Changeset 157598 in webkit
- Timestamp:
- Oct 17, 2013 2:14:46 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r157585 r157598 1 2013-10-17 Nico Weber <thakis@chromium.org> 2 3 Fix three bugs in the equals() implementations for css gradients. 4 https://bugs.webkit.org/show_bug.cgi?id=122987 5 6 Reviewed by Andreas Kling. 7 8 1. Linear gradients were considered equal if the first gradient has no x and y 9 position and the second has no x but does have y. 10 2. Same as 1, for radial gradients. (This doesn't happen in practice as 11 CSSParser::parseRadialGradient rejects such input, so no test for this case.) 12 3. Radial gradients without x and y position weren't considered equal even if 13 they were. 14 15 Merges https://codereview.chromium.org/26147006/ 16 17 * cssom/cssvalue-comparison-expected.txt: 18 * cssom/cssvalue-comparison.html: 19 1 20 2013-10-17 Roger Fong <roger_fong@apple.com> 2 21 -
trunk/LayoutTests/cssom/cssvalue-comparison-expected.txt
r142444 r157598 67 67 PASS Two CSSValues "-webkit-gradient(radial, 45 45, 0, 52 50, 0, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62))" for property "background" are equal. 68 68 PASS Two CSSValues "-webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000))" and "-webkit-gradient(radial, 45 45, 0, 52 50, 0, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62))" for property "background" are not equal. 69 PASS Two CSSValues "radial-gradient(circle, #ccc, #000)" for property "background" are equal. 70 PASS Two CSSValues "linear-gradient(#000, #234)" for property "background" are equal. 71 PASS Two CSSValues "linear-gradient(to top, #000, #234)" for property "background" are equal. 72 PASS Two CSSValues "linear-gradient(#000, #234)" and "linear-gradient(to top, #000, #234)" for property "background" are not equal. 69 73 PASS Two CSSValues "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)" for property "background-image" are equal. 70 74 PASS Two CSSValues "-webkit-cross-fade(url(dummy://background.png), url(dummy://foreground.png), 80%)" for property "background-image" are equal. -
trunk/LayoutTests/cssom/cssvalue-comparison.html
r142444 r157598 51 51 {"font" : ["italic bold 12px/30px arial", "italic bold 8px/16px helvetica"]}, // font 52 52 {"background" : ["-webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000))", "-webkit-gradient(radial, 45 45, 0, 52 50, 0, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62))"]}, // gradients 53 {"background" : ["radial-gradient(circle, #ccc, #000)"]}, // gradients 54 {"background" : ["linear-gradient(#000, #234)", "linear-gradient(to top, #000, #234)"]}, // gradients 53 55 {"background-image" : ["-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)", "-webkit-cross-fade(url(dummy://background.png), url(dummy://foreground.png), 80%)"]}, // crossfade 54 56 {"-webkit-box-reflect" : ["below 10px", "below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(10, 55, 234, 1)))"]}, // reflect -
trunk/Source/WebCore/ChangeLog
r157597 r157598 1 2013-10-17 Nico Weber <thakis@chromium.org> 2 3 Fix three bugs in the equals() implementations for css gradients. 4 https://bugs.webkit.org/show_bug.cgi?id=122987 5 6 Reviewed by Andreas Kling. 7 8 1. Linear gradients were considered equal if the first gradient has no x and y 9 position and the second has no x but does have y. 10 2. Same as 1, for radial gradients. (This doesn't happen in practice as 11 CSSParser::parseRadialGradient rejects such input, so no test for this case.) 12 3. Radial gradients without x and y position weren't considered equal even if 13 they were. 14 15 * css/CSSGradientValue.cpp: 16 (WebCore::CSSLinearGradientValue::equals): 17 (WebCore::CSSRadialGradientValue::equals): 18 1 19 2013-10-17 Antoine Quint <graouts@apple.com> 2 20 -
trunk/Source/WebCore/css/CSSGradientValue.cpp
r156964 r157598 727 727 return false; 728 728 729 bool equalX orY = false;729 bool equalXandY = false; 730 730 if (m_firstX && m_firstY) 731 equalX orY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY);731 equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY); 732 732 else if (m_firstX) 733 equalX orY =compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY;733 equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY; 734 734 else if (m_firstY) 735 equalX orY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX;735 equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX; 736 736 else 737 equalX orY = !other.m_firstX ||!other.m_firstY;738 739 return equalX orY && m_stops == other.m_stops;737 equalXandY = !other.m_firstX && !other.m_firstY; 738 739 return equalXandY && m_stops == other.m_stops; 740 740 } 741 741 … … 1139 1139 return false; 1140 1140 1141 bool equalX orY = false;1141 bool equalXandY = false; 1142 1142 if (m_firstX && m_firstY) 1143 equalX orY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY);1143 equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && compareCSSValuePtr(m_firstY, other.m_firstY); 1144 1144 else if (m_firstX) 1145 equalX orY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY;1145 equalXandY = compareCSSValuePtr(m_firstX, other.m_firstX) && !other.m_firstY; 1146 1146 else if (m_firstY) 1147 equalX orY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX;1147 equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_firstX; 1148 1148 else 1149 equalX orY == !other.m_firstX ||!other.m_firstY;1150 1151 if (!equalX orY)1149 equalXandY = !other.m_firstX && !other.m_firstY; 1150 1151 if (!equalXandY) 1152 1152 return false; 1153 1153
Note: See TracChangeset
for help on using the changeset viewer.