Changeset 166531 in webkit
- Timestamp:
- Mar 31, 2014 2:23:27 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166529 r166531 1 2014-03-31 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Hook up scroll events for accelerated overflow:scroll 4 https://bugs.webkit.org/show_bug.cgi?id=130976 5 6 Reviewed by Tim Horton. 7 8 When an accelerated overflow:scroll is scrolled in the UI process, 9 tell the WebProcess that the scroll happened to update RenderLayer 10 state and fire events. 11 12 In the WebProcess, RemoteScrollingCoordinator gets a message from the 13 UI process and calls AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(). 14 Fixed that function to handle scrolling nodes other than the root, which 15 required storing a map of ScrollingNodeID->RenderLayer* on RenderLayerCompositor, 16 accessible through FrameView::scrollableAreaForScrollLayerID(). 17 18 * WebCore.exp.in: 19 * page/FrameView.cpp: 20 (WebCore::FrameView::scrollableAreaForScrollLayerID): 21 * page/FrameView.h: 22 * page/scrolling/AsyncScrollingCoordinator.cpp: 23 (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): Handle 24 overflow as well as main frame scrolling nodes. 25 * page/scrolling/ScrollingTree.cpp: 26 (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Use isScrollingNode(). 27 (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): When an overflow 28 scroll node was scrolled externally, we have to update layers in decendant nodes, 29 and then call scrollingTreeNodeDidScroll() which tells the ScrollingCoordinator that 30 we scrolled. 31 * page/scrolling/ScrollingTree.h: Try to reduce confusion between the roles played 32 by these various functions, some of which happen in the UI process with UI-side 33 compositing. 34 * page/scrolling/ScrollingTreeScrollingNode.h: 35 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h: Need some functions to be 36 callable by subclasses. 37 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm: 38 (WebCore::ScrollingTreeScrollingNodeIOS::updateLayersAfterDelegatedScroll): 39 * rendering/RenderLayerCompositor.cpp: 40 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Add 41 scrolling layers to the m_scrollingNodeToLayerMap 42 (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Remove 43 layer from the m_scrollingNodeToLayerMap. 44 (WebCore::RenderLayerCompositor::scrollableAreaForScrollLayerID): 45 * rendering/RenderLayerCompositor.h: 46 1 47 2014-03-31 Antti Koivisto <antti@apple.com> 2 48 -
trunk/Source/WebCore/WebCore.exp.in
r166529 r166531 2739 2739 __ZN7WebCore13ScrollingTree36viewportChangedViaDelegatedScrollingEyRKNS_9FloatRectEd 2740 2740 __ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb 2741 __ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_10FloatPointE 2741 2742 __ZN7WebCore13ScrollingTreeC2Ev 2742 2743 __ZN7WebCore13ScrollingTreeD1Ev … … 2802 2803 __ZN7WebCore29ScrollingTreeScrollingNodeIOS20updateBeforeChildrenERKNS_18ScrollingStateNodeE 2803 2804 __ZN7WebCore29ScrollingTreeScrollingNodeIOS31updateLayersAfterViewportChangeERKNS_9FloatRectEd 2805 __ZN7WebCore29ScrollingTreeScrollingNodeIOS32updateLayersAfterDelegatedScrollERKNS_10FloatPointE 2804 2806 __ZN7WebCore29ScrollingTreeScrollingNodeIOS46setScrollPositionWithoutContentEdgeConstraintsERKNS_10FloatPointE 2805 2807 __ZN7WebCore29ScrollingTreeScrollingNodeIOS6createERNS_13ScrollingTreeENS_17ScrollingNodeTypeEy -
trunk/Source/WebCore/page/FrameView.cpp
r166529 r166531 818 818 } 819 819 820 ScrollableArea* FrameView::scrollableAreaForScrollLayerID(uint64_t nodeID) const 821 { 822 RenderView* renderView = this->renderView(); 823 if (!renderView) 824 return nullptr; 825 826 return renderView->compositor().scrollableAreaForScrollLayerID(nodeID); 827 } 828 820 829 #if ENABLE(RUBBER_BANDING) 821 830 GraphicsLayer* FrameView::layerForOverhangAreas() const -
trunk/Source/WebCore/page/FrameView.h
r166017 r166531 157 157 // become a virtual function on ScrollableArea. 158 158 uint64_t scrollLayerID() const; 159 ScrollableArea* scrollableAreaForScrollLayerID(uint64_t) const; 159 160 160 161 bool hasCompositedContent() const; -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r166348 r166531 195 195 return; 196 196 197 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); 198 frameView->setInProgrammaticScroll(programmaticScroll); 199 200 frameView->setConstrainsScrollingToContentEdge(false); 201 frameView->notifyScrollPositionChanged(roundedIntPoint(scrollPosition)); 202 frameView->setConstrainsScrollingToContentEdge(true); 203 204 frameView->setInProgrammaticScroll(oldProgrammaticScroll); 205 197 // Main frame. 206 198 if (scrollingNodeID == frameView->scrollLayerID()) { 199 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); 200 frameView->setInProgrammaticScroll(programmaticScroll); 201 202 frameView->setConstrainsScrollingToContentEdge(false); 203 frameView->notifyScrollPositionChanged(roundedIntPoint(scrollPosition)); 204 frameView->setConstrainsScrollingToContentEdge(true); 205 206 frameView->setInProgrammaticScroll(oldProgrammaticScroll); 207 207 208 if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView)) { 208 209 GraphicsLayer* counterScrollingLayer = counterScrollingLayerForFrameView(frameView); … … 232 233 } 233 234 } 234 } 235 // FIXME: handle non-main scrolling nodes. 235 236 return; 237 } 238 239 // Overflow-scroll area. 240 if (ScrollableArea* scrollableArea = frameView->scrollableAreaForScrollLayerID(scrollingNodeID)) 241 scrollableArea->scrollToOffsetWithoutAnimation(scrollPosition); 236 242 } 237 243 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r166517 r166531 105 105 return; 106 106 107 if ( node->nodeType() != FrameScrollingNode && node->nodeType() != OverflowScrollingNode)107 if (!node->isScrollingNode()) 108 108 return; 109 109 110 110 toScrollingTreeScrollingNode(node)->updateLayersAfterViewportChange(viewportRect, scale); 111 } 112 113 void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatPoint& scrollPosition) 114 { 115 ScrollingTreeNode* node = nodeForID(nodeID); 116 if (!node) 117 return; 118 119 if (node->nodeType() != OverflowScrollingNode) 120 return; 121 122 // Update descendant nodes 123 toScrollingTreeScrollingNode(node)->updateLayersAfterDelegatedScroll(scrollPosition); 124 125 // Update GraphicsLayers and scroll state. 126 scrollingTreeNodeDidScroll(nodeID, scrollPosition); 111 127 } 112 128 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r165652 r166531 64 64 bool shouldHandleWheelEventSynchronously(const PlatformWheelEvent&); 65 65 66 virtual void viewportChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatRect& viewportRect, double scale);67 68 66 void setMainFrameIsRubberBanding(bool); 69 67 bool isRubberBandInProgress(); … … 74 72 void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom); 75 73 74 // Called after a scrolling tree node has handled a scroll and updated its layers. 75 // Updates FrameView/RenderLayer scrolling state and GraphicsLayers. 76 76 virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) = 0; 77 78 // Delegated scrolling/zooming has caused the viewport to change, so update viewport-constrained layers 79 // (but don't cause scroll events to be fired). 80 virtual void viewportChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatRect& viewportRect, double scale); 81 82 // Delegated scrolling has scrolled a node. Update layer positions on descendant tree nodes, 83 // and call scrollingTreeNodeDidScroll(). 84 virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatPoint& scrollPosition); 85 77 86 FloatPoint mainFrameScrollPosition(); 78 87 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r166517 r166531 55 55 56 56 virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) = 0; 57 57 virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { } 58 58 59 SynchronousScrollingReasons synchronousScrollingReasons() const { return m_synchronousScrollingReasons; } 59 60 bool shouldUpdateScrollLayerPositionSynchronously() const { return m_synchronousScrollingReasons; } -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h
r166517 r166531 51 51 CALayer *scrollLayer() const { return m_scrollLayer.get(); } 52 52 53 private:54 53 FloatPoint scrollPosition() const; 55 54 virtual void setScrollPosition(const FloatPoint&) override; … … 57 56 58 57 virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale); 58 virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) override; 59 59 60 60 void setScrollLayerPosition(const FloatPoint&); … … 65 65 void scrollBy(const IntSize&); 66 66 void scrollByWithoutContentEdgeConstraints(const IntSize&); 67 68 private: 69 void updateChildNodesAfterScroll(const FloatPoint&); 67 70 68 71 RetainPtr<CALayer> m_scrollLayer; -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm
r166517 r166531 130 130 } 131 131 132 void ScrollingTreeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& position)132 void ScrollingTreeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition) 133 133 { 134 134 ASSERT(!shouldUpdateScrollLayerPositionSynchronously()); 135 [m_scrollLayer setPosition:CGPointMake(-position.x() + scrollOrigin().x(), -position.y() + scrollOrigin().y())]; 136 135 [m_scrollLayer setPosition:CGPointMake(-scrollPosition.x() + scrollOrigin().x(), -scrollPosition.y() + scrollOrigin().y())]; 136 137 updateChildNodesAfterScroll(scrollPosition); 138 } 139 140 void ScrollingTreeScrollingNodeIOS::updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) 141 { 142 [m_counterScrollingLayer setPosition:viewportRect.location()]; 143 144 if (!m_children) 145 return; 146 147 FloatRect viewportConstrainedObjectsRect = FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(viewportRect), totalContentsSize(), scale, false, scrollBehaviorForFixedElements()); 148 149 size_t size = m_children->size(); 150 for (size_t i = 0; i < size; ++i) 151 m_children->at(i)->parentScrollPositionDidChange(viewportConstrainedObjectsRect, FloatSize()); 152 } 153 154 void ScrollingTreeScrollingNodeIOS::updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition) 155 { 156 updateChildNodesAfterScroll(scrollPosition()); 157 } 158 159 void ScrollingTreeScrollingNodeIOS::updateChildNodesAfterScroll(const FloatPoint& scrollPosition) 160 { 137 161 ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements(); 138 FloatPoint scrollOffset = position - toIntSize(scrollOrigin());162 FloatPoint scrollOffset = scrollPosition - toIntSize(scrollOrigin()); 139 163 FloatRect viewportRect(FloatPoint(), viewportSize()); 140 141 // FIXME: scrollOffsetForFixedPosition() needs to do float math.142 164 FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight()); 143 165 … … 171 193 } 172 194 173 void ScrollingTreeScrollingNodeIOS::updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale)174 {175 [m_counterScrollingLayer setPosition:viewportRect.location()];176 177 if (!m_children)178 return;179 180 FloatRect viewportConstrainedObjectsRect = FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(viewportRect), totalContentsSize(), scale, false, scrollBehaviorForFixedElements());181 182 size_t size = m_children->size();183 for (size_t i = 0; i < size; ++i)184 m_children->at(i)->parentScrollPositionDidChange(viewportConstrainedObjectsRect, FloatSize());185 }186 187 195 FloatPoint ScrollingTreeScrollingNodeIOS::minimumScrollPosition() const 188 196 { -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r166529 r166531 3516 3516 nodeID = scrollingCoordinator->attachToStateTree(isRootLayer ? FrameScrollingNode : OverflowScrollingNode, nodeID, parentNodeID); 3517 3517 backing->setScrollingNodeID(nodeID); 3518 m_scrollingNodeToLayerMap.add(nodeID, &layer); 3518 3519 3519 3520 GraphicsLayer* scrollingLayer = backing->scrollingLayer(); … … 3538 3539 void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer) 3539 3540 { 3540 if (RenderLayerBacking* backing = layer.backing()) 3541 backing->detachFromScrollingCoordinator(); 3541 RenderLayerBacking* backing = layer.backing(); 3542 if (!backing) 3543 return; 3544 3545 backing->detachFromScrollingCoordinator(); 3546 3547 if (ScrollingNodeID nodeID = backing->scrollingNodeID()) 3548 m_scrollingNodeToLayerMap.remove(nodeID); 3549 } 3550 3551 ScrollableArea* RenderLayerCompositor::scrollableAreaForScrollLayerID(ScrollingNodeID nodeID) const 3552 { 3553 if (!nodeID) 3554 return nullptr; 3555 3556 return m_scrollingNodeToLayerMap.get(nodeID); 3542 3557 } 3543 3558 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r166489 r166531 267 267 #endif 268 268 269 ScrollableArea* scrollableAreaForScrollLayerID(ScrollingNodeID) const; 270 269 271 void updateScrollCoordinatedStatus(RenderLayer&); 270 272 void removeFromScrollCoordinatedLayers(RenderLayer&); … … 520 522 521 523 Color m_rootExtendedBackgroundColor; 524 525 HashMap<ScrollingNodeID, RenderLayer*> m_scrollingNodeToLayerMap; 522 526 }; 523 527 -
trunk/Source/WebKit2/ChangeLog
r166518 r166531 1 2014-03-31 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Hook up scroll events for accelerated overflow:scroll 4 https://bugs.webkit.org/show_bug.cgi?id=130976 5 6 Reviewed by Tim Horton. 7 8 When an accelerated overflow:scroll is scrolled in the UI process, 9 tell the WebProcess that the scroll happened to update RenderLayer 10 state and fire events. 11 12 Add a WKOverflowScrollViewDelegate which is set as the delegate of 13 UIScrollViews, owned by ScrollingTreeOverflowScrollingNodeIOS, and propagates 14 -scrollViewDidScroll: messages to ScrollingTree::scrollPositionChangedViaDelegatedScrolling(), 15 which updates child layers and then, via RemoteScrollingTree::scrollingTreeNodeDidScroll, 16 tells the RemoteScrollingCoordinator which sends a message to the WebProcess. 17 18 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: 19 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): Name change 20 to try to reduce confusion. 21 (WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChanged): Deleted. 22 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: 23 * UIProcess/Scrolling/RemoteScrollingTree.cpp: 24 (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): 25 * UIProcess/Scrolling/RemoteScrollingTree.h: 26 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: 27 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: 28 (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:WebKit::]): 29 (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): 30 (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): 31 (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): 32 (-[WKOverflowScrollViewDelegate scrollViewDidEndScrollingAnimation:]): 33 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS): 34 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): 35 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): 36 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): 37 * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: 38 (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): No need for 39 rounding. 40 1 41 2014-03-29 Simon Fraser <simon.fraser@apple.com> 2 42 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
r166518 r166531 151 151 152 152 // This comes from the scrolling tree. 153 void RemoteScrollingCoordinatorProxy::scroll PositionChanged(WebCore::ScrollingNodeID scrolledNodeID, const WebCore::FloatPoint& newScrollPosition)153 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID scrolledNodeID, const WebCore::FloatPoint& newScrollPosition) 154 154 { 155 155 // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects() -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
r166518 r166531 53 53 54 54 // Inform the web process that the scroll position changed (called from the scrolling tree) 55 void scroll PositionChanged(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition);55 void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition); 56 56 57 57 bool isPointInNonFastScrollableRegion(const WebCore::IntPoint&) const; -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
r166293 r166531 80 80 void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition) 81 81 { 82 m_scrollingCoordinatorProxy.scroll PositionChanged(nodeID, scrollPosition);82 m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition); 83 83 } 84 84 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h
r164358 r166531 47 47 const RemoteScrollingCoordinatorProxy& scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; } 48 48 49 virtual void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) override; 50 49 51 private: 50 52 explicit RemoteScrollingTree(RemoteScrollingCoordinatorProxy&); … … 53 55 virtual void handleWheelEventPhase(WebCore::PlatformWheelEventPhase) override; 54 56 #endif 55 virtual void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) override;56 57 57 58 virtual PassOwnPtr<WebCore::ScrollingTreeNode> createNode(WebCore::ScrollingNodeType, WebCore::ScrollingNodeID); -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h
r166333 r166531 33 33 #include <WebCore/ScrollingTreeScrollingNodeIOS.h> 34 34 35 OBJC_CLASS WKOverflowScrollViewDelegate; 36 35 37 namespace WebKit { 36 38 … … 40 42 virtual ~ScrollingTreeOverflowScrollingNodeIOS(); 41 43 44 void scrollViewDidScroll(const WebCore::FloatPoint&); 45 42 46 private: 43 47 ScrollingTreeOverflowScrollingNodeIOS(WebCore::ScrollingTree&, WebCore::ScrollingNodeID); 44 48 49 virtual void updateBeforeChildren(const WebCore::ScrollingStateNode&) override; 45 50 virtual void updateAfterChildren(const WebCore::ScrollingStateNode&) override; 46 51 52 RetainPtr<WKOverflowScrollViewDelegate> m_scrollViewDelegate; 47 53 }; 48 54 -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
r166334 r166531 32 32 #import <WebCore/BlockExceptions.h> 33 33 #import <WebCore/ScrollingStateScrollingNode.h> 34 #import <WebCore/ScrollingTree.h> 34 35 #import <UIKit/UIScrollView.h> 35 36 36 37 using namespace WebCore; 38 39 @interface WKOverflowScrollViewDelegate : NSObject <UIScrollViewDelegate> { 40 WebKit::ScrollingTreeOverflowScrollingNodeIOS* _scrollingTreeNode; 41 } 42 - (instancetype)initWithScrollingTreeNode:(WebKit::ScrollingTreeOverflowScrollingNodeIOS*)node; 43 44 @end 45 46 47 @implementation WKOverflowScrollViewDelegate 48 49 - (instancetype)initWithScrollingTreeNode:(WebKit::ScrollingTreeOverflowScrollingNodeIOS*)node 50 { 51 if ((self = [super init])) { 52 _scrollingTreeNode = node; 53 } 54 return self; 55 } 56 57 - (void)scrollViewDidScroll:(UIScrollView *)scrollView 58 { 59 _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset); 60 } 61 62 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView 63 { 64 } 65 66 - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate 67 { 68 } 69 70 - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView 71 { 72 } 73 74 @end 37 75 38 76 namespace WebKit { … … 50 88 ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS() 51 89 { 90 BEGIN_BLOCK_OBJC_EXCEPTIONS 91 if (UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate]) { 92 ASSERT([scrollView isKindOfClass:[UIScrollView self]]); 93 scrollView.delegate = nil; 94 } 95 END_BLOCK_OBJC_EXCEPTIONS 96 } 97 98 void ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren(const WebCore::ScrollingStateNode& stateNode) 99 { 100 if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) { 101 BEGIN_BLOCK_OBJC_EXCEPTIONS 102 if (UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate]) { 103 ASSERT([scrollView isKindOfClass:[UIScrollView self]]); 104 scrollView.delegate = nil; 105 } 106 END_BLOCK_OBJC_EXCEPTIONS 107 } 108 109 ScrollingTreeScrollingNodeIOS::updateBeforeChildren(stateNode); 52 110 } 53 111 … … 57 115 58 116 const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode); 117 118 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) { 119 BEGIN_BLOCK_OBJC_EXCEPTIONS 120 UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate]; 121 ASSERT([scrollView isKindOfClass:[UIScrollView self]]); 122 123 if (!m_scrollViewDelegate) 124 m_scrollViewDelegate = adoptNS([[WKOverflowScrollViewDelegate alloc] initWithScrollingTreeNode:this]); 125 126 scrollView.delegate = m_scrollViewDelegate.get(); 127 END_BLOCK_OBJC_EXCEPTIONS 128 } 59 129 60 130 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) { … … 69 139 } 70 140 141 void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition) 142 { 143 scrollingTree().scrollPositionChangedViaDelegatedScrolling(scrollingNodeID(), scrollPosition); 144 } 145 71 146 } // namespace WebCore 72 147 -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
r162736 r166531 94 94 void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition) 95 95 { 96 scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, roundedIntPoint(scrollPosition), false /* FIXME */, SyncScrollingLayerPosition);96 scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, false /* FIXME */, SyncScrollingLayerPosition); 97 97 } 98 98
Note: See TracChangeset
for help on using the changeset viewer.