| 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 <style> | 5 <style> |
| 6 #pseudo::after { | 6 #pseudo::after { |
| 7 pseudo-property: "12"; | 7 pseudo-property: "12"; |
| 8 color: red; | 8 color: red; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 return; | 112 return; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 callback(); | 115 callback(); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 function getMatchedRules() | 119 function getMatchedRules() |
| 120 { | 120 { |
| 121 var rules = []; | 121 var rules = []; |
| 122 for (var pseudoId in WebInspector.panels.elements.sidebarPanes.styles.se
ctions) { | 122 for (var block of WebInspector.panels.elements.sidebarPanes.styles._sect
ionBlocks) { |
| 123 var matchedStyleSections = WebInspector.panels.elements.sidebarPanes
.styles.sections[pseudoId]; | 123 for (var section of block.sections) { |
| 124 for (var i = 0; i < matchedStyleSections.length; ++i) { | 124 var rule = section.rule(); |
| 125 var rule = matchedStyleSections[i].rule(); | |
| 126 if (rule) | 125 if (rule) |
| 127 rules.push(rule); | 126 rules.push(rule); |
| 128 } | 127 } |
| 129 } | 128 } |
| 130 return rules; | 129 return rules; |
| 131 } | 130 } |
| 132 | 131 |
| 133 InspectorTest.runTestSuite([ | 132 InspectorTest.runTestSuite([ |
| 134 function selectInitialNode(next) | 133 function selectInitialNode(next) |
| 135 { | 134 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 148 { | 147 { |
| 149 InspectorTest.addResult("\n\n#### AFTER PROPERTY INSERTION ####\
n\n"); | 148 InspectorTest.addResult("\n\n#### AFTER PROPERTY INSERTION ####\
n\n"); |
| 150 InspectorTest.dumpSelectedElementStyles(true, false, true); | 149 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 151 var rules = getMatchedRules(); | 150 var rules = getMatchedRules(); |
| 152 validateRuleRanges("container", rules, next); | 151 validateRuleRanges("container", rules, next); |
| 153 } | 152 } |
| 154 }, | 153 }, |
| 155 | 154 |
| 156 function testEditSelector(next) | 155 function testEditSelector(next) |
| 157 { | 156 { |
| 158 var section = WebInspector.panels.elements.sidebarPanes.styles.secti
ons[0][3]; | 157 var section = WebInspector.panels.elements.sidebarPanes.styles._sect
ionBlocks[0].sections[3]; |
| 159 section.startEditingSelector(); | 158 section.startEditingSelector(); |
| 160 section._selectorElement.textContent = ".should-change, .INSERTED-OT
HER-SELECTOR"; | 159 section._selectorElement.textContent = ".should-change, .INSERTED-OT
HER-SELECTOR"; |
| 161 InspectorTest.waitForSelectorCommitted(onSelectorEdited); | 160 InspectorTest.waitForSelectorCommitted(onSelectorEdited); |
| 162 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent(
"Enter")); | 161 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent(
"Enter")); |
| 163 | 162 |
| 164 function onSelectorEdited() | 163 function onSelectorEdited() |
| 165 { | 164 { |
| 166 InspectorTest.addResult("\n\n#### AFTER SELECTOR EDIT ####\n\n")
; | 165 InspectorTest.addResult("\n\n#### AFTER SELECTOR EDIT ####\n\n")
; |
| 167 InspectorTest.dumpSelectedElementStyles(true, false, true); | 166 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 168 var rules = getMatchedRules(); | 167 var rules = getMatchedRules(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 <div id="container" class="left-intact should-change"> | 219 <div id="container" class="left-intact should-change"> |
| 221 Red text here. | 220 Red text here. |
| 222 </div> | 221 </div> |
| 223 | 222 |
| 224 <div id="other"></div> | 223 <div id="other"></div> |
| 225 | 224 |
| 226 <section id="pseudo"></div> | 225 <section id="pseudo"></div> |
| 227 | 226 |
| 228 </body> | 227 </body> |
| 229 </html> | 228 </html> |
| OLD | NEW |