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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js

Issue 1534323003: DevTools: [CSS] do not treat random css comments as disabled properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/CSSMetadata.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d71659df86be9f6d4a93f71172a10d9327c6f246..584b54a9fbe971ba6b23be933244af239bc8fbbc 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") || tokenType.includes("css-variable-2"));
- 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 WebInspector.CSSMetadata.isCSSPropertyName(propertyName);
+ }
},
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/CSSMetadata.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698