1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

Implement all composite CSS definitions.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@271 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-16 00:18:58 +00:00
parent 490fc003c8
commit 1388beb456
3 changed files with 57 additions and 5 deletions

View File

@@ -86,7 +86,41 @@ class HTMLPurifier_CSSDefinition
new HTMLPurifier_AttrDef_CSSLength()
));
$this->info['line-height'] = new HTMLPurifier_AttrDef_Composite(array(
new HTMLPurifier_AttrDef_Enum(array('normal')),
new HTMLPurifier_AttrDef_Number(true), // no negatives
new HTMLPurifier_AttrDef_CSSLength(true),
new HTMLPurifier_AttrDef_Percentage(true)
));
$this->info['margin-top'] =
$this->info['margin-bottom'] =
$this->info['margin-left'] =
$this->info['margin-right'] = new HTMLPurifier_AttrDef_Composite(array(
new HTMLPurifier_AttrDef_CSSLength(),
new HTMLPurifier_AttrDef_Percentage(),
new HTMLPurifier_AttrDef_Enum(array('auto'))
));
// non-negative
$this->info['padding-top'] =
$this->info['padding-bottom'] =
$this->info['padding-left'] =
$this->info['padding-right'] = new HTMLPurifier_AttrDef_Composite(array(
new HTMLPurifier_AttrDef_CSSLength(true),
new HTMLPurifier_AttrDef_Percentage(true)
));
$this->info['text-indent'] = new HTMLPurifier_AttrDef_Composite(array(
new HTMLPurifier_AttrDef_CSSLength(),
new HTMLPurifier_AttrDef_Percentage()
));
$this->info['width'] = new HTMLPurifier_AttrDef_Composite(array(
new HTMLPurifier_AttrDef_CSSLength(true),
new HTMLPurifier_AttrDef_Percentage(true),
new HTMLPurifier_AttrDef_Enum(array('auto'))
));
// this could use specialized code
$this->info['font-weight'] = new HTMLPurifier_AttrDef_Enum(