Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iOS 15: History back sometimes scrolls to top of the page
https://bugs.webkit.org/show_bug.cgi?id=231563 <rdar://problem/84405417> Reviewed by Devin Rousso. Sometimes, going back in history would fail to restore the scroll position because in -[WKWebView _restoreScrollAndZoomStateForTransaction:] the comparison of contentZoomScale() and _scaleToRestore would fail. In the case I debugged, _scaleToRestore was 1.15 and contentZoomScale() was 1.15044, the latter deviating via the round-trip through UIScrollView's zoomScale. So make all the scale comparisons in both WKWebView and WebPageIOS a little more lenient, allowing a delta of 0.01. * Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _updateScrollViewForTransaction:]): (-[WKWebView _restoreScrollAndZoomStateForTransaction:]): (-[WKWebView _allowsDoubleTapGestures]): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::scalesAreEssentiallyEqual): (WebKit::WebPage::restorePageState): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::scaleFromUIProcess const): (WebKit::WebPage::updateVisibleContentRects): (WebKit::areEssentiallyEqualAsFloat): Deleted. * Tools/TestWebKitAPI/Tests/WebKit/simple-tall.html: * Tools/TestWebKitAPI/Tests/WebKitCocoa/RestoreScrollPosition.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/253221@main
- Loading branch information
Showing
5 changed files
with
55 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters