Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: LayoutTests/fast/css/invalidation/shadow-add-sheet-content.html

Issue 1313443003: Fix crash when removing stylesheets from shadow tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed review issues and added test. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/shadow-add-sheet-content-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/shadow-add-sheet-content.html
diff --git a/LayoutTests/fast/css/invalidation/shadow-add-sheet-content.html b/LayoutTests/fast/css/invalidation/shadow-add-sheet-content.html
new file mode 100644
index 0000000000000000000000000000000000000000..a1bf5539172b50ad5f808779ff9a3c89b17109ea
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/shadow-add-sheet-content.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+ #outerHost { color: red }
+</style>
+<div>
+ <div id="outerHost">
+ <span id="outerSpan"></span>
+ </div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<script>
+ description("Insert a style element into a shadow tree affecting a distributed node.");
+
+ var outerRoot = outerHost.createShadowRoot();
+ outerRoot.innerHTML = "<div id='host1'><content/></div>";
+
+ var host1 = outerRoot.querySelector("#host1");
+ var root1 = host1.createShadowRoot();
+ root1.innerHTML = "<div id='host2'><content/></div>";
+
+ var host2 = root1.querySelector("#host2");
+ var root2 = host2.createShadowRoot();
+ root2.innerHTML = "<content/>";
+
+ shouldBeEqualToString("getComputedStyle(outerSpan).color", "rgb(255, 0, 0)");
+
+ var sheet = document.createElement("style");
+ sheet.appendChild(document.createTextNode("::content #outerSpan { color: green }"));
+ root2.appendChild(sheet);
+
+ if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "9");
+
+ shouldBeEqualToString("getComputedStyle(outerSpan).color", "rgb(0, 128, 0)");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/shadow-add-sheet-content-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698