Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1399)

Unified Diff: Source/core/paint/BoxPainter.cpp

Issue 1287293002: Use background positioning origin for repeating backgrounds (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/backgrounds/background-position-repeat-rendering-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « LayoutTests/fast/backgrounds/background-position-repeat-rendering-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698