Bug 239687

Summary: Behavior error when rendering dialog with/without the open attribute
Product: WebKit Reporter: Chijin <tlock.chijin>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: bfulgham, ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: All   
OS: All   
Attachments:
Description Flags
webkit screenshot none

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.