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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp

Issue 1406993009: Revert "CSS Custom Properties (Variables)" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
index 47752a01be89c89a84a64deefdd8f9a8afbbccb0..a9c2c3fd23485341f1c1488774e71c557a1df671 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
@@ -5,7 +5,6 @@
#include "config.h"
#include "core/css/parser/CSSParserImpl.h"
-#include "core/css/CSSCustomPropertyDeclaration.h"
#include "core/css/CSSKeyframesRule.h"
#include "core/css/CSSStyleSheet.h"
#include "core/css/StylePropertySet.h"
@@ -21,7 +20,6 @@
#include "core/css/parser/CSSSelectorParser.h"
#include "core/css/parser/CSSSupportsParser.h"
#include "core/css/parser/CSSTokenizer.h"
-#include "core/css/parser/CSSVariableParser.h"
#include "core/css/parser/MediaQueryParser.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
@@ -58,13 +56,10 @@ static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr
const CSSProperty& property = input[i];
if (property.isImportant() != important)
continue;
- const unsigned propertyIDIndex = property.id();
- // All custom properties use the same CSSPropertyID so we can't remove repeated definitions
- if (property.id() != CSSPropertyVariable) {
- if (seenProperties.get(propertyIDIndex))
- continue;
- seenProperties.set(propertyIDIndex);
- }
+ const unsigned propertyIDIndex = property.id() - firstCSSProperty;
+ if (seenProperties.get(propertyIDIndex))
+ continue;
+ seenProperties.set(propertyIDIndex);
output[--unusedEntries] = property;
}
}
@@ -677,8 +672,7 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Typ
CSSParserTokenRange rangeCopy = range; // For inspector callbacks
ASSERT(range.peek().type() == IdentToken);
- const CSSParserToken& token = range.consumeIncludingWhitespace();
- CSSPropertyID unresolvedProperty = token.parseAsUnresolvedCSSPropertyID();
+ CSSPropertyID unresolvedProperty = range.consumeIncludingWhitespace().parseAsUnresolvedCSSPropertyID();
if (range.consume().type() != ColonToken)
return; // Parse error
@@ -696,11 +690,6 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Typ
declarationValueEnd = last;
}
}
- if (RuntimeEnabledFeatures::cssVariablesEnabled() && unresolvedProperty == CSSPropertyInvalid && CSSVariableParser::isValidVariableName(token)) {
- AtomicString variableName = token.value();
- consumeVariableDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEnd), variableName, important);
- return;
- }
if (important && (ruleType == StyleRule::FontFace || ruleType == StyleRule::Keyframes))
return;
@@ -721,12 +710,6 @@ void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Typ
consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEnd), unresolvedProperty, important, ruleType);
}
-void CSSParserImpl::consumeVariableDeclarationValue(CSSParserTokenRange range, const AtomicString& variableName, bool important)
-{
- if (RefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> value = CSSVariableParser::parseDeclarationValue(variableName, range))
- m_parsedProperties.append(CSSProperty(CSSPropertyVariable, value.release(), important));
-}
-
void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSPropertyID unresolvedProperty, bool important, StyleRule::Type ruleType)
{
CSSPropertyParser::parseValue(unresolvedProperty, important, range, m_context, m_parsedProperties, ruleType);
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserImpl.h ('k') | third_party/WebKit/Source/core/css/parser/CSSParserToken.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698