Bug 266235 - iOS 17.2 Fullscreen API - Iframe doesn't take parent document viewport when sent fullscreen
Summary: iOS 17.2 Fullscreen API - Iframe doesn't take parent document viewport when s...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 17
Hardware: iPhone / iPad iOS 17
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-12-11 10:35 PST by Robert Bryer
Modified: 2023-12-11 16:49 PST (History)
5 users (show)

See Also:


Attachments
Video player with tiny controls (2.94 MB, image/png)
2023-12-11 10:35 PST, Robert Bryer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Bryer 2023-12-11 10:35:07 PST
Created attachment 468979 [details]
Video player with tiny controls

When our player sends the iframe fullscreen, we see that the viewport is scaled very small. The parent page has a <meta name="viewport"...>, but these attributes of the parent aren't applying to the iframe. The controls of the player are therefore tiny when in fullscreen.

The parent document has:
<meta name="viewport" content="width=device-width, initial-scale=1.0">

iPhone 13 / iOS 17.2
With the Fullscreen API feature flag turned on:
1. Visit http://cookbook.tools.bbc.co.uk/news?player=smphtml5 and play.
2. In portrait, go fullscreen.
3. See the controls of the video player are scaled really tiny.



We can fix this problem by duplicating the meta tag and adding it to the iframe's document's <head>, and this will fix the scaling. However we haven't needed to do this for any other fullscreen API implementation so I think (and correct me if I'm wrong) that the iframe should instead be taking these viewport attributes from its parent.

Extra:
4. Add a meta tag to the iframe by running in the console:
> $('#smphtml5iframemp')[0].contentWindow.document.head.appendChild($('<meta name="viewport" content="width=device-width, initial-scale=1.0">')[0])
Comment 1 Radar WebKit Bug Importer 2023-12-11 12:44:37 PST
<rdar://problem/119511225>
Comment 2 Karl Dubost 2023-12-11 16:48:44 PST
Could it be related to Bug 149889 and Bug 53546.
Adding Simon
Comment 3 Karl Dubost 2023-12-11 16:49:58 PST
Also maybe related Bug 172926
They all refer to iframe flattening.