From 4c081c09f37bec85de8a142814d0238edb02d417 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 10 Apr 2023 08:20:58 -0700 Subject: [PATCH 1/5] Don't throw when popover/dialog is in requested state This patch makes the following changes: - Don't throw exceptions when showPopover or hidePopover is called and the popover is already in the requested state. - Don't throw exceptions when dialog.showModal, dialog.show, or dialog.close is called and the dialog is already in the requested state. - Throw exceptions when trying to switch between modal and non-modal dialog modes via dialog.showModal or dialog.show. Fixes https://github.com/whatwg/html/issues/9045 --- source | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/source b/source index ac51445fdb0..dbfe513e67c 100644 --- a/source +++ b/source @@ -60034,8 +60034,11 @@ interface HTMLDialogElement : HTMLElement { method steps are:

    +
  1. If this has an open attribute and the + is modal flag of this is true, then return.

  2. +
  3. If this has an open attribute, then - return.

  4. + throw an "InvalidStateError" DOMException.

  5. If this is in the popover showing state, then throw an "InvalidStateError" @@ -60054,6 +60057,9 @@ interface HTMLDialogElement : HTMLElement { data-x="dom-dialog-showModal">showModal() method steps are:

      +
    1. If this has an open attribute and the + is modal flag of this is true, then return.

    2. +
    3. If this has an open attribute, then throw an "InvalidStateError" DOMException.

    4. @@ -82130,8 +82136,8 @@ dictionary DragEventInit : MouseEventInit {

      Check popover validity is called again because running hide all popovers until above could have fired the beforetoggle event, and an event handler could have - disconnected this element or called showPopover() on - this element.

      + disconnected this element or changes its popover + attribute.

  6. @@ -82554,18 +82560,27 @@ dictionary DragEventInit : MouseEventInit {
+
  • If element is not connected, then throw a + "InvalidStateError" DOMException.

  • +
  • If one of the following conditions is true

    + +

    then return false.

    +
  • +
  • +

    If one of the following conditions is true

    + +