Bug 239687 - Behavior error when rendering dialog with/without the open attribute
Summary: Behavior error when rendering dialog with/without the open attribute
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 15
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-22 23:08 PDT by Chijin
Modified: 2022-06-23 16:48 PDT (History)
3 users (show)

See Also:


Attachments
webkit screenshot (93.96 KB, image/png)
2022-04-22 23:08 PDT, Chijin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chijin 2022-04-22 23:08:23 PDT
Created attachment 458203 [details]
webkit screenshot

The behavior of <dialog> is not expected. As the document (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog) illustates, when the open attribute is not set, the dialog shouldn't be shown to the user. However, webkit didn't meet this end.

The behavior of Chrome seems correct.

code:

```
<html>
<head>
<style>
</style>
<script>
function jsfuzzer() {
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
// "When the open attribute is not set, the dialog shouldn't be shown to the user."
document.getElementById("htmlvar00001").setAttribute("open", "true")
}
</script>
</head>
<body onload=jsfuzzer()>
<dialog id="htmlvar00001">dialog 1</dialog>
<dialog id="htmlvar00002">dialog 2</dialog>
</body>
</html
```

link: https://codepen.io/chijinz/pen/QWaPBam
Comment 1 Radar WebKit Bug Importer 2022-04-29 23:09:33 PDT
<rdar://problem/92558271>
Comment 2 Brent Fulgham 2022-06-23 16:48:47 PDT
Unable to reproduce. Screenshot does not appear to be from Safari.