Chromium Code Reviews| Index: Source/core/paint/BoxPainter.cpp |
| diff --git a/Source/core/paint/BoxPainter.cpp b/Source/core/paint/BoxPainter.cpp |
| index 0bc798c3cd89adfa744ca3ee0911696327ff4c2f..62d96e5d668c74b307a56923c61c2861f024e2fc 100644 |
| --- a/Source/core/paint/BoxPainter.cpp |
| +++ b/Source/core/paint/BoxPainter.cpp |
| @@ -662,18 +662,18 @@ bool BoxPainter::isDocumentElementWithOpaqueBackground(LayoutObject& obj) |
| return isOpaque; |
| } |
| -// Return the amount of space to leave between image tiles for the background-repeat: space property. |
| +// Return the amount of characterSpace to leave between image tiles for the background-repeat: characterSpace property. |
|
jsbell
2015/05/05 17:29:53
This comment change is bogus
|
| static inline int getSpaceBetweenImageTiles(int areaSize, int tileSize) |
| { |
| int numberOfTiles = areaSize / tileSize; |
| - int space = -1; |
| + int characterSpace = -1; |
|
jsbell
2015/05/05 17:29:53
This change is incorrect - it's a local variable,
|
| if (numberOfTiles > 1) { |
| // Spec doesn't specify rounding, so use the same method as for background-repeat: round. |
| - space = lroundf((areaSize - numberOfTiles * tileSize) / (float)(numberOfTiles - 1)); |
| + characterSpace = lroundf((areaSize - numberOfTiles * tileSize) / (float)(numberOfTiles - 1)); |
| } |
| - return space; |
| + return characterSpace; |
| } |
| void BoxPainter::calculateBackgroundImageGeometry(LayoutBoxModelObject& obj, const LayoutBoxModelObject* paintContainer, const FillLayer& fillLayer, const LayoutRect& paintRect, |
| @@ -796,12 +796,12 @@ void BoxPainter::calculateBackgroundImageGeometry(LayoutBoxModelObject& obj, con |
| geometry.setPhaseX(geometry.tileSize().width() ? geometry.tileSize().width() - roundToInt(computedXPosition + left) % geometry.tileSize().width() : 0); |
| geometry.setSpaceSize(IntSize()); |
| } else if (backgroundRepeatX == SpaceFill && fillTileSize.width() > 0) { |
| - int space = getSpaceBetweenImageTiles(positioningAreaSize.width(), geometry.tileSize().width()); |
| - int actualWidth = geometry.tileSize().width() + space; |
| + int characterSpace = getSpaceBetweenImageTiles(positioningAreaSize.width(), geometry.tileSize().width()); |
|
jsbell
2015/05/05 17:29:53
Ditto.
|
| + int actualWidth = geometry.tileSize().width() + characterSpace; |
| - if (space >= 0) { |
| + if (characterSpace >= 0) { |
| computedXPosition = roundedMinimumValueForLength(Length(), availableWidth); |
| - geometry.setSpaceSize(IntSize(space, 0)); |
| + geometry.setSpaceSize(IntSize(characterSpace, 0)); |
| geometry.setPhaseX(actualWidth ? actualWidth - roundToInt(computedXPosition + left) % actualWidth : 0); |
| } else { |
| backgroundRepeatX = NoRepeatFill; |
| @@ -817,12 +817,12 @@ void BoxPainter::calculateBackgroundImageGeometry(LayoutBoxModelObject& obj, con |
| geometry.setPhaseY(geometry.tileSize().height() ? geometry.tileSize().height() - roundToInt(computedYPosition + 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()); |
| - int actualHeight = geometry.tileSize().height() + space; |
| + int characterSpace = getSpaceBetweenImageTiles(positioningAreaSize.height(), geometry.tileSize().height()); |
|
jsbell
2015/05/05 17:29:53
Ditto.
|
| + int actualHeight = geometry.tileSize().height() + characterSpace; |
| - if (space >= 0) { |
| + if (characterSpace >= 0) { |
| computedYPosition = roundedMinimumValueForLength(Length(), availableHeight); |
| - geometry.setSpaceSize(IntSize(geometry.spaceSize().width(), space)); |
| + geometry.setSpaceSize(IntSize(geometry.spaceSize().width(), characterSpace)); |
| geometry.setPhaseY(actualHeight ? actualHeight - roundToInt(computedYPosition + top) % actualHeight : 0); |
| } else { |
| backgroundRepeatY = NoRepeatFill; |