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

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

Issue 1698203002: Simplify CSS variables resolution logic [1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests 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 fa88637d99730853412e7105d3531a6a6083920b..bb740d87184c906ff91e4cc7d5c190cc88096305 100644
--- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
+++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
@@ -30,25 +30,17 @@ private:
CSSVariableResolver(StyleVariableData*);
CSSVariableResolver(StyleVariableData*, AtomicString& variable);
- struct ResolutionState {
- bool success;
- // Resolution doesn't finish when a cycle is detected. Fallbacks still
- // need to be tracked for additional cycles, and invalidation only
- // applies back to cycle starts. This context member tracks all
- // detected cycle start points.
- HashSet<AtomicString> cycleStartPoints;
-
- ResolutionState()
- : success(true)
- { };
- };
-
- void resolveFallback(CSSParserTokenRange, Vector<CSSParserToken>& result, ResolutionState& context);
- void resolveVariableTokensRecursive(CSSParserTokenRange, Vector<CSSParserToken>& result, ResolutionState& context);
- void resolveVariableReferencesFromTokens(CSSParserTokenRange tokens, Vector<CSSParserToken>& result, ResolutionState& context);
+ // Returns false if we encounter a reference to an invalid variable with no fallback
+ bool resolveFallback(CSSParserTokenRange, Vector<CSSParserToken>& result);
+ bool resolveVariableTokensRecursive(CSSParserTokenRange, Vector<CSSParserToken>& result);
+ bool resolveVariableReferencesFromTokens(CSSParserTokenRange tokens, Vector<CSSParserToken>& result);
StyleVariableData* m_styleVariableData;
HashSet<AtomicString> m_variablesSeen;
+ // Resolution doesn't finish when a cycle is detected. Fallbacks still
+ // need to be tracked for additional cycles, and invalidation only
+ // applies back to cycle starts.
+ HashSet<AtomicString> m_cycleStartPoints;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698