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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserToken.h

Issue 1537523003: Add correct equality testing for ComputedStyle's StyleVariableData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/CSSParserToken.h
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserToken.h b/third_party/WebKit/Source/core/css/parser/CSSParserToken.h
index e4a12c3f55b0906ee9b9bee5f79aa05702ce0357..88d00dc7f257ee8f4b7a751997331e4774366a46 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserToken.h
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserToken.h
@@ -82,6 +82,39 @@ public:
CSSParserToken(HashTokenType, CSSParserString);
+ bool operator==(const CSSParserToken& other) const
+ {
+ if (m_type != other.m_type)
+ return false;
+ switch (m_type) {
+ case DelimiterToken:
+ return delimiter() == other.delimiter();
+ case HashToken:
+ if (m_hashTokenType != other.m_hashTokenType)
+ return false;
+ // fallthrough
+ case IdentToken:
+ case FunctionToken:
+ case StringToken:
+ case UrlToken:
+ return m_valueDataCharRaw == other.m_valueDataCharRaw && m_valueLength == other.m_valueLength && m_valueIs8Bit == other.m_valueIs8Bit;
+ case NumberToken:
+ if (m_numericSign != other.m_numericSign)
+ return false;
+ // fallthrough
+ case DimensionToken:
+ if (m_valueDataCharRaw != other.m_valueDataCharRaw || m_valueLength != other.m_valueLength || m_valueIs8Bit != other.m_valueIs8Bit)
+ return false;
+ // fallthrough
+ case PercentageToken:
+ return m_numericValue == other.m_numericValue && m_numericValueType == other.m_numericValueType;
+ case UnicodeRangeToken:
+ return m_unicodeRange.start == other.m_unicodeRange.start && m_unicodeRange.end == other.m_unicodeRange.end;
+ default:
+ return true;
+ }
+ }
+
// Converts NumberToken to DimensionToken.
void convertToDimensionWithUnit(CSSParserString);

Powered by Google App Engine
This is Rietveld 408576698