| Index: third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
|
| index 16803f4d728d784cef547e7e6e3a9a098f7bec34..a2fc11089a9f3b876d027649c19e7309f2bf34b9 100644
|
| --- a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
|
| @@ -354,13 +354,14 @@ void BackgroundImageGeometry::calculate(const LayoutBoxModelObject& obj, const L
|
| LayoutUnit computedXPosition = roundedMinimumValueForLength(fillLayer.xPosition(), availableWidth);
|
| if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > LayoutUnit() && fillTileSize.width() > LayoutUnit()) {
|
| int nrTiles = std::max(1, roundToInt(positioningAreaSize.width() / fillTileSize.width()));
|
| -
|
| - fillTileSize.setWidth(positioningAreaSize.width() / nrTiles);
|
| + LayoutUnit roundedWidth = positioningAreaSize.width() / nrTiles;
|
|
|
| // Maintain aspect ratio if background-size: auto is set
|
| if (fillLayer.size().size.height().isAuto() && backgroundRepeatY != RoundFill) {
|
| - fillTileSize.setHeight(fillTileSize.height() * positioningAreaSize.width() / (nrTiles * fillTileSize.width()));
|
| + fillTileSize.setHeight(fillTileSize.height() * roundedWidth / fillTileSize.width());
|
| }
|
| + fillTileSize.setWidth(roundedWidth);
|
| +
|
| setTileSize(applySubPixelHeuristicToImageSize(fillTileSize, m_destRect));
|
| setPhaseX(tileSize().width()
|
| ? LayoutUnit(roundf(tileSize().width() - fmodf((computedXPosition + left), tileSize().width())))
|
| @@ -371,13 +372,13 @@ void BackgroundImageGeometry::calculate(const LayoutBoxModelObject& obj, const L
|
| LayoutUnit computedYPosition = roundedMinimumValueForLength(fillLayer.yPosition(), availableHeight);
|
| if (backgroundRepeatY == RoundFill && positioningAreaSize.height() > LayoutUnit() && fillTileSize.height() > LayoutUnit()) {
|
| int nrTiles = std::max(1, roundToInt(positioningAreaSize.height() / fillTileSize.height()));
|
| -
|
| - fillTileSize.setHeight(positioningAreaSize.height() / nrTiles);
|
| -
|
| + LayoutUnit roundedHeight = positioningAreaSize.height() / nrTiles;
|
| // Maintain aspect ratio if background-size: auto is set
|
| if (fillLayer.size().size.width().isAuto() && backgroundRepeatX != RoundFill) {
|
| - fillTileSize.setWidth(fillTileSize.width() * positioningAreaSize.height() / (nrTiles * fillTileSize.height()));
|
| + fillTileSize.setWidth(fillTileSize.width() * roundedHeight / fillTileSize.height());
|
| }
|
| + fillTileSize.setHeight(roundedHeight);
|
| +
|
| setTileSize(applySubPixelHeuristicToImageSize(fillTileSize, m_destRect));
|
| setPhaseY(tileSize().height()
|
| ? LayoutUnit(roundf(tileSize().height() - fmodf((computedYPosition + top), tileSize().height())))
|
|
|