diff --git a/source b/source index 1c0e98a5967..db6cb7729ca 100644 --- a/source +++ b/source @@ -21795,6 +21795,7 @@ interface HTMLDivElement : HTMLElement {
hreflang
type
referrerpolicy
interesttarget
href
attribute: HTMLAnchorElement : HTMLElement {
// also has obsolete members
};
-HTMLAnchorElement includes HTMLHyperlinkElementUtils;
+HTMLAnchorElement includes HTMLHyperlinkElementUtils;
+HTMLAnchorElement includes InterestInvokerElement;
HTMLAnchorElement
.ping
rel
referrerpolicy
interesttarget
href
attribute: HTMLAreaElement : HTMLElement {
// also has obsolete members
};
-HTMLAreaElement includes HTMLHyperlinkElementUtils;
+HTMLAreaElement includes HTMLHyperlinkElementUtils;
+HTMLAreaElement includes InterestInvokerElement;
HTMLAreaElement
.name
popovertarget
popovertargetaction
interesttarget
type
value
HTMLButtonElement
.:has-interest
The :has-interest
pseudo-class is
+ defined to match any HTML element whose interest
+ state is full.
:has-partial-interest
The :has-partial-interest
+ pseudo-class is defined to match any HTML
+ element whose interest state is
+ partial.
:hover
The :hover
pseudo-class is defined to
@@ -75929,6 +75950,26 @@ Demos:
containing no elements, if it is. SELECTORS
:target-of-interest
The :target-of-interest
+ pseudo-class is defined to match any element that is the result of running
+ get the
+ interesttarget
-associated element for any
+ HTML element whose interest state is
+ full.
:target-of-partial-interest
The :target-of-partial-interest
+ pseudo-class is defined to match any element that is the result of running
+ get the
+ interesttarget
-associated element for any
+ HTML element whose interest state is
+ partial.
:popover-open
The :popover-open
pseudo-class is
@@ -88115,6 +88156,166 @@ dictionary DragEventInit : MouseEventInit {
+
interesttarget
attributeThe interesttarget
+ attribute on a
, area
, and button
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.,
+ by hovering or focusing it), the target element will have an
+ interest
event fired on it. If the target is a popover, this
+ will show the popover.
If specified, the interesttarget
attribute value
+ must be the ID of an element in the same tree as the
+ element with the interesttarget
attribute.
interface mixin InterestInvokerElement {
+ [CEReactions] attribute Element? interestTargetElement;
+};
+
+ The interestTargetElement
IDL attribute must
+ reflect the interesttarget
attribute.
The following demonstrates how one might show a tooltip for a button using the
+ interesttarget
attribute to associate the button with
+ a popover
representing the tooltip.
<button interesttarget=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 interest state, initially + none, with these potential values:
+ +none
partial
full
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 an interesting element TODO.
+The source
attribute must return the value it was
+ initialized to.
To capture interest, given an HTML element invoker:
+ +Assert: invoker is an a
, area
, or button
+ element.
Assert: invoker has the interesttarget
+ attribute specified.
Let target be the result of running node's get the interesttarget
-associated
+ element.
If target is null, then return.
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 interest state to + full.
If target's popover
attribute is not in the
+ no popover state, then run show popover
+ given target, false, and invoker.
To lose interest, given an HTML element invoker:
+ +Assert: invoker is an a
, area
, or button
+ element.
Note: invoker may no longer have the interesttarget
attribute specified.
Let target be the result of running node's get the interesttarget
-associated
+ element.
If target is null, then return.
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.
Set invoker's interest state to + none.
If target's popover
attribute is not in the
+ no popover state, then hide popover given invoker, false, true, and
+ false.
TODO / questions:
+ +Actually invoke the capture/lose algorithms.
Which algorithm reads the computed style for interest-target-delay?
Handle removal of the interesttarget attribute, or the element that has it.
Handle changes of the interesttarget attribute while an element has interest.
Handle changes to the ID attribute referenced by an interesttarget attribute.
script
interesttarget
+ a
;
+ area
;
+ button
+ is
contenteditable
element's content, or the form control's value. See also the change
event for form controls.
+ interest
+ InterestEvent
+ interesttarget
TODO.
+
invalid
Event
@@ -146254,6 +146468,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
+ interesttarget
TODO.
+
message
MessageEvent