Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: LayoutTests/http/tests/inspector/elements-test.js

Issue 16561003: DevTools: Inspect element mode does not select element in ShadowDOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 var initialize_ElementTest = function() { 1 var initialize_ElementTest = function() {
2 2
3 InspectorTest.findNode = function(matchFunction, callback) 3 InspectorTest.findNode = function(matchFunction, callback)
4 { 4 {
5 var originalCallback = callback;
vsevik 2013/06/07 08:41:00 Unused.
pfeldman 2013/06/07 08:53:49 Done.
5 callback = InspectorTest.safeWrap(callback); 6 callback = InspectorTest.safeWrap(callback);
6 var result = null; 7 var result = null;
7 var topLevelChildrenRequested = false;
8 var pendingRequests = 0; 8 var pendingRequests = 0;
9 function processChildren(topLevel, children) 9 function processChildren(children)
10 { 10 {
11 pendingRequests--; 11 try {
12 if (result) 12 if (result)
13 return; 13 return;
14 14
15 for (var i = 0; children && i < children.length; ++i) { 15 for (var i = 0; children && i < children.length; ++i) {
16 var childNode = children[i]; 16 var childNode = children[i];
17 if (matchFunction(childNode)) { 17 if (matchFunction(childNode)) {
18 result = childNode; 18 result = childNode;
19 callback(result); 19 callback(result);
20 return; 20 pendingRequests--;
vsevik 2013/06/07 08:41:00 remove
pfeldman 2013/06/07 08:53:49 Done.
21 return;
22 }
23 pendingRequests++;
24 childNode.getChildNodes(processChildren);
21 } 25 }
22 pendingRequests++; 26 } finally {
apavlov 2013/06/06 16:18:59 Curlies not necessary here? The new styleguide is
23 childNode.getChildNodes(processChildren.bind(null, false)); 27 pendingRequests--;
24 } 28 }
25 29
26 if (topLevel) 30 if (!result && !pendingRequests) {
apavlov 2013/06/06 16:18:59 ditto
pfeldman 2013/06/07 08:53:49 Done.
27 topLevelChildrenRequested = true;
28 if (topLevelChildrenRequested && !result && !pendingRequests)
29 callback(null); 31 callback(null);
32 }
30 } 33 }
31 pendingRequests++;
32 34
33 WebInspector.domAgent.requestDocument(documentRequested.bind(this)); 35 WebInspector.domAgent.requestDocument(documentRequested.bind(this));
34 function documentRequested(doc) 36 function documentRequested(doc)
35 { 37 {
36 doc.getChildNodes(processChildren.bind(this, true)); 38 pendingRequests++;
39 doc.getChildNodes(processChildren);
37 } 40 }
38 }; 41 };
39 42
40 InspectorTest.nodeWithId = function(idValue, callback) 43 InspectorTest.nodeWithId = function(idValue, callback)
41 { 44 {
42 function nodeIdMatches(node) 45 function nodeIdMatches(node)
43 { 46 {
44 return node.getAttribute("id") === idValue; 47 return node.getAttribute("id") === idValue;
45 } 48 }
46 InspectorTest.findNode(nodeIdMatches, callback); 49 InspectorTest.findNode(nodeIdMatches, callback);
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 { 613 {
611 var rectNames = ["margin", "border", "padding", "content"]; 614 var rectNames = ["margin", "border", "padding", "content"];
612 var rects = window.internals.inspectorHighlightRects(document); 615 var rects = window.internals.inspectorHighlightRects(document);
613 for (var i = 0; i < rects.length; i++) 616 for (var i = 0; i < rects.length; i++)
614 { 617 {
615 var rectName = (i < rectNames.length ? rectNames[i] : "untitled"); 618 var rectName = (i < rectNames.length ? rectNames[i] : "untitled");
616 var rect = rects.item(i); 619 var rect = rects.item(i);
617 output(rectName + " rect is " + rect.width + " x " + rect.height + " at (" + rect.left + ", " + rect.top + ")"); 620 output(rectName + " rect is " + rect.width + " x " + rect.height + " at (" + rect.left + ", " + rect.top + ")");
618 } 621 }
619 } 622 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/edit-dom-actions.html » ('j') | Source/core/inspector/InspectorDOMAgent.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698