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

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

Issue 2614553002: Don't sync DOM selection for root a11y node (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
index 4830cc7588773bda55394232d41a5493526bc8af..7fa1119184c51f7db27b8d3e63f6d2b65e8da2e6 100644
--- a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
+++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
@@ -5,9 +5,13 @@
* @unrestricted
*/
Accessibility.AXTreePane = class extends Accessibility.AccessibilitySubPane {
- constructor() {
+ /**
+ * @param {!Accessibility.AccessibilitySidebarView} axSidebarView
+ */
+ constructor(axSidebarView) {
super(Common.UIString('Accessibility Tree'));
+ this._axSidebarView = axSidebarView;
this._treeOutline = this.createTreeOutline();
this.element.classList.add('accessibility-computed');
@@ -77,6 +81,22 @@ Accessibility.AXTreePane = class extends Accessibility.AccessibilitySubPane {
}
/**
+ * @param {!Accessibility.AccessibilityNode} axNode
+ */
+ setSelectedNode(axNode) {
+ if (axNode.parentNode()) {
+ Common.Revealer.reveal(axNode.deferredDOMNode());
+ } else {
+ // Only set the node for the accessibility panel, not the Elements tree.
+ var axSidebarView = this._axSidebarView;
+ function nodeResolved(node) {
dgozman 2017/01/04 00:11:05 Can use arrow function instead.
aboxhall 2017/01/04 01:06:10 Done.
+ axSidebarView.setNode(node);
+ }
+ axNode.deferredDOMNode().resolve(nodeResolved);
+ }
+ }
+
+ /**
* @param {boolean} selectedByUser
*/
setSelectedByUser(selectedByUser) {
@@ -137,7 +157,7 @@ Accessibility.InspectNodeButton = class {
*/
_handleMouseDown(event) {
this._treePane.setSelectedByUser(true);
- Common.Revealer.reveal(this._axNode.deferredDOMNode());
+ this._treePane.setSelectedNode(this._axNode);
dgozman 2017/01/04 00:11:05 Does it make sense to merge setSelectedByUser and
aboxhall 2017/01/04 01:06:10 I wanted to leave them separate, since it's plausi
}
};
@@ -205,7 +225,7 @@ Accessibility.AXNodeTreeElement = class extends UI.TreeElement {
inspectDOMNode() {
this._treePane.setSelectedByUser(true);
- Common.Revealer.reveal(this._axNode.deferredDOMNode());
+ this._treePane.setSelectedNode(this._axNode);
}
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698