Bug 212371 - New page loaded with a negative content offset for the first time
Summary: New page loaded with a negative content offset for the first time
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 13
Hardware: Mac macOS 10.15
: P2 Critical
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-26 06:15 PDT by Daohan Chong
Modified: 2021-06-17 20:00 PDT (History)
5 users (show)

See Also:


Attachments
Demo project (need to be run on macCatalyst) (31.51 KB, application/zip)
2020-05-26 06:21 PDT, Daohan Chong
no flags Details
Screenshot (252.78 KB, image/jpeg)
2020-05-26 06:23 PDT, Daohan Chong
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daohan Chong 2020-05-26 06:15:19 PDT
On Safari Version 13.1 (15609.1.20.111.8) of macOS, there is a bug:
When opening a page for the first time, the content has a negative offset on the vertical direction.

This can also be reproduced with macCatalyst and WKWebView.


Repro steps:

1. Search some keywords on Google, such as "Keyshot"
2. Open keyshot.com on Google search results
3. Observe the content offset

If you resize the Safari window, the bug will disappear.
Comment 1 Daohan Chong 2020-05-26 06:21:52 PDT
Created attachment 400241 [details]
Demo project (need to be run on macCatalyst)

Attaching a demo project.

Please note that this should be run on mac catalyst
Comment 2 Daohan Chong 2020-05-26 06:23:35 PDT
Created attachment 400242 [details]
Screenshot

Attaching a screenshot
Comment 3 Radar WebKit Bug Importer 2020-05-26 06:42:48 PDT
<rdar://problem/63622170>
Comment 4 Tim Horton 2020-05-26 10:13:12 PDT
This reproduces for me.

You can work around this (I tried in your test app) by avoiding the safe area:

webView.frame = view.bounds.inset(by: view.safeAreaInsets)

but ... we should figure out why this isn't working, since it works fine on iOS.
Comment 5 Daohan Chong 2020-08-10 17:10:33 PDT
This bug still exists on Version 14.0 (16610.1.23.1.3), Big Sur beta
Comment 6 Daohan Chong 2020-09-17 08:08:04 PDT
Adding a new radar: FB8704777
Comment 7 David Kilzer (:ddkilzer) 2020-09-22 10:00:35 PDT
(In reply to Daohan Chong from comment #6)
> Adding a new radar: FB8704777

The interesting thing about this bug report (per the reporter) is that it demonstrates that this bug also affects MobileSafari.
Comment 8 Daohan Chong 2020-10-05 05:16:11 PDT
(In reply to David Kilzer (:ddkilzer) from comment #7)
> (In reply to Daohan Chong from comment #6)
> > Adding a new radar: FB8704777
> 
> The interesting thing about this bug report (per the reporter) is that it
> demonstrates that this bug also affects MobileSafari.

Desktop Safari is also affected. Not 100% repro.
Comment 9 Daohan Chong 2021-06-17 19:22:17 PDT
Any updates on this bug?

It can still be reproduced on macOS 12.0 beta.

In addition, on iOS 14.x, `SFSafariViewController` can sometimes repro this bug.