0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-08 06:48:42 +00:00

Fix CSSDefinition Printer problems with important decorator.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang 2009-02-07 02:57:36 -05:00
parent db218c7b2b
commit 77f57aa264
5 changed files with 12 additions and 4 deletions

1
NEWS
View File

@ -22,6 +22,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
- Fix degenerate case with YouTube filter involving double hyphens. - Fix degenerate case with YouTube filter involving double hyphens.
Thanks Pierre Attar for reporting. Thanks Pierre Attar for reporting.
- Fix YouTube rendering problem on certain versions of Firefox. - Fix YouTube rendering problem on certain versions of Firefox.
- Fix CSSDefinition Printer problems with decorators
. Add verbose mode to command line test runner, use (--verbose) . Add verbose mode to command line test runner, use (--verbose)
. Turn on unit tests for UnitConverter . Turn on unit tests for UnitConverter
. Fix missing version number in configuration %Attr.DefaultImageAlt (added 3.2.0) . Fix missing version number in configuration %Attr.DefaultImageAlt (added 3.2.0)

View File

@ -5,7 +5,7 @@
*/ */
class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef
{ {
protected $def, $element; public $def, $element;
/** /**
* @param $def Definition to wrap * @param $def Definition to wrap

View File

@ -5,7 +5,7 @@
*/ */
class HTMLPurifier_AttrDef_CSS_ImportantDecorator extends HTMLPurifier_AttrDef class HTMLPurifier_AttrDef_CSS_ImportantDecorator extends HTMLPurifier_AttrDef
{ {
protected $def, $allow; public $def, $allow;
/** /**
* @param $def Definition to wrap * @param $def Definition to wrap

View File

@ -158,6 +158,14 @@ class HTMLPurifier_Printer
$class .= $this->getClass($obj->single, $sec_prefix) . ', '; $class .= $this->getClass($obj->single, $sec_prefix) . ', ';
$class .= $obj->max; $class .= $obj->max;
break; break;
case 'css_denyelementdecorator':
$class .= $this->getClass($obj->def, $sec_prefix) . ', ';
$class .= $obj->element;
break;
case 'css_importantdecorator':
$class .= $this->getClass($obj->def, $sec_prefix);
if ($obj->allow) $class .= ', !important';
break;
} }
$class .= ')'; $class .= ')';
return $class; return $class;

View File

@ -41,8 +41,7 @@ echo '<?xml version="1.0" encoding="UTF-8" ?>';
.HTMLPurifier_Printer td, .HTMLPurifier_Printer th {padding:3px; .HTMLPurifier_Printer td, .HTMLPurifier_Printer th {padding:3px;
border:1px solid #000;background:#CCC; vertical-align: baseline;} border:1px solid #000;background:#CCC; vertical-align: baseline;}
.HTMLPurifier_Printer th {text-align:left;background:#CCF;width:20%;} .HTMLPurifier_Printer th {text-align:left;background:#CCF;width:20%;}
.HTMLPurifier_Printer caption {font-size:1.5em; font-weight:bold; .HTMLPurifier_Printer caption {font-size:1.5em; font-weight:bold;}
width:100%;}
.HTMLPurifier_Printer .heavy {background:#99C;text-align:center;} .HTMLPurifier_Printer .heavy {background:#99C;text-align:center;}
.HTMLPurifier_Printer .unsafe {background:#C99;} .HTMLPurifier_Printer .unsafe {background:#C99;}
dt {font-weight:bold;} dt {font-weight:bold;}