TreeBuildingRules
in package
Handles special-case rules for the DOM tree builder.
Many tags have special rules that need to be accomodated on an individual basis. This class handles those rules.
See section 8.1.2.4 of the spec.
Tags
Table of Contents
Properties
- $tags : mixed
Methods
- evaluate() : DOMElement
- Evaluate the rule for the current tag name.
- hasRules() : mixed
- Returns true if the given tagname has special processing rules.
- closeIfCurrentMatches() : mixed
- handleDT() : mixed
- handleLI() : mixed
- handleRT() : mixed
Properties
$tags
protected
static mixed
$tags
= array('li' => 1, 'dd' => 1, 'dt' => 1, 'rt' => 1, 'rp' => 1, 'tr' => 1, 'th' => 1, 'td' => 1, 'thead' => 1, 'tfoot' => 1, 'tbody' => 1, 'table' => 1, 'optgroup' => 1, 'option' => 1)
Methods
evaluate()
Evaluate the rule for the current tag name.
public
evaluate(mixed $new, mixed $current) : DOMElement
This may modify the existing DOM.
Parameters
- $new : mixed
- $current : mixed
Return values
DOMElement —The new Current DOM element.
hasRules()
Returns true if the given tagname has special processing rules.
public
hasRules(mixed $tagname) : mixed
Parameters
- $tagname : mixed
closeIfCurrentMatches()
protected
closeIfCurrentMatches(mixed $ele, mixed $current, mixed $match) : mixed
Parameters
- $ele : mixed
- $current : mixed
- $match : mixed
handleDT()
protected
handleDT(mixed $ele, mixed $current) : mixed
Parameters
- $ele : mixed
- $current : mixed
handleLI()
protected
handleLI(mixed $ele, mixed $current) : mixed
Parameters
- $ele : mixed
- $current : mixed
handleRT()
protected
handleRT(mixed $ele, mixed $current) : mixed
Parameters
- $ele : mixed
- $current : mixed