// During the normal layout phase of the named flow the regions are initialized with a height equal to their max-height. // This way unforced breaks are automatically placed when a region is full and the content height/position correctly estimated. // Also, the region where a forced break falls is exactly the region found at the forced break offset inside the flow content. void RenderFlowThread::initializeRegionsOverrideLogicalContentHeight(RenderRegion* startRegion) { ASSERT(view()->normalLayoutPhase()); if (!hasAutoLogicalHeightRegions()) return; RenderRegionList::iterator regionIter = startRegion ? m_regionList.find(startRegion) : m_regionList.begin(); for (; regionIter != m_regionList.end(); ++regionIter) { RenderRegion* region = *regionIter; if (region->hasAutoLogicalHeight()) region->setOverrideLogicalContentHeight(region->maxPageLogicalHeight()); } }
bool FlowThreadController::isAutoLogicalHeightRegionsFlagConsistent() const { if (!hasRenderNamedFlowThreads()) return !hasAutoLogicalHeightRegions(); // Count the number of auto height regions unsigned autoLogicalHeightRegions = 0; for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) { RenderNamedFlowThread* flowRenderer = *iter; autoLogicalHeightRegions += flowRenderer->autoLogicalHeightRegionsCount(); } return autoLogicalHeightRegions == m_autoLogicalHeightRegionsCount; }
void RenderFlowThread::markAutoLogicalHeightRegionsForLayout() { ASSERT(view()->layoutState()); ASSERT(view()->constrainedFlowThreadsLayoutPhase()); if (!hasAutoLogicalHeightRegions()) return; for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { RenderRegion* region = *iter; if (!region->hasAutoLogicalHeight()) continue; // FIXME: We need to find a way to avoid marking all the regions ancestors for layout // as we are already inside layout. region->setNeedsLayout(true); } invalidateRegions(); }
void RenderFlowThread::resetRegionsOverrideLogicalContentHeight() { ASSERT(view()->layoutState()); ASSERT(view()->normalLayoutPhase()); if (!hasAutoLogicalHeightRegions()) return; for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { RenderRegion* region = *iter; if (!region->hasAutoLogicalHeight()) continue; region->clearOverrideLogicalContentHeight(); // FIXME: We need to find a way to avoid marking all the regions ancestors for layout // as we are already inside layout. region->setNeedsLayout(true); } // Make sure we don't skip any region breaks when we do the layout again. // Using m_regionsInvalidated to force all the RenderFlowThread children do the layout again. invalidateRegions(); }