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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/link.html

Issue 2177163002: Allow <link rel=stylesheet> in a connected shadow tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <body>
5 <div id="host"></div>
6 <div id="bodyChild"></div>
7 </body>
8 <script>
9 function colorFor(elem) {
10 return document.defaultView.getComputedStyle(elem, '').color;
11 }
12
13 async_test((test) => {
14 let link = document.createElement('link');
15 link.setAttribute('rel', 'stylesheet');
16 link.setAttribute('href', 'data:text/css,div { color: green }');
17 link.addEventListener("load", (e) => {
18 test.step(() => {
kochi 2016/07/29 07:10:12 nit: instead of "(e) => { test.step(() => {... tes
hayato 2016/07/29 07:41:56 Done
19 assert_equals(colorFor(bodyChild), 'rgb(0, 0, 0)', 'An element in a docume nt tree should not be styled.');
20 assert_equals(colorFor(shadowChild), 'rgb(0, 128, 0)', 'An element in a sh adow tree should be styled.');
21 test.done();
22 });
23 });
24 let sr = host.attachShadow({ mode: 'open' });
25 let shadowChild = document.createElement('div');
26 sr.appendChild(shadowChild);
27 sr.appendChild(link);
28 }, '<link rel=stylesheet> should load a stylesheet in a connected shadow tree.') ;
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698