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

Side by Side Diff: Source/devtools/front_end/elements/StylesSectionModel.js

Issue 1308663002: DevTools: simplify WI.CSSProperty and WI.CSSStyleDeclaration interfaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test Created 5 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!WebInspector.SectionCascade} cascade 7 * @param {!WebInspector.SectionCascade} cascade
8 * @param {?WebInspector.CSSRule} rule 8 * @param {?WebInspector.CSSRule} rule
9 * @param {!WebInspector.CSSStyleDeclaration} style 9 * @param {!WebInspector.CSSStyleDeclaration} style
10 * @param {string} customSelectorText 10 * @param {string} customSelectorText
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 /** @type {!Set.<string>} */ 321 /** @type {!Set.<string>} */
322 var styleRuleUsedProperties = new Set(); 322 var styleRuleUsedProperties = new Set();
323 stylesUsedProperties.push(styleRuleUsedProperties); 323 stylesUsedProperties.push(styleRuleUsedProperties);
324 if (!styleRule.hasMatchingSelectors()) 324 if (!styleRule.hasMatchingSelectors())
325 continue; 325 continue;
326 326
327 var style = styleRule.style(); 327 var style = styleRule.style();
328 var allProperties = style.allProperties; 328 var allProperties = style.allProperties;
329 for (var j = 0; j < allProperties.length; ++j) { 329 for (var j = 0; j < allProperties.length; ++j) {
330 var property = allProperties[j]; 330 var property = allProperties[j];
331 if (!property.isLive || !property.parsedOk) 331 if (!property.activeInStyle())
332 continue; 332 continue;
333 333
334 // Do not pick non-inherited properties from inherited styles. 334 // Do not pick non-inherited properties from inherited styles.
335 if (styleRule.inherited() && !WebInspector.CSSMetadata.isPropertyInh erited(property.name)) 335 if (styleRule.inherited() && !WebInspector.CSSMetadata.isPropertyInh erited(property.name))
336 continue; 336 continue;
337 337
338 var canonicalName = WebInspector.CSSMetadata.canonicalPropertyName(p roperty.name); 338 var canonicalName = WebInspector.CSSMetadata.canonicalPropertyName(p roperty.name);
339 if (foundImportantProperties.has(canonicalName)) 339 if (foundImportantProperties.has(canonicalName))
340 continue; 340 continue;
341 341
(...skipping 14 matching lines...) Expand all
356 propertyToEffectiveRule.get(canonicalName).delete(canonicalN ame); 356 propertyToEffectiveRule.get(canonicalName).delete(canonicalN ame);
357 } 357 }
358 358
359 styleRuleUsedProperties.add(canonicalName); 359 styleRuleUsedProperties.add(canonicalName);
360 allUsedProperties.add(canonicalName); 360 allUsedProperties.add(canonicalName);
361 propertyToEffectiveRule.set(canonicalName, styleRuleUsedProperties); 361 propertyToEffectiveRule.set(canonicalName, styleRuleUsedProperties);
362 } 362 }
363 } 363 }
364 return stylesUsedProperties; 364 return stylesUsedProperties;
365 } 365 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698