diff --git a/source b/source index 213f90acbef..125519389c4 100644 --- a/source +++ b/source @@ -21762,6 +21762,7 @@ interface HTMLDivElement : HTMLElement {
hreflang
type
referrerpolicy
+
interesttarget
Accessibility considerations:
If the element has an href attribute: HTMLAnchorElement : HTMLElement { // also has obsolete members }; -HTMLAnchorElement includes HTMLHyperlinkElementUtils; +HTMLAnchorElement includes HTMLHyperlinkElementUtils; +HTMLAnchorElement includes InterestInvokerElement;
Uses HTMLAnchorElement.
@@ -41997,6 +41999,7 @@ interface HTMLMapElement : HTMLElement {
ping
rel
referrerpolicy
+
interesttarget
Accessibility considerations:
If the element has an href attribute: HTMLAreaElement : HTMLElement { // also has obsolete members }; -HTMLAreaElement includes HTMLHyperlinkElementUtils; +HTMLAreaElement includes HTMLHyperlinkElementUtils; +HTMLAreaElement includes InterestInvokerElement;
Uses HTMLAreaElement.
@@ -53429,6 +53433,7 @@ You cannot submit this form when the field is incorrect.
name
popovertarget
popovertargetaction
+
interesttarget
type
value
HTMLButtonElement : HTMLElement { readonly attribute NodeList labels; }; -HTMLButtonElement includes PopoverInvokerElement; +HTMLButtonElement includes PopoverInvokerElement; +HTMLButtonElement includes InterestInvokerElement;
Uses HTMLButtonElement.
@@ -74941,6 +74947,13 @@ contradict people? data-x="concept-selector-active">being activated.)

+
:has-interest
+
+

The :has-interest pseudo-class is + defined to match any HTML element whose has + interest is true.

+
+
:hover

The :hover pseudo-class is defined to @@ -87118,6 +87131,159 @@ dictionary DragEventInit : MouseEventInit { +

Interest invokers

+ +

The interesttarget attribute

+ +

The interesttarget attribute on a, area, and button elements TODO.

+ +

If specified, the interesttarget attribute value + must be the ID of an element in the same tree as the + element with the interesttarget attribute.

+ + DOM interface: +
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 div popover representing the tooltip.

+ +
<button interesttarget=tooltip>
+ Click me
+</button>
+
+<div popover=hint id=tooltip>
+ I will appear
+</div>
+
+ +

Every HTML element has a has interest, which is a + boolean, initially set to false.

+ + +

The InterestEvent interface

+ +
[Exposed=Window]
+interface InterestEvent : Event {
+  constructor(DOMString type, optional InterestEventInit eventInitDict = {});
+  readonly attribute Element? source; // TODO: nullable, or require in ctor?
+};
+
+dictionary InterestEventInit : EventInit {
+  Element? source = null;
+};
+ +
+
event.source
+ +
+

Set to an interesting element TODO.

+
+
+ +

The source attribute must return the value it was + initialized to.

+ +

Processing model

+ +

To capture interest, given an HTML element invoker:

+ +
    +
  1. Assert: invoker is an a, area, or button + element.

  2. + +
  3. Assert: invoker has the interesttarget + attribute specified.

  4. + +
  5. Let target be the result of running node's get the interesttarget-associated + element.

  6. + +
  7. If target is null, then return.

  8. + +
  9. Let continue be the result of firing an + event named interest at target, using + InterestEvent, with the cancelable and + composed attributes initialized to true, and the + source attribute initialized to + invoker.

  10. + + +
  11. If continue is false, then return.

  12. + +
  13. Set invoker's has interest to true.

  14. + + + +
  15. If target's popover attribute is not in the + no popover state, then run show popover + given target, false, and invoker.

  16. + + + +
+ +

To lose interest, given an HTML element invoker:

+ +
    +
  1. Assert: invoker is an a, area, or button + element.

  2. + +
  3. Note: invoker may no longer have the interesttarget attribute specified.

  4. + +
  5. Let target be the result of running node's get the interesttarget-associated + element.

  6. + +
  7. If target is null, then return.

  8. + + + +
  9. 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.

  10. + + +
  11. If continue is false, then return.

  12. + + +
  13. If target's popover attribute is not in the + no popover state, then hide popover given invoker, false, true, and + false.

  14. + +
  15. Set invoker's has interest to false.

  16. + +
+ +

TODO / questions:

+ + + +

Loading web pages

@@ -143277,6 +143443,13 @@ interface External { script Integrity metadata used in Subresource Integrity checks SRI Text + + interesttarget + a; + area; + button + Targets an interesting TODO + ID* is HTML elements @@ -145061,6 +145234,12 @@ INSERT INTERFACES HERE Elements Fired when the user changes the contenteditable element's content, or the form control's value. See also the change event for form controls. + + interest + InterestEvent + Elements + Fired on interesting elements because of code interesttarget TODO. + invalid Event @@ -145079,6 +145258,12 @@ INSERT INTERFACES HERE Window, elements Fired at the 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 + Elements + Fired on boring elements because of code interesttarget TODO. + message MessageEvent