-
Notifications
You must be signed in to change notification settings - Fork 715
[mediaqueries-4] Change when any-* evaluate to 'none' #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There are definitely some interesting use-cases to address that aren't fully addressed by (pointer) and (any-pointer) (and hover/any-hover) right now, but I don't think that generalizing (any-pointer) to allow it to match anything is the right approach. The PR as written just removes any instructions on what values to should match. If we can come up with good criteria for determining what any-pointer/any-hover should match (more elaborate than just "the union of capabilities", as currently defined), then there might be something here. Otherwise, we might be looking at a different solution altogether - for example, maybe it's useful to explicitly call out the capabilities of the secondary input devices (so (secondary-pointer) would be just like (any-pointer), but excluding the primary devices). Or maybe we want a JS enumeration of the input devices with some annotations of their capabilities, so apps that really care can be smart about it. Regardless, I think the PR as written won't work. |
(same for Of course, an author would need to know exactly what they're asking for, and why, in order to make sensible use of this. |
In essence, this change makes the feature query for |
In combination with the regular |
Wouldn't that always be true? On desktops/laptops, the keyboard fits that bill. On mobile, the virtual keyboard or voice control... In an (js-based?) enumeration of input devices, saying that a particular one doesn't have the ability to hover seems reasonable. But on a single query that answers about the combination of all input devices, that seems ineffective. In a reductio ad absurdum kind of way, specifying thingsthis way sorts of implies that connecting an input device which is not capable of anything at all should change the result of the media query. I don't think that makes much sense. |
True, keyboard on desktop would be the fly in the ointment (unless UAs were using some heuristics - similar to what Firefox does with regards to Related musing: perhaps the features should be more tightly limited/defined to only apply to "pointer inputs" per se - similar to what happens with Pointer Events (I originally argued, but then conceded, that keyboard should also be a As for the reductio ad absurdum case, it doesn't seem too absurd to me - if the user does add an input that doesn't hover and doesn't have a traditional pointer, then yes I would expect the query (if it were modified as per this PR) to then return true for |
In both cases, excluding from consideration the device that cannot hover on the basis that it is not a pointing device would have no impact on the MQ. This distinction would be come meaningful if we were to follow to start allowing If I'm understanding you write, what you're after is the ability to distinguish between the absence of a pointing device, and the presence of a pointing device that cannot hover. In the case of the primary one, we can already do so: What we cannot tell apart is when there is one or more pointing devices some of which can hover, and one or more pointing devices, all of which can hover. I have a bit of a hard time imagining what a web page would do with that information. I can sort of imagine wanting more fine grained information, and iterating in javascript through an exhaustive list of input devices, each with detailed information, but as long as you're querying about the combined capabilities of all input devices, I don’t quite see it. Would you be so kind as to give me an example of how one would use that? |
see use cases here 08eaa28 This, in essence, boils down to authors having the ability to base their decision on whether or not to offer certain styles/functionalities reliant on pointer or hover based on knowledge of ALL available inputs. authors may decide that the fact that an input is present (even if it's not primary) that lacks that particular feature is enough for them to decide not to rely on hover stuff, or to add non-pointer stuff, for instance. It's not to say they must, but it gives them the option to. |
thinking about this further in the last few days - just to help myself work through this:
in the current model, there is no way to find out an answer to the questions in 2). which is confusing because the if the model for 2) was adopted, and the developer did want to find the answer to the questions as posed in 1), they could still do it with something like (using |
This would require us to define what is an input, while the current definition does not need that. If there is a thing that can hover, we're good, without having to wonder about whether that thing is an input. If there is nothing that can hover, we're also good. With your definition, we'd need to start classifying things as being an input or not. If a thing cannot point and cannot hover, is it an still input (e.g. the enter key, a spat-nav only gamepad, voice control, volume buttons, /dev/null…)? I am sure we could come up with a number of definitions. But as I don't see in what case it would be useful to distinguishing between the absence of devices with a certain feature and the presence of unidentified devices lacking that feature, I don't see on what basis to judge whether we picked the best definition. |
sorry @frivoal but you seem to be strangely splitting hairs here...i'm using the word "input" as a short way of saying "input mechanism", which is exactly what the current spec already talks about
your extra distinction here of input vs "unidentified devices" seems rather orthogonal to my actual points above, no? |
i've provided use cases 08eaa28, rationale, and in answer to @tabatkins also clarified how UAs should decide when the proposed modified media features would return true or false #737 (comment) ... could we focus the discussion back to those? where are the gaps here (one already identified was keyboard always being present and always fudging potential results on desktop, but I'd argue that's by design in my proposal rather than a problem, as indeed a desktop/laptop user could well decide at any point to use a keyboard) |
Sure. I don't care about that difference.
I don't think so, because with the way the spec is currently written, if something can point it informs the result of If you take for example an input to be anything that can either hover or point, then a spatnav or sequential-nav device is not an input, which I think defeats your use cases, as So I don't think we can evaluate your proposal unless we know what counts as input. Some definitions are nonsensical (rocks), some make the query useless (most devices match most values), and some seem completely arbitrary (include game pads but exclude keyboards?) making the query unreliable for authors. Maybe one of the seemingly arbitrary definitions will still be useful. But I don't know until you say which one you're using. Note: this is not the only thing that makes me skeptical of your proposal, but until we address it, I think it has too much undefined behavior to be effectively evaluated anyway. |
Serious question: do user agents not know what an "input"/"input method" is (either from some built-in capabilities or from the OS)? [edit: to expand, sure the UA doesn't know about the non-hovering "rock" next to it on the desk, but I'm fairly sure the OS at least has an overview of any standard HCI-type input mechanisms that are plugged in/paired/active, and of those the UA probably(?) knows which ones it needs to react to / can cause an activation / etc?] |
revisiting this once more, i think part of the discussion about keyboard is actually a red herring, since so, with this reevaluation, i can see how however, in the case of |
Adds more explicit clarification about the possibly non-intuitive way in which `any-pointer:none`/`any-hover:none` work. Splits out the initial mention (that "ALL pointing devices need to match") into its own line, and provides two sets of notes/examples that clarify scenarios where this may not be completely obvious. Additionally, this explicitly highlights the situation that currently cannot be detected: having more than one pointing device where at least one is non-hover-capable (as touched on in w3c#737 (comment) )
Tackling at least the clarification of what currently happens (and the shortcoming of what currently can't be detected) in #840 |
Closing this in favor of a more focused successor that only deals with |
Adds more explicit clarification about the possibly non-intuitive way in which `any-pointer:none`/`any-hover:none` work. Splits out the initial mention (that "ALL pointing devices need to match") into its own line, and provides two sets of notes/examples that clarify scenarios where this may not be completely obvious. Additionally, this explicitly highlights the situation that currently cannot be detected: having more than one pointing device where at least one is non-hover-capable (as touched on in #737 (comment) )
Currently,
any-pointer: none
andany-hover: none
only evaluate to true when they apply to ALL pointers/input mechanisms. There are situations, however, where it would be useful if these evaluated to true if ANY pointers/input mechanisms had those characteristics. Filing a speculative PR together with this issue - see the examples I propose there for use cases. [edit: see examples/use cases from the PR ]This would clearly be a substantive change to the spec, but one that I feel would open up some more granular possibilities for authors.
(this issue is a continuation of #715 which in turn came out of this isse #690)
The text was updated successfully, but these errors were encountered: