Notify clients when the user plays media otherwise prevented from autoplaying
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 02:18:00 +0000 (02:18 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 02:18:00 +0000 (02:18 +0000)
commitbc1d00d49351826d97419f47ece26f2afad8c1d8
tree2275b8296a0c787e31231783dc42d7e3adfd3403
parent05bb465ff50c3a052dd42c359f176e40645522bd
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-25
Reviewed by Alex Christensen.

Source/WebCore:

The API is tested.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
* page/ChromeClient.h:

Source/WebKit2:

* UIProcess/API/APIUIClient.h:
(API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/autoplay-with-controls.html: Added.
* TestWebKitAPI/Tests/WebKit2/js-play-with-controls.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(didPlayMediaPreventedFromPlayingWithoutUserGesture):
(TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebViewHostWindow _mouseUpAtPoint:]):
(-[TestWKWebView waitForLoad]):
(-[TestWKWebView mouseUpAtPoint:]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/page/ChromeClient.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/APIUIClient.h
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPageUIClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/autoplay-with-controls.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/js-play-with-controls.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/no-autoplay-with-controls.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm
Tools/TestWebKitAPI/cocoa/TestWKWebView.h
Tools/TestWebKitAPI/cocoa/TestWKWebView.mm
Tools/WebKitTestRunner/TestController.cpp