Changeset 211200 in webkit


Ignore:
Timestamp:
Jan 25, 2017 8:24:10 PM (7 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r211193.

This change broke internal builds.

Reverted changeset:

"Notify clients when the user plays media otherwise prevented
from autoplaying"
https://bugs.webkit.org/show_bug.cgi?id=167390
http://trac.webkit.org/changeset/211193

Location:
trunk
Files:
3 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211199 r211200  
     12017-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
    1142017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r211193 r211200  
    31683168
    31693169    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.
    31723171        m_preventedFromPlayingWithoutUserGesture = false;
    31733172    }
  • trunk/Source/WebCore/page/ChromeClient.h

    r211193 r211200  
    421421
    422422    virtual void isPlayingMediaDidChange(MediaProducer::MediaStateFlags, uint64_t) { }
    423     virtual void didPlayMediaPreventedFromPlayingWithoutUserGesture() { }
    424423
    425424#if ENABLE(MEDIA_SESSION)
  • trunk/Source/WebKit2/ChangeLog

    r211199 r211200  
     12017-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
    1142017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/APIUIClient.h

    r211193 r211200  
    153153    virtual void didBeginCaptureSession() { }
    154154    virtual void didEndCaptureSession() { }
    155     virtual void didPlayMediaPreventedFromPlayingWithoutUserGesture(WebKit::WebPageProxy&) { }
    156155
    157156#if ENABLE(MEDIA_SESSION)
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r211193 r211200  
    22362236        }
    22372237#endif
    2238 
    2239         void didPlayMediaPreventedFromPlayingWithoutUserGesture(WebPageProxy& page) override
    2240         {
    2241             if (!m_client.didPlayMediaPreventedFromPlayingWithoutUserGesture)
    2242                 return;
    2243 
    2244             m_client.didPlayMediaPreventedFromPlayingWithoutUserGesture(toAPI(&page), m_client.base.clientInfo);
    2245         }
    22462238    };
    22472239
  • trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h

    r211193 r211200  
    103103typedef void (*WKPageDidClickAutoFillButtonCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
    104104typedef void (*WKPageMediaSessionMetadataDidChangeCallback)(WKPageRef page, WKMediaSessionMetadataRef metadata, const void* clientInfo);
    105 typedef void (*WKDidPlayMediaPreventedFromPlayingWithoutUserGesture)(WKPageRef page, const void* clientInfo);
    106105typedef void (*WKFullscreenMayReturnToInlineCallback)(WKPageRef page, const void* clientInfo);
    107106
     
    727726    WKRequestPointerLockCallback                                        requestPointerLock;
    728727    WKDidLosePointerLockCallback                                        didLosePointerLock;
    729     WKDidPlayMediaPreventedFromPlayingWithoutUserGesture                didPlayMediaPreventedFromPlayingWithoutUserGesture;
    730728} WKPageUIClientV8;
    731729   
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r211193 r211200  
    65286528#endif
    65296529
    6530 void WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture()
    6531 {
    6532     m_uiClient->didPlayMediaPreventedFromPlayingWithoutUserGesture(*this);
    6533 }
    6534 
    65356530#if PLATFORM(MAC)
    65366531void WebPageProxy::removeNavigationGestureSnapshot()
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r211199 r211200  
    10631063    bool hasActiveVideoStream() const { return m_mediaState & WebCore::MediaProducer::HasActiveVideoCaptureDevice; }
    10641064    WebCore::MediaProducer::MediaStateFlags mediaStateFlags() const { return m_mediaState; }
    1065     void didPlayMediaPreventedFromPlayingWithoutUserGesture();
    10661065
    10671066#if PLATFORM(MAC)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r211199 r211200  
    444444
    445445    IsPlayingMediaDidChange(unsigned state, uint64_t sourceElementID)
    446     DidPlayMediaPreventedFromPlayingWithoutUserGesture()
    447446
    448447#if ENABLE(MEDIA_SESSION)
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r211193 r211200  
    10851085}
    10861086
    1087 void WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture()
    1088 {
    1089     m_page.send(Messages::WebPageProxy::DidPlayMediaPreventedFromPlayingWithoutUserGesture());
    1090 }
    1091 
    10921087#if ENABLE(MEDIA_SESSION)
    10931088
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r211193 r211200  
    298298
    299299    void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t) final;
    300     void didPlayMediaPreventedFromPlayingWithoutUserGesture() final;
    301300
    302301#if ENABLE(MEDIA_SESSION)
  • trunk/Tools/ChangeLog

    r211193 r211200  
     12017-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
    1142017-01-25  Matt Rajca  <mrajca@apple.com>
    215
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r211193 r211200  
    510510                C95984F51E36BC6B002C0D45 /* autoplay-no-audio-check.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C95984F31E36BC55002C0D45 /* autoplay-no-audio-check.html */; };
    511511                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 */; };
    515512                CD59F53419E9110D00CF1835 /* file-with-mse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53219E910AA00CF1835 /* file-with-mse.html */; };
    516513                CD59F53519E9110D00CF1835 /* test-mse.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53319E910BC00CF1835 /* test-mse.mp4 */; };
     
    611608                        dstSubfolderSpec = 7;
    612609                        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 */,
    616610                                C95984F71E36BCEF002C0D45 /* test-without-audio-track.mp4 in Copy Resources */,
    617611                                C95984F41E36BC6B002C0D45 /* autoplay-check.html in Copy Resources */,
     
    12811275                C95984F31E36BC55002C0D45 /* autoplay-no-audio-check.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "autoplay-no-audio-check.html"; sourceTree = "<group>"; };
    12821276                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>"; };
    12861277                CD225C071C45A69200140761 /* ParsedContentRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentRange.cpp; sourceTree = "<group>"; };
    12871278                CD5393C71757BA9700C07123 /* MD5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MD5.cpp; sourceTree = "<group>"; };
     
    19711962                                C95984F21E36BC55002C0D45 /* autoplay-check.html */,
    19721963                                C95984F31E36BC55002C0D45 /* autoplay-no-audio-check.html */,
    1973                                 C99B675A1E3971FC00FC6C80 /* autoplay-with-controls.html */,
    19741964                                7C486BA01AA1254B003F6F9B /* bundle-file.html */,
    19751965                                9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */,
     
    19921982                                BCBD372E125ABBE600D2C29F /* icon.png */,
    19931983                                CE3524F51B142BBB0028A7C5 /* input-focus-blur.html */,
    1994                                 C99B675B1E3971FC00FC6C80 /* js-play-with-controls.html */,
    19951984                                8349D3C31DB9724F004A9F65 /* link-with-download-attribute.html */,
    19961985                                378E647816326FDF00B6C676 /* link-with-title.html */,
     
    20031992                                7A1458FB1AD5C03500E06772 /* mouse-button-listener.html */,
    20041993                                33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */,
    2005                                 C99B675E1E39735C00FC6C80 /* no-autoplay-with-controls.html */,
    20061994                                CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */,
    20071995                                F6FDDDD514241C48004F1729 /* push-state.html */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm

    r211193 r211200  
    4040#if WK_API_ENABLED
    4141
    42 @interface WKWebView ()
    43 - (WKPageRef)_pageForTesting;
    44 @end
    45 
    4642static bool doneCompiling;
    4743static bool receivedAlert;
     
    218214}
    219215
    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 }
    273216#endif
    274 
    275 #endif
  • trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h

    r211193 r211200  
    4545// Simulates clicking with a pressure-sensitive device, if possible.
    4646- (void)mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure;
    47 - (void)mouseUpAtPoint:(NSPoint)point;
    4847- (void)typeCharacter:(char)character;
    4948@end
  • trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

    r211193 r211200  
    121121#endif
    122122}
    123 
    124 - (void)_mouseUpAtPoint:(NSPoint)point
    125 {
    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 }
    128123#endif // PLATFORM(MAC)
    129124
     
    256251}
    257252
    258 - (void)mouseUpAtPoint:(NSPoint)point
    259 {
    260     [_hostWindow _mouseUpAtPoint:point];
    261 }
    262 
    263253- (void)typeCharacter:(char)character {
    264254    NSString *characterAsString = [NSString stringWithFormat:@"%c" , character];
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r211193 r211200  
    280280        requestPointerLock,
    281281        0,
    282         0, // didPlayMediaPreventedFromPlayingWithoutUserGesture
    283282    };
    284283    WKPageSetPageUIClient(newPage, &otherPageUIClient.base);
     
    553552        requestPointerLock,
    554553        0,
    555         0, // didPlayMediaPreventedFromPlayingWithoutUserGesture
    556554    };
    557555    WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient.base);
Note: See TracChangeset for help on using the changeset viewer.