Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c1ebfc04931c043f873caf92a7af3ca0e4b02ba
      
https://github.com/WebKit/WebKit/commit/0c1ebfc04931c043f873caf92a7af3ca0e4b02ba
  Author: Andy Estes <[email protected]>
  Date:   2026-09-01 (Tue, 01 Sep 2026)

  Changed paths:
    A 
LayoutTests/http/tests/media/airplay-picker-rect-in-cross-origin-iframe-expected.txt
    A 
LayoutTests/http/tests/media/airplay-picker-rect-in-cross-origin-iframe.html
    A 
LayoutTests/http/tests/media/airplay-select-target-in-cross-origin-iframe-expected.txt
    A 
LayoutTests/http/tests/media/airplay-select-target-in-cross-origin-iframe.html
    A 
LayoutTests/http/tests/media/airplay-target-availability-in-cross-origin-iframe-expected.txt
    A 
LayoutTests/http/tests/media/airplay-target-availability-in-cross-origin-iframe.html
    A 
LayoutTests/http/tests/media/resources/airplay-picker-rect-in-cross-origin-iframe-frame.html
    A 
LayoutTests/http/tests/media/resources/airplay-select-target-in-cross-origin-iframe-frame.html
    A 
LayoutTests/http/tests/media/resources/airplay-target-availability-in-cross-origin-iframe-frame.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/Modules/airplay/WebMediaSessionManager.h
    M Source/WebCore/Modules/airplay/WebMediaSessionManager.mm
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/page/ChromeClient.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp
    M Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm

  Log Message:
  -----------
  [macOS] AirPlay target pickers are non-functional in Site Isolated frames
https://bugs.webkit.org/show_bug.cgi?id=323118
rdar://138912349

Reviewed by Jer Noble.

A page can observe AirPlay device availability by listening for
webkitplaybacktargetavailabilitychanged, or through remote.watchAvailability(), 
and our built-in
media controls use these mechanisms to decide whether to show an AirPlay 
button. On macOS
WebPageProxy is ultimately responsible for observing playback target 
availability, and when an
AirPlay button is clicked, is responsible for presenting the target picker. 
However, it would
always send messages (e.g., changes in availability, route selection) to the 
main frame WebContent
process. If the observing page were in a Site Isolated process it would never 
receive these
messages.

Fixing this bug (by teaching WebPageProxy to send playback target messages to 
the correct
WebContent process) uncovered two additional bugs:
1. WebChromeClient::showPlaybackTargetPicker returned early when there was no 
local main frame
   view.
2. Mouse events were in the wrong coordinate space when passed from a Site 
Isolated WebContent
   process to the UI process, resulting in the target picker appearing at the 
wrong location.

Addressed these issues by removing the early return and passing a frameID to 
the UI process
instead, which can then convert the mouse event coordinates to main frame 
coordinates before
presenting the target picker.

Tests: http/tests/media/airplay-picker-rect-in-cross-origin-iframe.html
       http/tests/media/airplay-select-target-in-cross-origin-iframe.html
       http/tests/media/airplay-target-availability-in-cross-origin-iframe.html

* 
LayoutTests/http/tests/media/airplay-picker-rect-in-cross-origin-iframe-expected.txt:
 Added.
* LayoutTests/http/tests/media/airplay-picker-rect-in-cross-origin-iframe.html: 
Added.
* 
LayoutTests/http/tests/media/airplay-select-target-in-cross-origin-iframe-expected.txt:
 Added.
* 
LayoutTests/http/tests/media/airplay-select-target-in-cross-origin-iframe.html: 
Added.
* 
LayoutTests/http/tests/media/airplay-target-availability-in-cross-origin-iframe-expected.txt:
 Added.
* 
LayoutTests/http/tests/media/airplay-target-availability-in-cross-origin-iframe.html:
 Added.
* 
LayoutTests/http/tests/media/resources/airplay-picker-rect-in-cross-origin-iframe-frame.html:
 Added.
* 
LayoutTests/http/tests/media/resources/airplay-select-target-in-cross-origin-iframe-frame.html:
 Added.
* 
LayoutTests/http/tests/media/resources/airplay-target-availability-in-cross-origin-iframe-frame.html:
 Added.
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/Modules/airplay/WebMediaSessionManager.h:
* Source/WebCore/Modules/airplay/WebMediaSessionManager.mm:
(WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerRect):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::showPlaybackTargetPicker):
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::showPlaybackTargetPicker):
(WebCore::ChromeClient::mockMediaPlaybackTargetPickerRect):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::showPlaybackTargetPicker):
(WebCore::Page::mockMediaPlaybackTargetPickerRect):
* Source/WebCore/page/Page.h:
* Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
* Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::mockMediaPlaybackTargetPickerRect):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::mockMediaPlaybackTargetPickerRect):
(WebKit::sendToPlaybackTargetClientProcess):
(WebKit::WebPageProxy::Internals::setPlaybackTarget):
(WebKit::WebPageProxy::Internals::externalOutputDeviceAvailableDidChange):
(WebKit::WebPageProxy::Internals::setShouldPlayToPlaybackTarget):
(WebKit::WebPageProxy::Internals::playbackTargetPickerWasDismissed):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::showPlaybackTargetPicker):
(WebKit::WebChromeClient::mockMediaPlaybackTargetPickerRect):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::showPlaybackTargetPicker):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to