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

Unified Diff: third_party/WebKit/Source/core/css/CSSVariableData.cpp

Issue 1645433002: Basic implementation of @apply (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix expted.txt for failing test Created 4 years, 10 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
Index: third_party/WebKit/Source/core/css/CSSVariableData.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSVariableData.cpp b/third_party/WebKit/Source/core/css/CSSVariableData.cpp
index 75134d96fb3e6a8049893a2d489e8bd525513668..30c6d9c6b15e5d66f12ebce721d242ef9169046a 100644
--- a/third_party/WebKit/Source/core/css/CSSVariableData.cpp
+++ b/third_party/WebKit/Source/core/css/CSSVariableData.cpp
@@ -4,11 +4,22 @@
#include "core/css/CSSVariableData.h"
+#include "core/css/parser/CSSParser.h"
#include "core/css/parser/CSSParserTokenRange.h"
#include "wtf/text/StringBuilder.h"
namespace blink {
+const StylePropertySet* CSSVariableData::propertySet()
+{
+ ASSERT(!m_needsVariableResolution);
+ if (!m_cachedPropertySet) {
+ m_propertySet = CSSParser::parseCustomPropertySet(m_tokens);
+ m_cachedPropertySet = true;
+ }
+ return m_propertySet.get();
+}
+
template<typename CharacterType> void CSSVariableData::updateTokens(const CSSParserTokenRange& range)
{
const CharacterType* currentOffset = m_backingString.getCharacters<CharacterType>();
@@ -55,6 +66,7 @@ void CSSVariableData::consumeAndUpdateTokens(const CSSParserTokenRange& range)
CSSVariableData::CSSVariableData(const CSSParserTokenRange& range, bool needsVariableResolution)
: m_needsVariableResolution(needsVariableResolution)
+ , m_cachedPropertySet(false)
{
ASSERT(!range.atEnd());
consumeAndUpdateTokens(range);

Powered by Google App Engine
This is Rietveld 408576698