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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/link-element.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: wip 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 </body>
7 <script>
8 function computedBackgroundColor(elem) {
9 return document.defaultView.getComputedStyle(elem, '').backgroundColor;
10 }
11
12 async_test((test) => {
13 let link = document.createElement('link');
14 link.setAttribute('rel', 'stylesheet');
15 link.setAttribute('href', 'resources/test.css');
16 link.addEventListener("load", (e) => {
17 test.step(() => {
18 assert_equals(computedBackgroundColor(host), 'rgba(0, 0, 0, 0)', 'A host i n a document tree should not be styled.');
kochi 2016/07/26 05:35:06 Having a :host rule in linked css and check if tha
hayato 2016/07/26 06:04:32 That sounds another concern. That should not be do
19 assert_equals(computedBackgroundColor(shadowChild), 'rgb(0, 0, 255)', 'An element in a shadow tree should be styled.');
20 test.done();
21 });
22 });
23 let sr = host.attachShadow({ mode: 'open' });
24 let shadowChild = document.createElement('div');
25 sr.appendChild(shadowChild);
26 sr.appendChild(link);
27 }, '<link rel=stylesheet> should load a stylesheet in a connected shadow tree.') ;
28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698