Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/shadow-dom/link-style-change-href-assert.html |
| diff --git a/third_party/WebKit/LayoutTests/shadow-dom/link-style-change-href-assert.html b/third_party/WebKit/LayoutTests/shadow-dom/link-style-change-href-assert.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4f07c1ce6b588c18e9aaf5beedbd625c158928cb |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/shadow-dom/link-style-change-href-assert.html |
| @@ -0,0 +1,17 @@ |
| +<!DOCTYPE html> |
|
kochi
2016/11/04 03:12:51
Could you move this test to LayoutTests/shadow-dom
rune
2016/11/04 09:45:14
Done.
|
| +<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> |