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

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

Issue 1405293012: [Variables] Enable get/setProperty and similar APIs from the CSSOM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use static_assert. 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/CSSParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
index 4e84fa1a883d67b3d19ca6a19f7a3410cdde14ea..fc5ce6a683c96af1e8db903b1177230c048f7e9e 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
@@ -17,6 +17,7 @@
#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/layout/LayoutTheme.h"
namespace blink {
@@ -69,6 +70,20 @@ bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u
return parseValue(declaration, unresolvedProperty, string, important, context);
}
+bool CSSParser::parseValueForCustomProperty(MutableStylePropertySet* declaration, const AtomicString& propertyName, const String& value, bool important, StyleSheetContents* styleSheet)
+{
+ ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::isValidVariableName(propertyName));
+ if (value.isEmpty())
+ return false;
+ CSSParserMode parserMode = declaration->cssParserMode();
+ CSSParserContext context(parserMode, 0);
+ if (styleSheet) {
+ context = styleSheet->parserContext();
+ context.setMode(parserMode);
+ }
+ return CSSParserImpl::parseVariableValue(declaration, propertyName, value, important, context);
+}
+
bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID unresolvedProperty, const String& string, bool important, const CSSParserContext& context)
{
return CSSParserImpl::parseValue(declaration, unresolvedProperty, string, important, context);
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParser.h ('k') | third_party/WebKit/Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698