RESOLVED FIXED 145059
[iOS] Remote scrolling tree needs to coordinate scroll snap state during resize/rotations
https://bugs.webkit.org/show_bug.cgi?id=145059
Summary [iOS] Remote scrolling tree needs to coordinate scroll snap state during resi...
Brent Fulgham
Reported 2015-05-15 10:02:57 PDT
This bug is an iOS flavor of Bug 142590, where resize events were not properly updating scroll snap state. In this case, the scroll snap positioning is not correct after a screen rotation. We need to update the RemoteLayerTree code to notify the WebProcess of new scroll snap positions so that after rotation we can be positioned on the right snap point.
Attachments
Patch (12.08 KB, patch)
2015-05-15 17:24 PDT, Brent Fulgham
simon.fraser: review+
Radar WebKit Bug Importer
Comment 1 2015-05-15 10:03:38 PDT
Brent Fulgham
Comment 2 2015-05-15 17:24:31 PDT
WebKit Commit Bot
Comment 3 2015-05-15 17:26:48 PDT
Attachment 253245 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:176: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 4 2015-05-15 17:37:51 PDT
Comment on attachment 253245 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253245&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1407 > + CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, [self _computedContentInset]); Would be nice to do just enough work to compute origin.y, rather than everything. > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1539 > + CGPoint currentPoint = [_scrollView contentOffset]; > + CGPoint activePoint = coordinator->nearestActiveSnapPoint(unobscuredRect.origin.y, currentPoint); > + > + if (!CGPointEqualToPoint(activePoint, currentPoint)) { Does this work with zooming? > Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:90 > + CGPoint nearestActiveSnapPoint(CGFloat topInset, const CGPoint&) const; I think it would be good to have "contentOffset" in the name here, maybe contentOffsetOfearestActiveSnapPoint(). > Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:126 > + float potentialSnapPosition = closestSnapOffsetForMainFrameScrolling(WebCore::ScrollEventAxis::Vertical, targetContentOffset->y, velocity.y, m_currentVerticalSnapPointIndex); > + potentialSnapPosition -= topInset; Are these in the same coordinate space with zooming? > Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:166 > + if (!root->isFrameScrollingNode()) is<> > Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:169 > + ScrollingTreeFrameScrollingNode* rootFrame = static_cast<ScrollingTreeFrameScrollingNode*>(root); downcast<>
Brent Fulgham
Comment 5 2015-05-16 15:28:03 PDT
Comment on attachment 253245 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253245&action=review >> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1539 >> + if (!CGPointEqualToPoint(activePoint, currentPoint)) { > > Does this work with zooming? Based on my testing, it does. But we (I) should be careful to make sure this is tested thoroughly. >> Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:90 >> + CGPoint nearestActiveSnapPoint(CGFloat topInset, const CGPoint&) const; > > I think it would be good to have "contentOffset" in the name here, maybe contentOffsetOfearestActiveSnapPoint(). I changed it to 'nearestActiveContentInsetAdjustedSnapPoint', which is a bit of a mouthful, but is more descriptive of what it does. >> Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:126 >> + potentialSnapPosition -= topInset; > > Are these in the same coordinate space with zooming? Yes. The coordinates are both in active view space (both zoomed, or both not-zoomed). >> Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:166 >> + if (!root->isFrameScrollingNode()) > > is<> Done! >> Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:169 >> + ScrollingTreeFrameScrollingNode* rootFrame = static_cast<ScrollingTreeFrameScrollingNode*>(root); > > downcast<> Done!
Brent Fulgham
Comment 6 2015-05-16 16:01:34 PDT
Brent Fulgham
Comment 7 2015-05-18 13:04:07 PDT
*** Bug 136005 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.