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 var sections = WebInspector.panels.elements.sidebarPanes.styles.sections; |
372 for (var i = 1; i < styleSections.length; ++i) { | 372 for (var pseudoId in sections) { |
373 var treeItem = InspectorTest.getFirstPropertyTreeItemForSection(styleSec
tions[i], propertyName); | 373 var styleSections = sections[pseudoId]; |
374 if (treeItem) | 374 for (var i = 0; i < styleSections.length; ++i) { |
375 return treeItem; | 375 var section = styleSections[i]; |
| 376 if (section.computedStyle) |
| 377 continue; |
| 378 var treeItem = InspectorTest.getFirstPropertyTreeItemForSection(sect
ion, propertyName); |
| 379 if (treeItem) |
| 380 return treeItem; |
| 381 } |
376 } | 382 } |
377 return null; | 383 return null; |
378 }; | 384 }; |
379 | 385 |
380 InspectorTest.getFirstPropertyTreeItemForSection = function(section, propertyNam
e) | 386 InspectorTest.getFirstPropertyTreeItemForSection = function(section, propertyNam
e) |
381 { | 387 { |
382 var outline = section.propertiesTreeOutline; | 388 var outline = section.propertiesTreeOutline; |
383 for (var i = 0; i < outline.children.length; ++i) { | 389 for (var i = 0; i < outline.children.length; ++i) { |
384 var treeItem = outline.children[i]; | 390 var treeItem = outline.children[i]; |
385 if (treeItem.name === propertyName) | 391 if (treeItem.name === propertyName) |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 function innerCallback(result) | 788 function innerCallback(result) |
783 { | 789 { |
784 InspectorTest.addResult(nodeId + ": " + result.description); | 790 InspectorTest.addResult(nodeId + ": " + result.description); |
785 callback(); | 791 callback(); |
786 } | 792 } |
787 opt_frameId = opt_frameId || ""; | 793 opt_frameId = opt_frameId || ""; |
788 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\",
\"" + opt_frameId + "\")", innerCallback); | 794 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\",
\"" + opt_frameId + "\")", innerCallback); |
789 } | 795 } |
790 | 796 |
791 }; | 797 }; |
OLD | NEW |