API / Minn\Html\Tree / Formatting

Formatting final class

Minn\Html\Tree\Formatting · public/minn/src/Minn/Html/Tree/Formatting.php · 89 lines

The list of active formatting elements, with its markers (null): the formatting elements opened since the last marker that may need reopening, three of a kind at most (the "Noah's Ark" clause).

Used by 1

Constants and properties

privatearray $entries

Public

methodpush(Minn\Html\Tree\Node $node): void#

Adds a formatting element, dropping the earliest of three identical ones since the last marker.

methodinsertMarker(): void#

Adds a marker (a cell, caption, template, applet, marquee or object opened).

methodclearToLastMarker(): void#

Drops entries back to and including the last marker.

methodremove(Minn\Html\Tree\Node $node): void#

Drops one element from the list.

methodcontains(Minn\Html\Tree\Node $node): bool#

Whether this very element is in the list.

methodlastNamed(string $name): ?Minn\Html\Tree\Node#

The last HTML element of the name since the last marker.

methodneedsReconstruction(Minn\Html\Tree\OpenElements $stack): bool#

Whether reopening would be needed: the last entry is an element no longer open.

methodnames(): array#

The entries' names, markers left out.

@return list<string>

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatesameAttributes(Minn\Html\Tree\Node $a, Minn\Html\Tree\Node $b): bool#