Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js |
| index 8492d514956bd59447ff8401666c7d405211d967..c94f7ccb77222744358af85e229a0531c7b45172 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js |
| @@ -1439,9 +1439,9 @@ WebInspector.CSSProperty.prototype = { |
| function processToken(token, tokenType, column, newColumn) |
| { |
| if (!insideProperty) { |
| - var isDisabledProperty = tokenType && tokenType.includes("css-comment") && token.includes(":"); |
| + var disabledProperty = tokenType && tokenType.includes("css-comment") && isDisabledProperty(token); |
| var isPropertyStart = tokenType && (tokenType.includes("css-meta") || tokenType.includes("css-property")); |
| - if (isDisabledProperty) { |
| + if (disabledProperty) { |
| result = result.trimRight() + indentation + token; |
| } else if (isPropertyStart) { |
| insideProperty = true; |
| @@ -1461,6 +1461,19 @@ WebInspector.CSSProperty.prototype = { |
| propertyText += token; |
| } |
| } |
| + |
| + /** |
| + * @param {string} text |
| + * @return {boolean} |
| + */ |
| + function isDisabledProperty(text) |
| + { |
| + var colon = text.indexOf(":"); |
| + if (colon === -1) |
| + return false; |
| + var propertyName = text.substring(2, colon).trim(); |
| + return CSS.supports(propertyName, "initial") || propertyName.startsWith("-moz-") || propertyName.startsWith("-o-") || propertyName.startsWith("-webkit-") || propertyName.startsWith("-ms-"); |
|
pfeldman
2016/01/04 21:27:01
You should either query the target (generated) css
lushnikov
2016/01/11 23:52:11
How are your suggestions better than this?
|
| + } |
| }, |
| /** |