Skip to content

Commit d30b3e5

Browse files
author
Jihye Hong
committed
[css-nav-1] Fix the markup for hiding API description
1 parent cf2435a commit d30b3e5

File tree

1 file changed

+66
-55
lines changed

1 file changed

+66
-55
lines changed

css-nav-1/Overview.bs

Lines changed: 66 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -995,36 +995,45 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
995995
3. If <var>eventTarget</var> is the <a>Document</a> or the <a>document element</a>,
996996
set <var>eventTarget</var> be <a>the body element</a> if it is not <code>null</code>
997997
or to the <a>document element</a> otherwise.
998-
4.
999-
* <span class=cssapi>If <var>searchOrigin</var> is <a>scroll container</a>
1000-
and the computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var> is ''spatial-navigation-action/scroll''
1001-
and <var>searchOrigin</var> [=can be manually scrolled=],
1002-
then [=directionally scroll the element=] <var>searchOrigin</var> and return.</span>
1003-
* <span class=cssapi>Else,</span> if <var>searchOrigin</var> is either a <a>scroll container</a> or the <a>document</a>
1004-
1. Let <var>candidates</var> be the result of <a>finding focusable areas</a>
1005-
within <var>searchOrigin</var>
1006-
with the argument <var>visibleOnly</var> set to <code>false</code>
1007-
<span class=cssapi>if computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var>
1008-
is ''spatial-navigation-action/focus'' or to <code>true</code> otherwise.
1009-
</span>
1010-
2.
1011-
* If <var>candidates</var> contains at least 1 item:
1012-
1. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
1013-
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>
1014-
2. 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
1015-
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1016-
* {{NavigationEvent/dir}} set to <var>direction</var>
1017-
* {{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
1018-
* the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
1019-
1020-
and return if the result is <code>false</code>.</span>
1021-
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
1022-
<span class=cssapi>* Else if the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var>
1023-
is not ''spatial-navigation-action/focus''
1024-
and <var>eventTarget</var> <a>can be manually scrolled</a>,
1025-
then <a>directionally scroll the element</a> <var>eventTarget</var> in <var>direction</var> and return.</span>
1026-
* Else, fall back to the next step.
1027-
* Else, fall back to the next step.
998+
4. <ul>
999+
<span class=cssapi><li>If <var>searchOrigin</var> is <a>scroll container</a>
1000+
and the computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var> is ''spatial-navigation-action/scroll''
1001+
and <var>searchOrigin</var> [=can be manually scrolled=],
1002+
then [=directionally scroll the element=] <var>searchOrigin</var> and return.</li></span>
1003+
<li><span class=cssapi>Else,</span> if <var>searchOrigin</var> is either a <a>scroll container</a> or the <a>document</a>
1004+
1. Let <var>candidates</var> be the result of <a>finding focusable areas</a>
1005+
within <var>searchOrigin</var>
1006+
with the argument <var>visibleOnly</var> set to <code>false</code>
1007+
<span class=cssapi>if computed value of the 'spatial-navigation-action' property on <var>searchOrigin</var>
1008+
is ''spatial-navigation-action/focus'' or to <code>true</code> otherwise.
1009+
</span>
1010+
2.
1011+
<ul>
1012+
<span class=cssapi><li>If
1013+
the computed value of the 'spatial-navigation-action' property on <var>eventTarget</var> is not ''spatial-navigation-action/focus''
1014+
and <var>eventTarget</var> <a>can be manually scrolled</a>,
1015+
then <a>directionally scroll the element</a> <var>eventTarget</var> in <var>direction</var> and return.</li></span>
1016+
<li><span class=cssapi>Else </span>if <var>candidates</var> contains at least 1 item:
1017+
1. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
1018+
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>
1019+
<p class=api>
1020+
2. If <a>navigation-override</a> <a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for
1021+
the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
1022+
<a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1023+
<ul>
1024+
<li>{{NavigationEvent/dir}} set to <var>direction</var>
1025+
<li>{{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
1026+
<li>the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
1027+
</ul>
1028+
and return if the result is <code>false</code>.
1029+
</p>
1030+
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
1031+
</li>
1032+
<li>Else, fall back to the next step.</li>
1033+
</ul>
1034+
</li>
1035+
<li>Else, fall back to the next step.</li>
1036+
</ul>
10281037
5. Let <var>container</var> be the nearest ancestor of <var>eventTarget</var> that is a <a>spatial navigation container</a>.
10291038
6. <i>Loop</i>: Let <var>candidates</var> be the result of <a>finding focusable areas</a>
10301039
within <var>container</var>
@@ -1035,29 +1044,31 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
10351044
excluding <var>searchOrigin</var>
10361045
</span>
10371046
7. If <var>candidates</var> is empty:
1038-
* <span class=cssapi>If the computed value of the 'spatial-navigation-action' property on <var>container</var> is not ''spatial-navigation-action/focus''
1039-
and <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>,
1040-
<a>directionally scroll the element</a> <var>container</var> in <var>direction</var> and return.
1041-
</span>
1042-
* <span class=cssapi>Else,</span>
1043-
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
1044-
<span class=api><a>fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1045-
* {{NavigationEvent/dir}} set to <var>direction</var>
1046-
* {{NavigationEvent/relatedTarget}} set to <var>container</var>
1047-
* the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
1048-
1049-
and return if the result is <code>false</code>.</span>
1050-
2.
1051-
* If <var>container</var> is the <a>document element</a> of the <a>top-level browsing context</a>,
1052-
then return.
1053-
The User Agent may transfer focus to its own controls (if any) honouring <var>direction</var>.
1054-
* Else, if <var>container</var> is the <a>document element</a> of a <a>nested browsing context</a> then:
1055-
1. Set <var>searchOrigin</var> to <var>container</var>'s <a>browsing context container</a>
1056-
2. Set <var>eventTarget</var> be <var>searchOrigin</var>
1057-
3. Set <var>container</var> to the nearest ancestor of <var>searchOrigin</var> that is a <a>spatial navigation container</a>.
1058-
4. Return to the step labeled <i>loop</i>.
1059-
* Else, set <var>container</var> to its closest ancestor that is itself a <a>spatial navigation container</a>
1060-
and return to the step labeled <i>loop</i>.
1047+
<ul>
1048+
<span class=cssapi><li>If the computed value of the 'spatial-navigation-action' property on <var>container</var> is not ''spatial-navigation-action/focus''
1049+
and <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>,
1050+
<a>directionally scroll the element</a> <var>container</var> in <var>direction</var> and return.
1051+
</li></span>
1052+
<span class=cssapi><li>Else,</li></span>
1053+
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
1054+
<span class=api><a>fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}} with:
1055+
* {{NavigationEvent/dir}} set to <var>direction</var>
1056+
* {{NavigationEvent/relatedTarget}} set to <var>container</var>
1057+
* the <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>
1058+
1059+
and return if the result is <code>false</code>.</span>
1060+
2.
1061+
* If <var>container</var> is the <a>document element</a> of the <a>top-level browsing context</a>,
1062+
then return.
1063+
The User Agent may transfer focus to its own controls (if any) honouring <var>direction</var>.
1064+
* Else, if <var>container</var> is the <a>document element</a> of a <a>nested browsing context</a> then:
1065+
1. Set <var>searchOrigin</var> to <var>container</var>'s <a>browsing context container</a>
1066+
2. Set <var>eventTarget</var> be <var>searchOrigin</var>
1067+
3. Set <var>container</var> to the nearest ancestor of <var>searchOrigin</var> that is a <a>spatial navigation container</a>.
1068+
4. Return to the step labeled <i>loop</i>.
1069+
* Else, set <var>container</var> to its closest ancestor that is itself a <a>spatial navigation container</a>
1070+
and return to the step labeled <i>loop</i>.
1071+
</ul>
10611072
8. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
10621073
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>.
10631074
9. 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
@@ -1238,9 +1249,9 @@ find the points <var>P1</var> and <var>P2</var>,
12381249
respectively within the boundary boxes of the <var>reference</var> and of the <var>candidate</var>,
12391250
that minimize the <var>distance</var> as defined as below:
12401251

1241-
<pre><code>
1252+
<pre class="prod">
12421253
<var>distance</var> = <var>euclidean</var> + <var>displacement</var> - <var>alignment</var> - <var>sqrt(Overlap)</var>
1243-
</code></pre>
1254+
</pre>
12441255

12451256
The meaning of each term is as follows:
12461257

0 commit comments

Comments
 (0)