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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/crashes/link-style-change-href-assert.html

Issue 2472973002: Link stylesheets in shadow trees do not belong to document scope. (Closed)
Patch Set: Rebased Created 4 years, 1 month 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/shadow-dom/crashes/link-style-change-href-assert.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/crashes/link-style-change-href-assert.html b/third_party/WebKit/LayoutTests/shadow-dom/crashes/link-style-change-href-assert.html
new file mode 100644
index 0000000000000000000000000000000000000000..65ac1086e516294c1de8b134f44192be0846a1c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/shadow-dom/crashes/link-style-change-href-assert.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="host">This text should not be red and there should be no asserts.</div>
+<script>
+ var root = host.attachShadow({mode:'open'});
+ root.innerHTML = '<slot/><link rel="stylesheet" href="data:text/css,:host{color:red}">';
+
+ test(() => {
+ assert_equals(getComputedStyle(host).color, "rgb(255, 0, 0)", "Host color is red.");
+ }, "Check initial color from applied stylesheet.");
+
+ test(() => {
+ root.querySelector("link").setAttribute("href", "data:text/css,");
+ assert_equals(getComputedStyle(host).color, "rgb(0, 0, 0)", "Host color is black after href is changed.");
+ }, "Changing href on a link in shadow should not trigger an assert.");
+</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