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

Unified Diff: Source/core/css/parser/CSSParserValues.h

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT-ed again... Created 5 years, 5 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: Source/core/css/parser/CSSParserValues.h
diff --git a/Source/core/css/parser/CSSParserValues.h b/Source/core/css/parser/CSSParserValues.h
index 0b760f1c510c1c80821ddb17d9dfcf286d1e92d8..8ff4a51e6242cc9a3e7c8564447651b8a8b5f769 100644
--- a/Source/core/css/parser/CSSParserValues.h
+++ b/Source/core/css/parser/CSSParserValues.h
@@ -26,6 +26,7 @@
#include "core/css/CSSSelector.h"
#include "core/css/CSSValueList.h"
#include "core/css/parser/CSSParserString.h"
+#include "core/css/parser/CSSTokenizer.h"
namespace blink {
@@ -48,6 +49,7 @@ struct CSSParserValue {
UChar32 start;
UChar32 end;
} m_unicodeRange;
+ CSSVariableData* variableData;
};
enum {
Operator = 0x100000,
@@ -58,6 +60,8 @@ struct CSSParserValue {
DimensionList = 0x100006,
// Represents a unicode range by a pair of UChar32 values
UnicodeRange = 0x100007,
+ // Reperesents a copy of part of a String for defining and resolving variables
+ VariableValue = 0x100008,
};
int unit;
@@ -74,6 +78,7 @@ public:
: m_current(0)
{
}
+ CSSParserValueList(CSSParserTokenRange, const String&, bool& usesRemUnits, bool& usesVariables);
CSSParserValueList(CSSParserTokenRange, bool& usesRemUnits);
~CSSParserValueList();
@@ -101,8 +106,11 @@ public:
void clearAndLeakValues() { m_values.clear(); m_current = 0;}
void destroyAndClear();
-
private:
+ void init(CSSParserTokenRange, bool& usesRemUnits, bool* usesVariables = 0, const String* = 0);
+ void checkForVariableReferencesOrDestroyAndClear(const CSSParserTokenRange& originalRange, const String&);
+ void consumeVariableValue(const CSSParserTokenRange&, const String&);
+
unsigned m_current;
Vector<CSSParserValue, 4> m_values;
};
@@ -202,6 +210,6 @@ inline void CSSParserValue::setFromValueList(PassOwnPtr<CSSParserValueList> valu
isInt = false;
}
-}
+};
#endif

Powered by Google App Engine
This is Rietveld 408576698