| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 function flattenRuleRanges(rule) | 9 function flattenRuleRanges(rule) |
| 10 { | 10 { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 InspectorTest.completeTest(); | 97 InspectorTest.completeTest(); |
| 98 return; | 98 return; |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 callback(); | 101 callback(); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 function getMatchedRules() | 105 function getMatchedRules() |
| 106 { | 106 { |
| 107 var matchedStyleSections = WebInspector.panels.elements.sidebarPanes.sty
les.sections[0]; | 107 var matchedStyleSections = WebInspector.inspectorView.panel("elements").
sidebarPanes.styles.sections[0]; |
| 108 var rules = []; | 108 var rules = []; |
| 109 for (var i = 1; i < matchedStyleSections.length; ++i) { | 109 for (var i = 1; i < matchedStyleSections.length; ++i) { |
| 110 var rule = matchedStyleSections[i].rule; | 110 var rule = matchedStyleSections[i].rule; |
| 111 if (rule) | 111 if (rule) |
| 112 rules.push(rule); | 112 rules.push(rule); |
| 113 } | 113 } |
| 114 return rules; | 114 return rules; |
| 115 } | 115 } |
| 116 | 116 |
| 117 function insertProperty() | 117 function insertProperty() |
| 118 { | 118 { |
| 119 InspectorTest.dumpSelectedElementStyles(true, false, true); | 119 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 120 var treeItem = InspectorTest.getMatchedStylePropertyTreeItem("color"); | 120 var treeItem = InspectorTest.getMatchedStylePropertyTreeItem("color"); |
| 121 var treeElement = treeItem.section().addNewBlankProperty(1); | 121 var treeElement = treeItem.section().addNewBlankProperty(1); |
| 122 treeElement.applyStyleText("PROPERTY: INSERTED;", true, true); | 122 treeElement.applyStyleText("PROPERTY: INSERTED;", true, true); |
| 123 InspectorTest.runAfterPendingDispatches(onPropertyInserted); | 123 InspectorTest.runAfterPendingDispatches(onPropertyInserted); |
| 124 } | 124 } |
| 125 | 125 |
| 126 function onPropertyInserted() | 126 function onPropertyInserted() |
| 127 { | 127 { |
| 128 InspectorTest.addResult("\n\n#### AFTER PROPERTY INSERTION ####\n\n"); | 128 InspectorTest.addResult("\n\n#### AFTER PROPERTY INSERTION ####\n\n"); |
| 129 InspectorTest.dumpSelectedElementStyles(true, false, true); | 129 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 130 var rules = getMatchedRules(); | 130 var rules = getMatchedRules(); |
| 131 validateRuleRanges(rules, editSelector); | 131 validateRuleRanges(rules, editSelector); |
| 132 } | 132 } |
| 133 | 133 |
| 134 function editSelector() | 134 function editSelector() |
| 135 { | 135 { |
| 136 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[
0][4]; | 136 var section = WebInspector.inspectorView.panel("elements").sidebarPanes.
styles.sections[0][4]; |
| 137 section.startEditingSelector(); | 137 section.startEditingSelector(); |
| 138 section._selectorElement.textContent = ".should-change, .INSERTED-OTHER-
SELECTOR"; | 138 section._selectorElement.textContent = ".should-change, .INSERTED-OTHER-
SELECTOR"; |
| 139 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Ent
er")); | 139 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Ent
er")); |
| 140 InspectorTest.runAfterPendingDispatches(onSelectorEdited); | 140 InspectorTest.runAfterPendingDispatches(onSelectorEdited); |
| 141 } | 141 } |
| 142 | 142 |
| 143 function onSelectorEdited() | 143 function onSelectorEdited() |
| 144 { | 144 { |
| 145 InspectorTest.addResult("\n\n#### AFTER SELECTOR EDIT ####\n\n"); | 145 InspectorTest.addResult("\n\n#### AFTER SELECTOR EDIT ####\n\n"); |
| 146 InspectorTest.dumpSelectedElementStyles(true, false, true); | 146 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 175 </p> | 175 </p> |
| 176 | 176 |
| 177 <div id="container" class="left-intact should-change"> | 177 <div id="container" class="left-intact should-change"> |
| 178 Red text here. | 178 Red text here. |
| 179 </div> | 179 </div> |
| 180 | 180 |
| 181 <div id="other"></div> | 181 <div id="other"></div> |
| 182 | 182 |
| 183 </body> | 183 </body> |
| 184 </html> | 184 </html> |
| OLD | NEW |