Skip to content

Commit

Permalink
Bug 1490791 - Make ShadowRoot stylesheet list work only when the shad…
Browse files Browse the repository at this point in the history
…ow root is connected. r=smaug

This avoids the issue of triggering stylesheet loads for disconnected stuff and
such, and is more consistent with Chrome and WebKit.

This is per the recent CSSWG resolution at
w3c/csswg-drafts#3096.

Differential Revision: https://phabricator.services.mozilla.com/D5699

UltraBlame original commit: 71f86120ca35d113a2462b2ffe68bc5accc813e4
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent a6a5ddf commit 82da233
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 103 deletions.
16 changes: 1 addition & 15 deletions dom/base/nsStyleLinkElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,21 +1321,7 @@ doc
thisContent
-
>
IsInShadowTree
(
)
?
thisContent
-
>
OwnerDoc
(
)
:
thisContent
-
>
GetUncomposedDoc
GetComposedDoc
(
)
;
Expand Down
61 changes: 34 additions & 27 deletions testing/web-platform/tests/shadow-dom/ShadowRoot-interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -1224,33 +1224,6 @@
}
)
;
assert_equals
(
shadowRoot
.
styleSheets
.
length
0
'
shadowRoot
.
styleSheets
must
be
empty
when
the
shadow
root
does
not
contain
any
stylesheets
'
)
;
shadowRoot
.
innerHTML
Expand Down Expand Up @@ -1296,6 +1269,40 @@
styleSheets
.
length
0
'
shadowRoot
.
styleSheets
must
be
empty
when
the
shadow
root
is
not
connected
'
)
;
document
.
body
.
appendChild
(
host
)
;
assert_equals
(
shadowRoot
.
styleSheets
.
length
2
'
shadowRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,46 +410,6 @@
'
)
;
/
/
TODO
Now
this
tests
produces
an
error
on
Chromium
because
styleSheets
.
length
/
/
returns
0
when
the
shadow
root
is
orphaned
.
/
/
Tracking
bug
:
http
:
/
/
crbug
.
com
/
392771
test
(
unit
Expand Down Expand Up @@ -536,27 +496,6 @@
style
)
;
/
/
The
following
line
fixes
the
issue
on
Chromium
http
:
/
/
crbug
.
com
/
392771
/
/
d
.
body
Expand Down

0 comments on commit 82da233

Please sign in to comment.