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

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

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/CSSTokenizer.h
diff --git a/Source/core/css/parser/CSSTokenizer.h b/Source/core/css/parser/CSSTokenizer.h
index 97349c646d55cf85b6de79c87d18d2bd7de70965..a6b21ffa8421920e0384c2806940165ee4b34d84 100644
--- a/Source/core/css/parser/CSSTokenizer.h
+++ b/Source/core/css/parser/CSSTokenizer.h
@@ -19,30 +19,33 @@ class CSSParserObserverWrapper;
struct CSSParserString;
class CSSParserTokenRange;
-class CORE_EXPORT CSSTokenizer {
- WTF_MAKE_NONCOPYABLE(CSSTokenizer);
- WTF_MAKE_FAST_ALLOCATED(CSSTokenizer);
+class CORE_EXPORT CSSTokenizerScope {
leviw_travelin_and_unemployed 2015/06/20 00:58:15 This change is leftover, not intentional/required.
+ WTF_MAKE_FAST_ALLOCATED(CSSTokenizerScope);
public:
- class CORE_EXPORT Scope {
- public:
- Scope(const String&);
- Scope(const String&, CSSParserObserverWrapper&); // For the inspector
+ CSSTokenizerScope(const String&);
+ CSSTokenizerScope(const String&, CSSParserObserverWrapper&); // For the inspector
- CSSParserTokenRange tokenRange();
- unsigned tokenCount();
+ CSSParserTokenRange tokenRange();
+ unsigned tokenCount();
+
+ String string() const { return m_string; }
+public:
+ void storeString(const String& string) { m_stringPool.append(string); }
+ Vector<CSSParserToken> m_tokens;
+ // We only allocate strings when escapes are used.
+ Vector<String> m_stringPool;
+ String m_string;
- private:
- void storeString(const String& string) { m_stringPool.append(string); }
- Vector<CSSParserToken> m_tokens;
- // We only allocate strings when escapes are used.
- Vector<String> m_stringPool;
- String m_string;
+ bool m_hasVariableReference;
- friend class CSSTokenizer;
- };
+ friend class CSSTokenizer;
+};
+class CORE_EXPORT CSSTokenizer {
+ WTF_MAKE_NONCOPYABLE(CSSTokenizer);
+ WTF_MAKE_FAST_ALLOCATED(CSSTokenizer);
private:
- CSSTokenizer(CSSTokenizerInputStream&, Scope&);
+ CSSTokenizer(CSSTokenizerInputStream&, CSSTokenizerScope&);
CSSParserToken nextToken();
@@ -58,12 +61,13 @@ private:
CSSParserToken consumeUrlToken();
void consumeBadUrlRemnants();
- void consumeUntilNonWhitespace();
+ unsigned consumeUntilNonWhitespace();
void consumeSingleWhitespaceIfNext();
void consumeUntilCommentEndFound();
bool consumeIfNext(UChar);
CSSParserString consumeName();
+ CSSParserString lastConsumedCharacter();
UChar32 consumeEscape();
bool nextTwoCharsAreValidEscape();
@@ -110,8 +114,10 @@ private:
CSSParserString registerString(const String&);
+ friend class CSSTokenizerScope;
+
CSSTokenizerInputStream& m_input;
- Scope& m_scope;
+ CSSTokenizerScope& m_scope;
};

Powered by Google App Engine
This is Rietveld 408576698