OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <style> |
| 4 body { |
| 5 --a: red; |
| 6 } |
| 7 |
| 8 #id1 { |
| 9 --b: 44px; |
| 10 } |
| 11 |
| 12 #id2 { |
| 13 --a: green; |
| 14 } |
| 15 |
| 16 </style> |
| 17 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 18 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 19 <script> |
| 20 |
| 21 function test() |
| 22 { |
| 23 InspectorTest.selectNodeAndWaitForStylesWithComputed("id1", step1); |
| 24 function step1(node) |
| 25 { |
| 26 InspectorTest.addResult("==== Computed style for ID1 ===="); |
| 27 InspectorTest.dumpSelectedElementStyles(false, true); |
| 28 InspectorTest.cssModel.computedStylePromise(node.id).then( |
| 29 function(style) { |
| 30 InspectorTest.addResult("value of --a: " + style.get("--a")); |
| 31 InspectorTest.selectNodeAndWaitForStylesWithComputed("id2", step
2); |
| 32 }); |
| 33 } |
| 34 |
| 35 function step2(node) |
| 36 { |
| 37 InspectorTest.addResult("==== Computed style for ID2 ===="); |
| 38 InspectorTest.dumpSelectedElementStyles(false, true); |
| 39 InspectorTest.cssModel.computedStylePromise(node.id).then( |
| 40 function(style) { |
| 41 InspectorTest.addResult("value of --b: " + style.get("--b")); |
| 42 InspectorTest.completeTest(); |
| 43 }); |
| 44 } |
| 45 |
| 46 } |
| 47 </script> |
| 48 </head> |
| 49 |
| 50 <body onload="runTest()"> |
| 51 <p> |
| 52 Tests that computed styles expand and allow tracing to style rules. |
| 53 </p> |
| 54 |
| 55 <div id="id1"> |
| 56 <div id="id2"> |
| 57 </div> |
| 58 </div> |
| 59 |
| 60 </body> |
| 61 </html> |
OLD | NEW |