Class HTMLPurifier_ChildDef_Chameleon

InheritanceHTMLPurifier_ChildDef_Chameleon » HTMLPurifier_ChildDef

Definition that uses different definitions depending on context.

The del and ins tags are notable because they allow different types of elements depending on whether or not they're in a block or inline context. Chameleon allows this behavior to happen by using two different definitions depending on context. While this somewhat generalized, it is specifically intended for those two tags.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$allow_empty Indicates whether or not an empty array of children is okay. HTMLPurifier_ChildDef
$block Instance of the definition object to use when block. HTMLPurifier_ChildDef_Chameleon
$elements Lookup array of all elements that this definition could possibly allow. HTMLPurifier_ChildDef
$inline Instance of the definition object to use when inline. Usually stricter. HTMLPurifier_ChildDef_Chameleon
$type HTMLPurifier_ChildDef_Chameleon

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() HTMLPurifier_ChildDef_Chameleon
getAllowedElements() Get lookup of tag names that should not close this element automatically. HTMLPurifier_ChildDef
validateChildren() HTMLPurifier_ChildDef_Chameleon

Property Details

$block public property
public $block null
$inline public property
public $inline null
$type public property
public $type 'chameleon'

Method Details

__construct() public method

public void __construct ( $inline, $block )
$inline array

List of elements to allow when inline.

$block array

List of elements to allow when block.

validateChildren() public method

public bool validateChildren ( $children, $config, $context )
$children HTMLPurifier_Node[]
$config HTMLPurifier_Config
$context HTMLPurifier_Context