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

Unified Diff: third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp

Issue 1431103005: Avoid truncation to int when setting background-position coordinates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Limit test to the bug; background-repeat: no-repeat has further issues Created 5 years, 1 month 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 | « third_party/WebKit/LayoutTests/fast/backgrounds/background-position-zoomed-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d9fb1bd39c6ea698f61867ff0f09ddbc133df42d..8f336f2feb6d8213c7f38599c4be5611b19bebc4 100644
--- a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
+++ b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
@@ -302,7 +302,7 @@ void BackgroundImageGeometry::calculate(const LayoutBoxModelObject& obj, const L
}
if (backgroundRepeatX == RepeatFill) {
- int xOffset = fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition;
+ LayoutUnit xOffset = fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition;
setPhaseX(tileSize().width() ? tileSize().width() - roundToInt(xOffset + left) % tileSize().width() : 0);
setSpaceSize(IntSize());
} else if (backgroundRepeatX == SpaceFill && fillTileSize.width() > 0) {
@@ -318,13 +318,13 @@ void BackgroundImageGeometry::calculate(const LayoutBoxModelObject& obj, const L
}
}
if (backgroundRepeatX == NoRepeatFill) {
- int xOffset = fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition;
+ LayoutUnit xOffset = fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition;
setNoRepeatX(left + xOffset);
setSpaceSize(IntSize(0, spaceSize().height()));
}
if (backgroundRepeatY == RepeatFill) {
- int yOffset = fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition;
+ LayoutUnit yOffset = fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition;
setPhaseY(tileSize().height() ? tileSize().height() - roundToInt(yOffset + top) % tileSize().height() : 0);
setSpaceSize(IntSize(spaceSize().width(), 0));
} else if (backgroundRepeatY == SpaceFill && fillTileSize.height() > 0) {
@@ -340,7 +340,7 @@ void BackgroundImageGeometry::calculate(const LayoutBoxModelObject& obj, const L
}
}
if (backgroundRepeatY == NoRepeatFill) {
- int yOffset = fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition;
+ LayoutUnit yOffset = fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition;
setNoRepeatY(top + yOffset);
setSpaceSize(IntSize(spaceSize().width(), 0));
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/backgrounds/background-position-zoomed-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698