Changeset 224286 in webkit
- Timestamp:
- Nov 1, 2017 12:10:20 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r224210 r224286 1 2017-11-01 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: Styles Redesign: Hovering over a selector should highlight matching elements on the page 4 https://bugs.webkit.org/show_bug.cgi?id=179040 5 6 Reviewed by Devin Rousso. 7 8 * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: 9 (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout): 10 Use mouseenter/mouseleave events instead of mousein/mouseout (as in the old styles sidebar) 11 to avoid unnecessary events being fired. 12 13 (WI.SpreadsheetCSSStyleDeclarationSection.prototype._highlightNodesWithSelector): 14 (WI.SpreadsheetCSSStyleDeclarationSection.prototype._hideDOMNodeHighlight): 15 1 16 2017-10-30 Nikita Vasilyev <nvasilyev@apple.com> 2 17 -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js
r224174 r224286 65 65 this._selectorElement = document.createElement("span"); 66 66 this._selectorElement.classList.add("selector"); 67 this._selectorElement.addEventListener("mouseenter", this._highlightNodesWithSelector.bind(this)); 68 this._selectorElement.addEventListener("mouseleave", this._hideDOMNodeHighlight.bind(this)); 67 69 this._headerElement.append(this._selectorElement); 68 70 … … 370 372 this._propertiesEditor.addBlankProperty(appendAfterLast); 371 373 } 374 375 _highlightNodesWithSelector() 376 { 377 if (!this._style.ownerRule) { 378 WI.domTreeManager.highlightDOMNode(this._style.node.id); 379 return; 380 } 381 382 let selectorText = this._selectorElement.textContent.trim(); 383 WI.domTreeManager.highlightSelector(selectorText, this._style.node.ownerDocument.frameIdentifier); 384 } 385 386 _hideDOMNodeHighlight() 387 { 388 WI.domTreeManager.hideDOMNodeHighlight(); 389 } 372 390 }; 373 391
Note: See TracChangeset
for help on using the changeset viewer.