commit-queue@webkit.org | 704811d | 2011-05-25 21:29:32 +0000 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <style> |
| 5 | span { display: none } |
| 6 | *[test~="0"] #sp { color: green; display: block} |
| 7 | </style> |
| 8 | </head> |
| 9 | <body onload="startTest();"> |
| 10 | <div test="1"> |
| 11 | <p> |
| 12 | Test for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=60752">https://bugs.webkit.org/show_bug.cgi?id=60752</a> |
| 13 | </p> |
| 14 | <p>This test checks whether CSS attribute selector [att~=val] is re-evaluated after attribute changes in DOM elements which have no style associated with them.</p> |
| 15 | <span id="sp">PASSED</span> |
| 16 | </div> |
| 17 | |
| 18 | <script> |
| 19 | function change() { |
| 20 | var element = document.getElementsByTagName('div')[0]; |
| 21 | element.attributes.test.value = "updated attributed value 0"; |
rniwa@webkit.org | 38608af | 2012-06-19 07:23:13 +0000 | [diff] [blame] | 22 | if (window.testRunner) { |
| 23 | testRunner.notifyDone(); |
commit-queue@webkit.org | 704811d | 2011-05-25 21:29:32 +0000 | [diff] [blame] | 24 | } |
| 25 | } |
| 26 | function startTest() { |
rniwa@webkit.org | 38608af | 2012-06-19 07:23:13 +0000 | [diff] [blame] | 27 | if (window.testRunner) { |
| 28 | testRunner.dumpAsText(); |
| 29 | testRunner.waitUntilDone(); |
commit-queue@webkit.org | 704811d | 2011-05-25 21:29:32 +0000 | [diff] [blame] | 30 | } |
| 31 | // Trigger an attribute change after all load processing is done. Doing the change |
| 32 | // here immediately does not exhibit the problem. |
| 33 | setTimeout("change();", 0); |
| 34 | } |
| 35 | </script> |
| 36 | </body> |
| 37 | </html> |