Skip to content

Basic concept of spatial navigation

Jihye Hong edited this page Sep 5, 2018 · 20 revisions

Preconditions

SpatNav Spec is too complicated, so we need to list up the preconditions for the spec.

  • The default container is the document element of a browsing context’s document (not limited to the top-level browsing context) or a scroll container.
  • Focusable elements in spatnav
    • The browsing context is focusable.
    • The scrollable area is focusable.
    • The negative integer value of tabindex makes the element be omitted from the spatial navigation order.
  • Candidates are focusable elements which are visible within the scrollport of a specific container.

Points to be considered

  • Does the spatnav container delegates focus to the element inside it?
  • Do candidates need to consider the invisible focusable element within the spatnav container?

Terminology

Core Features

1. Spatial focus navigation heuristic

  • Feature: The basic spatial navigation behavior supported by the browser.

2. Creating container: 'spatial-navigation-contain'

  • Feature: Make the elements within a container take higher priority when searching for the best candidate.

  • Basically, the element specified with this property isn't focusable. It needs to be specified with tabindex for being a focusable element.

  • Issue

    • Do we need 'delegate focus' option for the container?

3. NavigationEvent

  • Feature: Fire before the arrow key triggers some behavior (moving the focus, scrolling, nothing).

    • Moving the focus: navbeforefocus
    • Scrolling: navbeforescroll
    • Nothing: navnotarget
  • Purpose

    • Cover the edge cases of SpatNav heuristic
      • Using navbeforescroll: Move the focus directly to a candidate without scrolling. (But how?)
    • SpatNav customization
      • Using navnotarget: When there is any candidate at the end of scroll, move the focus to the first element within the spatnav container. (related to the previously proposed "nav-loop")

4. JS API

  • Feature: Find the best candidate which will gain the focus.
  • Purpose
    • Cover the edge cases of SpatNav heuristic
    • SpatNav Navigation algorithm customization
      • Apply the other spatial focus navigation algorithm. (related to the previously proposed "nav-rule")

Points to be considered

  • Is there a way to move the focus directly to the invisible focusable within the scrollable spatanv container?