Interoperability and Compatibility
Edge: No signals
Firefox: No signalsSafari: No signalsWeb / Framework developers: Positive (positive feedback from TV web developers)
Ergonomics
The proposed DOM API is just a get method, so there isn't any performance risk.
Activation
This features works only if the following runtime flag enables. (--enable-spatial-navigation) It means that this features would be basically supported in some specific user agents such as TV with remote control and touchless smartphone. Several JS libraries provides almost same functionalities without consistency, but the libraries with this web engine feature will provide the functionalities with a high estimation accuracy in a consistent way.
Contact emailsExplainerDesign doc/SpecCSS WG discussion: https://github.com/w3c/csswg-drafts/issues/3743SummaryCSS Spatial Navigation provides a directional focus navigation with arrow keys, mainly used in smart TV with remote control and touchless smartphone. It could be used for one of accessibility features in several devices as well. In CSS Spatial Navigation specification, there are a dozen of APIs such as DOM methods, CSS properties and UI Events. This is an intent to implement only for spatialNavigationSearch API as a first phase. spatialNavigationSearch() is a proposed API to get a next target element to be focused via directional inputs. It returns a focusable element as a best candidate element in a given direction.MotivationThe basic processing model of spatial navigation has been supported with a bit unstable quality in WebKit and Blink for more than a decade years behind a flag (--enable-spatial-navigation), but it has recently been enhanced in terms of stability by Vewd, Google and LG. spatialNavigationSearch() provides an overriding option to authors based on the internal processing model in Blink. Several spatial navigation JS frameworks such as js-spatial-navigation(Mozilla) and Enact spotlight(LG), needs to use the option to customize the original behavior of spatial navigation.DebuggabilityNo need any support from DevTools for now. This feature has already been verified by polyfill and chrome extension tool. Developers can use them for debugging this feature as well.RisksInteroperability and CompatibilityEdge: No signalsFirefox: No signalsSafari: No signals
Web / Framework developers: Positive (positive feedback from TV web developers)ErgonomicsThe proposed DOM API is just a get method, so there isn't any performance risk.ActivationThis features works only if the following runtime flag enables. (--enable-spatial-navigation) It means that this features would be basically supported in some specific user agents such as TV with remote control and touchless smartphone. Several JS libraries provides almost same functionalities without consistency, but the libraries with this web engine feature will provide the functionalities with a high estimation accuracy in a consistent way.Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?Yes. This feature will be platform agnostic. In Android, directional inputs (i.e. arrow keys) could be triggered by a bluetooth keyboard.Link to entry on the feature dashboardTBDRequesting approval to ship?Not yet, but we would implement this feature in a month.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/3c8f4f9d-4aee-48e4-bf18-8aceb3fd9780%40chromium.org.
--
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/3f838395-648a-4fca-9784-23830dbf40c0%40chromium.org.
For cases that truly want to build their own, highly-customized, spat-nav interface, I think that should be possible with existing web-APIs. The explainer lists some of the reasons why this isn't practical to build with existing web functionality. I believe this comes from experience with existing JS polyfills. These attempt to also solve the problem of general-purpose web browsing of content designed for mice/touch. To be clear, I don’t believe that problem can be solved with JS for many of these reasons. However, IMHO if the scope is narrowed to content built ground-up for spatial navigation, I’m unconvinced a reasonable library can’t be built out of existing tools. (e.g. if you have content built to be spatially navigated it should avoid corner cases like overlapping boxes and line-broken links, I don’t see why you can’t build something like spatialNavigationSearch out of Element.getBoundingClientRect)
I've added some questions and replies to each of the points listed in the explainer below:
- Limitation from JS capability (Form elements (slider, text input, etc.), Shadow DOM, OOIPFs, e.g. no way to get the current caret position or the current slider bar for now)
- Uncertainty on animated pages (With animated object on a web page, Blink SpatNav is better than JS SpatNav in terms of responsiveness.)
- Uncertainty on keydown handlers (Author-defined keydown handlers could affect to the existing SpatNav operation provided by JS SpatNav, e.g. preventDefault in the author-defined keydown handeler could cancel the JS SpatNav logic as well.)
- Inconsistency between several JS frameworks (Several JS SpatNav provides a bit different user experience. (e.g. rules for next target selection))
- Difficult to align native scroll behaviors with SpatNav when moving the focus to offscreen element (With JS, a bit complex codes are needed to support the offscreen element management in a scroll container.)
- Difficult to align the virtual focus management with a11y supports (The a11y functionality works based on the focus movement, but some JS SpatNav works with virtual focus.)
- Performance degradation due to a bit expensive cost of DOM Access whenever pressing arrow keys (In case of the huge number of focusable elements in a web page, it works slowly when pressing arrow keys)
Hello Bokan,
Thank you for the elaborate and experienced description. It discloses the overall spatial navigation status with several problematic issues so that it couldn't secure its place with a stable quality on the web until now. (so long history with spatial navigation for general web contents since early of 2000 on the web..)
First of all, I deeply respect your experience on performance issues on the main thread(esp. scrolling) and efforts for low-powered devices. Honestly, we also started the spatial navigation(aka. SpatNav) for smart TV as one of the low-powered devices with low performance and issues occurred rather frequently in SpatNav area. In a long-term perspective, I would totally agree with the approach you described.
Before replying your questions (I will respond it next week, though most of the comments make sense.), I would like to share some background and desired directions in phases.
<< SpatNav as a browser service >>
As you mentioned, most of the web contents have only considered mouse and touch as input modalities. It would be one of the biggest challenges on the spread of web-based TV platform ecosystem. The lean-back UX with remote control would be less competitive with desktop and smartphone, even though TV has the awesome big screen. In this background, we would like to embrace the existing web contents on the smart TV browser (which is included in top 5 apps) via the enhanced input modality. SpatNav was one of the key improvement area to be achieved on TV browser and TV installed apps, so we have tried to apply the SpatNav requirements into W3C spec and Blink until now.
I think TV browser almost doesn't need to support spatialNavigationSearch() and kind of the new meta syntax with simple-spatial-navigation. It would be difficult to manage the directional focus path on each page. If needed for some cases, the web contents offset could be adjusted in a proper way or handled by focusout event handler (see exmaple), so we hasn't taken account of the browser service for SpatNav.
<< SpatNav for TV installed apps >>
TV installed apps runs on a web runtime with a specific environments, so it's independent with TV browser. To make the install apps to be easily developed, we provides TV-friendly UI framework named Enact(https://enactjs.com/), which supports spatial navigation capability via the Spotlight JS library(https://enactjs.com/docs/modules/spotlight/) inside Enact. It works quite well, but sometimes it works abnormally or tricky with unexpected behavior. That's the reason we made the decision to migrate part of the JS logics on it into Blink.
At the current moment, I'm not convinced that the decision would be reasonable, because we've put much efforts more than expected. However, we've tried to define an appropriate processing model and standards API in a right direction so that I believe that the activities affects the competitiveness of our product and framework. TV installed apps are one of the important customers for spatialNavigationSerch API. If we secure that API, we can meaningfully use it on Enact framework and other frameworks as well, though it could be eliminated after migrating SpatNav to the browser process.
<< Suggestion >>
I believe that spatialNavigationSearch API affects no performance degradation without any risk, if authors don't use it. We plan to present the performance experiment when it's executed on the focusout handler on a current focused element as a synced event followed by focusin and focus on a next target. We can use it for the time being before all set of future SpatNav with a bit higher quality (e.g. interest, out of Blink, OOPIF, closed Shadow DOM). I guess it takes some time. In addition, the release period of TV product release is about a year unlike desktop and mobile, so we would hope that the API could be applied to M80. We've already started to implement the API, but need to get its review from several valuable people as usual. If I missed something or another opinion from different perspective, I'm willingly open to it.
Thanks,
Hyojin
To unsubscribe from this group and all its topics, send an email to blink-dev+unsubscribe@chromium.org.
We have bunch of standards API which has implemented in the browser engines and most of the standard APIs could be implemented by JS as well. The important criteria would be its generality and widely usage, but I hope Chromium open source can embrace powerless devices with a minimum coverage. I believe spatialNavigationSearch has few risk and generous API as the most fundamental one for SpatNav.
Inside Blink SpatNav, OOPIF could be properly handled and spatialNavigationSearch can handle OOIPF as well. The JS SpatNav can't handle OOPIF without spatialNavigationSearch.
The following example is what I wanted to show: https://codepen.io/anawhj/pen/rNaNbOJI thought that it somethime doen't work well when moving the focus via arrow keys, but it seems a tricky case.
The polyfill provides some restriction that authors can't use window.addEventListerer(keydown or keyup) due to a reserved usage from JS SpatNav. (document or specific DOM elements is no problem, though) In the background, authors need to use those event handlers based on JS SpatNav. If Blink SpatNav is supported, no need to consider it at all.
BTW, I just want to get your opinion about the scroll alignment API. You can see the scroll alignment JS API at the following link. https://scroll-into-view-if-needed.netlify.com/ Is it enough as a JS API or could it be considered as a standard API to be supported by browser engines?
To unsubscribe from this group and all its topics, send an email to blink-dev+...@chromium.org.
Sorry for the delay, replies inline.We have bunch of standards API which has implemented in the browser engines and most of the standard APIs could be implemented by JS as well. The important criteria would be its generality and widely usage, but I hope Chromium open source can embrace powerless devices with a minimum coverage. I believe spatialNavigationSearch has few risk and generous API as the most fundamental one for SpatNav.
I suspect it might be difficult to determine clipping and overlap of elements from JS but otherwise I'm still not totally clear on the advantages of building this as a browser API. However, I agree the risk here is low. My summary opinion is that this isn't harmful to add but I also don't know what problem this is solving.
Inside Blink SpatNav, OOPIF could be properly handled and spatialNavigationSearch can handle OOIPF as well. The JS SpatNav can't handle OOPIF without spatialNavigationSearch.How would this work? The API returns a Node. If you've got an OOPIF on your page, the DOM tree of the OOPIF isn't accessible to the current frame so you can't return a node to something inside it. Even if you did return some kind of proxy, you'd still need to do a cross-process call - the API shape appears to be synchronous which doesn't match well with an cross-process call.
The following example is what I wanted to show: https://codepen.io/anawhj/pen/rNaNbOJI thought that it somethime doen't work well when moving the focus via arrow keys, but it seems a tricky case.These animations are ticked on the compositor thread while this API works on the main thread, I don't think a blink-side API here will help much. That aside though, is this really a realistic use case for spatial navigation to solve?
The polyfill provides some restriction that authors can't use window.addEventListerer(keydown or keyup) due to a reserved usage from JS SpatNav. (document or specific DOM elements is no problem, though) In the background, authors need to use those event handlers based on JS SpatNav. If Blink SpatNav is supported, no need to consider it at all.Why is this a restriction? If authors want to do something with key events other than spat nav they can still register event listeners and preventDefault the key events before they reach spat nav.
Or is the intent that you don't want authors to be able to override spat nav? (this would seem like an odd design for apps designed specifically for spat-nav)In addition, a JS library can provide authors with an API to allow overriding/listening key events if this is really an issue.Perhaps I don't fully understand the key event listener use cases you're worried about.
BTW, I just want to get your opinion about the scroll alignment API. You can see the scroll alignment JS API at the following link. https://scroll-into-view-if-needed.netlify.com/ Is it enough as a JS API or could it be considered as a standard API to be supported by browser engines?This link appears to be a polyfill of functionality already shipped in Blink in scrollIntoView and scrollIntoViewIfNeeded so this is already available.
To unsubscribe from this group and all its topics, send an email to blin...@chromium.org.