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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/host-link-style.html

Issue 2554873002: Mark correct tree-scope dirty removing link in shadow. (Closed)
Patch Set: Rebased Created 4 years 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/ProcessingInstruction.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/host-link-style.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/host-link-style.html b/third_party/WebKit/LayoutTests/shadow-dom/host-link-style.html
index b9b171cddc536d2975c56653cf31892754d94ac9..137673c163bf2498e274af8562e6d571bc2834ed 100644
--- a/third_party/WebKit/LayoutTests/shadow-dom/host-link-style.html
+++ b/third_party/WebKit/LayoutTests/shadow-dom/host-link-style.html
@@ -1,11 +1,20 @@
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
-<div id="host">This text should have a green background.</div>
+<div id="host1">This text should have a green background.</div>
+<div id="host2">This text should not have a red background.</div>
<script>
test(() => {
- var root = host.attachShadow({mode:'open'});
+ var root = host1.attachShadow({mode:'open'});
root.innerHTML = '<link rel="stylesheet" href="data:text/css,:host{background:green}"><slot />';
- assert_equals(getComputedStyle(host).backgroundColor, "rgb(0, 128, 0)", "Host background should be green.");
+ assert_equals(getComputedStyle(host1).backgroundColor, "rgb(0, 128, 0)", "Host background should be green.");
}, "Check that :host rule from link stylesheet applies to host element.");
+
+ test(() => {
+ var root = host2.attachShadow({mode:'open'});
+ root.innerHTML = '<link rel="stylesheet" href="data:text/css,:host{background:red}"><slot />';
+ assert_equals(getComputedStyle(host2).backgroundColor, "rgb(255, 0, 0)", "Host background should be red.");
+ root.querySelector("link").remove();
+ assert_equals(getComputedStyle(host2).backgroundColor, "rgba(0, 0, 0, 0)", "Host background should be transparent.");
+ }, "Check that :host rule from link stylesheet no longer applies after the sheet is removed.");
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698