Skip to content

Commit ede8539

Browse files
[css-pseudo-4] Add a note explaining Element.pseudo() behaviour #12159 (#12406)
As per resolution in #12159, Element.pseudo() returns CSSPseudoElement even when invoked on Element that can't generate the requested type.
1 parent ec8dc8b commit ede8539

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

css-pseudo-4/Overview.bs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,12 @@ Additions to the CSS Object Model</h2>
18291829
(The UA may drop or regenerate the object for convenience or performance
18301830
if this is not observable.)
18311831

1832+
Note: {{CSSPseudoElement}} is returned even when this method is invoked on elements
1833+
that can't have the requested pseudo type (e.g. ''::before'' on <{input}>).
1834+
See <a href="https://github.com/w3c/csswg-drafts/issues/12159#issuecomment-3005238286">resolution</a> for more details.
1835+
Discussion in <a href="https://github.com/w3c/csswg-drafts/issues/12158">Issue 12158</a> will clarify how to
1836+
determine that the requested pseudo doesn't really "exist".
1837+
18321838
ISSUE: The identity, lifetime, and nullness of the return value
18331839
(and potential error cases)
18341840
of the {{pseudo()}} method is still under discussion.

0 commit comments

Comments
 (0)