Changeset 211200 in webkit
- Timestamp:
- Jan 25, 2017 8:24:10 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211199 r211200 1 2017-01-25 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r211193. 4 5 This change broke internal builds. 6 7 Reverted changeset: 8 9 "Notify clients when the user plays media otherwise prevented 10 from autoplaying" 11 https://bugs.webkit.org/show_bug.cgi?id=167390 12 http://trac.webkit.org/changeset/211193 13 1 14 2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 15 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r211193 r211200 3168 3168 3169 3169 if (ScriptController::processingUserGestureForMedia() && m_preventedFromPlayingWithoutUserGesture) { 3170 if (Page* page = document().page()) 3171 page->chrome().client().didPlayMediaPreventedFromPlayingWithoutUserGesture(); 3170 // FIXME: notify clients a user gesture was made and started playback of an element that was otherwise prevented from playing. 3172 3171 m_preventedFromPlayingWithoutUserGesture = false; 3173 3172 } -
trunk/Source/WebCore/page/ChromeClient.h
r211193 r211200 421 421 422 422 virtual void isPlayingMediaDidChange(MediaProducer::MediaStateFlags, uint64_t) { } 423 virtual void didPlayMediaPreventedFromPlayingWithoutUserGesture() { }424 423 425 424 #if ENABLE(MEDIA_SESSION) -
trunk/Source/WebKit2/ChangeLog
r211199 r211200 1 2017-01-25 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r211193. 4 5 This change broke internal builds. 6 7 Reverted changeset: 8 9 "Notify clients when the user plays media otherwise prevented 10 from autoplaying" 11 https://bugs.webkit.org/show_bug.cgi?id=167390 12 http://trac.webkit.org/changeset/211193 13 1 14 2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 15 -
trunk/Source/WebKit2/UIProcess/API/APIUIClient.h
r211193 r211200 153 153 virtual void didBeginCaptureSession() { } 154 154 virtual void didEndCaptureSession() { } 155 virtual void didPlayMediaPreventedFromPlayingWithoutUserGesture(WebKit::WebPageProxy&) { }156 155 157 156 #if ENABLE(MEDIA_SESSION) -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r211193 r211200 2236 2236 } 2237 2237 #endif 2238 2239 void didPlayMediaPreventedFromPlayingWithoutUserGesture(WebPageProxy& page) override2240 {2241 if (!m_client.didPlayMediaPreventedFromPlayingWithoutUserGesture)2242 return;2243 2244 m_client.didPlayMediaPreventedFromPlayingWithoutUserGesture(toAPI(&page), m_client.base.clientInfo);2245 }2246 2238 }; 2247 2239 -
trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h
r211193 r211200 103 103 typedef void (*WKPageDidClickAutoFillButtonCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo); 104 104 typedef void (*WKPageMediaSessionMetadataDidChangeCallback)(WKPageRef page, WKMediaSessionMetadataRef metadata, const void* clientInfo); 105 typedef void (*WKDidPlayMediaPreventedFromPlayingWithoutUserGesture)(WKPageRef page, const void* clientInfo);106 105 typedef void (*WKFullscreenMayReturnToInlineCallback)(WKPageRef page, const void* clientInfo); 107 106 … … 727 726 WKRequestPointerLockCallback requestPointerLock; 728 727 WKDidLosePointerLockCallback didLosePointerLock; 729 WKDidPlayMediaPreventedFromPlayingWithoutUserGesture didPlayMediaPreventedFromPlayingWithoutUserGesture;730 728 } WKPageUIClientV8; 731 729 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r211193 r211200 6528 6528 #endif 6529 6529 6530 void WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture()6531 {6532 m_uiClient->didPlayMediaPreventedFromPlayingWithoutUserGesture(*this);6533 }6534 6535 6530 #if PLATFORM(MAC) 6536 6531 void WebPageProxy::removeNavigationGestureSnapshot() -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r211199 r211200 1063 1063 bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; } 1064 1064 WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; } 1065 void didPlayMediaPreventedFromPlayingWithoutUserGesture();1066 1065 1067 1066 #if PLATFORM(MAC) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r211199 r211200 444 444 445 445 IsPlayingMediaDidChange(unsigned state, uint64_t sourceElementID) 446 DidPlayMediaPreventedFromPlayingWithoutUserGesture()447 446 448 447 #if ENABLE(MEDIA_SESSION) -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r211193 r211200 1085 1085 } 1086 1086 1087 void WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture()1088 {1089 m_page.send(Messages::WebPageProxy::DidPlayMediaPreventedFromPlayingWithoutUserGesture());1090 }1091 1092 1087 #if ENABLE(MEDIA_SESSION) 1093 1088 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r211193 r211200 298 298 299 299 void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t) final; 300 void didPlayMediaPreventedFromPlayingWithoutUserGesture() final;301 300 302 301 #if ENABLE(MEDIA_SESSION) -
trunk/Tools/ChangeLog
r211193 r211200 1 2017-01-25 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r211193. 4 5 This change broke internal builds. 6 7 Reverted changeset: 8 9 "Notify clients when the user plays media otherwise prevented 10 from autoplaying" 11 https://bugs.webkit.org/show_bug.cgi?id=167390 12 http://trac.webkit.org/changeset/211193 13 1 14 2017-01-25 Matt Rajca <mrajca@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r211193 r211200 510 510 C95984F51E36BC6B002C0D45 /* autoplay-no-audio-check.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C95984F31E36BC55002C0D45 /* autoplay-no-audio-check.html */; }; 511 511 C95984F71E36BCEF002C0D45 /* test-without-audio-track.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = C95984F61E36BCD7002C0D45 /* test-without-audio-track.mp4 */; }; 512 C99B675C1E39721A00FC6C80 /* autoplay-with-controls.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C99B675A1E3971FC00FC6C80 /* autoplay-with-controls.html */; };513 C99B675D1E39722000FC6C80 /* js-play-with-controls.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C99B675B1E3971FC00FC6C80 /* js-play-with-controls.html */; };514 C99B675F1E39736F00FC6C80 /* no-autoplay-with-controls.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C99B675E1E39735C00FC6C80 /* no-autoplay-with-controls.html */; };515 512 CD59F53419E9110D00CF1835 /* file-with-mse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53219E910AA00CF1835 /* file-with-mse.html */; }; 516 513 CD59F53519E9110D00CF1835 /* test-mse.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53319E910BC00CF1835 /* test-mse.mp4 */; }; … … 611 608 dstSubfolderSpec = 7; 612 609 files = ( 613 C99B675F1E39736F00FC6C80 /* no-autoplay-with-controls.html in Copy Resources */,614 C99B675D1E39722000FC6C80 /* js-play-with-controls.html in Copy Resources */,615 C99B675C1E39721A00FC6C80 /* autoplay-with-controls.html in Copy Resources */,616 610 C95984F71E36BCEF002C0D45 /* test-without-audio-track.mp4 in Copy Resources */, 617 611 C95984F41E36BC6B002C0D45 /* autoplay-check.html in Copy Resources */, … … 1281 1275 C95984F31E36BC55002C0D45 /* autoplay-no-audio-check.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "autoplay-no-audio-check.html"; sourceTree = "<group>"; }; 1282 1276 C95984F61E36BCD7002C0D45 /* test-without-audio-track.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-without-audio-track.mp4"; sourceTree = "<group>"; }; 1283 C99B675A1E3971FC00FC6C80 /* autoplay-with-controls.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "autoplay-with-controls.html"; sourceTree = "<group>"; };1284 C99B675B1E3971FC00FC6C80 /* js-play-with-controls.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "js-play-with-controls.html"; sourceTree = "<group>"; };1285 C99B675E1E39735C00FC6C80 /* no-autoplay-with-controls.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "no-autoplay-with-controls.html"; sourceTree = "<group>"; };1286 1277 CD225C071C45A69200140761 /* ParsedContentRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentRange.cpp; sourceTree = "<group>"; }; 1287 1278 CD5393C71757BA9700C07123 /* MD5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MD5.cpp; sourceTree = "<group>"; }; … … 1971 1962 C95984F21E36BC55002C0D45 /* autoplay-check.html */, 1972 1963 C95984F31E36BC55002C0D45 /* autoplay-no-audio-check.html */, 1973 C99B675A1E3971FC00FC6C80 /* autoplay-with-controls.html */,1974 1964 7C486BA01AA1254B003F6F9B /* bundle-file.html */, 1975 1965 9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */, … … 1992 1982 BCBD372E125ABBE600D2C29F /* icon.png */, 1993 1983 CE3524F51B142BBB0028A7C5 /* input-focus-blur.html */, 1994 C99B675B1E3971FC00FC6C80 /* js-play-with-controls.html */,1995 1984 8349D3C31DB9724F004A9F65 /* link-with-download-attribute.html */, 1996 1985 378E647816326FDF00B6C676 /* link-with-title.html */, … … 2003 1992 7A1458FB1AD5C03500E06772 /* mouse-button-listener.html */, 2004 1993 33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */, 2005 C99B675E1E39735C00FC6C80 /* no-autoplay-with-controls.html */,2006 1994 CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */, 2007 1995 F6FDDDD514241C48004F1729 /* push-state.html */, -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm
r211193 r211200 40 40 #if WK_API_ENABLED 41 41 42 @interface WKWebView ()43 - (WKPageRef)_pageForTesting;44 @end45 46 42 static bool doneCompiling; 47 43 static bool receivedAlert; … … 218 214 } 219 215 220 #if PLATFORM(MAC)221 static void didPlayMediaPreventedFromPlayingWithoutUserGesture(WKPageRef page, const void* clientInfo)222 {223 receivedAlert = true;224 }225 226 TEST(WebKit2, WebsitePoliciesPlayAfterPreventedAutoplay)227 {228 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);229 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 336, 276) configuration:configuration.get()]);230 231 auto delegate = adoptNS([[AutoplayPoliciesDelegate alloc] init]);232 [delegate setAutoplayPolicy:_WKWebsiteAutoplayPolicyDeny];233 [webView setNavigationDelegate:delegate.get()];234 235 WKPageUIClientV8 uiClient;236 memset(&uiClient, 0, sizeof(uiClient));237 238 uiClient.base.version = 8;239 uiClient.didPlayMediaPreventedFromPlayingWithoutUserGesture = didPlayMediaPreventedFromPlayingWithoutUserGesture;240 241 WKPageSetPageUIClient([webView _pageForTesting], &uiClient.base);242 NSPoint playButtonClickPoint = NSMakePoint(20, 256);243 244 receivedAlert = false;245 NSURLRequest *jsPlayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"js-play-with-controls" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];246 [webView loadRequest:jsPlayRequest];247 [webView waitForMessage:@"loaded"];248 [webView mouseDownAtPoint:playButtonClickPoint simulatePressure:NO];249 [webView mouseUpAtPoint:playButtonClickPoint];250 TestWebKitAPI::Util::run(&receivedAlert);251 252 receivedAlert = false;253 [webView loadHTMLString:@"" baseURL:nil];254 255 NSURLRequest *autoplayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"autoplay-with-controls" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];256 [webView loadRequest:autoplayRequest];257 [webView waitForMessage:@"loaded"];258 [webView mouseDownAtPoint:playButtonClickPoint simulatePressure:NO];259 [webView mouseUpAtPoint:playButtonClickPoint];260 TestWebKitAPI::Util::run(&receivedAlert);261 262 receivedAlert = false;263 [webView loadHTMLString:@"" baseURL:nil];264 265 NSURLRequest *noAutoplayRequest = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"no-autoplay-with-controls" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];266 [webView loadRequest:noAutoplayRequest];267 [webView waitForMessage:@"loaded"];268 [webView mouseDownAtPoint:playButtonClickPoint simulatePressure:NO];269 [webView mouseUpAtPoint:playButtonClickPoint];270 [webView waitForMessage:@"played"];271 ASSERT_FALSE(receivedAlert);272 }273 216 #endif 274 275 #endif -
trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h
r211193 r211200 45 45 // Simulates clicking with a pressure-sensitive device, if possible. 46 46 - (void)mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure; 47 - (void)mouseUpAtPoint:(NSPoint)point;48 47 - (void)typeCharacter:(char)character; 49 48 @end -
trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm
r211193 r211200 121 121 #endif 122 122 } 123 124 - (void)_mouseUpAtPoint:(NSPoint)point125 {126 [self sendEvent:[NSEvent mouseEventWithType:NSEventTypeLeftMouseUp location:point modifierFlags:0 timestamp:GetCurrentEventTime() windowNumber:self.windowNumber context:[NSGraphicsContext currentContext] eventNumber:++gEventNumber clickCount:1 pressure:0]];127 }128 123 #endif // PLATFORM(MAC) 129 124 … … 256 251 } 257 252 258 - (void)mouseUpAtPoint:(NSPoint)point259 {260 [_hostWindow _mouseUpAtPoint:point];261 }262 263 253 - (void)typeCharacter:(char)character { 264 254 NSString *characterAsString = [NSString stringWithFormat:@"%c" , character]; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r211193 r211200 280 280 requestPointerLock, 281 281 0, 282 0, // didPlayMediaPreventedFromPlayingWithoutUserGesture283 282 }; 284 283 WKPageSetPageUIClient(newPage, &otherPageUIClient.base); … … 553 552 requestPointerLock, 554 553 0, 555 0, // didPlayMediaPreventedFromPlayingWithoutUserGesture556 554 }; 557 555 WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient.base);
Note: See TracChangeset
for help on using the changeset viewer.