haikuwebkit/LayoutTests/imported/w3c/web-platform-tests/webstorage
Chris Dumez 56f3b39fde Add initial support for BroadcastChannel behind a runtime flag
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
2021-07-16 00:36:39 +00:00
..
resources
META.yml
README.md
defineProperty.window-expected.txt
defineProperty.window.html
defineProperty.window.js
document-domain-expected.txt
document-domain.html
eventTestHarness.js
event_basic-expected.txt
event_basic.html
event_basic.js
event_body_attribute-expected.txt
event_body_attribute.html
event_body_attribute.js
event_case_sensitive-expected.txt
event_case_sensitive.html
event_case_sensitive.js
event_constructor.window-expected.txt
event_constructor.window.html
event_constructor.window.js
event_initstorageevent.window-expected.txt
event_initstorageevent.window.html
event_initstorageevent.window.js
event_local_key-expected.txt
event_local_key.html
event_local_newvalue-expected.txt
event_local_newvalue.html
event_local_oldvalue-expected.txt
event_local_oldvalue.html
event_local_removeitem-expected.txt
event_local_removeitem.html
event_local_storagearea-expected.txt
event_local_storagearea.html
event_local_url-expected.txt
event_local_url.html
event_no_duplicates-expected.txt
event_no_duplicates.html
event_session_key-expected.txt
event_session_key.html
event_session_newvalue-expected.txt
event_session_newvalue.html
event_session_oldvalue-expected.txt
event_session_oldvalue.html
event_session_removeitem-expected.txt
event_session_removeitem.html
event_session_storagearea-expected.txt
event_session_storagearea.html
event_session_url-expected.txt
event_session_url.html
event_setattribute-expected.txt
event_setattribute.html
event_setattribute.js
missing_arguments.window-expected.txt
missing_arguments.window.html
missing_arguments.window.js
set.window-expected.txt
set.window.html
set.window.js
storage_builtins.window-expected.txt
storage_builtins.window.html
storage_builtins.window.js
storage_clear.window-expected.txt
storage_clear.window.html
storage_clear.window.js
storage_enumerate.window-expected.txt
storage_enumerate.window.html
storage_enumerate.window.js
storage_functions_not_overwritten.window-expected.txt
storage_functions_not_overwritten.window.html
storage_functions_not_overwritten.window.js
storage_getitem.window-expected.txt
storage_getitem.window.html
storage_getitem.window.js
storage_in.window-expected.txt
storage_in.window.html
storage_in.window.js
storage_indexing.window-expected.txt
storage_indexing.window.html
storage_indexing.window.js
storage_key.window-expected.txt
storage_key.window.html
storage_key.window.js
storage_key_empty_string.window-expected.txt
storage_key_empty_string.window.html
storage_key_empty_string.window.js
storage_length.window-expected.txt
storage_length.window.html
storage_length.window.js
storage_local_setitem_quotaexceedederr.window-expected.txt
storage_local_setitem_quotaexceedederr.window.html
storage_local_setitem_quotaexceedederr.window.js
storage_local_window_open.window-expected.txt
storage_local_window_open.window.html
storage_local_window_open.window.js
storage_removeitem.window-expected.txt
storage_removeitem.window.html
storage_removeitem.window.js
storage_session_setitem_quotaexceedederr.window.html
storage_session_setitem_quotaexceedederr.window.js
storage_session_window_noopener.window-expected.txt
storage_session_window_noopener.window.html
storage_session_window_noopener.window.js
storage_session_window_open.window-expected.txt
storage_session_window_open.window.html
storage_session_window_open.window.js
storage_set_value_enumerate.window-expected.txt
storage_set_value_enumerate.window.html
storage_set_value_enumerate.window.js
storage_setitem.window-expected.txt
storage_setitem.window.html
storage_setitem.window.js
storage_string_conversion.window-expected.txt
storage_string_conversion.window.html
storage_string_conversion.window.js
storage_supported_property_names.window-expected.txt
storage_supported_property_names.window.html
storage_supported_property_names.window.js
symbol-props.window-expected.txt
symbol-props.window.html
symbol-props.window.js
w3c-import.log

README.md

These are the storage (localStorage, sessionStorage) tests for the Web storage chapter of the HTML Standard.

IDL is covered by /html/dom/idlharness.https.html.