You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Match :last-child, :nth-last-child(), :only-child, :empty and the other pseudo-classes that need to see what follows #537
:last-child, :nth-last-child(), :only-child, :last-of-type, :only-of-type and :empty depend on what follows the element. A stream does not know that when the element opens.
Design.WriteHTML() already holds all of its tag and text pieces. One pass over them, before parsing, can record each element's parent, sibling count and whether it is empty, for the stack frames from #533 to read. Content split across separate WriteHTML() calls, headers and footers fall back to no match.
:has() comes last, if at all: it needs a look ahead over an arbitrary subtree.
Tests. Each pseudo-class matched and not matched; a list whose last item is followed by whitespace and a comment; an element closed in a later WriteHTML() call falls back to no match.
Activity
jakejackson1 commentedon Sep 30, 2026
Done in #634.