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

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

Issue 2394913003: Fixed pos objects are offset from the top of the page in paged media (Closed)
Patch Set: bug 652449 Created 4 years, 2 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
Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 8b06af2b00db6562533cf9dc589dd73e74471493..d72d2566b16a9d200eab52df317fb430d950e859 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -608,6 +608,13 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerWithTransform(
unsigned pages =
ceilf(view->documentRect().height() / view->pageLogicalHeight());
LayoutPoint paginationOffset;
+
+ // The fixed position object is offset from the top of the page, so remove
+ // any scroll offset.
+ LayoutPoint offsetFromRoot;
+ m_paintLayer.convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot);
+ paginationOffset -= offsetFromRoot - m_paintLayer.location();
+
for (unsigned i = 0; i < pages; i++) {
PaintLayerFragment fragment;
fragment.backgroundRect = paintingInfo.paintDirtyRect;

Powered by Google App Engine
This is Rietveld 408576698