[Settings] Remove all custom code from Settings.h/cpp
[WebKit-https.git] / Source / WebCore / rendering / RenderView.cpp
index 1e7e2ec..3c3d9c7 100644 (file)
 #include "Element.h"
 #include "FloatQuad.h"
 #include "FloatingObjects.h"
-#include "FlowThreadController.h"
 #include "Frame.h"
-#include "FrameSelection.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
+#include "HTMLBodyElement.h"
 #include "HTMLFrameOwnerElement.h"
+#include "HTMLHtmlElement.h"
 #include "HTMLIFrameElement.h"
 #include "HitTestResult.h"
 #include "ImageQualityController.h"
 #include "NodeTraversal.h"
 #include "Page.h"
+#include "RenderDescendantIterator.h"
 #include "RenderGeometryMap.h"
 #include "RenderIterator.h"
 #include "RenderLayer.h"
 #include "RenderLayerBacking.h"
 #include "RenderLayerCompositor.h"
-#include "RenderMultiColumnFlowThread.h"
+#include "RenderMultiColumnFlow.h"
 #include "RenderMultiColumnSet.h"
 #include "RenderMultiColumnSpannerPlaceholder.h"
-#include "RenderNamedFlowThread.h"
-#include "RenderSelectionInfo.h"
+#include "RenderQuote.h"
 #include "RenderWidget.h"
 #include "ScrollbarTheme.h"
 #include "Settings.h"
 #include "StyleInheritedData.h"
 #include "TransformState.h"
+#include <wtf/SetForScope.h>
 #include <wtf/StackStats.h>
 
 namespace WebCore {
@@ -58,7 +59,7 @@ namespace WebCore {
 struct FrameFlatteningLayoutDisallower {
     FrameFlatteningLayoutDisallower(FrameView& frameView)
         : m_frameView(frameView)
-        , m_disallowLayout(frameView.frame().settings().frameFlatteningEnabled())
+        , m_disallowLayout(frameView.effectiveFrameFlattening() != FrameFlattening::Disabled)
     {
         if (m_disallowLayout)
             m_frameView.startDisallowingLayout();
@@ -75,53 +76,11 @@ private:
     bool m_disallowLayout { false };
 };
 
-struct SelectionIterator {
-    SelectionIterator(RenderObject* start)
-        : m_current(start)
-    {
-        checkForSpanner();
-    }
-    
-    RenderObject* current() const
-    {
-        return m_current;
-    }
-    
-    RenderObject* next()
-    {
-        RenderObject* currentSpan = m_spannerStack.isEmpty() ? nullptr : m_spannerStack.last()->spanner();
-        m_current = m_current->nextInPreOrder(currentSpan);
-        checkForSpanner();
-        if (!m_current && currentSpan) {
-            RenderObject* placeholder = m_spannerStack.last();
-            m_spannerStack.removeLast();
-            m_current = placeholder->nextInPreOrder();
-            checkForSpanner();
-        }
-        return m_current;
-    }
-
-private:
-    void checkForSpanner()
-    {
-        if (!is<RenderMultiColumnSpannerPlaceholder>(m_current))
-            return;
-        auto& placeholder = downcast<RenderMultiColumnSpannerPlaceholder>(*m_current);
-        m_spannerStack.append(&placeholder);
-        m_current = placeholder.spanner();
-    }
-
-    RenderObject* m_current { nullptr };
-    Vector<RenderMultiColumnSpannerPlaceholder*> m_spannerStack;
-};
-
 RenderView::RenderView(Document& document, RenderStyle&& style)
     : RenderBlockFlow(document, WTFMove(style))
     , m_frameView(*document.view())
+    , m_selection(*this)
     , m_lazyRepaintTimer(*this, &RenderView::lazyRepaintTimerFired)
-#if ENABLE(SERVICE_CONTROLS)
-    , m_selectionRectGatherer(*this)
-#endif
 {
     setIsRenderView();
 
@@ -150,7 +109,7 @@ void RenderView::scheduleLazyRepaint(RenderBox& renderer)
     renderer.setRenderBoxNeedsLazyRepaint(true);
     m_renderersNeedingLazyRepaint.add(&renderer);
     if (!m_lazyRepaintTimer.isActive())
-        m_lazyRepaintTimer.startOneShot(0);
+        m_lazyRepaintTimer.startOneShot(0_s);
 }
 
 void RenderView::unscheduleLazyRepaint(RenderBox& renderer)
@@ -165,11 +124,8 @@ void RenderView::unscheduleLazyRepaint(RenderBox& renderer)
 
 void RenderView::lazyRepaintTimerFired()
 {
-    bool shouldRepaint = !document().inPageCache();
-
     for (auto& renderer : m_renderersNeedingLazyRepaint) {
-        if (shouldRepaint)
-            renderer->repaint();
+        renderer->repaint();
         renderer->setRenderBoxNeedsLazyRepaint(false);
     }
     m_renderersNeedingLazyRepaint.clear();
@@ -183,6 +139,10 @@ bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result)
 bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& location, HitTestResult& result)
 {
     document().updateLayout();
+    
+#if !ASSERT_DISABLED
+    SetForScope<bool> hitTestRestorer { m_inHitTesting, true };
+#endif
 
     FrameFlatteningLayoutDisallower disallower(frameView());
 
@@ -205,23 +165,22 @@ bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& l
     return resultLayer;
 }
 
-void RenderView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, LogicalExtentComputedValues& computedValues) const
+RenderBox::LogicalExtentComputedValues RenderView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit) const
 {
-    computedValues.m_extent = !shouldUsePrintingLayout() ? LayoutUnit(viewLogicalHeight()) : logicalHeight;
+    return { !shouldUsePrintingLayout() ? LayoutUnit(viewLogicalHeight()) : logicalHeight, LayoutUnit(), ComputedMarginValues() };
 }
 
 void RenderView::updateLogicalWidth()
 {
-    if (!shouldUsePrintingLayout())
-        setLogicalWidth(viewLogicalWidth());
+    setLogicalWidth(shouldUsePrintingLayout() ? m_pageLogicalSize->width() : LayoutUnit(viewLogicalWidth()));
 }
 
 LayoutUnit RenderView::availableLogicalHeight(AvailableLogicalHeightType) const
 {
     // Make sure block progression pagination for percentages uses the column extent and
     // not the view's extent. See https://bugs.webkit.org/show_bug.cgi?id=135204.
-    if (multiColumnFlowThread() && multiColumnFlowThread()->firstMultiColumnSet())
-        return multiColumnFlowThread()->firstMultiColumnSet()->computedColumnHeight();
+    if (multiColumnFlow() && multiColumnFlow()->firstMultiColumnSet())
+        return multiColumnFlow()->firstMultiColumnSet()->computedColumnHeight();
 
 #if PLATFORM(IOS)
     // Workaround for <rdar://problem/7166808>.
@@ -242,8 +201,6 @@ void RenderView::layoutContent(const LayoutState& state)
     ASSERT(needsLayout());
 
     RenderBlockFlow::layout();
-    if (hasRenderNamedFlowThreads())
-        flowThreadController().layoutRenderNamedFlowThreads();
 #ifndef NDEBUG
     checkLayoutState(state);
 #endif
@@ -263,81 +220,24 @@ void RenderView::initializeLayoutState(LayoutState& state)
     // FIXME: May be better to push a clip and avoid issuing offscreen repaints.
     state.m_clipped = false;
 
-    state.m_pageLogicalHeight = m_pageLogicalHeight;
+    state.m_pageLogicalHeight = m_pageLogicalSize ? m_pageLogicalSize->height() : LayoutUnit(0);
     state.m_pageLogicalHeightChanged = m_pageLogicalHeightChanged;
     ASSERT(state.m_pageLogicalHeight >= 0);
     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)
-{
-    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()
 {
     StackStats::LayoutCheckPoint layoutCheckPoint;
     if (!document().paginated())
-        setPageLogicalHeight(0);
+        m_pageLogicalSize = { };
 
-    if (shouldUsePrintingLayout())
-        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth();
+    if (shouldUsePrintingLayout()) {
+        if (!m_pageLogicalSize)
+            m_pageLogicalSize = LayoutSize(logicalWidth(), 0);
+        m_minPreferredLogicalWidth = m_pageLogicalSize->width();
+        m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth;
+    }
 
     // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
     bool relayoutChildren = !shouldUsePrintingLayout() && (width() != viewWidth() || height() != viewHeight());
@@ -364,12 +264,7 @@ void RenderView::layout()
 
     m_pageLogicalHeightChanged = false;
 
-    if (checkTwoPassLayoutForAutoHeightRegions())
-        layoutContentInAutoLogicalHeightRegions(*m_layoutState);
-    else
-        layoutContent(*m_layoutState);
-
-    layoutContentToComputeOverflowInRegions(*m_layoutState);
+    layoutContent(*m_layoutState);
 
 #ifndef NDEBUG
     checkLayoutState(*m_layoutState);
@@ -381,9 +276,9 @@ void RenderView::layout()
 LayoutUnit RenderView::pageOrViewLogicalHeight() const
 {
     if (document().printing())
-        return pageLogicalHeight();
+        return m_pageLogicalSize->height();
     
-    if (multiColumnFlowThread() && !style().hasInlineColumnAxis()) {
+    if (multiColumnFlow() && !style().hasInlineColumnAxis()) {
         if (int pageLength = frameView().pagination().pageLength)
             return pageLength;
     }
@@ -402,6 +297,9 @@ LayoutUnit RenderView::clientLogicalWidthForFixedPosition() const
         return isHorizontalWritingMode() ? frameView().customFixedPositionLayoutRect().width() : frameView().customFixedPositionLayoutRect().height();
 #endif
 
+    if (settings().visualViewportEnabled())
+        return isHorizontalWritingMode() ? frameView().layoutViewportRect().width() : frameView().layoutViewportRect().height();
+
     return clientLogicalWidth();
 }
 
@@ -416,6 +314,9 @@ LayoutUnit RenderView::clientLogicalHeightForFixedPosition() const
         return isHorizontalWritingMode() ? frameView().customFixedPositionLayoutRect().height() : frameView().customFixedPositionLayoutRect().width();
 #endif
 
+    if (settings().visualViewportEnabled())
+        return isHorizontalWritingMode() ? frameView().layoutViewportRect().height() : frameView().layoutViewportRect().width();
+
     return clientLogicalHeight();
 }
 
@@ -426,14 +327,14 @@ void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContai
     ASSERT_ARG(repaintContainer, !repaintContainer || repaintContainer == this);
     ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == (mode & IsFixed));
 
+    if (mode & IsFixed)
+        transformState.move(toLayoutSize(frameView().scrollPositionRespectingCustomFixedPosition()));
+
     if (!repaintContainer && mode & UseTransforms && shouldUseTransformFromContainer(nullptr)) {
         TransformationMatrix t;
         getTransformFromContainer(nullptr, LayoutSize(), t);
         transformState.applyTransform(t);
     }
-    
-    if (mode & IsFixed)
-        transformState.move(toLayoutSize(frameView().scrollPositionRespectingCustomFixedPosition()));
 }
 
 const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
@@ -456,14 +357,14 @@ const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObj
 
 void RenderView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const
 {
-    if (mode & IsFixed)
-        transformState.move(toLayoutSize(frameView().scrollPositionRespectingCustomFixedPosition()));
-
     if (mode & UseTransforms && shouldUseTransformFromContainer(nullptr)) {
         TransformationMatrix t;
         getTransformFromContainer(nullptr, LayoutSize(), t);
         transformState.applyTransform(t);
     }
+
+    if (mode & IsFixed)
+        transformState.move(toLayoutSize(frameView().scrollPositionRespectingCustomFixedPosition()));
 }
 
 bool RenderView::requiresColumns(int) const
@@ -495,24 +396,45 @@ void RenderView::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
     paintObject(paintInfo, paintOffset);
 }
 
-static inline bool rendererObscuresBackground(RenderElement* rootObject)
+RenderElement* RenderView::rendererForRootBackground() const
+{
+    auto* firstChild = this->firstChild();
+    if (!firstChild)
+        return nullptr;
+    ASSERT(is<RenderElement>(*firstChild));
+    auto& documentRenderer = downcast<RenderElement>(*firstChild);
+
+    if (documentRenderer.hasBackground())
+        return &documentRenderer;
+
+    // We propagate the background only for HTML content.
+    if (!is<HTMLHtmlElement>(documentRenderer.element()))
+        return &documentRenderer;
+
+    if (auto* body = document().body()) {
+        if (auto* renderer = body->renderer())
+            return renderer;
+    }
+    return &documentRenderer;
+}
+
+static inline bool rendererObscuresBackground(const RenderElement& rootElement)
 {
-    if (!rootObject)
+    auto& style = rootElement.style();
+    if (style.visibility() != VISIBLE || style.opacity() != 1 || style.hasTransform())
         return false;
-    
-    const RenderStyle& style = rootObject->style();
-    if (style.visibility() != VISIBLE
-        || style.opacity() != 1
-        || style.hasTransform())
+
+    if (style.hasBorderRadius())
         return false;
-    
-    if (rootObject->isComposited())
+
+    if (rootElement.isComposited())
         return false;
 
-    if (rootObject->rendererForRootBackground().style().backgroundClip() == TextFillBox)
+    auto* rendererForBackground = rootElement.view().rendererForRootBackground();
+    if (!rendererForBackground)
         return false;
 
-    if (style.hasBorderRadius())
+    if (rendererForBackground->style().backgroundClip() == TextFillBox)
         return false;
 
     return true;
@@ -556,10 +478,10 @@ void RenderView::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint&)
         // The document element's renderer is currently forced to be a block, but may not always be.
         RenderBox* rootBox = is<RenderBox>(*rootRenderer) ? downcast<RenderBox>(rootRenderer) : nullptr;
         rootFillsViewport = rootBox && !rootBox->x() && !rootBox->y() && rootBox->width() >= width() && rootBox->height() >= height();
-        rootObscuresBackground = rendererObscuresBackground(rootRenderer);
+        rootObscuresBackground = rendererObscuresBackground(*rootRenderer);
     }
 
-    bool backgroundShouldExtendBeyondPage = frameView().frame().settings().backgroundShouldExtendBeyondPage();
+    bool backgroundShouldExtendBeyondPage = settings().backgroundShouldExtendBeyondPage();
     compositor().setRootExtendedBackgroundColor(backgroundShouldExtendBeyondPage ? frameView().documentBackgroundColor() : Color());
 
     Page* page = document().page();
@@ -578,9 +500,9 @@ void RenderView::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint&)
     if (frameView().isTransparent()) // FIXME: This needs to be dynamic. We should be able to go back to blitting if we ever stop being transparent.
         frameView().setCannotBlitToWindow(); // The parent must show behind the child.
     else {
-        Color documentBackgroundColor = frameView().documentBackgroundColor();
-        Color backgroundColor = (backgroundShouldExtendBeyondPage && documentBackgroundColor.isValid()) ? documentBackgroundColor : frameView().baseBackgroundColor();
-        if (backgroundColor.alpha()) {
+        const Color& documentBackgroundColor = frameView().documentBackgroundColor();
+        const Color& backgroundColor = (backgroundShouldExtendBeyondPage && documentBackgroundColor.isValid()) ? documentBackgroundColor : frameView().baseBackgroundColor();
+        if (backgroundColor.isVisible()) {
             CompositeOperator previousOperator = paintInfo.context().compositeOperation();
             paintInfo.context().setCompositeOperation(CompositeCopy);
             paintInfo.context().fillRect(paintInfo.rect, backgroundColor);
@@ -719,6 +641,13 @@ bool RenderView::isScrollableOrRubberbandableBox() const
     return frameView().isScrollable(defineScrollable);
 }
 
+void RenderView::willBeDestroyed()
+{
+    RenderBlockFlow::willBeDestroyed();
+
+    ASSERT_WITH_MESSAGE(m_rendererCount == 1, "All other renderers in this render tree should have been destroyed");
+}
+
 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
 {
     rects.append(snappedIntRect(accumulatedOffset, layer()->size()));
@@ -731,380 +660,6 @@ void RenderView::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
     quads.append(FloatRect(FloatPoint(), layer()->size()));
 }
 
-static RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset)
-{
-    if (!object)
-        return nullptr;
-
-    RenderObject* child = object->childAt(offset);
-    return child ? child : object->nextInPreOrderAfterChildren();
-}
-
-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);
-}
-
-LayoutRect RenderView::subtreeSelectionBounds(const SelectionSubtreeRoot& root, bool clipToVisibleContent) const
-{
-    typedef HashMap<RenderObject*, std::unique_ptr<RenderSelectionInfo>> SelectionMap;
-    SelectionMap selectedObjects;
-
-    RenderObject* os = root.selectionData().selectionStart();
-    auto* selectionEnd = root.selectionData().selectionEnd();
-    RenderObject* stop = nullptr;
-    if (selectionEnd)
-        stop = rendererAfterPosition(selectionEnd, root.selectionData().selectionEndPos().value());
-    SelectionIterator selectionIterator(os);
-    while (os && os != stop) {
-        if ((os->canBeSelectionLeaf() || os == root.selectionData().selectionStart() || os == root.selectionData().selectionEnd()) && os->selectionState() != SelectionNone) {
-            // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
-            selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(*os, clipToVisibleContent));
-            RenderBlock* cb = os->containingBlock();
-            while (cb && !is<RenderView>(*cb)) {
-                std::unique_ptr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).iterator->value;
-                if (blockInfo)
-                    break;
-                blockInfo = std::make_unique<RenderSelectionInfo>(*cb, clipToVisibleContent);
-                cb = cb->containingBlock();
-            }
-        }
-
-        os = selectionIterator.next();
-    }
-
-    // Now create a single bounding box rect that encloses the whole selection.
-    LayoutRect selRect;
-    SelectionMap::iterator end = selectedObjects.end();
-    for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i) {
-        RenderSelectionInfo* info = i->value.get();
-        // RenderSelectionInfo::rect() is in the coordinates of the repaintContainer, so map to page coordinates.
-        LayoutRect currRect = info->rect();
-        if (RenderLayerModelObject* repaintContainer = info->repaintContainer()) {
-            FloatQuad absQuad = repaintContainer->localToAbsoluteQuad(FloatRect(currRect));
-            currRect = absQuad.enclosingBoundingBox(); 
-        }
-        selRect.unite(currRect);
-    }
-    return selRect;
-}
-
-void RenderView::repaintSelection() const
-{
-    repaintSubtreeSelection(*this);
-
-    if (hasRenderNamedFlowThreads()) {
-        for (auto* namedFlowThread : *m_flowThreadController->renderNamedFlowThreadList())
-            repaintSubtreeSelection(*namedFlowThread);
-    }
-}
-
-void RenderView::repaintSubtreeSelection(const SelectionSubtreeRoot& root) const
-{
-    HashSet<RenderBlock*> processedBlocks;
-
-    auto* selectionEnd = root.selectionData().selectionEnd();
-    RenderObject* end = nullptr;
-    if (selectionEnd)
-        end = rendererAfterPosition(selectionEnd, root.selectionData().selectionEndPos().value());
-    SelectionIterator selectionIterator(root.selectionData().selectionStart());
-    for (RenderObject* o = selectionIterator.current(); o && o != end; o = selectionIterator.next()) {
-        if (!o->canBeSelectionLeaf() && o != root.selectionData().selectionStart() && o != root.selectionData().selectionEnd())
-            continue;
-        if (o->selectionState() == SelectionNone)
-            continue;
-
-        RenderSelectionInfo(*o, true).repaint();
-
-        // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
-        for (RenderBlock* block = o->containingBlock(); block && !is<RenderView>(*block); block = block->containingBlock()) {
-            if (!processedBlocks.add(block).isNewEntry)
-                break;
-            RenderSelectionInfo(*block, true).repaint();
-        }
-    }
-}
-
-void RenderView::setSelection(RenderObject* start, Optional<unsigned> startPos, RenderObject* end, Optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode)
-{
-    // Make sure both our start and end objects are defined.
-    // Check www.msnbc.com and try clicking around to find the case where this happened.
-    if ((start && !end) || (end && !start))
-        return;
-
-    bool caretChanged = m_selectionWasCaret != frame().selection().isCaret();
-    m_selectionWasCaret = frame().selection().isCaret();
-    // Just return if the selection hasn't changed.
-    if (m_selectionUnsplitStart == start && m_selectionUnsplitStartPos == startPos
-        && m_selectionUnsplitEnd == end && m_selectionUnsplitEndPos == endPos && !caretChanged) {
-        return;
-    }
-
-#if ENABLE(SERVICE_CONTROLS)
-    // Clear the current rects and create a notifier for the new rects we are about to gather.
-    // The Notifier updates the Editor when it goes out of scope and is destroyed.
-    std::unique_ptr<SelectionRectGatherer::Notifier> rectNotifier = m_selectionRectGatherer.clearAndCreateNotifier();
-#endif // ENABLE(SERVICE_CONTROLS)
-    // Set global positions for new selection.
-    m_selectionUnsplitStart = start;
-    m_selectionUnsplitStartPos = startPos;
-    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, Optional<unsigned> startPos, const RenderObject* end, 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 : 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);
-}
-
-void RenderView::updateSelectionForSubtrees(RenderSubtreesMap& renderSubtreesMap, SelectionRepaintMode blockRepaintMode)
-{
-    SubtreeOldSelectionDataMap oldSelectionDataMap;
-    for (auto& subtreeSelectionInfo : renderSubtreesMap) {
-        SelectionSubtreeRoot& root = *subtreeSelectionInfo.key;
-        std::unique_ptr<OldSelectionData> oldSelectionData = std::make_unique<OldSelectionData>();
-
-        clearSubtreeSelection(root, blockRepaintMode, *oldSelectionData);
-        oldSelectionDataMap.set(&root, WTFMove(oldSelectionData));
-
-        root.setSelectionData(subtreeSelectionInfo.value);
-        if (hasRenderNamedFlowThreads())
-            root.adjustForVisibleSelection(document());
-    }
-
-    // Update selection status for the objects inside the selection subtrees.
-    // This needs to be done after the previous loop updated the selectionStart/End
-    // parameters of all subtrees because we're going to be climbing up the containing
-    // block chain and we might end up in a different selection subtree.
-    for (const auto* subtreeSelectionRoot : renderSubtreesMap.keys()) {
-        OldSelectionData& oldSelectionData = *oldSelectionDataMap.get(subtreeSelectionRoot);
-        applySubtreeSelection(*subtreeSelectionRoot, blockRepaintMode, oldSelectionData);
-    }
-}
-
-static inline bool isValidObjectForNewSelection(const SelectionSubtreeRoot& root, const RenderObject& object)
-{
-    return (object.canBeSelectionLeaf() || &object == root.selectionData().selectionStart() || &object == root.selectionData().selectionEnd()) && object.selectionState() != RenderObject::SelectionNone && object.containingBlock();
-}
-
-void RenderView::clearSubtreeSelection(const SelectionSubtreeRoot& root, SelectionRepaintMode blockRepaintMode, OldSelectionData& oldSelectionData) const
-{
-    // Record the old selected objects.  These will be used later
-    // when we compare against the new selected objects.
-    oldSelectionData.selectionStartPos = root.selectionData().selectionStartPos();
-    oldSelectionData.selectionEndPos = root.selectionData().selectionEndPos();
-    
-    // Blocks contain selected objects and fill gaps between them, either on the left, right, or in between lines and blocks.
-    // In order to get the repaint rect right, we have to examine left, middle, and right rects individually, since otherwise
-    // the union of those rects might remain the same even when changes have occurred.
-
-    RenderObject* os = root.selectionData().selectionStart();
-    auto* selectionEnd = root.selectionData().selectionEnd();
-    RenderObject* stop = nullptr;
-    if (selectionEnd)
-        stop = rendererAfterPosition(selectionEnd, root.selectionData().selectionEndPos().value());
-    SelectionIterator selectionIterator(os);
-    while (os && os != stop) {
-        if (isValidObjectForNewSelection(root, *os)) {
-            // Blocks are responsible for painting line gaps and margin gaps.  They must be examined as well.
-            oldSelectionData.selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(*os, true));
-            if (blockRepaintMode == RepaintNewXOROld) {
-                RenderBlock* cb = os->containingBlock();
-                while (cb && !is<RenderView>(*cb)) {
-                    std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = oldSelectionData.selectedBlocks.add(cb, nullptr).iterator->value;
-                    if (blockInfo)
-                        break;
-                    blockInfo = std::make_unique<RenderBlockSelectionInfo>(*cb);
-                    cb = cb->containingBlock();
-                }
-            }
-        }
-
-        os = selectionIterator.next();
-    }
-
-    for (auto* selectedObject : oldSelectionData.selectedObjects.keys())
-        selectedObject->setSelectionStateIfNeeded(SelectionNone);
-}
-
-void RenderView::applySubtreeSelection(const SelectionSubtreeRoot& root, SelectionRepaintMode blockRepaintMode, const OldSelectionData& oldSelectionData)
-{
-    // Update the selection status of all objects between selectionStart and selectionEnd
-    if (root.selectionData().selectionStart() && root.selectionData().selectionStart() == root.selectionData().selectionEnd())
-        root.selectionData().selectionStart()->setSelectionStateIfNeeded(SelectionBoth);
-    else {
-        if (root.selectionData().selectionStart())
-            root.selectionData().selectionStart()->setSelectionStateIfNeeded(SelectionStart);
-        if (root.selectionData().selectionEnd())
-            root.selectionData().selectionEnd()->setSelectionStateIfNeeded(SelectionEnd);
-    }
-
-    RenderObject* selectionStart = root.selectionData().selectionStart();
-    auto* selectionDataEnd = root.selectionData().selectionEnd();
-    RenderObject* selectionEnd = nullptr;
-    if (selectionDataEnd)
-        selectionEnd = rendererAfterPosition(selectionDataEnd, root.selectionData().selectionEndPos().value());
-    SelectionIterator selectionIterator(selectionStart);
-    for (RenderObject* currentRenderer = selectionStart; currentRenderer && currentRenderer != selectionEnd; currentRenderer = selectionIterator.next()) {
-        if (currentRenderer == root.selectionData().selectionStart() || currentRenderer == root.selectionData().selectionEnd())
-            continue;
-        if (!currentRenderer->canBeSelectionLeaf())
-            continue;
-        // FIXME: Move this logic to SelectionIterator::next()
-        if (&currentRenderer->selectionRoot() != &root)
-            continue;
-        currentRenderer->setSelectionStateIfNeeded(SelectionInside);
-    }
-
-    if (blockRepaintMode != RepaintNothing)
-        layer()->clearBlockSelectionGapsBounds();
-
-    // Now that the selection state has been updated for the new objects, walk them again and
-    // put them in the new objects list.
-    SelectedObjectMap newSelectedObjects;
-    SelectedBlockMap newSelectedBlocks;
-    selectionIterator = SelectionIterator(selectionStart);
-    for (RenderObject* currentRenderer = selectionStart; currentRenderer && currentRenderer != selectionEnd; currentRenderer = selectionIterator.next()) {
-        if (isValidObjectForNewSelection(root, *currentRenderer)) {
-            std::unique_ptr<RenderSelectionInfo> selectionInfo = std::make_unique<RenderSelectionInfo>(*currentRenderer, true);
-
-#if ENABLE(SERVICE_CONTROLS)
-            for (auto& rect : selectionInfo->collectedSelectionRects())
-                m_selectionRectGatherer.addRect(selectionInfo->repaintContainer(), rect);
-            if (!currentRenderer->isTextOrLineBreak())
-                m_selectionRectGatherer.setTextOnly(false);
-#endif
-
-            newSelectedObjects.set(currentRenderer, WTFMove(selectionInfo));
-
-            RenderBlock* containingBlock = currentRenderer->containingBlock();
-            while (containingBlock && !is<RenderView>(*containingBlock)) {
-                std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks.add(containingBlock, nullptr).iterator->value;
-                if (blockInfo)
-                    break;
-                blockInfo = std::make_unique<RenderBlockSelectionInfo>(*containingBlock);
-                containingBlock = containingBlock->containingBlock();
-
-#if ENABLE(SERVICE_CONTROLS)
-                m_selectionRectGatherer.addGapRects(blockInfo->repaintContainer(), blockInfo->rects());
-#endif
-            }
-        }
-    }
-
-    if (blockRepaintMode == RepaintNothing)
-        return;
-
-    // Have any of the old selected objects changed compared to the new selection?
-    for (const auto& selectedObjectInfo : oldSelectionData.selectedObjects) {
-        RenderObject* obj = selectedObjectInfo.key;
-        RenderSelectionInfo* newInfo = newSelectedObjects.get(obj);
-        RenderSelectionInfo* oldInfo = selectedObjectInfo.value.get();
-        if (!newInfo || oldInfo->rect() != newInfo->rect() || oldInfo->state() != newInfo->state()
-            || (root.selectionData().selectionStart() == obj && oldSelectionData.selectionStartPos != root.selectionData().selectionStartPos())
-            || (root.selectionData().selectionEnd() == obj && oldSelectionData.selectionEndPos != root.selectionData().selectionEndPos())) {
-            oldInfo->repaint();
-            if (newInfo) {
-                newInfo->repaint();
-                newSelectedObjects.remove(obj);
-            }
-        }
-    }
-
-    // Any new objects that remain were not found in the old objects dict, and so they need to be updated.
-    for (const auto& selectedObjectInfo : newSelectedObjects)
-        selectedObjectInfo.value->repaint();
-
-    // Have any of the old blocks changed?
-    for (const auto& selectedBlockInfo : oldSelectionData.selectedBlocks) {
-        const RenderBlock* block = selectedBlockInfo.key;
-        RenderBlockSelectionInfo* newInfo = newSelectedBlocks.get(block);
-        RenderBlockSelectionInfo* oldInfo = selectedBlockInfo.value.get();
-        if (!newInfo || oldInfo->rects() != newInfo->rects() || oldInfo->state() != newInfo->state()) {
-            oldInfo->repaint();
-            if (newInfo) {
-                newInfo->repaint();
-                newSelectedBlocks.remove(block);
-            }
-        }
-    }
-
-    // Any new blocks that remain were not found in the old blocks dict, and so they need to be updated.
-    for (const auto& selectedBlockInfo : newSelectedBlocks)
-        selectedBlockInfo.value->repaint();
-}
-
-void RenderView::getSelection(RenderObject*& startRenderer, Optional<unsigned>& startOffset, RenderObject*& endRenderer, Optional<unsigned>& endOffset) const
-{
-    startRenderer = m_selectionUnsplitStart;
-    startOffset = m_selectionUnsplitStartPos;
-    endRenderer = m_selectionUnsplitEnd;
-    endOffset = m_selectionUnsplitEndPos;
-}
-
-void RenderView::clearSelection()
-{
-    layer()->repaintBlockSelectionGaps();
-    setSelection(nullptr, Nullopt, nullptr, Nullopt, RepaintNewMinusOld);
-}
-
 bool RenderView::printing() const
 {
     return document().printing();
@@ -1133,11 +688,9 @@ IntRect RenderView::unscaledDocumentRect() const
 
 bool RenderView::rootBackgroundIsEntirelyFixed() const
 {
-    RenderElement* rootObject = document().documentElement() ? document().documentElement()->renderer() : nullptr;
-    if (!rootObject)
-        return false;
-
-    return rootObject->rendererForRootBackground().hasEntirelyFixedBackground();
+    if (auto* rootBackgroundRenderer = rendererForRootBackground())
+        return rootBackgroundRenderer->style().hasEntirelyFixedBackground();
+    return false;
 }
     
 LayoutRect RenderView::unextendedBackgroundRect() const
@@ -1189,6 +742,14 @@ int RenderView::viewLogicalHeight() const
     return height;
 }
 
+void RenderView::setPageLogicalSize(LayoutSize size)
+{
+    if (!m_pageLogicalSize || m_pageLogicalSize->height() != size.height())
+        m_pageLogicalHeightChanged = true;
+
+    m_pageLogicalSize = size;
+}
+
 float RenderView::zoomFactor() const
 {
     return frameView().frame().pageZoomFactor();
@@ -1200,7 +761,17 @@ void RenderView::pushLayoutState(RenderObject& root)
     ASSERT(m_layoutState == 0);
 
     m_layoutState = std::make_unique<LayoutState>(root);
-    pushLayoutStateForCurrentFlowThread(root);
+}
+
+bool RenderView::pushLayoutStateForPaginationIfNeeded(RenderBlockFlow& layoutRoot)
+{
+    if (m_layoutState)
+        return false;
+    m_layoutState = std::make_unique<LayoutState>(layoutRoot);
+    m_layoutState->m_isPaginated = true;
+    // This is just a flag for known page height (see RenderBlockFlow::checkForPaginationLogicalHeightChange).
+    m_layoutState->m_pageLogicalHeight = 1;
+    return true;
 }
 
 IntSize RenderView::viewportSizeForCSSViewportUnits() const
@@ -1213,8 +784,8 @@ void RenderView::updateHitTestResult(HitTestResult& result, const LayoutPoint& p
     if (result.innerNode())
         return;
 
-    if (multiColumnFlowThread() && multiColumnFlowThread()->firstMultiColumnSet())
-        return multiColumnFlowThread()->firstMultiColumnSet()->updateHitTestResult(result, point);
+    if (multiColumnFlow() && multiColumnFlow()->firstMultiColumnSet())
+        return multiColumnFlow()->firstMultiColumnSet()->updateHitTestResult(result, point);
 
     Node* node = document().documentElement();
     if (node) {
@@ -1276,56 +847,10 @@ 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;
-}
-
-void RenderView::pushLayoutStateForCurrentFlowThread(const RenderObject& object)
-{
-    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()
 {
     if (!m_imageQualityController)
@@ -1349,18 +874,22 @@ void RenderView::updateVisibleViewportRect(const IntRect& visibleRect)
 {
     resumePausedImageAnimationsIfNeeded(visibleRect);
 
-    for (auto* renderer : m_visibleInViewportRenderers)
-        renderer->visibleInViewportStateChanged(visibleRect.intersects(enclosingIntRect(renderer->absoluteClippedOverflowRect())) ? RenderElement::VisibleInViewport : RenderElement::NotVisibleInViewport);
+    for (auto* renderer : m_visibleInViewportRenderers) {
+        auto state = visibleRect.intersects(enclosingIntRect(renderer->absoluteClippedOverflowRect())) ? VisibleInViewportState::Yes : VisibleInViewportState::No;
+        renderer->setVisibleInViewportState(state);
+    }
 }
 
-void RenderView::addRendererWithPausedImageAnimations(RenderElement& renderer)
+void RenderView::addRendererWithPausedImageAnimations(RenderElement& renderer, CachedImage& image)
 {
-    if (renderer.hasPausedImageAnimations()) {
-        ASSERT(m_renderersWithPausedImageAnimation.contains(&renderer));
-        return;
-    }
+    ASSERT(!renderer.hasPausedImageAnimations() || m_renderersWithPausedImageAnimation.contains(&renderer));
+
     renderer.setHasPausedImageAnimations(true);
-    m_renderersWithPausedImageAnimation.add(&renderer);
+    auto& images = m_renderersWithPausedImageAnimation.ensure(&renderer, [] {
+        return Vector<CachedImage*>();
+    }).iterator->value;
+    if (!images.contains(&image))
+        images.append(&image);
 }
 
 void RenderView::removeRendererWithPausedImageAnimations(RenderElement& renderer)
@@ -1372,49 +901,74 @@ void RenderView::removeRendererWithPausedImageAnimations(RenderElement& renderer
     m_renderersWithPausedImageAnimation.remove(&renderer);
 }
 
+void RenderView::removeRendererWithPausedImageAnimations(RenderElement& renderer, CachedImage& image)
+{
+    ASSERT(renderer.hasPausedImageAnimations());
+
+    auto it = m_renderersWithPausedImageAnimation.find(&renderer);
+    ASSERT(it != m_renderersWithPausedImageAnimation.end());
+
+    auto& images = it->value;
+    if (!images.contains(&image))
+        return;
+
+    if (images.size() == 1)
+        removeRendererWithPausedImageAnimations(renderer);
+    else
+        images.removeFirst(&image);
+}
+
 void RenderView::resumePausedImageAnimationsIfNeeded(IntRect visibleRect)
 {
-    Vector<RenderElement*, 10> toRemove;
-    for (auto* renderer : m_renderersWithPausedImageAnimation) {
-        if (renderer->repaintForPausedImageAnimationsIfNeeded(visibleRect))
-            toRemove.append(renderer);
+    Vector<std::pair<RenderElement*, CachedImage*>, 10> toRemove;
+    for (auto& it : m_renderersWithPausedImageAnimation) {
+        auto* renderer = it.key;
+        for (auto* image : it.value) {
+            if (renderer->repaintForPausedImageAnimationsIfNeeded(visibleRect, *image))
+                toRemove.append(std::make_pair(renderer, image));
+        }
     }
-    for (auto& renderer : toRemove)
-        removeRendererWithPausedImageAnimations(*renderer);
+    for (auto& pair : toRemove)
+        removeRendererWithPausedImageAnimations(*pair.first, *pair.second);
 }
 
 RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator(RenderView* view)
-    : m_rootView(view ? view->document().topDocument().renderView() : nullptr)
 {
-    if (!m_rootView)
+    if (!view)
         return;
-    m_wasAccumulatingRepaintRegion = !!m_rootView->m_accumulatedRepaintRegion;
+
+    auto* rootRenderView = view->document().topDocument().renderView();
+    if (!rootRenderView)
+        return;
+
+    m_wasAccumulatingRepaintRegion = !!rootRenderView->m_accumulatedRepaintRegion;
     if (!m_wasAccumulatingRepaintRegion)
-        m_rootView->m_accumulatedRepaintRegion = std::make_unique<Region>();
+        rootRenderView->m_accumulatedRepaintRegion = std::make_unique<Region>();
+    m_rootView = makeWeakPtr(*rootRenderView);
 }
 
 RenderView::RepaintRegionAccumulator::~RepaintRegionAccumulator()
 {
-    if (!m_rootView)
-        return;
     if (m_wasAccumulatingRepaintRegion)
         return;
-    m_rootView->flushAccumulatedRepaintRegion();
+    if (!m_rootView)
+        return;
+    m_rootView.get()->flushAccumulatedRepaintRegion();
 }
 
 unsigned RenderView::pageNumberForBlockProgressionOffset(int offset) const
 {
     int columnNumber = 0;
-    const Pagination& pagination = frameView().frame().page()->pagination();
+    const Pagination& pagination = page().pagination();
     if (pagination.mode == Pagination::Unpaginated)
         return columnNumber;
     
     bool progressionIsInline = false;
     bool progressionIsReversed = false;
     
-    if (multiColumnFlowThread()) {
-        progressionIsInline = multiColumnFlowThread()->progressionIsInline();
-        progressionIsReversed = multiColumnFlowThread()->progressionIsReversed();
+    if (multiColumnFlow()) {
+        progressionIsInline = multiColumnFlow()->progressionIsInline();
+        progressionIsReversed = multiColumnFlow()->progressionIsReversed();
     } else
         return columnNumber;
     
@@ -1430,25 +984,25 @@ unsigned RenderView::pageNumberForBlockProgressionOffset(int offset) const
 
 unsigned RenderView::pageCount() const
 {
-    const Pagination& pagination = frameView().frame().page()->pagination();
+    const Pagination& pagination = page().pagination();
     if (pagination.mode == Pagination::Unpaginated)
         return 0;
     
-    if (multiColumnFlowThread() && multiColumnFlowThread()->firstMultiColumnSet())
-        return multiColumnFlowThread()->firstMultiColumnSet()->columnCount();
+    if (multiColumnFlow() && multiColumnFlow()->firstMultiColumnSet())
+        return multiColumnFlow()->firstMultiColumnSet()->columnCount();
 
     return 0;
 }
 
 #if ENABLE(CSS_SCROLL_SNAP)
-void RenderView::registerBoxWithScrollSnapCoordinates(const RenderBox& box)
+void RenderView::registerBoxWithScrollSnapPositions(const RenderBox& box)
 {
-    m_boxesWithScrollSnapCoordinates.add(&box);
+    m_boxesWithScrollSnapPositions.add(&box);
 }
 
-void RenderView::unregisterBoxWithScrollSnapCoordinates(const RenderBox& box)
+void RenderView::unregisterBoxWithScrollSnapPositions(const RenderBox& box)
 {
-    m_boxesWithScrollSnapCoordinates.remove(&box);
+    m_boxesWithScrollSnapPositions.remove(&box);
 }
 #endif