| 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 |
| 11 InspectorTest.preloadPanel("elements"); | 11 InspectorTest.preloadPanel("elements"); |
| 12 | 12 |
| 13 InspectorTest.findNode = function(matchFunction, callback) | 13 InspectorTest.findNode = function(matchFunction, callback) |
| 14 { | 14 { |
| 15 callback = InspectorTest.safeWrap(callback); | 15 callback = InspectorTest.safeWrap(callback); |
| 16 var result = null; | 16 var result = null; |
| 17 var pendingRequests = 0; | 17 var pendingRequests = 0; |
| 18 function processChildren(node) | 18 function processChildren(node) |
| 19 { | 19 { |
| 20 try { | 20 try { |
| 21 if (result) | 21 if (result) |
| 22 return; | 22 return; |
| 23 | 23 |
| 24 var children = (node.children() || []).concat(node.shadowRoots()).co
ncat(Object.values(node.pseudoElements() || {})); | 24 var pseudoElementsMap = node.pseudoElements(); |
| 25 var pseudoElements = pseudoElementsMap ? pseudoElementsMap.valuesArr
ay() : []; |
| 26 var children = (node.children() || []).concat(node.shadowRoots()).co
ncat(pseudoElements); |
| 25 if (node.templateContent()) | 27 if (node.templateContent()) |
| 26 children.push(node.templateContent()); | 28 children.push(node.templateContent()); |
| 27 else if (node.importedDocument()) | 29 else if (node.importedDocument()) |
| 28 children.push(node.importedDocument()); | 30 children.push(node.importedDocument()); |
| 29 | 31 |
| 30 for (var i = 0; i < children.length; ++i) { | 32 for (var i = 0; i < children.length; ++i) { |
| 31 var childNode = children[i]; | 33 var childNode = children[i]; |
| 32 if (matchFunction(childNode)) { | 34 if (matchFunction(childNode)) { |
| 33 result = childNode; | 35 result = childNode; |
| 34 callback(result); | 36 callback(result); |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 function innerCallback(result) | 829 function innerCallback(result) |
| 828 { | 830 { |
| 829 InspectorTest.addResult(nodeId + ": " + result.description); | 831 InspectorTest.addResult(nodeId + ": " + result.description); |
| 830 callback(); | 832 callback(); |
| 831 } | 833 } |
| 832 opt_frameId = opt_frameId || ""; | 834 opt_frameId = opt_frameId || ""; |
| 833 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\",
\"" + opt_frameId + "\")", innerCallback); | 835 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\",
\"" + opt_frameId + "\")", innerCallback); |
| 834 } | 836 } |
| 835 | 837 |
| 836 }; | 838 }; |
| OLD | NEW |