Skip to content

Commit

Permalink
expand list of interesttarget elements
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
keithamus committed Sep 19, 2023
1 parent 6d7db0a commit 310cd8a
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ ship for interactivity. Buttons with `invokertarget` will - when clicked,
touched, or enacted via keypress - dispatch an `InvokeEvent` on the element
referenced by `invokertarget`, with some default behaviours.

In addition, adding an `interesttarget` attribute to `<button>`, `<a>`,
`<area>`, `<input>` elements would allow disclosure of high fidelity tooltips in a more
accessible and declaritive way. Elements with `interesttarget` will - when
hovered, long pressed, or focussed - dispatch an `InterestEvent` on the element
referenced by `interesttarget`, with some default behaviours.
In addition, this proposals seeks to add an `interesttarget` attribute to
interactive elements: `<button>`, `<a>`, `<area>`, `<input>`, `<textarea>`,
`<select>`, `<summary>`. This would allow disclosure of high fidelity tooltips
in a more accessible and declarative way. Elements with `interesttarget` will -
when hovered, long pressed, or focussed - dispatch an `InterestEvent` on the
element referenced by `interesttarget`, with some default behaviours.

## Background

Expand Down Expand Up @@ -74,8 +75,8 @@ the balance.
such as eye tracking or game controllers, the equivalent "focusout or
mouseout" action is used to _Lose Interest_ on the element.
- Invoker: An invoker is a button element (that is a `<button>`,
`<input type="button">`, or `<input type="reset">`) that has an `invokertarget`
attribute set.
`<input type="button">`, or `<input type="reset">`) that has an
`invokertarget` attribute set.
- Invokee: An element which is referenced to by an Invoker, via the
`invokertarget` attribute.
- Interestee: An element which is referenced to by an Interest element, via the
Expand All @@ -86,7 +87,8 @@ the balance.
In the style of `popovertarget`, this document proposes we add `invokertarget`,
and `invokeraction` as available attributes to `<button>`,
`<input type="button">` and `<input type="reset">` elements, as well as an
`interesttarget` attribute to `<button>`, `<a>`, `<area>` and `<input>` elements.
`interesttarget` attribute to `<button>`, `<a>`, `<area>` and `<input>`
elements.

```webidl
interface mixin InvokerElement {
Expand All @@ -96,14 +98,19 @@ interface mixin InvokerElement {
interface mixing InterestElement {
[CEReactions] attribute Element? interestTargetElement;
}
HTMLButtonElement extends InvokerElement
HTMLInputElement extends InvokerElement
HTMLElement extends InterestElement
```

The `invokertarget` value should be an IDREF pointing to an element within the
document. `.invokerTargetElement` also exists on the element to imperatively
assign a node to be the invoker target, allowing for cross-root invokers (in
some cases, see
[the popovertarget attr-asociated element steps](https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#attr-associated-element) for
more).
[the popovertarget attr-asociated element steps](https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#attr-associated-element)
for more).

The `invokeraction` (and the `.invokerAction` reflected property) is a freeform
hint to the Invokee. If `invokeraction` is a falsey value (`''`, `null`, etc.)
Expand All @@ -118,8 +125,8 @@ The `interesttarget` value should be an IDREF pointing to an element within the
document. `.interestTargetElement` also exists on the element to imperatively
assign a node to be the invoker target, allowing for cross-root invokers (in
some cases, see
[the popovertarget attr-asociated element steps](https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#attr-associated-element) for
more).
[the popovertarget attr-asociated element steps](https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#attr-associated-element)
for more).

Elements with `invokertarget` set will dispatch an `InvokeEvent` on the
_Invokee_ (the element referenced by `invokertarget`) when the element is
Expand Down

0 comments on commit 310cd8a

Please sign in to comment.