Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 var initialize_ElementTest = function() { | 1 var initialize_ElementTest = function() { |
| 2 | 2 |
| 3 InspectorTest.preloadPanel("elements"); | 3 InspectorTest.preloadPanel("elements"); |
| 4 | 4 |
| 5 InspectorTest.findNode = function(matchFunction, callback) | 5 InspectorTest.findNode = function(matchFunction, callback) |
| 6 { | 6 { |
| 7 callback = InspectorTest.safeWrap(callback); | 7 callback = InspectorTest.safeWrap(callback); |
| 8 var result = null; | 8 var result = null; |
| 9 var pendingRequests = 0; | 9 var pendingRequests = 0; |
| 10 function processChildren(node) | 10 function processChildren(node) |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 | 762 |
| 763 function onBlankSection(selector, callback) | 763 function onBlankSection(selector, callback) |
| 764 { | 764 { |
| 765 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2 ]; | 765 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2 ]; |
| 766 if (typeof selector === "string") | 766 if (typeof selector === "string") |
| 767 section._selectorElement.textContent = selector; | 767 section._selectorElement.textContent = selector; |
| 768 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter") ); | 768 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter") ); |
| 769 InspectorTest.waitForSelectorCommitted(callback.bind(null, section)); | 769 InspectorTest.waitForSelectorCommitted(callback.bind(null, section)); |
| 770 } | 770 } |
| 771 | 771 |
| 772 InspectorTest.dumpInspectorHighlight = function(node, callback) | 772 InspectorTest.dumpInspectorHighlightJSON = function(nodeId, callback, opt_frameI d) |
| 773 { | 773 { |
| 774 node.boxModel(function(boxModel) { | 774 function innerCallback(result) |
| 775 var rectNames = ["margin", "border", "padding", "content"]; | 775 { |
| 776 for (var i = 0; i < rectNames.length; i++) { | 776 InspectorTest.addResult(nodeId + ": " + result.description); |
| 777 var rect = boxModel[rectNames[i]]; | |
| 778 InspectorTest.addResult(rectNames[i] + " rect is " + (rect[4] - rect [0]) + " x " + (rect[5] - rect[1]) + " at (" + rect[0] + ", " + rect[1] + ")"); | |
| 779 } | |
| 780 callback(); | 777 callback(); |
| 781 }); | 778 } |
| 782 } | 779 var getDocument = opt_frameId ? "document.getElementById(\"" + opt_frameId + "\").contentDocument" : "document"; |
| 783 | 780 InspectorTest.evaluateInPage("window.internals.getInspectorHighlightJSON(" + getDocument + ".getElementById(\"" + nodeId + "\"))", innerCallback); |
|
caseq
2014/10/24 13:31:44
For better readability, please either extract into
dgozman
2014/10/24 14:45:21
Done.
| |
| 784 InspectorTest.dumpInspectorHighlightShape = function(node, callback) | |
| 785 { | |
| 786 node.boxModel(function(shapes) { | |
| 787 InspectorTest.addResult(JSON.stringify(shapes.shapeOutside.shape)); | |
| 788 callback(); | |
| 789 }); | |
| 790 } | 781 } |
| 791 | 782 |
| 792 }; | 783 }; |
| OLD | NEW |