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

Changeset 286716 in webkit


Ignore:
Timestamp:
Dec 8, 2021, 1:25:30 PM (5 years ago)
Author:
Alan Coon
Message:

Cherry-pick r283353. rdar://problem/85928816

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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612.4.2.1-branch/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog

    r286713 r286716  
     12021-12-01  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r283353. rdar://problem/85928816
     4
     5    Simplify some scrolling-related code in WebKit with use of RectEdges<bool>
     6    https://bugs.webkit.org/show_bug.cgi?id=231037
     7   
     8    Reviewed by Tim Horton.
     9   
     10    Source/WebCore:
     11   
     12    Export edgePinnedState().
     13   
     14    * platform/ScrollableArea.h:
     15   
     16    Source/WebKit:
     17   
     18    Use RectEdges<bool> in code that tracks rubber banding state, and edge pinned state.
     19   
     20    * Shared/WebCoreArgumentCoders.cpp:
     21    (IPC::ArgumentCoder<RectEdges<bool>>::encode):
     22    (IPC::ArgumentCoder<RectEdges<bool>>::decode):
     23    * Shared/WebCoreArgumentCoders.h:
     24    * UIProcess/API/C/WKPage.cpp:
     25    (WKPageIsPinnedToLeftSide):
     26    (WKPageIsPinnedToRightSide):
     27    (WKPageIsPinnedToTopSide):
     28    (WKPageIsPinnedToBottomSide):
     29    (WKPageRubberBandsAtLeft):
     30    (WKPageRubberBandsAtRight):
     31    (WKPageRubberBandsAtTop):
     32    (WKPageRubberBandsAtBottom):
     33    * UIProcess/Cocoa/WebViewImpl.mm:
     34    (WebKit::toWKRectEdge):
     35    (WebKit::toRectEdges):
     36    (WebKit::WebViewImpl::pinnedState):
     37    (WebKit::WebViewImpl::rubberBandingEnabled):
     38    (WebKit::WebViewImpl::setRubberBandingEnabled):
     39    * UIProcess/ViewGestureController.cpp:
     40    (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
     41    * UIProcess/WebPageProxy.cpp:
     42    (WebKit::WebPageProxy::sendWheelEvent):
     43    (WebKit::WebPageProxy::setRubberBandsAtLeft):
     44    (WebKit::WebPageProxy::setRubberBandsAtRight):
     45    (WebKit::WebPageProxy::setRubberBandsAtTop):
     46    (WebKit::WebPageProxy::setRubberBandsAtBottom):
     47    (WebKit::WebPageProxy::didCommitLoadForFrame):
     48    (WebKit::WebPageProxy::resetState):
     49    (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
     50    (WebKit::WebPageProxy::rubberBandsAtLeft const): Deleted.
     51    (WebKit::WebPageProxy::rubberBandsAtRight const): Deleted.
     52    (WebKit::WebPageProxy::rubberBandsAtTop const): Deleted.
     53    (WebKit::WebPageProxy::rubberBandsAtBottom const): Deleted.
     54    * UIProcess/WebPageProxy.h:
     55    * UIProcess/WebPageProxy.messages.in:
     56    * WebProcess/WebPage/EventDispatcher.cpp:
     57    (WebKit::EventDispatcher::wheelEvent):
     58    * WebProcess/WebPage/EventDispatcher.h:
     59    * WebProcess/WebPage/EventDispatcher.messages.in:
     60    * WebProcess/WebPage/WebPage.cpp:
     61    (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
     62    * WebProcess/WebPage/WebPage.h:
     63   
     64    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     65
     66    2021-09-30  Simon Fraser  <simon.fraser@apple.com>
     67
     68            Simplify some scrolling-related code in WebKit with use of RectEdges<bool>
     69            https://bugs.webkit.org/show_bug.cgi?id=231037
     70
     71            Reviewed by Tim Horton.
     72
     73            Export edgePinnedState().
     74
     75            * platform/ScrollableArea.h:
     76
    1772021-12-01  Alan Coon  <alancoon@apple.com>
    278
  • branches/safari-612.4.2.1-branch/Source/WebCore/platform/ScrollableArea.h

    r279218 r286716  
    319319    bool isPinnedForScrollDeltaOnAxis(float scrollDelta, ScrollEventAxis) const;
    320320    bool isPinnedForScrollDelta(const FloatSize&) const;
    321     RectEdges<bool> edgePinnedState() const;
     321    WEBCORE_EXPORT RectEdges<bool> edgePinnedState() const;
    322322
    323323    // True if scrolling happens by moving compositing layers.
  • branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog

    r286714 r286716  
     12021-12-01  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r283353. rdar://problem/85928816
     4
     5    Simplify some scrolling-related code in WebKit with use of RectEdges<bool>
     6    https://bugs.webkit.org/show_bug.cgi?id=231037
     7   
     8    Reviewed by Tim Horton.
     9   
     10    Source/WebCore:
     11   
     12    Export edgePinnedState().
     13   
     14    * platform/ScrollableArea.h:
     15   
     16    Source/WebKit:
     17   
     18    Use RectEdges<bool> in code that tracks rubber banding state, and edge pinned state.
     19   
     20    * Shared/WebCoreArgumentCoders.cpp:
     21    (IPC::ArgumentCoder<RectEdges<bool>>::encode):
     22    (IPC::ArgumentCoder<RectEdges<bool>>::decode):
     23    * Shared/WebCoreArgumentCoders.h:
     24    * UIProcess/API/C/WKPage.cpp:
     25    (WKPageIsPinnedToLeftSide):
     26    (WKPageIsPinnedToRightSide):
     27    (WKPageIsPinnedToTopSide):
     28    (WKPageIsPinnedToBottomSide):
     29    (WKPageRubberBandsAtLeft):
     30    (WKPageRubberBandsAtRight):
     31    (WKPageRubberBandsAtTop):
     32    (WKPageRubberBandsAtBottom):
     33    * UIProcess/Cocoa/WebViewImpl.mm:
     34    (WebKit::toWKRectEdge):
     35    (WebKit::toRectEdges):
     36    (WebKit::WebViewImpl::pinnedState):
     37    (WebKit::WebViewImpl::rubberBandingEnabled):
     38    (WebKit::WebViewImpl::setRubberBandingEnabled):
     39    * UIProcess/ViewGestureController.cpp:
     40    (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
     41    * UIProcess/WebPageProxy.cpp:
     42    (WebKit::WebPageProxy::sendWheelEvent):
     43    (WebKit::WebPageProxy::setRubberBandsAtLeft):
     44    (WebKit::WebPageProxy::setRubberBandsAtRight):
     45    (WebKit::WebPageProxy::setRubberBandsAtTop):
     46    (WebKit::WebPageProxy::setRubberBandsAtBottom):
     47    (WebKit::WebPageProxy::didCommitLoadForFrame):
     48    (WebKit::WebPageProxy::resetState):
     49    (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
     50    (WebKit::WebPageProxy::rubberBandsAtLeft const): Deleted.
     51    (WebKit::WebPageProxy::rubberBandsAtRight const): Deleted.
     52    (WebKit::WebPageProxy::rubberBandsAtTop const): Deleted.
     53    (WebKit::WebPageProxy::rubberBandsAtBottom const): Deleted.
     54    * UIProcess/WebPageProxy.h:
     55    * UIProcess/WebPageProxy.messages.in:
     56    * WebProcess/WebPage/EventDispatcher.cpp:
     57    (WebKit::EventDispatcher::wheelEvent):
     58    * WebProcess/WebPage/EventDispatcher.h:
     59    * WebProcess/WebPage/EventDispatcher.messages.in:
     60    * WebProcess/WebPage/WebPage.cpp:
     61    (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
     62    * WebProcess/WebPage/WebPage.h:
     63   
     64    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     65
     66    2021-09-30  Simon Fraser  <simon.fraser@apple.com>
     67
     68            Simplify some scrolling-related code in WebKit with use of RectEdges<bool>
     69            https://bugs.webkit.org/show_bug.cgi?id=231037
     70
     71            Reviewed by Tim Horton.
     72
     73            Use RectEdges<bool> in code that tracks rubber banding state, and edge pinned state.
     74
     75            * Shared/WebCoreArgumentCoders.cpp:
     76            (IPC::ArgumentCoder<RectEdges<bool>>::encode):
     77            (IPC::ArgumentCoder<RectEdges<bool>>::decode):
     78            * Shared/WebCoreArgumentCoders.h:
     79            * UIProcess/API/C/WKPage.cpp:
     80            (WKPageIsPinnedToLeftSide):
     81            (WKPageIsPinnedToRightSide):
     82            (WKPageIsPinnedToTopSide):
     83            (WKPageIsPinnedToBottomSide):
     84            (WKPageRubberBandsAtLeft):
     85            (WKPageRubberBandsAtRight):
     86            (WKPageRubberBandsAtTop):
     87            (WKPageRubberBandsAtBottom):
     88            * UIProcess/Cocoa/WebViewImpl.mm:
     89            (WebKit::toWKRectEdge):
     90            (WebKit::toRectEdges):
     91            (WebKit::WebViewImpl::pinnedState):
     92            (WebKit::WebViewImpl::rubberBandingEnabled):
     93            (WebKit::WebViewImpl::setRubberBandingEnabled):
     94            * UIProcess/ViewGestureController.cpp:
     95            (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
     96            * UIProcess/WebPageProxy.cpp:
     97            (WebKit::WebPageProxy::sendWheelEvent):
     98            (WebKit::WebPageProxy::setRubberBandsAtLeft):
     99            (WebKit::WebPageProxy::setRubberBandsAtRight):
     100            (WebKit::WebPageProxy::setRubberBandsAtTop):
     101            (WebKit::WebPageProxy::setRubberBandsAtBottom):
     102            (WebKit::WebPageProxy::didCommitLoadForFrame):
     103            (WebKit::WebPageProxy::resetState):
     104            (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
     105            (WebKit::WebPageProxy::rubberBandsAtLeft const): Deleted.
     106            (WebKit::WebPageProxy::rubberBandsAtRight const): Deleted.
     107            (WebKit::WebPageProxy::rubberBandsAtTop const): Deleted.
     108            (WebKit::WebPageProxy::rubberBandsAtBottom const): Deleted.
     109            * UIProcess/WebPageProxy.h:
     110            * UIProcess/WebPageProxy.messages.in:
     111            * WebProcess/WebPage/EventDispatcher.cpp:
     112            (WebKit::EventDispatcher::wheelEvent):
     113            * WebProcess/WebPage/EventDispatcher.h:
     114            * WebProcess/WebPage/EventDispatcher.messages.in:
     115            * WebProcess/WebPage/WebPage.cpp:
     116            (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
     117            * WebProcess/WebPage/WebPage.h:
     118
    11192021-12-01  Alan Coon  <alancoon@apple.com>
    2120
  • branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebCoreArgumentCoders.cpp

    r285459 r286716  
    676676    return SimpleArgumentCoder<FloatBoxExtent>::decode(decoder, floatBoxExtent);
    677677}
    678    
     678
     679
     680void ArgumentCoder<RectEdges<bool>>::encode(Encoder& encoder, const RectEdges<bool>& boxEdges)
     681{
     682    SimpleArgumentCoder<RectEdges<bool>>::encode(encoder, boxEdges);
     683}
     684   
     685bool ArgumentCoder<RectEdges<bool>>::decode(Decoder& decoder, RectEdges<bool>& boxEdges)
     686{
     687    return SimpleArgumentCoder<RectEdges<bool>>::decode(decoder, boxEdges);
     688}
     689
    679690
    680691void ArgumentCoder<FloatSize>::encode(Encoder& encoder, const FloatSize& floatSize)
  • branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebCoreArgumentCoders.h

    r285459 r286716  
    320320};
    321321
     322template<> struct ArgumentCoder<WebCore::RectEdges<bool>> {
     323    static void encode(Encoder&, const WebCore::RectEdges<bool>&);
     324    static WARN_UNUSED_RETURN bool decode(Decoder&, WebCore::RectEdges<bool>&);
     325};
     326
    322327template<> struct ArgumentCoder<WebCore::FloatSize> {
    323328    static void encode(Encoder&, const WebCore::FloatSize&);
  • branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r284275 r286716  
    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
  • branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm

    r285555 r286716  
    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
  • branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/ViewGestureController.cpp

    r278880 r286716  
    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;
  • branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

    r286510 r286716  
    29262926    if (!connection)
    29272927        return;
    2928 
    2929     connection->send(
    2930         Messages::EventDispatcher::WheelEvent(
    2931             m_webPageID,
    2932             event,
    2933             shouldUseImplicitRubberBandControl() ? !m_backForwardList->backItem() : rubberBandsAtLeft(),
    2934             shouldUseImplicitRubberBandControl() ? !m_backForwardList->forwardItem() : rubberBandsAtRight(),
    2935             rubberBandsAtTop(),
    2936             rubberBandsAtBottom()
    2937     ), 0, { }, Thread::QOS::UserInteractive);
     2928   
     2929    auto rubberBandableEdges = this->rubberBandableEdges();
     2930    if (shouldUseImplicitRubberBandControl()) {
     2931        rubberBandableEdges.setLeft(!m_backForwardList->backItem());
     2932        rubberBandableEdges.setRight(!m_backForwardList->forwardItem());
     2933    }
     2934    connection -> send(Messages::EventDispatcher::WheelEvent(m_webPageID, event, rubberBandableEdges), 0);
    29382935
    29392936    // Manually ping the web process to check for responsiveness since our wheel
     
    41304127}
    41314128
    4132 bool WebPageProxy::rubberBandsAtLeft() const
    4133 {
    4134     return m_rubberBandsAtLeft;
    4135 }
    4136 
    41374129void WebPageProxy::setRubberBandsAtLeft(bool rubberBandsAtLeft)
    41384130{
    4139     m_rubberBandsAtLeft = rubberBandsAtLeft;
    4140 }
    4141 
    4142 bool WebPageProxy::rubberBandsAtRight() const
    4143 {
    4144     return m_rubberBandsAtRight;
     4131    m_rubberBandableEdges.setLeft(rubberBandsAtLeft);
    41454132}
    41464133
    41474134void WebPageProxy::setRubberBandsAtRight(bool rubberBandsAtRight)
    41484135{
    4149     m_rubberBandsAtRight = rubberBandsAtRight;
    4150 }
    4151 
    4152 bool WebPageProxy::rubberBandsAtTop() const
    4153 {
    4154     return m_rubberBandsAtTop;
     4136    m_rubberBandableEdges.setRight(rubberBandsAtRight);
    41554137}
    41564138
    41574139void WebPageProxy::setRubberBandsAtTop(bool rubberBandsAtTop)
    41584140{
    4159     m_rubberBandsAtTop = rubberBandsAtTop;
    4160 }
    4161 
    4162 bool WebPageProxy::rubberBandsAtBottom() const
    4163 {
    4164     return m_rubberBandsAtBottom;
     4141    m_rubberBandableEdges.setTop(rubberBandsAtTop);
    41654142}
    41664143
    41674144void WebPageProxy::setRubberBandsAtBottom(bool rubberBandsAtBottom)
    41684145{
    4169     m_rubberBandsAtBottom = rubberBandsAtBottom;
     4146    m_rubberBandableEdges.setBottom(rubberBandsAtBottom);
    41704147}
    41714148   
     
    49394916            // Always assume that the main frame is pinned here, since the custom representation view will handle
    49404917            // any wheel events and dispatch them to the WKView when necessary.
    4941             m_mainFrameIsPinnedToLeftSide = true;
    4942             m_mainFrameIsPinnedToRightSide = true;
    4943             m_mainFrameIsPinnedToTopSide = true;
    4944             m_mainFrameIsPinnedToBottomSide = true;
    4945 
     4918            m_mainFramePinnedState = { true, true, true, true };
    49464919            m_uiClient->pinnedStateDidChange(*this);
    49474920        }
     
    78557828    m_mainFrameHasVerticalScrollbar = false;
    78567829
    7857     m_mainFrameIsPinnedToLeftSide = true;
    7858     m_mainFrameIsPinnedToRightSide = true;
    7859     m_mainFrameIsPinnedToTopSide = true;
    7860     m_mainFrameIsPinnedToBottomSide = true;
     7830    m_mainFramePinnedState = { true, true, true, true };
    78617831
    78627832    m_visibleScrollerThumbRect = IntRect();
     
    87658735}
    87668736
    8767 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide)
     8737void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(RectEdges<bool> pinnedState)
    87688738{
    87698739    pageClient().pinnedStateWillChange();
    8770     m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide;
    8771     m_mainFrameIsPinnedToRightSide = pinnedToRightSide;
    8772     m_mainFrameIsPinnedToTopSide = pinnedToTopSide;
    8773     m_mainFrameIsPinnedToBottomSide = pinnedToBottomSide;
     8740    m_mainFramePinnedState = pinnedState;
    87748741    pageClient().pinnedStateDidChange();
    87758742
  • branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/WebPageProxy.h

    r286510 r286716  
    102102#include <WebCore/PlatformSpeechSynthesizer.h>
    103103#include <WebCore/PointerID.h>
     104#include <WebCore/RectEdges.h>
    104105#include <WebCore/RegistrableDomain.h>
    105106#include <WebCore/RunJavaScriptParameters.h>
     
    10861087    bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
    10871088
    1088     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
    1089     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
    1090     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
    1091     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
    1092 
    1093     bool rubberBandsAtLeft() const;
     1089    WebCore::RectEdges<bool> pinnedState() const { return m_mainFramePinnedState; }
     1090
     1091    WebCore::RectEdges<bool> rubberBandableEdges() const { return m_rubberBandableEdges; }
     1092    void setRubberBandableEdges(WebCore::RectEdges<bool> edges) { m_rubberBandableEdges = edges; }
    10941093    void setRubberBandsAtLeft(bool);
    1095     bool rubberBandsAtRight() const;
    10961094    void setRubberBandsAtRight(bool);
    1097     bool rubberBandsAtTop() const;
    10981095    void setRubberBandsAtTop(bool);
    1099     bool rubberBandsAtBottom() const;
    11001096    void setRubberBandsAtBottom(bool);
    11011097
     
    21492145    void recommendedScrollbarStyleDidChange(int32_t newStyle);
    21502146    void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
    2151     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
     2147    void didChangeScrollOffsetPinningForMainFrame(WebCore::RectEdges<bool>);
    21522148    void didChangePageCount(unsigned);
    21532149    void themeColorChanged(const WebCore::Color&);
     
    28522848
    28532849    PageLoadState m_pageLoadState;
    2854    
     2850
     2851    WebCore::RectEdges<bool> m_mainFramePinnedState { true, true, true, true };
     2852    WebCore::RectEdges<bool> m_rubberBandableEdges { true, true, true, true };
     2853
    28552854    bool m_delegatesScrolling { false };
    28562855
     
    28612860    bool m_canShortCircuitHorizontalWheelEvents { true };
    28622861
    2863     bool m_mainFrameIsPinnedToLeftSide { true };
    2864     bool m_mainFrameIsPinnedToRightSide { true };
    2865     bool m_mainFrameIsPinnedToTopSide { true };
    2866     bool m_mainFrameIsPinnedToBottomSide { true };
    2867 
    28682862    bool m_shouldUseImplicitRubberBandControl { false };
    2869     bool m_rubberBandsAtLeft { true };
    2870     bool m_rubberBandsAtRight { true };
    2871     bool m_rubberBandsAtTop { true };
    2872     bool m_rubberBandsAtBottom { true };
    28732863       
    28742864    bool m_enableVerticalRubberBanding { true };
  • branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in

    r283929 r286716  
    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)
  • branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp

    r277787 r286716  
    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);
  • branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/EventDispatcher.h

    r277958 r286716  
    3131#include <WebCore/PageIdentifier.h>
    3232#include <WebCore/PlatformWheelEvent.h>
     33#include <WebCore/RectEdges.h>
    3334#include <WebCore/WheelEventDeltaFilter.h>
    3435#include <memory>
     
    8485
    8586    // Message handlers
    86     void wheelEvent(WebCore::PageIdentifier, const WebWheelEvent&, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom);
     87    void wheelEvent(WebCore::PageIdentifier, const WebWheelEvent&, WebCore::RectEdges<bool> rubberBandableEdges);
    8788#if ENABLE(IOS_TOUCH_EVENTS)
    8889    void touchEvent(WebCore::PageIdentifier, const WebTouchEvent&, CompletionHandler<void(bool)>&&);
  • branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/EventDispatcher.messages.in

    r275440 r286716  
    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
  • branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp

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

    r286510 r286716  
    8282#include <WebCore/PointerCharacteristics.h>
    8383#include <WebCore/PointerID.h>
     84#include <WebCore/RectEdges.h>
    8485#include <WebCore/SecurityPolicyViolationEvent.h>
    8586#include <WebCore/ShareData.h>
     
    21572158#endif
    21582159
    2159     bool m_cachedMainFrameIsPinnedToLeftSide { true };
    2160     bool m_cachedMainFrameIsPinnedToRightSide { true };
    2161     bool m_cachedMainFrameIsPinnedToTopSide { true };
    2162     bool m_cachedMainFrameIsPinnedToBottomSide { true };
     2160    WebCore::RectEdges<bool> m_cachedMainFramePinnedState { true, true, true, true };
    21632161    bool m_canShortCircuitHorizontalWheelEvents { false };
    21642162    bool m_hasWheelEventHandlers { false };
Note: See TracChangeset for help on using the changeset viewer.