Gesture activation should activate entire doctree branch

RESOLVED FIXED in Firefox 63

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: cpearce, Assigned: cpearce)

Tracking

(Blocks 1 bug)

unspecified
mozilla63
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(1 attachment)

Sometimes when video is playing, a preroll ad plays, and in some cases that may be in a cross origin iframe. If we require gesture activation to play, then the user will have to click once for the cross origin ad, and then once the preroll ad finishes, the user will have to click again to activate playback of the same origin content video.

This is annoying. Also once we start prompting for permission to autoplay with a doorhanger, this will be doubly annoying.

So we should change our gesture activation strategy so that a gesture activation anywhere in the doc tree activates the entire doc tree.
Comment on attachment 8986982 [details]
Bug 1470346 - Gesture activate all documents in tab, even across origins, upon user interaction.

https://reviewboard.mozilla.org/r/252242/#review259200

Yeah, I guess this is fine. Users don't know about random origins in iframes. For them page is page, and it is the top level thing only.

::: dom/base/nsDocument.cpp:12525
(Diff revision 1)
> -  return mUserHasActivatedInteraction;
> +  // If any ancestor document is activated, so are we.
> +  nsIDocument* doc = GetSameTypeParentDocument();
> +  while (doc) {
> +    if (doc->mUserGestureActivated) {
> +      // An ancestor is also activated. Record activation on the unactivated
> +      // sub-brranch to speed up future queries.

brranch
Attachment #8986982 - Flags: review?(bugs) → review+
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4cee97f375da
Gesture activate all documents in tab, even across origins, upon user interaction. r=smaug
https://hg.mozilla.org/mozilla-central/rev/4cee97f375da
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.