mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 14:16:32 +02:00
[3.1.0] Add support for !important, with %CSS.AllowImportant
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1578 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -3,9 +3,12 @@
|
||||
class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
|
||||
{
|
||||
|
||||
function test() {
|
||||
|
||||
function setup() {
|
||||
parent::setup();
|
||||
$this->def = new HTMLPurifier_AttrDef_CSS();
|
||||
}
|
||||
|
||||
function test() {
|
||||
|
||||
// regular cases, singular
|
||||
$this->assertDef('text-align:right;');
|
||||
@@ -107,11 +110,13 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
|
||||
// case-insensitivity
|
||||
$this->assertDef('FLOAT:LEFT;', 'float:left;');
|
||||
|
||||
// !important stripping
|
||||
$this->assertDef('float:left !important;', 'float:left;');
|
||||
|
||||
}
|
||||
|
||||
function testProprietary() {
|
||||
$this->config->set('CSS', 'Proprietary', true);
|
||||
$this->def = new HTMLPurifier_AttrDef_CSS();
|
||||
|
||||
$this->assertDef('scrollbar-arrow-color:#ff0;');
|
||||
$this->assertDef('scrollbar-base-color:#ff6347;');
|
||||
@@ -127,5 +132,10 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
|
||||
|
||||
}
|
||||
|
||||
function testImportant() {
|
||||
$this->config->set('CSS', 'AllowImportant', true);
|
||||
$this->assertDef('float:left !important;');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user