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

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 266f59d3bdc26fbf1519e946160ada2a2d408336..90284da8bac156f154059e8e085813d3bcf70e4d 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -586,6 +586,12 @@ 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.
Xianzhu 2016/10/06 22:40:42 Nit: Wrap at 80 chars. (Though there are other com
+ 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