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

Unified Diff: Source/core/rendering/RenderBlockFlow.cpp

Issue 567463004: Move adjustForUnsplittableChild() from RenderBlock to RenderBlockFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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/rendering/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 84aff4e1773ccbdeee660f2284e8a6a517dd8001..3e64c68b404aa2bc1815235bb0a4bc2309f6ee53 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -867,6 +867,25 @@ void RenderBlockFlow::adjustLinePositionForPagination(RootInlineBox* lineBox, La
}
}
+LayoutUnit RenderBlockFlow::adjustForUnsplittableChild(RenderBox* child, LayoutUnit logicalOffset, bool includeMargins)
+{
+ bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns() || flowThreadContainingBlock();
+ bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogicalHeight();
+ bool isUnsplittable = child->isUnsplittableForPagination() || (checkColumnBreaks && child->style()->columnBreakInside() == PBAVOID)
+ || (checkPageBreaks && child->style()->pageBreakInside() == PBAVOID);
+ if (!isUnsplittable)
+ return logicalOffset;
+ LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : LayoutUnit());
+ LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
+ updateMinimumPageHeight(logicalOffset, childLogicalHeight);
+ if (!pageLogicalHeight || childLogicalHeight > pageLogicalHeight)
+ return logicalOffset;
+ LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary);
+ if (remainingLogicalHeight < childLogicalHeight)
+ return logicalOffset + remainingLogicalHeight;
+ return logicalOffset;
+}
+
void RenderBlockFlow::rebuildFloatsFromIntruding()
{
if (m_floatingObjects)
« Source/core/rendering/RenderBlockFlow.h ('K') | « Source/core/rendering/RenderBlockFlow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698