OLD | NEW |
---|---|
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 Loading... | |
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()) |
pfeldman
2015/08/21 17:40:42
Should you check for range here?
lushnikov
2015/08/21 21:25:03
why should I?
| |
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 Loading... | |
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 } |
OLD | NEW |