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

Side by Side Diff: LayoutTests/fast/dom/custom/unresolved-pseudoclass.html

Issue 14846002: Implement the Custom Elements :unresolved pseudoclass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adds a test and fixes style sharing. Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 x-x {
4 color: rgb(0, 222, 0);
5 }
6
7 [is=x-y]:not(:unresolved) {
8 color: rgb(0, 111, 0);
9 }
10
11 :unresolved {
12 color: rgb(0, 0, 222);
13 }
14
15 [is=x-y]:unresolved {
16 border-color: rgb(0, 0, 111);
17 }
18 </style>
19 <script src="../../js/resources/js-test-pre.js"></script>
20 <div id="container"></div>
21 <x-x id="a"></x-x>
22 <span id="b" is="x-y"></span>
23 <script>
24 description('Tests the :unresolved pseudoclass.');
25
26 var a = document.querySelector('#a');
27 shouldBe('document.querySelector("x-x:unresolved")', 'a');
28 shouldBe('window.getComputedStyle(a).color', '"rgb(0, 0, 222)"');
29
30 var b = document.querySelector('#b');
31 shouldBe('window.getComputedStyle(b).color', '"rgb(0, 0, 222)"');
32 shouldBe('window.getComputedStyle(b).borderColor', '"rgb(0, 0, 111)"');
33
34 var X = document.webkitRegister('x-x', {prototype: Object.create(HTMLElement.pro totype)});
35 var c = new X();
36 document.body.insertBefore(c, b);
37 shouldBe('window.getComputedStyle(c).color', '"rgb(0, 222, 0)"');
38
39 var Y = document.webkitRegister('x-y', {prototype: Object.create(HTMLSpanElement .prototype)});
40 var d = new Y();
41 document.body.insertBefore(d, b);
42 shouldBe('window.getComputedStyle(d).color', '"rgb(0, 111, 0)"');
43
44 // FIXME: When upgrade is implemented check that a and b's styles have changed.
45
46 successfullyParsed = true;
47 </script>
48 <script src="../../js/resources/js-test-post.js"></script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698