RemexHtml
Fast HTML 5 parser
|
An implementation of the "stack of open elements" which, unlike CachingStack, iterates through the stack in order to answer queries about which elements are in scope. More...
Public Member Functions | |
push (Element $elt) | |
Push an element. | |
pop () | |
Pop an element from the stack. | |
replace (Element $oldElt, Element $elt) | |
Replace an element which is on the stack with another element of the same type (i.e. | |
remove (Element $elt) | |
Remove an element, potentially from the middle of the stack. | |
isInScope ( $name) | |
Is there an element in (default) scope which is in the HTML namespace and has the given tag name? | |
isElementInScope (Element $elt) | |
Is the given element in (default) scope? | |
isOneOfSetInScope ( $names) | |
Is there any element in the (default) scope which is in the HTML namespace and has one of the given tag names? | |
isInListScope ( $name) | |
Is there an element in list scope which is an HTML element with the given name? | |
isInButtonScope ( $name) | |
Is there an element in button scope which is an HTML element with the given name? | |
isInTableScope ( $name) | |
Is there an element in table scope which is an HTML element with the given name? | |
isInSelectScope ( $name) | |
Is there an element in select scope which is an HTML element with the given name? | |
item ( $idx) | |
Get an element from the stack, where 0 is the first element inserted, and $this->length() - 1 is the most recently inserted element. | |
length () | |
Get the number of elements in the stack. | |
hasTemplate () | |
Is there a template element in the stack of open elements? | |
Public Member Functions inherited from Wikimedia\RemexHtml\TreeBuilder\Stack | |
string | dump () |
Get a string representation of the stack for debugging purposes. | |
Additional Inherited Members | |
Public Attributes inherited from Wikimedia\RemexHtml\TreeBuilder\Stack | |
$current | |
An implementation of the "stack of open elements" which, unlike CachingStack, iterates through the stack in order to answer queries about which elements are in scope.
This is presumably faster for best case input.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::hasTemplate | ( | ) |
Is there a template element in the stack of open elements?
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::isElementInScope | ( | Element | $elt | ) |
Is the given element in (default) scope?
Element | $elt |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::isInButtonScope | ( | $name | ) |
Is there an element in button scope which is an HTML element with the given name?
string | $name |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::isInListScope | ( | $name | ) |
Is there an element in list scope which is an HTML element with the given name?
string | $name |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::isInScope | ( | $name | ) |
Is there an element in (default) scope which is in the HTML namespace and has the given tag name?
string | $name |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::isInSelectScope | ( | $name | ) |
Is there an element in select scope which is an HTML element with the given name?
string | $name |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::isInTableScope | ( | $name | ) |
Is there an element in table scope which is an HTML element with the given name?
string | $name |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::isOneOfSetInScope | ( | $names | ) |
Is there any element in the (default) scope which is in the HTML namespace and has one of the given tag names?
array<string,mixed> | $names An array with the tag names in the keys, the value arbitrary |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::item | ( | $idx | ) |
Get an element from the stack, where 0 is the first element inserted, and $this->length() - 1 is the most recently inserted element.
This will raise a PHP notice if the index is out of range.
int | $idx |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::length | ( | ) |
Get the number of elements in the stack.
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::pop | ( | ) |
Pop an element from the stack.
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::push | ( | Element | $elt | ) |
Wikimedia\RemexHtml\TreeBuilder\SimpleStack::remove | ( | Element | $elt | ) |
Remove an element, potentially from the middle of the stack.
Element | $elt |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.
Replace an element which is on the stack with another element of the same type (i.e.
with the same tag name).
Element | $old | The element to be removed |
Element | $new | The element to be inserted |
Reimplemented from Wikimedia\RemexHtml\TreeBuilder\Stack.