INC-384 test page: hover and focus (WCAG 1.4.13)

Test page for the Incline browser tool actions hover and focus, and for the focusedElement field in the page state. Each case below is a small, self-contained widget. A "user" result is what a person with a mouse or keyboard experiences. A "tool" result is what the browser tool should return.

WCAG 2.1 SC 1.4.13 Content on Hover or Focus has three parts: Dismissible (Escape closes it without moving the pointer or focus), Hoverable (the pointer can move onto the new content without it disappearing) and Persistent (it stays until the trigger is left, it is dismissed, or it is no longer valid).

Summary

CaseWhat it showsUser resultExpected from the tool
H1CSS hover, 50px gapFails Hoverablehover on the tip works. Known limit: the tool does not cross the gap, so it reports no violation.
H2Script hides tip 150 ms after leaving, 50px gapFails HoverableSame known limit as H1.
H3Tip touches the triggerPassesFull sequence works: hover, hover the tip, Escape not needed.
H4Flyout menu on hoverPassesAfter hover the menu and its menu items appear in elements with refs.
H5Tip appears 500 ms after hoverPassesNeeds [hover, wait]. A bare hover returns no tip.
H6aEscape closes the tipDismissiblehover, then press Escape: tip is gone.
H6bEscape does nothingFails Dismissiblehover, then press Escape: tip is still there.
H7Tip disappears after 3 s while the pointer is still on itFails Persistenthover, then wait 4000 ms: tip is gone.
H8Tip ignores the pointer (pointer-events: none)Fails Hoverablehover on the tip ref fails. In production the model sees "Private execution failed" (until INC-180).
H9Tip without a rolePassesTip text is in the page text but the tip has no ref, so it cannot be hovered. Known limit.
F1Tip shown on focus, Escape closes itPassesfocus shows the tip and focusedElement is the trigger. Escape closes it.
F2Tip shown only for keyboard-style focus (:focus-visible)PassesClick another button first, then focus the trigger: the tip must appear.
F3Elements that cannot take focusn/afocus fails with ELEMENT_NOT_FOCUSABLE. The run continues.
F4Input inside a shadow rootn/afocus works. focusedElement is the inner input.

How to test by hand (QA)

Hover cases

H1. CSS hover with a gap

User: fails Hoverable. The tip is shown by :hover on the wrapper. The 50px gap is outside the wrapper, so moving slowly toward the tip hides it.

Tool: hover on the trigger shows the tip. hover on the tip ref keeps it visible (a jump skips the gap). The tool cannot tell this is a violation.

H2. Script hides the tip 150 ms after the pointer leaves, with a gap

User: fails Hoverable. Crossing the gap takes longer than 150 ms, so the tip is gone before the pointer arrives.

Tool: same as H1. The jump lands within 150 ms and the tip stays.

H3. Control: no gap

User: passes. The tip touches the trigger.

Tool: hover on the trigger, then hover on the tip ref: still visible.

H4. Flyout menu on hover

User: passes. The menu opens on hover and stays while the pointer moves onto it.

Tool: after hover on "Products", elements lists the menu items (role menuitem) with refs. The menu itself has role menu.

H5. Tip appears 500 ms after hover

User: passes. The tip shows after a short delay and hides when the pointer leaves.

Tool: a lone hover returns a page without the tip. [hover, wait 800] returns it.

H6a. Escape closes the tip (dismissible)

User: passes Dismissible. Escape hides the tip without moving the pointer. It returns after the pointer leaves and comes back.

Tool: hover, then press Escape on any current ref: the tip is gone from text and elements.

H6b. Escape does nothing (not dismissible)

User: fails Dismissible.

Tool: hover, then press Escape: the tip is still there. This is how the agent detects the violation.

H7. Tip disappears after 3 seconds (not persistent)

User: fails Persistent. The tip hides on its own while the pointer is still on the trigger.

Tool: [hover] shows the tip. [hover, wait 4000] returns a page without it.

H8. Tip ignores the pointer (pointer-events: none)

User: fails Hoverable. The pointer passes through the tip, so it cannot be hovered.

Tool: hover on the trigger shows the tip and gives it a ref. hover on that ref fails after the action timeout (15 s locally). Until INC-180 the model sees "Private execution failed" in production.

H9. Tip without a role

User: passes as far as 1.4.13 goes (it would fail a name/role check elsewhere).

Tool: the text is in the page text, but the tip gets no ref, so the agent cannot hover it. Known limit: only roles tooltip, menu, menuitem and dialog get a ref.

H9 tip: a plain div with no role

Focus cases

F1. Tip shown on focus, Escape closes it

User: passes. Tab to the button and the tip shows. Escape hides it while focus stays.

Tool: focus on the trigger ref: the tip appears and focusedElement is the trigger (ref, role button, name). press Escape: the tip is gone, focusedElement unchanged.

F2. Tip shown only for keyboard-style focus (:focus-visible)

User: passes. Tab to the trigger and the tip shows. A mouse click on the trigger does not show it.

Tool: click "Click me first", then focus the trigger: the tip must appear, because focus uses focus({ focusVisible: true }). A plain element.focus() after a click would not show it.

F3. Elements that cannot take focus

User: n/a. Neither element is reachable with the keyboard.

Tool: focus on either ref fails with code ELEMENT_NOT_FOCUSABLE and the message "The element cannot receive keyboard focus. Pick a focusable element from the latest page snapshot." The run is not terminated (unless the workflow sets stopOnToolFailure).

Not focusable: div with role=button, no tabindex (F3)

F4. Input inside a shadow root

User: n/a. Tab reaches the input.

Tool: focus on the shadow input ref succeeds, and focusedElement is the inner input (role textbox), not the host.