OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 x-x { | 3 x-x { |
4 color: rgb(0, 222, 0); | 4 color: rgb(0, 222, 0); |
5 } | 5 } |
6 | 6 |
7 [is=x-y]:not(:unresolved) { | 7 [is=x-y]:not(:unresolved) { |
8 color: rgb(0, 111, 0); | 8 color: rgb(0, 111, 0); |
9 } | 9 } |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 description('Tests the :unresolved pseudoclass.'); | 24 description('Tests the :unresolved pseudoclass.'); |
25 | 25 |
26 var a = document.querySelector('#a'); | 26 var a = document.querySelector('#a'); |
27 shouldBe('document.querySelector("x-x:unresolved")', 'a'); | 27 shouldBe('document.querySelector("x-x:unresolved")', 'a'); |
28 shouldBe('window.getComputedStyle(a).color', '"rgb(0, 0, 222)"'); | 28 shouldBe('window.getComputedStyle(a).color', '"rgb(0, 0, 222)"'); |
29 | 29 |
30 var b = document.querySelector('#b'); | 30 var b = document.querySelector('#b'); |
31 shouldBe('window.getComputedStyle(b).color', '"rgb(0, 0, 222)"'); | 31 shouldBe('window.getComputedStyle(b).color', '"rgb(0, 0, 222)"'); |
32 shouldBe('window.getComputedStyle(b).borderColor', '"rgb(0, 0, 111)"'); | 32 shouldBe('window.getComputedStyle(b).borderColor', '"rgb(0, 0, 111)"'); |
33 | 33 |
34 var X = document.register('x-x', {prototype: Object.create(HTMLElement.prototype
)}); | 34 var X = document.registerElement('x-x', {prototype: Object.create(HTMLElement.pr
ototype)}); |
35 var c = new X(); | 35 var c = new X(); |
36 document.body.insertBefore(c, b); | 36 document.body.insertBefore(c, b); |
37 shouldBe('window.getComputedStyle(c).color', '"rgb(0, 222, 0)"'); | 37 shouldBe('window.getComputedStyle(c).color', '"rgb(0, 222, 0)"'); |
38 | 38 |
39 // Registering x-x should have changed the styles of #a. | 39 // Registering x-x should have changed the styles of #a. |
40 shouldBe('window.getComputedStyle(a).color', '"rgb(0, 222, 0)"'); | 40 shouldBe('window.getComputedStyle(a).color', '"rgb(0, 222, 0)"'); |
41 | 41 |
42 var Y = document.register('x-y', {extends: 'span', prototype: Object.create(HTML
SpanElement.prototype)}); | 42 var Y = document.registerElement('x-y', {extends: 'span', prototype: Object.crea
te(HTMLSpanElement.prototype)}); |
43 var d = new Y(); | 43 var d = new Y(); |
44 document.body.insertBefore(d, b); | 44 document.body.insertBefore(d, b); |
45 shouldBe('window.getComputedStyle(d).color', '"rgb(0, 111, 0)"'); | 45 shouldBe('window.getComputedStyle(d).color', '"rgb(0, 111, 0)"'); |
46 | 46 |
47 // Registering is="x-y" should have changed the styles of #b. | 47 // Registering is="x-y" should have changed the styles of #b. |
48 shouldBe('window.getComputedStyle(b).color', '"rgb(0, 111, 0)"'); | 48 shouldBe('window.getComputedStyle(b).color', '"rgb(0, 111, 0)"'); |
49 | 49 |
50 successfullyParsed = true; | 50 successfullyParsed = true; |
51 </script> | 51 </script> |
OLD | NEW |