Source for file CSSDefinition.php
Documentation is available at CSSDefinition.php
* Defines allowed CSS attributes and what their values are.
* @see HTMLPurifier_HTMLDefinition
* Assoc array of attribute name to definition object.
* Constructs the info array. The meat of this class.
protected function doSetup($config) {
array('left', 'right', 'center', 'justify'), false);
$this->info['border-bottom-style'] =
$this->info['border-right-style'] =
$this->info['border-left-style'] =
array('none', 'hidden', 'dotted', 'dashed', 'solid', 'double',
'groove', 'ridge', 'inset', 'outset'), false);
array('none', 'left', 'right', 'both'), false);
array('none', 'left', 'right'), false);
array('normal', 'italic', 'oblique'), false);
array('normal', 'small-caps'), false);
array('inside', 'outside'), false);
array('disc', 'circle', 'square', 'decimal', 'lower-roman',
'upper-roman', 'lower-alpha', 'upper-alpha', 'none'), false);
$this->info['list-style-image'] =
$uri_or_none;
array('capitalize', 'uppercase', 'lowercase', 'none'), false);
$this->info['background-image'] =
$uri_or_none;
array('repeat', 'repeat-x', 'repeat-y', 'no-repeat')
$this->info['border-top-color'] =
$this->info['border-bottom-color'] =
$this->info['border-left-color'] =
$this->info['border-right-color'] =
$this->info['border-top-width'] =
$this->info['border-bottom-width'] =
$this->info['border-left-width'] =
'small', 'medium', 'large', 'x-large', 'xx-large',
$this->info['margin-top'] =
$this->info['margin-bottom'] =
$this->info['margin-left'] =
$this->info['padding-top'] =
$this->info['padding-bottom'] =
$this->info['padding-left'] =
$max =
$config->get('CSS', 'MaxImgLength');
// this could use specialized code
array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300',
'400', '500', '600', '700', '800', '900'), false);
// MUST be called after other font properties, as it references
// a CSSDefinition object
$this->info['border-bottom'] =
$this->info['border-top'] =
$this->info['border-left'] =
'collapse', 'separate'));
'top', 'text-top', 'middle', 'bottom', 'text-bottom')),
if ($config->get('CSS', 'Proprietary')) {
if ($config->get('CSS', 'AllowTricky')) {
$allow_important =
$config->get('CSS', 'AllowImportant');
// wrap all attr-defs with decorator that handles !important
foreach ($this->info as $k =>
$v) {
// Internet Explorer only scrollbar colors
// technically not proprietary, but CSS3, and no one supports it
'inline', 'block', 'list-item', 'run-in', 'compact',
'marker', 'table', 'inline-table', 'table-row-group',
'table-header-group', 'table-footer-group', 'table-row',
'table-column-group', 'table-column', 'table-cell', 'table-caption', 'none'
'visible', 'hidden', 'collapse'
* Performs extra config-based processing. Based off of
* HTMLPurifier_HTMLDefinition.
* @todo Refactor duplicate elements into common class (probably using
* composition, not inheritance).
// setup allowed elements
$support =
"(for information on implementing this, see the ".
$allowed_attributes =
$config->get('CSS', 'AllowedProperties');
if ($allowed_attributes !==
null) {
foreach ($this->info as $name =>
$d) {
if(!isset
($allowed_attributes[$name])) unset
($this->info[$name]);
unset
($allowed_attributes[$name]);
foreach ($allowed_attributes as $name =>
$d) {
// :TODO: Is this htmlspecialchars() call really necessary?
trigger_error("Style attribute '$name' is not supported $support", E_USER_WARNING);
Documentation generated on Thu, 19 Jun 2008 18:49:00 -0400 by phpDocumentor 1.4.2