Defines allowed CSS attributes and what their values are.
More...
|
| setup ($config) |
| Setup function that aborts if already setup. More...
|
|
Defines allowed CSS attributes and what their values are.
- See also
- HTMLPurifier_HTMLDefinition
Definition at line 7 of file CSSDefinition.php.
◆ doSetup()
HTMLPurifier_CSSDefinition::doSetup |
( |
|
$config | ) |
|
|
protected |
Constructs the info array.
The meat of this class.
- Parameters
-
Definition at line 22 of file CSSDefinition.php.
References $border_style, $config, array, doSetupProprietary(), doSetupTricky(), doSetupTrusted(), and setupConfigStuff().
25 array(
'left',
'right',
'center',
'justify'),
30 $this->info[
'border-bottom-style'] =
31 $this->info[
'border-right-style'] =
32 $this->info[
'border-left-style'] =
52 array(
'none',
'left',
'right',
'both'),
56 array(
'none',
'left',
'right'),
60 array(
'normal',
'italic',
'oblique'),
64 array(
'normal',
'small-caps'),
76 array(
'inside',
'outside'),
93 $this->info[
'list-style-image'] = $uri_or_none;
98 array(
'capitalize',
'uppercase',
'lowercase',
'none'),
103 $this->info[
'background-image'] = $uri_or_none;
105 array(
'repeat',
'repeat-x',
'repeat-y',
'no-repeat')
108 array(
'scroll',
'fixed')
113 $this->info[
'border-top-color'] =
114 $this->info[
'border-bottom-color'] =
115 $this->info[
'border-left-color'] =
116 $this->info[
'border-right-color'] =
129 $this->info[
'border-top-width'] =
130 $this->info[
'border-bottom-width'] =
131 $this->info[
'border-left-width'] =
185 $this->info[
'margin-top'] =
186 $this->info[
'margin-bottom'] =
187 $this->info[
'margin-left'] =
200 $this->info[
'padding-top'] =
201 $this->info[
'padding-bottom'] =
202 $this->info[
'padding-left'] =
226 $max =
$config->get(
'CSS.MaxImgLength');
228 $this->info[
'min-width'] =
229 $this->info[
'max-width'] =
230 $this->info[
'min-height'] =
231 $this->info[
'max-height'] =
232 $this->info[
'width'] =
233 $this->info[
'height'] =
278 $this->info[
'border'] =
279 $this->info[
'border-bottom'] =
280 $this->info[
'border-top'] =
281 $this->info[
'border-left'] =
285 array(
'collapse',
'separate')
289 array(
'top',
'bottom')
293 array(
'auto',
'fixed')
320 array(
'nowrap',
'normal',
'pre',
'pre-wrap',
'pre-line')
323 if (
$config->get(
'CSS.Proprietary')) {
327 if (
$config->get(
'CSS.AllowTricky')) {
331 if (
$config->get(
'CSS.Trusted')) {
335 $allow_important =
$config->get(
'CSS.AllowImportant');
337 foreach ($this->info as $k => $v) {
Decorator that, depending on a token, switches between two definitions.
Validates the value for the CSS property text-decoration.
Represents a Length as defined by CSS.
Validates shorthand CSS property background.
Validates a number as defined by the CSS spec.
Allows multiple validators to attempt to validate attribute.
Validates a Percentage as defined by the CSS spec.
setupConfigStuff($config)
Performs extra config-based processing.
Validates a font family list according to CSS spec.
Validates Color as defined by CSS.
Validates shorthand CSS property font.
Validates a URI in CSS syntax, which uses url('http://example.com')
Create styles array
The data for the language used.
Validates the border property as defined by CSS.
Validates the value of background-position.
Decorator which enables !important to be used in CSS values.
Validates a keyword against a list of valid values.
Framework class for strings that involve multiple values.
Validates shorthand CSS property list-style.
doSetupProprietary($config)
◆ doSetupProprietary()
HTMLPurifier_CSSDefinition::doSetupProprietary |
( |
|
$config | ) |
|
|
protected |
- Parameters
-
Definition at line 347 of file CSSDefinition.php.
References array.
Referenced by doSetup().
365 $this->info[
'page-break-after'] =
383 $this->info[
'border-top-left-radius'] =
384 $this->info[
'border-top-right-radius'] =
385 $this->info[
'border-bottom-right-radius'] =
Represents a Length as defined by CSS.
Allows multiple validators to attempt to validate attribute.
Validates a Percentage as defined by the CSS spec.
Microsoft's proprietary filter: CSS property.
Validates Color as defined by CSS.
Create styles array
The data for the language used.
Validates a keyword against a list of valid values.
Framework class for strings that involve multiple values.
◆ doSetupTricky()
HTMLPurifier_CSSDefinition::doSetupTricky |
( |
|
$config | ) |
|
|
protected |
- Parameters
-
Definition at line 395 of file CSSDefinition.php.
References array.
Referenced by doSetup().
409 'table-header-group',
410 'table-footer-group',
412 'table-column-group',
420 array(
'visible',
'hidden',
'collapse')
Create styles array
The data for the language used.
Validates a keyword against a list of valid values.
◆ doSetupTrusted()
HTMLPurifier_CSSDefinition::doSetupTrusted |
( |
|
$config | ) |
|
|
protected |
- Parameters
-
Definition at line 429 of file CSSDefinition.php.
References array.
Referenced by doSetup().
432 array(
'static',
'relative',
'absolute',
'fixed')
435 $this->info[
'left'] =
436 $this->info[
'right'] =
Represents a Length as defined by CSS.
Allows multiple validators to attempt to validate attribute.
Validates a Percentage as defined by the CSS spec.
Create styles array
The data for the language used.
Validates a keyword against a list of valid values.
◆ setupConfigStuff()
HTMLPurifier_CSSDefinition::setupConfigStuff |
( |
|
$config | ) |
|
|
protected |
Performs extra config-based processing.
Based off of HTMLPurifier_HTMLDefinition.
- Parameters
-
- Todo:
- Refactor duplicate elements into common class (probably using composition, not inheritance).
Definition at line 459 of file CSSDefinition.php.
References $config, $d, and $name.
Referenced by doSetup().
462 $support =
"(for information on implementing this, see the " .
464 $allowed_properties =
$config->get(
'CSS.AllowedProperties');
465 if ($allowed_properties !== null) {
466 foreach ($this->info as
$name =>
$d) {
467 if (!isset($allowed_properties[
$name])) {
468 unset($this->info[$name]);
470 unset($allowed_properties[$name]);
473 foreach ($allowed_properties as
$name =>
$d) {
476 trigger_error(
"Style attribute '$name' is not supported $support", E_USER_WARNING);
480 $forbidden_properties =
$config->get(
'CSS.ForbiddenProperties');
481 if ($forbidden_properties !== null) {
482 foreach ($this->info as
$name =>
$d) {
483 if (isset($forbidden_properties[
$name])) {
484 unset($this->info[$name]);
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
◆ $info
HTMLPurifier_CSSDefinition::$info = array() |
◆ $type
HTMLPurifier_CSSDefinition::$type = 'CSS' |
The documentation for this class was generated from the following file: