Changeset 142444 in webkit for trunk/Source/WebCore/css/CSSGradientValue.cpp
- Timestamp:
- Feb 11, 2013, 3:00:54 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSGradientValue.cpp
r141637 r142444 724 724 } 725 725 726 bool CSSLinearGradientValue::equals(const CSSLinearGradientValue& other) const 727 { 728 if (m_gradientType == CSSDeprecatedLinearGradient) 729 return other.m_gradientType == m_gradientType 730 && compareCSSValuePtr(m_firstX, other.m_firstX) 731 && compareCSSValuePtr(m_firstY, other.m_firstY) 732 && compareCSSValuePtr(m_secondX, other.m_secondX) 733 && compareCSSValuePtr(m_secondY, other.m_secondY) 734 && m_stops == other.m_stops; 735 736 if (m_repeating != other.m_repeating) 737 return false; 738 739 if (m_angle) 740 return compareCSSValuePtr(m_angle, other.m_angle) && m_stops == other.m_stops; 741 742 if (other.m_angle) 743 return false; 744 745 bool equalXorY = false; 746 if (m_firstX && m_firstY) 747 equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY); 748 else if (m_firstX) 749 equalXorY =compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY; 750 else if (m_firstY) 751 equalXorY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX; 752 else 753 equalXorY = !other.m_firstX || !other.m_firstY; 754 755 return equalXorY && m_stops == other.m_stops; 756 } 757 726 758 void CSSLinearGradientValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 727 759 { … … 1113 1145 } 1114 1146 1147 bool CSSRadialGradientValue::equals(const CSSRadialGradientValue& other) const 1148 { 1149 if (m_gradientType == CSSDeprecatedRadialGradient) 1150 return other.m_gradientType == m_gradientType 1151 && compareCSSValuePtr(m_firstX, other.m_firstX) 1152 && compareCSSValuePtr(m_firstY, other.m_firstY) 1153 && compareCSSValuePtr(m_secondX, other.m_secondX) 1154 && compareCSSValuePtr(m_secondY, other.m_secondY) 1155 && compareCSSValuePtr(m_firstRadius, other.m_firstRadius) 1156 && compareCSSValuePtr(m_secondRadius, other.m_secondRadius) 1157 && m_stops == other.m_stops; 1158 1159 if (m_repeating != other.m_repeating) 1160 return false; 1161 1162 bool equalXorY = false; 1163 if (m_firstX && m_firstY) 1164 equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY); 1165 else if (m_firstX) 1166 equalXorY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY; 1167 else if (m_firstY) 1168 equalXorY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX; 1169 else 1170 equalXorY == !other.m_firstX || !other.m_firstY; 1171 1172 if (!equalXorY) 1173 return false; 1174 1175 bool equalShape = true; 1176 bool equalSizingBehavior = true; 1177 bool equalHorizontalAndVerticalSize = true; 1178 1179 if (m_shape) 1180 equalShape = compareCSSValuePtr(m_shape, other.m_shape); 1181 else if (m_sizingBehavior) 1182 equalSizingBehavior = compareCSSValuePtr(m_sizingBehavior, other.m_sizingBehavior); 1183 else if (m_endHorizontalSize && m_endVerticalSize) 1184 equalHorizontalAndVerticalSize = compareCSSValuePtr(m_endHorizontalSize, other.m_endHorizontalSize) && compareCSSValuePtr(m_endVerticalSize, other.m_endVerticalSize); 1185 else { 1186 equalShape = !other.m_shape; 1187 equalSizingBehavior = !other.m_sizingBehavior; 1188 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_endVerticalSize; 1189 } 1190 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize && m_stops == other.m_stops; 1191 } 1192 1115 1193 void CSSRadialGradientValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 1116 1194 {
Note:
See TracChangeset
for help on using the changeset viewer.