WebKit Bugzilla
Attachment 360963 Details for
Bug 194184
: Async overflow scroll is jumpy on macOS if the main thread is busy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194184-20190201221019.patch (text/plain), 25.28 KB, created by
Simon Fraser (smfr)
on 2019-02-01 22:10:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-02-01 22:10:20 PST
Size:
25.28 KB
patch
obsolete
>Subversion Revision: 240891 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2c442482db30b4e5214a6d96e5e962ca86c76103..f1239edea2560d95448c0a42cdd918e007583886 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,54 @@ >+2019-02-01 Simon Fraser <simon.fraser@apple.com> >+ >+ Async overflow scroll is jumpy if the main thread is busy >+ https://bugs.webkit.org/show_bug.cgi?id=194184 >+ <rdar://problem/47758655> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change extends to macOS some existing overflow-scroll functionality for iOS. >+ When an async scroll is in process in the scroll thread (or UI process), we periodically >+ message back to the web process main thread with scroll position updates. These >+ can trigger post-scroll compositing updates, but we need to ensure that this update >+ doesn't clobber the scroll position of the native layers, which would trigger >+ stutters. >+ >+ To do this we have the notion of a scroll position "sync" (ScrollingLayerPositionAction::Sync) which >+ pokes the new value into the GraphicsLayer (hence making visible rect computations work), but doesn't >+ propagate it to the platform layer. This patch wires up syncs for macOS during async overflow scrolling, >+ coming out of AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(). >+ >+ In RenderLayerBacking, m_scrollingContentsLayer is renamed to m_scrolledContentsLayer, and I added >+ updateScrollOffset() and setLocationOfScrolledContents() to handle the set vs. sync, and to keep >+ the iOS vs macOS differences in one function. This allows for more code sharing in RenderLayerBacking::updateGeometry(). >+ >+ There's a confusing bit in the m_childClippingMaskLayer code (trac.webkit.org/178029) where the setOffsetFromRenderer() >+ just looks wrong; it should match m_scrollingLayer. This code is never hit for Cocoa, which never has m_childClippingMaskLayer. >+ >+ * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: >+ (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Logging >+ (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Logging >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::RenderLayer): >+ (WebCore::RenderLayer::scrollTo): >+ * rendering/RenderLayer.h: Rename m_requiresScrollBoundsOriginUpdate to m_requiresScrollPositionReconciliation >+ and make it available on all platforms. Just reorder m_adjustForIOSCaretWhenScrolling to reduce #ifdef nesting confusion. >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::updateDebugIndicators): >+ (WebCore::RenderLayerBacking::destroyGraphicsLayers): >+ (WebCore::RenderLayerBacking::updateGeometry): >+ (WebCore::RenderLayerBacking::setLocationOfScrolledContents): >+ (WebCore::RenderLayerBacking::updateScrollOffset): >+ (WebCore::RenderLayerBacking::updateDrawsContent): >+ (WebCore::RenderLayerBacking::updateScrollingLayers): >+ (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const): >+ (WebCore::RenderLayerBacking::parentForSublayers const): >+ (WebCore::RenderLayerBacking::setContentsNeedDisplay): >+ (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): >+ (WebCore::RenderLayerBacking::paintContents): >+ (WebCore::RenderLayerBacking::backingStoreMemoryEstimate const): >+ * rendering/RenderLayerBacking.h: >+ > 2019-02-01 Simon Fraser <simon.fraser@apple.com> > > Remove the unused layerForScrolling() >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >index 8b0d7ec7d1a26296a88467bd89da7912f3f929ae..b99afd7a935869a6984fb4ec4e514ede4357ac0e 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >@@ -107,7 +107,7 @@ FloatPoint ScrollingTreeOverflowScrollingNodeMac::scrollPosition() const > > void ScrollingTreeOverflowScrollingNodeMac::setScrollPosition(const FloatPoint& scrollPosition) > { >- LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeOverflowScrollingNodeMac::setScrollPosition " << scrollPosition << " scrollPosition(): " << this->scrollPosition() << " min: " << minimumScrollPosition() << " max: " << maximumScrollPosition()); >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeOverflowScrollingNodeMac::setScrollPosition " << scrollPosition << " from " << this->scrollPosition() << " (min: " << minimumScrollPosition() << " max: " << maximumScrollPosition() << ")"); > > // Scroll deltas can be non-integral with some input devices, so scrollPosition may not be integral. > // FIXME: when we support half-pixel scroll positions on Retina displays, this will need to round to half pixels. >@@ -124,6 +124,8 @@ void ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeC > > void ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect& fixedPositionRect) > { >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition " << scrollPosition); >+ > scrolledContentsLayer().position = -scrollPosition; > if (!m_children) > return; >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index 0a7080a37d1eb9acb2a36ed4c201e49dad421dc8..cc1ce5d3fa78a6b8230611eb85cc565d99e132f2 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -295,16 +295,14 @@ RenderLayer::RenderLayer(RenderLayerModelObject& rendererLayerModelObject) > , m_has3DTransformedAncestor(false) > , m_indirectCompositingReason(static_cast<unsigned>(IndirectCompositingReason::None)) > , m_viewportConstrainedNotCompositedReason(NoNotCompositedReason) >-#if PLATFORM(IOS_FAMILY) >- , m_adjustForIOSCaretWhenScrolling(false) >-#endif > #if PLATFORM(IOS_FAMILY) > #if ENABLE(IOS_TOUCH_EVENTS) > , m_registeredAsTouchEventListenerForScrolling(false) > #endif >- , m_inUserScroll(false) >- , m_requiresScrollBoundsOriginUpdate(false) >+ , m_adjustForIOSCaretWhenScrolling(false) > #endif >+ , m_inUserScroll(false) >+ , m_requiresScrollPositionReconciliation(false) > , m_containsDirtyOverlayScrollbars(false) > , m_updatingMarqueePosition(false) > #if !ASSERT_DISABLED >@@ -2347,7 +2345,7 @@ void RenderLayer::scrollTo(const ScrollPosition& position) > if (!box) > return; > >- LOG_WITH_STREAM(Scrolling, stream << "RenderLayer::scrollTo " << position); >+ LOG_WITH_STREAM(Scrolling, stream << "RenderLayer::scrollTo " << position << " from " << m_scrollPosition << " (in user scroll " << isInUserScroll() << ")"); > > ScrollPosition newPosition = position; > if (!box->isHTMLMarquee()) { >@@ -2374,12 +2372,12 @@ void RenderLayer::scrollTo(const ScrollPosition& position) > } > > if (m_scrollPosition == newPosition) { >-#if PLATFORM(IOS_FAMILY) >- if (m_requiresScrollBoundsOriginUpdate) { >+ // FIXME: Nothing guarantees we get a scrollTo() with an unchanged position at the end of a user gesture. >+ // The ScrollingCoordinator probably needs to message the main thread when a gesture ends. >+ if (requiresScrollPositionReconciliation()) { > setNeedsCompositingGeometryUpdate(); > updateCompositingLayersAfterScroll(); > } >-#endif > return; > } > >diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h >index ff911b5c2654063e7bad8fbe6d817d2d7eee7ecb..cbaf79d983a48135ffbf3d3fba2cc727b31a0dca 100644 >--- a/Source/WebCore/rendering/RenderLayer.h >+++ b/Source/WebCore/rendering/RenderLayer.h >@@ -449,6 +449,12 @@ public: > void updateSnapOffsets() override; > #endif > >+ void setIsUserScroll(bool isUserScroll) override { m_inUserScroll = isUserScroll; } >+ bool isInUserScroll() const { return m_inUserScroll; } >+ >+ bool requiresScrollPositionReconciliation() const { return m_requiresScrollPositionReconciliation; } >+ void setRequiresScrollPositionReconciliation(bool requiresReconciliation = true) { m_requiresScrollPositionReconciliation = requiresReconciliation; } >+ > #if PLATFORM(IOS_FAMILY) > #if ENABLE(IOS_TOUCH_EVENTS) > bool handleTouchEvent(const PlatformTouchEvent&) override; >@@ -457,12 +463,6 @@ public: > void didStartScroll() override; > void didEndScroll() override; > void didUpdateScroll() override; >- void setIsUserScroll(bool isUserScroll) override { m_inUserScroll = isUserScroll; } >- >- bool isInUserScroll() const { return m_inUserScroll; } >- >- bool requiresScrollBoundsOriginUpdate() const { return m_requiresScrollBoundsOriginUpdate; } >- void setRequiresScrollBoundsOriginUpdate(bool requiresUpdate = true) { m_requiresScrollBoundsOriginUpdate = requiresUpdate; } > #endif > > // Returns true when the layer could do touch scrolling, but doesn't look at whether there is actually scrollable overflow. >@@ -1192,14 +1192,14 @@ private: > unsigned m_viewportConstrainedNotCompositedReason : 2; > > #if PLATFORM(IOS_FAMILY) >- bool m_adjustForIOSCaretWhenScrolling : 1; > #if ENABLE(IOS_TOUCH_EVENTS) > bool m_registeredAsTouchEventListenerForScrolling : 1; > #endif >- bool m_inUserScroll : 1; >- bool m_requiresScrollBoundsOriginUpdate : 1; >+ bool m_adjustForIOSCaretWhenScrolling : 1; > #endif > >+ bool m_inUserScroll : 1; >+ bool m_requiresScrollPositionReconciliation : 1; > bool m_containsDirtyOverlayScrollbars : 1; > bool m_updatingMarqueePosition : 1; > >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index 6b906abe66202a0a53989bd546e0b6230466e64a..354249e670ccbd9dff7ff337432e4cb428f55456 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -394,9 +394,9 @@ void RenderLayerBacking::updateDebugIndicators(bool showBorder, bool showRepaint > if (m_scrollingLayer) > m_scrollingLayer->setShowDebugBorder(showBorder); > >- if (m_scrollingContentsLayer) { >- m_scrollingContentsLayer->setShowDebugBorder(showBorder); >- m_scrollingContentsLayer->setShowRepaintCounter(showRepaintCounter); >+ if (m_scrolledContentsLayer) { >+ m_scrolledContentsLayer->setShowDebugBorder(showBorder); >+ m_scrolledContentsLayer->setShowRepaintCounter(showRepaintCounter); > } > } > >@@ -483,7 +483,7 @@ void RenderLayerBacking::destroyGraphicsLayers() > GraphicsLayer::unparentAndClear(m_childContainmentLayer); > GraphicsLayer::unparentAndClear(m_childClippingMaskLayer); > GraphicsLayer::unparentAndClear(m_scrollingLayer); >- GraphicsLayer::unparentAndClear(m_scrollingContentsLayer); >+ GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); > GraphicsLayer::unparentAndClear(m_graphicsLayer); > } > >@@ -1182,43 +1182,19 @@ void RenderLayerBacking::updateGeometry() > } > > if (m_scrollingLayer) { >- ASSERT(m_scrollingContentsLayer); >+ ASSERT(m_scrolledContentsLayer); > auto& renderBox = downcast<RenderBox>(renderer()); > LayoutRect paddingBoxIncludingScrollbar = renderBox.paddingBoxRectIncludingScrollbar(); > ScrollOffset scrollOffset = m_owningLayer.scrollOffset(); > > // FIXME: need to do some pixel snapping here. > m_scrollingLayer->setPosition(FloatPoint(paddingBoxIncludingScrollbar.location() - compositedBounds().location())); >- > m_scrollingLayer->setSize(roundedIntSize(LayoutSize(renderBox.clientWidth(), renderBox.clientHeight()))); >-#if PLATFORM(IOS_FAMILY) >- FloatSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer(); >- m_scrollingLayer->setOffsetFromRenderer(FloatPoint() - paddingBoxIncludingScrollbar.location()); >- bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer(); >- >- if (m_owningLayer.isInUserScroll()) { >- // If scrolling is happening externally, we don't want to touch the layer bounds origin here because that will cause jitter. >- m_scrollingLayer->syncBoundsOrigin(scrollOffset); >- m_owningLayer.setRequiresScrollBoundsOriginUpdate(true); >- } else { >- // Note that we implement the contents offset via the bounds origin on this layer, rather than a position on the sublayer. >- m_scrollingLayer->setBoundsOrigin(scrollOffset); >- m_owningLayer.setRequiresScrollBoundsOriginUpdate(false); >- } >- >- IntSize scrollSize(m_owningLayer.scrollWidth(), m_owningLayer.scrollHeight()); >- >- m_scrollingContentsLayer->setPosition(FloatPoint()); >- >- if (scrollSize != m_scrollingContentsLayer->size() || paddingBoxOffsetChanged) >- m_scrollingContentsLayer->setNeedsDisplay(); > >- m_scrollingContentsLayer->setSize(scrollSize); >- // Scrolling the content layer does not need to trigger a repaint. The offset will be compensated away during painting. >- m_scrollingContentsLayer->setScrollOffset(scrollOffset, GraphicsLayer::DontSetNeedsDisplay); >- m_scrollingContentsLayer->setOffsetFromRenderer(toLayoutSize(paddingBoxIncludingScrollbar.location()), GraphicsLayer::DontSetNeedsDisplay); >-#else >- m_scrollingContentsLayer->setPosition(-scrollOffset); >+ updateScrollOffset(scrollOffset); >+#if PLATFORM(IOS_FAMILY) >+ m_scrolledContentsLayer->setPosition({ }); // FIXME: necessary? >+#endif > > FloatSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer(); > m_scrollingLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location())); >@@ -1226,23 +1202,22 @@ void RenderLayerBacking::updateGeometry() > if (m_childClippingMaskLayer) { > m_childClippingMaskLayer->setPosition(m_scrollingLayer->position()); > m_childClippingMaskLayer->setSize(m_scrollingLayer->size()); >- m_childClippingMaskLayer->setOffsetFromRenderer(toFloatSize(paddingBoxIncludingScrollbar.location())); >+ m_childClippingMaskLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location())); > } > > bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer(); > > IntSize scrollSize(m_owningLayer.scrollWidth(), m_owningLayer.scrollHeight()); >- if (scrollSize != m_scrollingContentsLayer->size() || paddingBoxOffsetChanged) >- m_scrollingContentsLayer->setNeedsDisplay(); >+ if (scrollSize != m_scrolledContentsLayer->size() || paddingBoxOffsetChanged) >+ m_scrolledContentsLayer->setNeedsDisplay(); > >- m_scrollingContentsLayer->setSize(scrollSize); >- m_scrollingContentsLayer->setScrollOffset(scrollOffset, GraphicsLayer::DontSetNeedsDisplay); >- m_scrollingContentsLayer->setOffsetFromRenderer(toLayoutSize(paddingBoxIncludingScrollbar.location()), GraphicsLayer::DontSetNeedsDisplay); >-#endif >+ m_scrolledContentsLayer->setSize(scrollSize); >+ m_scrolledContentsLayer->setScrollOffset(scrollOffset, GraphicsLayer::DontSetNeedsDisplay); >+ m_scrolledContentsLayer->setOffsetFromRenderer(toLayoutSize(paddingBoxIncludingScrollbar.location()), GraphicsLayer::DontSetNeedsDisplay); > > if (m_foregroundLayer) { >- m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); >- m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->offsetFromRenderer() - toLayoutSize(m_scrollingContentsLayer->scrollOffset())); >+ m_foregroundLayer->setSize(m_scrolledContentsLayer->size()); >+ m_foregroundLayer->setOffsetFromRenderer(m_scrolledContentsLayer->offsetFromRenderer() - toLayoutSize(m_scrolledContentsLayer->scrollOffset())); > } > } > >@@ -1259,6 +1234,34 @@ void RenderLayerBacking::updateGeometry() > setContentsNeedDisplay(); > } > >+void RenderLayerBacking::setLocationOfScrolledContents(ScrollOffset scrollOffset, ScrollingLayerPositionAction setOrSync) >+{ >+#if PLATFORM(IOS_FAMILY) >+ if (setOrSync == ScrollingLayerPositionAction::Sync) >+ m_scrollingLayer->syncBoundsOrigin(scrollOffset); >+ else >+ m_scrollingLayer->setBoundsOrigin(scrollOffset); >+#else >+ if (setOrSync == ScrollingLayerPositionAction::Sync) >+ m_scrolledContentsLayer->syncPosition(-scrollOffset); >+ else >+ m_scrolledContentsLayer->setPosition(-scrollOffset); >+#endif >+} >+ >+void RenderLayerBacking::updateScrollOffset(ScrollOffset scrollOffset) >+{ >+ if (m_owningLayer.isInUserScroll()) { >+ // If scrolling is happening externally, we don't want to touch the layer bounds origin here because that will cause jitter. >+ setLocationOfScrolledContents(scrollOffset, ScrollingLayerPositionAction::Sync); >+ m_owningLayer.setRequiresScrollPositionReconciliation(true); >+ } else { >+ // Note that we implement the contents offset via the bounds origin on this layer, rather than a position on the sublayer. >+ setLocationOfScrolledContents(scrollOffset, ScrollingLayerPositionAction::Set); >+ m_owningLayer.setRequiresScrollPositionReconciliation(false); >+ } >+} >+ > void RenderLayerBacking::updateAfterDescendants() > { > // FIXME: this potentially duplicates work we did in updateConfiguration(). >@@ -1391,12 +1394,12 @@ void RenderLayerBacking::updateDrawsContent(PaintedContentsInfo& contentsInfo) > // We don't have to consider overflow controls, because we know that the scrollbars are drawn elsewhere. > // m_graphicsLayer only needs backing store if the non-scrolling parts (background, outlines, borders, shadows etc) need to paint. > // m_scrollingLayer never has backing store. >- // m_scrollingContentsLayer only needs backing store if the scrolled contents need to paint. >+ // m_scrolledContentsLayer only needs backing store if the scrolled contents need to paint. > bool hasNonScrollingPaintedContent = m_owningLayer.hasVisibleContent() && m_owningLayer.hasVisibleBoxDecorationsOrBackground(); > m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent); > > bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer().hasBackground() || contentsInfo.paintsContent()); >- m_scrollingContentsLayer->setDrawsContent(hasScrollingPaintedContent); >+ m_scrolledContentsLayer->setDrawsContent(hasScrollingPaintedContent); > return; > } > >@@ -1745,23 +1748,23 @@ bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers) > m_scrollingLayer->setMasksToBounds(true); > > // Inner layer which renders the content that scrolls. >- m_scrollingContentsLayer = createGraphicsLayer("scrolled contents"); >- m_scrollingContentsLayer->setDrawsContent(true); >- m_scrollingContentsLayer->setAnchorPoint({ }); >+ m_scrolledContentsLayer = createGraphicsLayer("scrolled contents"); >+ m_scrolledContentsLayer->setDrawsContent(true); >+ m_scrolledContentsLayer->setAnchorPoint({ }); > > GraphicsLayerPaintingPhase paintPhase = GraphicsLayerPaintOverflowContents | GraphicsLayerPaintCompositedScroll; > if (!m_foregroundLayer) > paintPhase |= GraphicsLayerPaintForeground; >- m_scrollingContentsLayer->setPaintingPhase(paintPhase); >- m_scrollingLayer->addChild(*m_scrollingContentsLayer); >+ m_scrolledContentsLayer->setPaintingPhase(paintPhase); >+ m_scrollingLayer->addChild(*m_scrolledContentsLayer); > } else { > compositor().willRemoveScrollingLayerWithBacking(m_owningLayer, *this); > > willDestroyLayer(m_scrollingLayer.get()); >- willDestroyLayer(m_scrollingContentsLayer.get()); >+ willDestroyLayer(m_scrolledContentsLayer.get()); > > GraphicsLayer::unparentAndClear(m_scrollingLayer); >- GraphicsLayer::unparentAndClear(m_scrollingContentsLayer); >+ GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); > } > > m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); >@@ -1831,7 +1834,7 @@ GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() co > if (!m_foregroundLayer) > phase |= GraphicsLayerPaintForeground; > >- if (m_scrollingContentsLayer) { >+ if (m_scrolledContentsLayer) { > phase &= ~GraphicsLayerPaintForeground; > phase |= GraphicsLayerPaintCompositedScroll; > } >@@ -2394,8 +2397,8 @@ FloatRect RenderLayerBacking::backgroundBoxForSimpleContainerPainting() const > > GraphicsLayer* RenderLayerBacking::parentForSublayers() const > { >- if (m_scrollingContentsLayer) >- return m_scrollingContentsLayer.get(); >+ if (m_scrolledContentsLayer) >+ return m_scrolledContentsLayer.get(); > > return m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsLayer.get(); > } >@@ -2480,8 +2483,8 @@ void RenderLayerBacking::setContentsNeedDisplay(GraphicsLayer::ShouldClipToLayer > if (m_childClippingMaskLayer && m_childClippingMaskLayer->drawsContent()) > m_childClippingMaskLayer->setNeedsDisplay(); > >- if (m_scrollingContentsLayer && m_scrollingContentsLayer->drawsContent()) >- m_scrollingContentsLayer->setNeedsDisplay(); >+ if (m_scrolledContentsLayer && m_scrolledContentsLayer->drawsContent()) >+ m_scrolledContentsLayer->setNeedsDisplay(); > } > > // r is in the coordinate space of the layer's render object >@@ -2529,15 +2532,15 @@ void RenderLayerBacking::setContentsNeedDisplayInRect(const LayoutRect& r, Graph > m_childClippingMaskLayer->setNeedsDisplayInRect(layerDirtyRect); > } > >- if (m_scrollingContentsLayer && m_scrollingContentsLayer->drawsContent()) { >+ if (m_scrolledContentsLayer && m_scrolledContentsLayer->drawsContent()) { > FloatRect layerDirtyRect = pixelSnappedRectForPainting; >- layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer() + toLayoutSize(m_scrollingContentsLayer->scrollOffset()) - m_subpixelOffsetFromRenderer); >+ layerDirtyRect.move(-m_scrolledContentsLayer->offsetFromRenderer() + toLayoutSize(m_scrolledContentsLayer->scrollOffset()) - m_subpixelOffsetFromRenderer); > #if PLATFORM(IOS_FAMILY) > // Account for the fact that RenderLayerBacking::updateGeometry() bakes scrollOffset into offsetFromRenderer on iOS, > // but the repaint rect is computed without taking the scroll position into account (see shouldApplyClipAndScrollPositionForRepaint()). > layerDirtyRect.moveBy(-m_owningLayer.scrollPosition()); > #endif >- m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect, shouldClip); >+ m_scrolledContentsLayer->setNeedsDisplayInRect(layerDirtyRect, shouldClip); > } > } > >@@ -2623,7 +2626,7 @@ void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, Graph > || graphicsLayer == m_backgroundLayer.get() > || graphicsLayer == m_maskLayer.get() > || graphicsLayer == m_childClippingMaskLayer.get() >- || graphicsLayer == m_scrollingContentsLayer.get()) { >+ || graphicsLayer == m_scrolledContentsLayer.get()) { > InspectorInstrumentation::willPaint(renderer()); > > if (!(paintingPhase & GraphicsLayerPaintOverflowContents)) >@@ -3079,8 +3082,8 @@ double RenderLayerBacking::backingStoreMemoryEstimate() const > if (m_childClippingMaskLayer) > backingMemory += m_childClippingMaskLayer->backingStoreMemoryEstimate(); > >- if (m_scrollingContentsLayer) >- backingMemory += m_scrollingContentsLayer->backingStoreMemoryEstimate(); >+ if (m_scrolledContentsLayer) >+ backingMemory += m_scrolledContentsLayer->backingStoreMemoryEstimate(); > > if (m_layerForHorizontalScrollbar) > backingMemory += m_layerForHorizontalScrollbar->backingStoreMemoryEstimate(); >diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h >index 635a78893c5ea8704dd36a8f4d7078f14d673956..7bb13f9f743ec5b0f3583938b1cbfc92dadb8d5f 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.h >+++ b/Source/WebCore/rendering/RenderLayerBacking.h >@@ -106,7 +106,7 @@ public: > > bool hasScrollingLayer() const { return m_scrollingLayer != nullptr; } > GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } >- GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLayer.get(); } >+ GraphicsLayer* scrollingContentsLayer() const { return m_scrolledContentsLayer.get(); } > > OptionSet<ScrollCoordinationRole> coordinatedScrollingRoles() const; > >@@ -298,6 +298,9 @@ private: > bool requiresVerticalScrollbarLayer() const; > bool requiresScrollCornerLayer() const; > bool updateScrollingLayers(bool scrollingLayers); >+ >+ void updateScrollOffset(ScrollOffset); >+ void setLocationOfScrolledContents(ScrollOffset, ScrollingLayerPositionAction); > > void updateChildClippingStrategy(bool needsDescendantsClippingLayer); > >@@ -383,7 +386,7 @@ private: > RefPtr<GraphicsLayer> m_layerForScrollCorner; > > RefPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using composited scrolling. >- RefPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling. >+ RefPtr<GraphicsLayer> m_scrolledContentsLayer; // Only used if the layer is using composited scrolling. > > LayoutRect m_compositedBounds; > LayoutSize m_subpixelOffsetFromRenderer; // This is the subpixel distance between the primary graphics layer and the associated renderer's bounds.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194184
:
360950
| 360963