Bug 243131 - document.close, scripts in document.write, and later-defined onload event handlers
Summary: document.close, scripts in document.write, and later-defined onload event han...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 15
Hardware: Mac (Apple Silicon) macOS 12
: P2 Normal
Assignee: Nobody
URL: https://bug204497.bmoattachments.org/...
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-07-23 03:22 PDT by Ahmad Saleem
Modified: 2022-07-25 00:10 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2022-07-23 03:22:28 PDT
Hi Team,

Another test case, which I found in Mozilla Bugzilla to see where for onload Safari behavior is different from other browsers:

*** STEPS TO REPRODUCE ***

1 - Load test URL - https://bug204497.bmoattachments.org/attachment.cgi?id=

>>>> ACTUAL RESULT:

Safari should onAlert dialog window with 777 in it and then after dismissing, it loads body with 'y' in it.

>>>> EXPECTED RESULT:

Firefox Nightly 104 and Chrome Canary 105 does not show 777 dialog window and just load body with 'y' in it.

As per Mozilla bug report - it should show 'Alert' window but I am not sure on the web-specs here but since Safari behavior is different (whether aligned with web-spec or not), I just wanted to raise this bug report.

Thanks
Comment 1 Ahmad Saleem 2022-07-23 03:23:46 PDT
For some reason - test URL in Description / Comment 0 is broken, please use from URL field or below:

Link - https://bug204497.bmoattachments.org/attachment.cgi?id=267050
Comment 2 Sam Sneddon [:gsnedders] 2022-07-23 08:53:13 PDT
(In reply to Ahmad Saleem from comment #0)
> As per Mozilla bug report - it should show 'Alert' window but I am not sure
> on the web-specs here but since Safari behavior is different (whether
> aligned with web-spec or not), I just wanted to raise this bug report.

Pretty sure Firefox and Chrome are right v. HTML today.

That said, I suspect this is more about when HTML says to spin the event loop and when document.close stops parsing than anything else.
Comment 3 Radar WebKit Bug Importer 2022-07-23 10:34:18 PDT
<rdar://problem/97487338>