Chromium Code Reviews| Index: Source/core/paint/BackgroundImageGeometry.cpp |
| diff --git a/Source/core/paint/BackgroundImageGeometry.cpp b/Source/core/paint/BackgroundImageGeometry.cpp |
| index d4a3bedff08bf0af15358b19fe13c291f3f5f1f4..aa1151313dcfd83af950c2162dc3eb2171556dd6 100644 |
| --- a/Source/core/paint/BackgroundImageGeometry.cpp |
| +++ b/Source/core/paint/BackgroundImageGeometry.cpp |
| @@ -156,7 +156,7 @@ void BackgroundImageGeometry::clip(const IntRect& clipRect) |
| void BackgroundImageGeometry::calculate(const LayoutBoxModelObject& obj, const LayoutBoxModelObject* paintContainer, |
| const GlobalPaintFlags globalPaintFlags, const FillLayer& fillLayer, const LayoutRect& paintRect, |
| - LayoutObject* backgroundObject) |
| + const IntPoint& accumulatedScrollOffsetSincePaintContainer, LayoutObject* backgroundObject) |
| { |
| LayoutUnit left = 0; |
| LayoutUnit top = 0; |
| @@ -223,10 +223,13 @@ void BackgroundImageGeometry::calculate(const LayoutBoxModelObject& obj, const L |
| setHasNonLocalGeometry(); |
| IntRect viewportRect = pixelSnappedIntRect(obj.viewRect()); |
| - if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) |
| + if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) { |
| viewportRect.setLocation(IntPoint()); |
| - else if (FrameView* frameView = obj.view()->frameView()) |
| - viewportRect.setLocation(frameView->scrollPosition()); |
| + } else { |
| + if (FrameView* frameView = obj.view()->frameView()) { |
| + viewportRect.setLocation(frameView->scrollPosition()); |
| + viewportRect.moveBy(accumulatedScrollOffsetSincePaintContainer); |
| + } |
| if (paintContainer) { |
| IntPoint absoluteContainerOffset = roundedIntPoint(paintContainer->localToAbsolute(FloatPoint())); |
|
chrishtr
2015/09/09 17:05:41
localToAbsolute includes scroll offsets...why isn'
Xianzhu
2015/09/09 17:09:09
It includes scroll offsets from root to the paint
chrishtr
2015/09/09 17:29:16
Oh right.
How about replacing your code with mapL
Xianzhu
2015/09/09 20:40:03
This seems not to work because we only need to com
chrishtr
2015/09/09 20:48:15
Maybe just make a one-off method that accumulates
Xianzhu
2015/09/09 22:04:06
Good idea! Done.
|