Skip to content

Commit

Permalink
Apply suggestions from HTML editor code review
Browse files Browse the repository at this point in the history
Co-authored-by: Domenic Denicola <d@domenic.me>
  • Loading branch information
melanierichards and domenic authored Aug 20, 2021
1 parent ccd9b75 commit dd86e42
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions research/src/pages/popup/popup.proposal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ The `show()` method renders the `popup` element, such that the user can interact
```

The show() method steps are to run the [showing a `popup` element steps](#showing-popup-steps) with
[this](https://heycam.github.io/webidl/#this) with _candidate subject_ set to the new candidate
`popup` element to be shown.
[this](https://heycam.github.io/webidl/#this).

### The `popup` attribute

Expand Down Expand Up @@ -211,8 +210,7 @@ steps:
2. Get the _subject_'s _open state_.
3. If _subject_'s _open state_ is `true`, run
[hiding a `popup` element steps](#hiding-current-popups).
4. Otherwise, run [showing a `popup` element steps](#showing-popup-steps), with _candidate subject_
set to _subject_ and _invoker_ set to the current element _invoker_.
4. Otherwise, run [showing a `popup` element steps](#showing-popup-steps) with _subject_ and _invoker_.

<p class="question">
Should we have a way to suppress these steps upon focus, so that the author can enable the popup
Expand All @@ -227,22 +225,19 @@ The **showing a `popup` element steps**, given a popup element _candidate subjec
element _invoker_, and an optional element _anchor element_, are:

1. Run the [hiding currently-shown `popup` elements steps](#hiding-current-popups), with the
_candidate subject_, optional element _invoker_, and optional element _anchor element_.
_candidate subject_, _invoker_ if it was given, and _anchor element_ if it was given.
2. Add the _candidate subject_ to _candidate subject_'s
[node document](https://dom.spec.whatwg.org/#concept-node-document)'s [popup stack](#popup-stack).
3. Set the `open` IDL attribute on the _candidate subject_ to `true`.
4. Set the _candidate subject_'s _open state_ to `true`.
5. If the `popup` element was shown as a result of a user interaction with an `invoker`, internally
set the _candidate subject_'s _invoker_ to a pointer to the `invoker` element.
6. Run [get the focusable area
steps](https://html.spec.whatwg.org/multipage/interaction.html#get-the-focusable-area) with
_focus target_ set to the _candidate subject_.
7. Run [focusing steps](https://html.spec.whatwg.org/multipage/interaction.html#focusing=steps)
with _new focus target_ set to the returned node from [get the focusable area
steps](https://html.spec.whatwg.org/multipage/interaction.html#get-the-focusable-area).
6. Let _focusableArea_ be the result of [getting the focusable area
steps](https://html.spec.whatwg.org/multipage/interaction.html#get-the-focusable-area) given _candidate subject_.
7. Run the [focusing steps](https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps) given _focusableArea_.

<p class="note">
Without the precense of the autofocus or delegatefocus attribute, focus remains on the active
Without the presence of the autofocus or delegatefocus attribute, focus remains on the active
element. This behavior is to enable scenarios where the popup is used in a composite control. For
example, a combobox where the user expects their focus to stay in the text input instead of moving
automatically to the listbox popup as and when it appears.
Expand Down Expand Up @@ -283,7 +278,7 @@ shown, focus should move to the descendent of the `popup` element where `autofoc

The `delegatesfocus` content attribute is a
[boolean attribute](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attribute).
When specified, it indicates that when the `popup` element is shown, focus should move to the first
When specified, it indicates that when the `popup` element is shown, focus will move to the first
focusable descendent of the `popup` element.

**Example:**
Expand Down Expand Up @@ -317,7 +312,7 @@ relationship. When specified, the attribute's value must be the ID of an element
</popup>
```

The target of the `anchor` attribute participates in determining whether a candiate _popup_ element
The target of the `anchor` attribute participates in determining whether a candidate `popup` element
is "nested" in a currently-shown `popup`; refer to <a href="#hiding-current-popups">hiding
currently-shown <code>popup</code> elements steps</a>.

Expand Down

0 comments on commit dd86e42

Please sign in to comment.