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

Unified Diff: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h

Issue 1694133002: Simplify CSS variables resolution logic [2 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/resolver/CSSVariableResolver.h
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
index bb740d87184c906ff91e4cc7d5c190cc88096305..81d69bd8ac721724e466a946dbd214cd86f6b2f6 100644
--- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
+++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
@@ -14,6 +14,7 @@
namespace blink {
class CSSParserTokenRange;
+class CSSVariableData;
class CSSVariableReferenceValue;
class StyleResolverState;
class StyleVariableData;
@@ -28,12 +29,22 @@ public:
private:
CSSVariableResolver(StyleVariableData*);
- CSSVariableResolver(StyleVariableData*, AtomicString& variable);
- // Returns false if we encounter a reference to an invalid variable with no fallback
+ // These return false if we encounter a reference to an invalid variable with no fallback
+
+ // Resolves a range which may contain var() references
+ bool resolveTokenRange(CSSParserTokenRange, Vector<CSSParserToken>& result);
+ // Resolves the fallback (if present) of a var() reference, starting from the comma
bool resolveFallback(CSSParserTokenRange, Vector<CSSParserToken>& result);
- bool resolveVariableTokensRecursive(CSSParserTokenRange, Vector<CSSParserToken>& result);
- bool resolveVariableReferencesFromTokens(CSSParserTokenRange tokens, Vector<CSSParserToken>& result);
+ // Resolves the contents of a var() reference
+ bool resolveVariableReference(CSSParserTokenRange, Vector<CSSParserToken>& result);
+
+ // These return null if the custom property is invalid
+
+ // Returns the CSSVariableData for a custom property, resolving and storing it if necessary
+ CSSVariableData* valueForCustomProperty(AtomicString name);
+ // Resolves the CSSVariableData from a custom property declaration
+ PassRefPtr<CSSVariableData> resolveCustomProperty(AtomicString name, const CSSVariableData&);
StyleVariableData* m_styleVariableData;
HashSet<AtomicString> m_variablesSeen;

Powered by Google App Engine
This is Rietveld 408576698