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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSMatchedStyles.js

Issue 2637593002: DevTools: Autocomplete CSS variables in StylesSidebar (Closed)
Patch Set: merge Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698