Bug 214862 - Height of an element using height: -webkit-fill-available; is wrong after phone rotation
Summary: Height of an element using height: -webkit-fill-available; is wrong after pho...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-27 21:04 PDT by Simon Fraser (smfr)
Modified: 2020-08-03 21:05 PDT (History)
4 users (show)

See Also:


Attachments
Test (2.57 KB, text/html)
2020-07-27 21:04 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>