| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style> | 3 <style> |
| 4 div:hover, a:hover { | 4 div:hover, a:hover { |
| 5 color: red; | 5 color: red; |
| 6 } | 6 } |
| 7 | 7 |
| 8 div:focus, a:focus { | 8 div:focus, a:focus { |
| 9 border: 1px solid green; | 9 border: 1px solid green; |
| 10 } | 10 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 function dumpData() | 29 function dumpData() |
| 30 { | 30 { |
| 31 InspectorTest.dumpSelectedElementStyles(true); | 31 InspectorTest.dumpSelectedElementStyles(true); |
| 32 InspectorTest.dumpElementsTree(); | 32 InspectorTest.dumpElementsTree(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 function foundDiv(node) | 35 function foundDiv(node) |
| 36 { | 36 { |
| 37 divNode = node; | 37 divNode = node; |
| 38 WebInspector.panels.elements._setPseudoClassForNode(divNode, "hover", tr
ue); | 38 WebInspector.inspectorView.panel("elements")._setPseudoClassForNode(divN
ode, "hover", true); |
| 39 WebInspector.cssModel.forcePseudoState(divNode, "active", true); | 39 WebInspector.cssModel.forcePseudoState(divNode, "active", true); |
| 40 InspectorTest.selectNodeAndWaitForStyles("div", divSelected1); | 40 InspectorTest.selectNodeAndWaitForStyles("div", divSelected1); |
| 41 } | 41 } |
| 42 | 42 |
| 43 function divSelected1() | 43 function divSelected1() |
| 44 { | 44 { |
| 45 InspectorTest.addResult(""); | 45 InspectorTest.addResult(""); |
| 46 InspectorTest.addResult("DIV with :hover and :active"); | 46 InspectorTest.addResult("DIV with :hover and :active"); |
| 47 dumpData(); | 47 dumpData(); |
| 48 InspectorTest.waitForStyles("div", hoverCallback, true); | 48 InspectorTest.waitForStyles("div", hoverCallback, true); |
| 49 WebInspector.panels.elements._setPseudoClassForNode(divNode, "hover", fa
lse); | 49 WebInspector.inspectorView.panel("elements")._setPseudoClassForNode(divN
ode, "hover", false); |
| 50 | 50 |
| 51 function hoverCallback() | 51 function hoverCallback() |
| 52 { | 52 { |
| 53 InspectorTest.waitForStyles("div", divSelected2, true); | 53 InspectorTest.waitForStyles("div", divSelected2, true); |
| 54 WebInspector.panels.elements._setPseudoClassForNode(divNode, "focus"
, true); | 54 WebInspector.inspectorView.panel("elements")._setPseudoClassForNode(
divNode, "focus", true); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 function divSelected2() | 58 function divSelected2() |
| 59 { | 59 { |
| 60 InspectorTest.addResult(""); | 60 InspectorTest.addResult(""); |
| 61 InspectorTest.addResult("DIV with :active and :focus"); | 61 InspectorTest.addResult("DIV with :active and :focus"); |
| 62 dumpData(); | 62 dumpData(); |
| 63 InspectorTest.waitForStyles("div", focusCallback, true); | 63 InspectorTest.waitForStyles("div", focusCallback, true); |
| 64 WebInspector.panels.elements._setPseudoClassForNode(divNode, "focus", fa
lse); | 64 WebInspector.inspectorView.panel("elements")._setPseudoClassForNode(divN
ode, "focus", false); |
| 65 | 65 |
| 66 function focusCallback() | 66 function focusCallback() |
| 67 { | 67 { |
| 68 InspectorTest.waitForStyles("div", divSelected3, true); | 68 InspectorTest.waitForStyles("div", divSelected3, true); |
| 69 WebInspector.panels.elements._setPseudoClassForNode(divNode, "active
", false); | 69 WebInspector.inspectorView.panel("elements")._setPseudoClassForNode(
divNode, "active", false); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 function divSelected3(node) | 73 function divSelected3(node) |
| 74 { | 74 { |
| 75 InspectorTest.addResult(""); | 75 InspectorTest.addResult(""); |
| 76 InspectorTest.addResult("DIV with no forced state"); | 76 InspectorTest.addResult("DIV with no forced state"); |
| 77 dumpData(); | 77 dumpData(); |
| 78 InspectorTest.completeTest(); | 78 InspectorTest.completeTest(); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 </script> | 81 </script> |
| 82 </head> | 82 </head> |
| 83 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> | 83 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> |
| 84 <p> | 84 <p> |
| 85 Tests that forced element state is reflected in the DOM tree and Styles pane. | 85 Tests that forced element state is reflected in the DOM tree and Styles pane. |
| 86 </p> | 86 </p> |
| 87 <div id="div">Test text</div> | 87 <div id="div">Test text</div> |
| 88 </body> | 88 </body> |
| 89 </html> | 89 </html> |
| OLD | NEW |