OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script type="text/javascript"> |
| 5 function log(msg) |
| 6 { |
| 7 document.getElementById('console').appendChild(document.createTextNo
de(msg + '\n')); |
| 8 } |
| 9 |
| 10 function test(id) |
| 11 { |
| 12 var elem = document.getElementById(id); |
| 13 log(id + ': ' + document.defaultView.getComputedStyle(elem, null).ge
tPropertyValue('color')); |
| 14 } |
| 15 |
| 16 function testAll() |
| 17 { |
| 18 test('S1'); |
| 19 test('P1'); |
| 20 test('S2'); |
| 21 test('P2'); |
| 22 test('S3'); |
| 23 test('P3'); |
| 24 } |
| 25 |
| 26 function runTests() |
| 27 { |
| 28 if (window.testRunner) { |
| 29 testRunner.dumpAsText(); |
| 30 testRunner.waitUntilDone(); |
| 31 } |
| 32 |
| 33 log('--- ORIGINAL ---'); |
| 34 testAll(); |
| 35 |
| 36 log('--- AFTER DETACHING <STYLE SCOPED> ---'); |
| 37 var divElem = document.getElementById('DIV'); |
| 38 var styleElem = document.getElementById('STYLE'); |
| 39 divElem.removeChild(styleElem); |
| 40 setTimeout(function() { |
| 41 testAll(); |
| 42 log('--- FINISHED ---'); |
| 43 if (window.testRunner) |
| 44 testRunner.notifyDone(); |
| 45 }, 0); |
| 46 } |
| 47 </script> |
| 48 <style type="text/css" scoped> |
| 49 body { color: black; } |
| 50 </style> |
| 51 </head> |
| 52 <body onload="runTests();"> |
| 53 <p>Test detaching a <style scoped> element</p> |
| 54 <div> |
| 55 <span id="S1">Text</span> |
| 56 <p id="P1">Text</p> |
| 57 </div> |
| 58 <div id="DIV"> |
| 59 <style id="STYLE" type="text/css" scoped> |
| 60 div { color: red; } |
| 61 p { color: green; } |
| 62 </style> |
| 63 <span id="S2">Text</span> |
| 64 <p id="P2">Text</p> |
| 65 </div> |
| 66 <div> |
| 67 <span id="S3">Text</span> |
| 68 <p id="P3">Text</p> |
| 69 </div> |
| 70 <pre id="console"></pre> |
| 71 </body> |
| 72 </html> |
OLD | NEW |