mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +02:00
feat: Add support for CSS aspect-ratio (#408)
This commit is contained in:
24
tests/HTMLPurifier/AttrDef/CSS/RatioTest.php
Normal file
24
tests/HTMLPurifier/AttrDef/CSS/RatioTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
class HTMLPurifier_AttrDef_CSS_RatioTest extends HTMLPurifier_AttrDefHarness
|
||||
{
|
||||
|
||||
public function test()
|
||||
{
|
||||
$this->def = new HTMLPurifier_AttrDef_CSS_Ratio();
|
||||
|
||||
$this->assertDef('1/2');
|
||||
$this->assertDef('1 / 2', '1/2');
|
||||
$this->assertDef('1');
|
||||
$this->assertDef('1/0');
|
||||
$this->assertDef('0/1');
|
||||
|
||||
$this->assertDef('1/2/3', false);
|
||||
$this->assertDef('/2/3', false);
|
||||
$this->assertDef('/12', false);
|
||||
$this->assertDef('1/', false);
|
||||
$this->assertDef('asdf', false);
|
||||
}
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
@@ -72,6 +72,10 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
|
||||
$this->assertDef('min-width:50rem;');
|
||||
$this->assertDef('min-width:50vw;');
|
||||
$this->assertDef('min-width:-50vw;', false);
|
||||
$this->assertDef('aspect-ratio:16/9;');
|
||||
$this->assertDef('aspect-ratio:auto;');
|
||||
$this->assertDef('aspect-ratio:16/9 auto;');
|
||||
$this->assertDef('aspect-ratio:auto 16/9;');
|
||||
$this->assertDef('text-decoration:underline;');
|
||||
$this->assertDef('text-decoration-line:overline;');
|
||||
$this->assertDef('text-decoration-style:dashed;');
|
||||
|
Reference in New Issue
Block a user