Title: [282862] trunk/Source
Revision
282862
Author
[email protected]
Date
2021-09-21 20:40:29 -0700 (Tue, 21 Sep 2021)

Log Message

Change from ENABLE(RUBBER_BANDING) to HAVE(RUBBER_BANDING)
https://bugs.webkit.org/show_bug.cgi?id=230583

Reviewed by Tim Horton.

RUBBER_BANDING is not a feature we'll ever turn off on macOS, and it was only ever enabled
for that platform. However, it's also used in some cross-platform code, so
HAVE(RUBBER_BANDING) makes more sense for that use.

Also remove ENABLE(RUBBER_BANDING) #ifdefs from inside PLATFORM(MAC) code.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::isScrollable):
(WebCore::FrameView::handleWheelEventForScrolling):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::setUnderPageBackgroundColorOverride):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::headerLayerForFrameView):
(WebCore::ScrollingCoordinator::footerLayerForFrameView):
(WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollPositionIsNotRubberbandingEdge const):
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
* platform/ScrollableArea.h:
* platform/ScrollbarTheme.h:
* platform/ScrollingEffectsController.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::updateCustomAppearance):
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::rubberBandingEnabledForSystem):
(WebCore::ScrollAnimatorMac::isRubberBandInProgress const):
(WebCore::ScrollAnimatorMac::immediateScrollBy):
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
* platform/mac/ScrollingEffectsController.mm:
(WebCore::ScrollingEffectsController::updateRubberBandAnimatingState):
(WebCore::ScrollingEffectsController::scrollPositionChanged):
(WebCore::ScrollingEffectsController::isRubberBandInProgress const):
(WebCore::ScrollingEffectsController::stopRubberbanding):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::~RenderLayerCompositor):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::destroyRootLayer):
* rendering/RenderLayerCompositor.h:
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::isRubberBandInProgress const):
(WebCore::RenderLayerScrollableArea::overhangAmount const):
(WebCore::RenderLayerScrollableArea::setHasHorizontalScrollbar):
(WebCore::RenderLayerScrollableArea::setHasVerticalScrollbar):

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::updateCustomAppearance):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didAddHeaderLayer):
(WebKit::WebChromeClient::didAddFooterLayer):

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:
* wtf/PlatformHave.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (282861 => 282862)


--- trunk/Source/WTF/ChangeLog	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WTF/ChangeLog	2021-09-22 03:40:29 UTC (rev 282862)
@@ -1,3 +1,19 @@
+2021-09-21  Simon Fraser  <[email protected]>
+
+        Change from ENABLE(RUBBER_BANDING) to HAVE(RUBBER_BANDING)
+        https://bugs.webkit.org/show_bug.cgi?id=230583
+
+        Reviewed by Tim Horton.
+
+        RUBBER_BANDING is not a feature we'll ever turn off on macOS, and it was only ever enabled
+        for that platform. However, it's also used in some cross-platform code, so
+        HAVE(RUBBER_BANDING) makes more sense for that use.
+
+        Also remove ENABLE(RUBBER_BANDING) #ifdefs from inside PLATFORM(MAC) code.
+
+        * Scripts/Preferences/WebPreferences.yaml:
+        * wtf/PlatformHave.h:
+
 2021-09-21  Chris Dumez  <[email protected]>
 
         Reduce use of makeRef() and use Ref { } instead

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (282861 => 282862)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2021-09-22 03:40:29 UTC (rev 282862)
@@ -1838,7 +1838,7 @@
 
 RubberBandingForSubScrollableRegionsEnabled:
   type: bool
-  condition: ENABLE(RUBBER_BANDING)
+  condition: HAVE(RUBBER_BANDING)
   defaultValue:
     WebKitLegacy:
       default: false

Modified: trunk/Source/WTF/wtf/PlatformHave.h (282861 => 282862)


--- trunk/Source/WTF/wtf/PlatformHave.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -306,6 +306,10 @@
 #define HAVE_CVDISPLAYLINK 1
 #endif
 
+#if PLATFORM(MAC)
+#define HAVE_RUBBER_BANDING 1
+#endif
+
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
 #define HAVE_IOSURFACE_COREIMAGE_SUPPORT 1
 #endif

Modified: trunk/Source/WebCore/ChangeLog (282861 => 282862)


--- trunk/Source/WebCore/ChangeLog	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/ChangeLog	2021-09-22 03:40:29 UTC (rev 282862)
@@ -1,3 +1,63 @@
+2021-09-21  Simon Fraser  <[email protected]>
+
+        Change from ENABLE(RUBBER_BANDING) to HAVE(RUBBER_BANDING)
+        https://bugs.webkit.org/show_bug.cgi?id=230583
+
+        Reviewed by Tim Horton.
+
+        RUBBER_BANDING is not a feature we'll ever turn off on macOS, and it was only ever enabled
+        for that platform. However, it's also used in some cross-platform code, so
+        HAVE(RUBBER_BANDING) makes more sense for that use.
+
+        Also remove ENABLE(RUBBER_BANDING) #ifdefs from inside PLATFORM(MAC) code.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::FrameView):
+        (WebCore::FrameView::isScrollable):
+        (WebCore::FrameView::handleWheelEventForScrolling):
+        * page/FrameView.h:
+        * page/Page.cpp:
+        (WebCore::Page::setUnderPageBackgroundColorOverride):
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::headerLayerForFrameView):
+        (WebCore::ScrollingCoordinator::footerLayerForFrameView):
+        (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
+        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollPositionIsNotRubberbandingEdge const):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::paint):
+        * platform/ScrollableArea.h:
+        * platform/ScrollbarTheme.h:
+        * platform/ScrollingEffectsController.h:
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (WebCore::PlatformCALayerCocoa::updateCustomAppearance):
+        * platform/mac/ScrollAnimatorMac.h:
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::rubberBandingEnabledForSystem):
+        (WebCore::ScrollAnimatorMac::isRubberBandInProgress const):
+        (WebCore::ScrollAnimatorMac::immediateScrollBy):
+        * platform/mac/ScrollbarThemeMac.h:
+        * platform/mac/ScrollbarThemeMac.mm:
+        * platform/mac/ScrollingEffectsController.mm:
+        (WebCore::ScrollingEffectsController::updateRubberBandAnimatingState):
+        (WebCore::ScrollingEffectsController::scrollPositionChanged):
+        (WebCore::ScrollingEffectsController::isRubberBandInProgress const):
+        (WebCore::ScrollingEffectsController::stopRubberbanding):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
+        (WebCore::RenderLayerCompositor::updateBacking):
+        (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
+        (WebCore::RenderLayerCompositor::updateRootLayerPosition):
+        (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
+        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
+        (WebCore::RenderLayerCompositor::destroyRootLayer):
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderLayerScrollableArea.cpp:
+        (WebCore::RenderLayerScrollableArea::isRubberBandInProgress const):
+        (WebCore::RenderLayerScrollableArea::overhangAmount const):
+        (WebCore::RenderLayerScrollableArea::setHasHorizontalScrollbar):
+        (WebCore::RenderLayerScrollableArea::setHasVerticalScrollbar):
+
 2021-09-21  Myles C. Maxfield  <[email protected]>
 
         Delete dead code in FontPaletteValues

Modified: trunk/Source/WebCore/page/FrameView.cpp (282861 => 282862)


--- trunk/Source/WebCore/page/FrameView.cpp	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/page/FrameView.cpp	2021-09-22 03:40:29 UTC (rev 282862)
@@ -193,7 +193,7 @@
 {
     init();
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     ScrollElasticity verticalElasticity = ScrollElasticityNone;
     ScrollElasticity horizontalElasticity = ScrollElasticityNone;
     if (m_frame->isMainFrame()) {
@@ -887,7 +887,7 @@
     return renderView->compositor().scrollableAreaForScrollingNodeID(nodeID);
 }
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
 GraphicsLayer* FrameView::layerForOverhangAreas() const
 {
     RenderView* renderView = this->renderView();
@@ -914,7 +914,7 @@
     return renderView->compositor().updateLayerForBottomOverhangArea(wantsLayer);
 }
 
-#endif // ENABLE(RUBBER_BANDING)
+#endif // HAVE(RUBBER_BANDING)
 
 void FrameView::updateSnapOffsets()
 {
@@ -3890,7 +3890,7 @@
         return false;
 
     bool requiresActualOverflowToBeConsideredScrollable = !frame().isMainFrame() || definitionOfScrollable != Scrollability::ScrollableOrRubberbandable;
-#if !ENABLE(RUBBER_BANDING)
+#if !HAVE(RUBBER_BANDING)
     requiresActualOverflowToBeConsideredScrollable = true;
 #endif
 
@@ -5160,7 +5160,7 @@
 {
     // Note that to allow for rubber-band over-scroll behavior, even non-scrollable views
     // should handle wheel events.
-#if !ENABLE(RUBBER_BANDING)
+#if !HAVE(RUBBER_BANDING)
     if (!isScrollable())
         return false;
 #endif

Modified: trunk/Source/WebCore/page/FrameView.h (282861 => 282862)


--- trunk/Source/WebCore/page/FrameView.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/page/FrameView.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -584,7 +584,7 @@
     bool isActive() const final;
     bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const final;
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     WEBCORE_EXPORT GraphicsLayer* setWantsLayerForTopOverHangArea(bool) const;
     WEBCORE_EXPORT GraphicsLayer* setWantsLayerForBottomOverHangArea(bool) const;
 #endif
@@ -764,7 +764,7 @@
     IntRect scrollableAreaBoundingBox(bool* = nullptr) const final;
     bool scrollAnimatorEnabled() const final;
     GraphicsLayer* layerForScrollCorner() const final;
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     GraphicsLayer* layerForOverhangAreas() const final;
 #endif
     void contentsResized() final;

Modified: trunk/Source/WebCore/page/Page.cpp (282861 => 282862)


--- trunk/Source/WebCore/page/Page.cpp	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/page/Page.cpp	2021-09-22 03:40:29 UTC (rev 282862)
@@ -2619,7 +2619,7 @@
 
     scheduleRenderingUpdate({ });
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (RefPtr frameView = mainFrame().view()) {
         if (auto* renderView = frameView->renderView()) {
             if (renderView->usesCompositing())
@@ -2626,7 +2626,7 @@
                 renderView->compositor().updateLayerForOverhangAreasBackgroundColor();
         }
     }
-#endif // ENABLE(RUBBER_BANDING)
+#endif // HAVE(RUBBER_BANDING)
 }
 
 // These are magical constants that might be tweaked over time.

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (282861 => 282862)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2021-09-22 03:40:29 UTC (rev 282862)
@@ -216,7 +216,7 @@
 
 GraphicsLayer* ScrollingCoordinator::headerLayerForFrameView(FrameView& frameView)
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().headerLayer();
     return nullptr;
@@ -228,7 +228,7 @@
 
 GraphicsLayer* ScrollingCoordinator::footerLayerForFrameView(FrameView& frameView)
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().footerLayer();
     return nullptr;
@@ -254,7 +254,7 @@
 
 GraphicsLayer* ScrollingCoordinator::contentShadowLayerForFrameView(FrameView& frameView)
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (auto* renderView = frameView.frame().contentRenderer())
         return renderView->compositor().layerForContentShadow();
     

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (282861 => 282862)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm	2021-09-22 03:40:29 UTC (rev 282862)
@@ -123,7 +123,6 @@
 
 bool ScrollingTreeScrollingNodeDelegateMac::scrollPositionIsNotRubberbandingEdge(const FloatPoint& targetPosition) const
 {
-#if ENABLE(RUBBER_BANDING)
     if (!m_scrollController.isRubberBandInProgress())
         return false;
 
@@ -155,9 +154,6 @@
             break;
         }
     }
-#else
-    UNUSED_PARAM(targetPosition);
-#endif
     return false;
 }
 

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (282861 => 282862)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2021-09-22 03:40:29 UTC (rev 282862)
@@ -1300,7 +1300,7 @@
         paintContents(context, documentDirtyRect, securityOriginPaintPolicy, eventRegionContext);
     }
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (!layerForOverhangAreas())
         calculateAndPaintOverhangAreas(context, rect);
 #else

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (282861 => 282862)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -360,7 +360,7 @@
 
     friend class ScrollingCoordinator;
     virtual GraphicsLayer* layerForScrollCorner() const { return nullptr; }
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     virtual GraphicsLayer* layerForOverhangAreas() const { return nullptr; }
 #endif
 

Modified: trunk/Source/WebCore/platform/ScrollbarTheme.h (282861 => 282862)


--- trunk/Source/WebCore/platform/ScrollbarTheme.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/ScrollbarTheme.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef ScrollbarTheme_h
-#define ScrollbarTheme_h
+#pragma once
 
 #include "GraphicsContext.h"
 #include "IntRect.h"
@@ -37,7 +36,7 @@
 class Scrollbar;
 class ScrollView;
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
 class GraphicsLayer;
 #endif
 
@@ -91,7 +90,7 @@
     virtual void paintTickmarks(GraphicsContext&, Scrollbar&, const IntRect&) { }
     virtual void paintOverhangAreas(ScrollView&, GraphicsContext&, const IntRect&, const IntRect&, const IntRect&) { }
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) { }
     virtual void setUpContentShadowLayer(GraphicsLayer*) { }
 #endif
@@ -121,4 +120,3 @@
 };
 
 }
-#endif

Modified: trunk/Source/WebCore/platform/ScrollingEffectsController.h (282861 => 282862)


--- trunk/Source/WebCore/platform/ScrollingEffectsController.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/ScrollingEffectsController.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -77,7 +77,7 @@
     virtual void updateKeyboardScrollPosition(MonotonicTime) { }
     virtual KeyboardScrollingAnimator *keyboardScrollingAnimator() const { return nullptr; }
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     virtual bool allowsHorizontalStretching(const PlatformWheelEvent&) const = 0;
     virtual bool allowsVerticalStretching(const PlatformWheelEvent&) const = 0;
     virtual IntSize stretchAmount() const = 0;
@@ -158,7 +158,7 @@
     // Returns true if handled.
     bool processWheelEventForScrollSnap(const PlatformWheelEvent&);
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     void stopRubberbanding();
     bool isRubberBandInProgress() const;
     RectEdges<bool> rubberBandingEdges() const { return m_rubberBandingEdges; }
@@ -186,7 +186,7 @@
     void startDeferringWheelEventTestCompletionDueToScrollSnapping();
     void stopDeferringWheelEventTestCompletionDueToScrollSnapping();
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     void startRubberbandAnimation();
     void stopSnapRubberbandAnimation();
 
@@ -224,7 +224,7 @@
     FloatSize m_dragEndedScrollingVelocity;
     std::unique_ptr<ScrollingEffectsControllerTimer> m_statelessSnapTransitionTimer;
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     // Rubber band state.
     MonotonicTime m_startTime;
     FloatSize m_startStretch;

Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (282861 => 282862)


--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2021-09-22 03:40:29 UTC (rev 282862)
@@ -1034,7 +1034,7 @@
 
     m_customAppearance = appearance;
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     switch (appearance) {
     case GraphicsLayer::CustomAppearance::None:
     case GraphicsLayer::CustomAppearance::LightBackdrop:

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h (282861 => 282862)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -45,10 +45,8 @@
 private:
     bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier, OptionSet<ScrollBehavior>) final;
 
-#if ENABLE(RUBBER_BANDING)
     bool shouldForwardWheelEventsToParent(const PlatformWheelEvent&) const;
     bool handleWheelEvent(const PlatformWheelEvent&) final;
-#endif
 
     bool platformAllowsScrollAnimation() const;
 
@@ -65,7 +63,6 @@
     bool processWheelEventForScrollSnap(const PlatformWheelEvent&) final;
 
     // ScrollingEffectsControllerClient.
-#if ENABLE(RUBBER_BANDING)
     IntSize stretchAmount() const final;
     bool allowsHorizontalStretching(const PlatformWheelEvent&) const final;
     bool allowsVerticalStretching(const PlatformWheelEvent&) const final;
@@ -77,7 +74,6 @@
     void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) final;
     void immediateScrollBy(const FloatSize&) final;
     void adjustScrollPositionToBoundsIfNecessary() final;
-#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (282861 => 282862)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2021-09-22 03:40:29 UTC (rev 282862)
@@ -57,7 +57,6 @@
     return enabled;
 }
 
-#if ENABLE(RUBBER_BANDING)
 static bool rubberBandingEnabledForSystem()
 {
     static bool initialized = false;
@@ -73,7 +72,6 @@
     }
     return enabled;
 }
-#endif
 
 bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier, OptionSet<ScrollBehavior> behavior)
 {
@@ -109,11 +107,7 @@
 
 bool ScrollAnimatorMac::isRubberBandInProgress() const
 {
-#if !ENABLE(RUBBER_BANDING)
-    return false;
-#else
     return m_scrollController.isRubberBandInProgress();
-#endif
 }
 
 bool ScrollAnimatorMac::isScrollSnapInProgress() const
@@ -140,8 +134,6 @@
         m_scrollableArea.scrollbarsController().mayBeginScrollGesture();
 }
 
-#if ENABLE(RUBBER_BANDING)
-
 bool ScrollAnimatorMac::shouldForwardWheelEventsToParent(const PlatformWheelEvent& wheelEvent) const
 {
     if (std::abs(wheelEvent.deltaY()) >= std::abs(wheelEvent.deltaX()))
@@ -288,7 +280,6 @@
 
     setCurrentPosition(newPosition, NotifyScrollableArea::Yes);
 }
-#endif
 
 bool ScrollAnimatorMac::processWheelEventForScrollSnap(const PlatformWheelEvent& wheelEvent)
 {

Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h (282861 => 282862)


--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -71,7 +71,7 @@
     void didCreateScrollerImp(Scrollbar&);
     bool isLayoutDirectionRTL(Scrollbar&);
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     WEBCORE_EXPORT static void setUpOverhangAreaBackground(CALayer *, const Color& customBackgroundColor = Color());
     WEBCORE_EXPORT static void removeOverhangAreaBackground(CALayer *);
 
@@ -95,7 +95,7 @@
     bool shouldDragDocumentInsteadOfThumb(Scrollbar&, const PlatformMouseEvent&) override;
     int scrollbarPartToHIPressedState(ScrollbarPart);
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) override;
     void setUpContentShadowLayer(GraphicsLayer*) override;
 #endif

Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm (282861 => 282862)


--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm	2021-09-22 03:40:29 UTC (rev 282862)
@@ -578,7 +578,7 @@
     ALLOW_DEPRECATED_DECLARATIONS_END
 }
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
 static RetainPtr<CGColorRef> linenBackgroundColor()
 {
     NSImage *image = nil;

Modified: trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm (282861 => 282862)


--- trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm	2021-09-22 03:40:29 UTC (rev 282862)
@@ -38,11 +38,9 @@
 
 namespace WebCore {
 
-#if ENABLE(RUBBER_BANDING)
 static const Seconds scrollVelocityZeroingTimeout = 100_ms;
 static const float rubberbandDirectionLockStretchRatio = 1;
 static const float rubberbandMinimumRequiredDeltaBeforeStretch = 10;
-#endif
 
 static float elasticDeltaForTimeDelta(float initialPosition, float initialVelocity, Seconds elapsedTime)
 {
@@ -362,7 +360,6 @@
     return std::nullopt;
 }
 
-#if ENABLE(RUBBER_BANDING)
 static inline float roundTowardZero(float num)
 {
     return num > 0 ? ceilf(num - 0.5f) : floorf(num + 0.5f);
@@ -435,13 +432,10 @@
 
     updateRubberBandingState();
 }
-#endif
 
 void ScrollingEffectsController::scrollPositionChanged()
 {
-#if ENABLE(RUBBER_BANDING)
     updateRubberBandingState();
-#endif
 }
 
 bool ScrollingEffectsController::isUserScrollInProgress() const
@@ -451,11 +445,7 @@
 
 bool ScrollingEffectsController::isRubberBandInProgress() const
 {
-#if ENABLE(RUBBER_BANDING)
     return m_isRubberBanding;
-#else
-    return false;
-#endif
 }
 
 bool ScrollingEffectsController::isScrollSnapInProgress() const
@@ -471,7 +461,6 @@
 
 void ScrollingEffectsController::stopRubberbanding()
 {
-#if ENABLE(RUBBER_BANDING)
     stopSnapRubberbandAnimation();
     m_stretchScrollForce = { };
     m_startTime = { };
@@ -478,10 +467,8 @@
     m_startStretch = { };
     m_origVelocity = { };
     updateRubberBandingState();
-#endif
 }
 
-#if ENABLE(RUBBER_BANDING)
 void ScrollingEffectsController::startRubberbandAnimation()
 {
     m_client.willStartRubberBandSnapAnimation();
@@ -562,8 +549,6 @@
     m_rubberBandingEdges.setBottom(clientStretch.height() > 0);
 }
 
-#endif // ENABLE(RUBBER_BANDING)
-
 enum class WheelEventStatus {
     UserScrollBegin,
     UserScrolling,

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (282861 => 282862)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2021-09-22 03:40:29 UTC (rev 282862)
@@ -415,7 +415,7 @@
     GraphicsLayer::unparentAndClear(m_layerForVerticalScrollbar);
     GraphicsLayer::unparentAndClear(m_layerForScrollCorner);
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     GraphicsLayer::unparentAndClear(m_layerForOverhangAreas);
     GraphicsLayer::unparentAndClear(m_contentShadowLayer);
     GraphicsLayer::unparentAndClear(m_layerForTopOverhangArea);
@@ -1822,7 +1822,7 @@
                 auto& frameView = m_renderView.frameView();
                 if (auto* scrollingCoordinator = this->scrollingCoordinator())
                     scrollingCoordinator->frameViewRootLayerDidChange(frameView);
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
                 updateLayerForHeader(frameView.headerHeight());
                 updateLayerForFooter(frameView.footerHeight());
 #endif
@@ -2192,7 +2192,7 @@
         frameViewDidScroll();
         updateOverflowControlsLayers();
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
         if (m_layerForOverhangAreas) {
             auto& frameView = m_renderView.frameView();
             m_layerForOverhangAreas->setSize(frameView.frameRect().size());
@@ -2546,7 +2546,7 @@
 
     updateScrollLayerClipping();
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (m_contentShadowLayer && m_rootContentsLayer) {
         m_contentShadowLayer->setPosition(m_rootContentsLayer->position());
         m_contentShadowLayer->setSize(m_rootContentsLayer->size());
@@ -3735,7 +3735,7 @@
     return shouldCompositeOverflowControls() && m_renderView.frameView().isScrollCornerVisible();
 }
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
 bool RenderLayerCompositor::requiresOverhangAreasLayer() const
 {
     if (!isMainFrameCompositor())
@@ -3904,7 +3904,7 @@
         m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::CustomAppearance::ScrollingOverhang);
 }
 
-#endif // ENABLE(RUBBER_BANDING)
+#endif // HAVE(RUBBER_BANDING)
 
 bool RenderLayerCompositor::viewNeedsToInvalidateEventRegionOfEnclosingCompositingLayerForRepaint() const
 {
@@ -3979,7 +3979,7 @@
     if (extendedBackgroundColorChanged) {
         page().chrome().client().pageExtendedBackgroundColorDidChange();
         
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
         updateLayerForOverhangAreasBackgroundColor();
 #endif
     }
@@ -3989,7 +3989,7 @@
 
 void RenderLayerCompositor::updateOverflowControlsLayers()
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (requiresOverhangAreasLayer()) {
         if (!m_layerForOverhangAreas) {
             m_layerForOverhangAreas = GraphicsLayer::create(graphicsLayerFactory(), *this);
@@ -4179,7 +4179,7 @@
 
     detachRootLayer();
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     GraphicsLayer::unparentAndClear(m_layerForOverhangAreas);
 #endif
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (282861 => 282862)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2021-09-22 03:40:29 UTC (rev 282862)
@@ -266,7 +266,7 @@
 
     GraphicsLayer* layerForClipping() const {  return m_clipLayer ? m_clipLayer.get() : m_scrollContainerLayer.get();  }
 
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     GraphicsLayer* headerLayer() const { return m_layerForHeader.get(); }
     GraphicsLayer* footerLayer() const { return m_layerForFooter.get(); }
 #endif
@@ -339,7 +339,7 @@
     GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
     GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
     GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }
     GraphicsLayer* layerForContentShadow() const { return m_contentShadowLayer.get(); }
 
@@ -349,7 +349,7 @@
     GraphicsLayer* updateLayerForFooter(bool wantsLayer);
 
     void updateLayerForOverhangAreasBackgroundColor();
-#endif // ENABLE(RUBBER_BANDING)
+#endif // HAVE(RUBBER_BANDING)
 
     // FIXME: make the coordinated/async terminology consistent.
     bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer&) const;
@@ -551,7 +551,7 @@
     bool requiresHorizontalScrollbarLayer() const;
     bool requiresVerticalScrollbarLayer() const;
     bool requiresScrollCornerLayer() const;
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     bool requiresOverhangAreasLayer() const;
     bool requiresContentShadowLayer() const;
 #endif
@@ -615,7 +615,7 @@
     RefPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
     RefPtr<GraphicsLayer> m_layerForVerticalScrollbar;
     RefPtr<GraphicsLayer> m_layerForScrollCorner;
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     RefPtr<GraphicsLayer> m_layerForOverhangAreas;
     RefPtr<GraphicsLayer> m_contentShadowLayer;
     RefPtr<GraphicsLayer> m_layerForTopOverhangArea;

Modified: trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp (282861 => 282862)


--- trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp	2021-09-22 03:40:29 UTC (rev 282862)
@@ -180,7 +180,7 @@
 
 bool RenderLayerScrollableArea::isRubberBandInProgress() const
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (!scrollsOverflow())
         return false;
 
@@ -512,7 +512,7 @@
 
 IntSize RenderLayerScrollableArea::overhangAmount() const
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     auto& renderer = m_layer.renderer();
     if (!renderer.settings().rubberBandingForSubScrollableRegionsEnabled())
         return IntSize();
@@ -854,7 +854,7 @@
 
     if (hasScrollbar) {
         m_hBar = createScrollbar(HorizontalScrollbar);
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
         auto& renderer = m_layer.renderer();
         ScrollElasticity elasticity = scrollsOverflow() && renderer.settings().rubberBandingForSubScrollableRegionsEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
         ScrollableArea::setHorizontalScrollElasticity(elasticity);
@@ -861,7 +861,7 @@
 #endif
     } else {
         destroyScrollbar(HorizontalScrollbar);
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
         ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityNone);
 #endif
     }
@@ -880,7 +880,7 @@
 
     if (hasScrollbar) {
         m_vBar = createScrollbar(VerticalScrollbar);
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
         auto& renderer = m_layer.renderer();
         ScrollElasticity elasticity = scrollsOverflow() && renderer.settings().rubberBandingForSubScrollableRegionsEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
         ScrollableArea::setVerticalScrollElasticity(elasticity);
@@ -887,7 +887,7 @@
 #endif
     } else {
         destroyScrollbar(VerticalScrollbar);
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
         ScrollableArea::setVerticalScrollElasticity(ScrollElasticityNone);
 #endif
     }

Modified: trunk/Source/WebKit/ChangeLog (282861 => 282862)


--- trunk/Source/WebKit/ChangeLog	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebKit/ChangeLog	2021-09-22 03:40:29 UTC (rev 282862)
@@ -1,3 +1,22 @@
+2021-09-21  Simon Fraser  <[email protected]>
+
+        Change from ENABLE(RUBBER_BANDING) to HAVE(RUBBER_BANDING)
+        https://bugs.webkit.org/show_bug.cgi?id=230583
+
+        Reviewed by Tim Horton.
+
+        RUBBER_BANDING is not a feature we'll ever turn off on macOS, and it was only ever enabled
+        for that platform. However, it's also used in some cross-platform code, so
+        HAVE(RUBBER_BANDING) makes more sense for that use.
+
+        Also remove ENABLE(RUBBER_BANDING) #ifdefs from inside PLATFORM(MAC) code.
+
+        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
+        (WebKit::updateCustomAppearance):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::didAddHeaderLayer):
+        (WebKit::WebChromeClient::didAddFooterLayer):
+
 2021-09-21  Ross Kirsling  <[email protected]>
 
         [PlayStation] Unreviewed build fix (second attempt).

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm (282861 => 282862)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm	2021-09-22 03:40:29 UTC (rev 282862)
@@ -127,7 +127,7 @@
 
 static void updateCustomAppearance(CALayer *layer, GraphicsLayer::CustomAppearance customAppearance)
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     switch (customAppearance) {
     case GraphicsLayer::CustomAppearance::None:
     case GraphicsLayer::CustomAppearance::DarkBackdrop:

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (282861 => 282862)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2021-09-22 02:58:08 UTC (rev 282861)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2021-09-22 03:40:29 UTC (rev 282862)
@@ -1228,7 +1228,7 @@
 
 void WebChromeClient::didAddHeaderLayer(GraphicsLayer& headerParent)
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (PageBanner* banner = m_page.headerPageBanner())
         banner->didAddParentLayer(&headerParent);
 #else
@@ -1238,7 +1238,7 @@
 
 void WebChromeClient::didAddFooterLayer(GraphicsLayer& footerParent)
 {
-#if ENABLE(RUBBER_BANDING)
+#if HAVE(RUBBER_BANDING)
     if (PageBanner* banner = m_page.footerPageBanner())
         banner->didAddParentLayer(&footerParent);
 #else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to