\HTMLPurifier_ChildDef_Chameleon

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.

Summary

Methods
Properties
Constants
getAllowedElements()
validateChildren()
__construct()
$type
$allow_empty
$elements
$inline
$block
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$type

$type

Type of child definition, usually right-most part of class name lowercase.

$allow_empty

$allow_empty

Indicates whether or not an empty array of children is okay.

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

$elements

$elements

Lookup array of all elements that this definition could possibly allow.

$inline

$inline

Instance of the definition object to use when inline. Usually stricter.

$block

$block

Instance of the definition object to use when block.

Methods

getAllowedElements()

getAllowedElements(\HTMLPurifier_Config  $config) : array

Get lookup of tag names that should not close this element automatically.

All other elements will do so.

Parameters

\HTMLPurifier_Config $config

HTMLPurifier_Config object

Returns

array —

validateChildren()

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

Validates nodes according to definition and returns modification.

Parameters

\HTMLPurifier_Node[] $children
\HTMLPurifier_Config $config
\HTMLPurifier_Context $context

Returns

bool —

__construct()

__construct(array  $inline, array  $block) : mixed

Parameters

array $inline

List of elements to allow when inline.

array $block

List of elements to allow when block.

Returns

mixed —