Skip to content

Add the interestfor attribute - #11006

Open
foolip wants to merge 74 commits into
mainfrom
foolip/interesttarget
Open

foolip wants to merge 74 commits into
mainfrom
foolip/interesttarget

Conversation

@foolip

@foolip foolip commented Feb 6, 2025 •

Copy link
Copy Markdown
Member

The interestfor attribute indicates that an element is an interest
invoker and points (via ID) at the element that should be invoked (made
visible, typically) when the user shows interest in the invoker. When
the target is a popover, it is automatically opened and closed as
interest is gained and lost. The delay before interest is gained or lost
can be customized using the interest-delay-* CSS properties.

The typical use case for this is hovercards and tooltips.

Keyboards, pointing devices, and touch behavior is normatively defined, and the
user agent should provide a way for the user to express interest regardless of
input modality.

Based on https://open-ui.org/components/interest-invokers.explainer/ and
the implementation in Chromium.

The ::interest-button CSS pseudo-element is defined here:
https://drafts.csswg.org/css-pseudo-4/#selectordef-interest-button

The :interest-source and :interest-target CSS pseudo-classes are defined here:
https://drafts.csswg.org/selectors-5/#interest-pseudos

The interest-delay-* CSS properties are defined here:
https://drafts.csswg.org/css-ui-4/#interest


(See WHATWG Working Mode: Changes for more details.)


/browsers.html ( diff )
/form-elements.html ( diff )
/image-maps.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )
/popover.html ( diff )
/rendering.html ( diff )
/semantics-other.html ( diff )
/text-level-semantics.html ( diff )
/interestfor.html ( diff )

@foolip

foolip commented Feb 6, 2025

Copy link
Copy Markdown
Member Author

This is an initial translation of https://open-ui.org/components/interest-invokers.explainer/ to spec language, with a lot of things incomplete.

@mfreed7 I think the two biggest points of uncertainty I have now are the integration with mouse/keyboard/touch input on the one end, and with CSS on the other.

For showing interest, the timing of these algorithms relative to "mouseover" and other events needs to be defined.

For CSS, the fact that there are CSS properties controlling the timing means we need to think about:

  • When do we look at the computed style to extract those times?
  • Is there a state machine with timers, and is anything observable between the initial sign of interest and when we run "capture interest"?

There are many more minor TODOs, but I'd like to get the high-level flow settled first.

@foolip foolip changed the title Add the interesttarget attribute Add the interesttarget attribute Feb 6, 2025
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Outdated

<ul>
<li><p>Actually invoke the capture/lose algorithms.</p></li>
<li><p>Which algorithm reads the computed style for interest-target-delay?</p></li>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There need to be algorithms equivalent to these from Chromium code:

I think those three should hit most of the things in this list. Hopefully.

@foolip
foolip force-pushed the foolip/interesttarget branch from 0aac997 to 9e40cb6 Compare May 14, 2025 14:52
Comment thread source Outdated
<ul>
<li><p><dfn export for="interest state" data-x="interest-state-none">none</dfn></p></li>

<li><p><dfn export for="interest state" data-x="interest-state-partial">partial</dfn></p></li>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfreed7 Chromium additionally has a "potential partial interest" state used for popovers:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/element.cc;l=11060-11067;drc=743a82d08e59d803c94ee1b8564b8b11dd7b462f

Do we have to do the same in the spec? Or can we check if the target element is a popover when the scheduled task runs? The popover attribute could be removed before the task runs, so checking it ahead of time seems like it adds the need to double-check it later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you'll need this. It's used e.g. to add CSS for the "hint" text about the hotkey, and to check the conditions for moving from partial interest to full interest.

This happens when a user focuses an element that targets a popover which contains interactive content. In that situation, the popover is shown in "partial interest" mode, which renders the interactive content non-keyboard-focusable, so that they don't hijack the sequential focus navigation order. Then, hitting a keyboard hotkey, or doing other things like hovering the popover with the mouse, will upgrade it to "full interest".

Since all of the above doesn't happen if the target isn't a popover, you have to check twice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Do we also need :has-potential-partial-interest?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per other conversations, this whole thread is moot.

@mfreed7 mfreed7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I went through these fairly carefully and tried to provide links to Chromium code for the missing stuff. Hopefully that makes it a lot easier for you to find the equivalent code that we're trying to spec out.

Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Outdated
<p>The <dfn element-attr for="html-global"><code data-x="attr-interesttarget">interesttarget</code></dfn>
attribute on <code>a</code>, <code>area</code>, and <code>button</code> elements allows authors to
set up an invoker relationship between the triggering element and a separate target element such
as a popover. With this arrangement, when the user shows interest in the triggering element (e.g.,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that it'll pay off to define a concept for "showing interest" that you can refer to, e.g. in this sentence. That will eliminate "e.g. by hovering or focusing" wherever that appears. And another for "losing interest".

The definition of "showing interest" is loosely hovering the element with the mouse for longer than the delay, or focusing the element with the keyboard for longer than the delay, or long-pressing the element on a touchscreen. Whether it makes sense to define these in words, or just rely on the algorithms that practically say those same things, I leave to you. My preference would be to leave it to the algorithms.

Current Chromium code defines this cleanly in one spot, but as of the time of this comment, the code search cache hasn't updated to see it yet. But you can see the algorithms that essentially define interest for at least mouse and keyboard here.

Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
Comment thread source Resolved
@foolip foolip changed the title Add the interesttarget attribute Add the interestfor attribute Jul 1, 2025
dbaron added a commit that referenced this pull request Oct 8, 2026
This incorporates definitions from PR #11006.
dbaron added a commit that referenced this pull request Oct 13, 2026
This incorporates definitions from PR #11006.
efc54f7 (Fix hiding popovers that are removed or moved between
documents) changed the hide popover algorithm's re-checks of popover
validity to pass document instead of null. This makes the same change
to the re-check that runs after firing loseinterest.
beckysiegel pushed a commit to chromium/chromium that referenced this pull request Oct 21, 2026
Update InterestButtonPseudoElement::DefaultEventHandler to intercept
gesturelongpress events in addition to click and keyboard activation,
triggering immediate interest in the originating element. Also update
GestureManager::HandleGestureEventInFrame to dispatch gesture DOM
events to InnerPossiblyPseudoElement() so hit-testable pseudo elements
receive gesture events.

The equivalent change has been made to the interest invokers
explainer and spec PR:
- https://open-ui.org/components/interest-invokers.explainer/
- whatwg/html#11006
- https://drafts.csswg.org/css-pseudo-4/#selectordef-interest-button

Bug: 453705247
Change-Id: Id5ca9d5fd7916bda7ec9e296f7fa5dbde4de3c5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8593811
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1724150}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 22, 2026
Update InterestButtonPseudoElement::DefaultEventHandler to intercept
gesturelongpress events in addition to click and keyboard activation,
triggering immediate interest in the originating element. Also update
GestureManager::HandleGestureEventInFrame to dispatch gesture DOM
events to InnerPossiblyPseudoElement() so hit-testable pseudo elements
receive gesture events.

The equivalent change has been made to the interest invokers
explainer and spec PR:
- https://open-ui.org/components/interest-invokers.explainer/
- whatwg/html#11006
- https://drafts.csswg.org/css-pseudo-4/#selectordef-interest-button

Bug: 453705247
Change-Id: Id5ca9d5fd7916bda7ec9e296f7fa5dbde4de3c5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8593811
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1724150}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 23, 2026
Update InterestButtonPseudoElement::DefaultEventHandler to intercept
gesturelongpress events in addition to click and keyboard activation,
triggering immediate interest in the originating element. Also update
GestureManager::HandleGestureEventInFrame to dispatch gesture DOM
events to InnerPossiblyPseudoElement() so hit-testable pseudo elements
receive gesture events.

The equivalent change has been made to the interest invokers
explainer and spec PR:
- https://open-ui.org/components/interest-invokers.explainer/
- whatwg/html#11006
- https://drafts.csswg.org/css-pseudo-4/#selectordef-interest-button

Bug: 453705247
Change-Id: Id5ca9d5fd7916bda7ec9e296f7fa5dbde4de3c5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8593811
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1724150}
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Nov 6, 2026
…terest-button, a=testonly

Automatic update from web-platform-tests
Trigger interest when long-pressing ::interest-button

Update InterestButtonPseudoElement::DefaultEventHandler to intercept
gesturelongpress events in addition to click and keyboard activation,
triggering immediate interest in the originating element. Also update
GestureManager::HandleGestureEventInFrame to dispatch gesture DOM
events to InnerPossiblyPseudoElement() so hit-testable pseudo elements
receive gesture events.

The equivalent change has been made to the interest invokers
explainer and spec PR:
- https://open-ui.org/components/interest-invokers.explainer/
- whatwg/html#11006
- https://drafts.csswg.org/css-pseudo-4/#selectordef-interest-button

Bug: 453705247
Change-Id: Id5ca9d5fd7916bda7ec9e296f7fa5dbde4de3c5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8593811
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1724150}

--

wpt-commits: e551ebe4be77cc6c2f4d3b346fd1a8b505e948fb
wpt-pr: 63947
Fix edge cases in losing interest, child hover handling, focus
suppression, target popover lookup, and touch long-press ancestor
traversal. Also fix Web IDL annotations and cross-reference markup.
Karlito8888 added a commit to Karlito8888/css-features that referenced this pull request Nov 8, 2026
…t merged it

Chrome ships interest invokers, but the interestfor attribute is still an open WHATWG pull request (whatwg/html#11006), so the Nu checker rejects it on every interest source. validate.ts now tolerates exactly that message, like the CSS messages; any other HTML error still fails. RULES.md and AGENTS.md say so, and AGENTS.md now lists ::interest-button as the one interest feature left out: Chrome 157 parses it but draws it only behind the experimental web platform features flag.
beckysiegel pushed a commit to chromium/chromium that referenced this pull request Nov 13, 2026
This CL makes four changes to align the interestfor implementation with
the latest version of the spec PR (whatwg/html#11006):

1. The loseinterest event fired as a result of hiding a popover is no
   longer cancelable. Previously, canceling it would leave the invoker
   matching :interest-source and the hidden popover matching
   :interest-target.

2. After firing loseinterest, if the target's active interest source is
   no longer this invoker (e.g. a loseinterest handler reset the
   invoker's interest state), return without hiding the target popover.

3. Moving the pointer between descendants of an interest invoker no
   longer cancels and restarts the interest-delay-start timer. On
   pointerout, ancestors of the pointerout relatedTarget are still
   hovered, so we now exclude them from losing interest. And hovering
   an invoker that already has a pending interest-gained task no longer
   restarts that task.

4. After restoring focus when hiding a popover, the
   suppress-next-focus-interest flag is reset. Previously, if focus
   restoration failed (e.g. because the invoker was hidden or inert),
   the flag leaked and suppressed the next legitimate focus.

These are guarded by the InterestForSpecAlignment kill switch.

The interestfor-keyboard-behavior test is updated, since the
loseinterest fired when a second popover closes the first is now
non-cancelable.

Bug: 326681249
Change-Id: I38c180a61ba36abba020b074c1af685079640642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8761252
Reviewed-by: David Baron <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1744383}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 13, 2026
This CL makes four changes to align the interestfor implementation with
the latest version of the spec PR (whatwg/html#11006):

1. The loseinterest event fired as a result of hiding a popover is no
   longer cancelable. Previously, canceling it would leave the invoker
   matching :interest-source and the hidden popover matching
   :interest-target.

2. After firing loseinterest, if the target's active interest source is
   no longer this invoker (e.g. a loseinterest handler reset the
   invoker's interest state), return without hiding the target popover.

3. Moving the pointer between descendants of an interest invoker no
   longer cancels and restarts the interest-delay-start timer. On
   pointerout, ancestors of the pointerout relatedTarget are still
   hovered, so we now exclude them from losing interest. And hovering
   an invoker that already has a pending interest-gained task no longer
   restarts that task.

4. After restoring focus when hiding a popover, the
   suppress-next-focus-interest flag is reset. Previously, if focus
   restoration failed (e.g. because the invoker was hidden or inert),
   the flag leaked and suppressed the next legitimate focus.

These are guarded by the InterestForSpecAlignment kill switch.

The interestfor-keyboard-behavior test is updated, since the
loseinterest fired when a second popover closes the first is now
non-cancelable.

Bug: 326681249
Change-Id: I38c180a61ba36abba020b074c1af685079640642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8761252
Reviewed-by: David Baron <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1744383}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 13, 2026
This CL makes four changes to align the interestfor implementation with
the latest version of the spec PR (whatwg/html#11006):

1. The loseinterest event fired as a result of hiding a popover is no
   longer cancelable. Previously, canceling it would leave the invoker
   matching :interest-source and the hidden popover matching
   :interest-target.

2. After firing loseinterest, if the target's active interest source is
   no longer this invoker (e.g. a loseinterest handler reset the
   invoker's interest state), return without hiding the target popover.

3. Moving the pointer between descendants of an interest invoker no
   longer cancels and restarts the interest-delay-start timer. On
   pointerout, ancestors of the pointerout relatedTarget are still
   hovered, so we now exclude them from losing interest. And hovering
   an invoker that already has a pending interest-gained task no longer
   restarts that task.

4. After restoring focus when hiding a popover, the
   suppress-next-focus-interest flag is reset. Previously, if focus
   restoration failed (e.g. because the invoker was hidden or inert),
   the flag leaked and suppressed the next legitimate focus.

These are guarded by the InterestForSpecAlignment kill switch.

The interestfor-keyboard-behavior test is updated, since the
loseinterest fired when a second popover closes the first is now
non-cancelable.

Bug: 326681249
Change-Id: I38c180a61ba36abba020b074c1af685079640642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8761252
Reviewed-by: David Baron <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1744383}
dbaron added a commit that referenced this pull request Nov 20, 2026
This incorporates definitions from PR #11006.
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Nov 24, 2026
…dates, a=testonly

Automatic update from web-platform-tests
Align interestfor with recent spec PR updates

This CL makes four changes to align the interestfor implementation with
the latest version of the spec PR (whatwg/html#11006):

1. The loseinterest event fired as a result of hiding a popover is no
   longer cancelable. Previously, canceling it would leave the invoker
   matching :interest-source and the hidden popover matching
   :interest-target.

2. After firing loseinterest, if the target's active interest source is
   no longer this invoker (e.g. a loseinterest handler reset the
   invoker's interest state), return without hiding the target popover.

3. Moving the pointer between descendants of an interest invoker no
   longer cancels and restarts the interest-delay-start timer. On
   pointerout, ancestors of the pointerout relatedTarget are still
   hovered, so we now exclude them from losing interest. And hovering
   an invoker that already has a pending interest-gained task no longer
   restarts that task.

4. After restoring focus when hiding a popover, the
   suppress-next-focus-interest flag is reset. Previously, if focus
   restoration failed (e.g. because the invoker was hidden or inert),
   the flag leaked and suppressed the next legitimate focus.

These are guarded by the InterestForSpecAlignment kill switch.

The interestfor-keyboard-behavior test is updated, since the
loseinterest fired when a second popover closes the first is now
non-cancelable.

Bug: 326681249
Change-Id: I38c180a61ba36abba020b074c1af685079640642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8761252
Reviewed-by: David Baron <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1744383}

--

wpt-commits: 33926aca0f4313541f0ac5d67d4a4ab949d50b16
wpt-pr: 65167
Add authoring guidance advising against using interestfor to target a
"rich" popover on elements that also invoke a popover on activation
(via commandfor/command or popovertarget) or already have an explicit
aria-expanded attribute, due to conflicting aria-expanded/aria-details
semantics. Note that "plain" popovers (e.g. simple tooltips) have no
conflict, and summarize the HTML-AAM fallback precedence rules
(w3c/aria#2617).

Per mozilla/standards-positions#1181
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Nov 25, 2026
…dates, a=testonly

Automatic update from web-platform-tests
Align interestfor with recent spec PR updates

This CL makes four changes to align the interestfor implementation with
the latest version of the spec PR (whatwg/html#11006):

1. The loseinterest event fired as a result of hiding a popover is no
   longer cancelable. Previously, canceling it would leave the invoker
   matching :interest-source and the hidden popover matching
   :interest-target.

2. After firing loseinterest, if the target's active interest source is
   no longer this invoker (e.g. a loseinterest handler reset the
   invoker's interest state), return without hiding the target popover.

3. Moving the pointer between descendants of an interest invoker no
   longer cancels and restarts the interest-delay-start timer. On
   pointerout, ancestors of the pointerout relatedTarget are still
   hovered, so we now exclude them from losing interest. And hovering
   an invoker that already has a pending interest-gained task no longer
   restarts that task.

4. After restoring focus when hiding a popover, the
   suppress-next-focus-interest flag is reset. Previously, if focus
   restoration failed (e.g. because the invoker was hidden or inert),
   the flag leaked and suppressed the next legitimate focus.

These are guarded by the InterestForSpecAlignment kill switch.

The interestfor-keyboard-behavior test is updated, since the
loseinterest fired when a second popover closes the first is now
non-cancelable.

Bug: 326681249
Change-Id: I38c180a61ba36abba020b074c1af685079640642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8761252
Reviewed-by: David Baron <dbaronchromium.org>
Auto-Submit: Mason Freed <masonfchromium.org>
Commit-Queue: Mason Freed <masonfchromium.org>
Cr-Commit-Position: refs/heads/main{#1744383}

--

wpt-commits: 33926aca0f4313541f0ac5d67d4a4ab949d50b16
wpt-pr: 65167

UltraBlame original commit: ff53ef0f653972fd27022dabbecbd2fb36c0873b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Nov 25, 2026
…dates, a=testonly

Automatic update from web-platform-tests
Align interestfor with recent spec PR updates

This CL makes four changes to align the interestfor implementation with
the latest version of the spec PR (whatwg/html#11006):

1. The loseinterest event fired as a result of hiding a popover is no
   longer cancelable. Previously, canceling it would leave the invoker
   matching :interest-source and the hidden popover matching
   :interest-target.

2. After firing loseinterest, if the target's active interest source is
   no longer this invoker (e.g. a loseinterest handler reset the
   invoker's interest state), return without hiding the target popover.

3. Moving the pointer between descendants of an interest invoker no
   longer cancels and restarts the interest-delay-start timer. On
   pointerout, ancestors of the pointerout relatedTarget are still
   hovered, so we now exclude them from losing interest. And hovering
   an invoker that already has a pending interest-gained task no longer
   restarts that task.

4. After restoring focus when hiding a popover, the
   suppress-next-focus-interest flag is reset. Previously, if focus
   restoration failed (e.g. because the invoker was hidden or inert),
   the flag leaked and suppressed the next legitimate focus.

These are guarded by the InterestForSpecAlignment kill switch.

The interestfor-keyboard-behavior test is updated, since the
loseinterest fired when a second popover closes the first is now
non-cancelable.

Bug: 326681249
Change-Id: I38c180a61ba36abba020b074c1af685079640642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8761252
Reviewed-by: David Baron <dbaronchromium.org>
Auto-Submit: Mason Freed <masonfchromium.org>
Commit-Queue: Mason Freed <masonfchromium.org>
Cr-Commit-Position: refs/heads/main{#1744383}

--

wpt-commits: 33926aca0f4313541f0ac5d67d4a4ab949d50b16
wpt-pr: 65167

UltraBlame original commit: ff53ef0f653972fd27022dabbecbd2fb36c0873b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Nov 25, 2026
…dates, a=testonly

Automatic update from web-platform-tests
Align interestfor with recent spec PR updates

This CL makes four changes to align the interestfor implementation with
the latest version of the spec PR (whatwg/html#11006):

1. The loseinterest event fired as a result of hiding a popover is no
   longer cancelable. Previously, canceling it would leave the invoker
   matching :interest-source and the hidden popover matching
   :interest-target.

2. After firing loseinterest, if the target's active interest source is
   no longer this invoker (e.g. a loseinterest handler reset the
   invoker's interest state), return without hiding the target popover.

3. Moving the pointer between descendants of an interest invoker no
   longer cancels and restarts the interest-delay-start timer. On
   pointerout, ancestors of the pointerout relatedTarget are still
   hovered, so we now exclude them from losing interest. And hovering
   an invoker that already has a pending interest-gained task no longer
   restarts that task.

4. After restoring focus when hiding a popover, the
   suppress-next-focus-interest flag is reset. Previously, if focus
   restoration failed (e.g. because the invoker was hidden or inert),
   the flag leaked and suppressed the next legitimate focus.

These are guarded by the InterestForSpecAlignment kill switch.

The interestfor-keyboard-behavior test is updated, since the
loseinterest fired when a second popover closes the first is now
non-cancelable.

Bug: 326681249
Change-Id: I38c180a61ba36abba020b074c1af685079640642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8761252
Reviewed-by: David Baron <dbaronchromium.org>
Auto-Submit: Mason Freed <masonfchromium.org>
Commit-Queue: Mason Freed <masonfchromium.org>
Cr-Commit-Position: refs/heads/main{#1744383}

--

wpt-commits: 33926aca0f4313541f0ac5d67d4a4ab949d50b16
wpt-pr: 65167

UltraBlame original commit: ff53ef0f653972fd27022dabbecbd2fb36c0873b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants