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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/boundary-crossing-scopes-null-resolver-crash.html

Issue 2450353002: Clear m_treeBoundaryCrossingScopes when reconstructing StyleResolver. (Closed)
Patch Set: Created 4 years, 2 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 | third_party/WebKit/Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/boundary-crossing-scopes-null-resolver-crash.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/boundary-crossing-scopes-null-resolver-crash.html b/third_party/WebKit/LayoutTests/fast/css/boundary-crossing-scopes-null-resolver-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..721a35c92e1357b2e45c32a873553d70e2880c05
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/boundary-crossing-scopes-null-resolver-crash.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>.green { color: green }</style>
+<div id="host">
+ <div id="inner">Green, should not crash.</div>
+</div>
+<script>
+ var root = host.createShadowRoot();
+
+ test(() => {
+ root.innerHTML = "<style>:host ::content * { color:red }</style><content>";
+ document.body.offsetTop;
+ assert_equals(getComputedStyle(inner).color, "rgb(255, 0, 0)", "#inner is initially red.");
+ }, "Check that #inner is initially red.");
+
+ test(() => {
+ // Inserting a document stylesheet before another one causes a
+ // StyleResolver Reconstruct.
+ var newSheet = document.createElement("style");
+ newSheet.innerText = "#nomatch { color: red }";
+ document.head.insertBefore(newSheet, document.querySelector("style"));
+ // Removing the shadow stylesheet will cause the ScopedStyleResolver
+ // to be nuked.
+ root.innerHTML = "<content>";
+ inner.className = "green";
+ assert_equals(getComputedStyle(inner).color, "rgb(0, 128, 0)", "Check that #inner is green after the class is set.");
+ }, "Reconstructing StyleResolver should not leave any treeBoundaryCrossingScopes with null ScopedStyleResolvers in StyleEngine.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698