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

Unified Diff: Source/core/css/CSSGradientValue.cpp

Issue 26147006: Fix three bugs in the equals() implementations for css gradients. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 7 years, 2 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
« no previous file with comments | « LayoutTests/cssom/cssvalue-comparison-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSGradientValue.cpp
diff --git a/Source/core/css/CSSGradientValue.cpp b/Source/core/css/CSSGradientValue.cpp
index 5f27525f6b7d36d0b185b724ce4625ed25fafc9a..089190c13dd114fac59f705bed5504e1a597093c 100644
--- a/Source/core/css/CSSGradientValue.cpp
+++ b/Source/core/css/CSSGradientValue.cpp
@@ -723,17 +723,17 @@ bool CSSLinearGradientValue::equals(const CSSLinearGradientValue& other) const
if (other.m_angle)
return false;
- bool equalXorY = false;
+ bool equalXandY = false;
if (m_firstX && m_firstY)
- equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY);
+ equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY);
else if (m_firstX)
- equalXorY =compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY;
+ equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY;
else if (m_firstY)
- equalXorY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX;
+ equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX;
else
- equalXorY = !other.m_firstX || !other.m_firstY;
+ equalXandY = !other.m_firstX && !other.m_firstY;
- return equalXorY && m_stops == other.m_stops;
+ return equalXandY && m_stops == other.m_stops;
}
String CSSRadialGradientValue::customCSSText() const
@@ -1137,17 +1137,17 @@ bool CSSRadialGradientValue::equals(const CSSRadialGradientValue& other) const
if (m_repeating != other.m_repeating)
return false;
- bool equalXorY = false;
+ bool equalXandY = false;
if (m_firstX && m_firstY)
- equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY);
+ equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY);
else if (m_firstX)
- equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY;
+ equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY;
else if (m_firstY)
- equalXorY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX;
+ equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX;
else
- equalXorY == !other.m_firstX || !other.m_firstY;
+ equalXandY = !other.m_firstX && !other.m_firstY;
- if (!equalXorY)
+ if (!equalXandY)
return false;
bool equalShape = true;
« no previous file with comments | « LayoutTests/cssom/cssvalue-comparison-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698