Repository navigation
Conversation
|
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:
There are many more minor TODOs, but I'd like to get the high-level flow settled first. |
interesttarget attribute
|
|
||
| <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> |
There was a problem hiding this comment.
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.
0aac997 to
9e40cb6
Compare
| <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> |
There was a problem hiding this comment.
@mfreed7 Chromium additionally has a "potential partial interest" state used for popovers:
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I see. Do we also need :has-potential-partial-interest?
There was a problem hiding this comment.
Per other conversations, this whole thread is moot.
mfreed7
left a comment
There was a problem hiding this comment.
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.
| <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., |
There was a problem hiding this comment.
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.
This incorporates definitions from PR #11006.
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.
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}
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}
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}
…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.
…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.
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}
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}
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}
This incorporates definitions from PR #11006.
…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
# Conflicts: # source
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
…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
…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
…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
The
interestforattribute indicates that an element is an interestinvoker 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-buttonCSS pseudo-element is defined here:https://drafts.csswg.org/css-pseudo-4/#selectordef-interest-button
The
:interest-sourceand:interest-targetCSS 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 )