| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @unrestricted |
| 7 */ |
| 8 Elements.StylePropertyHighlighter = class { |
| 9 /** |
| 10 * @param {!Elements.StylesSidebarPane} ssp |
| 11 * @param {!SDK.CSSProperty} cssProperty |
| 12 */ |
| 13 constructor(ssp, cssProperty) { |
| 14 this._styleSidebarPane = ssp; |
| 15 this._cssProperty = cssProperty; |
| 16 } |
| 17 |
| 18 perform() { |
| 19 // Expand all shorthands. |
| 20 for (var section of this._styleSidebarPane.allSections()) { |
| 21 for (var treeElement = section.propertiesTreeOutline.firstChild(); treeEle
ment; |
| 22 treeElement = treeElement.nextSibling) |
| 23 treeElement.onpopulate(); |
| 24 } |
| 25 var highlightTreeElement = null; |
| 26 for (var section of this._styleSidebarPane.allSections()) { |
| 27 var treeElement = section.propertiesTreeOutline.firstChild(); |
| 28 while (treeElement && !highlightTreeElement) { |
| 29 if (treeElement.property === this._cssProperty) { |
| 30 highlightTreeElement = treeElement; |
| 31 break; |
| 32 } |
| 33 treeElement = treeElement.traverseNextTreeElement(false, null, true); |
| 34 } |
| 35 if (highlightTreeElement) |
| 36 break; |
| 37 } |
| 38 |
| 39 if (!highlightTreeElement) |
| 40 return; |
| 41 |
| 42 highlightTreeElement.parent.expand(); |
| 43 highlightTreeElement.listItemElement.scrollIntoViewIfNeeded(); |
| 44 highlightTreeElement.listItemElement.animate( |
| 45 [ |
| 46 {offset: 0, backgroundColor: 'rgba(255, 255, 0, 0.2)'}, |
| 47 {offset: 0.1, backgroundColor: 'rgba(255, 255, 0, 0.7)'}, {offset: 1,
backgroundColor: 'transparent'} |
| 48 ], |
| 49 {duration: 2000, easing: 'cubic-bezier(0, 0, 0.2, 1)'}); |
| 50 } |
| 51 }; |
| OLD | NEW |