RemexHtml
Fast HTML 5 parser
Loading...
Searching...
No Matches
Wikimedia\RemexHtml\TreeBuilder\Element Class Reference

Storage for all the state that TreeBuilder needs to associate with each element. More...

+ Inheritance diagram for Wikimedia\RemexHtml\TreeBuilder\Element:

Public Member Functions

 __construct ( $namespace, $name, Attributes $attrs)
 Constructor.
 
bool isMathmlTextIntegration ()
 Is the element a MathML text integration point?
 
bool isHtmlIntegration ()
 Is the element an HTML integration point?
 
string getNoahKey ()
 Get a string key for the Noah's Ark algorithm.
 
string getDebugTag ()
 Get a string identifying the element, for use in debugging.
 

Public Attributes

string $namespace
 The namespace.
 
string $name
 The tag name, usually exactly as it appeared in the source document.
 
string $htmlName
 This is an internal designation of the type of the element, which is equal to the tag name when the element is in the HTML namespace, and is some other string when the element is not in the HTML namespace.
 
Attributes $attrs
 
bool $isVirtual
 This is true if the element was created by the TreeBuilder either as a fragment context node, or as a synthetic <html> element to be used as the top-level element in fragment parsing.
 
 $nextEltInScope
 Internal to CachingStack.
 
 $stackIndex
 Internal to CachingStack and SimpleStack.
 
 $prevAFE
 Internal to ActiveFormattingElements.
 
 $nextAFE
 Internal to ActiveFormattingElements.
 
 $nextNoah
 Internal to ActiveFormattingElements.
 
 $userData
 This member variable can be written to by the TreeHandler, to store any state associated with the element (such as a DOM node).
 
int $uid
 A unique ID which identifies the element.
 

Detailed Description

Storage for all the state that TreeBuilder needs to associate with each element.

These objects should be freed once they fall out of TreeBuilder's data structures (the stack etc.).

These objects are also used to communicate information about elements with downstream clients.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\RemexHtml\TreeBuilder\Element::__construct ( $namespace,
$name,
Attributes $attrs )

Constructor.

Parameters
string$namespace
string$name
Attributes$attrs

Member Function Documentation

◆ getDebugTag()

string Wikimedia\RemexHtml\TreeBuilder\Element::getDebugTag ( )

Get a string identifying the element, for use in debugging.

Returns
string

◆ getNoahKey()

string Wikimedia\RemexHtml\TreeBuilder\Element::getNoahKey ( )

Get a string key for the Noah's Ark algorithm.

Returns
string

◆ isHtmlIntegration()

bool Wikimedia\RemexHtml\TreeBuilder\Element::isHtmlIntegration ( )

Is the element an HTML integration point?

Returns
bool

◆ isMathmlTextIntegration()

bool Wikimedia\RemexHtml\TreeBuilder\Element::isMathmlTextIntegration ( )

Is the element a MathML text integration point?

Returns
bool

Member Data Documentation

◆ $name

string Wikimedia\RemexHtml\TreeBuilder\Element::$name

The tag name, usually exactly as it appeared in the source document.

This is not strictly a local name, since it still contains a colon for prefixed elements. In foreign content, it is effectively a local name. It is suitable for use as a serialized tag name.

◆ $namespace

string Wikimedia\RemexHtml\TreeBuilder\Element::$namespace

The namespace.

This will be the HTML namespace for elements that are not in foreign content, even if there is a prefix.

◆ $nextEltInScope

Wikimedia\RemexHtml\TreeBuilder\Element::$nextEltInScope

Internal to CachingStack.

A link in the scope list.

◆ $stackIndex

Wikimedia\RemexHtml\TreeBuilder\Element::$stackIndex

Internal to CachingStack and SimpleStack.

The current stack index, or null if the element is not in the stack.

◆ $userData

Wikimedia\RemexHtml\TreeBuilder\Element::$userData

This member variable can be written to by the TreeHandler, to store any state associated with the element (such as a DOM node).

It is not used by TreeBuilder.


The documentation for this class was generated from the following file: