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

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

Issue 792803002: [New Multicolumn] Layout support for column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@347325-placeholder
Patch Set: Code review. If there are no sets, return early. Created 5 years, 11 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 | « Source/core/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 391f2db532359af17708f47fd591a0dab7fbd63b..1d7d6918238ef36b82bf185d1ada884ae0b19c3a 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -683,6 +683,11 @@ void RenderBlockFlow::layoutBlockChild(RenderBox& child, MarginInfo& marginInfo,
if (newHeight != size().height())
setLogicalHeight(newHeight);
}
+
+ if (child.isRenderMultiColumnSpannerPlaceholder()) {
+ // The actual column-span:all element is positioned by this placeholder child.
+ positionSpannerDescendant(toRenderMultiColumnSpannerPlaceholder(child));
+ }
}
LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, LayoutUnit estimateWithoutPagination, RenderBox& child, bool atBeforeSideOfBlock)
@@ -1060,7 +1065,10 @@ void RenderBlockFlow::layoutBlockChildren(bool relayoutChildren, SubtreeLayoutSc
}
if (child->isColumnSpanAll()) {
// This is not the containing block of the spanner. The spanner's placeholder will lay
- // it out in due course.
+ // it out in due course. For now we just need to consult our flow thread, so that the
+ // columns (if any) preceding and following the spanner are laid out correctly.
+ LayoutUnit adjustment = flowThreadContainingBlock()->skipColumnSpanner(child, offsetFromLogicalTopOfFirstPage() + logicalHeight());
+ setLogicalHeight(logicalHeight() + adjustment);
continue;
}
@@ -2972,6 +2980,15 @@ void RenderBlockFlow::setPaginationStrut(LayoutUnit strut)
m_rareData->m_paginationStrut = strut;
}
+void RenderBlockFlow::positionSpannerDescendant(RenderMultiColumnSpannerPlaceholder& child)
+{
+ RenderBox& spanner = *child.rendererInFlowThread();
+ // FIXME: |spanner| is a descendant, but never a direct child, so the names here are bad, if
+ // nothing else.
+ setLogicalTopForChild(spanner, child.logicalTop());
+ determineLogicalLeftPositionForChild(spanner);
+}
+
bool RenderBlockFlow::avoidsFloats() const
{
// Floats can't intrude into our box if we have a non-auto column count or width.
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698