Changeset 166333 in webkit
- Timestamp:
- Mar 26, 2014 7:15:48 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166329 r166333 1 2014-03-26 Simon Fraser <simon.fraser@apple.com> 2 3 Hook up -webkit-overflow-scrolling:touch for iOS WK2 4 https://bugs.webkit.org/show_bug.cgi?id=130809 5 6 Reviewed by Tim Horton. 7 8 Get -webkit-overflow-scrolling: touch working for iOS WK2. 9 10 * WebCore.exp.in: 11 * page/scrolling/AsyncScrollingCoordinator.cpp: 12 (WebCore::AsyncScrollingCoordinator::updateScrollingNode): 13 Send in ScrollingGeometry when we update scrolling nodes. 14 * page/scrolling/AsyncScrollingCoordinator.h: 15 * page/scrolling/ScrollingCoordinator.h: 16 (WebCore::ScrollingCoordinator::updateScrollingNode): 17 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h: 18 Need to get to the scrolling layer in a subclass. 19 (WebCore::ScrollingTreeScrollingNodeIOS::scrollLayer): 20 * rendering/RenderLayer.cpp: 21 (WebCore::RenderLayer::hasAcceleratedTouchScrolling): Remove code 22 that temporarily disabled touch-scrolling. 23 * rendering/RenderLayerCompositor.cpp: 24 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): When we 25 update scrolling nodes, send in the right scrolling geometry. 26 1 27 2014-03-26 Timothy Hatcher <timothy@apple.com> 2 28 -
trunk/Source/WebCore/WebCore.exp.in
r166317 r166333 2757 2757 __ZN7WebCore25AsyncScrollingCoordinator18syncChildPositionsERKNS_10LayoutRectE 2758 2758 __ZN7WebCore25AsyncScrollingCoordinator19detachFromStateTreeEy 2759 __ZN7WebCore25AsyncScrollingCoordinator19updateScrollingNodeEyPNS_13GraphicsLayerES2_S2_ 2759 __ZN7WebCore25AsyncScrollingCoordinator19updateScrollingNodeEyPNS_13GraphicsLayerES2_S2_RKNS_20ScrollingCoordinator17ScrollingGeometryE 2760 2760 __ZN7WebCore25AsyncScrollingCoordinator22frameViewLayoutUpdatedEPNS_9FrameViewE 2761 2761 __ZN7WebCore25AsyncScrollingCoordinator27frameViewRootLayerDidChangeEPNS_9FrameViewE -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r166293 r166333 288 288 } 289 289 290 void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer )290 void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, const ScrollingGeometry& scrollingGeometry) 291 291 { 292 292 ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID)); … … 298 298 node->setScrolledContentsLayer(scrolledContentsLayer); 299 299 node->setCounterScrollingLayer(counterScrollingLayer); 300 301 node->setScrollOrigin(scrollingGeometry.scrollOrigin); 302 node->setScrollPosition(scrollingGeometry.scrollPosition); 303 node->setTotalContentsSize(scrollingGeometry.contentSize); 300 304 } 301 305 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r164110 r166333 88 88 89 89 virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) override; 90 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer*, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer ) override;90 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer*, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, const ScrollingGeometry&) override; 91 91 virtual String scrollingStateTreeAsText() const override; 92 92 virtual bool isRubberBandInProgress() const override; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r166293 r166333 153 153 virtual void clearStateTree() { } 154 154 virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) { } 155 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/) { } 155 156 struct ScrollingGeometry { 157 IntSize contentSize; 158 FloatPoint scrollPosition; 159 IntPoint scrollOrigin; 160 }; 161 162 virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, const ScrollingGeometry&) { } 156 163 virtual void syncChildPositions(const LayoutRect&) { } 157 164 virtual String scrollingStateTreeAsText() const; -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h
r166293 r166333 44 44 ScrollingTreeScrollingNodeIOS(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); 45 45 46 private:47 46 // ScrollingTreeNode member functions. 48 47 virtual void updateBeforeChildren(const ScrollingStateNode&) override; … … 50 49 virtual void handleWheelEvent(const PlatformWheelEvent&) override { } 51 50 51 CALayer *scrollLayer() const { return m_scrollLayer.get(); } 52 53 private: 52 54 FloatPoint scrollPosition() const; 53 55 virtual void setScrollPosition(const FloatPoint&) override; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r166100 r166333 2088 2088 return false; 2089 2089 2090 // Temporary: turn off accelerated scrolling in WK2.2091 if (Page* page = renderer().frame().page()) {2092 if (page->scrollingCoordinator())2093 return false;2094 }2095 2096 2090 Settings* settings = renderer().document().settings(); 2097 2098 2091 // FIXME: settings should not be null at this point. If you find a reliable way to hit this assertion, please file a bug. 2099 2092 // See <rdar://problem/10266101>. -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r166293 r166333 3521 3521 GraphicsLayer* counterScrollingLayer = nullptr; 3522 3522 3523 ScrollingCoordinator::ScrollingGeometry scrollingGeometry; 3523 3524 if (isRootLayer) { 3524 3525 scrollingLayer = m_scrollLayer.get(); 3525 3526 scrolledContentsLayer = nullptr; 3526 3527 counterScrollingLayer = fixedRootBackgroundLayer(); 3527 } 3528 3529 scrollingCoordinator->updateScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer); 3528 3529 scrollingGeometry.scrollOrigin = m_renderView.frameView().scrollOrigin(); 3530 scrollingGeometry.scrollPosition = m_renderView.frameView().scrollPosition(); 3531 scrollingGeometry.contentSize = m_renderView.frameView().totalContentsSize(); 3532 } else { 3533 scrollingGeometry.scrollOrigin = layer.scrollOrigin(); 3534 scrollingGeometry.scrollPosition = layer.scrollPosition(); 3535 scrollingGeometry.contentSize = layer.contentsSize(); 3536 } 3537 3538 scrollingCoordinator->updateScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer, scrollingGeometry); 3530 3539 } 3531 3540 } -
trunk/Source/WebKit2/ChangeLog
r166332 r166333 1 2014-03-26 Simon Fraser <simon.fraser@apple.com> 2 3 Hook up -webkit-overflow-scrolling:touch for iOS WK2 4 https://bugs.webkit.org/show_bug.cgi?id=130809 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: 9 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: 10 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): 11 Set the content size of the UIScrollVIew based on the geometry. 12 * UIProcess/ios/RemoteLayerTreeHostIOS.mm: 13 (WebKit::RemoteLayerTreeHost::createLayer): Make a UIScrollView if the 14 layer properties tell us that we have the scrolling behavior. 15 * UIProcess/ios/WKContentView.mm: 16 (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]): 17 We need to allow user interaction in the _rootContentView so that events get to 18 nested UIScrollViews (this could be optimized in future). 19 * UIProcess/mac/RemoteLayerTreeHost.h: 20 * UIProcess/mac/RemoteLayerTreeHost.mm: 21 (WebKit::RemoteLayerTreeHost::updateLayerTree): 22 (WebKit::RemoteLayerTreeHost::createLayer): Need to pass RemoteLayerTreeTransaction::LayerProperties 23 in so we can get at the custom behavior. 24 1 25 2014-03-26 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h
r166293 r166333 42 42 private: 43 43 ScrollingTreeOverflowScrollingNodeIOS(WebCore::ScrollingTree&, WebCore::ScrollingNodeID); 44 45 virtual void updateAfterChildren(const WebCore::ScrollingStateNode&) override; 46 44 47 }; 45 48 -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
r166293 r166333 26 26 #import "config.h" 27 27 #import "ScrollingTreeOverflowScrollingNodeIOS.h" 28 #import <WebCore/BlockExceptions.h> 29 #import <WebCore/ScrollingStateScrollingNode.h> 30 #import <UIKit/UIScrollView.h> 28 31 29 32 #if PLATFORM(IOS) … … 48 51 } 49 52 53 void ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren(const ScrollingStateNode& stateNode) 54 { 55 ScrollingTreeScrollingNodeIOS::updateAfterChildren(stateNode); 56 57 const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode); 58 59 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) { 60 BEGIN_BLOCK_OBJC_EXCEPTIONS 61 UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate]; 62 ASSERT([scrollView isKindOfClass:[UIScrollView self]]); 63 64 scrollView.contentSize = scrollingStateNode.totalContentsSize(); 65 66 END_BLOCK_OBJC_EXCEPTIONS 67 } 68 } 69 50 70 } // namespace WebCore 51 71 -
trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm
r164890 r166333 33 33 #import <WebKitSystemInterface.h> 34 34 35 #import <UIKit/UI View.h>35 #import <UIKit/UIScrollView.h> 36 36 #import <QuartzCore/QuartzCore.h> 37 37 … … 77 77 namespace WebKit { 78 78 79 LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties )79 LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties, const RemoteLayerTreeTransaction::LayerProperties* layerProperties) 80 80 { 81 81 RetainPtr<LayerOrView>& layerOrView = m_layers.add(properties.layerID, nullptr).iterator->value; … … 91 91 case PlatformCALayer::LayerTypePageTiledBackingLayer: 92 92 case PlatformCALayer::LayerTypeTiledBackingTileLayer: 93 layerOrView = adoptNS([[UIView alloc] initWithFrame:CGRectZero]); 93 if (layerProperties && layerProperties->customBehavior == GraphicsLayer::CustomScrollingBehavior) 94 layerOrView = adoptNS([[UIScrollView alloc] init]); 95 else 96 layerOrView = adoptNS([[UIView alloc] init]); 94 97 break; 95 98 case PlatformCALayer::LayerTypeTransformLayer: 96 layerOrView = adoptNS([[WKTransformView alloc] init WithFrame:CGRectZero]);99 layerOrView = adoptNS([[WKTransformView alloc] init]); 97 100 break; 98 101 case PlatformCALayer::LayerTypeCustom: -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r166257 r166333 180 180 _rootContentView = adoptNS([[UIView alloc] init]); 181 181 [_rootContentView layer].masksToBounds = NO; 182 [_rootContentView setUserInteractionEnabled:NO];183 182 184 183 [self addSubview:_rootContentView.get()]; -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h
r164890 r166333 52 52 53 53 private: 54 LayerOrView *createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& );54 LayerOrView *createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties&, const RemoteLayerTreeTransaction::LayerProperties*); 55 55 56 56 LayerOrView *m_rootLayer; -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
r165652 r166333 54 54 bool RemoteLayerTreeHost::updateLayerTree(const RemoteLayerTreeTransaction& transaction, float indicatorScaleFactor) 55 55 { 56 for (const auto& createdLayer : transaction.createdLayers()) 57 createLayer(createdLayer); 56 for (const auto& createdLayer : transaction.createdLayers()) { 57 const RemoteLayerTreeTransaction::LayerProperties* properties = transaction.changedLayers().get(createdLayer.layerID); 58 createLayer(createdLayer, properties); 59 } 58 60 59 61 bool rootLayerChanged = false; … … 106 108 107 109 #if !PLATFORM(IOS) 108 LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties )110 LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties, const RemoteLayerTreeTransaction::LayerProperties*) 109 111 { 110 112 RetainPtr<CALayer>& layer = m_layers.add(properties.layerID, nullptr).iterator->value;
Note: See TracChangeset
for help on using the changeset viewer.