Bug 197428 - XMLHttpRequest should propagate user gestures for media playback
Summary: XMLHttpRequest should propagate user gestures for media playback
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-30 12:50 PDT by Eric Carlson
Modified: 2019-05-01 08:56 PDT (History)
5 users (show)

See Also:


Attachments
Patch (24.88 KB, patch)
2019-04-30 13:12 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews104 for mac-highsierra-wk2 (2.78 MB, application/zip)
2019-04-30 14:27 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews100 for mac-highsierra (3.33 MB, application/zip)
2019-04-30 14:32 PDT, EWS Watchlist
no flags Details
Patch (28.51 KB, patch)
2019-04-30 14:33 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2019-04-30 12:50:41 PDT
XMLHttpRequest should propagate user gestures for media playback.
Comment 1 Eric Carlson 2019-04-30 12:50:58 PDT
<rdar://problem/46677392>
Comment 2 Eric Carlson 2019-04-30 13:12:36 PDT
Created attachment 368599 [details]
Patch
Comment 3 EWS Watchlist 2019-04-30 14:27:46 PDT
Comment on attachment 368599 [details]
Patch

Attachment 368599 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/12044080

New failing tests:
fast/events/popup-blocking-timers5.html
Comment 4 EWS Watchlist 2019-04-30 14:27:48 PDT
Created attachment 368612 [details]
Archive of layout-test-results from ews104 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 5 EWS Watchlist 2019-04-30 14:32:56 PDT
Comment on attachment 368599 [details]
Patch

Attachment 368599 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12044204

New failing tests:
fast/events/popup-blocking-timers5.html
Comment 6 EWS Watchlist 2019-04-30 14:32:58 PDT
Created attachment 368613 [details]
Archive of layout-test-results from ews100 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 7 Eric Carlson 2019-04-30 14:33:07 PDT
Created attachment 368614 [details]
Patch
Comment 8 Jer Noble 2019-05-01 07:38:51 PDT
Comment on attachment 368614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=368614&action=review

> Source/WebCore/xml/XMLHttpRequest.cpp:69
> +static const Seconds maximumIntervalForUserGestureForwarding { 10_s };

Nit: I think it's really weird that there's both `maxIntervalForUserGestureForwarding` in DOMTimer and `maximumIntervalForUserGestureForwarding` in XMLHttpRequest, and that they're different values. (1s vs. 10s.)

Doesn't this mean that a xhr -> timer -> xhr of less that 10s will break if the first xhr takes > 1s?
Comment 9 Eric Carlson 2019-05-01 08:29:52 PDT
Comment on attachment 368614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=368614&action=review

Thanks for the review!

>> Source/WebCore/xml/XMLHttpRequest.cpp:69
>> +static const Seconds maximumIntervalForUserGestureForwarding { 10_s };
> 
> Nit: I think it's really weird that there's both `maxIntervalForUserGestureForwarding` in DOMTimer and `maximumIntervalForUserGestureForwarding` in XMLHttpRequest, and that they're different values. (1s vs. 10s.)
> 
> Doesn't this mean that a xhr -> timer -> xhr of less that 10s will break if the first xhr takes > 1s?

No, because XMLHttpRequest and DOMTimer both set a RefPtr<UserGestureIndicator> instance variable to null when their local timeout expires.
Comment 10 WebKit Commit Bot 2019-05-01 08:56:40 PDT
Comment on attachment 368614 [details]
Patch

Clearing flags on attachment: 368614

Committed r244823: <https://trac.webkit.org/changeset/244823>
Comment 11 WebKit Commit Bot 2019-05-01 08:56:41 PDT
All reviewed patches have been landed.  Closing bug.