Code Monkey home page Code Monkey logo

Comments (15)

frivoal avatar frivoal commented on June 15, 2024 1

How about making this variable as combination type such as ("sequential, spatial" | "spatial"), or {sequential, spatial}?

I don't understand. This would be a media feature, not a variable, so you could write:

@media (navigation: spatial) { ... }
@media (navigation: sequential) { ... }
@media (navigation) { /*matches if either is true*/ }
@media (navigation: none ) { /*matches if both are false*/ }
@media not (navigation) { /*same as above*/ }

Given how media queries work, the first two could absolutely match on the same device, if that device supports both sequential and spatial.

I also imagine an extended navigation, let's say that 3d navigation

Sure, no problem, then we can just add the new value, and you can continue to write the same as above, and also @media (navigation: nav3d) { ... }, and then @media (navigation) { ... } matches if any type of navigation, including 3d, is available.

from spatial-navigation.

anawhj avatar anawhj commented on June 15, 2024 1

Devices without a keyboard, and therefore no tab key (unless they provide some other way of triggering it).

Got it! I like @frivoal's idea. Could we suggest this proposal at the CSS wg f2f meeting?

Unlike limits of a media type that can handle a condition according to sort of output devices, this proposal that can distinguish input devices would have few issues on discriminating between the devices.

I'll put some concerns on this after the first formal proposal summary. Gathering use cases would be important in addition to the spatial navigation for now.

from spatial-navigation.

frivoal avatar frivoal commented on June 15, 2024 1

Yes, I discussed with Jihye today, and we will propose it at the CSSWG F2F. I will write a more detailed proposal in the csswg's repo and link it from here.

from spatial-navigation.

frivoal avatar frivoal commented on June 15, 2024 1

@Malvoz @supports allows to check if certain CSS property/value pairs are supported. This spec is mostly not about CSS properties (although it does propose one: spatial-navigation-contain). Knowing that this property is not supported wouldn't tell you anything about whether the browser implements the processing model, or about whether the user is able to trigger spatnav.

from spatial-navigation.

frivoal avatar frivoal commented on June 15, 2024 1

Suggesting the feature to the CSSWG: w3c/csswg-drafts#2494

from spatial-navigation.

frivoal avatar frivoal commented on June 15, 2024

I think we should probably have a media query, which lets the author ask about the presence of spatnav, and probably also about tab-based navigation.

Maybe something like this: navigation: sequential | spatial | none, so that you can write

@media (navigation: spatial) {...} in CSS or
if window.matchMedia("(navigation: spatial)").matches) { ... } in JS

from spatial-navigation.

anawhj avatar anawhj commented on June 15, 2024

Basically, we can use preventDefault() in a keydown event handler when author want to cancel the default spatnav, but I think @junhoseo's proposed API could be used for several purposes. The media query approach seems interesting to me.

Does the media query means there is a navigation CSS property that I can also use to set the spatnav mode? Otherwise, dose it mean to be used only in the media query scope?

from spatial-navigation.

frivoal avatar frivoal commented on June 15, 2024

Does the media query means there is a navigation CSS property that I can also use to set the spatnav mode? Otherwise, dose it mean to be used only in the media query scope?

Media queries and properties are independent.

from spatial-navigation.

junhoseo avatar junhoseo commented on June 15, 2024

Maybe something like this: navigation: sequential | spatial | none, so that you can write

How about making this variable as combination type such as ("sequential, spatial" | "spatial"), or {sequential, spatial}?
I imagine that only spatial navigation allowed user agent. I also imagine an extended navigation, let's say that 3d navigation. In this case, it will be better if we enumerate all supported navigation type than having single value.

from spatial-navigation.

anawhj avatar anawhj commented on June 15, 2024

Media queries and properties are independent.

Do you mean navigation is used as a media feature only in Media queries? I'm not yet sure how we can use the navigation as the media feature. What situations @media (navigation: sequential) condition is false in?

from spatial-navigation.

junhoseo avatar junhoseo commented on June 15, 2024

How about making this variable as combination type such as ("sequential, spatial" | "spatial"), or {sequential, spatial}?

Oh, your idea already implies my comment. Thanks! :)

from spatial-navigation.

frivoal avatar frivoal commented on June 15, 2024

What situations @media (navigation: sequential) condition is false in?

Devices without a keyboard, and therefore no tab key (unless they provide some other way of triggering it).

from spatial-navigation.

Malvoz avatar Malvoz commented on June 15, 2024

@junhoseo

... But, How to know a browser supports spatnav ...

+ @frivoal

I'm not sure I'm missing something here, but wouldn't @supports be applicable?

from spatial-navigation.

jihyerish avatar jihyerish commented on June 15, 2024

How about considering this by defining the new interface?
Such as, "SpatialNavigator" interface.

The SpatialNavigator interface of the spatial navigation which manages the process of spatial focus navigation on the web page.
Be specific,

  • Constructor

    • SpatialNavigator(): Creates a new SpatialNavigator object.
  • Event Handlers

    • SpatialNavigator.navbeforefocus: Dispatched when the spatial navigation process finds the best candidate.
    • SpatialNavigator.navbeforescroll: Dispatched when the spatial navigation triggers scrolling.
    • SpatialNavigator.navnotarget: Dispatched when the spatial navigation fails for finding the best candidate.

On top of that, the APIs in the current spatial navigation spec can be combined with this.

In this sense, the developer can know whether the page supports spatial navigation or not.
For example,

if (window.SpatialNavigator) {
  // The spatial navigator is supported
} else {
  // The spatial navigator is not supported
}

Also, the developer creates a SpatialNavigator to build a web page which uses the spatial navigation APIs.

from spatial-navigation.

frivoal avatar frivoal commented on June 15, 2024

Issue migrated to w3c/csswg-drafts#3385

from spatial-navigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.