Changeset 185576 in webkit
- Timestamp:
- Jun 15, 2015 7:10:58 PM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r185568 r185576 1 2015-06-15 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] position:fixed elements sometimes truncated on scroll view bouncing 4 https://bugs.webkit.org/show_bug.cgi?id=146000 5 rdar://problem/19448439 6 7 Reviewed by Benjamin Poulain. 8 9 When in the middle of a rubber-band (UIScrollView bounce), we could send a bad 10 fixed position rect down to WebCore, causing 100% height elements to get laid out 11 at the wrong height, possible too short. This occurred when -_updateVisibleContentRects 12 said we were in a stable state, but the rubber-band offset caused WebPageProxy::computeCustomFixedPositionRect() 13 to compute a bad rect via constrainedUnobscuredRect.intersect(documentRect). 14 15 Fix by not claiming to be in a stable state during rubber-banding. Added _scrollViewIsRubberBanding 16 to compute that, taking care with floating point comparisons for 3x devices. 17 18 * UIProcess/API/Cocoa/WKWebView.mm: 19 (isGreaterInDevicePixels): 20 (-[WKWebView _scrollViewIsRubberBanding]): 21 (-[WKWebView _updateVisibleContentRects]): 22 1 23 2015-06-15 Ryuan Choi <ryuan.choi@navercorp.com> 2 24 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r185556 r185576 690 690 } 691 691 692 static inline bool pointsEqualInDevicePixels(CGPoint a, CGPoint b, float deviceScaleFactor) 693 { 694 return fabs(a.x * deviceScaleFactor - b.x * deviceScaleFactor) < std::numeric_limits<float>::epsilon() 695 && fabs(a.y * deviceScaleFactor - b.y * deviceScaleFactor) < std::numeric_limits<float>::epsilon(); 696 } 697 692 698 static CGSize roundScrollViewContentSize(const WebKit::WebPageProxy& page, CGSize contentSize) 693 699 { … … 1514 1520 } 1515 1521 1522 // Ideally UIScrollView would expose this for us: <rdar://problem/21394567>. 1523 - (BOOL)_scrollViewIsRubberBanding 1524 { 1525 float deviceScaleFactor = _page->deviceScaleFactor(); 1526 1527 CGPoint contentOffset = [_scrollView contentOffset]; 1528 CGPoint boundedOffset = contentOffsetBoundedInValidRange(_scrollView.get(), contentOffset); 1529 return !pointsEqualInDevicePixels(contentOffset, boundedOffset, deviceScaleFactor); 1530 } 1531 1516 1532 - (void)_updateVisibleContentRects 1517 1533 { … … 1540 1556 CGFloat scaleFactor = contentZoomScale(self); 1541 1557 1542 BOOL isStableState = !(_isChangingObscuredInsetsInteractively || [_scrollView isDragging] || [_scrollView isDecelerating] || [_scrollView isZooming] || [_scrollView isZoomBouncing] || [_scrollView _isAnimatingZoom] || [_scrollView _isScrollingToTop] );1558 BOOL isStableState = !(_isChangingObscuredInsetsInteractively || [_scrollView isDragging] || [_scrollView isDecelerating] || [_scrollView isZooming] || [_scrollView isZoomBouncing] || [_scrollView _isAnimatingZoom] || [_scrollView _isScrollingToTop] || [self _scrollViewIsRubberBanding]); 1543 1559 1544 1560 // FIXME: this can be made static after we stop supporting iOS 8.x.
Note: See TracChangeset
for help on using the changeset viewer.