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

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

Issue 2746013010: Consistent pagination strut propagation policies. (Closed)
Patch Set: Created 3 years, 9 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 | « third_party/WebKit/LayoutTests/fragmentation/block-after-float-first-child-expected.html ('k') | 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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 9a0a90f993fd03c929f4d54c7b9a85bba2ee6781..ef6aeb493e2048877e61076b897b8efaa4ad5b95 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -4124,10 +4124,20 @@ bool LayoutBlockFlow::allowsPaginationStrut() const {
// If children are inline, allow the strut. We are probably a float.
if (containingBlockFlow->childrenInline())
return true;
- // If this isn't the first in-flow object, there's a break opportunity before
- // us, which means that we can allow the strut.
- if (previousInFlowSiblingBox())
- return true;
+ for (LayoutBox* sibling = previousSiblingBox(); sibling;
+ sibling = sibling->previousSiblingBox()) {
+ // What happens on the other side of a spanner is none of our concern, so
+ // stop here. Since there's no in-flow box between the previous spanner and
+ // us, there's no class A break point in front of us. We cannot even
+ // re-propagate pagination struts to our containing block, since the
+ // containing block starts in a different column row.
+ if (sibling->isColumnSpanAll())
+ return false;
+ // If this isn't the first in-flow object, there's a break opportunity
+ // before us, which means that we can allow the strut.
+ if (!sibling->isFloatingOrOutOfFlowPositioned())
+ return true;
+ }
// This is a first in-flow child. We'll still allow the strut if it can be
// re-propagated to our containing block.
return containingBlockFlow->allowsPaginationStrut();
« no previous file with comments | « third_party/WebKit/LayoutTests/fragmentation/block-after-float-first-child-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698