1. 6.13 Invokers
      1. 6.13.1 Introduction
      2. 6.13.2 The invoke target attributes

6.13 Invokers

6.13.1 Introduction

This section is non-normative.

Buttons are used to control elements on the page, such as controlling forms. They can be used to control other elements on the page using the invoketarget attribute.

HTML elements may have an associated invocation action algorithm which defines how the element reacts to being invoked. Invocations can vary based on the invokeaction attribute.

The invokeaction attribute is a freeform string that acts as a hint to invocation action algorithm s to perform some specific action such as showing or hiding. It is not enumerated, to allow for userland implementations of an invocation.

6.13.2 The invoke target attributes

Buttons may have the following content attributes:

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

DOM interface :
interface mixin InvokeElement {
  [CEReactions] attribute Element? invokeTargetElement;
  [CEReactions] attribute DOMString invokeAction;
};

The invokeTargetElement IDL attribute must reflect the invoketarget attribute.

The invokeAction IDL attribute must reflect the invokeaction attribute.

To run the invoke target attribute activation behavior given a Node node :

  1. Let invokee be invoketarget -associated element .

  2. If invokee is null, then return.

  3. Let action be node 's invokeaction attribute

  4. If action is null or empty, then let action be the string " auto ".

  5. Let notCancelled be the result of firing an event named invoke at invokee with its action set to action , its invoker set to node , and its cancelable attribute initialized to true.

  6. If notCancelled is true:

    1. Let shouldShowPopover be false.
    2. Let shouldHidePopover be false.
    3. If action is an ASCII case-insensitive match for " togglePopover " or " auto ", then:

      1. If invokee 's popover visibility state is hidden , then set shouldShowPopover to true.

      2. Otherwise set shouldHidePopover to true.

    4. if action is an ASCII case-insensitive match for " hidePopover ", and invokee 's popover visibility state is showing , then set shouldHidePopover to true.

    5. if action is an ASCII case-insensitive match for " showPopover ", and invokee 's popover visibility state is hidden , then set shouldShowPopover to true.

    6. If shouldShowPopover is true, then:

      1. Assert : shouldHidePopover is false.

      2. Run the show popover given invokee , false, and node .

    7. Otherwise, if shouldHidePopover is true and the result of running check popover validity given popover , false, false, and null is true, then:

      1. Assert : shouldShowPopover is false.

      2. Run the hide popover algorithm given invokee , true, true, and false.

    8. Otherwise, if invokee has an associated invocation action algorithm then run the invokee's invocation action algorithm given action .

HTML elements may have an associated invocation action algorithm which defines how the element reacts to being invoked.