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

Unified Diff: third_party/WebKit/Source/core/layout/ColumnBalancer.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
diff --git a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
index d56a08a2bcbd8f6b861ad363ce54b84267277f1a..65d3f4cb8a107682d467ffffa3ec44b395e26cc3 100644
--- a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
+++ b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
@@ -66,7 +66,7 @@ void ColumnBalancer::traverseSubtree(const LayoutBox& box)
examineBoxAfterEntering(childBox);
// Unless the child is unsplittable, or if the child establishes an inner multicol
// container, we descend into its subtree for further examination.
- if (!childBox.isUnsplittableForPagination()
+ if (childBox.paginationBreakability() != LayoutBox::ForbidBreaks
&& (!childBox.isLayoutBlockFlow() || !toLayoutBlockFlow(childBox).multiColumnFlowThread()))
traverseSubtree(childBox);
examineBoxBeforeLeaving(childBox);
@@ -216,10 +216,11 @@ void MinimumSpaceShortageFinder::examineBoxAfterEntering(const LayoutBox& box)
// Look for breaks before the child box.
bool isFirstAfterBreak = this->isFirstAfterBreak(flowThreadOffset());
ASSERT(isFirstAfterBreak || !box.paginationStrut());
+ LayoutBox::PaginationBreakability breakability = box.paginationBreakability();
if (isFirstAfterBreak && !box.hasForcedBreakBefore()) {
// This box is first after a soft break.
LayoutUnit strut = box.paginationStrut();
- if (box.isUnsplittableForPagination()) {
+ if (breakability == LayoutBox::ForbidBreaks) {
// Since we cannot break inside the box, just figure out how much more space we would
// need to prevent it from being pushed to the next column.
recordSpaceShortage(box.logicalHeight() - strut);
@@ -233,7 +234,7 @@ void MinimumSpaceShortageFinder::examineBoxAfterEntering(const LayoutBox& box)
}
}
- if (!box.isUnsplittableForPagination()) {
+ if (breakability != LayoutBox::ForbidBreaks) {
// See if this breakable box crosses column boundaries.
LayoutUnit bottomInFlowThread = flowThreadOffset() + box.logicalHeight();
if (isFirstAfterBreak || group().columnLogicalTopForOffset(flowThreadOffset()) != group().columnLogicalTopForOffset(bottomInFlowThread)) {
@@ -250,7 +251,7 @@ void MinimumSpaceShortageFinder::examineBoxAfterEntering(const LayoutBox& box)
void MinimumSpaceShortageFinder::examineBoxBeforeLeaving(const LayoutBox& box)
{
- if (m_pendingStrut == LayoutUnit::min() || !box.isUnsplittableForPagination())
+ if (m_pendingStrut == LayoutUnit::min() || box.paginationBreakability() != LayoutBox::ForbidBreaks)
return;
// The previous break was before a breakable block. Here's the first piece of unbreakable
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698