1
0
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:
Edward Z. Yang
2008-02-25 21:58:17 +00:00
parent a2d044f58d
commit 30eb982961
9 changed files with 117 additions and 4 deletions

View File

@@ -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;');
}
}