Skip to content

Commit 4e8f099

Browse files
committed
[cssom] Let getComputedStyle return an empty style for invalid pseudo-elements, and the element's style if the string doesn't begin with a colon.
Fixes w3c#6501. Tests in web-platform-tests/wpt#30140.
1 parent 7702ece commit 4e8f099

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cssom-1/Overview.bs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,10 +2986,10 @@ steps:
29862986
<ol>
29872987
<li>Let <var>doc</var> be <var>elt</var>'s <a>node document</a>.
29882988
<li>Let <var>obj</var> be <var>elt</var>.
2989-
<li>If <var>pseudoElt</var> is provided, and it's not the empty string, then:
2989+
<li>If <var>pseudoElt</var> is provided, is not the empty string, and starts with a colon, then:
29902990
<ol>
29912991
<li>[=CSS/Parse=] <var>pseudoElt</var> as a <<pseudo-element-selector>>, and let <var>type</var> be the result.
2992-
<li>If <var>type</var> is failure, or is an ''::slotted()'' or ''::part()'' pseudo-element, <a>throw</a> a {{TypeError}} exception.
2992+
<li>If <var>type</var> is failure, or is an ''::slotted()'' or ''::part()'' pseudo-element, let <var>obj</var> be null.
29932993
<li>Otherwise let <var>obj</var> be the given pseudo-element of <var>elt</var>.
29942994
</ol>
29952995

@@ -2998,7 +2998,8 @@ steps:
29982998
match above.
29992999

30003000
<li>Let <var>decls</var> be an empty list of <a>CSS declarations</a>.
3001-
<li>If <var>elt</var> is <a>connected</a>, part of the <a>flat tree</a>,
3001+
<li>If <var>obj</var> is not null, and <var>elt</var> is <a>connected</a>,
3002+
part of the <a>flat tree</a>,
30023003
and its <a>shadow-including root</a> has a <a>browsing context</a> which either
30033004
doesn't have a <a>browsing context container</a>, or whose
30043005
<a>browsing context container</a> is <a>being rendered</a>,

0 commit comments

Comments
 (0)