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

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

Issue 2053463003: Use the doc rect to figure out how many pages there are (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@617553
Patch Set: Updated Created 4 years, 6 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 fd8d01590aaed0b1bff70647fbcf87ff17be4011..83863c4d075337f2666a04a68f7b7e4e957c3774 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -482,13 +482,14 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerWithTransform(Graphi
bool isFixedPosObjectInPagedMedia = object->style()->position() == FixedPosition && object->container() == view && view->pageLogicalHeight();
PaintLayer* paginationLayer = m_paintLayer.enclosingPaginationLayer();
PaintLayerFragments fragments;
- if (isFixedPosObjectInPagedMedia) {
+ // TODO(crbug.com/619094): Figure out the correct behaviour for fixed position objects
+ // in paged media with vertical writing modes.
+ if (isFixedPosObjectInPagedMedia && view->isHorizontalWritingMode()) {
// "For paged media, boxes with fixed positions are repeated on every page."
// - https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-positioning
- ASSERT(view->firstChild() && view->firstChild()->isLayoutBlock());
- int pages = static_cast<int>(ceilf(toLayoutBlock(view->firstChild())->logicalHeight() / view->pageLogicalHeight()));
+ unsigned pages = ceilf(view->documentRect().height() / view->pageLogicalHeight());
LayoutPoint paginationOffset;
- for (int i = 0; i < pages; i++) {
+ for (unsigned i = 0; i < pages; i++) {
PaintLayerFragment fragment;
fragment.backgroundRect = paintingInfo.paintDirtyRect;
fragment.paginationOffset = paginationOffset;
« no previous file with comments | « third_party/WebKit/LayoutTests/printing/fixed-positioned-child-repeats-even-when-html-and-body-are-zero-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698