⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283353 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 5:40:33 PM (5 years ago)
Author:
Simon Fraser
Message:

Simplify some scrolling-related code in WebKit with use of RectEdges<bool>
https://bugs.webkit.org/show_bug.cgi?id=231037

Reviewed by Tim Horton.

Source/WebCore:

Export edgePinnedState().

  • platform/ScrollableArea.h:

Source/WebKit:

Use RectEdges<bool> in code that tracks rubber banding state, and edge pinned state.

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<RectEdges<bool>>::encode):
(IPC::ArgumentCoder<RectEdges<bool>>::decode):

  • Shared/WebCoreArgumentCoders.h:
  • UIProcess/API/C/WKPage.cpp:

(WKPageIsPinnedToLeftSide):
(WKPageIsPinnedToRightSide):
(WKPageIsPinnedToTopSide):
(WKPageIsPinnedToBottomSide):
(WKPageRubberBandsAtLeft):
(WKPageRubberBandsAtRight):
(WKPageRubberBandsAtTop):
(WKPageRubberBandsAtBottom):

  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::toWKRectEdge):
(WebKit::toRectEdges):
(WebKit::WebViewImpl::pinnedState):
(WebKit::WebViewImpl::rubberBandingEnabled):
(WebKit::WebViewImpl::setRubberBandingEnabled):

  • UIProcess/ViewGestureController.cpp:

(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::setRubberBandsAtLeft):
(WebKit::WebPageProxy::setRubberBandsAtRight):
(WebKit::WebPageProxy::setRubberBandsAtTop):
(WebKit::WebPageProxy::setRubberBandsAtBottom):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
(WebKit::WebPageProxy::rubberBandsAtLeft const): Deleted.
(WebKit::WebPageProxy::rubberBandsAtRight const): Deleted.
(WebKit::WebPageProxy::rubberBandsAtTop const): Deleted.
(WebKit::WebPageProxy::rubberBandsAtBottom const): Deleted.

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • WebProcess/WebPage/EventDispatcher.cpp:

(WebKit::EventDispatcher::wheelEvent):

  • WebProcess/WebPage/EventDispatcher.h:
  • WebProcess/WebPage/EventDispatcher.messages.in:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updateMainFrameScrollOffsetPinning):

  • WebProcess/WebPage/WebPage.h:
Location:
trunk/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r283347 r283353  
     12021-09-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Simplify some scrolling-related code in WebKit with use of RectEdges<bool>
     4        https://bugs.webkit.org/show_bug.cgi?id=231037
     5
     6        Reviewed by Tim Horton.
     7
     8        Export edgePinnedState().
     9
     10        * platform/ScrollableArea.h:
     11
    1122021-09-30  Sihui Liu  <sihui_liu@apple.com>
    213
  • trunk/Source/WebCore/platform/ScrollableArea.h

    r283335 r283353  
    322322    // "Pinned" means scrolled at or beyond the edge.
    323323    bool isPinnedOnSide(BoxSide) const;
    324     RectEdges<bool> edgePinnedState() const;
     324    WEBCORE_EXPORT RectEdges<bool> edgePinnedState() const;
    325325
    326326    // True if scrolling happens by moving compositing layers.
  • trunk/Source/WebKit/ChangeLog

    r283333 r283353  
     12021-09-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Simplify some scrolling-related code in WebKit with use of RectEdges<bool>
     4        https://bugs.webkit.org/show_bug.cgi?id=231037
     5
     6        Reviewed by Tim Horton.
     7
     8        Use RectEdges<bool> in code that tracks rubber banding state, and edge pinned state.
     9
     10        * Shared/WebCoreArgumentCoders.cpp:
     11        (IPC::ArgumentCoder<RectEdges<bool>>::encode):
     12        (IPC::ArgumentCoder<RectEdges<bool>>::decode):
     13        * Shared/WebCoreArgumentCoders.h:
     14        * UIProcess/API/C/WKPage.cpp:
     15        (WKPageIsPinnedToLeftSide):
     16        (WKPageIsPinnedToRightSide):
     17        (WKPageIsPinnedToTopSide):
     18        (WKPageIsPinnedToBottomSide):
     19        (WKPageRubberBandsAtLeft):
     20        (WKPageRubberBandsAtRight):
     21        (WKPageRubberBandsAtTop):
     22        (WKPageRubberBandsAtBottom):
     23        * UIProcess/Cocoa/WebViewImpl.mm:
     24        (WebKit::toWKRectEdge):
     25        (WebKit::toRectEdges):
     26        (WebKit::WebViewImpl::pinnedState):
     27        (WebKit::WebViewImpl::rubberBandingEnabled):
     28        (WebKit::WebViewImpl::setRubberBandingEnabled):
     29        * UIProcess/ViewGestureController.cpp:
     30        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
     31        * UIProcess/WebPageProxy.cpp:
     32        (WebKit::WebPageProxy::sendWheelEvent):
     33        (WebKit::WebPageProxy::setRubberBandsAtLeft):
     34        (WebKit::WebPageProxy::setRubberBandsAtRight):
     35        (WebKit::WebPageProxy::setRubberBandsAtTop):
     36        (WebKit::WebPageProxy::setRubberBandsAtBottom):
     37        (WebKit::WebPageProxy::didCommitLoadForFrame):
     38        (WebKit::WebPageProxy::resetState):
     39        (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
     40        (WebKit::WebPageProxy::rubberBandsAtLeft const): Deleted.
     41        (WebKit::WebPageProxy::rubberBandsAtRight const): Deleted.
     42        (WebKit::WebPageProxy::rubberBandsAtTop const): Deleted.
     43        (WebKit::WebPageProxy::rubberBandsAtBottom const): Deleted.
     44        * UIProcess/WebPageProxy.h:
     45        * UIProcess/WebPageProxy.messages.in:
     46        * WebProcess/WebPage/EventDispatcher.cpp:
     47        (WebKit::EventDispatcher::wheelEvent):
     48        * WebProcess/WebPage/EventDispatcher.h:
     49        * WebProcess/WebPage/EventDispatcher.messages.in:
     50        * WebProcess/WebPage/WebPage.cpp:
     51        (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
     52        * WebProcess/WebPage/WebPage.h:
     53
    1542021-09-30  Christopher Reid  <chris.reid@sony.com>
    255
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp

    r283048 r283353  
    675675    return SimpleArgumentCoder<FloatBoxExtent>::decode(decoder, floatBoxExtent);
    676676}
    677    
     677
     678
     679void ArgumentCoder<RectEdges<bool>>::encode(Encoder& encoder, const RectEdges<bool>& boxEdges)
     680{
     681    SimpleArgumentCoder<RectEdges<bool>>::encode(encoder, boxEdges);
     682}
     683   
     684bool ArgumentCoder<RectEdges<bool>>::decode(Decoder& decoder, RectEdges<bool>& boxEdges)
     685{
     686    return SimpleArgumentCoder<RectEdges<bool>>::decode(decoder, boxEdges);
     687}
     688
    678689
    679690void ArgumentCoder<FloatSize>::encode(Encoder& encoder, const FloatSize& floatSize)
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h

    r283048 r283353  
    322322};
    323323
     324template<> struct ArgumentCoder<WebCore::RectEdges<bool>> {
     325    static void encode(Encoder&, const WebCore::RectEdges<bool>&);
     326    static WARN_UNUSED_RETURN bool decode(Decoder&, WebCore::RectEdges<bool>&);
     327};
     328
    324329template<> struct ArgumentCoder<WebCore::FloatSize> {
    325330    static void encode(Encoder&, const WebCore::FloatSize&);
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r283316 r283353  
    679679bool WKPageIsPinnedToLeftSide(WKPageRef pageRef)
    680680{
    681     return toImpl(pageRef)->isPinnedToLeftSide();
     681    return toImpl(pageRef)->pinnedState().left();
    682682}
    683683
    684684bool WKPageIsPinnedToRightSide(WKPageRef pageRef)
    685685{
    686     return toImpl(pageRef)->isPinnedToRightSide();
     686    return toImpl(pageRef)->pinnedState().right();
    687687}
    688688
    689689bool WKPageIsPinnedToTopSide(WKPageRef pageRef)
    690690{
    691     return toImpl(pageRef)->isPinnedToTopSide();
     691    return toImpl(pageRef)->pinnedState().top();
    692692}
    693693
    694694bool WKPageIsPinnedToBottomSide(WKPageRef pageRef)
    695695{
    696     return toImpl(pageRef)->isPinnedToBottomSide();
     696    return toImpl(pageRef)->pinnedState().bottom();
    697697}
    698698
    699699bool WKPageRubberBandsAtLeft(WKPageRef pageRef)
    700700{
    701     return toImpl(pageRef)->rubberBandsAtLeft();
     701    return toImpl(pageRef)->rubberBandableEdges().left();
    702702}
    703703
     
    710710bool WKPageRubberBandsAtRight(WKPageRef pageRef)
    711711{
    712     return toImpl(pageRef)->rubberBandsAtRight();
     712    return toImpl(pageRef)->rubberBandableEdges().right();
    713713}
    714714
     
    721721bool WKPageRubberBandsAtTop(WKPageRef pageRef)
    722722{
    723     return toImpl(pageRef)->rubberBandsAtTop();
     723    return toImpl(pageRef)->rubberBandableEdges().top();
    724724}
    725725
     
    732732bool WKPageRubberBandsAtBottom(WKPageRef pageRef)
    733733{
    734     return toImpl(pageRef)->rubberBandsAtBottom();
     734    return toImpl(pageRef)->rubberBandableEdges().bottom();
    735735}
    736736
  • trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm

    r282889 r283353  
    56105610}
    56115611
     5612static _WKRectEdge toWKRectEdge(RectEdges<bool> edges)
     5613{
     5614    _WKRectEdge result = _WKRectEdgeNone;
     5615
     5616    if (edges.left())
     5617        result |= _WKRectEdgeLeft;
     5618
     5619    if (edges.right())
     5620        result |= _WKRectEdgeRight;
     5621
     5622    if (edges.top())
     5623        result |= _WKRectEdgeTop;
     5624
     5625    if (edges.bottom())
     5626        result |= _WKRectEdgeBottom;
     5627
     5628    return result;
     5629}
     5630
     5631static RectEdges<bool> toRectEdges(_WKRectEdge edges)
     5632{
     5633    return {
     5634        edges & _WKRectEdgeTop,
     5635        edges & _WKRectEdgeRight,
     5636        edges & _WKRectEdgeBottom,
     5637        edges & _WKRectEdgeLeft
     5638    };
     5639}
     5640
    56125641_WKRectEdge WebViewImpl::pinnedState()
    56135642{
    5614     _WKRectEdge state = _WKRectEdgeNone;
    5615     if (m_page->isPinnedToLeftSide())
    5616         state |= _WKRectEdgeLeft;
    5617     if (m_page->isPinnedToRightSide())
    5618         state |= _WKRectEdgeRight;
    5619     if (m_page->isPinnedToTopSide())
    5620         state |= _WKRectEdgeTop;
    5621     if (m_page->isPinnedToBottomSide())
    5622         state |= _WKRectEdgeBottom;
    5623     return state;
     5643    return toWKRectEdge(m_page->pinnedState());
    56245644}
    56255645
    56265646_WKRectEdge WebViewImpl::rubberBandingEnabled()
    56275647{
    5628     _WKRectEdge state = _WKRectEdgeNone;
    5629     if (m_page->rubberBandsAtLeft())
    5630         state |= _WKRectEdgeLeft;
    5631     if (m_page->rubberBandsAtRight())
    5632         state |= _WKRectEdgeRight;
    5633     if (m_page->rubberBandsAtTop())
    5634         state |= _WKRectEdgeTop;
    5635     if (m_page->rubberBandsAtBottom())
    5636         state |= _WKRectEdgeBottom;
    5637     return state;
     5648    return toWKRectEdge(m_page->rubberBandableEdges());
    56385649}
    56395650
    56405651void WebViewImpl::setRubberBandingEnabled(_WKRectEdge state)
    56415652{
    5642     m_page->setRubberBandsAtLeft(state & _WKRectEdgeLeft);
    5643     m_page->setRubberBandsAtRight(state & _WKRectEdgeRight);
    5644     m_page->setRubberBandsAtTop(state & _WKRectEdgeTop);
    5645     m_page->setRubberBandsAtBottom(state & _WKRectEdgeBottom);
     5653    m_page->setRubberBandableEdges(toRectEdges(state));
    56465654}
    56475655
  • trunk/Source/WebKit/UIProcess/ViewGestureController.cpp

    r278880 r283353  
    422422        return false;
    423423
    424     bool isPinnedToLeft = m_shouldIgnorePinnedState || m_webPageProxy.isPinnedToLeftSide();
    425     bool isPinnedToRight = m_shouldIgnorePinnedState || m_webPageProxy.isPinnedToRightSide();
     424    bool isPinnedToLeft = m_shouldIgnorePinnedState || m_webPageProxy.pinnedState().left();
     425    bool isPinnedToRight = m_shouldIgnorePinnedState || m_webPageProxy.pinnedState().right();
    426426
    427427    bool tryingToSwipeBack = size.width() > 0 && isPinnedToLeft;
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r283316 r283353  
    29192919#endif
    29202920
    2921     send(
    2922         Messages::EventDispatcher::WheelEvent(
    2923             m_webPageID,
    2924             event,
    2925             shouldUseImplicitRubberBandControl() ? !m_backForwardList->backItem() : rubberBandsAtLeft(),
    2926             shouldUseImplicitRubberBandControl() ? !m_backForwardList->forwardItem() : rubberBandsAtRight(),
    2927             rubberBandsAtTop(),
    2928             rubberBandsAtBottom()
    2929         ), 0);
     2921    auto rubberBandableEdges = this->rubberBandableEdges();
     2922    if (shouldUseImplicitRubberBandControl()) {
     2923        rubberBandableEdges.setLeft(!m_backForwardList->backItem());
     2924        rubberBandableEdges.setRight(!m_backForwardList->forwardItem());
     2925    }
     2926    send(Messages::EventDispatcher::WheelEvent(m_webPageID, event, rubberBandableEdges), 0);
    29302927
    29312928    // Manually ping the web process to check for responsiveness since our wheel
     
    41344131}
    41354132
    4136 bool WebPageProxy::rubberBandsAtLeft() const
    4137 {
    4138     return m_rubberBandsAtLeft;
    4139 }
    4140 
    41414133void WebPageProxy::setRubberBandsAtLeft(bool rubberBandsAtLeft)
    41424134{
    4143     m_rubberBandsAtLeft = rubberBandsAtLeft;
    4144 }
    4145 
    4146 bool WebPageProxy::rubberBandsAtRight() const
    4147 {
    4148     return m_rubberBandsAtRight;
     4135    m_rubberBandableEdges.setLeft(rubberBandsAtLeft);
    41494136}
    41504137
    41514138void WebPageProxy::setRubberBandsAtRight(bool rubberBandsAtRight)
    41524139{
    4153     m_rubberBandsAtRight = rubberBandsAtRight;
    4154 }
    4155 
    4156 bool WebPageProxy::rubberBandsAtTop() const
    4157 {
    4158     return m_rubberBandsAtTop;
     4140    m_rubberBandableEdges.setRight(rubberBandsAtRight);
    41594141}
    41604142
    41614143void WebPageProxy::setRubberBandsAtTop(bool rubberBandsAtTop)
    41624144{
    4163     m_rubberBandsAtTop = rubberBandsAtTop;
    4164 }
    4165 
    4166 bool WebPageProxy::rubberBandsAtBottom() const
    4167 {
    4168     return m_rubberBandsAtBottom;
     4145    m_rubberBandableEdges.setTop(rubberBandsAtTop);
    41694146}
    41704147
    41714148void WebPageProxy::setRubberBandsAtBottom(bool rubberBandsAtBottom)
    41724149{
    4173     m_rubberBandsAtBottom = rubberBandsAtBottom;
     4150    m_rubberBandableEdges.setBottom(rubberBandsAtBottom);
    41744151}
    41754152   
     
    49434920            // Always assume that the main frame is pinned here, since the custom representation view will handle
    49444921            // any wheel events and dispatch them to the WKView when necessary.
    4945             m_mainFrameIsPinnedToLeftSide = true;
    4946             m_mainFrameIsPinnedToRightSide = true;
    4947             m_mainFrameIsPinnedToTopSide = true;
    4948             m_mainFrameIsPinnedToBottomSide = true;
    4949 
     4922            m_mainFramePinnedState = { true, true, true, true };
    49504923            m_uiClient->pinnedStateDidChange(*this);
    49514924        }
     
    78837856    m_mainFrameHasVerticalScrollbar = false;
    78847857
    7885     m_mainFrameIsPinnedToLeftSide = true;
    7886     m_mainFrameIsPinnedToRightSide = true;
    7887     m_mainFrameIsPinnedToTopSide = true;
    7888     m_mainFrameIsPinnedToBottomSide = true;
     7858    m_mainFramePinnedState = { true, true, true, true };
    78897859
    78907860    m_visibleScrollerThumbRect = IntRect();
     
    87998769}
    88008770
    8801 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide)
     8771void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(RectEdges<bool> pinnedState)
    88028772{
    88038773    pageClient().pinnedStateWillChange();
    8804     m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide;
    8805     m_mainFrameIsPinnedToRightSide = pinnedToRightSide;
    8806     m_mainFrameIsPinnedToTopSide = pinnedToTopSide;
    8807     m_mainFrameIsPinnedToBottomSide = pinnedToBottomSide;
     8774    m_mainFramePinnedState = pinnedState;
    88088775    pageClient().pinnedStateDidChange();
    88098776
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r283320 r283353  
    105105#include <WebCore/PlatformSpeechSynthesizer.h>
    106106#include <WebCore/PointerID.h>
     107#include <WebCore/RectEdges.h>
    107108#include <WebCore/RegistrableDomain.h>
    108109#include <WebCore/RunJavaScriptParameters.h>
     
    10951096    bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
    10961097
    1097     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
    1098     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
    1099     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
    1100     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
    1101 
    1102     bool rubberBandsAtLeft() const;
     1098    WebCore::RectEdges<bool> pinnedState() const { return m_mainFramePinnedState; }
     1099
     1100    WebCore::RectEdges<bool> rubberBandableEdges() const { return m_rubberBandableEdges; }
     1101    void setRubberBandableEdges(WebCore::RectEdges<bool> edges) { m_rubberBandableEdges = edges; }
    11031102    void setRubberBandsAtLeft(bool);
    1104     bool rubberBandsAtRight() const;
    11051103    void setRubberBandsAtRight(bool);
    1106     bool rubberBandsAtTop() const;
    11071104    void setRubberBandsAtTop(bool);
    1108     bool rubberBandsAtBottom() const;
    11091105    void setRubberBandsAtBottom(bool);
    11101106
     
    21532149    void recommendedScrollbarStyleDidChange(int32_t newStyle);
    21542150    void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
    2155     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
     2151    void didChangeScrollOffsetPinningForMainFrame(WebCore::RectEdges<bool>);
    21562152    void didChangePageCount(unsigned);
    21572153    void themeColorChanged(const WebCore::Color&);
     
    28602856
    28612857    PageLoadState m_pageLoadState;
    2862    
     2858
     2859    WebCore::RectEdges<bool> m_mainFramePinnedState { true, true, true, true };
     2860    WebCore::RectEdges<bool> m_rubberBandableEdges { true, true, true, true };
     2861
    28632862    bool m_delegatesScrolling { false };
    28642863
     
    28692868    bool m_canShortCircuitHorizontalWheelEvents { true };
    28702869
    2871     bool m_mainFrameIsPinnedToLeftSide { true };
    2872     bool m_mainFrameIsPinnedToRightSide { true };
    2873     bool m_mainFrameIsPinnedToTopSide { true };
    2874     bool m_mainFrameIsPinnedToBottomSide { true };
    2875 
    28762870    bool m_shouldUseImplicitRubberBandControl { false };
    2877     bool m_rubberBandsAtLeft { true };
    2878     bool m_rubberBandsAtRight { true };
    2879     bool m_rubberBandsAtTop { true };
    2880     bool m_rubberBandsAtBottom { true };
    28812871       
    28822872    bool m_enableVerticalRubberBanding { true };
  • trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in

    r283304 r283353  
    7676    RecommendedScrollbarStyleDidChange(int32_t newStyle)
    7777    DidChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar)
    78     DidChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide)
     78    DidChangeScrollOffsetPinningForMainFrame(WebCore::RectEdges<bool> pinnedState)
    7979    DidChangePageCount(unsigned pageCount)
    8080    ThemeColorChanged(WebCore::Color themeColor)
  • trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp

    r282755 r283353  
    9797}
    9898
    99 void EventDispatcher::wheelEvent(PageIdentifier pageID, const WebWheelEvent& wheelEvent, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
     99void EventDispatcher::wheelEvent(PageIdentifier pageID, const WebWheelEvent& wheelEvent, RectEdges<bool> rubberBandableEdges)
    100100{
    101101#if PLATFORM(COCOA) || ENABLE(SCROLLING_THREAD)
     
    138138        // We only need to do this at the beginning of the gesture.
    139139        if (platformWheelEvent.phase() == PlatformWheelEventPhase::Began)
    140             scrollingTree->setMainFrameCanRubberBand({ canRubberBandAtTop, canRubberBandAtRight, canRubberBandAtBottom, canRubberBandAtLeft });
     140            scrollingTree->setMainFrameCanRubberBand(rubberBandableEdges);
    141141
    142142        auto processingSteps = scrollingTree->determineWheelEventProcessing(platformWheelEvent);
     
    166166    } while (false);
    167167#else
    168     UNUSED_PARAM(canRubberBandAtLeft);
    169     UNUSED_PARAM(canRubberBandAtRight);
    170     UNUSED_PARAM(canRubberBandAtTop);
    171     UNUSED_PARAM(canRubberBandAtBottom);
     168    UNUSED_PARAM(rubberBandableEdges);
    172169
    173170    dispatchWheelEventViaMainThread(pageID, wheelEvent, processingSteps);
  • trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h

    r281782 r283353  
    3030#include <WebCore/PageIdentifier.h>
    3131#include <WebCore/PlatformWheelEvent.h>
     32#include <WebCore/RectEdges.h>
    3233#include <WebCore/WheelEventDeltaFilter.h>
    3334#include <memory>
     
    8384
    8485    // Message handlers
    85     void wheelEvent(WebCore::PageIdentifier, const WebWheelEvent&, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom);
     86    void wheelEvent(WebCore::PageIdentifier, const WebWheelEvent&, WebCore::RectEdges<bool> rubberBandableEdges);
    8687#if ENABLE(IOS_TOUCH_EVENTS)
    8788    void touchEvent(WebCore::PageIdentifier, const WebTouchEvent&, CompletionHandler<void(bool)>&&);
  • trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.messages.in

    r275440 r283353  
    2222
    2323messages -> EventDispatcher {
    24     WheelEvent(WebCore::PageIdentifier pageID, WebKit::WebWheelEvent event, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
     24    WheelEvent(WebCore::PageIdentifier pageID, WebKit::WebWheelEvent event, WebCore::RectEdges<bool> rubberBandableEdges)
    2525#if ENABLE(IOS_TOUCH_EVENTS)
    2626    TouchEvent(WebCore::PageIdentifier pageID, WebKit::WebTouchEvent event) -> (bool handled) Async MainThreadCallback
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r283179 r283353  
    49444944void WebPage::updateMainFrameScrollOffsetPinning()
    49454945{
    4946     Frame& frame = m_page->mainFrame();
    4947     ScrollPosition scrollPosition = frame.view()->scrollPosition();
    4948     ScrollPosition maximumScrollPosition = frame.view()->maximumScrollPosition();
    4949     ScrollPosition minimumScrollPosition = frame.view()->minimumScrollPosition();
    4950 
    4951     bool isPinnedToLeftSide = (scrollPosition.x() <= minimumScrollPosition.x());
    4952     bool isPinnedToRightSide = (scrollPosition.x() >= maximumScrollPosition.x());
    4953     bool isPinnedToTopSide = (scrollPosition.y() <= minimumScrollPosition.y());
    4954     bool isPinnedToBottomSide = (scrollPosition.y() >= maximumScrollPosition.y());
    4955 
    4956     if (isPinnedToLeftSide != m_cachedMainFrameIsPinnedToLeftSide || isPinnedToRightSide != m_cachedMainFrameIsPinnedToRightSide || isPinnedToTopSide != m_cachedMainFrameIsPinnedToTopSide || isPinnedToBottomSide != m_cachedMainFrameIsPinnedToBottomSide) {
    4957         send(Messages::WebPageProxy::DidChangeScrollOffsetPinningForMainFrame(isPinnedToLeftSide, isPinnedToRightSide, isPinnedToTopSide, isPinnedToBottomSide));
    4958        
    4959         m_cachedMainFrameIsPinnedToLeftSide = isPinnedToLeftSide;
    4960         m_cachedMainFrameIsPinnedToRightSide = isPinnedToRightSide;
    4961         m_cachedMainFrameIsPinnedToTopSide = isPinnedToTopSide;
    4962         m_cachedMainFrameIsPinnedToBottomSide = isPinnedToBottomSide;
     4946    auto* frameView = mainFrameView();
     4947    if (!frameView)
     4948        return;
     4949
     4950    auto pinnedState = frameView->edgePinnedState();
     4951    if (pinnedState != m_cachedMainFramePinnedState) {
     4952        send(Messages::WebPageProxy::DidChangeScrollOffsetPinningForMainFrame(pinnedState));
     4953        m_cachedMainFramePinnedState = pinnedState;
    49634954    }
    49644955}
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r283304 r283353  
    8484#include <WebCore/PointerCharacteristics.h>
    8585#include <WebCore/PointerID.h>
     86#include <WebCore/RectEdges.h>
    8687#include <WebCore/SecurityPolicyViolationEvent.h>
    8788#include <WebCore/ShareData.h>
     
    21672168#endif
    21682169
    2169     bool m_cachedMainFrameIsPinnedToLeftSide { true };
    2170     bool m_cachedMainFrameIsPinnedToRightSide { true };
    2171     bool m_cachedMainFrameIsPinnedToTopSide { true };
    2172     bool m_cachedMainFrameIsPinnedToBottomSide { true };
     2170    WebCore::RectEdges<bool> m_cachedMainFramePinnedState { true, true, true, true };
    21732171    bool m_canShortCircuitHorizontalWheelEvents { false };
    21742172    bool m_hasWheelEventHandlers { false };
Note: See TracChangeset for help on using the changeset viewer.