Re: [w3ctag/design-reviews] Spatial Navigation (#287)

Thank you for the feedback!

@dbaron 
I agree with your concern. Considering shadow DOM and form control is the hardest part of spatial navigation. Nonetheless, the spec needs to describe how to handle those.

> So it seems like perhaps what spatial navigation exposes inside of a shadow tree should probably be different from what it exposes outside a shadow tree. That is, perhaps there should be a way for the shadow tree to "capture" some of the spatial navigations to be movement inside of it, and then in other cases allow the navigations to move outside of it.

I have a vague thought which is making the navigation event do not cross shadow DOM boundaries.
However, I need to think deeply about this and talk with folks working in webcomponents

There is another approach to solve this issue, and the discussion about it is still going on. 
If there is any progress about it, I'll share it here.

@cynthia 
> Completely turning off the feature with feature policy as a mitigation towards hostile iframes seems a bit extreme. 

[`navigation-override`](https://drafts.csswg.org/css-nav-1/#policy-feature) feature policy doesn't block the entire spatial navigation feature.
It just restricts iframe from using Navigation event.

There is [`navnotarget` ](https://drafts.csswg.org/css-nav-1/#event-type-navnotarget) event which occurs when there isn't any element which will get the focus next within the current [container](https://drafts.csswg.org/css-nav-1/#spatial-navigation-containers). (iframe is also considered as a container.)
In general, after firing [`navnotarget` ](https://drafts.csswg.org/css-nav-1/#event-type-navnotarget), the focus moves out of the container.

That means, if the hostile iframe prevents default of [`navnotarget` ](https://drafts.csswg.org/css-nav-1/#event-type-navnotarget), the focus is trapped inside it.

To avoid this kind of attempt, `navigation-override` makes the hostile iframe cannot use Navigation event.

> What does "absolute distance" mean? I'm suspecting it's an alias to manhattan distance, but that part is rather unclear. 

Oh, the expression is ambiguous. It means that the distance considering only one axis.
If the navigation direction is right or left, it measures distance only along the x-axis.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/287#issuecomment-497291149

Received on Thursday, 30 May 2019 10:57:05 UTC