Index: Source/core/paint/BoxPainter.cpp |
diff --git a/Source/core/paint/BoxPainter.cpp b/Source/core/paint/BoxPainter.cpp |
index 54efc4195fc86b688a74f6836b1cd66eb379ae01..c801060b6e2ba202a206cd1da8046ce4c794ec35 100644 |
--- a/Source/core/paint/BoxPainter.cpp |
+++ b/Source/core/paint/BoxPainter.cpp |
@@ -711,7 +711,8 @@ void BoxPainter::calculateBackgroundImageGeometry(LayoutBoxModelObject& obj, con |
} |
if (backgroundRepeatX == RepeatFill) { |
- geometry.setPhaseX(geometry.tileSize().width() ? geometry.tileSize().width() - roundToInt(computedXPosition + left) % geometry.tileSize().width() : 0); |
+ int xOffset = fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition; |
+ geometry.setPhaseX(geometry.tileSize().width() ? geometry.tileSize().width() - roundToInt(xOffset + left) % geometry.tileSize().width() : 0); |
geometry.setSpaceSize(IntSize()); |
} else if (backgroundRepeatX == SpaceFill && fillTileSize.width() > 0) { |
int space = getSpaceBetweenImageTiles(positioningAreaSize.width(), geometry.tileSize().width()); |
@@ -732,7 +733,8 @@ void BoxPainter::calculateBackgroundImageGeometry(LayoutBoxModelObject& obj, con |
} |
if (backgroundRepeatY == RepeatFill) { |
- geometry.setPhaseY(geometry.tileSize().height() ? geometry.tileSize().height() - roundToInt(computedYPosition + top) % geometry.tileSize().height() : 0); |
+ int yOffset = fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition; |
+ geometry.setPhaseY(geometry.tileSize().height() ? geometry.tileSize().height() - roundToInt(yOffset + top) % geometry.tileSize().height() : 0); |
geometry.setSpaceSize(IntSize(geometry.spaceSize().width(), 0)); |
} else if (backgroundRepeatY == SpaceFill && fillTileSize.height() > 0) { |
int space = getSpaceBetweenImageTiles(positioningAreaSize.height(), geometry.tileSize().height()); |