From df208432d29e27e622d4c79499e894812b5d979d Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Fri, 29 Mar 2019 16:45:55 +0900 Subject: [PATCH 01/11] Update the Acknowledgements --- css-nav-1/Overview.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 49f9e09d722..ae27d8d174f 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -1476,5 +1476,6 @@ The editors of this specification would like to thank the following individuals * Hugo Holgersson * Hyojin Song * Junho Seo +* Jeonghee Ahn * Rob Dodson * Seungcheon Baek From fde7c9eac042f22ae572a9626efd6b839e2b0595 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Fri, 29 Mar 2019 16:56:59 +0900 Subject: [PATCH 02/11] Refine the overview section * Refined the overview section * Fix several grammar mistakes --- css-nav-1/Overview.bs | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index ae27d8d174f..5c8af8e2f6e 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -199,24 +199,23 @@ next time spatial navigation in the same direction is requested. If the spatial navigation focus container cannot be scrolled, either because it is not a scrollable element or because it is already scrolled to the maximum in that direction, -the User Agent will select the next spatial navigation focus container up the ancestry chain, -and repeat the process of -looking for eligible focus targets, -selecting the best one if there's any, -scrolling if not, -going up the ancestry chain if it cannot scroll, -until it has either moved focus, -scrolled, -or reached the root. - -Note: As a consequence of this processing model, +the User Agent will select the next spatial navigation focus container up the ancestry chain. + +The process of looking for an eligible focus target and +if there is any, then move the focus, +else if the spatial navigation focus container can be scrolled, then scroll, +otherwise, going up to the next container +is repeated until the ancestry chain reaches the root element. + +
+NOTE: As a consequence of this processing model, the elements that are reachable by sequential navigation and by spatial navigation are almost the same: -elements that are currently outside of the viewport of a scrollable element -can only be reached once they have been scrolled into view, -and those that cannot be scrolled into view, -for instance because they are placed at a negative offset, -are out of reach. + * Elements that are currently outside of the viewport of a scrollable element + can only be reached once they have been scrolled into view + * Elements that cannot be scrolled into view. + For instance, those are out of reach because they are placed at a negative offset. +
At key points during this search for the appropriate response to the spatial navigation request, @@ -224,7 +223,7 @@ the User Agent will fire events. These enable authors to prevent the upcoming action (by calling {{preventDefault()}}), and if desired to provide an alternate action, -such as using calling the {{HTMLOrSVGElement/focus()}} method on a different +such as using the {{HTMLOrSVGElement/focus()}} method on a different element of the author's choosing. To help authors write such alternate actions, @@ -251,7 +250,7 @@ and [[#js-api]] for details about the JavaScript API. On the left of figure 2, "Box 2" is focused. - Pressing the ArrowDown key moves focus to + Pressing the ArrowDown key moves the focus to "Box 3" without scrolling because "Box 3" is visible in the scrollport of the spatial navigation focus container.
@@ -880,7 +879,7 @@ The navigation-override [=policy-controlled feature=] Note: This is to prevent a hostile iframe from using these events in order to highjack the focus. - We recognize that there exists other mechanisms predating spatial navigation + We recognize that there exist other mechanisms predating spatial navigation that malicious authors could use to interfere with the user's ability to control where the focus goes. Despite that, it seems worthwhile to attempt not to increase this attack surface, From 40da7925a9fae5d3dd3d7a1d176a0c0b003c844f Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Fri, 29 Mar 2019 17:00:58 +0900 Subject: [PATCH 03/11] Use 'User Agent' term consistently in the spec Use 'User Agent' instead of 'UA' --- css-nav-1/Overview.bs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 5c8af8e2f6e..93b0bc64771 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -241,7 +241,7 @@ and [[#js-api]] for details about the JavaScript API. arranged in a scrollable element would be navigated when using spatial navigation. For the sake of keeping the description simple, - this example assumes a UA where spatial navigation is triggered using arrow keys. + this example assumes a User Agent where spatial navigation is triggered using arrow keys.
@@ -321,7 +321,7 @@ User Agents should offer a means for users to trigger spatial navigation directl without having to use the APIs. Note: Conversely, authors should assume that spatial navigation may be triggered -by the UA in response to user actions +by the User Agent in response to user actions even if the author has not invoked any of the APIs. Regardless of the actual mechanism chosen to trigger spatial navigation, @@ -370,7 +370,7 @@ the following requirements apply: (in addition to moving the focus) User Agents should not offer the same mechanism to trigger both spatial navigation and a scrolling behavior separate from spatial navigation. - UAs may however, offer a way for the user to switch between different modes, + User Agents may however, offer a way for the user to switch between different modes, or offer both based on different UI mechanism.
@@ -403,7 +403,7 @@ the same chain of events will be fired and the same element will be scrolled or focused. Note: Authors can use this to trigger spatial navigation -based on a different UI mechanism than the one assigned by the UA, +based on a different UI mechanism than the one assigned by the User Agent, such as mapping to different keys, or triggering spatial navigation from a clickable on-screen directional pad. or in reaction to other events than UI ones. @@ -683,7 +683,7 @@ The navbeforefocus event occurs before spatial navigation changes t This example shows the [[UI-EVENTS#event-order]] when pressing the ArrowRight key. For the sake of keeping the description simple, - this example assumes a UA where spatial navigation is triggered using arrow keys. + this example assumes a User Agent where spatial navigation is triggered using arrow keys. @@ -760,7 +760,7 @@ and it cannot be scrolled at the same time. This example shows the [[UI-EVENTS#event-order]] when pressing the ArrowDown key in the situation like the following figure. For the sake of keeping the description simple, - this example assumes a UA where spatial navigation is triggered using arrow keys. + this example assumes a User Agent where spatial navigation is triggered using arrow keys.
An image about navnotarget @@ -946,7 +946,7 @@ The user agent may set it when the user indicates that it should be moved. Note: For example, the user agent could set it to the position of the user's click if the user clicks on the document contents, and unset when the focus is moved (by spatial navigation or any other means). -If the UA sets both a spatial navigation starting point and a sequential focus navigation starting point, +If the User Agent sets both a spatial navigation starting point and a sequential focus navigation starting point, they must not be set differently.
From 921ef44d2ac009461c5c060c9b78cc7bbfdb7038 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 09:08:40 +0900 Subject: [PATCH 04/11] Fix the misorder --- css-nav-1/Overview.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 93b0bc64771..4c72fdfbd8a 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -1474,7 +1474,8 @@ The editors of this specification would like to thank the following individuals * Elika Etemad * Hugo Holgersson * Hyojin Song -* Junho Seo * Jeonghee Ahn +* Junho Seo + * Rob Dodson * Seungcheon Baek From ba610cf6bb65aaaaff9f2a15ec8fb82c85213a97 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 14:07:03 +0900 Subject: [PATCH 05/11] Refine the spec * Modify the code example * Modify for the clear description --- css-nav-1/Overview.bs | 80 ++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 4c72fdfbd8a..637137fe2f4 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -327,8 +327,8 @@ even if the author has not invoked any of the APIs. Regardless of the actual mechanism chosen to trigger spatial navigation, the following requirements apply: * If the mechanism the user must use to trigger spatial navigation - would normally fire a {{UIEvent}}, - then that event must be fired prior to running the spatial navigation steps + would normally fire a {{UIEvent}}. + The event must be fired prior to running the spatial navigation steps and these steps must not be run if that event's canceled flag gets set. @@ -348,8 +348,8 @@ the following requirements apply: would follow the same sequence.
* If the mechanism the user must use to trigger spatial navigation - would in some contexts trigger other actions, - the User Agent should in these contexts + would trigger other actions in some contexts. + The User Agent should in these contexts give priority to these other actions and execute them instead of spatial navigation. It must not trigger both. @@ -403,12 +403,12 @@ the same chain of events will be fired and the same element will be scrolled or focused. Note: Authors can use this to trigger spatial navigation -based on a different UI mechanism than the one assigned by the User Agent, -such as mapping to different keys, -or triggering spatial navigation from a clickable on-screen directional pad. +based on a different UI mechanism than the one assigned by the User Agent. +Such as mapping to different keys, +or triggering spatial navigation from a clickable on-screen directional pad, or in reaction to other events than UI ones. It could also be used when an author wants to interrupt navigation to do some asynchronous operation -(e.g. load more content in an infinite scroller) then resume where they cancelled. +(e.g. load more content in an infinite scroller) then resume the navigation where they cancelled. Note: This API is also useful for testing purposes, as there is no other way to trigger spatial navigation @@ -486,11 +486,9 @@ The {{Element/focusableAreas()}} method must follow these steps: if the argument's {{FocusableAreasOptions/mode}} attribute is present and equal to 'all', or true otherwise. 2. Let areas be the result of finding focusable areas within the element with the visibleOnly argument. -3. Loop: If there is a spatial navigation container container among areas, - then add the result of finding focusable areas to areas within the container. -5. Let anchors be a clone of areas, +3. Let anchors be a clone of areas, with every focusable area which is not itself a Node replaced with its DOM anchor. -6. Return anchors +4. Return anchors
@@ -530,12 +528,12 @@ The {{Element/spatialNavigationSearch()}} method must follow these steps: else, let areas be the result of finding focusable areas within the argument's {{SpatialNavigationSearchOptions/container}} attribute is not null, or the element's nearest spatial navigation container ancestor -4. Return the result of selecting the best candidate within areas in direction d from the element +3. Return the result of selecting the best candidate within areas in direction d from the element Note: When neither a container nor a list of candidates is provided, this only searches through the visible focusable areas of the nearest spatial navigation container ancestor. -If none are found, this does not climb further up the ancestry chain, +If there isn't any eligible element to navigate, this does not climb further up the ancestry chain, and the result will be null.
@@ -546,20 +544,16 @@ and the result will be null. the focus is automatically transferred to it.

-    document.addEventListener("navbeforefocus", function(e) {
+    document.addEventListener('navbeforefocus', function(e) {
         e.preventDefault();
 
-        if (e.dir === "forward" || e.dir === "backward") {
-            e.dir = "top";
-        }
-
-        var t = e.relatedTarget;
-        while (t.isSameNode(t.getSpatialNavigationContainer())) {
-            var areas = t.focusableAreas();
+        let target = e.relatedTarget;
+        while (target.isSameNode(target.getSpatialNavigationContainer())) {
+            const areas = target.focusableAreas();
 
             if (areas.length === 0) { break; }
 
-            t = t.spatialNavigationSearch({
+            target = target.spatialNavigationSearch({
                 dir:  e.dir,
                 candidates: areas
             });
@@ -571,44 +565,45 @@ and the result will be null.
 
 
The following code changes the behavior of spatial navigation - to trap the focus within a spatial navigation container: + to trap the focus within a spatial navigation container: when no further focusable elements can be found in the requested direction - and the spatial navigation container cannot be scrolled any futher, - we loop back to the other side instead of searching outside of it, + and the spatial navigation container cannot be scrolled any further, + the focus loops back to the other side instead of moving outside of it, either by focusing or scrolling depending on what is available. - The focus can still be moved outside by sequential navigation, + However, the focus can still be moved outside by sequential navigation, mouse interaction, - programmatic calls to {{focus()}}… + and programmatic calls to {{focus()}}…

-    document.addEventListener("navnotarget", function(e) {
+    document.addEventListener('navnotarget', function(e) {
         e.preventDefault();
 
-        var c = e.relatedTarget;
-        var areas = c.focusableAreas({mode: "all"});
+        const container = e.relatedTarget;
+        const areas = container.focusableAreas({mode: 'all'});
 
         if (areas.length === 0) {
             switch (e.dir) {
-                case "down":
-                    c.scrollTop = 0;
+                case 'down':
+                    container.scrollTop = 0;
                     break;
-                case "up":
-                    c.scrollTop = c.scrollHeight;
+                case 'up':
+                    container.scrollTop = container.scrollHeight;
                     break;
-                case "right":
-                    c.scrollLeft = 0;
+                case 'right':
+                    container.scrollLeft = 0;
                     break;
-                case "left":
-                    c.scrollLeft = c.scrollWidth;
+                case 'left':
+                    container.scrollLeft = container.scrollWidth;
                     break;
             }
         } else {
-            var t = c.spatialNavigationSearch({
+            const target = container.spatialNavigationSearch({
                 dir: e.dir,
                 candidates: areas
             });
-            t.focus();
+            target.focus();
+        }
     });
     
@@ -922,7 +917,7 @@ if a suitable one cannot be found inside it (see [[#nav]] for details). Such groupings are called spatial navigation focus containers. -By default, spatial navigation containers are established by: +By default, spatial navigation containers(same with spatial navigation focus container) are established by: * The viewport of a browsing context (not limited to the top-level browsing context) @@ -1476,6 +1471,5 @@ The editors of this specification would like to thank the following individuals * Hyojin Song * Jeonghee Ahn * Junho Seo - * Rob Dodson * Seungcheon Baek From cdac475ee0c7d83e0f4e2bd68e300e55be50d2b0 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 15:00:25 +0900 Subject: [PATCH 06/11] Minor fix related to indentations --- css-nav-1/Overview.bs | 62 ++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 637137fe2f4..0e5e95bd251 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -9,7 +9,7 @@ ED: https://drafts.csswg.org/css-nav-1/ Editor: Jihye Hong, LG Electronics, jh.hong@lge.com Editor: Florian Rivoal, Invited Expert, https://florian.rivoal.net Abstract: This specification defines a general model for navigating the focus using the arrow keys, - as well as related CSS and JavaScript features. + as well as related CSS, JavaScript features and Events. At risk: {{getSpatialNavigationContainer()}} At risk: {{focusableAreas()}} At risk: 'spatial-navigation-contain' @@ -232,8 +232,9 @@ this specification also defines JavaScript APIs that expose key constructs of the underlying model. -See [[#events-nav-type]] for details about the various events, -and [[#js-api]] for details about the JavaScript API. +See [[#js-api]] for details about the JavaScript API, +[[#events-nav-type]] for details about the various events, +and [[#declarative]] for details about the CSS properties.
@@ -309,6 +310,7 @@ This intentionally left for User Agents to decide.
Note: It is expected that User Agents on devices with limited input capabilities, such as TVs operated with a remote control, + or smart feature phones, or devices operated with a game controller, will use spatial navigation as their primary or exclusive navigation mechanism.
@@ -499,16 +501,16 @@ The {{Element/focusableAreas()}} method must follow these steps:

     <body>
-        <button class="box" style="top:100px; left:20px;"></button>
-        <div class="container" style="left:110px; width:300px; height:200px; overflow-x: scroll;">
-            <button class="box" style="top:78px; left:25px;"></button>
-            <button class="box" style="top: 80px; left:150px;"></button>
-            <button class="box" style="top: 80px; left:350px;"></button>
+        <button class="box"></button>
+        <div class="container" style="width:300px; height:200px; overflow-x: scroll;">
+            <button class="box" style="left:25px;"></button>
+            <button class="box" style="left:150px;"></button>
+            <button class="box" style="left:350px;"></button>
         </div>
     </body>
     

-        const focusableAreas = document.body.focusableAreas({'mode': 'visible'});
+        const focusableAreas = document.body.focusableAreas({mode: 'visible'});
         focusableAreas && focusableAreas.forEach(focusable => {
           focusable.style.outline = '5px solid red';
         });
@@ -522,13 +524,13 @@ The {{Element/focusableAreas()}} method must follow these steps:
 
 
The {{Element/spatialNavigationSearch()}} method must follow these steps: -1. Let d be the argument's {{SpatialNavigationSearchOptions/dir}} attribute +1. Let direction be the argument's {{SpatialNavigationSearchOptions/dir}} attribute 2. If the argument's {{SpatialNavigationSearchOptions/candidates}} attribute is not null, then let areas be that attribute, else, let areas be the result of finding focusable areas within the argument's {{SpatialNavigationSearchOptions/container}} attribute is not null, or the element's nearest spatial navigation container ancestor -3. Return the result of selecting the best candidate within areas in direction d from the element +3. Return the result of selecting the best candidate within areas in direction direction from the element Note: When neither a container nor a list of candidates is provided, this only searches through the visible focusable areas of the nearest @@ -551,14 +553,14 @@ and the result will be null. while (target.isSameNode(target.getSpatialNavigationContainer())) { const areas = target.focusableAreas(); - if (areas.length === 0) { break; } + if (areas.length === 0) { target.navigate(e.dir); } target = target.spatialNavigationSearch({ dir: e.dir, candidates: areas }); } - t.focus(); + target.focus(); });
@@ -967,10 +969,12 @@ To run the spatial navigation steps in direction, do the f 1. Let bestCandidate be the result of selecting the best candidate within candidates in direction starting from searchOrigin 2. If navigation-override is enabled in the [=node document=] of eventTarget for the origin of the [=active document=] of the [=top-level browsing context=], then - fire an event named navbeforefocus at eventTarget using {{NavigationEvent}} - with its {{NavigationEvent/dir}} set to direction and {{NavigationEvent/relatedTarget}} set to bestCandidate - and with it's bubbles and cancelable attributes set to true, - and return if the result is false + fire an event named navbeforefocus at eventTarget using {{NavigationEvent}} with: + * Set {{NavigationEvent/dir}} to direction + * Set {{NavigationEvent/relatedTarget}} to bestCandidate + * Set bubbles and cancelable attributes to true + + and return if the result is false. 3. Run the focusing steps for bestCandidate and return * Else if eventTarget can be manually scrolled, directionally scroll the element eventTarget in direction and return. @@ -983,9 +987,11 @@ To run the spatial navigation steps in direction, do the f container in direction and return. * Else, 1. If navigation-override is enabled in the [=node document=] of eventTarget for the origin of the [=active document=] of the [=top-level browsing context=], then - fire an event named navnotarget at eventTarget using {{NavigationEvent}} - with its {{NavigationEvent/dir}} set to direction and {{NavigationEvent/relatedTarget}} set to container - and with it's bubbles and cancelable attributes set to true, + fire an event named navnotarget at eventTarget using {{NavigationEvent}} with: + * Set {{NavigationEvent/dir}} to direction + * Set {{NavigationEvent/relatedTarget}} to container + * Set bubbles and cancelable attributes to true + and return if the result is false. 2. * If container is the document element of the top-level browsing context, @@ -999,13 +1005,15 @@ To run the spatial navigation steps in direction, do the f * Else, set container to its closest ancestor that is itself a spatial navigation container and return to the step labeled loop. 9. Let bestCandidate be the result of selecting the best candidate - within candidates in direction starting from searchOrigin + within candidates in direction starting from searchOrigin. 10. If navigation-override is enabled in the [=node document=] of eventTarget for the origin of the [=active document=] of the [=top-level browsing context=], then - fire an event named navbeforefocus at eventTarget using {{NavigationEvent}} - with its {{NavigationEvent/dir}} set to direction and {{NavigationEvent/relatedTarget}} set to bestCandidate - and with it's bubbles and cancelable attributes set to true, - and return if the result is false -11. Run the focusing steps for bestCandidate and return + fire an event named navbeforefocus at eventTarget using {{NavigationEvent}} with: + * Set {{NavigationEvent/dir}} to direction + * Set {{NavigationEvent/relatedTarget}} to bestCandidate + * Set bubbles and cancelable attributes to true + + and return if the result is false. +11. Run the focusing steps for bestCandidate and return. @@ -1099,7 +1107,7 @@ run the following steps: Note: this sub-setting is necessary to avoid going in the opposite direction than the one requested. 5. - * If insiders is non empty + * If insiders is non empty, 1. Let closest subset be the subset of insiders whose boundary box's * top edge is closest to the top edge of insideArea if dir is {{SpatialNavigationDirection/down}} * bottom edge is closest to the bottom edge of insideArea if dir is {{SpatialNavigationDirection/up}} From 405c581171defeff7b13c2d4d14f512aa56bbfd3 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 15:35:23 +0900 Subject: [PATCH 07/11] Fix the misspelled words --- css-nav-1/Overview.bs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 0e5e95bd251..5e9609f9d4a 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -149,7 +149,7 @@ based on feedback and experience acquired through such JavaScript usage. Note: A few features are marked at-risk. The editors of this specification believe they represent an important part of the user or author experience -of the features defined in specification. +of the features defined in the specification. At the same time, the core functionality of this specification can be implemented without implementing these so it seems possible that implementors may choose to down-prioritize them @@ -524,13 +524,14 @@ The {{Element/focusableAreas()}} method must follow these steps:
The {{Element/spatialNavigationSearch()}} method must follow these steps: -1. Let direction be the argument's {{SpatialNavigationSearchOptions/dir}} attribute +1. Let direction be the argument's {{SpatialNavigationSearchOptions/dir}} attribute. 2. If the argument's {{SpatialNavigationSearchOptions/candidates}} attribute is not null, - then let areas be that attribute, - else, let areas be the result of finding focusable areas - within the argument's {{SpatialNavigationSearchOptions/container}} attribute is not null, - or the element's nearest spatial navigation container ancestor -3. Return the result of selecting the best candidate within areas in direction direction from the element + then let areas be that attribute. +3. Else, let container be + * the argument's {{SpatialNavigationSearchOptions/container}} attribute, if it is not null, + * the element's nearest spatial navigation container ancestor, otherwise. +4. Let areas be the result of finding focusable areas within container. +3. Return the result of selecting the best candidate within areas in direction direction from the element. Note: When neither a container nor a list of candidates is provided, this only searches through the visible focusable areas of the nearest @@ -1011,7 +1012,7 @@ To run the spatial navigation steps in direction, do the f * Set {{NavigationEvent/dir}} to direction * Set {{NavigationEvent/relatedTarget}} to bestCandidate * Set bubbles and cancelable attributes to true - + and return if the result is false. 11. Run the focusing steps for bestCandidate and return. @@ -1116,7 +1117,7 @@ run the following steps: 2. If closest subset contains a single item, return that item, else return the first item of closest subset in document order, - unless its [=boundary box=] overlaps with the [=boundary box=] of an other item + unless its [=boundary box=] overlaps with the [=boundary box=] of another item and that item is higher in the CSS [=painting order=]. In that case, return that item instead, unless it too is overlapped with another higher item, recursively. @@ -1147,14 +1148,14 @@ run the following steps: To calculate the distance, the function is defined as below:
-    distance = euclidian + displacement - alignment - sqrt(Overlap)
+    distance = euclidean + displacement - alignment - sqrt(Overlap)
 
The meaning of each factor in the function is as follows:
-
euclidian -
The euclidian distance between P1 and P2 +
euclidean +
The euclidean distance between P1 and P2
displacement
The degree of displacement in dir between searchOrigin and candidate @@ -1323,12 +1324,12 @@ Note: In addition, as per [[#grouping]], the viewport of a browsing c button { align-self: center; }
- Because the elements in the table are semantically related to eachother, + Because the elements in the table are semantically related to each other, the author may want to provide a different navigation experience giving priority to movements inside the grid once you have focused one of its items. Adding table { spatial-navigation-contain: contain; } to the stylesheet - would result it this behavior. + would result this behavior. It would still be possible to move the focus out of the table, for example by going right from "Foo". Since there is nothing in the grid that is to the right, From 184b7b03ef0db378ec8cdca58612d1ca8f985288 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 16:17:24 +0900 Subject: [PATCH 08/11] Precisely define the navigation events --- css-nav-1/Overview.bs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 5e9609f9d4a..5246d02d48e 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -625,15 +625,16 @@ To create an instance of the {{NavigationEvent}} interface, use the {{Navigation passing an optional {{NavigationEventInit}} dictionary.
-[Constructor(DOMString type, optional NavigationEventInit eventInitDict)]
+[Exposed=Window,
+  Constructor (DOMString type, optional NavigationEventInit eventInitDict)]
 interface NavigationEvent : UIEvent {
-      readonly attribute SpatialNavigationDirection dir;
-      readonly attribute EventTarget? relatedTarget;
+    readonly attribute SpatialNavigationDirection dir;
+    readonly attribute EventTarget? relatedTarget;
 };
 
 dictionary NavigationEventInit : UIEventInit {
-      required SpatialNavigationDirection dir;
-      EventTarget? relatedTarget = null;
+    SpatialNavigationDirection dir;
+    EventTarget? relatedTarget = null;
 };
 
From 9ef245b41dd99f723d63c55791f11353dfaca6a1 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 16:48:09 +0900 Subject: [PATCH 09/11] Change the description about low level APIs --- css-nav-1/Overview.bs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index 5246d02d48e..f20db4d0fa7 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -451,7 +451,7 @@ enum FocusableAreaSearchMode { "all" }; -dictionary FocusableAreasOptions { +dictionary FocusableAreasOption { FocusableAreaSearchMode mode; }; @@ -463,8 +463,8 @@ dictionary SpatialNavigationSearchOptions { partial interface Element { Node getSpatialNavigationContainer(); - sequence<Node> focusableAreas(optional FocusableAreasOptions arg); - Node? spatialNavigationSearch(SpatialNavigationSearchOptions arg); + sequence<Node> focusableAreas(optional FocusableAreasOption option); + Node? spatialNavigationSearch(SpatialNavigationSearchOptions options); }; @@ -475,19 +475,20 @@ More directional keywords or a numerical angle could be added. Note: the {{focusableAreas()}} and {{getSpatialNavigationContainer()}} methods are
at-risk.
-The {{Element/getSpatialNavigationContainer()}} method must follow these steps: +: {{Element/getSpatialNavigationContainer()}} +:: Follows these steps: 1. Return the element if it is a spatial navigation container, or the nearest ancestor of the element that is a spatial navigation container, or the document if the nearest spatial navigation container is the viewport. -
-The {{Element/focusableAreas()}} method must follow these steps: +: focusableAreas(option) +:: Follows these steps: 1. Let visibleOnly be false - if the argument's {{FocusableAreasOptions/mode}} attribute is present and equal to 'all', + if option is present and it's value is equal to 'all', or true otherwise. -2. Let areas be the result of finding focusable areas within the element with the visibleOnly argument. +2. Let areas be the result of finding focusable areas within the element with the visibleOnly. 3. Let anchors be a clone of areas, with every focusable area which is not itself a Node replaced with its DOM anchor. 4. Return anchors @@ -523,12 +524,13 @@ The {{Element/focusableAreas()}} method must follow these steps:
-The {{Element/spatialNavigationSearch()}} method must follow these steps: -1. Let direction be the argument's {{SpatialNavigationSearchOptions/dir}} attribute. -2. If the argument's {{SpatialNavigationSearchOptions/candidates}} attribute is not null, - then let areas be that attribute. +: spatialNavigationSearch(options) +:: Follows these steps: +1. Let direction be the value of {{SpatialNavigationSearchOptions/dir}} attribute from options. +2. If the value of {{SpatialNavigationSearchOptions/candidates}} attribute from options is not null, + then let areas be the corresponding value. 3. Else, let container be - * the argument's {{SpatialNavigationSearchOptions/container}} attribute, if it is not null, + * the value of {{SpatialNavigationSearchOptions/container}} attribute from options, if it is not null, * the element's nearest spatial navigation container ancestor, otherwise. 4. Let areas be the result of finding focusable areas within container. 3. Return the result of selecting the best candidate within areas in direction direction from the element. From 91ef58ad800aa95769a0f45954a1b0e92ace0965 Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 17:10:48 +0900 Subject: [PATCH 10/11] Fix errors reported by the markup validator Used tool: https://validator.w3.org/ --- css-nav-1/Overview.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index f20db4d0fa7..f104aedbf75 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -486,7 +486,7 @@ Note: the {{focusableAreas()}} and {{getSpatialNavigationContainer()}} methods a : focusableAreas(option) :: Follows these steps: 1. Let visibleOnly be false - if option is present and it's value is equal to 'all', + if option is present and its value is equal to 'all', or true otherwise. 2. Let areas be the result of finding focusable areas within the element with the visibleOnly. 3. Let anchors be a clone of areas, @@ -1294,7 +1294,7 @@ Note: In addition, as per [[#grouping]], the viewport of a browsing c /* For browsers that don't support grid */ #example-cal table { - display:inline-table + display:inline-table; vertical-align: middle; } @@ -1456,7 +1456,7 @@ Answers are provided below.
How should this specification work in the context of a user agent’s "incognito" mode?
No Difference is expected. -
Does this specification persist data to a user’s local device? +
Does this specification persist data to a user’s local device?
No.
Does this specification have a "Security Considerations" and "Privacy Considerations" section? From adab108039f6dd84c4ec10760caf0f04601b057a Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Wed, 3 Apr 2019 17:20:43 +0900 Subject: [PATCH 11/11] Fix link errors --- css-nav-1/Overview.bs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/css-nav-1/Overview.bs b/css-nav-1/Overview.bs index f104aedbf75..98c3c7e0701 100644 --- a/css-nav-1/Overview.bs +++ b/css-nav-1/Overview.bs @@ -35,10 +35,10 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/; spec: dom; urlPrefix: https://dom.spec.whatwg.org/ type: dfn; text: document element -spec: feature-policy; urlPrefix: https://wicg.github.io/feature-policy/ +spec: feature-policy; urlPrefix: https://w3c.github.io/webappsec-feature-policy/ type: dfn; text: is enabled; url: is-feature-enabled -spec: overscroll-behavior; urlPrefix: https://wicg.github.io/overscroll-behavior/; +spec: overscroll-behavior; urlPrefix: https://drafts.csswg.org/css-overscroll-behavior-1/; type: dfn; text: scroll boundary spec: css2; urlPrefix: https://drafts.csswg.org/css2/ @@ -497,7 +497,7 @@ Note: the {{focusableAreas()}} and {{getSpatialNavigationContainer()}} methods a
The following code shows how to get all the visible focusable elements in the current page using {{Element/focusableAreas()}}. If the method finds a spatial navigation container, it recursively finds focusable areas inside it. - However, 'visible' is given to the {{FocusableAreasOptions/mode}} attribute of this method, + However, visible is given to the {{FocusableAreasOptions/mode}} attribute of this method, the focusable element which isn’t inside the scrollport is excluded from the result.

@@ -1054,7 +1054,7 @@ run the following steps:
 2. The User Agent should remove from focusables items that have a [=DOM anchor=] whose tabindex attribute is set to a negative value.
 
     Note: This is a "SHOULD" in order to mirror the exclusion of elements with negative tabindex
-    from the sequential focus navigation order as defined in [[HTML#the-tabindex-attribute]].
+    from the sequential focus navigation order as defined in [[HTML#attr-tabindex]].
 3. If visibleOnly is false,
     return focusables.
 
@@ -1078,7 +1078,7 @@ run the following steps:
     authors should use make these elements unreachable to spatial navigation
     using the same best practices as for making elements unreachable to sequential navigation,
     such as using tab-index="-1"
-    or the inert attribute.
+    or the inert attribute.
     
6. Return visibles.