Changeset 283353 in webkit
- Timestamp:
- Sep 30, 2021, 5:40:33 PM (5 years ago)
- Location:
- trunk/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
-
trunk/Source/WebCore/ChangeLog
r283347 r283353 1 2021-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 1 12 2021-09-30 Sihui Liu <sihui_liu@apple.com> 2 13 -
trunk/Source/WebCore/platform/ScrollableArea.h
r283335 r283353 322 322 // "Pinned" means scrolled at or beyond the edge. 323 323 bool isPinnedOnSide(BoxSide) const; 324 RectEdges<bool> edgePinnedState() const;324 WEBCORE_EXPORT RectEdges<bool> edgePinnedState() const; 325 325 326 326 // True if scrolling happens by moving compositing layers. -
trunk/Source/WebKit/ChangeLog
r283333 r283353 1 2021-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 1 54 2021-09-30 Christopher Reid <chris.reid@sony.com> 2 55 -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
r283048 r283353 675 675 return SimpleArgumentCoder<FloatBoxExtent>::decode(decoder, floatBoxExtent); 676 676 } 677 677 678 679 void ArgumentCoder<RectEdges<bool>>::encode(Encoder& encoder, const RectEdges<bool>& boxEdges) 680 { 681 SimpleArgumentCoder<RectEdges<bool>>::encode(encoder, boxEdges); 682 } 683 684 bool ArgumentCoder<RectEdges<bool>>::decode(Decoder& decoder, RectEdges<bool>& boxEdges) 685 { 686 return SimpleArgumentCoder<RectEdges<bool>>::decode(decoder, boxEdges); 687 } 688 678 689 679 690 void ArgumentCoder<FloatSize>::encode(Encoder& encoder, const FloatSize& floatSize) -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h
r283048 r283353 322 322 }; 323 323 324 template<> 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 324 329 template<> struct ArgumentCoder<WebCore::FloatSize> { 325 330 static void encode(Encoder&, const WebCore::FloatSize&); -
trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp
r283316 r283353 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 -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r282889 r283353 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 -
trunk/Source/WebKit/UIProcess/ViewGestureController.cpp
r278880 r283353 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; -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r283316 r283353 2919 2919 #endif 2920 2920 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); 2930 2927 2931 2928 // Manually ping the web process to check for responsiveness since our wheel … … 4134 4131 } 4135 4132 4136 bool WebPageProxy::rubberBandsAtLeft() const4137 {4138 return m_rubberBandsAtLeft;4139 }4140 4141 4133 void WebPageProxy::setRubberBandsAtLeft(bool rubberBandsAtLeft) 4142 4134 { 4143 m_rubberBandsAtLeft = rubberBandsAtLeft; 4144 } 4145 4146 bool WebPageProxy::rubberBandsAtRight() const 4147 { 4148 return m_rubberBandsAtRight; 4135 m_rubberBandableEdges.setLeft(rubberBandsAtLeft); 4149 4136 } 4150 4137 4151 4138 void WebPageProxy::setRubberBandsAtRight(bool rubberBandsAtRight) 4152 4139 { 4153 m_rubberBandsAtRight = rubberBandsAtRight; 4154 } 4155 4156 bool WebPageProxy::rubberBandsAtTop() const 4157 { 4158 return m_rubberBandsAtTop; 4140 m_rubberBandableEdges.setRight(rubberBandsAtRight); 4159 4141 } 4160 4142 4161 4143 void WebPageProxy::setRubberBandsAtTop(bool rubberBandsAtTop) 4162 4144 { 4163 m_rubberBandsAtTop = rubberBandsAtTop; 4164 } 4165 4166 bool WebPageProxy::rubberBandsAtBottom() const 4167 { 4168 return m_rubberBandsAtBottom; 4145 m_rubberBandableEdges.setTop(rubberBandsAtTop); 4169 4146 } 4170 4147 4171 4148 void WebPageProxy::setRubberBandsAtBottom(bool rubberBandsAtBottom) 4172 4149 { 4173 m_rubberBand sAtBottom = rubberBandsAtBottom;4150 m_rubberBandableEdges.setBottom(rubberBandsAtBottom); 4174 4151 } 4175 4152 … … 4943 4920 // Always assume that the main frame is pinned here, since the custom representation view will handle 4944 4921 // 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 }; 4950 4923 m_uiClient->pinnedStateDidChange(*this); 4951 4924 } … … 7883 7856 m_mainFrameHasVerticalScrollbar = false; 7884 7857 7885 m_mainFrameIsPinnedToLeftSide = true; 7886 m_mainFrameIsPinnedToRightSide = true; 7887 m_mainFrameIsPinnedToTopSide = true; 7888 m_mainFrameIsPinnedToBottomSide = true; 7858 m_mainFramePinnedState = { true, true, true, true }; 7889 7859 7890 7860 m_visibleScrollerThumbRect = IntRect(); … … 8799 8769 } 8800 8770 8801 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame( bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide)8771 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(RectEdges<bool> pinnedState) 8802 8772 { 8803 8773 pageClient().pinnedStateWillChange(); 8804 m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide; 8805 m_mainFrameIsPinnedToRightSide = pinnedToRightSide; 8806 m_mainFrameIsPinnedToTopSide = pinnedToTopSide; 8807 m_mainFrameIsPinnedToBottomSide = pinnedToBottomSide; 8774 m_mainFramePinnedState = pinnedState; 8808 8775 pageClient().pinnedStateDidChange(); 8809 8776 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r283320 r283353 105 105 #include <WebCore/PlatformSpeechSynthesizer.h> 106 106 #include <WebCore/PointerID.h> 107 #include <WebCore/RectEdges.h> 107 108 #include <WebCore/RegistrableDomain.h> 108 109 #include <WebCore/RunJavaScriptParameters.h> … … 1095 1096 bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; } 1096 1097 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; } 1103 1102 void setRubberBandsAtLeft(bool); 1104 bool rubberBandsAtRight() const;1105 1103 void setRubberBandsAtRight(bool); 1106 bool rubberBandsAtTop() const;1107 1104 void setRubberBandsAtTop(bool); 1108 bool rubberBandsAtBottom() const;1109 1105 void setRubberBandsAtBottom(bool); 1110 1106 … … 2153 2149 void recommendedScrollbarStyleDidChange(int32_t newStyle); 2154 2150 void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar); 2155 void didChangeScrollOffsetPinningForMainFrame( bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);2151 void didChangeScrollOffsetPinningForMainFrame(WebCore::RectEdges<bool>); 2156 2152 void didChangePageCount(unsigned); 2157 2153 void themeColorChanged(const WebCore::Color&); … … 2860 2856 2861 2857 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 2863 2862 bool m_delegatesScrolling { false }; 2864 2863 … … 2869 2868 bool m_canShortCircuitHorizontalWheelEvents { true }; 2870 2869 2871 bool m_mainFrameIsPinnedToLeftSide { true };2872 bool m_mainFrameIsPinnedToRightSide { true };2873 bool m_mainFrameIsPinnedToTopSide { true };2874 bool m_mainFrameIsPinnedToBottomSide { true };2875 2876 2870 bool m_shouldUseImplicitRubberBandControl { false }; 2877 bool m_rubberBandsAtLeft { true };2878 bool m_rubberBandsAtRight { true };2879 bool m_rubberBandsAtTop { true };2880 bool m_rubberBandsAtBottom { true };2881 2871 2882 2872 bool m_enableVerticalRubberBanding { true }; -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r283304 r283353 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) -
trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
r282755 r283353 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); -
trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h
r281782 r283353 30 30 #include <WebCore/PageIdentifier.h> 31 31 #include <WebCore/PlatformWheelEvent.h> 32 #include <WebCore/RectEdges.h> 32 33 #include <WebCore/WheelEventDeltaFilter.h> 33 34 #include <memory> … … 83 84 84 85 // 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); 86 87 #if ENABLE(IOS_TOUCH_EVENTS) 87 88 void touchEvent(WebCore::PageIdentifier, const WebTouchEvent&, CompletionHandler<void(bool)>&&); -
trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.messages.in
r275440 r283353 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 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r283179 r283353 4944 4944 void WebPage::updateMainFrameScrollOffsetPinning() 4945 4945 { 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; 4963 4954 } 4964 4955 } -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r283304 r283353 84 84 #include <WebCore/PointerCharacteristics.h> 85 85 #include <WebCore/PointerID.h> 86 #include <WebCore/RectEdges.h> 86 87 #include <WebCore/SecurityPolicyViolationEvent.h> 87 88 #include <WebCore/ShareData.h> … … 2167 2168 #endif 2168 2169 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 }; 2173 2171 bool m_canShortCircuitHorizontalWheelEvents { false }; 2174 2172 bool m_hasWheelEventHandlers { false };
Note:
See TracChangeset
for help on using the changeset viewer.