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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Accessibility.AXTreePane = class extends Accessibility.AccessibilitySubPane { 7 Accessibility.AXTreePane = class extends Accessibility.AccessibilitySubPane {
8 /** 8 /**
9 * @param {!Accessibility.AccessibilitySidebarView} axSidebarView 9 * @param {!Accessibility.AccessibilitySidebarView} axSidebarView
10 */ 10 */
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Pass an empty title, the title gets made later in onattach. 172 // Pass an empty title, the title gets made later in onattach.
173 super(''); 173 super('');
174 174
175 /** @type {!Accessibility.AccessibilityNode} */ 175 /** @type {!Accessibility.AccessibilityNode} */
176 this._axNode = axNode; 176 this._axNode = axNode;
177 177
178 /** @type {!Accessibility.AXTreePane} */ 178 /** @type {!Accessibility.AXTreePane} */
179 this._treePane = treePane; 179 this._treePane = treePane;
180 180
181 this.selectable = true; 181 this.selectable = true;
182 this._hovered = false;
182 183
183 this._inspectNodeButton = new Accessibility.InspectNodeButton(axNode, treePa ne); 184 this._inspectNodeButton = new Accessibility.InspectNodeButton(axNode, treePa ne);
185 this.listItemElement.addEventListener('mousemove', this._onmousemove.bind(th is), false);
186 this.listItemElement.addEventListener('mouseleave', this._onmouseleave.bind( this), false);
184 } 187 }
185 188
186 /** 189 /**
190 * @param {boolean} x
191 */
192 setHovered(x) {
193 if (this._hovered === x)
194 return;
195 this._hovered = x;
196 this.listItemElement.classList.toggle('hovered', x);
197 if (this._hovered)
198 this._axNode.highlightDOMNode();
199 }
200
201 _onmousemove(event) {
202 this.setHovered(true);
203 }
204
205 _onmouseleave(event) {
206 this.setHovered(false);
207 }
208
209 /**
187 * @return {!Accessibility.AccessibilityNode} 210 * @return {!Accessibility.AccessibilityNode}
188 */ 211 */
189 axNode() { 212 axNode() {
190 return this._axNode; 213 return this._axNode;
191 } 214 }
192 215
193 /** 216 /**
194 * @param {boolean} inspected 217 * @param {boolean} inspected
195 */ 218 */
196 setInspected(inspected) { 219 setInspected(inspected) {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 continue; 451 continue;
429 } 452 }
430 siblingTreeElement = new Accessibility.AXNodeTreeElement(sibling, this._tr eePane); 453 siblingTreeElement = new Accessibility.AXNodeTreeElement(sibling, this._tr eePane);
431 if (foundInspectedNode) 454 if (foundInspectedNode)
432 this.appendChild(siblingTreeElement); 455 this.appendChild(siblingTreeElement);
433 else 456 else
434 this.insertChild(siblingTreeElement, nextIndex++); 457 this.insertChild(siblingTreeElement, nextIndex++);
435 } 458 }
436 } 459 }
437 }; 460 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698