Bug 213842 - Missing tiles when tapping back arrow
Summary: Missing tiles when tapping back arrow
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Compositing (show other bugs)
Version: Safari 13
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: https://bugreport2.zemtu.com
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-01 06:54 PDT by Philipp Metzler
Modified: 2020-07-06 13:51 PDT (History)
5 users (show)

See Also:


Attachments
Animated GIF to illustrate the problem. (361.87 KB, image/gif)
2020-07-01 06:54 PDT, Philipp Metzler
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Metzler 2020-07-01 06:54:37 PDT
Created attachment 403288 [details]
Animated GIF to illustrate the problem.

Steps to reproduce:

1. On Mobile Safari on iOS 13.5.1 open the URL https://bugreport2.zemtu.com
2. Touch scroll to the red rectangle and click on it
3. Press the arrow / back button
4. Some of the green rectangles on the top of the screen are no longer visible
5. Touch scroll just a little bit to make these rectangles visible again

Please retry several times as it may not occur all the time. Usually you have to try 2 - 4 times to see the problem.

This problem can also be reproduced in the XCode iOS simulator.

The problem cannot be reproduced under macOS Catalina 10.15.5 (19F101) in these browsers:
- Safari Version 13.1.1 (15609.2.9.1.2)
- Google Chrome Version 83.0.4103.116 (Offizieller Build) (64-Bit)
- Firefox 77.0.1 (64-Bit)
- Opera 68.0.3618.173
- Microsoft Edge 83.0.478.56 (Offizielles Build) (64-Bit)
Comment 1 Radar WebKit Bug Importer 2020-07-01 11:09:28 PDT
<rdar://problem/64994694>
Comment 2 Simon Fraser (smfr) 2020-07-06 13:08:51 PDT
I can reproduce on iOS 13.4.
Comment 3 Simon Fraser (smfr) 2020-07-06 13:12:16 PDT
Also reproduces in iOS 14 beta. Sometimes it fails to restore the scroll position.
Comment 4 Simon Fraser (smfr) 2020-07-06 13:35:45 PDT
The failure to restore the scroll position (which also happens on macOS) happens because we try to restore the scroll position from FrameLoader::HistoryController::restoreScrollPositionAndViewState() but this happens before we've done a layout for the new size, so we end up clamping the scroll position to zero.
Comment 5 Simon Fraser (smfr) 2020-07-06 13:40:26 PDT
The page doesn't build the new content until some time after the back(), using JS running on a timer, so we have no hope of restoring the correct scroll position.
Comment 6 Simon Fraser (smfr) 2020-07-06 13:51:53 PDT
On iOS this goes through WebFrameLoaderClient::restoreViewState().