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

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: split tests 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", test.step_func_done(() => {
18 assert_equals(colorFor(bodyChild), 'rgb(0, 0, 0)', 'An element in a docume nt tree should not be styled.');
19 assert_equals(colorFor(shadowChild), 'rgb(0, 128, 0)', 'An element in a sh adow tree should be styled.');
20 }));
21 let sr = host.attachShadow({ mode: 'open' });
22 let shadowChild = document.createElement('div');
23 sr.appendChild(shadowChild);
24 sr.appendChild(link);
25 }, '<link rel=stylesheet> should load a stylesheet in a connected shadow tree.') ;
26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698