haikuwebkit/LayoutTests/fast/html
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 Add initial support for BroadcastChannel behind a runtime flag 2021-07-16 00:36:39 +00:00
HTMLEmbedElement_without_parent_renderer_assert_crash-expected.txt
HTMLEmbedElement_without_parent_renderer_assert_crash.html Missing null-check of parent renderer in WebCore::HTMLEmbedElement::rendererIsNeeded() 2013-08-27 17:20:28 +00:00
adjacent-html-context-element-expected.txt
adjacent-html-context-element.html
adopt-parent-frame-expected.txt
adopt-parent-frame.html
article-element-expected.txt
article-element.html
aside-element-expected.txt
aside-element.html
body-offset-properties-expected.txt
body-offset-properties.html
broadcast-channel-between-different-sessions-expected.txt Add initial support for BroadcastChannel behind a runtime flag 2021-07-16 00:36:39 +00:00
broadcast-channel-between-different-sessions.html Add initial support for BroadcastChannel behind a runtime flag 2021-07-16 00:36:39 +00:00
clone-keygen-expected.txt
clone-keygen.html [Testing] Rename test header commands to match names in WebPreferences*.yaml 2020-10-13 17:16:15 +00:00
clone-range-expected.txt
clone-range.html
crash-style-first-letter-expected.txt
crash-style-first-letter.html
detach-frame-while-clicking-on-anchor-with-ping-expected.txt
detach-frame-while-clicking-on-anchor-with-ping.html
details-add-child-1.html
details-add-child-2.html
details-add-details-child-1.html
details-add-details-child-2.html
details-add-summary-1-and-click.html
details-add-summary-1.html
details-add-summary-2-and-click.html
details-add-summary-2.html
details-add-summary-3-and-click.html
details-add-summary-3.html
details-add-summary-4-and-click.html
details-add-summary-4.html
details-add-summary-5-and-click.html
details-add-summary-5.html
details-add-summary-6-and-click.html
details-add-summary-6.html
details-add-summary-7-and-click.html
details-add-summary-7.html
details-add-summary-8-and-click.html
details-add-summary-8.html
details-add-summary-9-and-click.html
details-add-summary-9.html
details-add-summary-10-and-click.html
details-add-summary-10.html
details-add-summary-child-1.html
details-add-summary-child-2.html
details-children-merge-crash-expected.txt
details-children-merge-crash.html
details-click-controls-expected.txt
details-click-controls.html
details-clone-expected.txt
details-clone.html
details-close-modify-open-expected.html
details-close-modify-open.html
details-comment-crash-expected.html
details-comment-crash.html
details-edit-expected.txt
details-edit.html
details-element-render-inline-crash-expected.txt
details-element-render-inline-crash.html
details-flow-thread-expected.txt
details-flow-thread.html
details-inline-expected.html
details-inline.html
details-keyboard-show-hide-expected.txt
details-keyboard-show-hide.html
details-line-height-overlap-expected.html
details-line-height-overlap.html
details-marker-style-mixed.html LayoutTests/imported/w3c: 2020-03-25 17:03:50 +00:00
details-marker-style.html LayoutTests/imported/w3c: 2020-03-25 17:03:50 +00:00
details-mathml-crash-expected.txt
details-mathml-crash.html
details-mouse-click-expected.txt
details-mouse-click.html
details-nested-1.html
details-nested-2.html
details-no-summary1.html
details-no-summary2.html
details-no-summary3.html
details-no-summary4.html
details-open-javascript.html
details-open1.html
details-open2.html
details-open3.html
details-open4.html
details-open5.html
details-open6.html
details-position.html
details-remove-child-1.html
details-remove-child-2.html
details-remove-summary-1-and-click.html
details-remove-summary-1.html
details-remove-summary-2-and-click.html
details-remove-summary-2.html
details-remove-summary-3-and-click.html
details-remove-summary-3.html
details-remove-summary-4-and-click.html
details-remove-summary-4.html
details-remove-summary-5-and-click.html
details-remove-summary-5.html
details-remove-summary-6-and-click.html
details-remove-summary-6.html
details-remove-summary-child-1.html
details-remove-summary-child-2.html
details-replace-summary-child.html
details-replace-text.html
details-set-inner-text-crash-expected.txt REGRESSION(r272900): Nullptr crash in ComposedTreeIterator::traverseNextInShadowTree() via ShadowRoot::hostChildElementDidChange 2021-03-08 08:59:22 +00:00
details-set-inner-text-crash.html REGRESSION(r272900): Nullptr crash in ComposedTreeIterator::traverseNextInShadowTree() via ShadowRoot::hostChildElementDidChange 2021-03-08 08:59:22 +00:00
details-summary-document-child-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
details-summary-document-child.html
details-summary-slot-expected.html
details-summary-slot.html
details-summary-tabindex-crash-expected.txt
details-summary-tabindex-crash.html
details-writing-mode-mixed.html LayoutTests/imported/w3c: 2020-03-25 17:03:50 +00:00
details-writing-mode.html LayoutTests/imported/w3c: 2020-03-25 17:03:50 +00:00
disable-style-element-expected.txt
disable-style-element.html
draggable-expected.txt
draggable.html
empty-fragment-id-goto-top-expected.txt
empty-fragment-id-goto-top.html
figcaption-element-expected.txt
figcaption-element.html
figure-element-expected.txt
figure-element.html
font-face-empty-should-not-crash-expected.txt
font-face-empty-should-not-crash.html
font-weight-bold-for-b-and-strong.html
footer-element-expected.txt
footer-element.html
form-mutate-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
form-mutate.html
form-registerimg-multiple-crash-expected.txt
form-registerimg-multiple-crash.html
header-element-expected.txt
header-element.html
hgroup-element-expected.txt
hgroup-element.html
hidden-attr-dom-expected.txt
hidden-attr-dom.html
hidden-attr-expected.txt
hidden-attr.html
image-element-serialization-expected.txt
image-element-serialization.html
input-type-change-crash-expected.txt
input-type-change-crash.html
keygen.html [Testing] Rename test header commands to match names in WebPreferences*.yaml 2020-10-13 17:16:15 +00:00
link-rel-stylesheet.html WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs 2020-10-05 19:36:22 +00:00
listing.html
main-element-expected.txt
main-element.html
mark-element-expected.txt
mark-element.html
marquee-alternate-expected.txt
marquee-alternate.html
marquee-child-wrap-expected.html
marquee-child-wrap.html
marquee-element-expected.txt
marquee-element.html
marquee-reparent-check-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
marquee-reparent-check.html [Testing] Rename test header commands to match names in WebPreferences*.yaml 2020-10-13 17:16:15 +00:00
marquee-scroll-expected.html
marquee-scroll.html
marquee-scrollamount-expected.html
marquee-scrollamount.html
marquee-set-truespeed-expected.html
marquee-set-truespeed.html
menuitem-element-expected.txt
menuitem-element.html [Testing] Rename test header commands to match names in WebPreferences*.yaml 2020-10-13 17:16:15 +00:00
meter-user-modify-expected.txt
meter-user-modify.html
nav-element-expected.txt
nav-element.html
numbered-header-element-expected.txt
numbered-header-element.html
object-border-expected.txt
object-border.html
object-image-nested-fallback-expected.txt
object-image-nested-fallback.html
pending-stylesheet-crash-expected.txt
pending-stylesheet-crash.html
process-end-tag-for-inbody-crash-expected.txt
process-end-tag-for-inbody-crash.html
progress-user-modify-expected.txt
progress-user-modify.html
range-point-in-range-for-different-documents-expected.txt
range-point-in-range-for-different-documents.html Change fast/g*, fast/h*, fast/i*, and fast/l* files to use pre and post js files in LayoutTests/resources. 2013-09-07 23:56:14 +00:00
script-allowed-types-languages-expected.txt
script-allowed-types-languages.html
script-must-not-run-when-child-is-adopted-expected.txt
script-must-not-run-when-child-is-adopted.html Adopting a child node of a script element can run script 2017-02-09 17:59:45 +00:00
script-must-not-run-when-child-is-removed-expected.txt
script-must-not-run-when-child-is-removed.html Adopting a child node of a script element can run script 2017-02-09 17:59:45 +00:00
section-element-expected.txt
section-element.html
select-dropdown-consistent-background-color-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
select-dropdown-consistent-background-color.html
set-text-direction-expected.txt
set-text-direction.html
tab-order-expected.txt
tab-order.html
tabindex-overwrite-with-non-integer-expected.txt When non-integer tabindex is set, the behavior of element should be same as the tabindex is omitted. 2021-01-15 16:53:46 +00:00
tabindex-overwrite-with-non-integer.html When non-integer tabindex is set, the behavior of element should be same as the tabindex is omitted. 2021-01-15 16:53:46 +00:00
tabindex-removal-expected.txt
tabindex-removal.html
text-field-input-types-expected.txt
text-field-input-types.html
undefined-parameter-default-value-expected.txt [WebIDL] Specify default parameter values where it is useful 2015-09-20 00:45:26 +00:00
undefined-parameter-default-value.html
unforgeable-operations-readonly-expected.txt
unforgeable-operations-readonly.html
unknown-tag-expected.txt
unknown-tag.html
xhtml-serialize-expected.txt
xhtml-serialize.html