-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
User activation: different concepts for different usages #3859
Comments
So to be clear, I'm not just talking about the sets of events. In general, it feels like there are the following things to consider:
The three API concepts listed above don't really address those issues; unless I am missing something they merely talk about what APIs are available once "activation" has been achieved and how (or whether) use of those APIs affects whether "activation" is preserved or not. The big question is whether the answers to those three questions are the same across all APIs that need "activation". In the spec proposal they are. Let me give a few specific examples of things I'm not sure @mustaqahmed's model captures:
There are also other minor quibbles in terms of the event set, of course. Gecko's concept of activation can be triggered by certain key events; the current spec proposal might capture some of that in its change/submit/reset bits, but that might be too restrictive; unclear. Gecko treats mouse/pointer down/up symmetrically, but the spec requires "up". But those are details; the big question is whether it makes sense to have this event set be uniform across all APIs that depend on "activation". Anyway, I am not actively involved in this work on the Gecko end right now, so I don't know exactly where things stand in our implementation and what plans, if any, there are for evolving this. @smaug---- or @martinthomson might know who would have that information. |
I understand that our model doesn't fully capture the variations Gecko has between various APIs. The core question here is: how many of such variations do we really need for the Web? We want to define a "small" set of variations that works:
I believe the variations you mentioned are results of isolated API-specific development, instead of being part of a holistic design from user activation perspective. I have seen the same situation in Chromium: we have many many hacks that were added independently only to make individual APIs functional with user activation. I just investigated Firefox with the hope of finding a pattern in the variations but I failed. In fact, I have got new questions if we want to justify the underlying model:
The Web is currently broken in terms of user activation interop. In #1903, we are trying to fix this through a simple design, because:
|
When I looked back at this discussion yesterday after a break, it seems to me that popup blocker is the most significant source for the variations observed. While today popup blocker is fused to (or inseparable from) user activation in perhaps most browsers, it doesn't have to remain so forever. To be precise, if we define a functional relationship between user activation state and popup blocker as follows, we can address the core concern here in an incremental way:
In other words, popup blocker can rely on and affect user activation state in a limited manner, but the observable behavior of popup blocker can still vary with, say, input event. Note that this argument applies to any user-activation-gated API, hence redefining user activation state doesn't necessarily mean redefining all dependent APIs in one shot. Instead, other APIs can catch up with a redefined user activation state by gradually getting rid of legacy constraints and other states if necessary. However, I don't believe anything except the popup blocker will need it. From this perspective, it seems fair to say that user-activation-gated APIs can affect user activation state in only a few limited ways (e.g. as proposed in #1903). So we can still have a single concept for user activation state that covers all use cases. @bzbarsky: Does it look like a reasonable way forward? @domenic: Do you see any way the proposed spec can mention this? I guess the section on API classification should be rewritten? |
To fit additional pop-up blocking constraints into the spec, you'd modify the pop-up blocking section, i.e. https://html.spec.whatwg.org/multipage/browsers.html#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name to allow additional user-agent specific leeway in when to popup-block. Something like modifying
to
This would be sad for interop, but what I'm hearing from @bzbarsky is that this is a place where, in his view, interop needs to take a back seat to product decisions. I'm not sure I agree, and it'd be interesting to hear if other implementers feel the same way... but that's one path, if we need to do that. |
This is forked from blink-dev, where @bzbarsky expresses
In response, @mustaqahmed forked off #3849 to address this, asking the question, should we maybe use a different set of events for each situation that uses "activation"? I'm raising this thread because I think @bzbarsky was probably suggesting a broader focus, not just on events, and it'd be good to have a dedicated discussion.
The way I see it, with @mustaqahmed's model (explainer, spec PR, rendered spec preview) we have three concepts of activation already, which he lists as:
@bzbarsky, do you think this is enough nuance to capture the different notions of "activation"? If not, do you think adding variants with different sets of events would help, e.g. transient-activation-consuming-but-only-clicks? Or did you have other ideas?
The text was updated successfully, but these errors were encountered: