Changeset 187131 in webkit
- Timestamp:
- Jul 21, 2015, 3:35:57 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/Cocoa/WKWebView.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r187129 r187131 1 2015-07-21 Zalan Bujtas <zalan@apple.com> 2 3 [iOS] Menu drop down such as on nike.com does not stay 4 https://bugs.webkit.org/show_bug.cgi?id=147047 5 rdar://problem/21046961 6 7 Reviewed by Benjamin Poulain. 8 9 This is a workaround for unintended scrolling while scaling. 10 (Based on Benjamin Poulain's WIP patch for webkit.org/b/136904) 11 12 In certain cases when scaling would result in moving the scrollview (which would trigger 13 a scroll event on WebCore side), zoomRect is called instead of setZoomScale to ensure 14 that the scroll position stays intact. 15 16 * UIProcess/API/Cocoa/WKWebView.mm: 17 (-[WKWebView _didCommitLayerTree:]): 18 1 19 2015-07-21 Daniel Bates <dabates@apple.com> 2 20 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r186778 r187131 960 960 [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()]; 961 961 [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()]; 962 if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom]) 963 [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()]; 962 if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom]) { 963 float newPageScaleFactor = layerTreeTransaction.pageScaleFactor(); 964 965 if (!areEssentiallyEqualAsFloat(contentZoomScale(self), newPageScaleFactor)) { 966 // FIXME: We need to handle stick to bottom. 967 WebCore::FloatRect oldUnobscuredContentRect = _page->unobscuredContentRect(); 968 if (!oldUnobscuredContentRect.isEmpty() && oldUnobscuredContentRect.y() < 1) { 969 CGFloat relativeHorizontalPosition = oldUnobscuredContentRect.x() / oldUnobscuredContentRect.width(); 970 CGPoint newTopLeft = [self _adjustedContentOffset: { relativeHorizontalPosition * newContentSize.width, 0 }]; 971 CGSize scrollViewSize = [_scrollView bounds].size; 972 CGSize rectToZoomSize = CGSizeMake(scrollViewSize.width * newPageScaleFactor, scrollViewSize.height * newPageScaleFactor); 973 [_scrollView zoomToRect: { newTopLeft, rectToZoomSize } animated:NO]; 974 } else 975 [_scrollView setZoomScale:newPageScaleFactor]; 976 } 977 } 964 978 965 979 [self _updateScrollViewBackground];
Note:
See TracChangeset
for help on using the changeset viewer.