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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1426673005: Introduce LayoutBox::paginationBreakability(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 1ab0b71934851d9de35c961cbf2786a66a336f35..714418e5044de9582d0b490bc566333d7130a2c7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -4403,12 +4403,21 @@ bool LayoutBox::hasUnsplittableScrollingOverflow() const
|| (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logicalMinHeight().isPositive() && (!style()->logicalMinHeight().hasPercent() || percentageLogicalHeightIsResolvable()));
}
-bool LayoutBox::isUnsplittableForPagination() const
+LayoutBox::PaginationBreakability LayoutBox::paginationBreakability() const
{
- return isReplaced()
+ if (isReplaced()
|| hasUnsplittableScrollingOverflow()
|| (parent() && isWritingModeRoot())
- || (isOutOfFlowPositioned() && style()->position() == FixedPosition);
+ || (isOutOfFlowPositioned() && style()->position() == FixedPosition))
+ return ForbidBreaks;
+
+ bool checkColumnBreaks = flowThreadContainingBlock();
+ bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogicalHeight();
+ bool isUnsplittable = (checkColumnBreaks && style()->columnBreakInside() == PBAVOID)
+ || (checkPageBreaks && style()->pageBreakInside() == PBAVOID);
+ if (isUnsplittable)
+ return AvoidBreaks;
+ return AllowAnyBreaks;
}
LayoutUnit LayoutBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const

Powered by Google App Engine
This is Rietveld 408576698