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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityModel.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 c7a24626bac1d6375410c4f6343b01737fc3895b..88ed1ee7e86b4dfc38922fcb3f44c90e16fea6b1 100644
--- a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
+++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
@@ -180,8 +180,32 @@ Accessibility.AXNodeTreeElement = class extends UI.TreeElement {
this._treePane = treePane;
this.selectable = true;
+ this.paddingSize = 12;
+ 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);
}
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698