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

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

Issue 246403015: [New Multicolumn] Create RenderMultiColumnSet during renderer creation, not during layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master Created 6 years, 8 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/RenderFlowThread.h ('k') | Source/core/rendering/RenderMultiColumnFlowThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFlowThread.cpp
diff --git a/Source/core/rendering/RenderFlowThread.cpp b/Source/core/rendering/RenderFlowThread.cpp
index 0bd5d7419a67b67cb22339a9130a4b191cbb3139..74b20fc9bafebd921f46f45ff79a343c453f202c 100644
--- a/Source/core/rendering/RenderFlowThread.cpp
+++ b/Source/core/rendering/RenderFlowThread.cpp
@@ -54,13 +54,6 @@ RenderFlowThread::RenderFlowThread()
setFlowThreadState(InsideOutOfFlowThread);
}
-void RenderFlowThread::addRegionToThread(RenderRegion* renderRegion)
-{
- ASSERT(renderRegion);
- m_regionList.add(renderRegion);
- renderRegion->setIsValid(true);
-}
-
void RenderFlowThread::removeRegionFromThread(RenderRegion* renderRegion)
{
ASSERT(renderRegion);
@@ -195,13 +188,10 @@ void RenderFlowThread::repaintRectangleInRegions(const LayoutRect& repaintRect)
}
}
-RenderRegion* RenderFlowThread::regionAtBlockOffset(LayoutUnit offset, bool extendLastRegion, RegionAutoGenerationPolicy autoGenerationPolicy)
+RenderRegion* RenderFlowThread::regionAtBlockOffset(LayoutUnit offset) const
{
ASSERT(!m_regionsInvalidated);
- if (autoGenerationPolicy == AllowRegionAutoGeneration)
- autoGenerateRegionsToBlockOffset(offset);
-
if (offset <= 0)
return m_regionList.isEmpty() ? 0 : m_regionList.first();
@@ -209,7 +199,6 @@ RenderRegion* RenderFlowThread::regionAtBlockOffset(LayoutUnit offset, bool exte
m_regionIntervalTree.allOverlapsWithAdapter<RegionSearchAdapter>(adapter);
// If no region was found, the offset is in the flow thread overflow.
- // The last region will contain the offset if extendLastRegion is set or if the last region is a set.
if (!adapter.result() && !m_regionList.isEmpty())
return m_regionList.last();
@@ -339,7 +328,7 @@ RenderRegion* RenderFlowThread::mapFromFlowToRegion(TransformState& transformSta
// Note: Using the center in order to avoid rounding errors.
LayoutPoint center = boxRect.center();
- RenderRegion* renderRegion = const_cast<RenderFlowThread*>(this)->regionAtBlockOffset(isHorizontalWritingMode() ? center.y() : center.x(), true, DisallowRegionAutoGeneration);
+ RenderRegion* renderRegion = regionAtBlockOffset(isHorizontalWritingMode() ? center.y() : center.x());
if (!renderRegion)
return 0;
@@ -371,8 +360,8 @@ void RenderFlowThread::setRegionRangeForBox(const RenderBox* box, LayoutUnit off
return;
// FIXME: Not right for differing writing-modes.
- RenderRegion* startRegion = regionAtBlockOffset(offsetFromLogicalTopOfFirstPage, true);
- RenderRegion* endRegion = regionAtBlockOffset(offsetFromLogicalTopOfFirstPage + box->logicalHeight(), true);
+ RenderRegion* startRegion = regionAtBlockOffset(offsetFromLogicalTopOfFirstPage);
+ RenderRegion* endRegion = regionAtBlockOffset(offsetFromLogicalTopOfFirstPage + box->logicalHeight());
RenderRegionRangeMap::iterator it = m_regionRangeMap.find(box);
if (it == m_regionRangeMap.end()) {
m_regionRangeMap.set(box, RenderRegionRange(startRegion, endRegion));
@@ -577,6 +566,9 @@ void RenderFlowThread::mapLocalToContainer(const RenderLayerModelObject* repaint
if (RenderRegion* region = mapFromFlowToRegion(transformState)) {
// FIXME: The cast below is probably not the best solution, we may need to find a better way.
static_cast<const RenderObject*>(region)->mapLocalToContainer(region->containerForRepaint(), transformState, mode, wasFixed);
+ } else {
+ // This will happen for multicol when the flow thread is empty.
+ RenderBlockFlow::mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
}
}
« no previous file with comments | « Source/core/rendering/RenderFlowThread.h ('k') | Source/core/rendering/RenderMultiColumnFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698