Changeset 240899 in webkit


Ignore:
Timestamp:
Feb 2, 2019, 12:05:22 PM (7 years ago)
Author:
Simon Fraser
Message:

Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity
https://bugs.webkit.org/show_bug.cgi?id=194194

Rubber-stampted by Antti Koivisto.

Our desired terminology is "scrollContainerLayer" for the outer, clipping layer
for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll.

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateDebugIndicators):
(WebCore::RenderLayerBacking::destroyGraphicsLayers):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::setLocationOfScrolledContents):
(WebCore::RenderLayerBacking::updateAfterDescendants):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::updateScrollingLayers):

  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r240898 r240899  
     12019-02-02  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity
     4        https://bugs.webkit.org/show_bug.cgi?id=194194
     5
     6        Rubber-stampted by Antti Koivisto.
     7
     8        Our desired terminology is "scrollContainerLayer" for the outer, clipping layer
     9        for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll.
     10
     11        * rendering/RenderLayerBacking.cpp:
     12        (WebCore::RenderLayerBacking::updateDebugIndicators):
     13        (WebCore::RenderLayerBacking::destroyGraphicsLayers):
     14        (WebCore::RenderLayerBacking::updateGeometry):
     15        (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
     16        (WebCore::RenderLayerBacking::updateAfterDescendants):
     17        (WebCore::RenderLayerBacking::updateInternalHierarchy):
     18        (WebCore::RenderLayerBacking::updateDrawsContent):
     19        (WebCore::RenderLayerBacking::updateScrollingLayers):
     20        * rendering/RenderLayerBacking.h:
     21        * rendering/RenderLayerCompositor.cpp:
     22        (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
     23        (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
     24        (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
     25        (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
     26        (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
     27        (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
     28
    1292019-02-02  Justin Fan  <justin_fan@apple.com>
    230
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r240897 r240899  
    392392        m_layerForScrollCorner->setShowDebugBorder(showBorder);
    393393
    394     if (m_scrollingLayer)
    395         m_scrollingLayer->setShowDebugBorder(showBorder);
     394    if (m_scrollContainerLayer)
     395        m_scrollContainerLayer->setShowDebugBorder(showBorder);
    396396
    397397    if (m_scrolledContentsLayer) {
     
    483483    GraphicsLayer::unparentAndClear(m_childContainmentLayer);
    484484    GraphicsLayer::unparentAndClear(m_childClippingMaskLayer);
    485     GraphicsLayer::unparentAndClear(m_scrollingLayer);
     485    GraphicsLayer::unparentAndClear(m_scrollContainerLayer);
    486486    GraphicsLayer::unparentAndClear(m_scrolledContentsLayer);
    487487    GraphicsLayer::unparentAndClear(m_graphicsLayer);
     
    10911091        clipLayer->setOffsetFromRenderer(toLayoutSize(clippingBox.location() - snappedClippingGraphicsLayer.m_snapDelta));
    10921092
    1093         if (m_childClippingMaskLayer && !m_scrollingLayer) {
     1093        if (m_childClippingMaskLayer && !m_scrollContainerLayer) {
    10941094            m_childClippingMaskLayer->setSize(clipLayer->size());
    10951095            m_childClippingMaskLayer->setPosition(FloatPoint());
     
    11821182    }
    11831183
    1184     if (m_scrollingLayer) {
     1184    if (m_scrollContainerLayer) {
    11851185        ASSERT(m_scrolledContentsLayer);
    11861186        auto& renderBox = downcast<RenderBox>(renderer());
     
    11891189
    11901190        // FIXME: need to do some pixel snapping here.
    1191         m_scrollingLayer->setPosition(FloatPoint(paddingBoxIncludingScrollbar.location() - compositedBounds().location()));
    1192         m_scrollingLayer->setSize(roundedIntSize(LayoutSize(renderBox.clientWidth(), renderBox.clientHeight())));
     1191        m_scrollContainerLayer->setPosition(FloatPoint(paddingBoxIncludingScrollbar.location() - compositedBounds().location()));
     1192        m_scrollContainerLayer->setSize(roundedIntSize(LayoutSize(renderBox.clientWidth(), renderBox.clientHeight())));
    11931193
    11941194        updateScrollOffset(scrollOffset);
     
    11971197#endif
    11981198
    1199         FloatSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer();
    1200         m_scrollingLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location()));
     1199        FloatSize oldScrollingLayerOffset = m_scrollContainerLayer->offsetFromRenderer();
     1200        m_scrollContainerLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location()));
    12011201
    12021202        if (m_childClippingMaskLayer) {
    1203             m_childClippingMaskLayer->setPosition(m_scrollingLayer->position());
    1204             m_childClippingMaskLayer->setSize(m_scrollingLayer->size());
     1203            m_childClippingMaskLayer->setPosition(m_scrollContainerLayer->position());
     1204            m_childClippingMaskLayer->setSize(m_scrollContainerLayer->size());
    12051205            m_childClippingMaskLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location()));
    12061206        }
    12071207
    1208         bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer();
     1208        bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollContainerLayer->offsetFromRenderer();
    12091209
    12101210        IntSize scrollSize(m_owningLayer.scrollWidth(), m_owningLayer.scrollHeight());
     
    12391239#if PLATFORM(IOS_FAMILY)
    12401240    if (setOrSync == ScrollingLayerPositionAction::Sync)
    1241         m_scrollingLayer->syncBoundsOrigin(scrollOffset);
     1241        m_scrollContainerLayer->syncBoundsOrigin(scrollOffset);
    12421242    else
    1243         m_scrollingLayer->setBoundsOrigin(scrollOffset);
     1243        m_scrollContainerLayer->setBoundsOrigin(scrollOffset);
    12441244#else
    12451245    if (setOrSync == ScrollingLayerPositionAction::Sync)
     
    12791279
    12801280    m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || hasVisibleNonCompositedDescendants());
    1281     if (m_scrollingLayer) {
    1282         m_scrollingLayer->setContentsVisible(renderer().style().visibility() == Visibility::Visible);
    1283         m_scrollingLayer->setUserInteractionEnabled(renderer().style().pointerEvents() != PointerEvents::None);
     1281    if (m_scrollContainerLayer) {
     1282        m_scrollContainerLayer->setContentsVisible(renderer().style().visibility() == Visibility::Visible);
     1283        m_scrollContainerLayer->setUserInteractionEnabled(renderer().style().pointerEvents() != PointerEvents::None);
    12841284    }
    12851285}
     
    13481348        m_graphicsLayer->addChild(*m_childContainmentLayer);
    13491349
    1350     if (m_scrollingLayer) {
     1350    if (m_scrollContainerLayer) {
    13511351        auto* superlayer = m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsLayer.get();
    1352         superlayer->addChild(*m_scrollingLayer);
     1352        superlayer->addChild(*m_scrollContainerLayer);
    13531353    }
    13541354
     
    13911391void RenderLayerBacking::updateDrawsContent(PaintedContentsInfo& contentsInfo)
    13921392{
    1393     if (m_scrollingLayer) {
     1393    if (m_scrollContainerLayer) {
    13941394        // We don't have to consider overflow controls, because we know that the scrollbars are drawn elsewhere.
    13951395        // m_graphicsLayer only needs backing store if the non-scrolling parts (background, outlines, borders, shadows etc) need to paint.
    1396         // m_scrollingLayer never has backing store.
     1396        // m_scrollContainerLayer never has backing store.
    13971397        // m_scrolledContentsLayer only needs backing store if the scrolled contents need to paint.
    13981398        bool hasNonScrollingPaintedContent = m_owningLayer.hasVisibleContent() && m_owningLayer.hasVisibleBoxDecorationsOrBackground();
     
    17391739bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers)
    17401740{
    1741     if (needsScrollingLayers == !!m_scrollingLayer)
    1742         return false;
    1743 
    1744     if (!m_scrollingLayer) {
     1741    if (needsScrollingLayers == !!m_scrollContainerLayer)
     1742        return false;
     1743
     1744    if (!m_scrollContainerLayer) {
    17451745        // Outer layer which corresponds with the scroll view.
    1746         m_scrollingLayer = createGraphicsLayer("scrolling container", GraphicsLayer::Type::Scrolling);
    1747         m_scrollingLayer->setDrawsContent(false);
    1748         m_scrollingLayer->setMasksToBounds(true);
     1746        m_scrollContainerLayer = createGraphicsLayer("scrolling container", GraphicsLayer::Type::Scrolling);
     1747        m_scrollContainerLayer->setDrawsContent(false);
     1748        m_scrollContainerLayer->setMasksToBounds(true);
    17491749
    17501750        // Inner layer which renders the content that scrolls.
     
    17571757            paintPhase |= GraphicsLayerPaintForeground;
    17581758        m_scrolledContentsLayer->setPaintingPhase(paintPhase);
    1759         m_scrollingLayer->addChild(*m_scrolledContentsLayer);
     1759        m_scrollContainerLayer->addChild(*m_scrolledContentsLayer);
    17601760    } else {
    17611761        compositor().willRemoveScrollingLayerWithBacking(m_owningLayer, *this);
    17621762
    1763         willDestroyLayer(m_scrollingLayer.get());
     1763        willDestroyLayer(m_scrollContainerLayer.get());
    17641764        willDestroyLayer(m_scrolledContentsLayer.get());
    17651765       
    1766         GraphicsLayer::unparentAndClear(m_scrollingLayer);
     1766        GraphicsLayer::unparentAndClear(m_scrollContainerLayer);
    17671767        GraphicsLayer::unparentAndClear(m_scrolledContentsLayer);
    17681768    }
     
    17711771    m_graphicsLayer->setNeedsDisplay(); // Because painting phases changed.
    17721772
    1773     if (m_scrollingLayer)
     1773    if (m_scrollContainerLayer)
    17741774        compositor().didAddScrollingLayer(m_owningLayer);
    17751775   
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r240897 r240899  
    105105    void setRequiresBackgroundLayer(bool);
    106106
    107     bool hasScrollingLayer() const { return m_scrollingLayer != nullptr; }
    108     GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); }
    109     GraphicsLayer* scrollingContentsLayer() const { return m_scrolledContentsLayer.get(); }
     107    bool hasScrollingLayer() const { return m_scrollContainerLayer != nullptr; }
     108    GraphicsLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); }
     109    GraphicsLayer* scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); }
    110110
    111111    OptionSet<ScrollCoordinationRole> coordinatedScrollingRoles() const;
     
    386386    RefPtr<GraphicsLayer> m_layerForScrollCorner;
    387387
    388     RefPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using composited scrolling.
     388    RefPtr<GraphicsLayer> m_scrollContainerLayer; // Only used if the layer is using composited scrolling.
    389389    RefPtr<GraphicsLayer> m_scrolledContentsLayer; // Only used if the layer is using composited scrolling.
    390390
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r240861 r240899  
    554554            nodeLayers = { nullptr, nullptr, m_scrollLayer.get(), fixedRootBackgroundLayer(), clipLayer(), m_rootContentsLayer.get() };
    555555        } else
    556             nodeLayers = { layer.backing()->graphicsLayer(), backing->scrollingLayer(), backing->scrollingContentsLayer() };
     556            nodeLayers = { layer.backing()->graphicsLayer(), backing->scrollContainerLayer(), backing->scrolledContentsLayer() };
    557557
    558558        scrollingCoordinator->setNodeLayers(nodeID, nodeLayers);
     
    40284028       
    40294029        if (changes & ScrollingNodeChangeFlags::Layer)
    4030             scrollingCoordinator->setNodeLayers(newNodeID, { layer.backing()->graphicsLayer(), layer.backing()->scrollingLayer(), layer.backing()->scrollingContentsLayer() });
     4030            scrollingCoordinator->setNodeLayers(newNodeID, { layer.backing()->graphicsLayer(), layer.backing()->scrollContainerLayer(), layer.backing()->scrolledContentsLayer() });
    40314031
    40324032        if (changes & ScrollingNodeChangeFlags::LayerGeometry && treeState.parentNodeID) {
     
    42364236            if (compositor.isAsyncScrollableStickyLayer(*layer, &enclosingTouchScrollableLayer) && enclosingTouchScrollableLayer) {
    42374237                ASSERT(enclosingTouchScrollableLayer->isComposited());
    4238                 stickyContainerMap.add(layer->backing()->graphicsLayer()->platformLayer(), enclosingTouchScrollableLayer->backing()->scrollingLayer()->platformLayer());
     4238                // what
     4239                stickyContainerMap.add(layer->backing()->graphicsLayer()->platformLayer(), enclosingTouchScrollableLayer->backing()->scrollContainerLayer()->platformLayer());
    42394240            }
    42404241        } else if (layer->renderer().isFixedPositioned())
     
    42744275    bool allowHorizontalScrollbar = !scrollbarHasDisplayNone(layer.horizontalScrollbar());
    42754276    bool allowVerticalScrollbar = !scrollbarHasDisplayNone(layer.verticalScrollbar());
    4276     m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scrollingLayer()->platformLayer(), backing->scrollingContentsLayer()->platformLayer(),
     4277    m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer(),
    42774278        layer.scrollableContentsSize(), allowHorizontalScrollbar, allowVerticalScrollbar);
    42784279}
     
    42974298        auto* backing = layer->backing();
    42984299        ASSERT(backing);
    4299         m_chromeClient.removeScrollingLayer(layer->renderer().element(), backing->scrollingLayer()->platformLayer(), backing->scrollingContentsLayer()->platformLayer());
     4300        m_chromeClient.removeScrollingLayer(layer->renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer());
    43004301    }
    43014302}
     
    43114312    m_scrollingLayersNeedingUpdate.remove(&layer);
    43124313    if (m_scrollingLayers.remove(&layer)) {
    4313         auto* scrollingLayer = backing.scrollingLayer()->platformLayer();
    4314         auto* contentsLayer = backing.scrollingContentsLayer()->platformLayer();
    4315         m_chromeClient.removeScrollingLayer(layer.renderer().element(), scrollingLayer, contentsLayer);
     4314        auto* scrollContainerLayer = backing.scrollContainerLayer()->platformLayer();
     4315        auto* scrolledContentsLayer = backing.scrolledContentsLayer()->platformLayer();
     4316        m_chromeClient.removeScrollingLayer(layer.renderer().element(), scrollContainerLayer, scrolledContentsLayer);
    43164317    }
    43174318}
Note: See TracChangeset for help on using the changeset viewer.