Skip to content

Commit 355cdea

Browse files
committed
[css-pseudo-4] Clarify return value of element.pseudo() - identity is stable per element/type pair, returns null for unknown types. w3c#3607 w3c#3603
1 parent 05f350f commit 355cdea

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

css-pseudo-4/Overview.bs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ Overlapping Pseudo-element Interactions</h2>
834834
Additions to the CSS Object Model</h2>
835835

836836
<h3 id="CSSPseudoElement-interface">
837-
Interface CSSPseudoElement</h3>
837+
{{CSSPseudoElement}} Interface</h3>
838838

839839
The {{CSSPseudoElement}} interface
840840
allows pseudo-elements to be event targets.
@@ -871,7 +871,7 @@ Interface CSSPseudoElement</h3>
871871
to that which is needed to support [[web-animations-1]].
872872

873873
<h3 id="window-interface">
874-
Addition to the {{Element}} interface</h3>
874+
{{pseudo()}} method of the {{Element}} interface</h3>
875875

876876
A new method is added to the {{Element}} interface to retrieve
877877
pseudo-elements created by a given element for a given type:
@@ -883,12 +883,14 @@ Addition to the {{Element}} interface</h3>
883883

884884
The <dfn method for=Element title="pseudo(type)" id="dom-element-pseudo">pseudo(CSSOMString type)</dfn> method
885885
is used to retrieve the {{CSSPseudoElement}} instance
886-
created by the element of the type matching {{type!!argument}}.
887-
Its return value is a {{CSSPseudoElement}},
888-
potentially null if no such pseudo-element exists.
889-
890-
Pseudo-elements of unsupported types are considered to simply not exist;
891-
unrecognized {{type!!argument}} values are not an error.
886+
of the type matching {{type!!argument}}
887+
associated with the element.
888+
Its return value on a given element
889+
for a given, supported {{CSSPseudoElement}} {{CSSPseudoElement/type}} is,
890+
insofar as observable, always the same {{CSSPseudoElement}} object.
891+
(The UA may drop or regenerate the object for convenience or performance
892+
if this is not observable.)
893+
For unrecognized types, the return value is null.
892894

893895
ISSUE: The identity, lifetime, and nullness of the return value
894896
(and potential error cases)
@@ -911,6 +913,7 @@ Changes</h2>
911913

912914
<ul>
913915
<li>Added ''::marker'' to types allowed for {{CSSPseudoElement}} interface.
916+
<li>Clarified return value of {{pseudo()}}.
914917
</ul>
915918

916919
Changes since the <a href="https://www.w3.org/TR/2016/WD-css-pseudo-4-20160607/">7 June 2016 Working Draft</a> include:

0 commit comments

Comments
 (0)