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

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

Issue 883293004: [New Multicolumn] Preparatory work for nested multicol support. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: no find copies, please 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
Index: Source/core/rendering/RenderFlowThread.cpp
diff --git a/Source/core/rendering/RenderFlowThread.cpp b/Source/core/rendering/RenderFlowThread.cpp
index 4713e1617830e58087c85ff3217c1493a4dd2879..ec45e386686e3512b2a0e97cb2ebb16772d06ff5 100644
--- a/Source/core/rendering/RenderFlowThread.cpp
+++ b/Source/core/rendering/RenderFlowThread.cpp
@@ -90,7 +90,7 @@ void RenderFlowThread::validateRegions()
}
updateLogicalWidth(); // Called to get the maximum logical width for the columnSet.
- updateRegionsFlowThreadPortionRect();
+ generateColumnSetIntervalTree();
}
void RenderFlowThread::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const
@@ -166,26 +166,13 @@ RenderRegion* RenderFlowThread::lastRegion() const
return m_multiColumnSetList.last();
}
-void RenderFlowThread::updateRegionsFlowThreadPortionRect()
+void RenderFlowThread::generateColumnSetIntervalTree()
{
- LayoutUnit logicalHeight = 0;
// FIXME: Optimize not to clear the interval all the time. This implies manually managing the tree nodes lifecycle.
m_multiColumnSetIntervalTree.clear();
m_multiColumnSetIntervalTree.initIfNeeded();
- for (RenderMultiColumnSetList::iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) {
- RenderMultiColumnSet* columnSet = *iter;
-
- LayoutUnit columnSetLogicalWidth = columnSet->pageLogicalWidth();
- LayoutUnit columnSetLogicalHeight = std::min<LayoutUnit>(RenderFlowThread::maxLogicalHeight() - logicalHeight, columnSet->logicalHeightInFlowThread());
-
- LayoutRect columnSetRect(style()->direction() == LTR ? LayoutUnit() : logicalWidth() - columnSetLogicalWidth, logicalHeight, columnSetLogicalWidth, columnSetLogicalHeight);
-
- columnSet->setFlowThreadPortionRect(isHorizontalWritingMode() ? columnSetRect : columnSetRect.transposedRect());
-
- m_multiColumnSetIntervalTree.add(MultiColumnSetIntervalTree::createInterval(logicalHeight, logicalHeight + columnSetLogicalHeight, columnSet));
-
- logicalHeight += columnSetLogicalHeight;
- }
+ for (auto columnSet : m_multiColumnSetList)
+ m_multiColumnSetIntervalTree.add(MultiColumnSetIntervalTree::createInterval(columnSet->logicalTopInFlowThread(), columnSet->logicalBottomInFlowThread(), columnSet));
}
void RenderFlowThread::collectLayerFragments(LayerFragments& layerFragments, const LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect)

Powered by Google App Engine
This is Rietveld 408576698