Skip to content

Proposal: Reflect whether an element is "open" (children being parsed) #12200

@noamr

Description

@noamr

What problem are you trying to solve?

With HTML streaming, and more so with the new streamHTML methods, authors sometimes need insight as to whether an element is currently being parsed (in the stack of open elements).

For example, operating on an incomplete subtree can create layout shifts or errors.

What solutions exist today?

  • Render blocking - only works once, on the page's initial load.
  • Complex CSS selectors (e.g. :has( + *) etc) can help in some cases but they are very clunky and require a lot of care.

How would you solve it?

A boolean on a ContainerNode - isParsingChildren (name bike-sheddable), similar to isConnected.
It returns true if the element is in the stack of open elements (or if the corresponding template is in the stack for ShadowRoot).

Also reflect this in CSS, with a :parsing-children pseudo-class or some such.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions