Bug 243488 - Why I create an iframe, but it affected promise microtasks in webkit
Summary: Why I create an iframe, but it affected promise microtasks in webkit
Status: RESOLVED DUPLICATE of bug 235322
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 13
Hardware: All All
: P1 Blocker
Assignee: Nobody
URL: https://codesandbox.io/s/compassionat...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-03 01:41 PDT by 993634344
Modified: 2022-08-05 17:40 PDT (History)
2 users (show)

See Also:


Attachments

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