Changeset 163516 in webkit
- Timestamp:
- Feb 5, 2014 10:55:20 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163515 r163516 1 2014-02-05 Simon Fraser <simon.fraser@apple.com> 2 3 Transfer the non-fast-scrollable region to the UI process for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=128293 5 6 Reviewed by Benjamin Poulain. 7 8 Two main changes to support sending the non-fast scrollable region 9 to the UI process for iOS: 10 11 1. Add ScrollingCoordinator::frameViewNonFastScrollableRegionChanged(), 12 which is called when we've updated the touch event region (this can happen 13 independenly of layout). When called we just scheduled a scrolling tree 14 commit with the new region. 15 16 2. Avoid thinking that we have a new root node with every remote scrolling 17 transaction. This was a side-effect of reconstructing the scrolling state 18 tree in the UI process, and caused us to try to grab a nonFastScrollableRegion 19 from a node which never had one set. 20 21 * WebCore.exp.in: 22 * page/scrolling/AsyncScrollingCoordinator.cpp: 23 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): 24 * page/scrolling/AsyncScrollingCoordinator.h: 25 * page/scrolling/ScrollingCoordinator.cpp: 26 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): 27 * page/scrolling/ScrollingCoordinator.h: 28 (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged): 29 * page/scrolling/ScrollingStateTree.h: 30 (WebCore::ScrollingStateTree::setHasNewRootStateNode): 31 * page/scrolling/ScrollingTree.cpp: 32 (WebCore::ScrollingTree::commitNewTreeState): 33 (WebCore::ScrollingTree::isPointInNonFastScrollableRegion): 34 * page/scrolling/ScrollingTree.h: 35 1 36 2014-02-05 Benjamin Poulain <benjamin@webkit.org> 2 37 -
trunk/Source/WebCore/WebCore.exp.in
r163515 r163516 1130 1130 __ZN7WebCore6Editor7outdentEv 1131 1131 __ZN7WebCore6JSNode6s_infoE 1132 __ZN7WebCore6Region21updateBoundsFromShapeEv 1133 __ZNK7WebCore6Region5Shape7isValidEv 1132 1134 __ZN7WebCore6Region5uniteERKS0_ 1133 1135 __ZN7WebCore6Region8subtractERKS0_ … … 2994 2996 __ZN7WebCore13ScrollingTree21setCanRubberBandStateEbbbb 2995 2997 __ZN7WebCore13ScrollingTree31willWheelEventStartSwipeGestureERKNS_18PlatformWheelEventE 2998 __ZN7WebCore13ScrollingTree32isPointInNonFastScrollableRegionENS_8IntPointE 2996 2999 __ZN7WebCore13ScrollingTree35shouldHandleWheelEventSynchronouslyERKNS_18PlatformWheelEventE 2997 3000 __ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb … … 3027 3030 __ZN7WebCore25AsyncScrollingCoordinator30setSynchronousScrollingReasonsEj 3028 3031 __ZN7WebCore25AsyncScrollingCoordinator37scrollableAreaScrollbarLayerDidChangeEPNS_14ScrollableAreaENS_20ScrollbarOrientationE 3032 __ZN7WebCore25AsyncScrollingCoordinator39frameViewNonFastScrollableRegionChangedEPNS_9FrameViewE 3029 3033 __ZN7WebCore25AsyncScrollingCoordinator43recomputeWheelEventHandlerCountForFrameViewEPNS_9FrameViewE 3030 3034 __ZN7WebCore25AsyncScrollingCoordinator44scheduleUpdateScrollPositionAfterAsyncScrollEyRKNS_10FloatPointEbNS_31SetOrSyncScrollingLayerPositionE … … 3042 3046 __ZN7WebCore27ScrollingStateScrollingNode24setCounterScrollingLayerERKNS_19LayerRepresentationE 3043 3047 __ZN7WebCore27ScrollingStateScrollingNode25setWheelEventHandlerCountEj 3048 __ZN7WebCore27ScrollingStateScrollingNode26setNonFastScrollableRegionERKNS_6RegionE 3044 3049 __ZN7WebCore27ScrollingStateScrollingNode27setScrollableAreaParametersERKNS_24ScrollableAreaParametersE 3045 3050 __ZN7WebCore27ScrollingStateScrollingNode30setSynchronousScrollingReasonsEj -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r163231 r163516 106 106 } 107 107 108 void AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged(FrameView*) 109 { 110 if (!m_scrollingStateTree->rootStateNode()) 111 return; 112 113 Region nonFastScrollableRegion = computeNonFastScrollableRegion(&m_page->mainFrame(), IntPoint()); 114 setNonFastScrollableRegionForNode(nonFastScrollableRegion, m_scrollingStateTree->rootStateNode()); 115 } 116 108 117 void AsyncScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView) 109 118 { -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r163231 r163516 79 79 virtual void frameViewLayoutUpdated(FrameView*) override; 80 80 virtual void frameViewRootLayerDidChange(FrameView*) override; 81 virtual void frameViewNonFastScrollableRegionChanged(FrameView*) override; 81 82 82 83 virtual bool requestScrollPositionUpdate(FrameView*, const IntPoint&) override; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r163079 r163516 95 95 Region ScrollingCoordinator::computeNonFastScrollableRegion(const Frame* frame, const IntPoint& frameLocation) const 96 96 { 97 #if PLATFORM(IOS) 98 // On iOS, we use nonFastScrollableRegion to represent the region covered by elements with touch event handlers. 99 ASSERT(frame->isMainFrame()); 100 UNUSED_PARAM(frameLocation); 101 102 Document* document = frame->document(); 103 if (!document) 104 return Region(); 105 106 Vector<IntRect> touchRects; 107 document->getTouchRects(touchRects); 108 109 Region touchRegion; 110 for (auto rect : touchRects) 111 touchRegion.unite(rect); 112 113 return touchRegion; 114 #else 97 115 Region nonFastScrollableRegion; 98 116 FrameView* frameView = frame->view(); … … 127 145 128 146 return nonFastScrollableRegion; 147 #endif 129 148 } 130 149 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r163158 r163516 126 126 void frameViewFixedObjectsDidChange(FrameView*); 127 127 128 // Called whenever the non-fast scrollable region changes for reasons other than layout. 129 virtual void frameViewNonFastScrollableRegionChanged(FrameView*) { } 130 128 131 // Should be called whenever the root layer for the given frame view changes. 129 132 virtual void frameViewRootLayerDidChange(FrameView*); -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h
r161315 r163516 67 67 68 68 bool hasNewRootStateNode() const { return m_hasNewRootStateNode; } 69 void setHasNewRootStateNode(bool hasNewRoot) { m_hasNewRootStateNode = hasNewRoot; } 69 70 70 71 int nodeCount() const { return m_stateNodeMap.size(); } -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r163231 r163516 255 255 } 256 256 257 bool ScrollingTree::isPointInNonFastScrollableRegion(IntPoint p) 258 { 259 MutexLocker lock(m_mutex); 260 261 return m_nonFastScrollableRegion.contains(p); 262 } 263 257 264 bool ScrollingTree::isRubberBandInProgress() 258 265 { -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r163231 r163516 77 77 FloatPoint mainFrameScrollPosition(); 78 78 79 bool isPointInNonFastScrollableRegion(IntPoint); 80 79 81 #if PLATFORM(MAC) && !PLATFORM(IOS) 80 82 virtual void handleWheelEventPhase(PlatformWheelEventPhase) = 0; -
trunk/Source/WebKit2/ChangeLog
r163515 r163516 1 2014-02-05 Simon Fraser <simon.fraser@apple.com> 2 3 Transfer the non-fast-scrollable region to the UI process for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=128293 5 6 Reviewed by Benjamin Poulain. 7 8 Two main changes to support sending the non-fast scrollable region 9 to the UI process for iOS: 10 11 1. Add ScrollingCoordinator::frameViewNonFastScrollableRegionChanged(), 12 which is called when we've updated the touch event region (this can happen 13 independenly of layout). When called we just scheduled a scrolling tree 14 commit with the new region. 15 16 2. Avoid thinking that we have a new root node with every remote scrolling 17 transaction. This was a side-effect of reconstructing the scrolling state 18 tree in the UI process, and caused us to try to grab a nonFastScrollableRegion 19 from a node which never had one set. 20 21 Now that we have the non-fast scrollable region in the UI process, we can 22 use it to avoid sending sync messages to the web process. 23 24 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: 25 (ArgumentCoder<ScrollingStateScrollingNode>::encode): Encode hasNewRootNode. 26 (ArgumentCoder<ScrollingStateScrollingNode>::decode): Decode hasNewRootNode and set it on 27 the state tree. 28 (WebKit::RemoteScrollingCoordinatorTransaction::encode): Encode the nonFastScrollableRegion 29 now that we can encode Regions. 30 (WebKit::RemoteScrollingCoordinatorTransaction::decode): Decode the nonFastScrollableRegion 31 now that we can decode Regions. 32 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: 33 (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): 34 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: 35 * UIProcess/WebPageProxy.cpp: 36 (WebKit::WebPageProxy::handleTouchEvent): If we're not in the non-fast scrollable region, 37 don't both sending touch events to the web process. 38 1 39 2014-02-05 Benjamin Poulain <benjamin@webkit.org> 2 40 -
trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp
r163231 r163516 114 114 SCROLLING_NODE_ENCODE(ScrollOrigin, scrollOrigin) 115 115 SCROLLING_NODE_ENCODE(FrameScaleFactor, frameScaleFactor) 116 // SCROLLING_NODE_ENCODE(NonFastScrollableRegion, nonFastScrollableRegion) // FIXME: no encoder support for Region 116 SCROLLING_NODE_ENCODE(NonFastScrollableRegion, nonFastScrollableRegion) 117 117 SCROLLING_NODE_ENCODE(WheelEventHandlerCount, wheelEventHandlerCount) 118 118 SCROLLING_NODE_ENCODE(ReasonsForSynchronousScrolling, synchronousScrollingReasons) … … 150 150 SCROLLING_NODE_DECODE(ScrollOrigin, IntPoint, setScrollOrigin); 151 151 SCROLLING_NODE_DECODE(FrameScaleFactor, float, setFrameScaleFactor); 152 // SCROLLING_NODE_DECODE(NonFastScrollableRegion, Region, setNonFastScrollableRegion); // FIXME: no decoder support for Region. 152 SCROLLING_NODE_DECODE(NonFastScrollableRegion, Region, setNonFastScrollableRegion); 153 153 SCROLLING_NODE_DECODE(WheelEventHandlerCount, int, setWheelEventHandlerCount); 154 154 SCROLLING_NODE_DECODE(ReasonsForSynchronousScrolling, SynchronousScrollingReasons, setSynchronousScrollingReasons); … … 237 237 int numNodes = m_scrollingStateTree ? m_scrollingStateTree->nodeCount() : 0; 238 238 encoder << numNodes; 239 240 bool hasNewRootNode = m_scrollingStateTree ? m_scrollingStateTree->hasNewRootStateNode() : false; 241 encoder << hasNewRootNode; 239 242 240 243 if (m_scrollingStateTree) { … … 258 261 return false; 259 262 263 bool hasNewRootNode; 264 if (!decoder.decode(hasNewRootNode)) 265 return false; 266 260 267 m_scrollingStateTree = ScrollingStateTree::create(); 261 268 … … 294 301 } 295 302 303 m_scrollingStateTree->setHasNewRootStateNode(hasNewRootNode); 304 296 305 // Removed nodes 297 306 Vector<ScrollingNodeID> removedNodes; -
trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm
r159724 r163516 42 42 return WebEvent::TouchStart; 43 43 case UIWebTouchEventTouchChange: 44 return WebEvent::Touch Start;44 return WebEvent::TouchMove; 45 45 case UIWebTouchEventTouchEnd: 46 return WebEvent::Touch Start;46 return WebEvent::TouchEnd; 47 47 case UIWebTouchEventTouchCancel: 48 return WebEvent::Touch Start;48 return WebEvent::TouchCancel; 49 49 } 50 50 } -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
r162880 r163516 130 130 } 131 131 132 bool RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion(const WebCore::IntPoint& p) const 133 { 134 return m_scrollingTree->isPointInNonFastScrollableRegion(p); 135 } 136 132 137 void RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const IntPoint& offset) 133 138 { -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
r162748 r163516 55 55 void scrollPositionChanged(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition); 56 56 57 bool isPointInNonFastScrollableRegion(const WebCore::IntPoint&) const; 58 57 59 // Called externally when native views move around. 58 60 void scrollPositionChangedViaDelegatedScrolling(WebCore::ScrollingNodeID, const WebCore::IntPoint&); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r163515 r163516 292 292 , m_syncNavigationActionPolicyDownloadID(0) 293 293 , m_processingMouseMoveEvent(false) 294 #if ENABLE(TOUCH_EVENTS)295 , m_needTouchEvents(false)296 #endif297 294 , m_pageID(pageID) 298 295 , m_session(session) … … 1377 1374 1378 1375 #if ENABLE(TOUCH_EVENTS) 1376 static bool anyTouchIsInNonFastScrollableRegion(RemoteScrollingCoordinatorProxy& scrollingCoordinator, const WebTouchEvent& event) 1377 { 1378 for (auto touchPoint : event.touchPoints()) { 1379 if (scrollingCoordinator.isPointInNonFastScrollableRegion(touchPoint.location())) 1380 return true; 1381 } 1382 1383 return false; 1384 } 1385 1379 1386 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event) 1380 1387 { … … 1385 1392 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, then 1386 1393 // we do not send any of the events to the page even if is has listeners. 1387 if (m_needTouchEvents && !m_isPageSuspended) { 1394 if (!m_isPageSuspended) { 1395 // FIXME: we should only do this check for the start of a touch gesture. 1396 if (!anyTouchIsInNonFastScrollableRegion(*m_scrollingCoordinatorProxy, event)) 1397 return; 1398 1388 1399 m_touchEventQueue.append(event); 1389 1400 m_process->responsivenessTimer()->start(); … … 2882 2893 #endif 2883 2894 2884 #if ENABLE(TOUCH_EVENTS)2885 void WebPageProxy::needTouchEvents(bool needTouchEvents)2886 {2887 m_needTouchEvents = needTouchEvents;2888 }2889 #endif2890 2891 2895 #if ENABLE(INPUT_TYPE_COLOR) 2892 2896 void WebPageProxy::showColorPicker(const WebCore::Color& initialColor, const IntRect& elementRect) … … 3880 3884 3881 3885 #if ENABLE(TOUCH_EVENTS) 3882 m_needTouchEvents = false;3883 3886 m_touchEventQueue.clear(); 3884 3887 #endif -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r163515 r163516 1319 1319 1320 1320 #if ENABLE(TOUCH_EVENTS) 1321 bool m_needTouchEvents;1322 1321 Deque<QueuedTouchEvents> m_touchEventQueue; 1323 1322 #endif -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r163515 r163516 95 95 #endif 96 96 97 #if ENABLE(TOUCH_EVENTS)98 NeedTouchEvents(bool needTouchEvents)99 #endif100 101 97 #if ENABLE(INPUT_TYPE_COLOR) 102 98 ShowColorPicker(WebCore::Color initialColor, WebCore::IntRect elementRect); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r163515 r163516 822 822 #endif 823 823 824 #if ENABLE(TOUCH_EVENTS)825 void WebChromeClient::needTouchEvents(bool needTouchEvents)826 {827 m_page->send(Messages::WebPageProxy::NeedTouchEvents(needTouchEvents));828 }829 #endif830 831 824 #if ENABLE(FULLSCREEN_API) 832 825 bool WebChromeClient::supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard) -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r163079 r163516 231 231 232 232 #if ENABLE(TOUCH_EVENTS) 233 virtual void needTouchEvents(bool) override ;233 virtual void needTouchEvents(bool) override { } 234 234 #endif 235 235
Note: See TracChangeset
for help on using the changeset viewer.