Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Popover: check dialog's is modal flag instead of open attribute
The following case currently does not fail dialog.showModal(); dialog.open = false; dialog.showPopover(); even though it is a top layer conflict: 1. showModal() pushes to the top layer. 2. open = false then hides the dialog, while keeping it in top layer. 3. showPopover() pushes to the top layer again. The check for the open attribute is supposed to prevent top layer conflicts, since those conflicts can leave the element in a broken state, notably after hiding. For instance, the previous sequence of actions followed by dialog.hidePopover() will leave the is modal flag set to true despite the dialog being completely removed from the top layer. Also only remove from top layer in HTMLDialogElement.prototype.close() when the is modal flag is true to prevent that method from removing popovers from the top layer. For dialog.close() to be symmetric & consistent with dialog.show(), we also stop throwing when show() is called on a dialog in the popover showing state. Tests: WebKit/WebKit#14454. Fixes whatwg#9335.
- Loading branch information