diff --git a/source b/source index e0db066a971..03bbd0e6103 100644 --- a/source +++ b/source @@ -1845,6 +1845,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
If removedNode's popover
attribute is not in
the No Popover state, then run the hide
popover algorithm given removedNode, false, false, false, and null.
If removedNode is an HTML element with a + non-null active interest target, then reset interest state for + removedNode.
If removedNode is an element with a non-null active interest + source, then reset interest state for removedNode's active + interest source.
The moving steps for the HTML Standard, given @@ -1861,6 +1869,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute form owner and movedNode and its form owner are no longer in the same tree, then reset the form owner of movedNode.
+ +If movedNode is an HTML element with a + non-null active interest target and movedNode and its active + interest target are no longer in the same tree, then reset interest + state for movedNode.
If movedNode is an element with a non-null active interest source + and movedNode and its active interest source are no longer in the same + tree, then reset interest state for movedNode's active + interest source.
A HTMLDivElement : HTMLElement {
hreflang
type
referrerpolicy
interestfor
href
attribute: HTMLAnchorElement : HTMLElement {
// also has obsolete members
};
-HTMLAnchorElement includes HTMLHyperlinkElementUtils;
+HTMLAnchorElement includes HTMLHyperlinkElementUtils;
+HTMLAnchorElement includes InterestInvokerElement;
HTMLAnchorElement
.ping
rel
referrerpolicy
interestfor
href
attribute: HTMLAreaElement : HTMLElement {
// also has obsolete members
};
-HTMLAreaElement includes HTMLHyperlinkElementUtils;
+HTMLAreaElement includes HTMLHyperlinkElementUtils;
+HTMLAreaElement includes InterestInvokerElement;
HTMLAreaElement
.name
popovertarget
popovertargetaction
interestfor
type
value
HTMLButtonElement
.If blur event target is not null, fire a focus event
- named blur
at blur event target, with
- related blur target as the related target.
If blur event target is not null:
-In some cases, e.g., if entry is
- an area
element's shape, a scrollable region, or a viewport, no
- event is fired.
Fire a focus event named blur
at blur
+ event target, with related blur target as the related target.
In some cases, e.g., if entry
+ is an area
element's shape, a scrollable region, or a viewport, no
+ event is fired.
Handle interest change for blur event target and + false.
If focus event target is not null, fire a focus event
- named focus
at focus event target, with
- related focus target as the related target.
If focus event target is not null:
+ +Fire a focus event named focus
at
+ focus event target, with related focus target as the related
+ target.
In some cases, e.g., if entry is an area
+ element's shape, a scrollable region, or a viewport, no event is fired.
In some cases, e.g. if entry is an area
- element's shape, a scrollable region, or a viewport, no event is fired.
Handle interest change for focus event target and + true.
An interest invoker is an a
, area
, or button
+ element with the interestfor
attribute set.
interestfor
attributeThe interestfor
+ attribute 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., by hovering or focusing it), the target element will have an interest
event fired on it. If the target is a popover with a
+ popover visibility state of hidden, this
+ will show the popover. When the user loses interest (e.g., by no longer hovering or focusing the
+ invoker or target) a loseinterest
event is fired. If the
+ target is a popover it will be hidden.
If specified, the interestfor
attribute value must be
+ the ID of an element in the same tree as the
+ element with the interestfor
attribute.
interface mixin InterestInvokerElement {
+ [CEReactions] attribute Element? interestForElement;
+};
+
+ The interestForElement
IDL attribute must
+ reflect the interestfor
attribute.
The following demonstrates how one might show a tooltip for a button using the
+ interestfor
attribute to associate the button with
+ a popover
representing the tooltip.
<button interestfor=tooltip>
+ Click me
+</button>
+
+<div popover=hint id=tooltip>
+ I will appear when the user shows interest in the button
+</div>
+ Every HTML element has an element-or-null active + interest target, initially null.
+ +Every HTML element has a pending interest change + handle, which is a unique internal value or null, initially null.
+ +The pending interest change handle is used to abort steps that run + after a timeout.
+ +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 getting the interestfor
-associated 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.
InterestEvent
interface[Exposed=Window]
+interface InterestEvent : Event {
+ constructor(DOMString type, InterestEventInit eventInitDict);
+ readonly attribute Element source;
+};
+
+dictionary InterestEventInit : EventInit {
+ required Element source;
+};
+
+ event.source
Set to the interest invoker that triggered interest.
+The source
attribute must return the value it was
+ initialized to.
To handle interest change for an element element and a boolean + show:
+ +If element's active interest source is not null, handle + interest change for element's active interest source and + show.
+ +User interactions such as hovering or focusing an interest target have the same + effect as interactions with the invoker. This prevents interest from being lost while the user + is interacting with the target. Since an element can simultaneously be both an invoker and a + target, the following steps are still run.
+If element is not an interest invoker, then return.
Let global be element's relevant global object.
Let target be the result of running element's get the interestfor
-associated
+ element.
If target is null, then return.
Let delayProperty be 'interest-show-delay' if show is true, + otherwise 'interest-hide-delay'.
Let delay be the computed value of delayProperty on + element, interpreted as a number of milliseconds.
If delay is negative, infinite, or NaN, then return.
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 in element's pending interest + change handle, then abort these steps.
Set element's pending interest change handle to null.
If element is not connected, then abort these steps.
If element's node document is not fully active, + then abort these steps.
If the result of running element's get the interestfor
-associated element is not
+ target, then abort these steps.
If show is true, then gain interest in element with + target.
Otherwise, lose interest in element with + target.
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
", timeout, and
+ completionStep.
Set element's pending interest change handle to + uniqueHandle.
To gain interest in an HTML element + invoker given an element target:
+ +Assert: invoker is an a
, area
, or button
+ element.
Assert: the result of running invoker's get the interestfor
-associated
+ element is target.
If invoker's active interest target is not null:
+ +If invoker's active interest target is target, then set + invoker's pending interest change handle to null and return.
+ +Interest has already been gained for the correct target and there is nothing + to do except to cancel pending tasks.
+If the result of losing interest in invoker + given invoker's active interest target is false, then return.
+ +This fires the loseinterest
event, which
+ could be canceled.
Assert: invoker's active interest target is null.
If target's active interest source is not null:
+ +If the result of losing interest in target's + active interest source given target is false, then return.
+ +This fires the loseinterest
event, which
+ could be canceled.
Assert: target's active interest source is null.
Let continue be the result of firing an
+ event named interest
at target, using
+ InterestEvent
, with the cancelable
+ attribute initialized to true, and the source
+ attribute initialized to invoker.
If continue is false, then return.
Set invoker's active interest target to + target.
Set target's active interest source to + invoker.
If target's popover visibility state is + hidden, then run show popover given + target, false, and invoker.
To lose interest in an HTML element + invoker given an element target:
+ +Assert: invoker is an a
, area
, or button
+ element.
Assert: the result of running invoker's get the interestfor
-associated
+ element is target.
Let continue be the result of firing an
+ event named loseinterest
at target, using
+ InterestEvent
, with the cancelable
and
+ composed
attributes initialized to true, and the
+ source
attribute initialized to
+ invoker.
If continue is false, then return false.
Reset interest state for invoker.
If target's popover visibility state is showing, then hide + popover given invoker, false, true, and false.
Return true.
To reset interest state for an HTML element + invoker:
+ +Let target be invoker's active interest + target.
Set invoker's active interest target to null.
Set target's active interest source to null.
Set invoker's pending interest change handle to null.
The following attribute change
+ steps, given element, localName, oldValue,
+ value, and namespace, are used for a
, area
, and
+ button
elements:
If namespace is not null, then return.
If localName is not interestfor
, then
+ return.
If value is oldValue, then return.
If element's active interest target is not null, then reset + interest state for element.
The following attribute change + steps, given element, localName, oldValue, + value, and namespace, are used for all elements:
+ +If namespace is not null, then return.
If localName is not id
, then return.
If value is oldValue, then return.
If element's active interest source is not null, then reset + interest state for element's active interest source.
When the user designates an element + element with a pointing device, the user agent must queue a task on the + user interaction task source to handle interest change for + element and true.
+ +When the user no longer designates an element + element with a pointing device, the user agent must queue a task on the + user interaction task source to handle interest change for + element and false.
+ +The tasks queued on the user interaction task source in this section must be
+ queued after any tasks that fire events such as mouseover
+ and mouseout
or that affect the :hover
pseudo-class.
This means that when the interest
and loseinterest
events fire, any event handlers see the state after
+ the change.
Keyboard interactions are handled in the focus update steps.
+ +For input modalities other than pointing devices and keyboards, the user agent should provide + the ability for the user to indicate interest.
+script
interestfor
+ a
;
+ area
;
+ button
+ is
contenteditable
element's content, or the form control's value. See also the change
event for form controls.
+ interest
+ InterestEvent
+ invalid
Event
@@ -146538,6 +146926,12 @@ INSERT INTERFACES HERE
Window
, elements
Window
when the document has finished loading; fired at an element containing a resource (e.g. img
, embed
) when its resource has finished loading
+ loseinterest
+ InterestEvent
+ message
MessageEvent