diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index a6b17bf1962e..cc0e5ed939d1 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -2354,6 +2354,8 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext, // stops have been normalized. gfxPoint gradientStart = lineStart + (lineEnd - lineStart)*stopOrigin; gfxPoint gradientEnd = lineStart + (lineEnd - lineStart)*stopEnd; + gfxPoint gradientStopStart = lineStart + (lineEnd - lineStart)*firstStop; + gfxPoint gradientStopEnd = lineStart + (lineEnd - lineStart)*lastStop; if (stopDelta == 0.0) { // Stops are all at the same place. For repeating gradients, this will @@ -2363,6 +2365,7 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext, // our stops will be at 0.0; we just need to set the direction vector // correctly. gradientEnd = gradientStart + (lineEnd - lineStart); + gradientStopEnd = gradientStopStart + (lineEnd - lineStart); } gradientPattern = new gfxPattern(gradientStart.x, gradientStart.y, @@ -2372,10 +2375,10 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext, // to the right edge of a tile, then we can repeat by just repeating the // gradient. if (!cellContainsFill && - ((gradientStart.y == gradientEnd.y && gradientStart.x == 0 && - gradientEnd.x == oneCellArea.width) || - (gradientStart.x == gradientEnd.x && gradientStart.y == 0 && - gradientEnd.y == oneCellArea.height))) { + ((gradientStopStart.y == gradientStopEnd.y && gradientStopStart.x == 0 && + gradientStopEnd.x == oneCellArea.width) || + (gradientStopStart.x == gradientStopEnd.x && gradientStopStart.y == 0 && + gradientStopEnd.y == oneCellArea.height))) { forceRepeatToCoverTiles = true; } } else { diff --git a/layout/reftests/css-gradients/bug-916535-background-repeat-linear-ref.html b/layout/reftests/css-gradients/bug-916535-background-repeat-linear-ref.html new file mode 100644 index 000000000000..c4c0a8b9cde8 --- /dev/null +++ b/layout/reftests/css-gradients/bug-916535-background-repeat-linear-ref.html @@ -0,0 +1,24 @@ + + + + + + Grid + + + + +
+
+
+
+
+
+ + diff --git a/layout/reftests/css-gradients/bug-916535-background-repeat-linear.html b/layout/reftests/css-gradients/bug-916535-background-repeat-linear.html new file mode 100644 index 000000000000..995c9e04100a --- /dev/null +++ b/layout/reftests/css-gradients/bug-916535-background-repeat-linear.html @@ -0,0 +1,25 @@ + + + + + + Grid + + + + +
+ + diff --git a/layout/reftests/css-gradients/reftest.list b/layout/reftests/css-gradients/reftest.list index aed1a8a20aad..62c121395b1a 100644 --- a/layout/reftests/css-gradients/reftest.list +++ b/layout/reftests/css-gradients/reftest.list @@ -136,3 +136,4 @@ fuzzy-if(d2d,47,400) == linear-onestopposition-1.html linear-onestopposition-1-r == repeating-radial-onestopposition-1a.html orange-square.html == repeating-radial-onestopposition-1b.html orange-square.html == repeating-radial-onestopposition-1c.html orange-square.html +== bug-916535-background-repeat-linear.html bug-916535-background-repeat-linear-ref.html