Living Standard — Last Updated 8 October 2026
An element can act as an interest invoker (or interest invokers) for a target element. When the user shows interest in the interest invoker (e.g., by hovering or focusing it), if the target is a popover with a popover visibility state of , this will show the popover. When the user loses interest (e.g., by no longer hovering or focusing the interest source or target), if the target is a popover with a popover visibility state of showing, it will be hidden.
The interest invoker concept is used to describe how other features work, but it is not currently exposed directly to authors.
Each element has an interest target element, which is an element or null. Unless otherwise specified, an element's interest target element is null.
Every HTML element has an element-or-null active interest target, initially null.
Every Document has an active interest sources set, a set
of HTML elements, initially the empty set.
The active interest sources set holds all of the HTML elements in the document that have a non-null active interest target, in the order that interest was gained.
Every HTML element has a pending gain interest handle and a pending lose interest handle, which are both a unique internal value or null, initially null.
These handles are used to abort steps that run after a timeout, effectively canceling the tasks.
Every HTML element has a boolean suppress next focus interest, initially false.
Every HTML element has a boolean explicit interest, initially false.
An element has explicit interest when interest was gained through an explicit user action, such as a long press on a touch device. Such interest is not lost when the element stops being hovered or focused, since the element was not hovered or focused to gain interest in the first place.
Every element has an element-or-null active interest source, initially null.
When non-null, an element's active interest target is a cached result of its interest target element and the target's active interest source points back to the source. This is a convenience that makes it easier to handle tree modifications that break the association between source and target.
To handle interest change for an element element, a boolean show, and a boolean viaFocus:
If element is not connected, or element's node document is not fully active, then return.
For each element candidate of element's inclusive ancestors in the flat tree:
If show is true:
For each element upstream of candidate's recursive active interest sources:
Set upstream's pending lose interest handle to null.
This effectively cancels any pending task to lose interest for upstream. User interactions such as hovering or focusing an interest target or its descendants prevent those tasks from running, so that interest isn't lost while the user is interacting with the target.
If candidate is an HTML element:
Set candidate's pending lose interest handle to null.
Let suppressFocusInterest be true if viaFocus is true and candidate's suppress next focus interest is true; otherwise false.
Set candidate's suppress next focus interest to false.
If suppressFocusInterest is true, then continue.
If candidate's active interest target is not null, then continue.
Let target be candidate's interest target element.
If target is null, then continue.
If the computed value of 'interest-delay-start' on candidate is 'normal', then let delay be an implementation-defined number of milliseconds. Otherwise, let delay be the computed value of 'interest-delay-start' on candidate, interpreted as a number of milliseconds.
A typical value for the 'normal' delay is 250 milliseconds.
If delay is negative, infinite, or NaN, then continue.
Set candidate's pending gain interest handle to null.
Let uniqueHandle be null.
Let task be a task that runs the following substeps:
Assert: uniqueHandle is a unique internal value, not null.
If uniqueHandle is not candidate's pending gain interest handle, then abort these steps.
Set candidate's pending gain interest handle to null.
If the interest ready check for candidate and target returns false, then abort these steps.
Gain interest in candidate given target.
Let global be candidate's relevant global object.
Let completionStep be an algorithm step which queues a global task on the timer task source given global to run task.
Set uniqueHandle to the result of running steps after a timeout given global, "interest change", delay, and
completionStep.
Set candidate's pending gain interest handle to uniqueHandle.
Otherwise (when show is false):
If candidate is an HTML element:
Set candidate's pending gain interest handle to null.
If candidate's active interest target is not null and candidate's explicit interest is false, then schedule losing interest for candidate.
For each element upstream of candidate's recursive active interest sources:
Schedule losing interest for upstream.
To schedule losing interest for an HTML element source:
Let target be source's active interest target.
If target is null, then return.
If the computed value of 'interest-delay-end' on source is 'normal', then let delay be an implementation-defined number of milliseconds. Otherwise, let delay be the computed value of 'interest-delay-end' on source, interpreted as a number of milliseconds.
A typical value for the 'normal' delay is 150 milliseconds.
If delay is negative, infinite, or NaN, then return.
Set source's pending lose interest handle to null.
Let uniqueHandle be null.
Let task be a task that runs the following substeps:
Assert: uniqueHandle is a unique internal value, not null.
If uniqueHandle is not source's pending lose interest handle, then abort these steps.
Set source's pending lose interest handle to null.
If the interest ready check for source and target returns false, then abort these steps.
Lose interest in source given target.
Let global be source's relevant global object.
Let completionStep be an algorithm step which queues a global task on the timer task source given global to run task.
Set uniqueHandle to the result of running steps after a timeout given global, "interest change", delay, and
completionStep.
Set source's pending lose interest handle to uniqueHandle.
To find the recursive active interest sources given an element element, perform the following steps. They return a list of zero or more elements.
Let sources be an empty list.
Let pending be an empty queue.
Enqueue element in pending.
While pending is not empty:
Let current be the result of dequeuing from pending.
While current is not null:
Let source be current's active interest source.
If source is not null, source is not element, and sources does not contain source:
Set current to current's parent node within the flat tree, if that parent node is an element; otherwise, set current to null.
Return sources.
The recursive active interest sources algorithm finds all elements whose active interest target contains (inclusively) a given element, as well as any elements that indirect interest sources through the same condition applied recursively. In effect, all "upstream" interest sources in a graph of active interest target relations are found. Because cycles are possible, it is defined iteratively to avoid infinite loops.
The interest ready check for an HTML element source and an element target returns true if all of the following are true, and false otherwise:
source is a menuitem element whose invoked submenu is not null.
source is connected.
source's node document is fully active.
source's interest target element is target.
To gain interest in an HTML element source given an element target and an optional boolean explicit (default false):
Assert: source's interest target element is target.
If source's active interest target is not null:
If source's active interest target is target:
Set source's pending lose interest handle to null.
If explicit is true, then set source's explicit interest to true.
Return.
Interest has already been gained for the correct target and there is nothing to do except to cancel pending tasks, and possibly upgrade to explicit interest.
Lose interest in source given source's active interest target.
If the interest ready check for source and target returns false, then return.
Assert: source's active interest target is null.
If target's active interest source is not null:
Lose interest in target's active interest source given target.
If the interest ready check for source and target returns false, then return.
Assert: target's active interest source is null.
If the interest ready check for source and target returns false, then return.
Set source's active interest target to target.
Set source's explicit interest to explicit.
Append source to source's node document's active interest sources set.
Set target's active interest source to source.
If target is an HTML element and target's popover visibility state is :
Run show popover given target, false, and source.
If target's popover visibility state is showing, then set target's popover shown via interest to true.
To lose interest in an HTML element source given an element target and an optional boolean hidePopover (default true):
Assert: source's active interest target is target.
Reset interest state for source.
If hidePopover is true, target is an HTML element, target's popover visibility state is showing, and target's popover shown via interest is true, then run the hide popover algorithm given target, true, true, false, and source.
To reset interest state for an HTML element source:
Let target be source's active interest target.
Set source's active interest target to null.
Set source's explicit interest to false.
Remove source from source's node document's active interest sources set.
If target is not null, then set target's active interest source to null.
Set source's pending gain interest handle to null.
Set source's pending lose interest handle to null.
When the user designates an element element with a pointing device, other than through touch input, the user agent must queue a task on the user interaction task source to handle interest change for element, true, and false.
When the user no longer designates an element element with a pointing device, other than through touch input, the user agent must queue a task on the user interaction task source to handle interest change for element, false, and false.
The tasks queued on the user interaction task source above must be queued after
any tasks that fire events such as mouseover and mouseout, or that affect the :hover pseudo-class.
Canceling events such as mouseover and
mouseout does not prevent the above tasks from running.
Keyboard interactions are handled in the focus update steps.
For input modalities other than pointing devices, touch, and keyboards, the user agent should provide the ability for the user to indicate interest.