Bug 243488

Summary: Why I create an iframe, but it affected promise microtasks in webkit
Product: WebKit Reporter: 993634344
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Blocker CC: cdumez, rniwa
Priority: P1    
Version: Safari 13   
Hardware: All   
OS: All   
URL: https://codesandbox.io/s/compassionate-volhard-86pz0b?file=/index.html;https://86pz0b.csb.app/

Description 993634344 2022-08-03 01:41:50 PDT
I find an unexpected result when I created an iframe in my code, but it affected promise microtasks in webkit.eg: safari,iosApp webview.

code:
Promise.resolve(1).then(data => {
  console.log('>>>data')
})

var node = document.createElement('iframe')
node.style.display = 'none'

node.src = 'www.baidu.com';
(document.body || document.documentElement).appendChild(node)
console.log('>>>end')


It‘s normal output is:
>>>end
>>>data

But it‘s output in webkit is:
>>>data
>>>end
Comment 1 Ryosuke Niwa 2022-08-05 17:40:22 PDT

*** This bug has been marked as a duplicate of bug 235322 ***