Skip to content

[css-nav-1] Simplify the description of processing model #4361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions css-nav-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -972,15 +972,17 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
set <var>eventTarget</var> be <a>the body element</a> if it is not <code>null</code>
or to the <a>document element</a> otherwise.
4.
* If <var>searchOrigin</var> is <a>scroll container</a>
* <span class=cssapi>If <var>searchOrigin</var> is <a>scroll container</a>
and the computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var> is ''spatial-navigation-action/scroll''
and <var>searchOrigin</var> [=can be manually scrolled=],
then [=directionally scroll the element=] <var>searchOrigin</var> and return.
* Else, if <var>searchOrigin</var> is either a <a>scroll container</a> or the <a>document</a>
then [=directionally scroll the element=] <var>searchOrigin</var> and return.</span>
* <span class=cssapi>Else,</span> if <var>searchOrigin</var> is either a <a>scroll container</a> or the <a>document</a>
1. Let <var>candidates</var> be the result of <a>finding focusable areas</a>
within <var>searchOrigin</var>
with the argument <var>visibleOnly</var> set to <code>false</code> if computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var>
with the argument <var>visibleOnly</var> set to <code>false</code>
<span class=cssapi>if computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var>
is ''spatial-navigation-action/focus'' or to <code>true</code> otherwise.
</span>
2.
* If <var>candidates</var> contains at least 1 item:
1. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
Expand All @@ -993,23 +995,26 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f

and return if the result is <code>false</code>.</span>
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
* Else if the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var> is not ''spatial-navigation-action/focus''
<span class=cssapi>* Else if the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var> is not ''spatial-navigation-action/focus''
and <var>eventTarget</var> <a>can be manually scrolled</a>,
then <a>directionally scroll the element</a> <var>eventTarget</var> in <var>direction</var> and return.
then <a>directionally scroll the element</a> <var>eventTarget</var> in <var>direction</var> and return.</span>
* Else, fallback to the next step.
* Else, fallback to the next step.
5. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
6. <i>Loop</i>: Let <var>candidates</var> be the result of <a>finding focusable areas</a>
within <var>container</var>
with the argument <var>visibleOnly</var> set to <code>false</code>
<span class=cssapi>
if computed value of the 'spatial-navigation-action' property on <var>container</var> is ''spatial-navigation-action/focus''
or to <code>true</code> otherwise,
excluding <var>searchOrigin</var>
</span>
7. If <var>candidates</var> is empty:
* If the computed value of the 'spatial-navigation-action' property on <var>container</var> is not ''spatial-navigation-action/focus''
* <span class=cssapi>If the computed value of the 'spatial-navigation-action' property on <var>container</var> is not ''spatial-navigation-action/focus''
and <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>,
<a>directionally scroll the element</a> <var>container</var> in <var>direction</var> and return.
* Else,
</span>
* <span class=cssapi>Else,</span>
1. If <a>navigation-override</a> <a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
<span class=api><a>fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
* {{NavigationEvent/dir}} set to <var>direction</var>
Expand Down