Bug 1538323 [wpt PR 15958] - Only connected shadow roots can be active tree scopes., a=testonly
authorRune Lillesveen <futhark@chromium.org>
Mon, 15 Apr 2019 14:37:00 +0000
changeset 470773 c5a29660d8ae8637ba924cad76a6b611933980f1
parent 470772 8dd90cc8a39cc593f131423c34865795c3262f31
child 470774 564fa295d4c2928172361650365e08baf1caaf14
push id35911
push usercbrindusan@mozilla.com
push dateWed, 24 Apr 2019 21:55:25 +0000
treeherdermozilla-central@c7a9affeb604 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1538323, 15958, 942553, 1532104, 642746
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1538323 [wpt PR 15958] - Only connected shadow roots can be active tree scopes., a=testonly Automatic update from web-platform-tests Only connected shadow roots can be active tree scopes. Stylesheet collection will be ensured, active scope added, and active style will be marked dirty on ShadowRootInsertedIntoDocument(). Skip on adopted stylesheets changes. Added DCHECK to make sure we don't mark disconnected tree scopes dirty. Bug: 942553 Change-Id: I71b991dbeec540e69f85a1fef3961f3b9efaa1e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1532104 Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#642746} -- wpt-commits: 733791e7ce85c523a238ff4e7616821deb51466d wpt-pr: 15958
testing/web-platform/tests/css/cssom/CSSStyleSheet-constructable.html
--- a/testing/web-platform/tests/css/cssom/CSSStyleSheet-constructable.html
+++ b/testing/web-platform/tests/css/cssom/CSSStyleSheet-constructable.html
@@ -563,10 +563,16 @@ test(() => {
   document.body.appendChild(iframe);
   iframe.contentDocument.adoptNode(span);
   iframe.contentDocument.body.appendChild(span);
   assert_not_equals(span.shadowRoot, null);
   assert_equals(span.shadowRoot.adoptedStyleSheets.length, 0);
   assert_equals(getComputedStyle(shadowDiv).color, "rgb(0, 0, 0)");
 }, 'Adopting a shadow host will empty adoptedStyleSheets if adopting to a different document');
 
+test(() => {
+  const host = document.createElement("div");
+  const root = host.attachShadow({mode: "open"});
+  root.adoptedStyleSheets = [new CSSStyleSheet()];
+  document.body.offsetTop;
+}, 'Forcing a style update after adding an adopted stylesheet on a disconnected shadow root should not crash.');
+
 </script>
-