Changeset 286716 in webkit
- Timestamp:
- Dec 8, 2021, 1:25:30 PM (5 years ago)
- Location:
- branches/safari-612.4.2.1-branch/Source
- Files:
-
- 16 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/ScrollableArea.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/WebCoreArgumentCoders.cpp (modified) (1 diff)
-
WebKit/Shared/WebCoreArgumentCoders.h (modified) (1 diff)
-
WebKit/UIProcess/API/C/WKPage.cpp (modified) (4 diffs)
-
WebKit/UIProcess/Cocoa/WebViewImpl.mm (modified) (1 diff)
-
WebKit/UIProcess/ViewGestureController.cpp (modified) (1 diff)
-
WebKit/UIProcess/WebPageProxy.cpp (modified) (5 diffs)
-
WebKit/UIProcess/WebPageProxy.h (modified) (5 diffs)
-
WebKit/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
WebKit/WebProcess/WebPage/EventDispatcher.cpp (modified) (3 diffs)
-
WebKit/WebProcess/WebPage/EventDispatcher.h (modified) (2 diffs)
-
WebKit/WebProcess/WebPage/EventDispatcher.messages.in (modified) (1 diff)
-
WebKit/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
WebKit/WebProcess/WebPage/WebPage.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog
r286713 r286716 1 2021-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 1 77 2021-12-01 Alan Coon <alancoon@apple.com> 2 78 -
branches/safari-612.4.2.1-branch/Source/WebCore/platform/ScrollableArea.h
r279218 r286716 319 319 bool isPinnedForScrollDeltaOnAxis(float scrollDelta, ScrollEventAxis) const; 320 320 bool isPinnedForScrollDelta(const FloatSize&) const; 321 RectEdges<bool> edgePinnedState() const;321 WEBCORE_EXPORT RectEdges<bool> edgePinnedState() const; 322 322 323 323 // True if scrolling happens by moving compositing layers. -
branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog
r286714 r286716 1 2021-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 1 119 2021-12-01 Alan Coon <alancoon@apple.com> 2 120 -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
r285459 r286716 676 676 return SimpleArgumentCoder<FloatBoxExtent>::decode(decoder, floatBoxExtent); 677 677 } 678 678 679 680 void ArgumentCoder<RectEdges<bool>>::encode(Encoder& encoder, const RectEdges<bool>& boxEdges) 681 { 682 SimpleArgumentCoder<RectEdges<bool>>::encode(encoder, boxEdges); 683 } 684 685 bool ArgumentCoder<RectEdges<bool>>::decode(Decoder& decoder, RectEdges<bool>& boxEdges) 686 { 687 return SimpleArgumentCoder<RectEdges<bool>>::decode(decoder, boxEdges); 688 } 689 679 690 680 691 void ArgumentCoder<FloatSize>::encode(Encoder& encoder, const FloatSize& floatSize) -
branches/safari-612.4.2.1-branch/Source/WebKit/Shared/WebCoreArgumentCoders.h
r285459 r286716 320 320 }; 321 321 322 template<> 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 322 327 template<> struct ArgumentCoder<WebCore::FloatSize> { 323 328 static void encode(Encoder&, const WebCore::FloatSize&); -
branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/API/C/WKPage.cpp
r284275 r286716 679 679 bool WKPageIsPinnedToLeftSide(WKPageRef pageRef) 680 680 { 681 return toImpl(pageRef)-> isPinnedToLeftSide();681 return toImpl(pageRef)->pinnedState().left(); 682 682 } 683 683 684 684 bool WKPageIsPinnedToRightSide(WKPageRef pageRef) 685 685 { 686 return toImpl(pageRef)-> isPinnedToRightSide();686 return toImpl(pageRef)->pinnedState().right(); 687 687 } 688 688 689 689 bool WKPageIsPinnedToTopSide(WKPageRef pageRef) 690 690 { 691 return toImpl(pageRef)-> isPinnedToTopSide();691 return toImpl(pageRef)->pinnedState().top(); 692 692 } 693 693 694 694 bool WKPageIsPinnedToBottomSide(WKPageRef pageRef) 695 695 { 696 return toImpl(pageRef)-> isPinnedToBottomSide();696 return toImpl(pageRef)->pinnedState().bottom(); 697 697 } 698 698 699 699 bool WKPageRubberBandsAtLeft(WKPageRef pageRef) 700 700 { 701 return toImpl(pageRef)->rubberBand sAtLeft();701 return toImpl(pageRef)->rubberBandableEdges().left(); 702 702 } 703 703 … … 710 710 bool WKPageRubberBandsAtRight(WKPageRef pageRef) 711 711 { 712 return toImpl(pageRef)->rubberBand sAtRight();712 return toImpl(pageRef)->rubberBandableEdges().right(); 713 713 } 714 714 … … 721 721 bool WKPageRubberBandsAtTop(WKPageRef pageRef) 722 722 { 723 return toImpl(pageRef)->rubberBand sAtTop();723 return toImpl(pageRef)->rubberBandableEdges().top(); 724 724 } 725 725 … … 732 732 bool WKPageRubberBandsAtBottom(WKPageRef pageRef) 733 733 { 734 return toImpl(pageRef)->rubberBand sAtBottom();734 return toImpl(pageRef)->rubberBandableEdges().bottom(); 735 735 } 736 736 -
branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r285555 r286716 5610 5610 } 5611 5611 5612 static _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 5631 static RectEdges<bool> toRectEdges(_WKRectEdge edges) 5632 { 5633 return { 5634 edges & _WKRectEdgeTop, 5635 edges & _WKRectEdgeRight, 5636 edges & _WKRectEdgeBottom, 5637 edges & _WKRectEdgeLeft 5638 }; 5639 } 5640 5612 5641 _WKRectEdge WebViewImpl::pinnedState() 5613 5642 { 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()); 5624 5644 } 5625 5645 5626 5646 _WKRectEdge WebViewImpl::rubberBandingEnabled() 5627 5647 { 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()); 5638 5649 } 5639 5650 5640 5651 void WebViewImpl::setRubberBandingEnabled(_WKRectEdge state) 5641 5652 { 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)); 5646 5654 } 5647 5655 -
branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/ViewGestureController.cpp
r278880 r286716 422 422 return false; 423 423 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(); 426 426 427 427 bool tryingToSwipeBack = size.width() > 0 && isPinnedToLeft; -
branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/WebPageProxy.cpp
r286510 r286716 2926 2926 if (!connection) 2927 2927 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); 2938 2935 2939 2936 // Manually ping the web process to check for responsiveness since our wheel … … 4130 4127 } 4131 4128 4132 bool WebPageProxy::rubberBandsAtLeft() const4133 {4134 return m_rubberBandsAtLeft;4135 }4136 4137 4129 void WebPageProxy::setRubberBandsAtLeft(bool rubberBandsAtLeft) 4138 4130 { 4139 m_rubberBandsAtLeft = rubberBandsAtLeft; 4140 } 4141 4142 bool WebPageProxy::rubberBandsAtRight() const 4143 { 4144 return m_rubberBandsAtRight; 4131 m_rubberBandableEdges.setLeft(rubberBandsAtLeft); 4145 4132 } 4146 4133 4147 4134 void WebPageProxy::setRubberBandsAtRight(bool rubberBandsAtRight) 4148 4135 { 4149 m_rubberBandsAtRight = rubberBandsAtRight; 4150 } 4151 4152 bool WebPageProxy::rubberBandsAtTop() const 4153 { 4154 return m_rubberBandsAtTop; 4136 m_rubberBandableEdges.setRight(rubberBandsAtRight); 4155 4137 } 4156 4138 4157 4139 void WebPageProxy::setRubberBandsAtTop(bool rubberBandsAtTop) 4158 4140 { 4159 m_rubberBandsAtTop = rubberBandsAtTop; 4160 } 4161 4162 bool WebPageProxy::rubberBandsAtBottom() const 4163 { 4164 return m_rubberBandsAtBottom; 4141 m_rubberBandableEdges.setTop(rubberBandsAtTop); 4165 4142 } 4166 4143 4167 4144 void WebPageProxy::setRubberBandsAtBottom(bool rubberBandsAtBottom) 4168 4145 { 4169 m_rubberBand sAtBottom = rubberBandsAtBottom;4146 m_rubberBandableEdges.setBottom(rubberBandsAtBottom); 4170 4147 } 4171 4148 … … 4939 4916 // Always assume that the main frame is pinned here, since the custom representation view will handle 4940 4917 // 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 }; 4946 4919 m_uiClient->pinnedStateDidChange(*this); 4947 4920 } … … 7855 7828 m_mainFrameHasVerticalScrollbar = false; 7856 7829 7857 m_mainFrameIsPinnedToLeftSide = true; 7858 m_mainFrameIsPinnedToRightSide = true; 7859 m_mainFrameIsPinnedToTopSide = true; 7860 m_mainFrameIsPinnedToBottomSide = true; 7830 m_mainFramePinnedState = { true, true, true, true }; 7861 7831 7862 7832 m_visibleScrollerThumbRect = IntRect(); … … 8765 8735 } 8766 8736 8767 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame( bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide)8737 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(RectEdges<bool> pinnedState) 8768 8738 { 8769 8739 pageClient().pinnedStateWillChange(); 8770 m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide; 8771 m_mainFrameIsPinnedToRightSide = pinnedToRightSide; 8772 m_mainFrameIsPinnedToTopSide = pinnedToTopSide; 8773 m_mainFrameIsPinnedToBottomSide = pinnedToBottomSide; 8740 m_mainFramePinnedState = pinnedState; 8774 8741 pageClient().pinnedStateDidChange(); 8775 8742 -
branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/WebPageProxy.h
r286510 r286716 102 102 #include <WebCore/PlatformSpeechSynthesizer.h> 103 103 #include <WebCore/PointerID.h> 104 #include <WebCore/RectEdges.h> 104 105 #include <WebCore/RegistrableDomain.h> 105 106 #include <WebCore/RunJavaScriptParameters.h> … … 1086 1087 bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; } 1087 1088 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; } 1094 1093 void setRubberBandsAtLeft(bool); 1095 bool rubberBandsAtRight() const;1096 1094 void setRubberBandsAtRight(bool); 1097 bool rubberBandsAtTop() const;1098 1095 void setRubberBandsAtTop(bool); 1099 bool rubberBandsAtBottom() const;1100 1096 void setRubberBandsAtBottom(bool); 1101 1097 … … 2149 2145 void recommendedScrollbarStyleDidChange(int32_t newStyle); 2150 2146 void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar); 2151 void didChangeScrollOffsetPinningForMainFrame( bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);2147 void didChangeScrollOffsetPinningForMainFrame(WebCore::RectEdges<bool>); 2152 2148 void didChangePageCount(unsigned); 2153 2149 void themeColorChanged(const WebCore::Color&); … … 2852 2848 2853 2849 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 2855 2854 bool m_delegatesScrolling { false }; 2856 2855 … … 2861 2860 bool m_canShortCircuitHorizontalWheelEvents { true }; 2862 2861 2863 bool m_mainFrameIsPinnedToLeftSide { true };2864 bool m_mainFrameIsPinnedToRightSide { true };2865 bool m_mainFrameIsPinnedToTopSide { true };2866 bool m_mainFrameIsPinnedToBottomSide { true };2867 2868 2862 bool m_shouldUseImplicitRubberBandControl { false }; 2869 bool m_rubberBandsAtLeft { true };2870 bool m_rubberBandsAtRight { true };2871 bool m_rubberBandsAtTop { true };2872 bool m_rubberBandsAtBottom { true };2873 2863 2874 2864 bool m_enableVerticalRubberBanding { true }; -
branches/safari-612.4.2.1-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in
r283929 r286716 76 76 RecommendedScrollbarStyleDidChange(int32_t newStyle) 77 77 DidChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar) 78 DidChangeScrollOffsetPinningForMainFrame( bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide)78 DidChangeScrollOffsetPinningForMainFrame(WebCore::RectEdges<bool> pinnedState) 79 79 DidChangePageCount(unsigned pageCount) 80 80 ThemeColorChanged(WebCore::Color themeColor) -
branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
r277787 r286716 97 97 } 98 98 99 void EventDispatcher::wheelEvent(PageIdentifier pageID, const WebWheelEvent& wheelEvent, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)99 void EventDispatcher::wheelEvent(PageIdentifier pageID, const WebWheelEvent& wheelEvent, RectEdges<bool> rubberBandableEdges) 100 100 { 101 101 #if PLATFORM(COCOA) || ENABLE(SCROLLING_THREAD) … … 138 138 // We only need to do this at the beginning of the gesture. 139 139 if (platformWheelEvent.phase() == PlatformWheelEventPhase::Began) 140 scrollingTree->setMainFrameCanRubberBand( { canRubberBandAtTop, canRubberBandAtRight, canRubberBandAtBottom, canRubberBandAtLeft });140 scrollingTree->setMainFrameCanRubberBand(rubberBandableEdges); 141 141 142 142 auto processingSteps = scrollingTree->determineWheelEventProcessing(platformWheelEvent); … … 166 166 } while (false); 167 167 #else 168 UNUSED_PARAM(canRubberBandAtLeft); 169 UNUSED_PARAM(canRubberBandAtRight); 170 UNUSED_PARAM(canRubberBandAtTop); 171 UNUSED_PARAM(canRubberBandAtBottom); 168 UNUSED_PARAM(rubberBandableEdges); 172 169 173 170 dispatchWheelEventViaMainThread(pageID, wheelEvent, processingSteps); -
branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/EventDispatcher.h
r277958 r286716 31 31 #include <WebCore/PageIdentifier.h> 32 32 #include <WebCore/PlatformWheelEvent.h> 33 #include <WebCore/RectEdges.h> 33 34 #include <WebCore/WheelEventDeltaFilter.h> 34 35 #include <memory> … … 84 85 85 86 // 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); 87 88 #if ENABLE(IOS_TOUCH_EVENTS) 88 89 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 22 22 23 23 messages -> 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) 25 25 #if ENABLE(IOS_TOUCH_EVENTS) 26 26 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 4943 4943 void WebPage::updateMainFrameScrollOffsetPinning() 4944 4944 { 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; 4962 4953 } 4963 4954 } -
branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.h
r286510 r286716 82 82 #include <WebCore/PointerCharacteristics.h> 83 83 #include <WebCore/PointerID.h> 84 #include <WebCore/RectEdges.h> 84 85 #include <WebCore/SecurityPolicyViolationEvent.h> 85 86 #include <WebCore/ShareData.h> … … 2157 2158 #endif 2158 2159 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 }; 2163 2161 bool m_canShortCircuitHorizontalWheelEvents { false }; 2164 2162 bool m_hasWheelEventHandlers { false };
Note:
See TracChangeset
for help on using the changeset viewer.