| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../../http/tests/inspector/elements-test.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 function test() | |
| 8 { | |
| 9 InspectorTest.selectNodeAndWaitForStyles("box", step1); | |
| 10 | |
| 11 function step1() | |
| 12 { | |
| 13 InspectorTest.dumpSelectedElementStyles(true, false, true, false); | |
| 14 InspectorTest.completeTest(); | |
| 15 } | |
| 16 } | |
| 17 | |
| 18 </script> | |
| 19 <style> | |
| 20 div { | |
| 21 border: 1px solid black; | |
| 22 background-color: white; | |
| 23 padding: 20px; | |
| 24 } | |
| 25 </style> | |
| 26 </head> | |
| 27 | |
| 28 <body onload="runTest()"> | |
| 29 Tests that the inspected page does not crash after inspecting element with CSSOM
added rules. <a href="http://crbug.com/373508">Bug 373508</a> | |
| 30 <div id="box">Inspecting this element crashes DevTools</div> | |
| 31 <script> | |
| 32 var lastSheet = document.styleSheets[document.styleSheets.length - 1]; | |
| 33 var mediaIndex = lastSheet.insertRule('@media all { }', lastSheet.cssRules.lengt
h); | |
| 34 var mediaRule = lastSheet.cssRules[mediaIndex]; | |
| 35 mediaRule.insertRule('#box { background: red; color: white; }', mediaRule.cssRul
es.length); | |
| 36 </script> | |
| 37 </body> | |
| 38 </html> | |
| OLD | NEW |