Bug 214862

Summary: Height of an element using height: -webkit-fill-available; is wrong after phone rotation
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test none

Description Simon Fraser (smfr) 2020-07-27 21:04:03 PDT
Created attachment 405340 [details]
Test

Load the attached test on an iPhone. Note how the green element fits the visible size of the view (as noted here: https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/).

Now rotate to landscape. It's still the same height, so too tall. Now reload, and it's still a bit taller than the visible area (MobileSafari provides a height that is a "bar hidden" height).

Now rotate back to portrait. The green box is still the landscape size.
Comment 1 Simon Fraser (smfr) 2020-07-27 21:05:59 PDT
With height: -webkit-fill-available we end up in RenderView::availableLogicalHeight() which just uses frameView().visibleHeight(), but this seems to be wrong or stale after rotation.
Comment 2 Simon Fraser (smfr) 2020-07-27 21:19:56 PDT
It's stale on rotation because WebPage::dynamicViewportSizeUpdate() does two layouts; the first uses the old visibleRect() (which comes out of ScrollView::m_delegatedScrollingGeometry->unobscuredContentSize), then we update unobscuredContentSize and do another layout, but we don't seem to have dirtied the -webkit-fill-available for layout.
Comment 3 Radar WebKit Bug Importer 2020-08-03 21:05:21 PDT
<rdar://problem/66506365>