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 @@ + + + +
+ +