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

Unified Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 122973002: Refactor the length functions to remove passing around the extra bool parameter for rounding behavi… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Try again Created 6 years, 12 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 | « Source/core/css/CSSLengthFunctions.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 9113f1ab58ea6e7fc00a822c88bec84c9213e3f9..dd0d2b75833fa37e971e04b94475670cb2b2e4c9 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -27,8 +27,8 @@
#include "core/rendering/RenderBoxModelObject.h"
#include "HTMLNames.h"
-#include "core/html/HTMLFrameOwnerElement.h"
#include "core/frame/Settings.h"
+#include "core/html/HTMLFrameOwnerElement.h"
#include "core/page/scrolling/ScrollingConstraints.h"
#include "core/rendering/CompositedLayerMapping.h"
#include "core/rendering/ImageQualityController.h"
@@ -1062,7 +1062,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
int availableWidth = positioningAreaSize.width() - geometry.tileSize().width();
int availableHeight = positioningAreaSize.height() - geometry.tileSize().height();
- LayoutUnit computedXPosition = minimumValueForLength(fillLayer->xPosition(), availableWidth, true);
+ LayoutUnit computedXPosition = roundedMinimumValueForLength(fillLayer->xPosition(), availableWidth);
if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > 0 && fillTileSize.width() > 0) {
long nrTiles = max(1l, lroundf((float)positioningAreaSize.width() / fillTileSize.width()));
@@ -1076,7 +1076,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
geometry.setSpaceSize(IntSize());
}
- LayoutUnit computedYPosition = minimumValueForLength(fillLayer->yPosition(), availableHeight, true);
+ LayoutUnit computedYPosition = roundedMinimumValueForLength(fillLayer->yPosition(), availableHeight);
if (backgroundRepeatY == RoundFill && positioningAreaSize.height() > 0 && fillTileSize.height() > 0) {
long nrTiles = max(1l, lroundf((float)positioningAreaSize.height() / fillTileSize.height()));
@@ -1098,7 +1098,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
int actualWidth = geometry.tileSize().width() + space;
if (space >= 0) {
- computedXPosition = minimumValueForLength(Length(), availableWidth, true);
+ computedXPosition = roundedMinimumValueForLength(Length(), availableWidth);
geometry.setSpaceSize(IntSize(space, 0));
geometry.setPhaseX(actualWidth ? actualWidth - roundToInt(computedXPosition + left) % actualWidth : 0);
} else {
@@ -1119,7 +1119,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
int actualHeight = geometry.tileSize().height() + space;
if (space >= 0) {
- computedYPosition = minimumValueForLength(Length(), availableHeight, true);
+ computedYPosition = roundedMinimumValueForLength(Length(), availableHeight);
geometry.setSpaceSize(IntSize(geometry.spaceSize().width(), space));
geometry.setPhaseY(actualHeight ? actualHeight - roundToInt(computedYPosition + top) % actualHeight : 0);
} else {
« no previous file with comments | « Source/core/css/CSSLengthFunctions.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698