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

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

Issue 1360753002: Only block container children support pagination struts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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: Source/core/layout/LayoutBlockFlow.cpp
diff --git a/Source/core/layout/LayoutBlockFlow.cpp b/Source/core/layout/LayoutBlockFlow.cpp
index a4cb56f6fa16a237ad5bf135bd997928c4bebbdc..90095513311596801ffb809105021048486e268c 100644
--- a/Source/core/layout/LayoutBlockFlow.cpp
+++ b/Source/core/layout/LayoutBlockFlow.cpp
@@ -783,7 +783,17 @@ static inline bool shouldSetStrutOnBlock(const LayoutBlockFlow& block, const Roo
}
// If we want to break before the block, one final check is needed, since some block object
leviw_travelin_and_unemployed 2015/09/22 17:20:31 This is no longer one final check, and is really t
mstensho (USE GERRIT) 2015/09/22 18:11:50 I shuffled things around a little bit, hopefully t
// types cannot handle struts.
- return wantsStrutOnBlock && !block.isOutOfFlowPositioned() && !block.isTableCell();
+ if (!wantsStrutOnBlock)
+ return false;
+ if (block.isOutOfFlowPositioned())
leviw_travelin_and_unemployed 2015/09/22 17:20:31 Combine this with the above?
mstensho (USE GERRIT) 2015/09/22 18:11:50 Done.
+ return false;
+ // The block needs to be contained by a block container (and not e.g. a flexbox, or a table
+ // (which would be the case if the block is a table cell or table caption)). The reason for
+ // this limitation is simply that block container child layout code is the only place where we
leviw_travelin_and_unemployed 2015/09/22 17:20:31 as you imply in your description, block container
mstensho (USE GERRIT) 2015/09/22 18:11:50 Yeah, "block container" is CSS sp33k. Changing to
+ // pick up the struts and handle them. We could do so in other layout modes as well, but
+ // currently we don't.
+ LayoutBlock* containingBlock = block.containingBlock();
+ return containingBlock && containingBlock->isLayoutBlockFlow();
}
void LayoutBlockFlow::adjustLinePositionForPagination(RootInlineBox& lineBox, LayoutUnit& delta)
« no previous file with comments | « LayoutTests/fast/multicol/table-caption-and-cells-fixed-width-expected.html ('k') | Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698