Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ec9c5dbe3501425a942c3e0c969802c2998be98e
      
https://github.com/WebKit/WebKit/commit/ec9c5dbe3501425a942c3e0c969802c2998be98e
  Author: Andy Estes <aes...@apple.com>
  Date:   2024-07-31 (Wed, 31 Jul 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingSession.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/large-video-test-now-playing.html

  Log Message:
  -----------
  _hasActiveNowPlayingSession incorrectly set to NO when a subframe navigation 
occurs
https://bugs.webkit.org/show_bug.cgi?id=277404
rdar://131082146

Reviewed by Jean-Yves Avenard.

WebPageProxy::didCommitLoadForFrame would set WKWebView's 
_hasActiveNowPlayingSession property to
NO when a load committed in *any* frame, even if that frame was not playing 
media. Furthermore, it
would be set to NO during a same-document navigation even if the navigation did 
not stop media
playback.

To correct these two mistakes, moved the call to 
PageClient::hasActiveNowPlayingSessionChanged from
WebPageProxy::didCommitLoadForFrame to WebPageProxy::didChangeMainDocument and 
ensured that it's
only called on the main frame.

Added API tests.

* Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::hasActiveNowPlayingSessionChanged):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didChangeMainDocument):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingSession.mm:
(TEST(NowPlayingSession, NavigateToFragmentAfterHasSession)):
(TEST(NowPlayingSession, LoadSubframeAfterHasSession)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/large-video-test-now-playing.html:

Canonical link: https://commits.webkit.org/281664@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to