-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as duplicate of#10953
Closed as duplicate of#10953
Copy link
Labels
topic: dialogThe <dialog> elementThe <dialog> element
Description
What is the issue with the HTML Standard?
Step 8 of show()
:
Add this to this's node document's open dialogs list.
At no point prior does show()
assert or guard the document being connected. This can result in a disconnected dialog being in the open dialogs list. Removing open
and calling show()
again will hit the assert on Step 7, which if implemented precisely would cause a crash.
let d = document.createElement('dialog');
d.show() // In the open dialogs list!
d.open = false;
d.show() // Assert fails!
The reason this fails is because Dialog has no attribute changed steps to remove a Dialog from the open dialogs list. This is solved by #10954 which aligns the behaviour closer to Chrome.
Chrome's impl is divergent from the spec because Chrome's flow goes something like:
- Show() sets
open
attribute - AttributeChangedSteps fire on Element, calling ParseAttribute
- HTMLDialogElement::ParseAttribute checks if the
open
attribute is being added, and the element is connected. - Then do step 8.
/cc @lukewarlow @mfreed7
Metadata
Metadata
Assignees
Labels
topic: dialogThe <dialog> elementThe <dialog> element