mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Allow autoplay attribute of <audio> and <video> tags #1187
This commit is contained in:
parent
553ae9ce98
commit
d8fa31722c
2 changed files with 5 additions and 3 deletions
|
|
@ -235,6 +235,7 @@ class HTMLFilter
|
|||
'preload' => 'Enum#auto,metadata,none',
|
||||
'controls' => 'Bool',
|
||||
'muted' => 'Bool',
|
||||
'autoplay' => 'Bool',
|
||||
'loop' => 'Bool',
|
||||
));
|
||||
$def->addElement('video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array(
|
||||
|
|
@ -246,6 +247,7 @@ class HTMLFilter
|
|||
'preload' => 'Enum#auto,metadata,none',
|
||||
'controls' => 'Bool',
|
||||
'muted' => 'Bool',
|
||||
'autoplay' => 'Bool',
|
||||
'loop' => 'Bool',
|
||||
));
|
||||
$def->addElement('source', 'Block', 'Empty', 'Common', array(
|
||||
|
|
|
|||
|
|
@ -69,11 +69,11 @@ class HTMLFilterTest extends \Codeception\TestCase\Test
|
|||
public function testHTMLFilterHTML5()
|
||||
{
|
||||
$source = '<div><audio autoplay="autoplay" src="./foo/bar.mp3"></audio></div>';
|
||||
$target = '<div><audio src="./foo/bar.mp3"></audio></div>';
|
||||
$target = '<div><audio autoplay="" src="./foo/bar.mp3"></audio></div>';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source));
|
||||
|
||||
$source = '<video autoplay="autoplay" width="320" height="240"><source src="./foo/bar.mp4" type="video/mp4" /></video>';
|
||||
$target = '<video width="320" height="240"><source src="./foo/bar.mp4" type="video/mp4" /></video>';
|
||||
$source = '<video autoplay width="320" height="240"><source src="./foo/bar.mp4" type="video/mp4" /></video>';
|
||||
$target = '<video autoplay="" width="320" height="240"><source src="./foo/bar.mp4" type="video/mp4" /></video>';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source));
|
||||
|
||||
$source = '<nav>123</nav><section>456</section><article>789</article><aside>0</aside>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue