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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParser.cpp

Issue 1863793003: Make CSSValuePool thread local to ensure correct parsing in colors on workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with master Created 4 years, 8 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/parser/CSSParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
index 075226045b4d2fee237b3a77fe402e4f3fee58a9..1f75bbf3e5ad33097f058395b8cfb06397ee3a7b 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
@@ -132,7 +132,7 @@ bool CSSParser::parseSupportsCondition(const String& condition)
return CSSSupportsParser::supportsCondition(scope.tokenRange(), parser) == CSSSupportsParser::Supported;
}
-bool CSSParser::parseColor(Color& color, const String& string, bool strict)
+bool CSSParser::parseColor(Color& color, const String& string, CSSValuePool* localCssValuePool, bool strict)
{
if (string.isEmpty())
return false;
@@ -145,7 +145,13 @@ bool CSSParser::parseColor(Color& color, const String& string, bool strict)
return true;
}
- RawPtr<CSSValue> value = CSSParserFastPaths::parseColor(string, strict ? HTMLStandardMode : HTMLQuirksMode);
+ RawPtr<CSSValue> value;
+ if (!localCssValuePool) {
+ value = CSSParserFastPaths::parseColor(string, strict ? HTMLStandardMode : HTMLQuirksMode, &cssValuePool());
+ } else {
+ value = CSSParserFastPaths::parseColor(string, strict ? HTMLStandardMode : HTMLQuirksMode, localCssValuePool);
+ }
+
// TODO(timloh): Why is this always strict mode?
if (!value)
value = parseSingleValue(CSSPropertyColor, string, strictCSSParserContext());
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParser.h ('k') | third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698