WICG / gesture-delegation

Gesture Delegation API proposal
Other
7 stars 5 forks source link

Why can you only delegate vibration and media, not others? #10

Closed domenic closed 7 years ago

domenic commented 7 years ago

https://github.com/whatwg/html/issues/3123 lists a lot of places that the user activation concept exists on the platform. Probably more exist.

Why does this feature, which has a generic name, only allow delegation for two cases? What happens if I want to delegate permission to, e.g., go fullscreen, to an iframe?

mounirlamouri commented 7 years ago

This is meant to delegate the user activation on the browsing context. For now, only these two features are ready to use this concept in Blink. We could extend to more features if there is interest from the community.

domenic commented 7 years ago

Perhaps it should use a name like allowdelegationoffeaturesinblink="" then? Only slightly joking. We shouldn't be developing standards with such a vendor-specific focus.

mounirlamouri commented 7 years ago

I don't think these concepts have to be Blink focused. For vibration, when most vendors decided to kill the feature, Blink has been looking in a way to reduce annoyance. The autoplay work is very similar and Blink is paving the way and hope others will follow. We are talking to other browsers in parallel but everyone has different visions and priorities wrt interventions.

domenic commented 7 years ago

OK. Then why not include a cross-vendor feature like fullscreen in the initial set? It seems like it'd be useful to allow iframes to use the user activation of a parent to trigger fullscreen.

mounirlamouri commented 7 years ago

The first version of this feature will only delegate "document user activation" fullscreen uses user activation. In other words, fullscreen only works if you make the call when the activation happened or closed enough to when it happens while this API for now is about delegating the fact that the document had a user activation at some point.

domenic commented 7 years ago

Oh. That's confusing.

Isn't it browsing context user activation, per #8?

mounirlamouri commented 7 years ago

I think https://github.com/WICG/gesture-delegation/blob/master/explainer.md#new-html-concept might answer your question.

domenic commented 7 years ago

That seems to imply it has nothing to do with documents, and is scoped to some kind of (browsing context, eTLD+1) combination.

mounirlamouri commented 7 years ago

Whether it has something to do with document is really a point of view. I think it's simpler to describe it as related to the document. Whether it's described in spec as part of the document or the browsing context is also a spec details: the flag could be on the browsing context and it would reset it on some navigation or it could be set on the document and the browsing context would set it on the new document after navigation for some navigations.

As far as naming is concerned, I think "document" is clearer for most people and when actually used, the "document" is what matters. Though this is leaking into #7.

domenic commented 7 years ago

I'll close this and take the discussion to #7 then. But I am very confused by document and think it's bad. E.g. I don't think new Document() objects have this flag.