https://bugs.webkit.org/show_bug.cgi?id=227924
Reviewed by Sam Weinig.
LayoutTests/imported/w3c:
Rebaseline WPT tests now that more tests are running and we are passing more checks.
* web-platform-tests/FileAPI/url/url-in-tags-revoke.window-expected.txt:
* web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window-expected.txt:
* web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt:
* web-platform-tests/html/browsers/the-window-object/window-open-noreferrer-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/report-only-require-corp.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt:
* web-platform-tests/html/dom/idlharness.worker-expected.txt:
* web-platform-tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-target/rel-base-target-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-target/rel-button-target-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-target/rel-form-target-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-target/rel-input-target-expected.txt:
* web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener-expected.txt:
* web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt:
* web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt:
* web-platform-tests/wasm/serialization/module/broadcastchannel-success-and-failure-expected.txt:
* web-platform-tests/wasm/serialization/module/broadcastchannel-success-expected.txt:
* web-platform-tests/webmessaging/MessageEvent-trusted.any-expected.txt:
* web-platform-tests/webmessaging/MessageEvent-trusted.any.worker-expected.txt:
* web-platform-tests/webmessaging/broadcastchannel/basics-expected.txt: Removed.
* web-platform-tests/webmessaging/broadcastchannel/basics.any-expected.txt:
* web-platform-tests/webmessaging/broadcastchannel/basics.any.worker-expected.txt:
* web-platform-tests/webmessaging/broadcastchannel/blobs-expected.txt:
* web-platform-tests/webmessaging/broadcastchannel/interface-expected.txt: Removed.
* web-platform-tests/webmessaging/broadcastchannel/interface.any-expected.txt:
* web-platform-tests/webmessaging/broadcastchannel/interface.any.worker-expected.txt:
* web-platform-tests/webmessaging/broadcastchannel/sandbox-expected.txt:
* web-platform-tests/webmessaging/broadcastchannel/workers-expected.txt: Added.
* web-platform-tests/webmessaging/multi-globals/broadcastchannel-current.sub-expected.txt:
* web-platform-tests/webstorage/storage_session_window_noopener.window-expected.txt:
* web-platform-tests/workers/semantics/interface-objects/001.worker-expected.txt:
Source/WebCore:
Add initial support for BroadcastChannel behind a runtime flag, off by default:
- https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts
Both Firefox and Blink have been supporting BroadcastChannel for a long time.
The implementation is complete and spec-compliant. It works both in Window and Worker environments,
in WebKit1 and WebKit2. However, the feature is off-by-default because of privacy concerns that have
not been addresssed yet:
- https://github.com/whatwg/html/issues/5803
We should be able to add partioning to address the privacy concerns and ship this later on. In the mean
time though, having a working BroadcastChannel implementation in the context of layout tests is already
very useful because a lot of Web-Platform-Tests are relying on it to test other Web features. This means
better test coverage for WebKit.
Tests:
- fast/html/broadcast-channel-between-different-sessions.html
- Rebaselined WPT tests
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/BroadcastChannel.cpp: Added.
(WebCore::channelToContextIdentifier):
(WebCore::BroadcastChannel::BroadcastChannel):
(WebCore::BroadcastChannel::~BroadcastChannel):
(WebCore::BroadcastChannel::postMessage):
(WebCore::BroadcastChannel::close):
(WebCore::BroadcastChannel::dispatchMessageTo):
(WebCore::BroadcastChannel::dispatchMessage):
(WebCore::BroadcastChannel::ensureOnMainThread):
(WebCore::BroadcastChannel::activeDOMObjectName const):
(WebCore::BroadcastChannel::eventListenersDidChange):
(WebCore::BroadcastChannel::virtualHasPendingActivity const):
* dom/BroadcastChannel.h: Added.
(WebCore::BroadcastChannel::create):
(WebCore::BroadcastChannel::identifier const):
(WebCore::BroadcastChannel::name const):
* dom/BroadcastChannel.idl: Added.
* dom/BroadcastChannelIdentifier.h: Added.
* dom/BroadcastChannelRegistry.h: Added.
(WebCore::BroadcastChannelRegistry::~BroadcastChannelRegistry):
* dom/DeviceOrientationAndMotionAccessController.h:
* dom/DeviceOrientationEvent.cpp:
* dom/DeviceOrientationEvent.h:
* dom/EventTargetFactory.in:
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setBroadcastChannelRegistry):
* page/Page.h:
(WebCore::Page::broadcastChannelRegistry):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
Source/WebKit:
Add initial support for BroadcastChannel behind a runtime flag, off by default:
- https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts
Both Firefox and Blink have been supporting BroadcastChannel for a long time.
The implementation is complete and spec-compliant. It works both in Window and Worker environments,
in WebKit1 and WebKit2. However, the feature is off-by-default because of privacy concerns that have
not been addresssed yet:
- https://github.com/whatwg/html/issues/5803
We should be able to add partioning to address the privacy concerns and ship this later on. In the mean
time though, having a working BroadcastChannel implementation in the context of layout tests is already
very useful because a lot of Web-Platform-Tests are relying on it to test other Web features. This means
better test coverage for WebKit.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* NetworkProcess/Downloads/DownloadManager.cpp:
* NetworkProcess/NetworkBroadcastChannelRegistry.cpp: Added.
(WebKit::NetworkBroadcastChannelRegistry::registerChannel):
(WebKit::NetworkBroadcastChannelRegistry::unregisterChannel):
(WebKit::NetworkBroadcastChannelRegistry::postMessage):
(WebKit::NetworkBroadcastChannelRegistry::removeConnection):
* NetworkProcess/NetworkBroadcastChannelRegistry.h: Added.
(WebKit::NetworkBroadcastChannelRegistry::GlobalBroadcastChannelIdentifier::operator== const):
* NetworkProcess/NetworkBroadcastChannelRegistry.messages.in: Added.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didClose):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::broadcastChannelRegistry):
* Scripts/webkit/messages.py:
(types_that_cannot_be_forward_declared):
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
* WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp: Added.
(WebKit::networkProcessConnection):
(WebKit::WebBroadcastChannelRegistry::registerChannel):
(WebKit::WebBroadcastChannelRegistry::unregisterChannel):
(WebKit::WebBroadcastChannelRegistry::postMessage):
(WebKit::WebBroadcastChannelRegistry::postMessageToRemote):
* WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h: Added.
* WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.messages.in: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_appHighlightsVisible):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::broadcastChannelRegistry):
Source/WebKitLegacy:
Add BroadcastChannelRegistry implementation for WebKitLegacy.
* Sources.txt:
* WebCoreSupport/WebBroadcastChannelRegistry.cpp: Added.
(WebBroadcastChannelRegistry::getOrCreate):
(WebBroadcastChannelRegistry::registerChannel):
(WebBroadcastChannelRegistry::unregisterChannel):
(WebBroadcastChannelRegistry::postMessage):
* WebCoreSupport/WebBroadcastChannelRegistry.h: Added.
* WebKitLegacy.xcodeproj/project.pbxproj:
Source/WebKitLegacy/mac:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _preferencesChanged:]):
Source/WebKitLegacy/win:
* WebView.cpp:
(WebView::initWithFrame):
(WebView::notifyPreferencesChanged):
Source/WTF:
Add experimental feature flag for BroadcastChannel, off by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
LayoutTests:
* TestExpectations:
* fast/html/broadcast-channel-between-different-sessions-expected.txt: Added.
* fast/html/broadcast-channel-between-different-sessions.html: Added.
* fast/html/resources/broadcast-channel-between-different-sessions-window.html: Added.
Add layout test coverage to make sure that windows belonging to different session are unable to communicate
via BroadcastChannel.
* platform/ios-wk2/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt.
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener-expected.txt: Added.
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/win/TestExpectations:
* platform/wk2/TestExpectations:
Update test expectations now that we support BroadcastChannel.
Canonical link: https://commits.webkit.org/239714@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279971 268f45cc-cd09-0410-ab3c-d52691b4dbfc