OLD | NEW |
---|---|
1 function getInspectorHighlightJSON(nodeId, opt_frameId) | 1 function getInspectorHighlightJSON(nodeId, opt_frameId) |
2 { | 2 { |
3 var doc = document; | 3 var doc = document; |
4 if (opt_frameId) | 4 if (opt_frameId) |
5 doc = document.getElementById(opt_frameId).contentDocument; | 5 doc = document.getElementById(opt_frameId).contentDocument; |
6 return window.internals.inspectorHighlightJSON(doc.getElementById(nodeId)); | 6 return window.internals.inspectorHighlightJSON(doc.getElementById(nodeId)); |
7 } | 7 } |
8 | 8 |
9 var initialize_ElementTest = function() { | 9 var initialize_ElementTest = function() { |
10 | 10 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 InspectorTest.getElementStylePropertyTreeItem = function(propertyName) | 361 InspectorTest.getElementStylePropertyTreeItem = function(propertyName) |
362 { | 362 { |
363 var styleSections = WebInspector.panels.elements.sidebarPanes.styles.section s[0]; | 363 var styleSections = WebInspector.panels.elements.sidebarPanes.styles.section s[0]; |
364 var elementStyleSection = styleSections[1]; | 364 var elementStyleSection = styleSections[1]; |
365 return InspectorTest.getFirstPropertyTreeItemForSection(elementStyleSection, propertyName); | 365 return InspectorTest.getFirstPropertyTreeItemForSection(elementStyleSection, propertyName); |
366 }; | 366 }; |
367 | 367 |
368 // FIXME: this returns the first tree item found (may fail for same-named proper ties in a style). | 368 // FIXME: this returns the first tree item found (may fail for same-named proper ties in a style). |
369 InspectorTest.getMatchedStylePropertyTreeItem = function(propertyName) | 369 InspectorTest.getMatchedStylePropertyTreeItem = function(propertyName) |
370 { | 370 { |
371 var styleSections = WebInspector.panels.elements.sidebarPanes.styles.section s[0]; | 371 for (var pseudoId in WebInspector.panels.elements.sidebarPanes.styles.sectio ns) { |
vsevik
2014/11/05 06:49:11
Extract WebInspector.panels.elements.sidebarPanes.
lushnikov
2014/11/05 08:51:09
Done.
| |
372 for (var i = 1; i < styleSections.length; ++i) { | 372 var styleSections = WebInspector.panels.elements.sidebarPanes.styles.sec tions[pseudoId]; |
373 var treeItem = InspectorTest.getFirstPropertyTreeItemForSection(styleSec tions[i], propertyName); | 373 for (var i = 0; i < styleSections.length; ++i) { |
374 if (treeItem) | 374 var section = styleSections[i]; |
375 return treeItem; | 375 if (section.computedStyle) |
376 continue; | |
377 var treeItem = InspectorTest.getFirstPropertyTreeItemForSection(sect ion, propertyName); | |
378 if (treeItem) | |
379 return treeItem; | |
380 } | |
376 } | 381 } |
377 return null; | 382 return null; |
378 }; | 383 }; |
379 | 384 |
380 InspectorTest.getFirstPropertyTreeItemForSection = function(section, propertyNam e) | 385 InspectorTest.getFirstPropertyTreeItemForSection = function(section, propertyNam e) |
381 { | 386 { |
382 var outline = section.propertiesTreeOutline; | 387 var outline = section.propertiesTreeOutline; |
383 for (var i = 0; i < outline.children.length; ++i) { | 388 for (var i = 0; i < outline.children.length; ++i) { |
384 var treeItem = outline.children[i]; | 389 var treeItem = outline.children[i]; |
385 if (treeItem.name === propertyName) | 390 if (treeItem.name === propertyName) |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
782 function innerCallback(result) | 787 function innerCallback(result) |
783 { | 788 { |
784 InspectorTest.addResult(nodeId + ": " + result.description); | 789 InspectorTest.addResult(nodeId + ": " + result.description); |
785 callback(); | 790 callback(); |
786 } | 791 } |
787 opt_frameId = opt_frameId || ""; | 792 opt_frameId = opt_frameId || ""; |
788 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\", \"" + opt_frameId + "\")", innerCallback); | 793 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\", \"" + opt_frameId + "\")", innerCallback); |
789 } | 794 } |
790 | 795 |
791 }; | 796 }; |
OLD | NEW |