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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-dumpAccessibilityNodes.js

Issue 2390783006: [DevTools] Accessibility: Show siblings and children of selected node (Closed)
Patch Set: Handle non-rendered nodes which are not top-level Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function initialize_DumpAccessibilityNodesTest() { 5 function initialize_DumpAccessibilityNodesTest() {
6 6
7 var nodeInfo = {}; 7 var nodeInfo = {};
8 InspectorTest.trackGetChildNodesEvents(nodeInfo); 8 InspectorTest.trackGetChildNodesEvents(nodeInfo);
9 9
10 InspectorTest.dumpAccessibilityNodesBySelectorAndCompleteTest = function(selecto r, msg) { 10 InspectorTest.dumpAccessibilityNodesBySelectorAndCompleteTest = function(selecto r, msg) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 { 47 {
48 return sendCommandPromise("DOM.querySelectorAll", { "nodeId": nodeId, "selec tor": 48 return sendCommandPromise("DOM.querySelectorAll", { "nodeId": nodeId, "selec tor":
49 selector }); 49 selector });
50 } 50 }
51 51
52 function getAXNodes(msg) 52 function getAXNodes(msg)
53 { 53 {
54 var promise; 54 var promise;
55 msg.result.nodeIds.forEach((id) => { 55 msg.result.nodeIds.forEach((id) => {
56 if (promise) 56 if (promise)
57 promise = promise.then(() => { return sendCommandPromise("Accessibil ity.getAXNodeChain", { "nodeId": id, "fetchAncestors": false }); }); 57 promise = promise.then(() => { return sendCommandPromise("Accessibil ity.getPartialAXTree", { "nodeId": id }); });
58 else 58 else
59 promise = sendCommandPromise("Accessibility.getAXNodeChain", { "node Id": id, "fetchAncestors": false }); 59 promise = sendCommandPromise("Accessibility.getPartialAXTree", { "no deId": id });
60 promise = promise.then((msg) => { return rewriteRelatedNodes(msg); }) 60 promise = promise.then((msg) => { return rewriteRelatedNodes(msg); })
61 .then((msg) => { return dumpNode(null, msg); }); 61 .then((msg) => { return dumpNode(null, msg); });
62 }); 62 });
63 return promise; 63 return promise;
64 } 64 }
65 65
66 function describeRelatedNode(nodeData) 66 function describeRelatedNode(nodeData)
67 { 67 {
68 var description = nodeData.nodeName.toLowerCase(); 68 var description = nodeData.nodeName.toLowerCase();
69 switch (nodeData.nodeType) { 69 switch (nodeData.nodeType) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 return "<int>" 195 return "<int>"
196 if (key == "backendNodeId") 196 if (key == "backendNodeId")
197 return "<string>" 197 return "<string>"
198 if (key == "nodeId") 198 if (key == "nodeId")
199 return "<string>" 199 return "<string>"
200 return value; 200 return value;
201 } 201 }
202 InspectorTest.log((selector ? selector + ": " : "") + JSON.stringify(msg, st ripIds, " ")); 202 InspectorTest.log((selector ? selector + ": " : "") + JSON.stringify(msg, st ripIds, " "));
203 } 203 }
204 } 204 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698