OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 3 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 4 <style>span { color: red }</style> |
| 5 <script> |
| 6 function test() { |
| 7 |
| 8 var nodeId; |
| 9 var sheetId; |
| 10 |
| 11 InspectorTest.selectNodeAndWaitForStyles("styled-span", nodeSelected); |
| 12 |
| 13 function nodeSelected(node) { |
| 14 nodeId = node.id; |
| 15 InspectorTest.cssModel.matchedStylesPromise(nodeId).then(matchedStylesBefore
); |
| 16 } |
| 17 |
| 18 function matchedStylesBefore(matchedResult) { |
| 19 sheetId = matchedResult.nodeStyles()[1].styleSheetId; |
| 20 InspectorTest.addResult("\n== Matched rules before @import added ==\n"); |
| 21 InspectorTest.dumpSelectedElementStyles(true); |
| 22 InspectorTest.CSSAgent.setStyleSheetText(sheetId, "@import 'data:text/css,sp
an{color:green}';").then(sheetTextSet); |
| 23 } |
| 24 |
| 25 function sheetTextSet() { |
| 26 InspectorTest.selectNodeAndWaitForStyles("styled-span", matchedStylesAfter); |
| 27 } |
| 28 |
| 29 function matchedStylesAfter() { |
| 30 InspectorTest.addResult("\n== Matched rules after @import added ==\n"); |
| 31 InspectorTest.dumpSelectedElementStyles(true); |
| 32 InspectorTest.completeTest(); |
| 33 } |
| 34 |
| 35 } |
| 36 </script> |
| 37 <body onload="runTest()"> |
| 38 <span id="styled-span"></span> |
OLD | NEW |