1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 22:26:31 +02:00

De-singleton-ized (HTML|CSS)Definition, tying them to the configuration and making them more amenable to changes.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@350 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-31 20:33:07 +00:00
parent 90279eaee2
commit 14aeafcf22
17 changed files with 88 additions and 110 deletions

View File

@@ -13,8 +13,8 @@ class HTMLPurifier_AttrDef_Border extends HTMLPurifier_AttrDef
*/
var $info = array();
function HTMLPurifier_AttrDef_Border() {
$def = HTMLPurifier_CSSDefinition::instance();
function HTMLPurifier_AttrDef_Border($config) {
$def = $config->getCSSDefinition();
$this->info['border-width'] = $def->info['border-width'];
$this->info['border-style'] = $def->info['border-style'];
$this->info['border-top-color'] = $def->info['border-top-color'];

View File

@@ -16,7 +16,7 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
$css = $this->parseCDATA($css);
$definition = HTMLPurifier_CSSDefinition::instance();
$definition = $config->getCSSDefinition();
// we're going to break the spec and explode by semicolons.
// This is because semicolon rarely appears in escaped form

View File

@@ -30,8 +30,8 @@ class HTMLPurifier_AttrDef_Font extends HTMLPurifier_AttrDef
'status-bar' => true
);
function HTMLPurifier_AttrDef_Font() {
$def = HTMLPurifier_CSSDefinition::instance();
function HTMLPurifier_AttrDef_Font($config) {
$def = $config->getCSSDefinition();
$this->info['font-style'] = $def->info['font-style'];
$this->info['font-variant'] = $def->info['font-variant'];
$this->info['font-weight'] = $def->info['font-weight'];

View File

@@ -16,8 +16,8 @@ class HTMLPurifier_AttrDef_ListStyle extends HTMLPurifier_AttrDef
*/
var $info;
function HTMLPurifier_AttrDef_ListStyle() {
$def = HTMLPurifier_CSSDefinition::instance();
function HTMLPurifier_AttrDef_ListStyle($config) {
$def = $config->getCSSDefinition();
$this->info['list-style-type'] = $def->info['list-style-type'];
$this->info['list-style-position'] = $def->info['list-style-position'];
}