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

Unified Diff: third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js

Issue 2390783006: [DevTools] Accessibility: Show siblings and children of selected node (Closed)
Patch Set: Ready for a first look 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js
index 59f69b4810f4b7876707caa5d1ec23027f8742de..4e0077ba3cf00265b1af3f038ab68068d77d8710 100644
--- a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js
+++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js
@@ -10,6 +10,7 @@ WebInspector.AccessibilitySidebarView = function()
{
WebInspector.ThrottledWidget.call(this);
this._node = null;
+ this._axNode = null;
this._sidebarPaneStack = WebInspector.viewManager.createStackLocation();
this._treeSubPane = new WebInspector.AXTreePane();
this._sidebarPaneStack.showView(this._treeSubPane);
@@ -32,23 +33,24 @@ WebInspector.AccessibilitySidebarView.prototype = {
},
/**
- * @param {?Array<!AccessibilityAgent.AXNode>} nodes
+ * @param {?WebInspector.AccessibilityNode} axNode
*/
- accessibilityNodeCallback: function(nodes)
+ accessibilityNodeCallback: function(axNode)
{
- if (!nodes)
+ if (!axNode)
return;
- var currentAXNode = nodes[0];
- if (currentAXNode.ignored)
+ this._axNode = axNode;
+
+ if (axNode.ignored())
this._sidebarPaneStack.removeView(this._ariaSubPane);
else
this._sidebarPaneStack.showView(this._ariaSubPane, this._axNodeSubPane);
if (this._axNodeSubPane)
- this._axNodeSubPane.setAXNode(currentAXNode);
+ this._axNodeSubPane.setAXNode(axNode);
if (this._treeSubPane)
- this._treeSubPane.setAXNodeAndAncestors(nodes);
+ this._treeSubPane.setAXNode(axNode);
},
/**
@@ -62,8 +64,13 @@ WebInspector.AccessibilitySidebarView.prototype = {
this._treeSubPane.setNode(node);
this._axNodeSubPane.setNode(node);
this._ariaSubPane.setNode(node);
- return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNodeChain(node.id)
- .then((nodes) => { this.accessibilityNodeCallback(nodes); });
+ if (!node)
+ return Promise.resolve();
+ var accessibilityModel = WebInspector.AccessibilityModel.fromTarget(node.target());
+ return accessibilityModel.setDOMNode(node)
+ .then(accessibilityModel.resolveAllDOMNodes.bind(accessibilityModel))
+ .then(accessibilityModel.getInspectedAXNode.bind(accessibilityModel))
+ .then((axNode) => { this.accessibilityNodeCallback(axNode); });
},
/**
@@ -99,6 +106,7 @@ WebInspector.AccessibilitySidebarView.prototype = {
this._node = WebInspector.context.flavor(WebInspector.DOMNode);
this._ariaSubPane.setNode(this._node);
this._axNodeSubPane.setNode(this._node);
+ this._treeSubPane.setNode(this._node);
this.update();
},
@@ -147,7 +155,7 @@ WebInspector.AccessibilitySubPane = function(name)
WebInspector.AccessibilitySubPane.prototype = {
/**
- * @param {?AccessibilityAgent.AXNode} axNode
+ * @param {?WebInspector.AccessibilityNode} axNode
* @protected
*/
setAXNode: function(axNode)

Powered by Google App Engine
This is Rietveld 408576698