Bug 251595

Summary: Incorrect rendering of nested iframes in the absence of src/srcdoc/document.write
Product: WebKit Reporter: Matthieu Wipliez <matthieu.wipliez>
Component: FramesAssignee: Nobody <webkit-unassigned>
Status: REOPENED ---    
Severity: Major CC: karlcow, rniwa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: All   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=251592
Attachments:
Description Flags
rendering of iframe 3
none
rendering in safari, firefox, chrome none

Description Matthieu Wipliez 2023-02-02 08:44:30 PST
This seems somewhat related to bug #251592

When creating nested iframes dynamically in JavaScript, only the first 2 iframes are correctly rendered.
It is necessary to use "document.write" to force the iframes to render properly on Safari (expect notably on Safari 16.3 as the aforementioned bug shows).

Steps to reproduce :
Go to the URL: https://sample.teads.net/demo/bugs/safari-nested-iframe.html
Scroll down to the red rectangle
Observe that you see "hey there 0" and "hey there 1".

Expected: "hey there 0", "hey there 1", "hey there 2", "hey there 3".
Open the page on Firefox or Chrome, and witness the expected behavior.

I'm marking this as "Major" rather than "Critical" only because there is a workaround thanks to document.write.
Comment 1 Radar WebKit Bug Importer 2023-02-06 15:52:08 PST
<rdar://problem/105102996>
Comment 2 Karl Dubost 2023-02-09 00:17:35 PST
Created attachment 464920 [details]
rendering of iframe 3

This is nested iframe 3 in blue.
Comment 3 Matthieu Wipliez 2023-02-14 09:47:28 PST
The nested iframe should appear within the others, no?
Comment 4 Karl Dubost 2023-11-13 18:44:48 PST
This might have been fixed by https://github.com/apple/WebKit/pull/380
Comment 5 Karl Dubost 2023-11-13 18:45:16 PST
Matthieu could you confirm?
Comment 6 Matthieu Wipliez 2024-01-12 06:56:53 PST
Hi Karl, sorry I have been out of office for a while. The bug is still present in Safari 17.1.2 as well as in Safari Technology Preview 17.4. The code works fine in both Chrome and Firefox latest versions.
Comment 7 Karl Dubost 2024-01-14 22:47:43 PST
Created attachment 469401 [details]
rendering in safari, firefox, chrome

iframe 2 and 3 are not visible the same way than they are visible in Firefox/Chrome.

Confirmed that this is still happening in 
STP Release 185 (Safari 17.4, WebKit 19618.1.9.8)
STP Release 186 (Safari 17.4, WebKit 19618.1.10.1.1)
Comment 8 Karl Dubost 2024-01-15 16:55:58 PST
<rdar://121021077>