Remove RenderNamedFlowThread and FlowThreadController
https://bugs.webkit.org/show_bug.cgi?id=177229

Reviewed by Andreas Kling.

Get rid of some parts of the rendering code for CSS Regions.

The feature is disabled, no functional changes.

* WebCore.xcodeproj/project.pbxproj:
* rendering/FlowThreadController.cpp: Removed.
* rendering/FlowThreadController.h: Removed.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
(WebCore::canComputeRegionRangeForBox):
(WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::logicalHeightForChildForFragmentation const):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::borderBoxRectInRegion const):
(WebCore::RenderBox::scroll):
(WebCore::RenderBox::renderBoxRegionInfo const):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
(WebCore::RenderElement::hoverAncestor const):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
(WebCore::RenderFlowThread::incrementAutoLogicalHeightRegions):
(WebCore::RenderFlowThread::decrementAutoLogicalHeightRegions):
(WebCore::RenderFlowThread::addRegionsOverflowFromChild):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::updateAlwaysCreateLineBoxes):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::paintFixedLayersInNamedFlows): Deleted.
(WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed): Deleted.
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed): Deleted.
* rendering/RenderLayerCompositor.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::checkRegionStyle):
(WebCore::RenderNamedFlowFragment::namedFlowThread const): Deleted.
* rendering/RenderNamedFlowFragment.h:
* rendering/RenderNamedFlowThread.cpp: Removed.
* rendering/RenderNamedFlowThread.h: Removed.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::selectionRoot const):
(WebCore::RenderObject::offsetParent const):
(WebCore::RenderObject::currentRenderNamedFlowFragment const):
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderGrid const):
(WebCore::RenderObject::isRenderNamedFlowThread const): Deleted.
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::RenderRegion):
(WebCore::RenderRegion::attachRegion):
* rendering/RenderRegion.h:
(WebCore::RenderRegion::parentNamedFlowThread const): Deleted.
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):
(WebCore::writeRenderRegionList): Deleted.
(WebCore::writeRenderNamedFlowThreads): Deleted.
* rendering/RenderView.cpp:
(WebCore::RenderView::layoutContent):
(WebCore::RenderView::layoutContentInAutoLogicalHeightRegions):
(WebCore::RenderView::layout):
(WebCore::RenderView::selectionBounds const):
(WebCore::RenderView::repaintSelection const):
(WebCore::RenderView::setSelection):
(WebCore::RenderView::updateSelectionForSubtrees):
(WebCore::RenderView::styleDidChange):
(WebCore::RenderView::checkTwoPassLayoutForAutoHeightRegions const):
(WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
(WebCore::RenderView::popLayoutStateForCurrentFlowThread):
(WebCore::RenderView::layoutContentToComputeOverflowInRegions): Deleted.
(WebCore::RenderView::splitSelectionBetweenSubtrees): Deleted.
(WebCore::RenderView::hasRenderNamedFlowThreads const): Deleted.
(WebCore::RenderView::flowThreadController): Deleted.
* rendering/RenderView.h:
* rendering/SelectionSubtreeRoot.cpp:
(WebCore::SelectionSubtreeRoot::adjustForVisibleSelection): Deleted.
* rendering/SelectionSubtreeRoot.h:
(WebCore::SelectionSubtreeRoot::setSelectionData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index d5edc6a..054c77f 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -46,7 +46,6 @@
 #include "RenderMultiColumnFlowThread.h"
 #include "RenderMultiColumnSet.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderTableCell.h"
 #include "RenderText.h"
 #include "RenderView.h"
@@ -883,7 +882,7 @@
         
     // Some objects (e.g., tables, horizontal rules, overflow:auto blocks) avoid floats. They need
     // to shift over as necessary to dodge any floats that might get in the way.
-    if (child.avoidsFloats() && containsFloats() && !is<RenderNamedFlowThread>(flowThreadContainingBlock()))
+    if (child.avoidsFloats() && containsFloats())
         newPosition += computeStartPositionDeltaForChildAvoidingFloats(child, marginStartForChild(child));
 
     setLogicalLeftForChild(child, style().isLeftToRightDirection() ? newPosition : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child), applyDelta);
@@ -1516,10 +1515,10 @@
 {
     // FIXME: Add page break checking here when we support printing.
     RenderFlowThread* flowThread = flowThreadContainingBlock();
-    bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread();
+    bool isInsideMulticolFlowThread = flowThread;
     bool checkColumnBreaks = flowThread && flowThread->shouldCheckColumnBreaks();
     bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
-    bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
+    bool checkRegionBreaks = false;
     bool checkBeforeAlways = (checkColumnBreaks && child.style().breakBefore() == ColumnBreakBetween)
         || (checkPageBreaks && alwaysPageBreak(child.style().breakBefore()));
     if (checkBeforeAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
@@ -1541,10 +1540,10 @@
 {
     // FIXME: Add page break checking here when we support printing.
     RenderFlowThread* flowThread = flowThreadContainingBlock();
-    bool isInsideMulticolFlowThread = flowThread && !flowThread->isRenderNamedFlowThread();
+    bool isInsideMulticolFlowThread = flowThread;
     bool checkColumnBreaks = flowThread && flowThread->shouldCheckColumnBreaks();
     bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
-    bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
+    bool checkRegionBreaks = false;
     bool checkAfterAlways = (checkColumnBreaks && child.style().breakAfter() == ColumnBreakBetween)
         || (checkPageBreaks && alwaysPageBreak(child.style().breakAfter()));
     if (checkAfterAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
@@ -1980,32 +1979,7 @@
 
 LayoutUnit RenderBlockFlow::logicalHeightForChildForFragmentation(const RenderBox& child) const
 {
-    // This method is required because regions do not fragment monolithic elements but instead
-    // they let them overflow the region they flow in. This behaviour is different from the 
-    // multicol/printing implementations, which have not yet been updated to correctly handle
-    // monolithic elements.
-    // As a result, for the moment, this method will only be used for regions, the multicol and
-    // printing implementations will stick to the existing behaviour until their fragmentation
-    // implementation is updated to match the regions implementation.
-    if (!flowThreadContainingBlock() || !flowThreadContainingBlock()->isRenderNamedFlowThread())
-        return logicalHeightForChild(child);
-
-    // For unsplittable elements, this method will just return the height of the element that
-    // fits into the current region, without the height of the part that overflows the region.
-    // This is done for all regions, except the last one because in that case, the logical
-    // height of the flow thread needs to also
-    if (!childBoxIsUnsplittableForFragmentation(child) || !pageLogicalHeightForOffset(logicalTopForChild(child)))
-        return logicalHeightForChild(child);
-
-    // If we're on the last page this block fragments to, the logical height of the flow thread must include
-    // the entire unsplittable child because any following children will not be moved to the next page
-    // so they will need to be laid out below the current unsplittable child.
-    LayoutUnit childLogicalTop = logicalTopForChild(child);
-    if (!hasNextPage(childLogicalTop))
-        return logicalHeightForChild(child);
-    
-    LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(childLogicalTop, ExcludePageBoundary);
-    return std::min(child.logicalHeight(), remainingLogicalHeight);
+    return logicalHeightForChild(child);
 }
 
 void RenderBlockFlow::layoutLineGridBox()