Skip to content

[css-pseudo-4] Should parent and element attributes of CSSPseudoElement interface be nullable? #12115

Closed
@danielsakhapov

Description

@danielsakhapov

https://drafts.csswg.org/css-pseudo-4/#CSSPseudoElement-interface has

readonly attribute Element element;
readonly attribute (Element or CSSPseudoElement) parent;

but, given the outcome of #3607, and e.g.

fc = div.firstChild;
div.removeChild(fc);
fc.parentElement; <-- is null.

I would expect the following to return null:

.beforePseudo::before { content: "before"; }

before = target.pseudo("::before");
div.classList.remove("beforePseudo");
before.parent; <-- should be null, since the pseudo is now ~"detached from DOM"?

So, I guess that parent and element attributes of CSSPseudoElement interface should be nullable?

@emilio @fantasai ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions