OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <script src="../js/resources/js-test-pre.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
6 <style> | 6 <style> |
7 .entry[status="foo"] .toggle { | 7 .entry[status="foo"] .toggle { |
8 color: green; | 8 color: green; |
9 } | 9 } |
10 .entry[status="bar"] .toggle { | 10 .entry[status="bar"] .toggle { |
11 color: red; | 11 color: red; |
12 } | 12 } |
13 </style> | 13 </style> |
14 </head> | 14 </head> |
15 <body> | 15 <body> |
16 <div class="entry" status="foo"> | 16 <div class="entry" status="foo"> |
17 <span class="toggle">Text.</span> | 17 <span class="toggle">Text.</span> |
18 </div> | 18 </div> |
19 <script> | 19 <script> |
20 | 20 |
21 description("This test checks that attribute selectors are recursively re-evalua
ted when the attribute changes."); | 21 description("This test checks that attribute selectors are recursively re-evalua
ted when the attribute changes."); |
22 | 22 |
23 var entry= document.getElementsByClassName("entry")[0]; | 23 var entry= document.getElementsByClassName("entry")[0]; |
24 var toggle = document.getElementsByClassName("toggle")[0]; | 24 var toggle = document.getElementsByClassName("toggle")[0]; |
25 | 25 |
26 shouldBe("getComputedStyle(toggle).color", "'rgb(0, 128, 0)'"); | 26 shouldBe("getComputedStyle(toggle).color", "'rgb(0, 128, 0)'"); |
27 entry.setAttribute("status", "bar"); | 27 entry.setAttribute("status", "bar"); |
28 shouldBe("getComputedStyle(toggle).color", "'rgb(255, 0, 0)'"); | 28 shouldBe("getComputedStyle(toggle).color", "'rgb(255, 0, 0)'"); |
29 | 29 |
30 document.body.removeChild(entry); | 30 document.body.removeChild(entry); |
31 | 31 |
32 </script> | 32 </script> |
33 </body> | 33 </body> |
34 </html> | 34 </html> |
OLD | NEW |