Bug 197428

Summary: XMLHttpRequest should propagate user gestures for media playback
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, jer.noble, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews104 for mac-highsierra-wk2
none
Archive of layout-test-results from ews100 for mac-highsierra
none
Patch none

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.