From 5a673030cc645b3379c287867c6e16cc30772334 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 11 May 2020 18:43:07 -0400 Subject: [PATCH] Add notes explaining how .showModal() focuses It was unclear how the "focus fixup rule" came into play, since that rule is done using action at a distance. This inserts notes explicitly calling out what happens. See https://github.com/web-platform-tests/wpt/pull/23485 for background. --- source | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/source b/source index 6df46e2b806..42b397f189a 100644 --- a/source +++ b/source @@ -56626,8 +56626,17 @@ interface HTMLDialogElement : HTMLElement {
  • Set the dialog to the centered alignment mode.

  • -
  • Let subject's node document be blocked by the modal dialog subject.

  • +
  • +

    Let subject's node document be blocked by the modal dialog subject.

    + +

    This will cause the focused area of the + document to become inert (unless that currently focused area is a + shadow-including descendant of subject). In such cases, the focus + fixup rule will kick in and reset the focused area of the document to the + viewport for now. In a couple steps we will attempt to find a better candidate to + focus.

    +
  • If subject's node document's top layer does not already contain subject, then HTMLDialogElement : HTMLElement {

    If there isn't one of those either, then let control be subject.

  • -
  • Run the focusing steps for control.

  • +
  • +

    Run the focusing steps for control.

    + +

    If control is not focusable, this will do nothing. For + modal dialogs, this means that any earlier + modifications to the focused area of the document will apply.

    +
  • Let topDocument be the active document of control's node document's browsing context's