New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS 17: History back sometimes scrolls to top of the page (with app banner) #19324
Merged
webkit-commit-queue
merged 1 commit into
WebKit:main
from
smfr:eng/iOS-17-History-back-sometimes-scrolls-to-top-of-the-page-with-app-banner
Oct 21, 2023
Merged
iOS 17: History back sometimes scrolls to top of the page (with app banner) #19324
webkit-commit-queue
merged 1 commit into
WebKit:main
from
smfr:eng/iOS-17-History-back-sometimes-scrolls-to-top-of-the-page-with-app-banner
Oct 21, 2023
Conversation
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
smfr
added
the
Scrolling
Bugs related to main thread and off-main thread scrolling
label
Oct 20, 2023
EWS run on previous version of this PR (hash 451a25d) |
hortont424
approved these changes
Oct 20, 2023
smfr
force-pushed
the
eng/iOS-17-History-back-sometimes-scrolls-to-top-of-the-page-with-app-banner
branch
from
October 20, 2023 01:45
451a25d
to
66d8e6c
Compare
EWS run on previous version of this PR (hash 66d8e6c) |
smfr
force-pushed
the
eng/iOS-17-History-back-sometimes-scrolls-to-top-of-the-page-with-app-banner
branch
from
October 21, 2023 00:11
66d8e6c
to
b6b3e75
Compare
EWS run on current version of this PR (hash b6b3e75) |
β¦anner) https://bugs.webkit.org/show_bug.cgi?id=231563 rdar://117107620 Reviewed by Tim Horton. Sometimes, navigating back to a page on iOS would fail to restore the scroll position to the correct location. This happened when `WebPage::restorePageState()` hit the second mismatched `minimumLayoutSizeInScrollViewCoordinates` clause, which made use of `historyItem.unobscuredContentRect()`. This could happen when MobileSafari app banners were hidden or shown. `historyItem.unobscuredContentRect()` had the wrong value in this case, containing a rect that had a 0,0 location which triggered a scroll back to the top. `historyItem.unobscuredContentRect()` was wrong because it was set in `HistoryController::saveScrollPositionAndViewStateToItem()` which runs after we've reset the content size in preparation for the navigation; note that this function uses `frameView->cachedScrollPosition()`. So the fix is to cache `unobscuredContentRect()` and `exposedContentRect()` in the same way. This is messy; ScrollView shouldn't be in the business of storing caches related to page navigation, but fixing that is out of scope for this change. The API test navigates and goes back with a view size change, which triggers the bug. Also add some release logging to help diagnose scroll restoration bugs. * Source/WebCore/dom/Document.cpp: (WebCore::Document::setBackForwardCacheState): * Source/WebCore/loader/HistoryController.cpp: (WebCore::FrameLoader::HistoryController::saveScrollPositionAndViewStateToItem): * Source/WebCore/platform/ScrollView.cpp: (WebCore::ScrollView::cacheCurrentScrollState): * Source/WebCore/platform/ScrollView.h: (WebCore::ScrollView::cachedUnobscuredContentRect const): (WebCore::ScrollView::cachedExposedContentRect const): (WebCore::ScrollView::cacheCurrentScrollPosition): Deleted. * Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm: (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/ios/scrollable-page.html: Added. Canonical link: https://commits.webkit.org/269611@main
webkit-commit-queue
force-pushed
the
eng/iOS-17-History-back-sometimes-scrolls-to-top-of-the-page-with-app-banner
branch
from
October 21, 2023 02:46
b6b3e75
to
2bafc1b
Compare
Committed 269611@main (2bafc1b): https://commits.webkit.org/269611@main Reviewed commits have been landed. Closing PR #19324 and removing active labels. |
webkit-commit-queue
removed
the
merge-queue
Applied to send a pull request to merge-queue
label
Oct 21, 2023
smfr
deleted the
eng/iOS-17-History-back-sometimes-scrolls-to-top-of-the-page-with-app-banner
branch
December 22, 2023 16:48
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
2bafc1b
b6b3e75
π wincairoπ§ͺ wpe-wk2π§ͺ ios-wk2-wptπ§ͺ gtk-wk2π§ͺ api-gtkπ tvπ§ͺ mac-AS-debug-wk2π watch