You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Nils Frahm is a German musician, composer and record producer based in Berlin. He is known for combining classical and electronic music and for an unconventional approach to the piano in which he mixes a grand piano, upright piano, Roland Juno-60, Rhodes piano, drum machine, and Moog Taurus.</p>
<p>Agnes Caroline Thaarup Obel is a Danish singer/songwriter. Her first album, Philharmonics, was released by PIAS Recordings on 4 October 2010 in Europe. Philharmonics was certified gold in June 2011 by the Belgian Entertainment Association (BEA) for sales of 10,000 Copies.</p>
Copy file name to clipboardExpand all lines: explainer.md
+74-5Lines changed: 74 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,9 @@ the specification exposes Javascript APIs and Events that enable authors to inte
170
170
171
171
#### JS APIs
172
172
173
+
* navigate()
174
+
- Moves the focus to the best target in the corresponding direction
175
+
173
176
* getSpatialNavigationContainer()
174
177
- Returns the spatial navigation focus container of an element.
175
178
@@ -325,11 +328,77 @@ The approach we have chosen seems more inline with how existing implementations
325
328
simpler and therefore easier to understand,
326
329
and authors can switch to the other approaches using the APIs.
327
330
328
-
## Demo
329
-
-[Blog using the spatial navigation polyfill](https://wicg.github.io/spatial-navigation/demo/blog/)
331
+
## Open Questions
332
+
### How can the developer knows weather the spatial navigation is supported or not?
333
+
There are several approaches.
334
+
1. Using the Media Query
335
+
336
+
```
337
+
@media (navigation: spatial) { ... }
338
+
@media (navigation: sequential) { ... }
339
+
```
340
+
341
+
* related github issue: https://github.com/WICG/spatial-navigation/issues/41
342
+
343
+
2. Using the spatial navigation API
344
+
If the spatial navigation is implemented, one of the API can be the criteria for the enablility of the spatial navigation
345
+
For example,
346
+
347
+
```
348
+
349
+
if (document.body.spatialNavigationSearch) {
350
+
// The spatial navigator is supported
351
+
} else {
352
+
//The spatial navigator is not supported
353
+
}
354
+
```
355
+
356
+
### How can the spatial navigation works for the iframe?
330
357
331
-
-[Samples using the spatial navigation polyfill](https://wicg.github.io/spatial-navigation/sample/)
358
+
The iframe element needs to be consider carefully for moving the focus.
359
+
Using the Feature Policy API can be the solution.
332
360
333
-
-[Samples for testing the implementation in Blink](https://wicg.github.io/spatial-navigation/blink_impl/heuristic_default_move.html)
361
+
By default the focus can move to the iframe element which are the same-origin.
362
+
But for the iframe with `spatialnavigation` value is given to `allow` attribute (Feature Policy API), the focus can move inside it.
334
363
335
-
***Note***: Samples work best in the latest Chrome with the experimental web platform features enabled (--enable-spatial-navigation flag) otherwise they won't work.
364
+
In detail, the approach for the Feature policy would be like below:
365
+
366
+
* Default policy: spatialnavigation 'self'
367
+
368
+
*`Feature-Policy` HTTP header
369
+
370
+
A page can declare the spatial navigation feature in its HTTP headers as follows:
371
+
```
372
+
Feature policy: spatialnavigation 'self'
373
+
```
374
+
It means that only same-origin iframe elements are allowed for the spatial navigation.
375
+
376
+
* iframe `allow` attribute
377
+
378
+
The feature can be specified for a single iframe element using `allow` attribute as below:
0 commit comments