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

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

Issue 2611993003: [DevTools] Accessibility pane: Sync highlight between a11y pane and DOM pane (Closed)
Patch Set: rebase Created 3 years, 11 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/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 ab855811c5322fa5a6ea540d5a7ee2f5dfa6fb59..44988b94158c780269d20e9db0bea402028de025 100644
--- a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
+++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
@@ -179,8 +179,31 @@ Accessibility.AXNodeTreeElement = class extends UI.TreeElement {
this._treePane = treePane;
this.selectable = true;
+ this._hovered = false;
this._inspectNodeButton = new Accessibility.InspectNodeButton(axNode, treePane);
+ this.listItemElement.addEventListener('mousemove', this._onmousemove.bind(this), false);
+ this.listItemElement.addEventListener('mouseleave', this._onmouseleave.bind(this), false);
+ }
+
+ /**
+ * @param {boolean} x
+ */
+ setHovered(x) {
+ if (this._hovered === x)
+ return;
+ this._hovered = x;
+ this.listItemElement.classList.toggle('hovered', x);
+ if (this._hovered)
+ this._axNode.highlightDOMNode();
+ }
+
+ _onmousemove(event) {
+ this.setHovered(true);
+ }
+
+ _onmouseleave(event) {
+ this.setHovered(false);
}
/**

Powered by Google App Engine
This is Rietveld 408576698