Node final class
Minn\Html\Tree\Node · public/minn/src/Minn/Html/Tree/Node.php · 109 lines
A node the tree builder places: an element (named as the HTML API reports it, upper-cased, with its namespace) or a text, comment, doctype or other leaf. Real when a token in the document made it (its offset is where that token starts), virtual when the parser implied it.
Constants and properties
| const | VOID = array ( 0 => 'AREA', 1 => 'BASE', 2 => 'BASEFONT', 3 => 'BGSOUND', 4 => 'BR', 5 => 'COL', 6 => 'EMBED', 7 => 'FRAME', 8 => 'HR', 9 => 'IMG', 10 => 'INPUT', 11 => 'KEYGEN', 12 => 'LINK', 13 => 'META', 14 => 'PARAM', 15 => 'SOURCE', 16 => 'TRACK', 17 => 'WBR', ) | |
| const | ATOMIC = array ( 0 => 'SCRIPT', 1 => 'STYLE', 2 => 'TEXTAREA', 3 => 'TITLE', 4 => 'XMP', 5 => 'IFRAME', 6 => 'NOEMBED', 7 => 'NOFRAMES', ) | Elements whose body the tokenizer reads whole, so they never take a closer. |
| private | bool $selfClosing | |
| private | array $attributes | |
| private | string $text | |
| prop | readonly string $type | Promoted from the constructor. |
| prop | readonly string $name | Promoted from the constructor. |
| prop | readonly string $namespace | Promoted from the constructor. |
| prop | readonly ?int $offset | Promoted from the constructor. |
Public
| new | __construct(string $type, string $name, string $namespace, ?int $offset)# | ||||
| static | element(string $name, string $namespace, ?int $offset, array $attributes = array ( )): self# | An element; the attributes kept are the ones the builder compares.
| |||
| static | leaf(string $type, string $name, string $namespace, ?int $offset, string $text): self# | A leaf: text, a comment, a doctype, a CDATA section, a processing instruction. | |||
| method | selfClosed(): self# | The same element, marked as written with "/>". | |||
| method | isSelfClosing(): bool# | Whether the element was written with "/>". | |||
| method | text(): string# | A leaf's text. | |||
| method | attributes(): array# | The attributes kept for comparison. @return array<string, string|true> | |||
| method | isHtml(string ...$names): bool# | Whether this is an HTML element with one of the names. | |||
| method | isIn(string $namespace, string ...$names): bool# | Whether this is an element of the namespace with one of the names. | |||
| method | expectsCloser(): bool# | Whether the element is closed by a closer of its own: not a leaf, not void, not read whole, not self-closed foreign content. | |||
| method | isHtmlIntegrationPoint(): bool# | Whether this element is an HTML integration point (SVG foreignObject, desc, title; MathML annotation-xml for HTML). | |||
| method | isMathTextIntegrationPoint(): bool# | Whether this element is a MathML text integration point. |
Nothing matches.