From 3665a26903c03c4ba2a25bb75aa78fb399caace4 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 12 Apr 2022 17:50:41 -0400 Subject: [PATCH 1/3] Add a note about why dialog uses show/close Closes #7748. --- source | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/source b/source index aa6cf8a37e6..795d5b7f5d4 100644 --- a/source +++ b/source @@ -58899,7 +58899,7 @@ interface HTMLDialogElement : HTMLElement { -
+

Removing the open attribute will usually hide the dialog. However, doing so has a number of strange additional consequences: @@ -59102,6 +59102,45 @@ interface HTMLDialogElement : HTMLElement { the last value to which it was set. On setting, it must be set to the new value. When the element is created, it must be set to the empty string.

+
+ +
+

The reason we use show/close as the verbs for dialog elements, as opposed to verb pairs that + are more commonly thought of as English antonyms such as show/hide or open/close, is due to the + following constraints:

+ +
    +
  • Hiding a dialog is different from closing one. Closing a dialog gives it a return value, + fires an event, unblocks the page for other dialogs, and so on. Whereas hiding a dialog is a + purely visual property, and is something you can already do with the hidden attribute or by removing the open attribute. (See also the note above about removing the open attribute, and how hiding the dialog in that way is + generally not desired.)

  • + +
  • Showing a dialog is different from opening one. Opening a dialog consists of creating + and showing that dialog (similar to how window.open() both + creates and shows a new window). Whereas showing the dialog is the process of taking a + dialog element that is already in the DOM, and making it interactive and visible + to the user.

  • + +
  • If we were to have a dialog.open() method despite the above, it + would conflict with the dialog.open property.

  • +
+ +

Furthermore, a survey + of many other UI frameworks contemporary to the original design of the dialog + element made it clear that the show/close verb pair was reasonably common.

+ +

In summary, it turns out that the implications of English verbs, and how they are used in + technology contexts, mean that paired actions such as showing and closing a dialog are not + always expressible as antonyms.

+
+ +
+

Canceling dialogs: When Document is From 3b62ffefa824fb0be91fb41a598e867541fe1c72 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 14 Apr 2022 11:03:09 -0400 Subject: [PATCH 2/3] Add id="" to the note for even easier linking --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 795d5b7f5d4..b805b48045e 100644 --- a/source +++ b/source @@ -59104,7 +59104,7 @@ interface HTMLDialogElement : HTMLElement {

-
+

The reason we use show/close as the verbs for dialog elements, as opposed to verb pairs that are more commonly thought of as English antonyms such as show/hide or open/close, is due to the following constraints:

From 339737664aa2f89f84060dd521442bf34b500224 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 21 Apr 2022 12:51:21 -0400 Subject: [PATCH 3/3] Tweaks --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index b805b48045e..bcbdb7287a8 100644 --- a/source +++ b/source @@ -59105,9 +59105,9 @@ interface HTMLDialogElement : HTMLElement {
-

The reason we use show/close as the verbs for dialog elements, as opposed to verb pairs that - are more commonly thought of as English antonyms such as show/hide or open/close, is due to the - following constraints:

+

We use show/close as the verbs for dialog elements, as opposed to verb pairs that + are more commonly thought of as antonyms such as show/hide or open/close, due to the following + constraints:

  • Hiding a dialog is different from closing one. Closing a dialog gives it a return value, @@ -59134,7 +59134,7 @@ interface HTMLDialogElement : HTMLElement { of many other UI frameworks contemporary to the original design of the dialog element made it clear that the show/close verb pair was reasonably common.

    -

    In summary, it turns out that the implications of English verbs, and how they are used in +

    In summary, it turns out that the implications of certain verbs, and how they are used in technology contexts, mean that paired actions such as showing and closing a dialog are not always expressible as antonyms.