| OLD | NEW |
| 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 SDK.CSSMatchedStyles = class { | 7 SDK.CSSMatchedStyles = class { |
| 8 /** | 8 /** |
| 9 * @param {!SDK.CSSModel} cssModel | 9 * @param {!SDK.CSSModel} cssModel |
| 10 * @param {!SDK.DOMNode} node | 10 * @param {!SDK.DOMNode} node |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 /** | 300 /** |
| 301 * @param {!SDK.CSSStyleDeclaration} style | 301 * @param {!SDK.CSSStyleDeclaration} style |
| 302 * @return {?SDK.DOMNode} | 302 * @return {?SDK.DOMNode} |
| 303 */ | 303 */ |
| 304 nodeForStyle(style) { | 304 nodeForStyle(style) { |
| 305 return this._nodeForStyle.get(style) || null; | 305 return this._nodeForStyle.get(style) || null; |
| 306 } | 306 } |
| 307 | 307 |
| 308 /** | 308 /** |
| 309 * @return {!Array<string>} |
| 310 */ |
| 311 cssVariables() { |
| 312 var cssVariables = []; |
| 313 for (var style of this.nodeStyles()) { |
| 314 for (var property of style.allProperties()) { |
| 315 if (property.name.startsWith('--')) |
| 316 cssVariables.push(property.name); |
| 317 } |
| 318 } |
| 319 return cssVariables; |
| 320 } |
| 321 |
| 322 /** |
| 309 * @param {!SDK.CSSStyleDeclaration} style | 323 * @param {!SDK.CSSStyleDeclaration} style |
| 310 * @return {boolean} | 324 * @return {boolean} |
| 311 */ | 325 */ |
| 312 isInherited(style) { | 326 isInherited(style) { |
| 313 return this._inheritedStyles.has(style); | 327 return this._inheritedStyles.has(style); |
| 314 } | 328 } |
| 315 | 329 |
| 316 /** | 330 /** |
| 317 * @param {!SDK.CSSProperty} property | 331 * @param {!SDK.CSSProperty} property |
| 318 * @return {?SDK.CSSMatchedStyles.PropertyState} | 332 * @return {?SDK.CSSMatchedStyles.PropertyState} |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } | 441 } |
| 428 } | 442 } |
| 429 } | 443 } |
| 430 }; | 444 }; |
| 431 | 445 |
| 432 /** @enum {string} */ | 446 /** @enum {string} */ |
| 433 SDK.CSSMatchedStyles.PropertyState = { | 447 SDK.CSSMatchedStyles.PropertyState = { |
| 434 Active: 'Active', | 448 Active: 'Active', |
| 435 Overloaded: 'Overloaded' | 449 Overloaded: 'Overloaded' |
| 436 }; | 450 }; |
| OLD | NEW |