OpenElements final class
Minn\Html\Tree\OpenElements · public/minn/src/Minn/Html/Tree/OpenElements.php · 110 lines
The stack of open elements and the spec's scope tests over it: an element is in scope when it is reached walking down from the current node before any of the scope's boundary elements.
Constants and properties
| private | DEFAULT_SCOPE = array ( 'html' => array ( 0 => 'APPLET', 1 => 'CAPTION', 2 => 'HTML', 3 => 'TABLE', 4 => 'TD', 5 => 'TH', 6 => 'MARQUEE', 7 => 'OBJECT', 8 => 'TEMPLATE', ), 'math' => array ( 0 => 'MI', 1 => 'MO', 2 => 'MN', 3 => 'MS', 4 => 'MTEXT', 5 => 'ANNOTATION-XML', ), 'svg' => array ( 0 => 'FOREIGNOBJECT', 1 => 'DESC', 2 => 'TITLE', ), ) | |
| private | array $nodes |
Public
| method | push(Minn\Html\Tree\Node $node): void# | Puts a node on top. |
| method | pop(): ?Minn\Html\Tree\Node# | Takes the current node off, or null when the stack is empty. |
| method | current(): ?Minn\Html\Tree\Node# | The current (bottom-most open) node. |
| method | at(int $index): ?Minn\Html\Tree\Node# | The node at a position, 0 being the root. |
| method | count(): int# | How many nodes are open. |
| method | all(): array# | Every open node, root first. @return list<Node> |
| method | containsNode(Minn\Html\Tree\Node $node): bool# | Whether this very node is open. |
| method | hasHtml(string $name): bool# | Whether an HTML element of the name is open anywhere. |
| method | inScope(string ...$names): bool# | Whether one of the HTML elements is in the default scope. |
| method | inListItemScope(string $name): bool# | Whether the HTML element is in list item scope (the default plus OL and UL). |
| method | inButtonScope(string $name): bool# | Whether the HTML element is in button scope (the default plus BUTTON). |
| method | inTableScope(string ...$names): bool# | Whether one of the HTML elements is in table scope (HTML, TABLE and TEMPLATE bound it). |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | inSpecificScope(array $names, array $boundary): bool# |
|
Nothing matches.