Remove RenderNamedFlowThread and FlowThreadController
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 15:37:23 +0000 (15:37 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 15:37:23 +0000 (15:37 +0000)
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: https://svn.webkit.org/repository/webkit/trunk@222263 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/rendering/FlowThreadController.cpp [deleted file]
Source/WebCore/rendering/FlowThreadController.h [deleted file]
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderNamedFlowFragment.cpp
Source/WebCore/rendering/RenderNamedFlowFragment.h
Source/WebCore/rendering/RenderNamedFlowThread.cpp [deleted file]
Source/WebCore/rendering/RenderNamedFlowThread.h [deleted file]
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderRegion.cpp
Source/WebCore/rendering/RenderRegion.h
Source/WebCore/rendering/RenderTreeAsText.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/RenderingAllInOne.cpp
Source/WebCore/rendering/SelectionSubtreeRoot.cpp
Source/WebCore/rendering/SelectionSubtreeRoot.h

index ec08866..7fa3408 100644 (file)
@@ -2645,7 +2645,6 @@ set(WebCore_SOURCES
     rendering/FlexibleBoxAlgorithm.cpp
     rendering/FixedTableLayout.cpp
     rendering/FloatingObjects.cpp
-    rendering/FlowThreadController.cpp
     rendering/Grid.cpp
     rendering/GridTrackSizingAlgorithm.cpp
     rendering/HitTestLocation.cpp
@@ -2710,7 +2709,6 @@ set(WebCore_SOURCES
     rendering/RenderMultiColumnSet.cpp
     rendering/RenderMultiColumnSpannerPlaceholder.cpp
     rendering/RenderNamedFlowFragment.cpp
-    rendering/RenderNamedFlowThread.cpp
     rendering/RenderObject.cpp
     rendering/RenderProgress.cpp
     rendering/RenderQuote.cpp
index 93d1257..afcba57 100644 (file)
@@ -1,5 +1,107 @@
 2017-09-20  Antti Koivisto  <antti@apple.com>
 
+        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):
+
+2017-09-20  Antti Koivisto  <antti@apple.com>
+
         Remove DOM and styling support for CSS Regions
         https://bugs.webkit.org/show_bug.cgi?id=177221
 
index dc1c0cf..7cdd8fb 100644 (file)
                1A3586E115264F950022A659 /* SVGAnimatedIntegerOptionalInteger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */; };
                1A37636B1A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */; };
                1A37636C1A2E68BB009A7EE2 /* StorageNamespaceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC85F23E1519187300BC17BE /* RenderNamedFlowThread.cpp */; };
                1A4832B31A953BA6008B4DFE /* LocalizedStringsCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4832B21A953BA6008B4DFE /* LocalizedStringsCocoa.mm */; };
                1A494BFA0A122F4400FDAFC1 /* JSHTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */; };
                1A494BFB0A122F4400FDAFC1 /* JSHTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC82432A0D0CE8A200460C8F /* JSSQLTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243260D0CE8A200460C8F /* JSSQLTransaction.h */; };
                BC8243E80D0CFD7500460C8F /* WindowFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */; };
                BC8243E90D0CFD7500460C8F /* WindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243E70D0CFD7500460C8F /* WindowFeatures.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC85F23D151915E000BC17BE /* RenderNamedFlowThread.h in Headers */ = {isa = PBXBuildFile; fileRef = BC85F23C151915E000BC17BE /* RenderNamedFlowThread.h */; };
                BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */; };
                BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                D6F7960D166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6F7960C166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp */; };
                D70AD65713E1342B005B50B4 /* RenderRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D70AD65513E1342B005B50B4 /* RenderRegion.cpp */; };
                D70AD65813E1342B005B50B4 /* RenderRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = D70AD65613E1342B005B50B4 /* RenderRegion.h */; };
-               D72F6D79153159A3001EE44E /* FlowThreadController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D72F6D77153159A3001EE44E /* FlowThreadController.cpp */; };
-               D72F6D7A153159A3001EE44E /* FlowThreadController.h in Headers */ = {isa = PBXBuildFile; fileRef = D72F6D78153159A3001EE44E /* FlowThreadController.h */; };
                D8B6152F1032495100C8554A /* Cookie.h in Headers */ = {isa = PBXBuildFile; fileRef = D8B6152E1032495100C8554A /* Cookie.h */; settings = {ATTRIBUTES = (Private, ); }; };
                DAED203016F2442B0070EC0F /* PageConsoleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAACB3D916F2416400666135 /* PageConsoleClient.cpp */; };
                DAED203116F244480070EC0F /* PageConsoleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = DAACB3DA16F2416400666135 /* PageConsoleClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC8243260D0CE8A200460C8F /* JSSQLTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransaction.h; sourceTree = "<group>"; };
                BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFeatures.cpp; sourceTree = "<group>"; };
                BC8243E70D0CFD7500460C8F /* WindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFeatures.h; sourceTree = "<group>"; };
-               BC85F23C151915E000BC17BE /* RenderNamedFlowThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderNamedFlowThread.h; sourceTree = "<group>"; };
-               BC85F23E1519187300BC17BE /* RenderNamedFlowThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderNamedFlowThread.cpp; sourceTree = "<group>"; };
                BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollableArea.cpp; sourceTree = "<group>"; };
                BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollableArea.h; sourceTree = "<group>"; };
                BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeMac.h; sourceTree = "<group>"; };
                D6F7960C166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTemplateElementCustom.cpp; sourceTree = "<group>"; };
                D70AD65513E1342B005B50B4 /* RenderRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderRegion.cpp; sourceTree = "<group>"; };
                D70AD65613E1342B005B50B4 /* RenderRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderRegion.h; sourceTree = "<group>"; };
-               D72F6D77153159A3001EE44E /* FlowThreadController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FlowThreadController.cpp; sourceTree = "<group>"; };
-               D72F6D78153159A3001EE44E /* FlowThreadController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlowThreadController.h; sourceTree = "<group>"; };
                D8B6152E1032495100C8554A /* Cookie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cookie.h; sourceTree = "<group>"; };
                DAACB3D916F2416400666135 /* PageConsoleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageConsoleClient.cpp; sourceTree = "<group>"; };
                DAACB3DA16F2416400666135 /* PageConsoleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageConsoleClient.h; sourceTree = "<group>"; };
                                94DD79731E54E3A20058FB80 /* FlexibleBoxAlgorithm.h */,
                                9A528E8117D7F52F00AA9518 /* FloatingObjects.cpp */,
                                9A528E8217D7F52F00AA9518 /* FloatingObjects.h */,
-                               D72F6D77153159A3001EE44E /* FlowThreadController.cpp */,
-                               D72F6D78153159A3001EE44E /* FlowThreadController.h */,
                                935C477409AC4D8D00A6AAB4 /* GapRects.h */,
                                E112F4701E3A85F200D6CDFD /* Grid.cpp */,
                                E112F46F1E3A85D800D6CDFD /* Grid.h */,
                                BC1A7D9618FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h */,
                                8AC822FA180FC03300FB64D5 /* RenderNamedFlowFragment.cpp */,
                                8AC822FB180FC03300FB64D5 /* RenderNamedFlowFragment.h */,
-                               BC85F23E1519187300BC17BE /* RenderNamedFlowThread.cpp */,
-                               BC85F23C151915E000BC17BE /* RenderNamedFlowThread.h */,
                                BCEA4840097D93020094C9E4 /* RenderObject.cpp */,
                                BCEA4841097D93020094C9E4 /* RenderObject.h */,
                                838867341D13BA59003697D0 /* RenderObjectEnums.h */,
                                6E0E569C183BFFE600E0E8D5 /* FloatRoundedRect.h in Headers */,
                                B275356D0B053814002CE64F /* FloatSize.h in Headers */,
                                58CD35CB18EB4C3900B9F3AC /* FloatSizeHash.h in Headers */,
-                               D72F6D7A153159A3001EE44E /* FlowThreadController.h in Headers */,
                                14993BE60B2F2B1C0050497F /* FocusController.h in Headers */,
                                062287840B4DB322000C34DF /* FocusDirection.h in Headers */,
                                B6D9D23514EABD260090D75E /* FocusEvent.h in Headers */,
                                BCE32B9C1517C0B200F542EC /* RenderMultiColumnSet.h in Headers */,
                                BC1A7D9818FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h in Headers */,
                                8AC822FD180FC03300FB64D5 /* RenderNamedFlowFragment.h in Headers */,
-                               BC85F23D151915E000BC17BE /* RenderNamedFlowThread.h in Headers */,
                                BCEA4880097D93020094C9E4 /* RenderObject.h in Headers */,
                                838867351D13BA5F003697D0 /* RenderObjectEnums.h in Headers */,
                                BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */,
                                B275356C0B053814002CE64F /* FloatSize.cpp in Sources */,
                                B275355B0B053814002CE64F /* FloatSizeCG.cpp in Sources */,
                                B275357A0B053814002CE64F /* FloatSizeMac.mm in Sources */,
-                               D72F6D79153159A3001EE44E /* FlowThreadController.cpp in Sources */,
                                14993BE50B2F2B1C0050497F /* FocusController.cpp in Sources */,
                                B6D9D23614EABD260090D75E /* FocusEvent.cpp in Sources */,
                                B2C3DA640D006CD600EF6F26 /* Font.cpp in Sources */,
                                BCE32B9E1517C22700F542EC /* RenderMultiColumnSet.cpp in Sources */,
                                BC1A7D9718FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp in Sources */,
                                8AC822FC180FC03300FB64D5 /* RenderNamedFlowFragment.cpp in Sources */,
-                               1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */,
                                BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */,
                                A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
                                5A574F24131DB93900471B88 /* RenderQuote.cpp in Sources */,
diff --git a/Source/WebCore/rendering/FlowThreadController.cpp b/Source/WebCore/rendering/FlowThreadController.cpp
deleted file mode 100644 (file)
index bc21db1..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer in the documentation and/or other materials
- *    provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FlowThreadController.h"
-
-#include "RenderFlowThread.h"
-#include "RenderLayer.h"
-#include "RenderNamedFlowThread.h"
-#include "StyleInheritedData.h"
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-FlowThreadController::FlowThreadController(RenderView* view)
-    : m_view(view)
-    , m_isRenderNamedFlowThreadOrderDirty(false)
-    , m_flowThreadsWithAutoLogicalHeightRegions(0)
-{
-}
-
-FlowThreadController::~FlowThreadController()
-{
-}
-
-void FlowThreadController::styleDidChange()
-{
-    auto& viewStyle = m_view->style();
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList)
-        flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(&viewStyle));
-}
-
-void FlowThreadController::layoutRenderNamedFlowThreads()
-{
-    updateFlowThreadsChainIfNecessary();
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList)
-        flowRenderer->layoutIfNeeded();
-}
-
-void FlowThreadController::registerNamedFlowContentElement(Element& contentElement, RenderNamedFlowThread& namedFlow)
-{
-    ASSERT(!m_mapNamedFlowContentElement.contains(&contentElement));
-    ASSERT(!namedFlow.hasContentElement(contentElement));
-    m_mapNamedFlowContentElement.add(&contentElement, &namedFlow);
-    namedFlow.registerNamedFlowContentElement(contentElement);
-}
-
-void FlowThreadController::unregisterNamedFlowContentElement(Element& contentElement)
-{
-    auto it = m_mapNamedFlowContentElement.find(&contentElement);
-    ASSERT(it != m_mapNamedFlowContentElement.end());
-    ASSERT(it->value);
-    ASSERT(it->value->hasContentElement(contentElement));
-    it->value->unregisterNamedFlowContentElement(contentElement);
-    m_mapNamedFlowContentElement.remove(&contentElement);
-}
-
-void FlowThreadController::updateFlowThreadsChainIfNecessary()
-{
-    ASSERT(m_renderNamedFlowThreadList);
-    ASSERT(isAutoLogicalHeightRegionsCountConsistent());
-
-    // Remove the left-over flow threads.
-    RenderNamedFlowThreadList toRemoveList;
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-        if (flowRenderer->isMarkedForDestruction())
-            toRemoveList.add(flowRenderer);
-    }
-
-    if (toRemoveList.size() > 0)
-        setIsRenderNamedFlowThreadOrderDirty(true);
-
-    for (auto& flowRenderer : toRemoveList) {
-        m_renderNamedFlowThreadList->remove(flowRenderer);
-        flowRenderer->destroy();
-    }
-
-    if (isRenderNamedFlowThreadOrderDirty()) {
-        // Arrange the thread list according to dependencies.
-        RenderNamedFlowThreadList sortedList;
-        for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-            if (sortedList.contains(flowRenderer))
-                continue;
-            flowRenderer->pushDependencies(sortedList);
-            sortedList.add(flowRenderer);
-        }
-        m_renderNamedFlowThreadList->swap(sortedList);
-        setIsRenderNamedFlowThreadOrderDirty(false);
-    }
-}
-
-bool FlowThreadController::updateFlowThreadsNeedingLayout()
-{
-    bool needsTwoPassLayout = false;
-
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-        ASSERT(!flowRenderer->needsTwoPhasesLayout());
-        ASSERT(flowRenderer->inMeasureContentLayoutPhase());
-        if (flowRenderer->needsLayout() && flowRenderer->hasAutoLogicalHeightRegions())
-            needsTwoPassLayout = true;
-    }
-
-    if (needsTwoPassLayout)
-        resetFlowThreadsWithAutoHeightRegions();
-
-    return needsTwoPassLayout;
-}
-
-bool FlowThreadController::updateFlowThreadsNeedingTwoStepLayout()
-{
-    bool needsTwoPassLayout = false;
-
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-        if (flowRenderer->needsTwoPhasesLayout()) {
-            needsTwoPassLayout = true;
-            break;
-        }
-    }
-
-    if (needsTwoPassLayout)
-        resetFlowThreadsWithAutoHeightRegions();
-
-    return needsTwoPassLayout;
-}
-
-void FlowThreadController::resetFlowThreadsWithAutoHeightRegions()
-{
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-        if (flowRenderer->hasAutoLogicalHeightRegions()) {
-            flowRenderer->markAutoLogicalHeightRegionsForLayout();
-            flowRenderer->invalidateRegions();
-        }
-    }
-}
-
-void FlowThreadController::updateFlowThreadsIntoConstrainedPhase()
-{
-    // Walk the flow chain in reverse order to update the auto-height regions and compute correct sizes for the containing regions. Only after this we can
-    // set the flow in the constrained layout phase.
-    for (auto iter = m_renderNamedFlowThreadList->rbegin(), end = m_renderNamedFlowThreadList->rend(); iter != end; ++iter) {
-        RenderNamedFlowThread* flowRenderer = *iter;
-        ASSERT(!flowRenderer->hasRegions() || flowRenderer->hasValidRegionInfo());
-        flowRenderer->layoutIfNeeded();
-        if (flowRenderer->hasAutoLogicalHeightRegions()) {
-            ASSERT(flowRenderer->needsTwoPhasesLayout());
-            flowRenderer->markAutoLogicalHeightRegionsForLayout();
-        }
-        flowRenderer->setLayoutPhase(RenderFlowThread::LayoutPhaseConstrained);
-        flowRenderer->clearNeedsTwoPhasesLayout();
-    }
-}
-
-void FlowThreadController::updateFlowThreadsIntoOverflowPhase()
-{
-    for (auto iter = m_renderNamedFlowThreadList->rbegin(), end = m_renderNamedFlowThreadList->rend(); iter != end; ++iter) {
-        RenderNamedFlowThread* flowRenderer = *iter;
-        ASSERT(!flowRenderer->hasRegions() || flowRenderer->hasValidRegionInfo());
-        ASSERT(!flowRenderer->needsTwoPhasesLayout());
-
-        // In the overflow computation phase the flow threads start in the constrained phase even though optimizations didn't set the state before.
-        flowRenderer->setLayoutPhase(RenderFlowThread::LayoutPhaseConstrained);
-
-        flowRenderer->layoutIfNeeded();
-        flowRenderer->markRegionsForOverflowLayoutIfNeeded();
-        flowRenderer->setLayoutPhase(RenderFlowThread::LayoutPhaseOverflow);
-    }
-}
-
-void FlowThreadController::updateFlowThreadsIntoMeasureContentPhase()
-{
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-        ASSERT(flowRenderer->inFinalLayoutPhase());
-
-        flowRenderer->dispatchNamedFlowEvents();
-        flowRenderer->setLayoutPhase(RenderFlowThread::LayoutPhaseMeasureContent);
-    }
-}
-
-void FlowThreadController::updateFlowThreadsIntoFinalPhase()
-{
-    for (auto iter = m_renderNamedFlowThreadList->rbegin(), end = m_renderNamedFlowThreadList->rend(); iter != end; ++iter) {
-        RenderNamedFlowThread* flowRenderer = *iter;
-        flowRenderer->layoutIfNeeded();
-        if (flowRenderer->needsTwoPhasesLayout()) {
-            flowRenderer->markRegionsForOverflowLayoutIfNeeded();
-            flowRenderer->clearNeedsTwoPhasesLayout();
-        }
-        flowRenderer->setLayoutPhase(RenderFlowThread::LayoutPhaseFinal);
-    }
-}
-
-void FlowThreadController::updateFlowThreadsLayerToRegionMappingsIfNeeded()
-{
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList)
-        flowRenderer->updateAllLayerToRegionMappingsIfNeeded();
-}
-
-void FlowThreadController::updateNamedFlowsLayerListsIfNeeded()
-{
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList)
-        flowRenderer->layer()->updateLayerListsIfNeeded();
-}
-
-static inline bool compareZIndexFlowThreadController(RenderLayer* first, RenderLayer* second)
-{
-    return first->zIndex() < second->zIndex();
-}
-
-// Collect the fixed positioned layers that have the named flows as containing block
-// These layers are painted and hit-tested starting from RenderView not from regions.
-void FlowThreadController::collectFixedPositionedLayers(Vector<RenderLayer*>& fixedPosLayers) const
-{
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-        // If the named flow does not have any regions attached, a fixed element should not be
-        // displayed even if the fixed element is positioned/sized by the viewport.
-        if (!flowRenderer->hasRegions())
-            continue;
-
-        RenderLayer* flowThreadLayer = flowRenderer->layer();
-        if (Vector<RenderLayer*>* negZOrderList = flowThreadLayer->negZOrderList()) {
-            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i) {
-                RenderLayer* currLayer = negZOrderList->at(i);
-                if (currLayer->renderer().style().position() != FixedPosition)
-                    continue;
-                fixedPosLayers.append(currLayer);
-            }
-        }
-
-        if (Vector<RenderLayer*>* posZOrderList = flowThreadLayer->posZOrderList()) {
-            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i) {
-                RenderLayer* currLayer = posZOrderList->at(i);
-                if (currLayer->renderer().style().position() != FixedPosition)
-                    continue;
-                fixedPosLayers.append(currLayer);
-            }
-        }
-    }
-
-    std::stable_sort(fixedPosLayers.begin(), fixedPosLayers.end(), compareZIndexFlowThreadController);
-}
-
-#ifndef NDEBUG
-bool FlowThreadController::isAutoLogicalHeightRegionsCountConsistent() const
-{
-    if (!hasRenderNamedFlowThreads())
-        return !hasFlowThreadsWithAutoLogicalHeightRegions();
-
-    for (auto& flowRenderer : *m_renderNamedFlowThreadList) {
-        if (!flowRenderer->isAutoLogicalHeightRegionsCountConsistent())
-            return false;
-    }
-
-    return true;
-}
-#endif
-
-} // namespace WebCore
diff --git a/Source/WebCore/rendering/FlowThreadController.h b/Source/WebCore/rendering/FlowThreadController.h
deleted file mode 100644 (file)
index 73fbfbd..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer in the documentation and/or other materials
- *    provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "RenderView.h"
-#include <memory>
-#include <wtf/ListHashSet.h>
-
-namespace WebCore {
-
-class RenderFlowThread;
-class RenderLayer;
-class RenderNamedFlowThread;
-
-typedef ListHashSet<RenderNamedFlowThread*> RenderNamedFlowThreadList;
-
-class FlowThreadController {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit FlowThreadController(RenderView*);
-    ~FlowThreadController();
-
-    bool isRenderNamedFlowThreadOrderDirty() const { return m_isRenderNamedFlowThreadOrderDirty; }
-    void setIsRenderNamedFlowThreadOrderDirty(bool dirty)
-    {
-        m_isRenderNamedFlowThreadOrderDirty = dirty;
-        if (dirty)
-            m_view->setNeedsLayout();
-    }
-
-    const RenderNamedFlowThreadList* renderNamedFlowThreadList() const { return m_renderNamedFlowThreadList.get(); }
-    bool hasRenderNamedFlowThreads() const { return m_renderNamedFlowThreadList && !m_renderNamedFlowThreadList->isEmpty(); }
-    void layoutRenderNamedFlowThreads();
-    void styleDidChange();
-
-    void registerNamedFlowContentElement(Element&, RenderNamedFlowThread&);
-    void unregisterNamedFlowContentElement(Element&);
-
-    bool hasFlowThreadsWithAutoLogicalHeightRegions() const { return m_flowThreadsWithAutoLogicalHeightRegions; }
-    void incrementFlowThreadsWithAutoLogicalHeightRegions() { ++m_flowThreadsWithAutoLogicalHeightRegions; }
-    void decrementFlowThreadsWithAutoLogicalHeightRegions() { ASSERT(m_flowThreadsWithAutoLogicalHeightRegions > 0); --m_flowThreadsWithAutoLogicalHeightRegions; }
-
-    bool updateFlowThreadsNeedingLayout();
-    bool updateFlowThreadsNeedingTwoStepLayout();
-    void updateFlowThreadsIntoConstrainedPhase();
-    void updateFlowThreadsIntoOverflowPhase();
-    void updateFlowThreadsIntoMeasureContentPhase();
-    void updateFlowThreadsIntoFinalPhase();
-
-    void updateNamedFlowsLayerListsIfNeeded();
-    // Collect the fixed positioned layers that have the named flows as containing block
-    // These layers are painted and hit-tested by RenderView
-    void collectFixedPositionedLayers(Vector<RenderLayer*>& fixedPosLayers) const;
-
-    void updateFlowThreadsLayerToRegionMappingsIfNeeded();
-
-#ifndef NDEBUG
-    bool isAutoLogicalHeightRegionsCountConsistent() const;
-#endif
-
-protected:
-    void updateFlowThreadsChainIfNecessary();
-    void resetFlowThreadsWithAutoHeightRegions();
-
-private:
-    RenderView* m_view;
-    bool m_isRenderNamedFlowThreadOrderDirty;
-    unsigned m_flowThreadsWithAutoLogicalHeightRegions;
-    std::unique_ptr<RenderNamedFlowThreadList> m_renderNamedFlowThreadList;
-    HashMap<const Element*, RenderNamedFlowThread*> m_mapNamedFlowContentElement;
-};
-
-} // namespace WebCore
index b12e8ab..fe8da13 100644 (file)
@@ -57,7 +57,6 @@
 #include "RenderListMarker.h"
 #include "RenderMenuList.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
 #include "RenderSVGResourceClipper.h"
 #include "RenderTableCell.h"
@@ -1681,27 +1680,8 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
 
     // 1. paint background, borders etc
     if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style().visibility() == VISIBLE) {
-        if (hasVisibleBoxDecorations()) {
-            bool didClipToRegion = false;
-            
-            RenderNamedFlowFragment* namedFlowFragment = currentRenderNamedFlowFragment();
-            if (namedFlowFragment && is<RenderNamedFlowThread>(paintInfo.paintContainer)) {
-                // If this box goes beyond the current region, then make sure not to overflow the region.
-                // This (overflowing region X altough also fragmented to region X+1) could happen when one of this box's children
-                // overflows region X and is an unsplittable element (like an image).
-                // The same applies for a box overflowing the top of region X when that box is also fragmented in region X-1.
-
-                paintInfo.context().save();
-                didClipToRegion = true;
-
-                paintInfo.context().clip(downcast<RenderNamedFlowThread>(*paintInfo.paintContainer).decorationsClipRectForBoxInNamedFlowFragment(*this, *namedFlowFragment));
-            }
-
+        if (hasVisibleBoxDecorations())
             paintBoxDecorations(paintInfo, paintOffset);
-            
-            if (didClipToRegion)
-                paintInfo.context().restore();
-        }
     }
     
     // Paint legends just above the border before we scroll or clip.
@@ -3429,8 +3409,6 @@ RenderRegion* RenderBlock::regionAtBlockOffset(LayoutUnit blockOffset) const
 
 static bool canComputeRegionRangeForBox(const RenderBlock& parentBlock, const RenderBox& childBox, const RenderFlowThread* flowThreadContainingBlock)
 {
-    ASSERT(!childBox.isRenderNamedFlowThread());
-
     if (!flowThreadContainingBlock)
         return false;
 
@@ -3448,11 +3426,9 @@ bool RenderBlock::childBoxIsUnsplittableForFragmentation(const RenderBox& child)
     RenderFlowThread* flowThread = flowThreadContainingBlock();
     bool checkColumnBreaks = flowThread && flowThread->shouldCheckColumnBreaks();
     bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight;
-    bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
     return child.isUnsplittableForPagination() || child.style().breakInside() == AvoidBreakInside
         || (checkColumnBreaks && child.style().breakInside() == AvoidColumnBreakInside)
-        || (checkPageBreaks && child.style().breakInside() == AvoidPageBreakInside)
-        || (checkRegionBreaks && child.style().breakInside() == AvoidRegionBreakInside);
+        || (checkPageBreaks && child.style().breakInside() == AvoidPageBreakInside);
 }
 
 void RenderBlock::computeRegionRangeForBoxChild(const RenderBox& box) const
index d5edc6a..054c77f 100644 (file)
@@ -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 @@ void RenderBlockFlow::determineLogicalLeftPositionForChild(RenderBox& child, App
         
     // 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 @@ LayoutUnit RenderBlockFlow::applyBeforeBreak(RenderBox& child, LayoutUnit logica
 {
     // 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 @@ LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox& child, LayoutUnit logical
 {
     // 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::pageRemainingLogicalHeightForOffset(LayoutUnit offse
 
 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()
index bfdddbb..e61dba2 100644 (file)
@@ -1441,16 +1441,6 @@ void RenderBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState, I
                 }
                     
                 if (paginated) {
-                    if (RenderFlowThread* flowThread = flowThreadContainingBlock()) {
-                        if (flowThread->isRenderNamedFlowThread() && overflowsRegion && hasNextPage(lineBox->lineTop())) {
-                            // Limit the height of this block to the end of the current region because
-                            // it is also fragmented into the next region.
-                            LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalTop(), ExcludePageBoundary);
-                            if (logicalHeight() > remainingLogicalHeight)
-                                setLogicalHeight(remainingLogicalHeight);
-                        }
-                    }
-
                     if (layoutState.flowThread())
                         updateRegionForLine(lineBox);
                 }
index 8272aee..bf998fa 100644 (file)
@@ -61,7 +61,6 @@
 #include "RenderLayerCompositor.h"
 #include "RenderMultiColumnFlowThread.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderTableCell.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
@@ -211,60 +210,9 @@ LayoutRect RenderBox::clientBoxRectInRegion(RenderRegion* region) const
     return clientBox;
 }
 
-LayoutRect RenderBox::borderBoxRectInRegion(RenderRegion* region, RenderBoxRegionInfoFlags cacheFlag) const
+LayoutRect RenderBox::borderBoxRectInRegion(RenderRegion*, RenderBoxRegionInfoFlags) const
 {
-    if (!region)
-        return borderBoxRect();
-
-    auto* flowThread = flowThreadContainingBlock();
-    if (!is<RenderNamedFlowThread>(flowThread))
-        return borderBoxRect();
-
-    RenderRegion* startRegion = nullptr;
-    RenderRegion* endRegion = nullptr;
-    if (!flowThread->getRegionRangeForBox(this, startRegion, endRegion)) {
-        // FIXME: In a perfect world this condition should never happen.
-        return borderBoxRect();
-    }
-
-    ASSERT(flowThread->regionInRange(region, startRegion, endRegion));
-
-    // Compute the logical width and placement in this region.
-    RenderBoxRegionInfo* boxInfo = renderBoxRegionInfo(region, cacheFlag);
-    if (!boxInfo)
-        return borderBoxRect();
-
-    // We have cached insets.
-    LayoutUnit logicalWidth = boxInfo->logicalWidth();
-    LayoutUnit logicalLeft = boxInfo->logicalLeft();
-
-    // Now apply the parent inset since it is cumulative whenever anything in the containing block chain shifts.
-    // FIXME: Doesn't work right with perpendicular writing modes.
-    const RenderBlock* currentBox = containingBlock();
-    RenderBoxRegionInfo* currentBoxInfo = isRenderFlowThread() ? nullptr : currentBox->renderBoxRegionInfo(region);
-    while (currentBoxInfo && currentBoxInfo->isShifted()) {
-        if (currentBox->style().direction() == LTR)
-            logicalLeft += currentBoxInfo->logicalLeft();
-        else
-            logicalLeft -= (currentBox->logicalWidth() - currentBoxInfo->logicalWidth()) - currentBoxInfo->logicalLeft();
-
-        // Once we reach the fragmentation container we should stop.
-        if (currentBox->isRenderFlowThread())
-            break;
-
-        currentBox = currentBox->containingBlock();
-        if (!currentBox)
-            break;
-        region = currentBox->clampToStartAndEndRegions(region);
-        currentBoxInfo = currentBox->renderBoxRegionInfo(region);
-    }
-
-    if (cacheFlag == DoNotCacheRenderBoxRegionInfo)
-        delete boxInfo;
-
-    if (isHorizontalWritingMode())
-        return LayoutRect(logicalLeft, 0, logicalWidth, height());
-    return LayoutRect(0, logicalLeft, width(), logicalWidth);
+    return borderBoxRect();
 }
 
 static RenderBlockFlow* outermostBlockContainingFloatingObject(RenderBox& box)
@@ -869,10 +817,6 @@ bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity,
         return true;
 
     RenderBlock* nextScrollBlock = containingBlock();
-    if (is<RenderNamedFlowThread>(nextScrollBlock)) {
-        ASSERT(startBox);
-        nextScrollBlock = downcast<RenderNamedFlowThread>(*nextScrollBlock).fragmentFromAbsolutePointAndBox(wheelEventAbsolutePoint, *startBox);
-    }
 
     if (nextScrollBlock && !nextScrollBlock->isRenderView())
         return nextScrollBlock->scroll(direction, granularity, multiplier, stopElement, startBox, wheelEventAbsolutePoint);
@@ -2693,57 +2637,7 @@ RenderBoxRegionInfo* RenderBox::renderBoxRegionInfo(RenderRegion* region, Render
     if (boxInfo && cacheFlag == CacheRenderBoxRegionInfo)
         return boxInfo;
 
-    // No cached value was found, so we have to compute our insets in this region.
-    // FIXME: For now we limit this computation to normal RenderBlocks. Future patches will expand
-    // support to cover all boxes.
-    RenderFlowThread* flowThread = flowThreadContainingBlock();
-    if (isRenderFlowThread() || !is<RenderNamedFlowThread>(flowThread) || !canHaveBoxInfoInRegion() || flowThread->style().writingMode() != style().writingMode())
-        return nullptr;
-
-    LogicalExtentComputedValues computedValues;
-    computeLogicalWidthInRegion(computedValues, region);
-
-    // Now determine the insets based off where this object is supposed to be positioned.
-    RenderBlock& cb = *containingBlock();
-    RenderRegion* clampedContainingBlockRegion = cb.clampToStartAndEndRegions(region);
-    RenderBoxRegionInfo* containingBlockInfo = cb.renderBoxRegionInfo(clampedContainingBlockRegion);
-    LayoutUnit containingBlockLogicalWidth = cb.logicalWidth();
-    LayoutUnit containingBlockLogicalWidthInRegion = containingBlockInfo ? containingBlockInfo->logicalWidth() : containingBlockLogicalWidth;
-    
-    LayoutUnit marginStartInRegion = computedValues.m_margins.m_start;
-    LayoutUnit startMarginDelta = marginStartInRegion - marginStart();
-    LayoutUnit logicalWidthInRegion = computedValues.m_extent;
-    LayoutUnit logicalLeftInRegion = computedValues.m_position;
-    LayoutUnit widthDelta = logicalWidthInRegion - logicalWidth();
-    LayoutUnit logicalLeftDelta = isOutOfFlowPositioned() ? logicalLeftInRegion - logicalLeft() : startMarginDelta;
-    LayoutUnit logicalRightInRegion = containingBlockLogicalWidthInRegion - (logicalLeftInRegion + logicalWidthInRegion);
-    LayoutUnit oldLogicalRight = containingBlockLogicalWidth - (logicalLeft() + logicalWidth());
-    LayoutUnit logicalRightDelta = isOutOfFlowPositioned() ? logicalRightInRegion - oldLogicalRight : startMarginDelta;
-
-    LayoutUnit logicalLeftOffset = 0;
-    
-    if (!isOutOfFlowPositioned() && avoidsFloats() && cb.containsFloats()) {
-        LayoutUnit startPositionDelta = cb.computeStartPositionDeltaForChildAvoidingFloats(*this, marginStartInRegion, region);
-        if (cb.style().isLeftToRightDirection())
-            logicalLeftDelta += startPositionDelta;
-        else
-            logicalRightDelta += startPositionDelta;
-    }
-
-    if (cb.style().isLeftToRightDirection())
-        logicalLeftOffset += logicalLeftDelta;
-    else
-        logicalLeftOffset -= (widthDelta + logicalRightDelta);
-    
-    LayoutUnit logicalRightOffset = logicalWidth() - (logicalLeftOffset + logicalWidthInRegion);
-    bool isShifted = (containingBlockInfo && containingBlockInfo->isShifted())
-            || (style().isLeftToRightDirection() && logicalLeftOffset)
-            || (!style().isLeftToRightDirection() && logicalRightOffset);
-
-    // FIXME: Although it's unlikely, these boxes can go outside our bounds, and so we will need to incorporate them into overflow.
-    if (cacheFlag == CacheRenderBoxRegionInfo)
-        return region->setRenderBoxRegionInfo(this, logicalLeftOffset, logicalWidthInRegion, isShifted);
-    return new RenderBoxRegionInfo(logicalLeftOffset, logicalWidthInRegion, isShifted);
+    return nullptr;
 }
 
 static bool shouldFlipBeforeAfterMargins(const RenderStyle& containingBlockStyle, const RenderStyle* childStyle)
@@ -3178,7 +3072,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType heightType, Len
             auto* container = isOutOfFlowPositioned() ? this->container() : containingBlock();
             while (container && container->isAnonymous()) {
                 // Stop at rendering context root.
-                if (is<RenderView>(*container) || is<RenderNamedFlowThread>(*container))
+                if (is<RenderView>(*container))
                     break;
                 container = container->containingBlock();
             }
@@ -3342,9 +3236,6 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo
             return downcast<RenderBox>(containingBlock).clientLogicalWidth();
         }
 
-        if (isFixedPosition && is<RenderNamedFlowThread>(containingBlock))
-            return containingBlock.view().clientLogicalWidth();
-
         if (!is<RenderBlock>(containingBlock))
             return downcast<RenderBox>(containingBlock).clientLogicalWidth();
 
@@ -3408,11 +3299,8 @@ LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxM
         const RenderBlock& cb = is<RenderBlock>(containingBlock) ? downcast<RenderBlock>(containingBlock) : *containingBlock.containingBlock();
         LayoutUnit result = cb.clientLogicalHeight();
         RenderFlowThread* flowThread = flowThreadContainingBlock();
-        if (flowThread && is<RenderFlowThread>(containingBlock) && flowThread->isHorizontalWritingMode() == containingBlock.isHorizontalWritingMode()) {
-            if (is<RenderNamedFlowThread>(containingBlock) && isFixedPosition)
-                return containingBlock.view().clientLogicalHeight();
+        if (flowThread && is<RenderFlowThread>(containingBlock) && flowThread->isHorizontalWritingMode() == containingBlock.isHorizontalWritingMode())
             return downcast<RenderFlowThread>(containingBlock).contentLogicalHeightOfFirstRegion();
-        }
         return result;
     }
         
index ec216fb..d90de15 100644 (file)
@@ -49,7 +49,6 @@
 #include "RenderLayerCompositor.h"
 #include "RenderMultiColumnFlowThread.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
 #include "RenderTable.h"
 #include "RenderTableRow.h"
@@ -411,7 +410,7 @@ LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
             // Since we will bypass the body’s renderer anyway, just end the loop if we encounter a region flow (named flow thread).
             // See http://dev.w3.org/csswg/css-regions/#cssomview-offset-attributes
             auto* ancestor = parent();
-            while (ancestor != offsetParent && !is<RenderNamedFlowThread>(*ancestor)) {
+            while (ancestor != offsetParent) {
                 // FIXME: What are we supposed to do inside SVG content?
                 
                 if (is<RenderMultiColumnFlowThread>(*ancestor)) {
@@ -427,11 +426,7 @@ LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
                 ancestor = ancestor->parent();
             }
             
-            // Compute the offset position for elements inside named flow threads for which the offsetParent was the body.
-            // See https://bugs.webkit.org/show_bug.cgi?id=115899
-            if (is<RenderNamedFlowThread>(*ancestor))
-                referencePoint = downcast<RenderNamedFlowThread>(*ancestor).adjustedPositionRelativeToOffsetParent(*this, referencePoint);
-            else if (is<RenderBox>(*offsetParent) && offsetParent->isBody() && !offsetParent->isPositioned())
+            if (is<RenderBox>(*offsetParent) && offsetParent->isBody() && !offsetParent->isPositioned())
                 referencePoint.moveBy(downcast<RenderBox>(*offsetParent).topLeftLocation());
         }
     }
index 7279362..7173ec5 100644 (file)
@@ -30,7 +30,6 @@
 #include "CursorList.h"
 #include "ElementChildIterator.h"
 #include "EventHandler.h"
-#include "FlowThreadController.h"
 #include "FocusController.h"
 #include "Frame.h"
 #include "FrameSelection.h"
@@ -48,6 +47,7 @@
 #include "RenderDeprecatedFlexibleBox.h"
 #include "RenderDescendantIterator.h"
 #include "RenderFlexibleBox.h"
+#include "RenderFlowThread.h"
 #include "RenderImage.h"
 #include "RenderImageResourceStyleImage.h"
 #include "RenderInline.h"
@@ -59,7 +59,6 @@
 #if !ASSERT_DISABLED
 #include "RenderListMarker.h"
 #endif
-#include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
 #include "RenderTableCaption.h"
 #include "RenderTableCell.h"
@@ -1111,15 +1110,6 @@ void RenderElement::willBeDestroyed()
 
     RenderObject::willBeDestroyed();
 
-#if !ASSERT_DISABLED
-    if (!renderTreeBeingDestroyed() && view().hasRenderNamedFlowThreads()) {
-        // After remove, the object and the associated information should not be in any flow thread.
-        for (auto& flowThread : *view().flowThreadController().renderNamedFlowThreadList()) {
-            ASSERT(!flowThread->hasChildInfo(this));
-        }
-    }
-#endif
-
     clearLayoutRootIfNeeded();
 
     if (hasInitializedStyle()) {
@@ -1181,26 +1171,7 @@ void RenderElement::setNeedsSimplifiedNormalFlowLayout()
 
 RenderElement* RenderElement::hoverAncestor() const
 {
-    // When searching for the hover ancestor and encountering a named flow thread,
-    // the search will continue with the DOM ancestor of the top-most element
-    // in the named flow thread.
-    // See https://bugs.webkit.org/show_bug.cgi?id=111749
-    RenderElement* hoverAncestor = parent();
-
-    // Skip anonymous blocks directly flowed into flow threads as it would
-    // prevent us from continuing the search on the DOM tree when reaching the named flow thread.
-    if (hoverAncestor && hoverAncestor->isAnonymousBlock() && hoverAncestor->parent() && hoverAncestor->parent()->isRenderNamedFlowThread())
-        hoverAncestor = hoverAncestor->parent();
-
-    if (hoverAncestor && hoverAncestor->isRenderNamedFlowThread()) {
-        hoverAncestor = nullptr;
-        if (Element* element = this->element()) {
-            if (auto parent = element->parentNode())
-                hoverAncestor = parent->renderer();
-        }
-    }
-
-    return hoverAncestor;
+    return parent();
 }
 
 static inline void paintPhase(RenderElement& element, PaintPhase phase, PaintInfo& paintInfo, const LayoutPoint& childPoint)
index 5c04c0f..0f697f8 100644 (file)
@@ -30,7 +30,6 @@
 #include "config.h"
 #include "RenderFlowThread.h"
 
-#include "FlowThreadController.h"
 #include "HitTestRequest.h"
 #include "HitTestResult.h"
 #include "InlineElementBox.h"
@@ -41,7 +40,6 @@
 #include "RenderLayer.h"
 #include "RenderLayerCompositor.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
 #include "RenderTableCell.h"
 #include "RenderTableSection.h"
@@ -445,7 +443,7 @@ LayoutPoint RenderFlowThread::adjustedPositionRelativeToOffsetParent(const Rende
         // and if so, drop the object's top position (which was computed relative to its containing block
         // and is no longer valid) and recompute it using the region in which it flows as reference.
         bool wasComputedRelativeToOtherRegion = false;
-        while (objContainingBlock && !is<RenderView>(*objContainingBlock) && !objContainingBlock->isRenderNamedFlowThread()) {
+        while (objContainingBlock && !is<RenderView>(*objContainingBlock)) {
             // Check if this object is in a different region.
             RenderRegion* parentStartRegion = nullptr;
             RenderRegion* parentEndRegion = nullptr;
@@ -1117,8 +1115,6 @@ bool RenderFlowThread::addForcedRegionBreak(const RenderBlock* block, LayoutUnit
 
 void RenderFlowThread::incrementAutoLogicalHeightRegions()
 {
-    if (!m_autoLogicalHeightRegionsCount)
-        view().flowThreadController().incrementFlowThreadsWithAutoLogicalHeightRegions();
     ++m_autoLogicalHeightRegionsCount;
 }
 
@@ -1126,8 +1122,6 @@ void RenderFlowThread::decrementAutoLogicalHeightRegions()
 {
     ASSERT(m_autoLogicalHeightRegionsCount > 0);
     --m_autoLogicalHeightRegionsCount;
-    if (!m_autoLogicalHeightRegionsCount)
-        view().flowThreadController().decrementFlowThreadsWithAutoLogicalHeightRegions();
 }
 
 void RenderFlowThread::collectLayerFragments(LayerFragments& layerFragments, const LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect)
@@ -1405,32 +1399,6 @@ void RenderFlowThread::addRegionsOverflowFromChild(const RenderBox* box, const R
         LayoutRect childLayoutOverflowRect = region->layoutOverflowRectForBoxForPropagation(child);
         childLayoutOverflowRect.move(delta);
         
-        // When propagating the layout overflow to the flow thread object, make sure to include
-        // the logical bottom padding of the scrollable region and the bottom margin of the flowed element.
-        // In order to behave in a similar manner to the non-regions case, content overflowing the box
-        // flowed into the region must be painted on top of the region's padding and the box's margin.
-        // See http://lists.w3.org/Archives/Public/www-style/2014Jan/0089.html
-        if (is<RenderNamedFlowThread>(*box)) {
-            ASSERT(box == this);
-            RenderBlockFlow& fragmentContainer = downcast<RenderNamedFlowFragment>(*region).fragmentContainer();
-            LayoutUnit spacingAfterLayout = fragmentContainer.paddingAfter() + child->marginAfter();
-            if (isHorizontalWritingMode()) {
-                if (fragmentContainer.scrollsOverflowY()) {
-                    LayoutUnit layoutMaxLogicalY = region->rectFlowPortionForBox(child, child->frameRect()).maxY() + spacingAfterLayout;
-                    LayoutUnit maxYDiff = layoutMaxLogicalY - childLayoutOverflowRect.maxY();
-                    if (maxYDiff > 0)
-                        childLayoutOverflowRect.expand(0, maxYDiff);
-                }
-            } else {
-                if (fragmentContainer.scrollsOverflowX()) {
-                    LayoutUnit layoutMaxLogicalY = region->rectFlowPortionForBox(child, child->frameRect()).maxX() + spacingAfterLayout;
-                    LayoutUnit maxYDiff = layoutMaxLogicalY - childLayoutOverflowRect.maxX();
-                    if (maxYDiff > 0)
-                        childLayoutOverflowRect.expand(maxYDiff, 0);
-                }
-            }
-        }
-        
         region->addLayoutOverflowForBox(box, childLayoutOverflowRect);
 
         if (child->hasSelfPaintingLayer() || box->hasOverflowClip()) {
index 32a8329..c0aa460 100644 (file)
 #include "InlineTextBox.h"
 #include "RenderBlock.h"
 #include "RenderChildIterator.h"
+#include "RenderFlowThread.h"
 #include "RenderFullScreen.h"
 #include "RenderGeometryMap.h"
 #include "RenderIterator.h"
 #include "RenderLayer.h"
 #include "RenderLineBreak.h"
 #include "RenderListMarker.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderTable.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
@@ -223,14 +223,12 @@ void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout)
     auto* parentStyle = &parent()->style();
     RenderInline* parentRenderInline = is<RenderInline>(*parent()) ? downcast<RenderInline>(parent()) : nullptr;
     bool checkFonts = document().inNoQuirksMode();
-    RenderFlowThread* flowThread = flowThreadContainingBlock();
     bool alwaysCreateLineBoxes = (parentRenderInline && parentRenderInline->alwaysCreateLineBoxes())
         || (parentRenderInline && parentStyle->verticalAlign() != BASELINE)
         || style().verticalAlign() != BASELINE
         || style().textEmphasisMark() != TextEmphasisMarkNone
         || (checkFonts && (!parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(style().fontCascade().fontMetrics())
-        || parentStyle->lineHeight() != style().lineHeight()))
-        || (flowThread && flowThread->isRenderNamedFlowThread()); // FIXME: Enable the optimization once we make overflow computation for culled inlines in regions.
+        || parentStyle->lineHeight() != style().lineHeight()));
 
     if (!alwaysCreateLineBoxes && checkFonts && view().usesFirstLineRules()) {
         // Have to check the first line style as well.
index 3faac54..3bb3c19 100644 (file)
@@ -61,7 +61,6 @@
 #include "FloatPoint3D.h"
 #include "FloatRect.h"
 #include "FloatRoundedRect.h"
-#include "FlowThreadController.h"
 #include "FocusController.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -98,7 +97,6 @@
 #include "RenderMarquee.h"
 #include "RenderMultiColumnFlowThread.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
 #include "RenderReplica.h"
 #include "RenderSVGResourceClipper.h"
@@ -4251,31 +4249,6 @@ static inline bool compareZIndex(RenderLayer* first, RenderLayer* second)
     return first->zIndex() < second->zIndex();
 }
 
-// Paint the layers associated with the fixed positioned elements in named flows.
-// These layers should not be painted in a similar way as the other elements collected in
-// named flows - regions -> named flows - since we do not want them to be clipped to the
-// regions viewport.
-void RenderLayer::paintFixedLayersInNamedFlows(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
-{
-    if (!isRenderViewLayer())
-        return;
-
-    // Get the named flows for the view
-    if (!renderer().view().hasRenderNamedFlowThreads())
-        return;
-
-    // Ensure the flow threads hierarchy is up-to-date before using it.
-    renderer().view().flowThreadController().updateNamedFlowsLayerListsIfNeeded();
-
-    // Collect the fixed layers in a list to be painted
-    Vector<RenderLayer*> fixedLayers;
-    renderer().view().flowThreadController().collectFixedPositionedLayers(fixedLayers);
-
-    // Paint the layers
-    for (auto* fixedLayer : fixedLayers)
-        fixedLayer->paintLayer(context, paintingInfo, paintFlags);
-}
-
 void RenderLayer::paintLayerContents(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
 {
     ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant());
@@ -4418,13 +4391,6 @@ void RenderLayer::paintLayerContents(GraphicsContext& context, const LayerPainti
         
             // Now walk the sorted list of children with positive z-indices.
             paintList(posZOrderList(), currentContext, localPaintingInfo, localPaintFlags);
-
-            // Paint the fixed elements from flow threads.
-            paintFixedLayersInNamedFlows(currentContext, localPaintingInfo, localPaintFlags);
-            
-            // If this is a region, paint its contents via the flow thread's layer.
-            if (shouldPaintContent)
-                paintFlowThreadIfRegionForFragments(layerFragments, currentContext, localPaintingInfo, localPaintFlags);
         }
 
         if (isPaintingOverlayScrollbars && hasScrollbars())
@@ -5051,51 +5017,6 @@ static bool isHitCandidate(const RenderLayer* hitLayer, bool canDepthSort, doubl
     return true;
 }
 
-RenderLayer* RenderLayer::hitTestFixedLayersInNamedFlows(RenderLayer* /*rootLayer*/,
-    const HitTestRequest& request, HitTestResult& result,
-    const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation,
-    const HitTestingTransformState* transformState, 
-    double* zOffsetForDescendants, double* zOffset,
-    const HitTestingTransformState* unflattenedTransformState,
-    bool depthSortDescendants)
-{
-    if (!isRenderViewLayer())
-        return nullptr;
-
-    // Get the named flows for the view
-    if (!renderer().view().hasRenderNamedFlowThreads())
-        return nullptr;
-
-    Vector<RenderLayer*> fixedLayers;
-    renderer().view().flowThreadController().collectFixedPositionedLayers(fixedLayers);
-
-    // Hit test the layers
-    RenderLayer* resultLayer = nullptr;
-    for (int i = fixedLayers.size() - 1; i >= 0; --i) {
-        RenderLayer* fixedLayer = fixedLayers.at(i);
-
-        HitTestResult tempResult(result.hitTestLocation());
-        RenderLayer* hitLayer = fixedLayer->hitTestLayer(fixedLayer->renderer().flowThreadContainingBlock()->layer(), nullptr, request, tempResult,
-            hitTestRect, hitTestLocation, false, transformState, zOffsetForDescendants);
-
-        // If it a list-based test, we can safely append the temporary result since it might had hit
-        // nodes but not necesserily had hitLayer set.
-        ASSERT(!result.isRectBasedTest() || request.resultIsElementList());
-        if (request.resultIsElementList())
-            result.append(tempResult, request);
-
-        if (isHitCandidate(hitLayer, depthSortDescendants, zOffset, unflattenedTransformState)) {
-            resultLayer = hitLayer;
-            if (!request.resultIsElementList())
-                result = tempResult;
-            if (!depthSortDescendants)
-                break;
-        }
-    }
-
-    return resultLayer;
-}
-
 // hitTestLocation and hitTestRect are relative to rootLayer.
 // A 'flattening' layer is one preserves3D() == false.
 // transformState.m_accumulatedTransform holds the transform from the containing flattening layer.
@@ -5200,17 +5121,8 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
     LayerListMutationDetector mutationChecker(this);
 #endif
 
-    // Check the fixed positioned layers within flow threads that are positioned by the view.
-    RenderLayer* hitLayer = hitTestFixedLayersInNamedFlows(rootLayer, request, result, hitTestRect, hitTestLocation,
-        localTransformState.get(), zOffsetForDescendantsPtr, zOffset, unflattenedTransformState.get(), depthSortDescendants);
-    if (hitLayer) {
-        if (!depthSortDescendants)
-            return hitLayer;
-        candidateLayer = hitLayer;
-    }
-
     // Begin by walking our list of positive layers from highest z-index down to the lowest z-index.
-    hitLayer = hitTestList(posZOrderList(), rootLayer, request, result, hitTestRect, hitTestLocation,
+    auto* hitLayer = hitTestList(posZOrderList(), rootLayer, request, result, hitTestRect, hitTestLocation,
                                         localTransformState.get(), zOffsetForDescendantsPtr, zOffset, unflattenedTransformState.get(), depthSortDescendants);
     if (hitLayer) {
         if (!depthSortDescendants)
@@ -5568,9 +5480,6 @@ void RenderLayer::calculateClipRects(const ClipRectsContext& clipRectsContext, C
     ClipRectsType clipRectsType = clipRectsContext.clipRectsType;
     bool useCached = clipRectsType != TemporaryClipRects;
 
-    if (renderer().isRenderNamedFlowThread() && mapLayerClipRectsToFragmentationLayer(clipRects))
-        return;
-
     // For transformed layers, the root layer was shifted to be us, so there is no need to
     // examine the parent. We want to cache clip rects with us as the root.
     RenderLayer* parentLayer = clipRectsContext.rootLayer != this ? parent() : nullptr;
@@ -5632,11 +5541,6 @@ void RenderLayer::calculateClipRects(const ClipRectsContext& clipRectsContext, C
 Ref<ClipRects> RenderLayer::parentClipRects(const ClipRectsContext& clipRectsContext) const
 {
     ASSERT(parent());
-    if (renderer().isRenderNamedFlowThread()) {
-        auto parentClipRects = ClipRects::create();
-        if (mapLayerClipRectsToFragmentationLayer(parentClipRects))
-            return parentClipRects;
-    }
 
     if (clipRectsContext.clipRectsType == TemporaryClipRects) {
         auto parentClipRects = ClipRects::create();
@@ -5763,17 +5667,6 @@ void RenderLayer::calculateRects(const ClipRectsContext& clipRectsContext, const
             bounds.move(offsetFromRootLocal);
             if (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)
                 backgroundRect.intersect(bounds);
-            // Boxes inside flow threads don't have their logical left computed to avoid
-            // floats. Instead, that information is kept in their RenderBoxRegionInfo structure.
-            // As such, the layer bounds must be enlarged to encompass their background rect
-            // to ensure intersecting them won't result in an empty rect, which would eventually
-            // cause paint rejection.
-            if (flowThread && flowThread->isRenderNamedFlowThread()) {
-                if (flowThread->style().isHorizontalWritingMode())
-                    layerBounds.shiftMaxXEdgeTo(std::max(layerBounds.maxX(), backgroundRect.rect().maxX()));
-                else
-                    layerBounds.shiftMaxYEdgeTo(std::max(layerBounds.maxY(), backgroundRect.rect().maxY()));
-            }
         }
     }
 }
@@ -7099,50 +6992,6 @@ void RenderLayer::paintNamedFlowThreadInsideRegion(GraphicsContext& context, Ren
     context.restore();
 }
 
-void RenderLayer::paintFlowThreadIfRegionForFragments(const LayerFragments& fragments, GraphicsContext& context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
-{
-    if (!renderer().isRenderNamedFlowFragmentContainer())
-        return;
-    
-    RenderBlockFlow& renderNamedFlowFragmentContainer = downcast<RenderBlockFlow>(renderer());
-    RenderNamedFlowFragment* flowFragment = renderNamedFlowFragmentContainer.renderNamedFlowFragment();
-    if (!flowFragment->isValid())
-        return;
-
-    RenderNamedFlowThread* flowThread = flowFragment->namedFlowThread();
-    RenderLayer* flowThreadLayer = flowThread->layer();
-
-    LayoutRect regionClipRect = LayoutRect::infiniteRect();
-    if (flowFragment->shouldClipFlowThreadContent()) {
-        regionClipRect = renderNamedFlowFragmentContainer.paddingBoxRect();
-
-        // When the layer of the flow fragment's container is composited, the flow fragment container receives a
-        // GraphicsLayer of its own so the clipping coordinates (caused by overflow:hidden) must be relative to the
-        // GraphicsLayer coordinates in which the fragment gets painted. So what is computed so far is enough.
-        // If the layer of the flowFragment is not composited, then we change the coordinates to be relative to the flow
-        // thread's layer.
-        if (!isComposited())
-            regionClipRect.move(offsetFromAncestor(paintingInfo.rootLayer));
-    }
-    
-    for (const auto& fragment : fragments) {
-        ClipRect clipRect = fragment.foregroundRect;
-        if (flowFragment->shouldClipFlowThreadContent())
-            clipRect.intersect(regionClipRect);
-
-        bool shouldClip = !clipRect.isInfinite();
-        // Optimize clipping for the single fragment case.
-        if (shouldClip)
-            clipToRect(context, paintingInfo, clipRect);
-
-        flowThreadLayer->paintNamedFlowThreadInsideRegion(context, flowFragment, paintingInfo.paintDirtyRect, fragment.layerBounds.location() + paintingInfo.subpixelOffset,
-            paintingInfo.paintBehavior, paintFlags);
-
-        if (shouldClip)
-            restoreClip(context, paintingInfo, clipRect);
-    }
-}
-
 RenderLayer* RenderLayer::hitTestFlowThreadIfRegionForFragments(const LayerFragments& fragments, RenderLayer*, const HitTestRequest& request, HitTestResult& result, const LayoutRect& hitTestRect,
     const HitTestLocation& hitTestLocation,
     const HitTestingTransformState* transformState, 
index a4215a9..7568cbe 100644 (file)
@@ -834,7 +834,6 @@ private:
     void applyFilters(FilterEffectRendererHelper*, GraphicsContext& originalContext, const LayerPaintingInfo&, const LayerFragments&);
 
     void paintLayer(GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags);
-    void paintFixedLayersInNamedFlows(GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags);
     void paintLayerContentsAndReflection(GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags);
     void paintLayerByApplyingTransform(GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags, const LayoutSize& translationOffset = LayoutSize());
     void paintLayerContents(GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags);
@@ -1035,7 +1034,6 @@ private:
         const LayoutRect&, const HitTestLocation&,
         const HitTestingTransformState*, double* zOffsetForDescendants,
         double* zOffset, const HitTestingTransformState* unflattenedTransformState, bool depthSortDescendants);
-    void paintFlowThreadIfRegionForFragments(const LayerFragments&, GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags);
     bool mapLayerClipRectsToFragmentationLayer(ClipRects&) const;
 
     RenderNamedFlowFragment* currentRenderNamedFlowFragment() const;
index d614209..c1ebf5b 100644 (file)
@@ -32,7 +32,6 @@
 #include "CanvasRenderingContext.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
-#include "FlowThreadController.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsLayer.h"
@@ -702,8 +701,6 @@ bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
 #endif
 
     if (checkForHierarchyUpdate) {
-        if (m_renderView.hasRenderNamedFlowThreads() && isFullUpdate)
-            m_renderView.flowThreadController().updateFlowThreadsLayerToRegionMappingsIfNeeded();
         // Go through the layers in presentation order, so that we can compute which RenderLayers need compositing layers.
         // FIXME: we could maybe do this and the hierarchy udpate in one pass, but the parenting logic would be more complex.
         CompositingState compState(updateRoot);
@@ -1259,21 +1256,6 @@ void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, con
         overlapMap.geometryMap().popMappingsToAncestor(ancestorLayer);
 }
 
-void RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed(RenderLayer& layer, OverlapMap& overlapMap, CompositingState& childState, bool& layersChanged, bool& anyDescendantHas3DTransform)
-{
-    if (!layer.isRenderViewLayer())
-        return;
-
-    if (!layer.renderer().view().hasRenderNamedFlowThreads())
-        return;
-
-    Vector<RenderLayer*> fixedLayers;
-    layer.renderer().view().flowThreadController().collectFixedPositionedLayers(fixedLayers);
-
-    for (auto* fixedLayer : fixedLayers)
-        computeCompositingRequirements(&layer, *fixedLayer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
-}
-
 //  Recurse through the layers in z-index and overflow order (which is equivalent to painting order)
 //  For the z-order children of a compositing layer:
 //      If a child layers has a compositing layer, then all subsequent layers must
@@ -1414,9 +1396,6 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
         }
     }
 
-    if (layer.isRenderViewLayer())
-        computeCompositingRequirementsForNamedFlowFixed(layer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
-
     // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled).
     if (layer.isRenderViewLayer()) {
         if (inCompositingMode() && m_hasAcceleratedCompositing)
@@ -1569,21 +1548,6 @@ bool RenderLayerCompositor::canAccelerateVideoRendering(RenderVideo& video) cons
 }
 #endif
 
-void RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed(RenderLayer& layer, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth)
-{
-    if (!layer.isRenderViewLayer())
-        return;
-
-    if (!layer.renderer().view().hasRenderNamedFlowThreads())
-        return;
-
-    Vector<RenderLayer*> fixedLayers;
-    layer.renderer().view().flowThreadController().collectFixedPositionedLayers(fixedLayers);
-
-    for (auto* fixedLayer : fixedLayers)
-        rebuildCompositingLayerTree(*fixedLayer, childGraphicsLayersOfEnclosingLayer, depth);
-}
-
 void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer& layer, Vector<GraphicsLayer*>& childLayersOfEnclosingLayer, int depth)
 {
     // Make the layer compositing if necessary, and set up clipping and content layers.
@@ -1657,9 +1621,6 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer& layer, Vect
         }
     }
 
-    if (layer.isRenderViewLayer())
-        rebuildCompositingLayerTreeForNamedFlowFixed(layer, childList, depth + 1);
-
     if (layerBacking) {
         bool parented = false;
         if (is<RenderWidget>(layer.renderer()))
index 13c9417..c3f04c0 100644 (file)
@@ -371,8 +371,6 @@ private:
 
     void computeRegionCompositingRequirements(RenderNamedFlowFragment*, OverlapMap&, CompositingState&, bool& layersChanged, bool& anyDescendantHas3DTransform);
 
-    void computeCompositingRequirementsForNamedFlowFixed(RenderLayer&, OverlapMap&, CompositingState&, bool& layersChanged, bool& anyDescendantHas3DTransform);
-
     // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer.
     void rebuildCompositingLayerTree(RenderLayer&, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth);
 
@@ -380,8 +378,6 @@ private:
     // layers for the current compositing layer corresponding to the anonymous region (that belongs to the region's parent).
     void rebuildRegionCompositingLayerTree(RenderNamedFlowFragment*, Vector<GraphicsLayer*>& childList, int depth);
 
-    void rebuildCompositingLayerTreeForNamedFlowFixed(RenderLayer&, Vector<GraphicsLayer*>& childList, int depth);
-
     // Recurses down the tree, updating layer geometry only.
     void updateLayerTreeGeometry(RenderLayer&, int depth);
     
index 28258d3..e521cfd 100644 (file)
 #include "config.h"
 #include "RenderNamedFlowFragment.h"
 
-#include "FlowThreadController.h"
 #include "PaintInfo.h"
 #include "RenderBoxRegionInfo.h"
 #include "RenderFlowThread.h"
 #include "RenderIterator.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderTableCell.h"
 #include "RenderView.h"
 #include "StyleResolver.h"
@@ -293,7 +291,6 @@ void RenderNamedFlowFragment::checkRegionStyle()
     bool customRegionStyle = false;
 
     setHasCustomRegionStyle(customRegionStyle);
-    downcast<RenderNamedFlowThread>(*m_flowThread).checkRegionsWithStyling();
 }
 
 std::unique_ptr<RenderStyle> RenderNamedFlowFragment::computeStyleInRegion(RenderElement&, const RenderStyle&) const
@@ -389,11 +386,6 @@ void RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle()
     m_rendererRegionStyle.swap(temp);
 }
 
-RenderNamedFlowThread* RenderNamedFlowFragment::namedFlowThread() const
-{
-    return downcast<RenderNamedFlowThread>(flowThread());
-}
-
 LayoutRect RenderNamedFlowFragment::visualOverflowRect() const
 {
     if (isValid()) {
index d8f0550..7e6ff5e 100644 (file)
@@ -85,8 +85,6 @@ public:
     
     LayoutRect visualOverflowRect() const override;
 
-    RenderNamedFlowThread* namedFlowThread() const;
-
     bool hasAutoLogicalHeight() const override { return m_hasAutoLogicalHeight; }
 
     LayoutUnit computedAutoHeight() const { return m_computedAutoHeight; }
diff --git a/Source/WebCore/rendering/RenderNamedFlowThread.cpp b/Source/WebCore/rendering/RenderNamedFlowThread.cpp
deleted file mode 100644 (file)
index 7410ace..0000000
+++ /dev/null
@@ -1,760 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS IN..0TERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "RenderNamedFlowThread.h"
-
-#include "ComposedTreeAncestorIterator.h"
-#include "FlowThreadController.h"
-#include "InlineTextBox.h"
-#include "InspectorInstrumentation.h"
-#include "NodeTraversal.h"
-#include "Position.h"
-#include "Range.h"
-#include "RenderInline.h"
-#include "RenderLayer.h"
-#include "RenderLineBreak.h"
-#include "RenderNamedFlowFragment.h"
-#include "RenderText.h"
-#include "RenderView.h"
-#include "ShadowRoot.h"
-#include "Text.h"
-
-namespace WebCore {
-
-RenderNamedFlowThread::RenderNamedFlowThread(Document& document, RenderStyle&& style)
-    : RenderFlowThread(document, WTFMove(style))
-    , m_hasRegionsWithStyling(false)
-    , m_dispatchRegionOversetChangeEvent(false)
-    , m_regionOversetChangeEventTimer(*this, &RenderNamedFlowThread::regionOversetChangeEventTimerFired)
-{
-}
-
-RenderNamedFlowThread::~RenderNamedFlowThread()
-{
-    // Do not add any code here. Add it to willBeDestroyed() instead.
-}
-
-void RenderNamedFlowThread::willBeDestroyed()
-{
-    // The flow thread can be destroyed without unregistering the content nodes if the document is destroyed.
-    // This can lead to problems because the nodes are still marked as belonging to a flow thread.
-    clearContentElements();
-
-    // Also leave the NamedFlow object in a consistent state by calling mark for destruction.
-    setMarkForDestruction();
-
-    RenderFlowThread::willBeDestroyed();
-}
-
-const char* RenderNamedFlowThread::renderName() const
-{    
-    return "RenderNamedFlowThread";
-}
-    
-void RenderNamedFlowThread::clearContentElements()
-{
-}
-
-void RenderNamedFlowThread::updateWritingMode()
-{
-    auto* firstFragment = downcast<RenderNamedFlowFragment>(m_regionList.first());
-    if (!firstFragment)
-        return;
-    if (style().writingMode() == firstFragment->style().writingMode())
-        return;
-
-    // The first region defines the principal writing mode for the entire flow.
-    auto newStyle = RenderStyle::clone(style());
-    newStyle.setWritingMode(firstFragment->style().writingMode());
-    setStyle(WTFMove(newStyle));
-}
-
-bool RenderNamedFlowThread::dependsOn(RenderNamedFlowThread* otherRenderFlowThread) const
-{
-    if (m_layoutBeforeThreadsSet.contains(otherRenderFlowThread))
-        return true;
-
-    // Recursively traverse the m_layoutBeforeThreadsSet.
-    for (const auto& beforeFlowThreadPair : m_layoutBeforeThreadsSet) {
-        const auto& beforeFlowThread = beforeFlowThreadPair.key;
-        if (beforeFlowThread->dependsOn(otherRenderFlowThread))
-            return true;
-    }
-
-    return false;
-}
-
-// Compare two regions to determine in which one the content should flow first.
-// The function returns true if the first passed region is "less" than the second passed region.
-// If the first region appears before second region in DOM,
-// the first region is "less" than the second region.
-// If the first region is "less" than the second region, the first region receives content before second region.
-static bool compareRenderNamedFlowFragments(const RenderNamedFlowFragment* firstFragment, const RenderNamedFlowFragment* secondFragment)
-{
-    ASSERT(firstFragment);
-    ASSERT(secondFragment);
-
-    ASSERT(firstFragment->generatingElement());
-    ASSERT(secondFragment->generatingElement());
-
-    // If the regions belong to different nodes, compare their position in the DOM.
-    if (firstFragment->generatingElement() != secondFragment->generatingElement()) {
-        unsigned short position = firstFragment->generatingElement()->compareDocumentPosition(*secondFragment->generatingElement());
-
-        // If the second region is contained in the first one, the first region is "less" if it's :before.
-        if (position & Node::DOCUMENT_POSITION_CONTAINED_BY) {
-            ASSERT(secondFragment->style().styleType() == NOPSEUDO);
-            return firstFragment->style().styleType() == BEFORE;
-        }
-
-        // If the second region contains the first region, the first region is "less" if the second is :after.
-        if (position & Node::DOCUMENT_POSITION_CONTAINS) {
-            ASSERT(firstFragment->style().styleType() == NOPSEUDO);
-            return secondFragment->style().styleType() == AFTER;
-        }
-
-        return (position & Node::DOCUMENT_POSITION_FOLLOWING);
-    }
-
-    // FIXME: Currently it's not possible for an element to be both a region and have pseudo-children. The case is covered anyway.
-    switch (firstFragment->style().styleType()) {
-    case BEFORE:
-        // The second region can be the node or the after pseudo-element (before is smaller than any of those).
-        return true;
-    case AFTER:
-        // The second region can be the node or the before pseudo-element (after is greater than any of those).
-        return false;
-    case NOPSEUDO:
-        // The second region can either be the before or the after pseudo-element (the node is only smaller than the after pseudo-element).
-        return firstFragment->style().styleType() == AFTER;
-    default:
-        break;
-    }
-
-    ASSERT_NOT_REACHED();
-    return true;
-}
-
-// This helper function adds a region to a list preserving the order property of the list.
-static void addFragmentToList(RenderRegionList& regionList, RenderNamedFlowFragment* renderNamedFlowFragment)
-{
-    if (regionList.isEmpty())
-        regionList.add(renderNamedFlowFragment);
-    else {
-        // Find the first region "greater" than renderNamedFlowFragment.
-        auto it = regionList.begin();
-        while (it != regionList.end() && !compareRenderNamedFlowFragments(renderNamedFlowFragment, downcast<RenderNamedFlowFragment>(*it)))
-            ++it;
-        regionList.insertBefore(it, renderNamedFlowFragment);
-    }
-}
-
-void RenderNamedFlowThread::addFragmentToNamedFlowThread(RenderNamedFlowFragment* renderNamedFlowFragment)
-{
-    ASSERT(renderNamedFlowFragment);
-    ASSERT(!renderNamedFlowFragment->isValid());
-
-    if (renderNamedFlowFragment->parentNamedFlowThread())
-        addDependencyOnFlowThread(renderNamedFlowFragment->parentNamedFlowThread());
-
-    renderNamedFlowFragment->setIsValid(true);
-    renderNamedFlowFragment->updateRegionFlags();
-    addFragmentToList(m_regionList, renderNamedFlowFragment);
-
-    if (m_regionList.first() == renderNamedFlowFragment)
-        updateWritingMode();
-}
-
-void RenderNamedFlowThread::addRegionToThread(RenderRegion* renderRegion)
-{
-    ASSERT(renderRegion);
-    ASSERT(!renderRegion->isValid());
-
-    RenderNamedFlowFragment& renderNamedFlowFragment = downcast<RenderNamedFlowFragment>(*renderRegion);
-    resetMarkForDestruction();
-
-    if (renderNamedFlowFragment.parentNamedFlowThread() && renderNamedFlowFragment.parentNamedFlowThread()->dependsOn(this)) {
-        // The order of invalid regions is irrelevant.
-        m_invalidRegionList.add(&renderNamedFlowFragment);
-        // Register ourself to get a notification when the state changes.
-        renderNamedFlowFragment.parentNamedFlowThread()->m_observerThreadsSet.add(this);
-        return;
-    }
-
-    addFragmentToNamedFlowThread(&renderNamedFlowFragment);
-
-    invalidateRegions();
-}
-
-void RenderNamedFlowThread::removeRegionFromThread(RenderRegion* renderRegion)
-{
-    ASSERT(renderRegion);
-
-    RenderNamedFlowFragment& renderNamedFlowFragment = downcast<RenderNamedFlowFragment>(*renderRegion);
-    if (renderNamedFlowFragment.parentNamedFlowThread()) {
-        if (!renderNamedFlowFragment.isValid()) {
-            ASSERT(m_invalidRegionList.contains(&renderNamedFlowFragment));
-            m_invalidRegionList.remove(&renderNamedFlowFragment);
-            renderNamedFlowFragment.parentNamedFlowThread()->m_observerThreadsSet.remove(this);
-            // No need to invalidate the regions rectangles. The removed region
-            // was not taken into account. Just return here.
-            return;
-        }
-        removeDependencyOnFlowThread(renderNamedFlowFragment.parentNamedFlowThread());
-    }
-
-    ASSERT(m_regionList.contains(&renderNamedFlowFragment));
-    bool wasFirst = m_regionList.first() == &renderNamedFlowFragment;
-    m_regionList.remove(&renderNamedFlowFragment);
-
-    if (canBeDestroyed())
-        setMarkForDestruction();
-
-    if (!m_regionList.isEmpty() && wasFirst)
-        updateWritingMode();
-
-    invalidateRegions();
-}
-
-void RenderNamedFlowThread::regionChangedWritingMode(RenderRegion* region)
-{
-    if (m_regionList.first() == region)
-        updateWritingMode();
-}
-
-LayoutRect RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment(const RenderBox& box, RenderNamedFlowFragment& fragment) const
-{
-    LayoutRect visualOverflowRect = fragment.visualOverflowRectForBox(box);
-    LayoutUnit initialLogicalX = style().isHorizontalWritingMode() ? visualOverflowRect.x() : visualOverflowRect.y();
-
-    // The visual overflow rect returned by visualOverflowRectForBox is already flipped but the
-    // RenderRegion::rectFlowPortionForBox method expects it unflipped.
-    flipForWritingModeLocalCoordinates(visualOverflowRect);
-    visualOverflowRect = fragment.rectFlowPortionForBox(&box, visualOverflowRect);
-    
-    // Now flip it again.
-    flipForWritingModeLocalCoordinates(visualOverflowRect);
-
-    // Take the scrolled offset of this object's parents into consideration.
-    ScrollPosition scrollPosition;
-    RenderBlock* containingBlock = box.containingBlock();
-    while (containingBlock && !is<RenderView>(*containingBlock)) {
-        if (containingBlock->isRenderNamedFlowThread()) {
-            // We've reached the flow thread, take the scrolled offset of the region into consideration.
-            ASSERT(containingBlock == this);
-            scrollPosition += toIntSize(fragment.fragmentContainer().scrollPosition());
-            break;
-        }
-        
-        scrollPosition += toIntSize(containingBlock->scrollPosition());
-        containingBlock = containingBlock->containingBlock();
-    }
-
-    if (!scrollPosition.isZero()) {
-        if (style().isFlippedBlocksWritingMode())
-            scrollPosition = -scrollPosition;
-        
-        visualOverflowRect.inflateX(scrollPosition.x());
-        visualOverflowRect.inflateY(scrollPosition.y());
-    }
-    
-    // Layers are in physical coordinates so the origin must be moved to the physical top-left of the flowthread.
-    if (style().isFlippedBlocksWritingMode()) {
-        if (style().isHorizontalWritingMode())
-            visualOverflowRect.moveBy(LayoutPoint(0, height()));
-        else
-            visualOverflowRect.moveBy(LayoutPoint(width(), 0));
-    }
-
-    const RenderBox* iterBox = &box;
-    while (iterBox && iterBox != this) {
-        RenderBlock* containerBlock = iterBox->containingBlock();
-
-        // FIXME: This doesn't work properly with flipped writing modes.
-        // https://bugs.webkit.org/show_bug.cgi?id=125149
-        if (iterBox->isPositioned()) {
-            // For positioned elements, just use the layer's absolute bounding box.
-            visualOverflowRect.moveBy(iterBox->layer()->absoluteBoundingBox().location());
-            break;
-        }
-
-        LayoutRect currentBoxRect = iterBox->frameRect();
-        if (iterBox->style().isFlippedBlocksWritingMode()) {
-            if (iterBox->style().isHorizontalWritingMode())
-                currentBoxRect.setY(currentBoxRect.height() - currentBoxRect.maxY());
-            else
-                currentBoxRect.setX(currentBoxRect.width() - currentBoxRect.maxX());
-        }
-
-        if (containerBlock->style().writingMode() != iterBox->style().writingMode())
-            iterBox->flipForWritingMode(currentBoxRect);
-
-        visualOverflowRect.moveBy(currentBoxRect.location());
-        iterBox = containerBlock;
-    }
-
-    // Since the purpose of this method is to make sure the borders of a fragmented
-    // element don't overflow the region in the fragmentation direction, there's no
-    // point in restricting the clipping rect on the logical X axis. 
-    // This also saves us the trouble of handling percent-based widths and margins
-    // since the absolute bounding box of a positioned element would not contain
-    // the correct coordinates relative to the region we're interested in, but rather
-    // relative to the actual flow thread.
-    if (style().isHorizontalWritingMode()) {
-        if (initialLogicalX < visualOverflowRect.x())
-            visualOverflowRect.shiftXEdgeTo(initialLogicalX);
-        if (visualOverflowRect.width() < frameRect().width())
-            visualOverflowRect.setWidth(frameRect().width());
-    } else {
-        if (initialLogicalX < visualOverflowRect.y())
-            visualOverflowRect.shiftYEdgeTo(initialLogicalX);
-        if (visualOverflowRect.height() < frameRect().height())
-            visualOverflowRect.setHeight(frameRect().height());
-    }
-
-    return visualOverflowRect;
-}
-
-RenderBlock* RenderNamedFlowThread::fragmentFromRenderBoxAsRenderBlock(RenderBox* renderBox, const IntPoint& absolutePoint, const RenderBox& flowedBox)
-{
-    return downcast<RenderNamedFlowThread>(*renderBox).fragmentFromAbsolutePointAndBox(absolutePoint, flowedBox);
-}
-
-RenderNamedFlowFragment* RenderNamedFlowThread::fragmentFromAbsolutePointAndBox(const IntPoint& absolutePoint, const RenderBox& flowedBox)
-{
-    RenderRegion* startRegion = nullptr;
-    RenderRegion* endRegion = nullptr;
-    if (!getRegionRangeForBox(&flowedBox, startRegion, endRegion))
-        return nullptr;
-    
-    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
-        auto& fragment = downcast<RenderNamedFlowFragment>(**iter);
-        RenderBlockFlow& fragmentContainer = fragment.fragmentContainer();
-        IntRect fragmentAbsoluteRect(roundedIntPoint(fragmentContainer.localToAbsolute()), roundedIntSize(fragmentContainer.paddingBoxRect().size()));
-        if (fragmentAbsoluteRect.contains(absolutePoint))
-            return &fragment;
-        
-        if (&fragment == endRegion)
-            break;
-    }
-    
-    return nullptr;
-}
-
-void RenderNamedFlowThread::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats)
-{
-    RenderFlowThread::computeOverflow(oldClientAfterEdge, recomputeFloats);
-
-    m_flowContentBottom = oldClientAfterEdge;
-}
-
-void RenderNamedFlowThread::layout()
-{
-    RenderFlowThread::layout();
-
-    // If the number of regions has changed since we last computed the overset property, schedule the regionOversetChange event.
-    if (previousRegionCountChanged()) {
-        setDispatchRegionOversetChangeEvent(true);
-        updatePreviousRegionCount();
-    }
-}
-
-void RenderNamedFlowThread::dispatchNamedFlowEvents()
-{
-    ASSERT(inFinalLayoutPhase());
-
-    dispatchRegionOversetChangeEventIfNeeded();
-}
-
-void RenderNamedFlowThread::checkInvalidRegions()
-{
-    Vector<RenderNamedFlowFragment*> newValidFragments;
-    for (auto& region : m_invalidRegionList) {
-        auto& namedFlowFragment = downcast<RenderNamedFlowFragment>(*region);
-        // The only reason a region would be invalid is because it has a parent flow thread.
-        ASSERT(!namedFlowFragment.isValid() && namedFlowFragment.parentNamedFlowThread());
-        if (namedFlowFragment.parentNamedFlowThread()->dependsOn(this))
-            continue;
-
-        newValidFragments.append(&namedFlowFragment);
-    }
-
-    for (auto& namedFlowFragment : newValidFragments) {
-        m_invalidRegionList.remove(namedFlowFragment);
-        namedFlowFragment->parentNamedFlowThread()->m_observerThreadsSet.remove(this);
-        addFragmentToNamedFlowThread(namedFlowFragment);
-    }
-
-    if (!newValidFragments.isEmpty())
-        invalidateRegions();
-
-    if (m_observerThreadsSet.isEmpty())
-        return;
-
-    // Notify all the flow threads that were dependent on this flow.
-
-    // Create a copy of the list first. That's because observers might change the list when calling checkInvalidRegions.
-    Vector<RenderNamedFlowThread*> observers;
-    copyToVector(m_observerThreadsSet, observers);
-
-    for (auto& flowThread : observers)
-        flowThread->checkInvalidRegions();
-}
-
-void RenderNamedFlowThread::addDependencyOnFlowThread(RenderNamedFlowThread* otherFlowThread)
-{
-    RenderNamedFlowThreadCountedSet::AddResult result = m_layoutBeforeThreadsSet.add(otherFlowThread);
-    if (result.isNewEntry) {
-        // This is the first time we see this dependency. Make sure we recalculate all the dependencies.
-        view().flowThreadController().setIsRenderNamedFlowThreadOrderDirty(true);
-    }
-}
-
-void RenderNamedFlowThread::removeDependencyOnFlowThread(RenderNamedFlowThread* otherFlowThread)
-{
-    bool removed = m_layoutBeforeThreadsSet.remove(otherFlowThread);
-    if (removed) {
-        checkInvalidRegions();
-        view().flowThreadController().setIsRenderNamedFlowThreadOrderDirty(true);
-    }
-}
-
-void RenderNamedFlowThread::pushDependencies(RenderNamedFlowThreadList& list)
-{
-    for (auto& flowThreadPair : m_layoutBeforeThreadsSet) {
-        auto& flowThread = flowThreadPair.key;
-        if (list.contains(flowThread))
-            continue;
-        flowThread->pushDependencies(list);
-        list.add(flowThread);
-    }
-}
-
-// The content nodes list contains those nodes with -webkit-flow-into: flow.
-// An element with display:none should also be listed among those nodes.
-// The list of nodes is ordered.
-void RenderNamedFlowThread::registerNamedFlowContentElement(Element&)
-{
-}
-
-void RenderNamedFlowThread::unregisterNamedFlowContentElement(Element&)
-{
-}
-
-bool RenderNamedFlowThread::hasContentElement(Element&) const
-{
-    return false;
-}
-    
-const AtomicString& RenderNamedFlowThread::flowThreadName() const
-{
-    return nullAtom();
-}
-
-bool RenderNamedFlowThread::isChildAllowed(const RenderObject& child, const RenderStyle& style) const
-{
-    if (!child.node())
-        return true;
-
-    ASSERT(is<Element>(*child.node()));
-
-    auto* originalParent = composedTreeAncestors(*child.node()).first();
-    if (!originalParent || !originalParent->renderer())
-        return true;
-
-    return originalParent->renderer()->isChildAllowed(child, style);
-}
-
-void RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded()
-{
-}
-
-void RenderNamedFlowThread::regionOversetChangeEventTimerFired()
-{
-}
-
-void RenderNamedFlowThread::setMarkForDestruction()
-{
-}
-
-void RenderNamedFlowThread::resetMarkForDestruction()
-{
-}
-
-bool RenderNamedFlowThread::isMarkedForDestruction() const
-{
-    return false;
-}
-
-static bool isContainedInElements(const Vector<Element*>& others, Element* element)
-{
-    for (auto& other : others) {
-        if (other->contains(element))
-            return true;
-    }
-    return false;
-}
-
-static bool boxIntersectsRegion(LayoutUnit logicalTopForBox, LayoutUnit logicalBottomForBox, LayoutUnit logicalTopForRegion, LayoutUnit logicalBottomForRegion)
-{
-    bool regionIsEmpty = logicalBottomForRegion != LayoutUnit::max() && logicalTopForRegion != LayoutUnit::min()
-        && (logicalBottomForRegion - logicalTopForRegion) <= 0;
-    return  (logicalBottomForBox - logicalTopForBox) > 0
-        && !regionIsEmpty
-        && logicalTopForBox < logicalBottomForRegion && logicalTopForRegion < logicalBottomForBox;
-}
-
-// Retrieve the next node to be visited while computing the ranges inside a region.
-static Node* nextNodeInsideContentElement(const Node& currNode, const Element* contentElement)
-{
-    if (currNode.renderer() && currNode.renderer()->isSVGRoot())
-        return NodeTraversal::nextSkippingChildren(currNode, contentElement);
-
-    return NodeTraversal::next(currNode, contentElement);
-}
-
-void RenderNamedFlowThread::getRanges(Vector<RefPtr<Range>>& rangeObjects, const RenderNamedFlowFragment* namedFlowFragment) const
-{
-    LayoutUnit logicalTopForRegion;
-    LayoutUnit logicalBottomForRegion;
-
-    // extend the first region top to contain everything up to its logical height
-    if (namedFlowFragment->isFirstRegion())
-        logicalTopForRegion = LayoutUnit::min();
-    else
-        logicalTopForRegion =  namedFlowFragment->logicalTopForFlowThreadContent();
-
-    // extend the last region to contain everything above its y()
-    if (namedFlowFragment->isLastRegion())
-        logicalBottomForRegion = LayoutUnit::max();
-    else
-        logicalBottomForRegion = namedFlowFragment->logicalBottomForFlowThreadContent();
-
-    Vector<Element*> elements;
-    // eliminate the contentElements that are descendants of other contentElements
-    for (auto& element : contentElements()) {
-        if (!isContainedInElements(elements, element))
-            elements.append(element);
-    }
-
-    for (auto& contentElement : elements) {
-        if (!contentElement->renderer())
-            continue;
-
-        RefPtr<Range> range = Range::create(contentElement->document());
-        bool foundStartPosition = false;
-        bool startsAboveRegion = true;
-        bool endsBelowRegion = true;
-        bool skipOverOutsideNodes = false;
-        Node* lastEndNode = nullptr;
-
-        for (Node* node = contentElement; node; node = nextNodeInsideContentElement(*node, contentElement)) {
-            RenderObject* renderer = node->renderer();
-            if (!renderer)
-                continue;
-
-            LayoutRect boundingBox;
-            if (is<RenderInline>(*renderer))
-                boundingBox = downcast<RenderInline>(*renderer).linesBoundingBox();
-            else if (is<RenderText>(*renderer))
-                boundingBox = downcast<RenderText>(*renderer).linesBoundingBox();
-            else if (is<RenderLineBreak>(*renderer))
-                boundingBox = downcast<RenderLineBreak>(*renderer).linesBoundingBox();
-            else if (is<RenderBox>(*renderer)) {
-                auto& renderBox = downcast<RenderBox>(*renderer);
-                boundingBox = renderBox.frameRect();
-                if (renderBox.isRelPositioned())
-                    boundingBox.move(renderBox.relativePositionLogicalOffset());
-            } else
-                continue;
-
-            LayoutUnit offsetTop = renderer->containingBlock()->offsetFromLogicalTopOfFirstPage();
-            const LayoutPoint logicalOffsetFromTop(isHorizontalWritingMode() ? LayoutUnit() :  offsetTop,
-                isHorizontalWritingMode() ? offsetTop : LayoutUnit());
-
-            boundingBox.moveBy(logicalOffsetFromTop);
-
-            LayoutUnit logicalTopForRenderer = namedFlowFragment->logicalTopOfFlowThreadContentRect(boundingBox);
-            LayoutUnit logicalBottomForRenderer = namedFlowFragment->logicalBottomOfFlowThreadContentRect(boundingBox);
-
-            // if the bounding box of the current element doesn't intersect the region box
-            // close the current range only if the start element began inside the region,
-            // otherwise just move the start position after this node and keep skipping them until we found a proper start position.
-            if (!boxIntersectsRegion(logicalTopForRenderer, logicalBottomForRenderer, logicalTopForRegion, logicalBottomForRegion)) {
-                if (foundStartPosition) {
-                    if (!startsAboveRegion) {
-                        auto intersectsResult = range->intersectsNode(*node);
-                        if (!intersectsResult.hasException() && intersectsResult.releaseReturnValue())
-                            range->setEndBefore(*node);
-                        rangeObjects.append(range->cloneRange());
-                        range = Range::create(contentElement->document());
-                        startsAboveRegion = true;
-                    } else
-                        skipOverOutsideNodes = true;
-                }
-                if (skipOverOutsideNodes)
-                    range->setStartAfter(*node);
-                foundStartPosition = false;
-                continue;
-            }
-
-            // start position
-            if (logicalTopForRenderer < logicalTopForRegion && startsAboveRegion) {
-                if (is<RenderText>(*renderer)) {
-                    // Text crosses region top
-                    // for Text elements, just find the last textbox that is contained inside the region and use its start() offset as start position
-                    RenderText& textRenderer = downcast<RenderText>(*renderer);
-                    for (InlineTextBox* box = textRenderer.firstTextBox(); box; box = box->nextTextBox()) {
-                        if (offsetTop + box->logicalBottom() < logicalTopForRegion)
-                            continue;
-                        range->setStart(Position(downcast<Text>(node), box->start()));
-                        startsAboveRegion = false;
-                        break;
-                    }
-                } else {
-                    // node crosses region top
-                    // for all elements, except Text, just set the start position to be before their children
-                    startsAboveRegion = true;
-                    range->setStart(Position(node, Position::PositionIsBeforeChildren));
-                }
-            } else {
-                // node starts inside region
-                // for elements that start inside the region, set the start position to be before them. If we found one, we will just skip the others until
-                // the range is closed.
-                if (startsAboveRegion) {
-                    startsAboveRegion = false;
-                    range->setStartBefore(*node);
-                }
-            }
-            skipOverOutsideNodes  = false;
-            foundStartPosition = true;
-
-            // end position
-            if (logicalBottomForRegion < logicalBottomForRenderer && (endsBelowRegion || (!endsBelowRegion && !node->isDescendantOf(lastEndNode)))) {
-                // for Text elements, just find just find the last textbox that is contained inside the region and use its start()+len() offset as end position
-                if (is<RenderText>(*renderer)) {
-                    // Text crosses region bottom
-                    RenderText& textRenderer = downcast<RenderText>(*renderer);
-                    InlineTextBox* lastBox = nullptr;
-                    for (InlineTextBox* box = textRenderer.firstTextBox(); box; box = box->nextTextBox()) {
-                        if ((offsetTop + box->logicalTop()) < logicalBottomForRegion) {
-                            lastBox = box;
-                            continue;
-                        }
-                        ASSERT(lastBox);
-                        if (lastBox)
-                            range->setEnd(Position(downcast<Text>(node), lastBox->start() + lastBox->len()));
-                        break;
-                    }
-                    endsBelowRegion = false;
-                    lastEndNode = node;
-                } else {
-                    // node crosses region bottom
-                    // for all elements, except Text, just set the start position to be after their children
-                    range->setEnd(Position(node, Position::PositionIsAfterChildren));
-                    endsBelowRegion = true;
-                    lastEndNode = node;
-                }
-            } else {
-                // node ends inside region
-                // for elements that ends inside the region, set the end position to be after them
-                // allow this end position to be changed only by other elements that are not descendants of the current end node
-                if (endsBelowRegion || (!endsBelowRegion && !node->isDescendantOf(lastEndNode))) {
-                    range->setEndAfter(*node);
-                    endsBelowRegion = false;
-                    lastEndNode = node;
-                }
-            }
-        }
-        if (foundStartPosition || skipOverOutsideNodes)
-            rangeObjects.append(range);
-    }
-}
-
-void RenderNamedFlowThread::applyBreakAfterContent(LayoutUnit clientHeight)
-{
-    // Simulate a region break at height. If it points inside an auto logical height region,
-    // then it may determine the region computed autoheight.
-    addForcedRegionBreak(this, clientHeight, this, false);
-}
-
-bool RenderNamedFlowThread::collectsGraphicsLayersUnderRegions() const
-{
-    // We only need to map layers to regions for named flow threads.
-    // Multi-column threads are displayed on top of the regions and do not require
-    // distributing the layers.
-
-    return true;
-}
-
-// Check if the content is flown into at least a region with region styling rules.
-void RenderNamedFlowThread::checkRegionsWithStyling()
-{
-    bool hasRegionsWithStyling = false;
-    for (const auto& region : m_regionList) {
-        if (downcast<RenderNamedFlowFragment>(*region).hasCustomRegionStyle()) {
-            hasRegionsWithStyling = true;
-            break;
-        }
-    }
-    m_hasRegionsWithStyling = hasRegionsWithStyling;
-}
-
-void RenderNamedFlowThread::clearRenderObjectCustomStyle(const RenderElement& object)
-{
-    // Clear the styles for the object in the regions.
-    // FIXME: Region styling is not computed only for the region range of the object so this is why we need to walk the whole chain.
-    for (auto& region : m_regionList)
-        downcast<RenderNamedFlowFragment>(*region).clearObjectStyleInRegion(object);
-}
-
-void RenderNamedFlowThread::removeFlowChildInfo(RenderElement& child)
-{
-    RenderFlowThread::removeFlowChildInfo(child);
-    clearRenderObjectCustomStyle(child);
-}
-
-bool RenderNamedFlowThread::absoluteQuadsForBox(Vector<FloatQuad>& quads, bool* wasFixed, const RenderBox* renderer, float localTop, float localBottom) const
-{
-    RenderRegion* startRegion = nullptr;
-    RenderRegion* endRegion = nullptr;
-    // If the box doesn't have a range, we don't know how it is fragmented so fallback to the default behaviour.
-    if (!computedRegionRangeForBox(renderer, startRegion, endRegion))
-        return false;
-
-    for (auto iter = m_regionList.find(startRegion), end = m_regionList.end(); iter != end; ++iter) {
-        RenderRegion* region = *iter;
-
-        region->absoluteQuadsForBoxInRegion(quads, wasFixed, renderer, localTop, localBottom);
-
-        if (region == endRegion)
-            break;
-    }
-
-    return true;
-}
-
-}
diff --git a/Source/WebCore/rendering/RenderNamedFlowThread.h b/Source/WebCore/rendering/RenderNamedFlowThread.h
deleted file mode 100644 (file)
index 322f070..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "RenderFlowThread.h"
-#include "SelectionSubtreeRoot.h"
-#include "Timer.h"
-#include <wtf/HashCountedSet.h>
-#include <wtf/ListHashSet.h>
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-class Node;
-class RenderNamedFlowThread;
-
-typedef ListHashSet<RenderNamedFlowThread*> RenderNamedFlowThreadList;
-typedef HashCountedSet<RenderNamedFlowThread*> RenderNamedFlowThreadCountedSet;
-typedef ListHashSet<Element*> NamedFlowContentElements;
-
-class RenderNamedFlowThread final : public RenderFlowThread, public SelectionSubtreeRoot {
-public:
-    RenderNamedFlowThread(Document&, RenderStyle&&);
-    virtual ~RenderNamedFlowThread();
-
-    const AtomicString& flowThreadName() const;
-
-    const RenderRegionList& invalidRenderRegionList() const { return m_invalidRegionList; }
-
-    static RenderBlock* fragmentFromRenderBoxAsRenderBlock(RenderBox*, const IntPoint& absolutePoint, const RenderBox& flowedBox);
-
-    void pushDependencies(RenderNamedFlowThreadList&);
-
-    void addRegionToThread(RenderRegion*) override;
-    void removeRegionFromThread(RenderRegion*) override;
-
-    void regionChangedWritingMode(RenderRegion*) override;
-
-    LayoutRect decorationsClipRectForBoxInNamedFlowFragment(const RenderBox&, RenderNamedFlowFragment&) const;
-
-    RenderNamedFlowFragment* fragmentFromAbsolutePointAndBox(const IntPoint&, const RenderBox& flowedBox);
-
-    void registerNamedFlowContentElement(Element&);
-    void unregisterNamedFlowContentElement(Element&);
-    const NamedFlowContentElements& contentElements() const { return m_contentElements; }
-    bool hasContentElement(Element&) const;
-
-    bool isMarkedForDestruction() const;
-    void getRanges(Vector<RefPtr<Range>>&, const RenderNamedFlowFragment*) const;
-
-    void applyBreakAfterContent(LayoutUnit) override;
-
-    bool collectsGraphicsLayersUnderRegions() const override;
-
-    // Check if the content is flown into at least a region with region styling rules.
-    bool hasRegionsWithStyling() const { return m_hasRegionsWithStyling; }
-    void checkRegionsWithStyling();
-
-    void clearRenderObjectCustomStyle(const RenderElement&);
-
-    void removeFlowChildInfo(RenderElement&) override;
-
-    LayoutUnit flowContentBottom() const { return m_flowContentBottom; }
-    void dispatchNamedFlowEvents();
-
-    void setDispatchRegionOversetChangeEvent(bool value) { m_dispatchRegionOversetChangeEvent = value; }
-
-    bool absoluteQuadsForBox(Vector<FloatQuad>&, bool*, const RenderBox*, float, float) const override;
-
-protected:
-    void setMarkForDestruction();
-    void resetMarkForDestruction();
-
-private:
-    void willBeDestroyed() override;
-    const char* renderName() const override;
-    bool isRenderNamedFlowThread() const override { return true; }
-    bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
-    void computeOverflow(LayoutUnit, bool = false) override;
-    void layout() override;
-
-    void dispatchRegionOversetChangeEventIfNeeded();
-
-    bool dependsOn(RenderNamedFlowThread* otherRenderFlowThread) const;
-    void addDependencyOnFlowThread(RenderNamedFlowThread*);
-    void removeDependencyOnFlowThread(RenderNamedFlowThread*);
-
-    void addFragmentToNamedFlowThread(RenderNamedFlowFragment*);
-
-    void checkInvalidRegions();
-
-    bool canBeDestroyed() const { return m_invalidRegionList.isEmpty() && m_regionList.isEmpty() && m_contentElements.isEmpty(); }
-    void regionOversetChangeEventTimerFired();
-    void clearContentElements();
-    void updateWritingMode();
-
-    // Observer flow threads have invalid regions that depend on the state of this thread
-    // to re-validate their regions. Keeping a set of observer threads make it easy
-    // to notify them when a region was removed from this flow.
-    RenderNamedFlowThreadCountedSet m_observerThreadsSet;
-
-    // Some threads need to have a complete layout before we layout this flow.
-    // That's because they contain a RenderRegion that should display this thread. The set makes it
-    // easy to sort the order of threads layout.
-    RenderNamedFlowThreadCountedSet m_layoutBeforeThreadsSet;
-
-    NamedFlowContentElements m_contentElements;
-
-    RenderRegionList m_invalidRegionList;
-
-    bool m_hasRegionsWithStyling : 1;
-    bool m_dispatchRegionOversetChangeEvent : 1;
-
-    Timer m_regionOversetChangeEventTimer;
-
-    LayoutUnit m_flowContentBottom;
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderNamedFlowThread, isRenderNamedFlowThread())
index b311ecc..f568ff1 100644 (file)
@@ -31,7 +31,6 @@
 #include "CSSAnimationController.h"
 #include "Editing.h"
 #include "FloatQuad.h"
-#include "FlowThreadController.h"
 #include "FrameSelection.h"
 #include "FrameView.h"
 #include "GeometryUtilities.h"
@@ -55,7 +54,6 @@
 #include "RenderLayerBacking.h"
 #include "RenderMultiColumnFlowThread.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderRuby.h"
 #include "RenderSVGBlock.h"
 #include "RenderSVGInline.h"
@@ -1236,8 +1234,6 @@ SelectionSubtreeRoot& RenderObject::selectionRoot() const
     if (!flowThread)
         return view();
 
-    if (is<RenderNamedFlowThread>(*flowThread))
-        return downcast<RenderNamedFlowThread>(*flowThread);
     if (is<RenderMultiColumnFlowThread>(*flowThread)) {
         if (!flowThread->containingBlock())
             return view();
@@ -1767,7 +1763,7 @@ RenderBoxModelObject* RenderObject::offsetParent() const
     bool skipTables = isPositioned();
     float currZoom = style().effectiveZoom();
     auto current = parent();
-    while (current && (!current->element() || (!current->isPositioned() && !current->isBody())) && !is<RenderNamedFlowThread>(*current)) {
+    while (current && (!current->element() || (!current->isPositioned() && !current->isBody()))) {
         Element* element = current->element();
         if (!skipTables && element && (is<HTMLTableElement>(*element) || is<HTMLTableCellElement>(*element)))
             break;
@@ -1778,13 +1774,7 @@ RenderBoxModelObject* RenderObject::offsetParent() const
         currZoom = newZoom;
         current = current->parent();
     }
-    
-    // CSS regions specification says that region flows should return the body element as their offsetParent.
-    if (is<RenderNamedFlowThread>(current)) {
-        auto* body = document().bodyOrFrameset();
-        current = body ? body->renderer() : nullptr;
-    }
-    
+
     return is<RenderBoxModelObject>(current) ? downcast<RenderBoxModelObject>(current) : nullptr;
 }
 
@@ -1925,16 +1915,7 @@ bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const
 
 RenderNamedFlowFragment* RenderObject::currentRenderNamedFlowFragment() const
 {
-    RenderFlowThread* flowThread = flowThreadContainingBlock();
-    if (!is<RenderNamedFlowThread>(flowThread))
-        return nullptr;
-
-    // FIXME: Once regions are fully integrated with the compositing system we should uncomment this assert.
-    // This assert needs to be disabled because it's possible to ask for the ancestor clipping rectangle of
-    // a layer without knowing the containing region in advance.
-    // ASSERT(flowThread->currentRegion() && flowThread->currentRegion()->isRenderNamedFlowFragment());
-
-    return downcast<RenderNamedFlowFragment>(flowThread->currentRegion());
+    return nullptr;
 }
 
 RenderFlowThread* RenderObject::locateFlowThreadContainingBlock() const
index 5e7e1e6..418903e 100644 (file)
@@ -60,7 +60,6 @@ class RenderGeometryMap;
 class RenderLayer;
 class RenderLayerModelObject;
 class RenderNamedFlowFragment;
-class RenderNamedFlowThread;
 class RenderRegion;
 class RenderTheme;
 class SelectionSubtreeRoot;
@@ -278,7 +277,6 @@ public:
     virtual bool isRenderFullScreenPlaceholder() const { return false; }
 #endif
     virtual bool isRenderGrid() const { return false; }
-    virtual bool isRenderNamedFlowThread() const { return false; }
     bool isInFlowRenderFlowThread() const { return isRenderFlowThread() && !isOutOfFlowPositioned(); }
     bool isOutOfFlowRenderFlowThread() const { return isRenderFlowThread() && isOutOfFlowPositioned(); }
 
index ddc6200..7c84caa 100644 (file)
 #include "config.h"
 #include "RenderRegion.h"
 
-#include "FlowThreadController.h"
 #include "GraphicsContext.h"
 #include "HitTestResult.h"
 #include "IntRect.h"
 #include "LayoutRepainter.h"
 #include "Range.h"
 #include "RenderBoxRegionInfo.h"
+#include "RenderFlowThread.h"
 #include "RenderInline.h"
 #include "RenderIterator.h"
 #include "RenderLayer.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderView.h"
 #include "StyleResolver.h"
 
@@ -50,7 +49,6 @@ namespace WebCore {
 RenderRegion::RenderRegion(Element& element, RenderStyle&& style, RenderFlowThread* flowThread)
     : RenderBlockFlow(element, WTFMove(style))
     , m_flowThread(flowThread)
-    , m_parentNamedFlowThread(nullptr)
     , m_isValid(false)
 {
 }
@@ -58,7 +56,6 @@ RenderRegion::RenderRegion(Element& element, RenderStyle&& style, RenderFlowThre
 RenderRegion::RenderRegion(Document& document, RenderStyle&& style, RenderFlowThread* flowThread)
     : RenderBlockFlow(document, WTFMove(style))
     , m_flowThread(flowThread)
-    , m_parentNamedFlowThread(nullptr)
     , m_isValid(false)
 {
 }
@@ -278,7 +275,7 @@ void RenderRegion::attachRegion()
     // and we are attaching the region to the flow thread.
     installFlowThread();
     
-    if (m_flowThread == m_parentNamedFlowThread)
+    if (!m_flowThread)
         return;
 
     // Only after adding the region to the thread, the region is marked to be valid.
index a07204f..3936da1 100644 (file)
@@ -40,7 +40,6 @@ class Element;
 class RenderBox;
 class RenderBoxRegionInfo;
 class RenderFlowThread;
-class RenderNamedFlowThread;
 
 class RenderRegion : public RenderBlockFlow {
 public:
@@ -55,7 +54,6 @@ public:
     virtual void attachRegion();
     virtual void detachRegion();
 
-    RenderNamedFlowThread* parentNamedFlowThread() const { return m_parentNamedFlowThread; }
     RenderFlowThread* flowThread() const { return m_flowThread; }
 
     // Valid regions do not create circular dependencies with other flows.
@@ -158,10 +156,6 @@ protected:
     RenderFlowThread* m_flowThread;
 
 private:
-    // If this RenderRegion is displayed as part of another named flow,
-    // we need to create a dependency tree, so that layout of the
-    // regions is always done before the regions themselves.
-    RenderNamedFlowThread* m_parentNamedFlowThread;
     LayoutRect m_flowThreadPortionRect;
 
     // This map holds unique information about a block that is split across regions.
index 0712d6f..060e1ef 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "ClipRect.h"
 #include "Document.h"
-#include "FlowThreadController.h"
 #include "Frame.h"
 #include "FrameSelection.h"
 #include "FrameView.h"
@@ -51,7 +50,6 @@
 #include "RenderListItem.h"
 #include "RenderListMarker.h"
 #include "RenderNamedFlowFragment.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
 #include "RenderSVGContainer.h"
 #include "RenderSVGGradientStop.h"
@@ -680,79 +678,6 @@ static void writeLayerRenderers(TextStream& ts, const RenderLayer& layer, LayerP
         write(ts, layer.renderer(), indent + 1, behavior);
 }
 
-static void writeRenderRegionList(const RenderRegionList& flowThreadRegionList, TextStream& ts, int indent)
-{
-    for (const auto& renderRegion : flowThreadRegionList) {
-        writeIndent(ts, indent);
-        ts << static_cast<const RenderObject*>(renderRegion)->renderName();
-
-        Element* generatingElement = renderRegion->generatingElement();
-        if (generatingElement) {
-            bool isRenderNamedFlowFragment = is<RenderNamedFlowFragment>(*renderRegion);
-            if (isRenderNamedFlowFragment && downcast<RenderNamedFlowFragment>(*renderRegion).hasCustomRegionStyle())
-                ts << " region style: 1";
-            if (renderRegion->hasAutoLogicalHeight())
-                ts << " hasAutoLogicalHeight";
-
-            if (isRenderNamedFlowFragment)
-                ts << " (anonymous child of";
-
-            StringBuilder tagName;
-            tagName.append(generatingElement->nodeName());
-
-            RenderElement* renderElementForRegion = isRenderNamedFlowFragment ? renderRegion->parent() : renderRegion;
-            if (renderElementForRegion->isPseudoElement()) {
-                if (renderElementForRegion->element()->isBeforePseudoElement())
-                    tagName.appendLiteral("::before");
-                else if (renderElementForRegion->element()->isAfterPseudoElement())
-                    tagName.appendLiteral("::after");
-            }
-
-            ts << " {" << tagName.toString() << "}";
-
-            auto& generatingElementId = generatingElement->idForStyleResolution();
-            if (!generatingElementId.isNull())
-                ts << " #" << generatingElementId;
-
-            if (isRenderNamedFlowFragment)
-                ts << ")";
-        }
-
-        ts << "\n";
-    }
-}
-
-static void writeRenderNamedFlowThreads(TextStream& ts, RenderView& renderView, const RenderLayer& rootLayer, const LayoutRect& paintRect, int indent, RenderAsTextBehavior behavior)
-{
-    if (!renderView.hasRenderNamedFlowThreads())
-        return;
-
-    writeIndent(ts, indent);
-    ts << "Named flows\n";
-
-    for (const auto* renderFlowThread : *renderView.flowThreadController().renderNamedFlowThreadList()) {
-        writeIndent(ts, indent + 1);
-        ts << "Named flow '" << renderFlowThread->flowThreadName() << "'\n";
-
-        RenderLayer* layer = renderFlowThread->layer();
-        writeLayers(ts, rootLayer, *layer, paintRect, indent + 2, behavior);
-
-        // Display the valid and invalid render regions attached to this flow thread.
-        const RenderRegionList& validRegionsList = renderFlowThread->renderRegionList();
-        const RenderRegionList& invalidRegionsList = renderFlowThread->invalidRenderRegionList();
-        if (!validRegionsList.isEmpty()) {
-            writeIndent(ts, indent + 2);
-            ts << "Regions for named flow '" << renderFlowThread->flowThreadName() << "'\n";
-            writeRenderRegionList(validRegionsList, ts, indent + 3);
-        }
-        if (!invalidRegionsList.isEmpty()) {
-            writeIndent(ts, indent + 2);
-            ts << "Invalid regions for named flow '" << renderFlowThread->flowThreadName() << "'\n";
-            writeRenderRegionList(invalidRegionsList, ts, indent + 3);
-        }
-    }
-}
-
 static LayoutSize maxLayoutOverflow(const RenderBox* box)
 {
     LayoutRect overflowRect = box->layoutOverflowRect();
@@ -839,7 +764,6 @@ static void writeLayers(TextStream& ts, const RenderLayer& rootLayer, RenderLaye
         
         if (layerCount) {
             int currIndent = indent;
-            // We only print the header if there's at list a non-RenderNamedFlowThread part of the list.
             if (!positiveZOrderList->size() || !positiveZOrderList->at(0)->isFlowThreadCollectingGraphicsLayersUnderRegions()) {
                 if (behavior & RenderAsTextShowLayerNesting) {
                     writeIndent(ts, indent);
@@ -855,11 +779,6 @@ static void writeLayers(TextStream& ts, const RenderLayer& rootLayer, RenderLaye
             }
         }
     }
-    
-    // Altough the RenderFlowThread requires a layer, it is not collected by its parent,
-    // so we have to treat it as a special case.
-    if (is<RenderView>(layer.renderer()))
-        writeRenderNamedFlowThreads(ts, downcast<RenderView>(layer.renderer()), rootLayer, paintDirtyRect, indent, behavior);
 }
 
 static String nodePosition(Node* node)
index b22ac50..f98bfb6 100644 (file)
@@ -25,7 +25,6 @@
 #include "Element.h"
 #include "FloatQuad.h"
 #include "FloatingObjects.h"
-#include "FlowThreadController.h"
 #include "Frame.h"
 #include "FrameSelection.h"
 #include "FrameView.h"
@@ -47,7 +46,6 @@
 #include "RenderMultiColumnFlowThread.h"
 #include "RenderMultiColumnSet.h"
 #include "RenderMultiColumnSpannerPlaceholder.h"
-#include "RenderNamedFlowThread.h"
 #include "RenderQuote.h"
 #include "RenderSelectionInfo.h"
 #include "RenderWidget.h"
@@ -248,8 +246,6 @@ void RenderView::layoutContent(const LayoutState& state)
     ASSERT(needsLayout());
 
     RenderBlockFlow::layout();
-    if (hasRenderNamedFlowThreads())
-        flowThreadController().layoutRenderNamedFlowThreads();
 #ifndef NDEBUG
     checkLayoutState(state);
 #endif
@@ -275,65 +271,8 @@ void RenderView::initializeLayoutState(LayoutState& state)
     state.m_isPaginated = state.m_pageLogicalHeight > 0;
 }
 
-// The algorithm below assumes this is a full layout. In case there are previously computed values for regions, supplemental steps are taken
-// to ensure the results are the same as those obtained from a full layout (i.e. the auto-height regions from all the flows are marked as needing
-// layout).
-// 1. The flows are laid out from the outer flow to the inner flow. This successfully computes the outer non-auto-height regions size so the 
-// inner flows have the necessary information to correctly fragment the content.
-// 2. The flows are laid out from the inner flow to the outer flow. After an inner flow is laid out it goes into the constrained layout phase
-// and marks the auto-height regions they need layout. This means the outer flows will relayout if they depend on regions with auto-height regions
-// belonging to inner flows. This step will correctly set the computedAutoHeight for the auto-height regions. It's possible for non-auto-height
-// regions to relayout if they depend on auto-height regions. This will invalidate the inner flow threads and mark them as needing layout.
-// 3. The last step is to do one last layout if there are pathological dependencies between non-auto-height regions and auto-height regions
-// as detected in the previous step.
-void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState& state)
-{
-    // We need to invalidate all the flows with auto-height regions if one such flow needs layout.
-    // If none is found we do a layout a check back again afterwards.
-    if (!flowThreadController().updateFlowThreadsNeedingLayout()) {
-        // Do a first layout of the content. In some cases more layouts are not needed (e.g. only flows with non-auto-height regions have changed).
-        layoutContent(state);
-
-        // If we find no named flow needing a two step layout after the first layout, exit early.
-        // Otherwise, initiate the two step layout algorithm and recompute all the flows.
-        if (!flowThreadController().updateFlowThreadsNeedingTwoStepLayout())
-            return;
-    }
-
-    // Layout to recompute all the named flows with auto-height regions.
-    layoutContent(state);
-
-    // Propagate the computed auto-height values upwards.
-    // Non-auto-height regions may invalidate the flow thread because they depended on auto-height regions, but that's ok.
-    flowThreadController().updateFlowThreadsIntoConstrainedPhase();
-
-    // Do one last layout that should update the auto-height regions found in the main flow
-    // and solve pathological dependencies between regions (e.g. a non-auto-height region depending
-    // on an auto-height one).
-    if (needsLayout())
-        layoutContent(state);
-}
-
-void RenderView::layoutContentToComputeOverflowInRegions(const LayoutState& state)
+void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState&)
 {
-    if (!hasRenderNamedFlowThreads())
-        return;
-
-    // First pass through the flow threads and mark the regions as needing a simple layout.
-    // The regions extract the overflow from the flow thread and pass it to their containg
-    // block chain.
-    flowThreadController().updateFlowThreadsIntoOverflowPhase();
-    if (needsLayout())
-        layoutContent(state);
-
-    // In case scrollbars resized the regions a new pass is necessary to update the flow threads
-    // and recompute the overflow on regions. This is the final state of the flow threads.
-    flowThreadController().updateFlowThreadsIntoFinalPhase();
-    if (needsLayout())
-        layoutContent(state);
-
-    // Finally reset the layout state of the flow threads.
-    flowThreadController().updateFlowThreadsIntoMeasureContentPhase();
 }
 
 void RenderView::layout()
@@ -379,8 +318,6 @@ void RenderView::layout()
     else
         layoutContent(*m_layoutState);
 
-    layoutContentToComputeOverflowInRegions(*m_layoutState);
-
 #ifndef NDEBUG
     checkLayoutState(*m_layoutState);
 #endif
@@ -780,14 +717,6 @@ static RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset
 IntRect RenderView::selectionBounds(bool clipToVisibleContent) const
 {
     LayoutRect selRect = subtreeSelectionBounds(*this, clipToVisibleContent);
-
-    if (hasRenderNamedFlowThreads()) {
-        for (auto* namedFlowThread : *m_flowThreadController->renderNamedFlowThreadList()) {
-            LayoutRect currRect = subtreeSelectionBounds(*namedFlowThread, clipToVisibleContent);
-            selRect.unite(currRect);
-        }
-    }
-
     return snappedIntRect(selRect);
 }
 
@@ -838,11 +767,6 @@ LayoutRect RenderView::subtreeSelectionBounds(const SelectionSubtreeRoot& root,
 void RenderView::repaintSelection() const
 {
     repaintSubtreeSelection(*this);
-
-    if (hasRenderNamedFlowThreads()) {
-        for (auto* namedFlowThread : *m_flowThreadController->renderNamedFlowThreadList())
-            repaintSubtreeSelection(*namedFlowThread);
-    }
 }
 
 void RenderView::repaintSubtreeSelection(const SelectionSubtreeRoot& root) const
@@ -897,58 +821,9 @@ void RenderView::setSelection(RenderObject* start, std::optional<unsigned> start
     m_selectionUnsplitEnd = end;
     m_selectionUnsplitEndPos = endPos;
 
-    // If there is no RenderNamedFlowThreads we follow the regular selection.
-    if (!hasRenderNamedFlowThreads()) {
-        RenderSubtreesMap singleSubtreeMap;
-        singleSubtreeMap.set(this, SelectionSubtreeData(start, startPos, end, endPos));
-        updateSelectionForSubtrees(singleSubtreeMap, blockRepaintMode);
-        return;
-    }
-
-    splitSelectionBetweenSubtrees(start, startPos, end, endPos, blockRepaintMode);
-}
-
-void RenderView::splitSelectionBetweenSubtrees(const RenderObject* start, std::optional<unsigned> startPos, const RenderObject* end, std::optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode)
-{
-    // Compute the visible selection end points for each of the subtrees.
-    RenderSubtreesMap renderSubtreesMap;
-
-    SelectionSubtreeData initialSelection;
-    renderSubtreesMap.set(this, initialSelection);
-    for (auto* namedFlowThread : *flowThreadController().renderNamedFlowThreadList())
-        renderSubtreesMap.set(namedFlowThread, initialSelection);
-
-    if (start && end) {
-        Node* startNode = start->node();
-        Node* endNode = end->node();
-        ASSERT(endNode);
-        Node* stopNode = NodeTraversal::nextSkippingChildren(*endNode);
-
-        for (Node* node = startNode; node != stopNode; node = NodeTraversal::next(*node)) {
-            RenderObject* renderer = node->renderer();
-            if (!renderer)
-                continue;
-
-            SelectionSubtreeRoot& root = renderer->selectionRoot();
-            SelectionSubtreeData selectionData = renderSubtreesMap.get(&root);
-            if (selectionData.selectionClear()) {
-                selectionData.setSelectionStart(node->renderer());
-                selectionData.setSelectionStartPos(node == startNode ? startPos : std::optional<unsigned>(0));
-            }
-
-            selectionData.setSelectionEnd(node->renderer());
-            if (node == endNode)
-                selectionData.setSelectionEndPos(endPos);
-            else {
-                unsigned newEndPos = node->offsetInCharacters() ? node->maxCharacterOffset() : node->countChildNodes();
-                selectionData.setSelectionEndPos(newEndPos);
-            }
-
-            renderSubtreesMap.set(&root, selectionData);
-        }
-    }
-    
-    updateSelectionForSubtrees(renderSubtreesMap, blockRepaintMode);
+    RenderSubtreesMap singleSubtreeMap;
+    singleSubtreeMap.set(this, SelectionSubtreeData(start, startPos, end, endPos));
+    updateSelectionForSubtrees(singleSubtreeMap, blockRepaintMode);
 }
 
 void RenderView::updateSelectionForSubtrees(RenderSubtreesMap& renderSubtreesMap, SelectionRepaintMode blockRepaintMode)
@@ -962,8 +837,6 @@ void RenderView::updateSelectionForSubtrees(RenderSubtreesMap& renderSubtreesMap
         oldSelectionDataMap.set(&root, WTFMove(oldSelectionData));
 
         root.setSelectionData(subtreeSelectionInfo.value);
-        if (hasRenderNamedFlowThreads())
-            root.adjustForVisibleSelection(document());
     }
 
     // Update selection status for the objects inside the selection subtrees.
@@ -1331,54 +1204,21 @@ void RenderView::setIsInWindow(bool isInWindow)
 void RenderView::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBlockFlow::styleDidChange(diff, oldStyle);
-    if (hasRenderNamedFlowThreads())
-        flowThreadController().styleDidChange();
 
     frameView().styleDidChange();
 }
 
-bool RenderView::hasRenderNamedFlowThreads() const
-{
-    return m_flowThreadController && m_flowThreadController->hasRenderNamedFlowThreads();
-}
-
 bool RenderView::checkTwoPassLayoutForAutoHeightRegions() const
 {
-    return hasRenderNamedFlowThreads() && m_flowThreadController->hasFlowThreadsWithAutoLogicalHeightRegions();
-}
-
-FlowThreadController& RenderView::flowThreadController()
-{
-    if (!m_flowThreadController)
-        m_flowThreadController = std::make_unique<FlowThreadController>(this);
-
-    return *m_flowThreadController;
+    return false;
 }
 
-void RenderView::pushLayoutStateForCurrentFlowThread(const RenderObject& object)
+void RenderView::pushLayoutStateForCurrentFlowThread(const RenderObject&)
 {
-    if (!m_flowThreadController)
-        return;
-
-    RenderFlowThread* currentFlowThread = object.flowThreadContainingBlock();
-    if (!currentFlowThread)
-        return;
-
-    m_layoutState->setCurrentRenderFlowThread(currentFlowThread);
-
-    currentFlowThread->pushFlowThreadLayoutState(object);
 }
 
 void RenderView::popLayoutStateForCurrentFlowThread()
 {
-    if (!m_flowThreadController)
-        return;
-
-    RenderFlowThread* currentFlowThread = m_layoutState->currentRenderFlowThread();
-    if (!currentFlowThread)
-        return;
-
-    currentFlowThread->popFlowThreadLayoutState();
 }
 
 ImageQualityController& RenderView::imageQualityController()
index 83eaaf9..7f7548c 100644 (file)
@@ -37,7 +37,6 @@
 
 namespace WebCore {
 
-class FlowThreadController;
 class ImageQualityController;
 class RenderLayerCompositor;
 class RenderQuote;
@@ -188,9 +187,7 @@ public:
     // Renderer that paints the root background has background-images which all have background-attachment: fixed.
     bool rootBackgroundIsEntirelyFixed() const;
     
-    bool hasRenderNamedFlowThreads() const;
     bool checkTwoPassLayoutForAutoHeightRegions() const;
-    FlowThreadController& flowThreadController();
 
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
 
@@ -310,7 +307,6 @@ private:
 
     void layoutContent(const LayoutState&);
     void layoutContentInAutoLogicalHeightRegions(const LayoutState&);
-    void layoutContentToComputeOverflowInRegions(const LayoutState&);
 #ifndef NDEBUG
     void checkLayoutState(const LayoutState&);
 #endif
@@ -325,7 +321,6 @@ private:
 
     bool isScrollableOrRubberbandableBox() const override;
 
-    void splitSelectionBetweenSubtrees(const RenderObject* startRenderer, std::optional<unsigned> startPos, const RenderObject* endRenderer, std::optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode);
     void clearSubtreeSelection(const SelectionSubtreeRoot&, SelectionRepaintMode, OldSelectionData&) const;
     void updateSelectionForSubtrees(RenderSubtreesMap&, SelectionRepaintMode);
     void applySubtreeSelection(const SelectionSubtreeRoot&, SelectionRepaintMode, const OldSelectionData&);
@@ -370,7 +365,6 @@ private:
     std::unique_ptr<LayoutState> m_layoutState;
     unsigned m_layoutStateDisableCount { 0 };
     std::unique_ptr<RenderLayerCompositor> m_compositor;
-    std::unique_ptr<FlowThreadController> m_flowThreadController;
 
     bool m_hasQuotesNeedingUpdate { false };
 
index e247069..dad5dba 100644 (file)
@@ -35,7 +35,6 @@
 #include "FilterEffectRenderer.cpp"
 #include "FixedTableLayout.cpp"
 #include "FloatingObjects.cpp"
-#include "FlowThreadController.cpp"
 #include "HitTestLocation.cpp"
 #include "HitTestResult.cpp"
 #include "HitTestingTransformState.cpp"
@@ -97,7 +96,6 @@
 #include "RenderMultiColumnSet.cpp"
 #include "RenderMultiColumnSpannerPlaceholder.cpp"
 #include "RenderNamedFlowFragment.cpp"
-#include "RenderNamedFlowThread.cpp"
 #include "RenderObject.cpp"
 #include "RenderProgress.cpp"
 #include "RenderQuote.cpp"
index 181e6b5..4189564 100644 (file)
@@ -42,50 +42,4 @@ SelectionSubtreeRoot::SelectionSubtreeRoot()
 {
 }
 
-void SelectionSubtreeRoot::adjustForVisibleSelection(Document& document)
-{
-    if (m_selectionSubtreeData.selectionClear())
-        return;
-
-    // Create a range based on the cached end points
-    auto selectionStart = m_selectionSubtreeData.selectionStartPos().value();
-    auto selectionEnd = m_selectionSubtreeData.selectionEndPos().value();
-    Position startPosition = createLegacyEditingPosition(m_selectionSubtreeData.selectionStart()->node(), selectionStart);
-    Position endPosition = createLegacyEditingPosition(m_selectionSubtreeData.selectionEnd()->node(), selectionEnd);
-
-    RefPtr<Range> range = Range::create(document, startPosition.parentAnchoredEquivalent(), endPosition.parentAnchoredEquivalent());
-    VisibleSelection selection(*range);
-    Position startPos = selection.start();
-    Position candidate = startPos.downstream();
-    if (candidate.isCandidate())
-        startPos = candidate;
-
-    Position endPos = selection.end();
-    candidate = endPos.upstream();
-    if (candidate.isCandidate())
-        endPos = candidate;
-
-    m_selectionSubtreeData.clearSelection();
-
-    if (startPos.isNull() || endPos.isNull())
-        return;
-
-    if (selection.visibleStart() == selection.visibleEnd())
-        return;
-
-    if (startPos.deprecatedNode()->renderer()->flowThreadContainingBlock() != endPos.deprecatedNode()->renderer()->flowThreadContainingBlock())
-        return;
-
-    if (&startPos.deprecatedNode()->renderer()->selectionRoot() != this)
-        return;
-
-    auto newStartPos = startPos.deprecatedEditingOffset();
-    auto newEndPos = endPos.deprecatedEditingOffset();
-    ASSERT(newStartPos >= 0 && newEndPos >= 0);
-    m_selectionSubtreeData.setSelectionStart(startPos.deprecatedNode()->renderer());
-    m_selectionSubtreeData.setSelectionStartPos(newStartPos);
-    m_selectionSubtreeData.setSelectionEnd(endPos.deprecatedNode()->renderer());
-    m_selectionSubtreeData.setSelectionEndPos(newEndPos);
-}
-
 } // namespace WebCore
index c7399ef..a6f44fb 100644 (file)
@@ -110,7 +110,6 @@ public:
     const SelectionSubtreeData& selectionData() const { return m_selectionSubtreeData; }
 
     void setSelectionData(const SelectionSubtreeData& selectionSubtreeData) { m_selectionSubtreeData = selectionSubtreeData; }
-    void adjustForVisibleSelection(Document&);
 
 private:
     SelectionSubtreeData m_selectionSubtreeData;