Title: [271740] trunk/Source/WebCore
Revision
271740
Author
[email protected]
Date
2021-01-22 01:07:05 -0800 (Fri, 22 Jan 2021)

Log Message

Continue removing glue code from RenderLayer that was recently added in r271559
https://bugs.webkit.org/show_bug.cgi?id=220729

Reviewed by Adrian Perez de Castro.

Follow-up on patch adressing the removal of the glue code that
forwards calls from RenderLayer to RenderLayerScrollableArea (see
webkit.org/b/60305).

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
(WebCore::RenderBlock::isPointInOverflowControl):
(WebCore::RenderBlock::baselinePosition const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::intrinsicScrollbarLogicalWidth const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::containsDirtyOverlayScrollbars const): Deleted.
(WebCore::RenderLayer::hitTestOverflowControls): Deleted.
(WebCore::RenderLayer::paintOverflowControls): Deleted.
(WebCore::RenderLayer::paintResizer): Deleted.
(WebCore::RenderLayer::paintScrollCorner): Deleted.
(WebCore::RenderLayer::paintOverlayScrollbars): Deleted.
(WebCore::RenderLayer::layerForHorizontalScrollbar const): Deleted.
(WebCore::RenderLayer::layerForVerticalScrollbar const): Deleted.
(WebCore::RenderLayer::horizontalScrollbar const): Deleted.
(WebCore::RenderLayer::verticalScrollbar const): Deleted.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::hasScrollbars const): Deleted.
(WebCore::RenderLayer::hasHorizontalScrollbar const): Deleted.
(WebCore::RenderLayer::hasVerticalScrollbar const): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
* rendering/RenderTreeAsText.cpp:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paint):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (271739 => 271740)


--- trunk/Source/WebCore/ChangeLog	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/ChangeLog	2021-01-22 09:07:05 UTC (rev 271740)
@@ -1,3 +1,52 @@
+2021-01-19  Nikolas Zimmermann  <[email protected]>
+
+        Continue removing glue code from RenderLayer that was recently added in r271559
+        https://bugs.webkit.org/show_bug.cgi?id=220729
+
+        Reviewed by Adrian Perez de Castro.
+
+        Follow-up on patch adressing the removal of the glue code that
+        forwards calls from RenderLayer to RenderLayerScrollableArea (see
+        webkit.org/b/60305).
+
+        Covered by existing tests.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintContents):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paint):
+        (WebCore::RenderBlock::isPointInOverflowControl):
+        (WebCore::RenderBlock::baselinePosition const):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::intrinsicScrollbarLogicalWidth const):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::containsDirtyOverlayScrollbars const): Deleted.
+        (WebCore::RenderLayer::hitTestOverflowControls): Deleted.
+        (WebCore::RenderLayer::paintOverflowControls): Deleted.
+        (WebCore::RenderLayer::paintResizer): Deleted.
+        (WebCore::RenderLayer::paintScrollCorner): Deleted.
+        (WebCore::RenderLayer::paintOverlayScrollbars): Deleted.
+        (WebCore::RenderLayer::layerForHorizontalScrollbar const): Deleted.
+        (WebCore::RenderLayer::layerForVerticalScrollbar const): Deleted.
+        (WebCore::RenderLayer::horizontalScrollbar const): Deleted.
+        (WebCore::RenderLayer::verticalScrollbar const): Deleted.
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::hasScrollbars const): Deleted.
+        (WebCore::RenderLayer::hasHorizontalScrollbar const): Deleted.
+        (WebCore::RenderLayer::hasVerticalScrollbar const): Deleted.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const):
+        (WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const):
+        (WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
+        (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
+        (WebCore::RenderLayerBacking::paintIntoLayer):
+        (WebCore::RenderLayerBacking::paintContents):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
+        * rendering/RenderTreeAsText.cpp:
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paint):
+
 2021-01-21  Rob Buis  <[email protected]>
 
         Handle shapeMargin becoming NaN

Modified: trunk/Source/WebCore/page/FrameView.cpp (271739 => 271740)


--- trunk/Source/WebCore/page/FrameView.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/page/FrameView.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -4332,8 +4332,10 @@
         renderer = renderer->parent();
 
     rootLayer->paint(context, dirtyRect, LayoutSize(), m_paintBehavior, renderer, { }, securityOriginPaintPolicy == SecurityOriginPaintPolicy::AnyOrigin ? RenderLayer::SecurityOriginPaintPolicy::AnyOrigin : RenderLayer::SecurityOriginPaintPolicy::AccessibleOriginOnly, eventRegionContext);
-    if (rootLayer->containsDirtyOverlayScrollbars() && !eventRegionContext)
-        rootLayer->paintOverlayScrollbars(context, dirtyRect, m_paintBehavior, renderer);
+    if (auto* scrollableRootLayer = rootLayer->scrollableArea()) {
+        if (scrollableRootLayer->containsDirtyOverlayScrollbars() && !eventRegionContext)
+            scrollableRootLayer->paintOverlayScrollbars(context, dirtyRect, m_paintBehavior, renderer);
+    }
 
     didPaintContents(context, dirtyRect, paintingState);
 }

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -59,6 +59,7 @@
 #include "RenderInline.h"
 #include "RenderIterator.h"
 #include "RenderLayer.h"
+#include "RenderLayerScrollableArea.h"
 #include "RenderLayoutState.h"
 #include "RenderListMarker.h"
 #include "RenderMenuList.h"
@@ -1112,8 +1113,8 @@
     // z-index. We paint after we painted the background/border, so that the scrollbars will
     // sit above the background/border.
     if ((phase == PaintPhase::BlockBackground || phase == PaintPhase::ChildBlockBackground) && hasOverflowClip() && layer()
-        && style().visibility() == Visibility::Visible && paintInfo.shouldPaintWithinRoot(*this) && !paintInfo.paintRootBackgroundOnly())
-        layer()->paintOverflowControls(paintInfo.context(), roundedIntPoint(adjustedPaintOffset), snappedIntRect(paintInfo.rect));
+        && layer()->scrollableArea() && style().visibility() == Visibility::Visible && paintInfo.shouldPaintWithinRoot(*this) && !paintInfo.paintRootBackgroundOnly())
+        layer()->scrollableArea()->paintOverflowControls(paintInfo.context(), roundedIntPoint(adjustedPaintOffset), snappedIntRect(paintInfo.rect));
 }
 
 void RenderBlock::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -2005,8 +2006,9 @@
 {
     if (!scrollsOverflow())
         return false;
-
-    return layer()->hitTestOverflowControls(result, roundedIntPoint(locationInContainer - toLayoutSize(accumulatedOffset)));
+    if (auto* scrollableLayer = layer() ? layer()->scrollableArea() : nullptr)
+        return scrollableLayer->hitTestOverflowControls(result, roundedIntPoint(locationInContainer - toLayoutSize(accumulatedOffset)));
+    return false;
 }
 
 Node* RenderBlock::nodeForHitTest() const
@@ -2502,11 +2504,24 @@
         // (the content inside them moves).  This matches WinIE as well, which just bottom-aligns them.
         // We also give up on finding a baseline if we have a vertical scrollbar, or if we are scrolled
         // vertically (e.g., an overflow:hidden block that has had scrollTop moved).
-        bool ignoreBaseline = (layer() && (layer()->marquee() || (direction == HorizontalLine ? (layer()->verticalScrollbar() || layer()->scrollOffset().y() != 0)
-            : (layer()->horizontalScrollbar() || layer()->scrollOffset().x() != 0)))) || (isWritingModeRoot() && !isRubyRun());
+        auto ignoreBaseline = [this, direction]() -> bool {
+            if (isWritingModeRoot() && !isRubyRun())
+                return true;
+
+            auto* scrollableLayer = layer() ? layer()->scrollableArea() : nullptr;
+            if (!scrollableLayer)
+                return false;
+
+            if (scrollableLayer->marquee())
+                return true;
+
+            if (direction == HorizontalLine)
+                return scrollableLayer->verticalScrollbar() || scrollableLayer->scrollOffset().y();
+            return scrollableLayer->horizontalScrollbar() || scrollableLayer->scrollOffset().x();
+        };
+
+        Optional<int> baselinePos = ignoreBaseline() ? Optional<int>() : inlineBlockBaseline(direction);
         
-        Optional<int> baselinePos = ignoreBaseline ? Optional<int>() : inlineBlockBaseline(direction);
-        
         if (isDeprecatedFlexibleBox()) {
             // Historically, we did this check for all baselines. But we can't
             // remove this code from deprecated flexbox, because it effectively

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -849,12 +849,12 @@
         return 0;
 
     if (isHorizontalWritingMode() && (style().overflowY() == Overflow::Scroll && !canUseOverlayScrollbars())) {
-        ASSERT(layer() && layer()->hasVerticalScrollbar());
+        ASSERT(layer() && layer()->scrollableArea() && layer()->scrollableArea()->hasVerticalScrollbar());
         return verticalScrollbarWidth();
     }
 
     if (!isHorizontalWritingMode() && (style().overflowX() == Overflow::Scroll && !canUseOverlayScrollbars())) {
-        ASSERT(layer() && layer()->hasHorizontalScrollbar());
+        ASSERT(layer() && layer()->scrollableArea() && layer()->scrollableArea()->hasHorizontalScrollbar());
         return horizontalScrollbarHeight();
     }
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -389,13 +389,6 @@
     return renderer().shouldPlaceBlockDirectionScrollbarOnLeft();
 }
 
-bool RenderLayer::containsDirtyOverlayScrollbars() const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->containsDirtyOverlayScrollbars();
-    return false;
-}
-
 RenderMarquee* RenderLayer::marquee() const
 {
     if (m_scrollableArea)
@@ -409,37 +402,6 @@
         m_scrollableArea->updateLayerPositionsAfterDocumentScroll();
 }
 
-bool RenderLayer::hitTestOverflowControls(HitTestResult& result, const IntPoint& localPoint)
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->hitTestOverflowControls(result, localPoint);
-    return false;
-}
-
-void RenderLayer::paintOverflowControls(GraphicsContext& context, const IntPoint& point, const IntRect& damageRect, bool paintingOverlayControls)
-{
-    if (m_scrollableArea)
-        m_scrollableArea->paintOverflowControls(context, point, damageRect, paintingOverlayControls);
-}
-
-void RenderLayer::paintResizer(GraphicsContext& context, const LayoutPoint& point, const LayoutRect& damageRect)
-{
-    if (m_scrollableArea)
-        m_scrollableArea->paintResizer(context, point, damageRect);
-}
-
-void RenderLayer::paintScrollCorner(GraphicsContext& context, const IntPoint& point, const IntRect& damageRect)
-{
-    if (m_scrollableArea)
-        m_scrollableArea->paintScrollCorner(context, point, damageRect);
-}
-
-void RenderLayer::paintOverlayScrollbars(GraphicsContext& context, const LayoutRect& damageRect, OptionSet<PaintBehavior> behavior, RenderObject* subtreePaintRoot)
-{
-    if (m_scrollableArea)
-        m_scrollableArea->paintOverlayScrollbars(context, damageRect, behavior, subtreePaintRoot);
-}
-
 void RenderLayer::setPostLayoutScrollPosition(Optional<ScrollPosition> position)
 {
     if (m_scrollableArea)
@@ -459,34 +421,6 @@
     return ScrollPosition();
 }
 
-GraphicsLayer* RenderLayer::layerForHorizontalScrollbar() const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->layerForHorizontalScrollbar();
-    return nullptr;
-}
-
-GraphicsLayer* RenderLayer::layerForVerticalScrollbar() const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->layerForVerticalScrollbar();
-    return nullptr;
-}
-
-Scrollbar* RenderLayer::horizontalScrollbar() const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->horizontalScrollbar();
-    return nullptr;
-}
-
-Scrollbar* RenderLayer::verticalScrollbar() const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->verticalScrollbar();
-    return nullptr;
-}
-
 bool RenderLayer::scrollingMayRevealBackground() const
 {
     if (m_scrollableArea)

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2021-01-22 09:07:05 UTC (rev 271740)
@@ -162,27 +162,14 @@
     // Start of temporary glue code to help landing webkit.org/b/60305 (split RenderLayer into RenderLayer/RenderLayerScrollableArea)
     WEBCORE_EXPORT ScrollOffset scrollOffset() const;
     bool shouldPlaceBlockDirectionScrollbarOnLeft() const;
-    bool containsDirtyOverlayScrollbars() const;
     RenderMarquee* marquee() const;
     void updateLayerPositionsAfterDocumentScroll();
-    bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint);
-    void paintOverflowControls(GraphicsContext&, const IntPoint&, const IntRect& damageRect, bool paintingOverlayControls = false);
-    void paintScrollCorner(GraphicsContext&, const IntPoint&, const IntRect& damageRect);
-    void paintResizer(GraphicsContext&, const LayoutPoint&, const LayoutRect& damageRect);
-    void paintOverlayScrollbars(GraphicsContext&, const LayoutRect& damageRect, OptionSet<PaintBehavior>, RenderObject* subtreePaintRoot = nullptr);
     void setPostLayoutScrollPosition(Optional<ScrollPosition>);
     void panScrollFromPoint(const IntPoint&);
     ScrollPosition scrollPosition() const;
-    GraphicsLayer* layerForHorizontalScrollbar() const;
-    GraphicsLayer* layerForVerticalScrollbar() const;
-    Scrollbar* horizontalScrollbar() const;
-    Scrollbar* verticalScrollbar() const;
     bool scrollingMayRevealBackground() const;
     bool hasScrollableHorizontalOverflow() const;
     bool hasScrollableVerticalOverflow() const;
-    bool hasScrollbars() const { return horizontalScrollbar() || verticalScrollbar(); }
-    bool hasHorizontalScrollbar() const { return horizontalScrollbar(); }
-    bool hasVerticalScrollbar() const { return verticalScrollbar(); }
     int verticalScrollbarWidth(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
     int horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
     bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -2015,12 +2015,17 @@
 
 bool RenderLayerBacking::requiresHorizontalScrollbarLayer() const
 {
-    return requiresLayerForScrollbar(m_owningLayer.horizontalScrollbar());
+    if (auto* scrollableLayer = m_owningLayer.scrollableArea())
+        return requiresLayerForScrollbar(scrollableLayer->horizontalScrollbar());
+    return false;
+
 }
 
 bool RenderLayerBacking::requiresVerticalScrollbarLayer() const
 {
-    return requiresLayerForScrollbar(m_owningLayer.verticalScrollbar());
+    if (auto* scrollableLayer = m_owningLayer.scrollableArea())
+        return requiresLayerForScrollbar(scrollableLayer->verticalScrollbar());
+    return false;
 }
 
 bool RenderLayerBacking::requiresScrollCornerLayer() const
@@ -2032,8 +2037,12 @@
     if (cornerRect.isEmpty())
         return false;
 
-    auto verticalScrollbar = m_owningLayer.verticalScrollbar();
-    auto scrollbar = verticalScrollbar ? verticalScrollbar : m_owningLayer.horizontalScrollbar();
+    auto* scrollableLayer = m_owningLayer.scrollableArea();
+    if (!scrollableLayer)
+        return false;
+
+    auto verticalScrollbar = scrollableLayer->verticalScrollbar();
+    auto scrollbar = verticalScrollbar ? verticalScrollbar : scrollableLayer->horizontalScrollbar();
     return requiresLayerForScrollbar(scrollbar);
 }
 
@@ -2082,9 +2091,9 @@
 
 void RenderLayerBacking::positionOverflowControlsLayers()
 {
-    if (!m_owningLayer.hasScrollbars())
+    auto* scrollableLayer = m_owningLayer.scrollableArea();
+    if (!scrollableLayer || !scrollableLayer->hasScrollbars())
         return;
-
     // FIXME: Should do device-pixel snapping.
     auto box = renderBox();
     auto borderBox = snappedIntRect(box->borderBoxRect());
@@ -2108,12 +2117,12 @@
 
     if (auto* layer = layerForHorizontalScrollbar()) {
         positionScrollbarLayer(*layer, rects.horizontalScrollbar, paddingBoxInset);
-        layer->setDrawsContent(m_owningLayer.horizontalScrollbar() && !layer->usesContentsLayer());
+        layer->setDrawsContent(scrollableLayer->horizontalScrollbar() && !layer->usesContentsLayer());
     }
 
     if (auto* layer = layerForVerticalScrollbar()) {
         positionScrollbarLayer(*layer, rects.verticalScrollbar, paddingBoxInset);
-        layer->setDrawsContent(m_owningLayer.verticalScrollbar() && !layer->usesContentsLayer());
+        layer->setDrawsContent(scrollableLayer->verticalScrollbar() && !layer->usesContentsLayer());
     }
 
     if (auto* layer = layerForScrollCorner()) {
@@ -3138,7 +3147,8 @@
         if (&layer == &m_owningLayer) {
             layer.paintLayerContents(context, paintingInfo, paintFlags);
 
-            if (layer.containsDirtyOverlayScrollbars() && !eventRegionContext)
+            auto* scrollableLayer = layer.scrollableArea();
+            if (scrollableLayer && scrollableLayer->containsDirtyOverlayScrollbars() && !eventRegionContext)
                 layer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerFlag::PaintingOverlayScrollbars);
         } else
             layer.paintLayerWithEffects(context, paintingInfo, paintFlags);
@@ -3424,17 +3434,26 @@
             paintDebugOverlays(graphicsLayer, context);
 
     } else if (graphicsLayer == layerForHorizontalScrollbar()) {
-        paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect);
+        auto* scrollableLayer = m_owningLayer.scrollableArea();
+        ASSERT(scrollableLayer);
+
+        paintScrollbar(scrollableLayer->horizontalScrollbar(), context, dirtyRect);
     } else if (graphicsLayer == layerForVerticalScrollbar()) {
-        paintScrollbar(m_owningLayer.verticalScrollbar(), context, dirtyRect);
+        auto* scrollableLayer = m_owningLayer.scrollableArea();
+        ASSERT(scrollableLayer);
+
+        paintScrollbar(scrollableLayer->verticalScrollbar(), context, dirtyRect);
     } else if (graphicsLayer == layerForScrollCorner()) {
+        auto* scrollableLayer = m_owningLayer.scrollableArea();
+        ASSERT(scrollableLayer);
+
         auto cornerRect = m_owningLayer.overflowControlsRects().scrollCornerOrResizerRect();
         GraphicsContextStateSaver stateSaver(context);
         context.translate(-cornerRect.location());
         LayoutRect transformedClip = LayoutRect(clip);
         transformedClip.moveBy(cornerRect.location());
-        m_owningLayer.paintScrollCorner(context, IntPoint(), snappedIntRect(transformedClip));
-        m_owningLayer.paintResizer(context, IntPoint(), transformedClip);
+        scrollableLayer->paintScrollCorner(context, IntPoint(), snappedIntRect(transformedClip));
+        scrollableLayer->paintResizer(context, IntPoint(), transformedClip);
     }
 #ifndef NDEBUG
     renderer().page().setIsPainting(false);

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -4669,6 +4669,9 @@
 
 void RenderLayerCompositor::updateScrollingNodeLayers(ScrollingNodeID nodeID, RenderLayer& layer, ScrollingCoordinator& scrollingCoordinator)
 {
+    auto* scrollableLayer = layer.scrollableArea();
+    ASSERT(scrollableLayer);
+
     if (layer.isRenderViewLayer()) {
         FrameView& frameView = m_renderView.frameView();
         scrollingCoordinator.setNodeLayers(nodeID, { nullptr,
@@ -4680,7 +4683,7 @@
         scrollingCoordinator.setNodeLayers(nodeID, { backing.graphicsLayer(),
             backing.scrollContainerLayer(), backing.scrolledContentsLayer(),
             nullptr, nullptr, nullptr,
-            layer.layerForHorizontalScrollbar(), layer.layerForVerticalScrollbar() });
+            scrollableLayer->layerForHorizontalScrollbar(), scrollableLayer->layerForVerticalScrollbar() });
     }
 }
 

Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -49,6 +49,7 @@
 #include "RenderIterator.h"
 #include "RenderLayer.h"
 #include "RenderLayerBacking.h"
+#include "RenderLayerScrollableArea.h"
 #include "RenderLineBreak.h"
 #include "RenderListItem.h"
 #include "RenderListMarker.h"
@@ -639,9 +640,9 @@
             ts << " scrollHeight " << layer.scrollHeight();
 #if PLATFORM(MAC)
         ScrollbarTheme& scrollbarTheme = ScrollbarTheme::theme();
-        if (!scrollbarTheme.isMockTheme() && layer.hasVerticalScrollbar()) {
+        if (!scrollbarTheme.isMockTheme() && layer.scrollableArea() && layer.scrollableArea()->hasVerticalScrollbar()) {
             ScrollbarThemeMac& macTheme = *static_cast<ScrollbarThemeMac*>(&scrollbarTheme);
-            if (macTheme.isLayoutDirectionRTL(*layer.verticalScrollbar()))
+            if (macTheme.isLayoutDirectionRTL(*layer.scrollableArea()->verticalScrollbar()))
                 ts << " scrollbarHasRTLLayoutDirection";
         }
 #endif

Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (271739 => 271740)


--- trunk/Source/WebCore/rendering/RenderWidget.cpp	2021-01-22 08:52:37 UTC (rev 271739)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp	2021-01-22 09:07:05 UTC (rev 271740)
@@ -30,6 +30,7 @@
 #include "HitTestResult.h"
 #include "RenderLayer.h"
 #include "RenderLayerBacking.h"
+#include "RenderLayerScrollableArea.h"
 #include "RenderView.h"
 #include "SecurityOrigin.h"
 #include <wtf/IsoMallocInlines.h>
@@ -332,8 +333,10 @@
         paintInfo.context().fillRect(snappedIntRect(selectionRect()), selectionBackgroundColor());
     }
 
-    if (hasLayer() && layer()->canResize())
-        layer()->paintResizer(paintInfo.context(), roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
+    if (hasLayer() && layer()->canResize()) {
+        ASSERT(layer()->scrollableArea());
+        layer()->scrollableArea()->paintResizer(paintInfo.context(), roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
+    }
 }
 
 void RenderWidget::setOverlapTestResult(bool isOverlapped)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to