1. 6.13 Interest invokers
      1. 6.13.1 The interesttarget attribute
      2. 6.13.2 The InterestEvent interface
      3. 6.13.3 Processing model

6.13 Interest invokers

6.13.1 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.

6.13.2 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.

6.13.3 Processing model

To capture interest , given an HTML element invoker :

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

  2. Assert: invoker has the interesttarget attribute specified.

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

  4. If target is null, then return.

  5. 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 .

  6. If continue is false, then return.

  7. Set invoker 's has interest to true.

  8. 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 :

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

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

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

  4. If target is null, then return.

  5. 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 .

  6. If continue is false, then return.

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

  8. Set invoker 's has interest to false.

TODO / questions: