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

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

Issue 1876713003: Resurrect ASSERT(isFirstAfterBreak(flowThreadOffset()) || !box.paginationStrut()). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 abe44457319e7623e367c2421403985614aae554..3023993789bdeda86e8e50571691a2fda2d9f2e5 100644
--- a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
+++ b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
@@ -102,10 +102,12 @@ void InitialColumnHeightFinder::examineBoxAfterEntering(const LayoutBox& box)
if (isLogicalTopWithinBounds(flowThreadOffset() - box.paginationStrut())) {
if (box.needsForcedBreakBefore(previousBreakAfterValue())) {
addContentRun(flowThreadOffset());
- } else if (isFirstAfterBreak(flowThreadOffset())) {
- // This box is first after a soft break.
+ } else {
ASSERT(isFirstAfterBreak(flowThreadOffset()) || !box.paginationStrut());
- recordStrutBeforeOffset(flowThreadOffset(), box.paginationStrut());
+ if (isFirstAfterBreak(flowThreadOffset())) {
+ // This box is first after a soft break.
+ recordStrutBeforeOffset(flowThreadOffset(), box.paginationStrut());
+ }
}
}
@@ -245,19 +247,21 @@ void MinimumSpaceShortageFinder::examineBoxAfterEntering(const LayoutBox& box)
if (isLogicalTopWithinBounds(flowThreadOffset() - box.paginationStrut())) {
if (box.needsForcedBreakBefore(previousBreakAfterValue())) {
m_forcedBreaksCount++;
- } else if (isFirstAfterBreak(flowThreadOffset())) {
- // This box is first after a soft break.
+ } else {
ASSERT(isFirstAfterBreak(flowThreadOffset()) || !box.paginationStrut());
- LayoutUnit strut = box.paginationStrut();
- // Figure out how much more space we would need to prevent it from being pushed to the next column.
- recordSpaceShortage(box.logicalHeight() - strut);
- if (breakability != LayoutBox::ForbidBreaks && m_pendingStrut == LayoutUnit::min()) {
- // We now want to look for the first piece of unbreakable content (e.g. a line or a
- // block-displayed image) inside this block. That ought to be a good candidate for
- // minimum space shortage; a much better one than reporting space shortage for the
- // entire block (which we'll also do (further down), in case we couldn't find anything
- // more suitable).
- m_pendingStrut = strut;
+ if (isFirstAfterBreak(flowThreadOffset())) {
+ // This box is first after a soft break.
+ LayoutUnit strut = box.paginationStrut();
+ // Figure out how much more space we would need to prevent it from being pushed to the next column.
+ recordSpaceShortage(box.logicalHeight() - strut);
+ if (breakability != LayoutBox::ForbidBreaks && m_pendingStrut == LayoutUnit::min()) {
+ // We now want to look for the first piece of unbreakable content (e.g. a line or a
+ // block-displayed image) inside this block. That ought to be a good candidate for
+ // minimum space shortage; a much better one than reporting space shortage for the
+ // entire block (which we'll also do (further down), in case we couldn't find anything
+ // more suitable).
+ m_pendingStrut = strut;
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698