mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 08:21:52 +00:00
Add relative length units from CSS 3
cf. https://www.w3schools.com/cssref/css_units.asp
This commit is contained in:
parent
df64746caa
commit
67c3798922
@ -26,12 +26,14 @@ class HTMLPurifier_Length
|
||||
protected $isValid;
|
||||
|
||||
/**
|
||||
* Array Lookup array of units recognized by CSS 2.1
|
||||
* Array Lookup array of units recognized by CSS 3
|
||||
* @type array
|
||||
*/
|
||||
protected static $allowedUnits = array(
|
||||
'em' => true, 'ex' => true, 'px' => true, 'in' => true,
|
||||
'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true
|
||||
'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true,
|
||||
'ch' => true, 'rem' => true, 'vw' => true, 'vh' => true,
|
||||
'vmin' => true, 'vmax' => true
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -66,6 +66,10 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
|
||||
$this->assertDef('min-width:50px;');
|
||||
$this->assertDef('min-width:auto;');
|
||||
$this->assertDef('min-width:-50px;', false);
|
||||
$this->assertDef('min-width:50ch;');
|
||||
$this->assertDef('min-width:50rem;');
|
||||
$this->assertDef('min-width:50vw;');
|
||||
$this->assertDef('min-width:-50vw;', false);
|
||||
$this->assertDef('text-decoration:underline;');
|
||||
$this->assertDef('font-family:sans-serif;');
|
||||
$this->assertDef("font-family:Gill, 'Times New Roman', sans-serif;");
|
||||
|
Loading…
Reference in New Issue
Block a user