Commit Graph

170 Commits

Author SHA1 Message Date
Adrien Destugues 0195b40b77 Merge commit 'e4390067fab9a407b0c303e04f03c77381cb2ddb' into Haiku 2021-08-30 17:59:07 +02:00
Adrien Destugues 0c9484cd1a Initialize internal settings to default values.
Fixes #17094.
2021-08-21 18:54:09 +02:00
Antti Koivisto 7089c76408 [:has() pseudo-class] Basic support
https://bugs.webkit.org/show_bug.cgi?id=228894

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/css/selectors/has-basic-expected.txt:
* web-platform-tests/css/selectors/has-relative-argument-expected.txt:
* web-platform-tests/css/selectors/parsing/parse-has-expected.txt:
* web-platform-tests/dom/nodes/Element-closest-expected.txt:

Source/WebCore:

This patch adds basic support for :has() pseudo-class, https://drafts.csswg.org/selectors/#has-pseudo.
The initial implementation is very inefficient. There is no support for invalidation yet.

The feature is disabled by default.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):

Serialization.

* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):

Selector matching using nested SelectorChecker.

* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
(WebCore::add):
* css/parser/CSSParserContext.h:
* css/parser/CSSParserSelector.h:
(WebCore::CSSParserSelector::setPseudoClassType):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeForgivingSelectorList):

Add a template version of the forgiving parsing function.

(WebCore::CSSSelectorParser::consumeForgivingComplexSelectorList):

Use it for complex selector lists.

(WebCore::CSSSelectorParser::consumeForgivingRelativeSelectorList):

And the new relative selector lists.

(WebCore::CSSSelectorParser::consumeRelativeSelector):

Parse relative selectors like "> foo".

(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeComplexForgivingSelectorList): Deleted.
* css/parser/CSSSelectorParser.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):

No compiler support yet.

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Add off-by-default HasPseudoClassEnabled preference value.


Canonical link: https://commits.webkit.org/240719@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-20 05:15:47 +00:00
Alex Christensen 988a6bd73c Enable PerformanceNavigationAPI by default
https://bugs.webkit.org/show_bug.cgi?id=227336

Patch by Alex Christensen <achristensen@webkit.org> on 2021-08-16
Reviewed by Chris Dumez.

It passes WPT tests except the following:

navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html and navigation-timing/nav2_test_redirect_xserver.html pass when run from wpt.live,
and other browsers also don't pass when run from our local hosting infrastructure, which doesn't have a good cross-domain redirect.

nav2_test_attributes_values.html fails in Chrome and Firefox.  There's something wrong with the port detection in the test.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Canonical link: https://commits.webkit.org/240570@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-16 21:45:04 +00:00
Chris Dumez e6c7e17d32 Add initial support for Cross-Origin-Embedder-Policy (COEP)
https://bugs.webkit.org/show_bug.cgi?id=228754

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline COEP WPT tests now that we are passing more checks.

* web-platform-tests/html/cross-origin-embedder-policy/blob.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/coep-frame-javascript.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/data.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/javascript.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/multi-globals/workers-coep-report.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/no-secure-context-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-require-corp.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank-expected.txt: Removed.
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc-expected.txt: Removed.
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-load-from-cache-storage.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-none.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-require-corp.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/sandbox.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https-expected.txt:

Source/WebCore:

Add initial support for Cross-Origin-Embedder-Policy (COEP) behind a runtime feature flag, off by default:
- https://html.spec.whatwg.org/multipage/origin.html#coep

The COEP header has the following impacts:
- When a document with `Cross-Origin-Embedder-Policy: require-corp` loads an iframe or a worker script, if the network
  response for that iframe doesn't also contain `Cross-Origin-Embedder-Policy: require-corp`, then we fail the load.
- When a document with `Cross-Origin-Embedder-Policy: require-corp` loads cross-origin subresources, then either CORS
  must be used or the resource response must be allowed by Cross-Origin-Resource-Policy (CORP) header.

Support is only for WK2 and checks are done in the network process for better security. Support for workers and service
workers (including cache storage) is included.

Most of the Web-Platform-Tests for COEP are passing with this patch. The exceptions are:
- Some tests relying on Blob are failing. Similarly to COOP, Blobs need to inherit COEP from their
  creator. This is currently unimplemented as the change will likely be non-trivial. I will follow-up
  to fix Blob support for both COOP and COEP.
- Tests in the credentialless/ folder are failing because we do not support `Cross-Origin-Embedder-Policy: credentialless`.
  This seems to be a fairly recent extension proposed by Google and it is not part of the HTML specification yet.
- Some tests expect violation reporting and they are failing and we do not implement reporting yet.

Note that `self.crossOriginIsolated` still returns false, even if the pages opts into both COOP & COEP, and APIs such
as SharedArrayBuffer still are not permitted to use. In order to support this, we will have to actually implement process
swapping so that we know a process is not actually shared by several origins.

Test: http/wpt/html/cross-origin-embedder-policy/require-corp.https.html

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::queryCache):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::convertToException):
* Modules/cache/DOMCacheEngine.h:
* Modules/cache/RetrieveRecordsOptions.h:
(WebCore::RetrieveRecordsOptions::isolatedCopy const):
(WebCore::RetrieveRecordsOptions::encode const):
(WebCore::RetrieveRecordsOptions::decode):
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
* dom/SecurityContext.h:
(WebCore::SecurityContext::crossOriginEmbedderPolicy const):
(WebCore::SecurityContext::setCrossOriginEmbedderPolicy):
* loader/CrossOriginAccessControl.cpp:
(WebCore::shouldCrossOriginResourcePolicyCancelLoad):
(WebCore::validateCrossOriginResourcePolicy):
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginEmbedderPolicy.cpp:
(WebCore::obtainCrossOriginEmbedderPolicy):
(WebCore::CrossOriginEmbedderPolicy::isolatedCopy const):
* loader/CrossOriginEmbedderPolicy.h:
(WebCore::CrossOriginEmbedderPolicy::encode const):
(WebCore::CrossOriginEmbedderPolicy::decode):
* loader/CrossOriginOpenerPolicy.cpp:
(WebCore::obtainCrossOriginOpenerPolicy):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadResourceSynchronously):
(WebCore::DocumentThreadableLoader::create):
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::crossOriginEmbedderPolicy const):
* loader/DocumentThreadableLoader.h:
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/SecurityOrigin.h:
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginResourcePolicyHeader):
* platform/network/HTTPParsers.h:
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::didReceiveResponse):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::crossOriginEmbedderPolicy const):
* workers/WorkerThread.cpp:
(WebCore::WorkerParameters::isolatedCopy const):
* workers/WorkerThread.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::isolatedCopy const):
(WebCore::serviceWorkerFetchError):
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::SWServerWorker::contextData const):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

As mentioned in the WebCore changelog, we do all the COEP checks in the network process
instead of WebCore for added security. As a result, we need to pass more information
to the network process when doing loads in order to do those checks. The checks are done
in NetworkResourceLoader for navigations & worker script loads (similarly to CSP,
X-FrameOptions) and in NetworkLoadChecker for CORP checks of subresource loads (similarly
to CORS checks).

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::validateResponse):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::setParentCrossOriginEmbedderPolicy):
(WebKit::NetworkLoadChecker::setCrossOriginEmbedderPolicy):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::parentOrigin const):
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
(WebKit::NetworkResourceLoader::shouldInterruptNavigationForCrossOriginEmbedderPolicy):
(WebKit::NetworkResourceLoader::shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::initialize):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
(WebKit::ServiceWorkerFetchTask::didReceiveResponse):
* NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
(WebKit::ServiceWorkerSoftUpdateLoader::processResponse):
(WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading):
* NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h:
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::retrieveRecords):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::addParametersShared):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

Source/WTF:

Add experimental feature flag for Cross-Origin-Embedder-Policy (COEP), off by default.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

Update test expectations now that we support COEP on WK2.

* TestExpectations:
* http/wpt/html/cross-origin-embedder-policy/require-corp.https-expected.txt: Added.
* http/wpt/html/cross-origin-embedder-policy/require-corp.https.html: Added.
* http/wpt/html/cross-origin-embedder-policy/require-corp.https.html.headers: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:


Canonical link: https://commits.webkit.org/240459@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-12 02:43:53 +00:00
Youenn Fablet ec7ed5bc5e Enable WebRTC relay by default
https://bugs.webkit.org/show_bug.cgi?id=229000
<rdar://78767922>

Reviewed by Eric Carlson.

* Scripts/Preferences/WebPreferencesExperimental.yaml:


Canonical link: https://commits.webkit.org/240430@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-11 15:09:00 +00:00
Youenn Fablet 2d70b3bde7 Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default
https://bugs.webkit.org/show_bug.cgi?id=228689
<rdar://problem/81383711>

Reviewed by Eric Carlson.

Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default, WebRTC proxying being off by default for now.

* Scripts/Preferences/WebPreferencesExperimental.yaml:


Canonical link: https://commits.webkit.org/240172@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-02 18:39:53 +00:00
Youenn Fablet 819994b1f1 Introduce an experimental feature to toggle WebRTC socket proxying
https://bugs.webkit.org/show_bug.cgi?id=228681

Reviewed by Eric Carlson.

Source/WebKit:

Decide whether to disable proxying based on experimental feature in WebProcess.
Send the disable relay value from WebProcess to NetworkProcess for TCP sockets.
Manually tested.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h:
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:
(WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket):
(WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa):
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::RTCSocketFactory::CreateClientTcpSocket):
(WebKit::LibWebRTCProvider::createSocketFactory):
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:


Canonical link: https://commits.webkit.org/240155@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-01 16:02:21 +00:00
Rob Buis 5b42ab6b1f [css-overflow] Implement clip value for overflow
https://bugs.webkit.org/show_bug.cgi?id=198230

Patch by Rob Buis <rbuis@igalia.com> on 2021-07-30
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-overflow/overflow-clip-hit-testing-expected.txt: Added.
* web-platform-tests/css/css-overflow/overflow-clip-scroll-size-expected.txt: Added.
* web-platform-tests/css/css-overflow/parsing/overflow-computed-expected.txt:
* web-platform-tests/css/css-overflow/parsing/overflow-valid-expected.txt:

Source/WebCore:

Implement overflow: clip. Parsing is like the other
overflow values but special logic is added to handle
the case where only one of overflow-x/overflow-y uses
'clip' [1]. Also adjusts code that computes layout and
visual overflow to take overflow: clip into account.

This matches Chrome and Firefox.

[1] https://drafts.csswg.org/css-overflow/#propdef-overflow-x

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Overflow const):
* css/CSSProperties.json:
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
(WebCore::add):
* css/parser/CSSParserContext.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* page/FrameView.cpp: handle scrollbars
on viewport element same as overflow: hidden.
(WebCore::FrameView::applyOverflowToViewport):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateFromStyle):
(WebCore::RenderBox::scrollWidth const): overflow clip
forbids all scrolling.
(WebCore::RenderBox::scrollHeight const): Ditto.
(WebCore::RenderBox::setScrollLeft): Ditto.
(WebCore::RenderBox::setScrollTop): Ditto.
(WebCore::RenderBox::setScrollPosition): Ditto.
(WebCore::RenderBox::requiresLayerWithScrollableArea const): do
not create layer with scrollable area for overflow: clip.
(WebCore::RenderBox::canBeProgramaticallyScrolled const): overflow clip
forbids all scrolling.
(WebCore::RenderBox::scrollPosition const): overflow clip
forbids all scrolling.
(WebCore::RenderBox::overflowClipRect const): only clip the rect horizontally
for overflow-x: clip and only vertically for overflow-y: clip.
(WebCore::RenderBox::createsNewFormattingContext const): do
not create formatting context for overflow: clip.
(WebCore::RenderBox::addOverflowFromChild):
(WebCore::RenderBox::addLayoutOverflow):
(WebCore::RenderBox::layoutOverflowRectForPropagation const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::enclosingScrollableContainerForSnapping const):
* rendering/RenderObject.h: Add helper method that excludes overflow-x/y: clip.
(WebCore::RenderObject::hasPotentiallyScrollableOverflow const):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
* style/StyleAdjuster.cpp: Add special logic is to handle the case where only
one of overflow-x/overflow-y uses 'clip'.
(WebCore::Style::Adjuster::adjust const):

Source/WTF:

Add preference for overflow: clip support.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

* TestExpectations:

Canonical link: https://commits.webkit.org/240141@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-31 06:07:09 +00:00
Chris Dumez c0421a46a7 Add initial support for 'Cross-Origin-Opener-Policy' HTTP header
https://bugs.webkit.org/show_bug.cgi?id=192193
<rdar://problem/42013525>

Reviewed by Geoff Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that most tests are passing.

* web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coep-navigate-popup.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coep-redirect.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coep.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coop-coep-sandbox.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coop-csp-sandbox-navigate.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coop-csp-sandbox.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coop-navigated-history-popup.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coop-navigated-popup.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coop-sandbox.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/header-parsing.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/coep-navigate-popup-unsafe-inherit.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-origin-unsafe-allow-outgoing-with-cross-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-origin-unsafe-allow-outgoing-with-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-origin-unsafe-allow-outgoing-with-same-site.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-unsafe-allow-outgoing-with-cross-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-unsafe-allow-outgoing-with-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-unsafe-allow-outgoing-with-same-site.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-with-cross-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-with-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-with-same-site.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-same-origin-allow-popups.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-to-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-to-unsafe-none.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/iframe-popup-unsafe-none-to-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/javascript-url.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/navigate-to-aboutblank.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/no-https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-redirect-same-origin-allow-popups.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-allow-popups-with-cross-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-allow-popups-with-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-allow-popups-with-same-site.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-with-cross-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-with-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-with-same-site.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-unsafe-none-with-cross-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-unsafe-none-with-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-unsafe-none-with-same-site.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-unspecified-with-cross-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-unspecified-with-same-origin.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-unspecified-with-same-site.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/popup-with-structured-header.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/resource-popup.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/resources/resource-popup.html:
* web-platform-tests/html/dom/idlharness.worker-expected.txt:

Source/WebCore:

Add initial support for 'Cross-Origin-Opener-Policy' HTTP header:
- https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policy-value

Support is complete enough to pass most WPT tests with the exception of:
- The ones involving blob. Support for Blob does not seem trivial so I will address
  separately (https://github.com/whatwg/html/issues/5198).
- The ones that requires reporting COOP enforcement as this is not supported yet.
  This is a fairly large task so I'll handle separately.
- The ones that involve Cross-Origin-Embedder-Policy (COEP) and this is not yet
  supported.

I tried to stay as close as possible to the HTML specification as possible in terms
of structuring and naming. I also have code comments to link to the relevant HTML
spec sections.

Note that as it stands, we do not currently swap process based on COOP header. We
merely do isolation of the new browsing context at JS level for now. At some point,
we'll want to actually process-swap, once we support COEP and we want to re-enable
some Web APIs such as SharedArrayBuffer.

No new tests, covered by web-plaform-tests/html/cross-origin-opener-policy.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
(WebCore::Document::shouldForceNoOpenerBasedOnCOOP const):
(WebCore::Document::crossOriginOpenerPolicy const):
(WebCore::Document::setCrossOriginOpenerPolicy):
* dom/Document.h:
(WebCore::Document::isSameOriginAsTopDocument const):
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::enforceSandboxFlags):
* dom/SecurityContext.h:
(WebCore::SecurityContext::creationSandboxFlags const):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openURLExternally):
* loader/CrossOriginEmbedderPolicy.cpp: Copied from Source/WebCore/page/AbstractFrame.cpp.
(WebCore::obtainCrossOriginEmbedderPolicy):
* loader/CrossOriginEmbedderPolicy.h: Copied from Source/WebCore/page/AbstractFrame.cpp.
* loader/CrossOriginOpenerPolicy.cpp: Added.
(WebCore::obtainCrossOriginOpenerPolicy):
* loader/CrossOriginOpenerPolicy.h: Copied from Source/WebCore/page/AbstractFrame.h.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
(WebCore::checkIfCOOPValuesRequireBrowsingContextGroupSwitch):
(WebCore::computeResponseOriginAndCOOP):
(WebCore::DocumentLoader::doCrossOriginOpenerHandlingOfResponse):
(WebCore::DocumentLoader::enforceResponseCrossOriginOpenerPolicy):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::crossOriginOpenerPolicy const):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
(WebCore::FrameLoader::setOpener):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::createWindow):
(WebCore::FrameLoader::switchBrowsingContextsGroup):
* loader/FrameLoader.h:
* loader/NavigationAction.cpp:
* loader/NavigationAction.h:
(WebCore::NavigationAction::Requester::securityOrigin const):
(WebCore::NavigationAction::Requester::topOrigin const):
(WebCore::NavigationAction::Requester::crossOriginOpenerPolicy const):
* page/AbstractFrame.cpp:
(WebCore::AbstractFrame::resetWindowProxy):
* page/AbstractFrame.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::crossOriginIsolated const):
(WebCore::DOMWindow::createWindow):
* page/DOMWindow.h:
* page/Frame.cpp:
(WebCore::Frame::resetScript):
* page/Frame.h:
* page/Page.h:
(WebCore::Page::setOpenedByDOMWithOpener):
* page/WindowOrWorkerGlobalScope.idl:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext):
* platform/network/HTTPHeaderNames.in:
* platform/network/HTTPParsers.cpp:
(WebCore::parseStructuredFieldValue):
* platform/network/HTTPParsers.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::isSafeRedirectionResponseHeader):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::crossOriginIsolated const):
* workers/WorkerGlobalScope.h:

Source/WTF:

Add experimental feature flag for 'Cross-Origin-Opener-Policy' HTTP header
support.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

Update test expectations.

* TestExpectations:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/TestExpectations:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac/TestExpectations:


Canonical link: https://commits.webkit.org/240136@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-31 00:07:37 +00:00
Myles C. Maxfield f11022e79e Stop building WebGPU and the WHLSL compiler to decrease binary size
https://bugs.webkit.org/show_bug.cgi?id=228179

Reviewed by Dean Jackson, Robin Morisset, and Devin Rousso.

.:

* Source/cmake/OptionsFTW.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

This patch deletes the existing implementation just to reduce binary size in releases of WebKit
which don't enable WebGPU by default. It doesn't represent a change in direction or policy or
anything regarding WebGPU. It's a (somewhat temporary) pragmatic change.

Our current implementation of WebGPU:
1. Is off by default on all platforms
2. Is extremely outdated
3. Has no notion of the GPU Process, and therefore needs to be redesigned and largely rewritten
4. Only implements a fraction of what is in the spec

Removing the code from the tree doesn't delete it from existence; it's still in source control.
The benefit of reducing binary size seems to outweigh having this code in the tree.

* inspector/protocol/Canvas.json:
* inspector/scripts/codegen/generator.py:

Source/WebCore:

No new tests because there is no behavior change.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webgpu/GPUBindGroupLayoutBinding.h: Removed.
* Modules/webgpu/GPUBindGroupLayoutBinding.idl: Removed.
* Modules/webgpu/GPUBindGroupLayoutDescriptor.h: Removed.
* Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: Removed.
* Modules/webgpu/GPUBlendDescriptor.idl: Removed.
* Modules/webgpu/GPUBufferDescriptor.idl: Removed.
* Modules/webgpu/GPUBufferUsage.idl: Removed.
* Modules/webgpu/GPUCanvasContext.cpp: Removed.
* Modules/webgpu/GPUCanvasContext.h: Removed.
* Modules/webgpu/GPUCanvasContext.idl: Removed.
* Modules/webgpu/GPUColor.idl: Removed.
* Modules/webgpu/GPUColorStateDescriptor.idl: Removed.
* Modules/webgpu/GPUColorWrite.idl: Removed.
* Modules/webgpu/GPUCompareFunction.idl: Removed.
* Modules/webgpu/GPUDepthStencilStateDescriptor.idl: Removed.
* Modules/webgpu/GPUErrorFilter.idl: Removed.
* Modules/webgpu/GPUExtent3D.idl: Removed.
* Modules/webgpu/GPULoadOp.idl: Removed.
* Modules/webgpu/GPUOrigin3D.h: Removed.
* Modules/webgpu/GPUOrigin3D.idl: Removed.
* Modules/webgpu/GPUOutOfMemoryError.idl: Removed.
* Modules/webgpu/GPURequestAdapterOptions.idl: Removed.
* Modules/webgpu/GPUSamplerDescriptor.idl: Removed.
* Modules/webgpu/GPUShaderStage.h: Removed.
* Modules/webgpu/GPUShaderStage.idl: Removed.
* Modules/webgpu/GPUStoreOp.idl: Removed.
* Modules/webgpu/GPUTextureDescriptor.idl: Removed.
* Modules/webgpu/GPUTextureFormat.idl: Removed.
* Modules/webgpu/GPUTextureUsage.idl: Removed.
* Modules/webgpu/GPUUncapturedErrorEvent.cpp: Removed.
* Modules/webgpu/GPUUncapturedErrorEvent.h: Removed.
* Modules/webgpu/GPUUncapturedErrorEvent.idl: Removed.
* Modules/webgpu/GPUValidationError.idl: Removed.
* Modules/webgpu/GPUVertexAttributeDescriptor.idl: Removed.
* Modules/webgpu/GPUVertexBufferDescriptor.idl: Removed.
* Modules/webgpu/GPUVertexInputDescriptor.idl: Removed.
* Modules/webgpu/Navigator+GPU.idl: Removed.
* Modules/webgpu/NavigatorGPU.cpp: Removed.
* Modules/webgpu/NavigatorGPU.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLAST.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLAddressEscapeMode.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLBlock.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLBreak.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLContinue.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLDefaultDelete.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLNameSpace.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLReplaceWith.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLStatement.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: Removed.
* Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: Removed.
* Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLASTDumper.h: Removed.
* Modules/webgpu/WHLSL/WHLSLBuildStandardLibraryFunctionMap.py: Removed.
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: Removed.
* Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Removed.
* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h: Removed.
* Modules/webgpu/WHLSL/WHLSLChecker.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLChecker.h: Removed.
* Modules/webgpu/WHLSL/WHLSLCodeLocation.h: Removed.
* Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Removed.
* Modules/webgpu/WHLSL/WHLSLError.h: Removed.
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Removed.
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: Removed.
* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Removed.
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLInferTypes.h: Removed.
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h: Removed.
* Modules/webgpu/WHLSL/WHLSLLexer.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLLexer.h: Removed.
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Removed.
* Modules/webgpu/WHLSL/WHLSLNameContext.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLNameContext.h: Removed.
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLNameResolver.h: Removed.
* Modules/webgpu/WHLSL/WHLSLParser.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLParser.h: Removed.
* Modules/webgpu/WHLSL/WHLSLParsingMode.h: Removed.
* Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: Removed.
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLPrepare.h: Removed.
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h: Removed.
* Modules/webgpu/WHLSL/WHLSLProgram.h: Removed.
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.h: Removed.
* Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h: Removed.
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Removed.
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: Removed.
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: Removed.
* Modules/webgpu/WHLSL/WHLSLResolvingType.h: Removed.
* Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h: Removed.
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: Removed.
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Removed.
* Modules/webgpu/WHLSL/WHLSLStandardLibraryFunctionMap.h: Removed.
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h: Removed.
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Removed.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Removed.
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Removed.
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLVisitor.h: Removed.
* Modules/webgpu/WebGPU.cpp: Removed.
* Modules/webgpu/WebGPU.h: Removed.
* Modules/webgpu/WebGPU.idl: Removed.
* Modules/webgpu/WebGPUAdapter.cpp: Removed.
* Modules/webgpu/WebGPUAdapter.h: Removed.
* Modules/webgpu/WebGPUAdapter.idl: Removed.
* Modules/webgpu/WebGPUBindGroup.cpp: Removed.
* Modules/webgpu/WebGPUBindGroup.h: Removed.
* Modules/webgpu/WebGPUBindGroup.idl: Removed.
* Modules/webgpu/WebGPUBindGroupBinding.h: Removed.
* Modules/webgpu/WebGPUBindGroupBinding.idl: Removed.
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Removed.
* Modules/webgpu/WebGPUBindGroupDescriptor.h: Removed.
* Modules/webgpu/WebGPUBindGroupDescriptor.idl: Removed.
* Modules/webgpu/WebGPUBindGroupLayout.cpp: Removed.
* Modules/webgpu/WebGPUBindGroupLayout.h: Removed.
* Modules/webgpu/WebGPUBindGroupLayout.idl: Removed.
* Modules/webgpu/WebGPUBuffer.cpp: Removed.
* Modules/webgpu/WebGPUBuffer.h: Removed.
* Modules/webgpu/WebGPUBuffer.idl: Removed.
* Modules/webgpu/WebGPUBufferBinding.h: Removed.
* Modules/webgpu/WebGPUBufferBinding.idl: Removed.
* Modules/webgpu/WebGPUCommandBuffer.cpp: Removed.
* Modules/webgpu/WebGPUCommandBuffer.h: Removed.
* Modules/webgpu/WebGPUCommandBuffer.idl: Removed.
* Modules/webgpu/WebGPUCommandEncoder.cpp: Removed.
* Modules/webgpu/WebGPUCommandEncoder.h: Removed.
* Modules/webgpu/WebGPUCommandEncoder.idl: Removed.
* Modules/webgpu/WebGPUComputePassEncoder.cpp: Removed.
* Modules/webgpu/WebGPUComputePassEncoder.h: Removed.
* Modules/webgpu/WebGPUComputePassEncoder.idl: Removed.
* Modules/webgpu/WebGPUComputePipeline.cpp: Removed.
* Modules/webgpu/WebGPUComputePipeline.h: Removed.
* Modules/webgpu/WebGPUComputePipeline.idl: Removed.
* Modules/webgpu/WebGPUComputePipelineDescriptor.cpp: Removed.
* Modules/webgpu/WebGPUComputePipelineDescriptor.h: Removed.
* Modules/webgpu/WebGPUComputePipelineDescriptor.idl: Removed.
* Modules/webgpu/WebGPUDevice.cpp: Removed.
* Modules/webgpu/WebGPUDevice.h: Removed.
* Modules/webgpu/WebGPUDevice.idl: Removed.
* Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Removed.
* Modules/webgpu/WebGPUDeviceErrorScopes.h: Removed.
* Modules/webgpu/WebGPUDeviceErrorScopes.idl: Removed.
* Modules/webgpu/WebGPUDeviceEventHandler.idl: Removed.
* Modules/webgpu/WebGPUPipeline.cpp: Removed.
* Modules/webgpu/WebGPUPipeline.h: Removed.
* Modules/webgpu/WebGPUPipelineDescriptorBase.h: Removed.
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Removed.
* Modules/webgpu/WebGPUPipelineLayout.cpp: Removed.
* Modules/webgpu/WebGPUPipelineLayout.h: Removed.
* Modules/webgpu/WebGPUPipelineLayout.idl: Removed.
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.cpp: Removed.
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Removed.
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Removed.
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Removed.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h: Removed.
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Removed.
* Modules/webgpu/WebGPUProgrammableStageDescriptor.cpp: Removed.
* Modules/webgpu/WebGPUProgrammableStageDescriptor.h: Removed.
* Modules/webgpu/WebGPUProgrammableStageDescriptor.idl: Removed.
* Modules/webgpu/WebGPUQueue.cpp: Removed.
* Modules/webgpu/WebGPUQueue.h: Removed.
* Modules/webgpu/WebGPUQueue.idl: Removed.
* Modules/webgpu/WebGPURenderPassDescriptor.cpp: Removed.
* Modules/webgpu/WebGPURenderPassDescriptor.h: Removed.
* Modules/webgpu/WebGPURenderPassDescriptor.idl: Removed.
* Modules/webgpu/WebGPURenderPassEncoder.cpp: Removed.
* Modules/webgpu/WebGPURenderPassEncoder.h: Removed.
* Modules/webgpu/WebGPURenderPassEncoder.idl: Removed.
* Modules/webgpu/WebGPURenderPipeline.cpp: Removed.
* Modules/webgpu/WebGPURenderPipeline.h: Removed.
* Modules/webgpu/WebGPURenderPipeline.idl: Removed.
* Modules/webgpu/WebGPURenderPipelineDescriptor.cpp: Removed.
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Removed.
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Removed.
* Modules/webgpu/WebGPUSampler.cpp: Removed.
* Modules/webgpu/WebGPUSampler.h: Removed.
* Modules/webgpu/WebGPUSampler.idl: Removed.
* Modules/webgpu/WebGPUShaderModule.cpp: Removed.
* Modules/webgpu/WebGPUShaderModule.h: Removed.
* Modules/webgpu/WebGPUShaderModule.idl: Removed.
* Modules/webgpu/WebGPUShaderModuleDescriptor.h: Removed.
* Modules/webgpu/WebGPUShaderModuleDescriptor.idl: Removed.
* Modules/webgpu/WebGPUSwapChain.cpp: Removed.
* Modules/webgpu/WebGPUSwapChain.h: Removed.
* Modules/webgpu/WebGPUSwapChain.idl: Removed.
* Modules/webgpu/WebGPUSwapChainDescriptor.cpp: Removed.
* Modules/webgpu/WebGPUSwapChainDescriptor.h: Removed.
* Modules/webgpu/WebGPUTexture.cpp: Removed.
* Modules/webgpu/WebGPUTexture.h: Removed.
* Modules/webgpu/WebGPUTexture.idl: Removed.
* Modules/webgpu/WebGPUTextureView.cpp: Removed.
* Modules/webgpu/WebGPUTextureView.h: Removed.
* Modules/webgpu/WebGPUTextureView.idl: Removed.
* Modules/webgpu/WorkerNavigator+GPU.idl: Removed.
* Modules/webgpu/WorkerNavigatorGPU.cpp: Removed.
* Modules/webgpu/WorkerNavigatorGPU.h: Removed.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebGPUType): Deleted.
(WebCore::HTMLCanvasElement::createContextWebGPU): Deleted.
(WebCore::HTMLCanvasElement::getContextWebGPU): Deleted.
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGL const):
(WebCore::CanvasRenderingContext::isWebGPU const): Deleted.
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::InspectorCanvas):
(WebCore::InspectorCanvas::canvasElement const):
(WebCore::InspectorCanvas::scriptExecutionContext const):
(WebCore::InspectorCanvas::resolveContext const):
(WebCore:: const):
(WebCore::InspectorCanvas::resetRecordingData):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::releaseObjectForRecording):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::canvasIfContextMatchesDevice): Deleted.
(WebCore::InspectorCanvas::deviceContext const): Deleted.
(WebCore::InspectorCanvas::isDeviceForCanvasContext const): Deleted.
* inspector/InspectorCanvas.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Deleted.
(WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Deleted.
(WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Deleted.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Deleted.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Deleted.
(WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Deleted.
(WebCore::InspectorInstrumentation::willConfigureSwapChain): Deleted.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Deleted.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Deleted.
* inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::requestShaderSource):
(WebCore::InspectorShaderProgram::updateShader):
(WebCore::InspectorShaderProgram::buildObjectForShaderProgram):
(WebCore::InspectorShaderProgram::pipeline const): Deleted.
* inspector/InspectorShaderProgram.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::stopRecording):
(WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
(WebCore::InspectorCanvasAgent::recordAction):
(WebCore::InspectorCanvasAgent::reset):
(WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Deleted.
(WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Deleted.
(WebCore::InspectorCanvasAgent::willConfigureSwapChain): Deleted.
(WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Deleted.
(WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Deleted.
* inspector/agents/InspectorCanvasAgent.h:
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::prewarmGlobally):
* platform/Logging.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
* platform/graphics/cocoa/WebGPULayer.h: Removed.
* platform/graphics/cocoa/WebGPULayer.mm: Removed.
* platform/graphics/gpu/GPUBindGroup.h: Removed.
* platform/graphics/gpu/GPUBindGroupAllocator.h: Removed.
* platform/graphics/gpu/GPUBindGroupBinding.h: Removed.
* platform/graphics/gpu/GPUBindGroupDescriptor.h: Removed.
* platform/graphics/gpu/GPUBindGroupLayout.h: Removed.
* platform/graphics/gpu/GPUBlendDescriptor.h: Removed.
* platform/graphics/gpu/GPUBuffer.cpp: Removed.
* platform/graphics/gpu/GPUBuffer.h: Removed.
* platform/graphics/gpu/GPUBufferBinding.h: Removed.
* platform/graphics/gpu/GPUBufferDescriptor.h: Removed.
* platform/graphics/gpu/GPUBufferUsage.h: Removed.
* platform/graphics/gpu/GPUColor.h: Removed.
* platform/graphics/gpu/GPUColorStateDescriptor.h: Removed.
* platform/graphics/gpu/GPUColorWrite.h: Removed.
* platform/graphics/gpu/GPUCommandBuffer.h: Removed.
* platform/graphics/gpu/GPUCompareFunction.h: Removed.
* platform/graphics/gpu/GPUComputePassEncoder.h: Removed.
* platform/graphics/gpu/GPUComputePipeline.h: Removed.
* platform/graphics/gpu/GPUComputePipelineDescriptor.h: Removed.
* platform/graphics/gpu/GPUDepthStencilStateDescriptor.h: Removed.
* platform/graphics/gpu/GPUDevice.cpp: Removed.
* platform/graphics/gpu/GPUDevice.h:
(WebCore::GPUDevice::platformDevice const): Deleted.
(WebCore::GPUDevice::swapChain const): Deleted.
(WebCore::GPUDevice::setErrorScopes): Deleted.
* platform/graphics/gpu/GPUError.cpp: Removed.
* platform/graphics/gpu/GPUError.h: Removed.
* platform/graphics/gpu/GPUErrorFilter.h: Removed.
* platform/graphics/gpu/GPUErrorScopes.cpp: Removed.
* platform/graphics/gpu/GPUErrorScopes.h: Removed.
* platform/graphics/gpu/GPUExtent3D.h: Removed.
* platform/graphics/gpu/GPULimits.h: Removed.
* platform/graphics/gpu/GPULoadOp.h: Removed.
* platform/graphics/gpu/GPUObjectBase.h: Removed.
* platform/graphics/gpu/GPUOutOfMemoryError.h: Removed.
* platform/graphics/gpu/GPUPipeline.cpp: Removed.
* platform/graphics/gpu/GPUPipeline.h: Removed.
* platform/graphics/gpu/GPUPipelineDescriptorBase.h: Removed.
* platform/graphics/gpu/GPUPipelineLayout.cpp: Removed.
* platform/graphics/gpu/GPUPipelineLayout.h: Removed.
* platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Removed.
* platform/graphics/gpu/GPUPlatformTypes.h: Removed.
* platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Removed.
* platform/graphics/gpu/GPUProgrammablePassEncoder.h: Removed.
* platform/graphics/gpu/GPUProgrammableStageDescriptor.h: Removed.
* platform/graphics/gpu/GPUQueue.h: Removed.
* platform/graphics/gpu/GPURenderPassDescriptor.h: Removed.
* platform/graphics/gpu/GPURenderPassEncoder.h: Removed.
* platform/graphics/gpu/GPURenderPipeline.h: Removed.
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Removed.
* platform/graphics/gpu/GPURequestAdapterOptions.h: Removed.
* platform/graphics/gpu/GPUSampler.h: Removed.
* platform/graphics/gpu/GPUSamplerDescriptor.h: Removed.
* platform/graphics/gpu/GPUShaderModule.h: Removed.
* platform/graphics/gpu/GPUShaderModuleDescriptor.h: Removed.
* platform/graphics/gpu/GPUStoreOp.h: Removed.
* platform/graphics/gpu/GPUSwapChain.h: Removed.
* platform/graphics/gpu/GPUSwapChainDescriptor.h: Removed.
* platform/graphics/gpu/GPUTexture.h: Removed.
* platform/graphics/gpu/GPUTextureDescriptor.h: Removed.
* platform/graphics/gpu/GPUTextureFormat.h: Removed.
* platform/graphics/gpu/GPUTextureUsage.h: Removed.
* platform/graphics/gpu/GPUUtils.h: Removed.
* platform/graphics/gpu/GPUValidationError.cpp: Removed.
* platform/graphics/gpu/GPUValidationError.h: Removed.
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Removed.
* platform/graphics/gpu/GPUVertexBufferDescriptor.h: Removed.
* platform/graphics/gpu/GPUVertexInputDescriptor.h: Removed.
* platform/graphics/gpu/cocoa/GPUBindGroupAllocatorMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::prewarmGPU):
(WebCore::isAcceptableDevice): Deleted.
(WebCore::GPUDevice::prewarm): Deleted.
(WebCore::GPUDevice::tryCreate): Deleted.
(WebCore::GPUDevice::GPUDevice): Deleted.
* platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Removed.
* platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Removed.
* platform/graphics/gpu/cocoa/GPUPlatformTypesMetal.h: Removed.
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Removed.
* platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Removed.
* platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Removed.
* platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Removed.
* platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Removed.
* platform/ios/DragImageIOS.mm:
* platform/mediastream/mac/WindowDisplayCapturerMac.mm:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::contentChanged):

Source/WebKit:

* FeatureFlags/WebKit-appletvos.plist:
* FeatureFlags/WebKit-ios.plist:
* FeatureFlags/WebKit-macos.plist:
* FeatureFlags/WebKit-watchos.plist:
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultWebGPUEnabled): Deleted.
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences webGPUEnabled]): Deleted.
(-[WebPreferences setWebGPUEnabled:]): Deleted.
* WebView/WebPreferencesDefaultValues.h:
* WebView/WebPreferencesDefaultValues.mm:
(WebKit::defaultWebGPUEnabled): Deleted.
* WebView/WebPreferencesPrivate.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:

LayoutTests:

* TestExpectations:
* fast/dom/navigator-detached-no-crash-expected.txt:
* inspector/canvas/create-context-webgpu-expected.txt: Removed.
* inspector/canvas/create-context-webgpu.html: Removed.
* inspector/canvas/requestClientNodes-webgpu-expected.txt: Removed.
* inspector/canvas/requestClientNodes-webgpu.html: Removed.
* inspector/canvas/requestShaderSource-webgpu-expected.txt: Removed.
* inspector/canvas/requestShaderSource-webgpu.html: Removed.
* inspector/canvas/resolveContext-webgpu-expected.txt: Removed.
* inspector/canvas/resolveContext-webgpu.html: Removed.
* inspector/canvas/shaderProgram-add-remove-webgpu-expected.txt: Removed.
* inspector/canvas/shaderProgram-add-remove-webgpu.html: Removed.
* inspector/canvas/updateShader-webgpu-expected.txt: Removed.
* inspector/canvas/updateShader-webgpu-sharedVertexFragment-expected.txt: Removed.
* inspector/canvas/updateShader-webgpu-sharedVertexFragment.html: Removed.
* inspector/canvas/updateShader-webgpu.html: Removed.
* platform/glib/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* webgpu/bind-groups-expected.txt: Removed.
* webgpu/bind-groups.html: Removed.
* webgpu/blend-color-triangle-strip-expected.html: Removed.
* webgpu/blend-color-triangle-strip.html: Removed.
* webgpu/blend-triangle-strip-expected.html: Removed.
* webgpu/blend-triangle-strip.html: Removed.
* webgpu/blit-commands-expected.html: Removed.
* webgpu/blit-commands-texture-to-texture-expected.html: Removed.
* webgpu/blit-commands-texture-to-texture.html: Removed.
* webgpu/blit-commands.html: Removed.
* webgpu/buffer-command-buffer-races-expected.html: Removed.
* webgpu/buffer-command-buffer-races.html: Removed.
* webgpu/buffer-errors-expected.txt: Removed.
* webgpu/buffer-errors.html: Removed.
* webgpu/color-write-mask-triangle-strip-expected.html: Removed.
* webgpu/color-write-mask-triangle-strip.html: Removed.
* webgpu/command-buffers-expected.txt: Removed.
* webgpu/command-buffers.html: Removed.
* webgpu/compute-pipeline-errors-expected.txt: Removed.
* webgpu/compute-pipeline-errors.html: Removed.
* webgpu/depth-enabled-triangle-strip-expected.html: Removed.
* webgpu/depth-enabled-triangle-strip.html: Removed.
* webgpu/draw-indexed-triangles-expected.html: Removed.
* webgpu/draw-indexed-triangles.html: Removed.
* webgpu/error-scopes-test-expected.txt: Removed.
* webgpu/error-scopes-test.html: Removed.
* webgpu/expando-properties-expected.txt: Removed.
* webgpu/expando-properties.html: Removed.
* webgpu/js/webgpu-functions.js: Removed.
* webgpu/map-read-buffers-expected.txt: Removed.
* webgpu/map-read-buffers.html: Removed.
* webgpu/map-write-buffers-expected.txt: Removed.
* webgpu/map-write-buffers.html: Removed.
* webgpu/pipeline-layouts-expected.txt: Removed.
* webgpu/pipeline-layouts.html: Removed.
* webgpu/queue-creation-expected.txt: Removed.
* webgpu/queue-creation.html: Removed.
* webgpu/render-command-encoding-expected.txt: Removed.
* webgpu/render-command-encoding.html: Removed.
* webgpu/render-pipeline-errors-expected.txt: Removed.
* webgpu/render-pipeline-errors.html: Removed.
* webgpu/render-pipelines-expected.txt: Removed.
* webgpu/render-pipelines.html: Removed.
* webgpu/resources/blue-checkered.png: Removed.
* webgpu/resources/green-400.png: Removed.
* webgpu/shader-modules-expected.txt: Removed.
* webgpu/shader-modules.html: Removed.
* webgpu/simple-triangle-strip-expected.html: Removed.
* webgpu/simple-triangle-strip.html: Removed.
* webgpu/texture-creation-expected.txt: Removed.
* webgpu/texture-creation.html: Removed.
* webgpu/texture-triangle-strip-expected.html: Removed.
* webgpu/texture-triangle-strip.html: Removed.
* webgpu/textures-textureviews-expected.txt: Removed.
* webgpu/textures-textureviews.html: Removed.
* webgpu/uncaptured-errors-expected.txt: Removed.
* webgpu/uncaptured-errors.html: Removed.
* webgpu/vertex-buffer-triangle-strip-expected.html: Removed.
* webgpu/vertex-buffer-triangle-strip.html: Removed.
* webgpu/viewport-scissor-rect-triangle-strip-expected.html: Removed.
* webgpu/viewport-scissor-rect-triangle-strip.html: Removed.
* webgpu/whlsl/address-of-swizzle-expected.txt: Removed.
* webgpu/whlsl/address-of-swizzle.html: Removed.
* webgpu/whlsl/arbitrary-vertex-attribute-locations-expected.html: Removed.
* webgpu/whlsl/arbitrary-vertex-attribute-locations.html: Removed.
* webgpu/whlsl/argument-evaluation-order-expected.txt: Removed.
* webgpu/whlsl/argument-evaluation-order.html: Removed.
* webgpu/whlsl/array-length-spec-tests-expected.txt: Removed.
* webgpu/whlsl/array-length-spec-tests.html: Removed.
* webgpu/whlsl/array-oob-alias-expected.txt: Removed.
* webgpu/whlsl/array-oob-alias.html: Removed.
* webgpu/whlsl/array-spec-tests-expected.txt: Removed.
* webgpu/whlsl/array-spec-tests.html: Removed.
* webgpu/whlsl/bad-add-expected.txt: Removed.
* webgpu/whlsl/bad-add.html: Removed.
* webgpu/whlsl/bad-literals-expected.txt: Removed.
* webgpu/whlsl/bad-literals.html: Removed.
* webgpu/whlsl/bitwise-bool-ops-expected.txt: Removed.
* webgpu/whlsl/bitwise-bool-ops.html: Removed.
* webgpu/whlsl/bool-matrix-expected.txt: Removed.
* webgpu/whlsl/bool-matrix.html: Removed.
* webgpu/whlsl/bools-expected.txt: Removed.
* webgpu/whlsl/bools.html: Removed.
* webgpu/whlsl/buffer-fragment-expected.html: Removed.
* webgpu/whlsl/buffer-fragment.html: Removed.
* webgpu/whlsl/buffer-length-expected.txt: Removed.
* webgpu/whlsl/buffer-length.html: Removed.
* webgpu/whlsl/buffer-vertex-expected.html: Removed.
* webgpu/whlsl/buffer-vertex.html: Removed.
* webgpu/whlsl/builtin-vectors-2-expected.txt: Removed.
* webgpu/whlsl/builtin-vectors-2.html: Removed.
* webgpu/whlsl/builtin-vectors-expected.txt: Removed.
* webgpu/whlsl/builtin-vectors.html: Removed.
* webgpu/whlsl/casts-expected.txt: Removed.
* webgpu/whlsl/casts.html: Removed.
* webgpu/whlsl/checker-should-set-type-of-read-modify-write-variables-expected.txt: Removed.
* webgpu/whlsl/checker-should-set-type-of-read-modify-write-variables.html: Removed.
* webgpu/whlsl/clamp-stdlib-expected.txt: Removed.
* webgpu/whlsl/clamp-stdlib.html: Removed.
* webgpu/whlsl/comment-parsing-expected.txt: Removed.
* webgpu/whlsl/comment-parsing.html: Removed.
* webgpu/whlsl/compute-expected.txt: Removed.
* webgpu/whlsl/compute.html: Removed.
* webgpu/whlsl/copy-expected.txt: Removed.
* webgpu/whlsl/copy.html: Removed.
* webgpu/whlsl/dereference-ordering-expected.txt: Removed.
* webgpu/whlsl/dereference-ordering.html: Removed.
* webgpu/whlsl/dereference-pointer-should-type-check-expected.html: Removed.
* webgpu/whlsl/dereference-pointer-should-type-check.html: Removed.
* webgpu/whlsl/device-proper-type-checker-expected.txt: Removed.
* webgpu/whlsl/device-proper-type-checker.html: Removed.
* webgpu/whlsl/do-while-loop-break-expected.html: Removed.
* webgpu/whlsl/do-while-loop-break.html: Removed.
* webgpu/whlsl/do-while-loop-continue-expected.html: Removed.
* webgpu/whlsl/do-while-loop-continue.html: Removed.
* webgpu/whlsl/do-while-loop-expected.html: Removed.
* webgpu/whlsl/do-while-loop.html: Removed.
* webgpu/whlsl/dont-crash-parsing-enum-expected.html: Removed.
* webgpu/whlsl/dont-crash-parsing-enum.html: Removed.
* webgpu/whlsl/dot-expressions-expected.html: Removed.
* webgpu/whlsl/dot-expressions.html: Removed.
* webgpu/whlsl/double-not-expected.txt: Removed.
* webgpu/whlsl/double-not.html: Removed.
* webgpu/whlsl/duplicate-types-should-not-produce-duplicate-ctors-expected.txt: Removed.
* webgpu/whlsl/duplicate-types-should-not-produce-duplicate-ctors.html: Removed.
* webgpu/whlsl/duplicates-expected.txt: Removed.
* webgpu/whlsl/duplicates.html: Removed.
* webgpu/whlsl/ensure-proper-pointer-usage-expected.txt: Removed.
* webgpu/whlsl/ensure-proper-pointer-usage.html: Removed.
* webgpu/whlsl/ensure-proper-variable-lifetime-2-expected.html: Removed.
* webgpu/whlsl/ensure-proper-variable-lifetime-2.html: Removed.
* webgpu/whlsl/ensure-proper-variable-lifetime-3-expected.html: Removed.
* webgpu/whlsl/ensure-proper-variable-lifetime-3.html: Removed.
* webgpu/whlsl/ensure-proper-variable-lifetime-expected.html: Removed.
* webgpu/whlsl/ensure-proper-variable-lifetime.html: Removed.
* webgpu/whlsl/enum-integer-constructor-expected.txt: Removed.
* webgpu/whlsl/enum-integer-constructor.html: Removed.
* webgpu/whlsl/enum-spec-tests-expected.txt: Removed.
* webgpu/whlsl/enum-spec-tests.html: Removed.
* webgpu/whlsl/enums-2-expected.txt: Removed.
* webgpu/whlsl/enums-2.html: Removed.
* webgpu/whlsl/enums-expected.txt: Removed.
* webgpu/whlsl/enums.html: Removed.
* webgpu/whlsl/equality-expected.txt: Removed.
* webgpu/whlsl/equality.html: Removed.
* webgpu/whlsl/float-math-expected.txt: Removed.
* webgpu/whlsl/float-math.html: Removed.
* webgpu/whlsl/getter-setter-type-expected.txt: Removed.
* webgpu/whlsl/getter-setter-type.html: Removed.
* webgpu/whlsl/huge-array-expected.txt: Removed.
* webgpu/whlsl/huge-array.html: Removed.
* webgpu/whlsl/if-statement-expected.txt: Removed.
* webgpu/whlsl/if-statement.html: Removed.
* webgpu/whlsl/increment-decrement-expected.txt: Removed.
* webgpu/whlsl/increment-decrement.html: Removed.
* webgpu/whlsl/increment-setter-expected.txt: Removed.
* webgpu/whlsl/increment-setter.html: Removed.
* webgpu/whlsl/index-getter-setter-expected.txt: Removed.
* webgpu/whlsl/index-getter-setter.html: Removed.
* webgpu/whlsl/int-bit-math-expected.txt: Removed.
* webgpu/whlsl/int-bit-math.html: Removed.
* webgpu/whlsl/int-literal-compare-expected.txt: Removed.
* webgpu/whlsl/int-literal-compare.html: Removed.
* webgpu/whlsl/js/test-harness.js: Removed.
* webgpu/whlsl/length-stdlib-expected.txt: Removed.
* webgpu/whlsl/length-stdlib.html: Removed.
* webgpu/whlsl/lexing-expected.txt: Removed.
* webgpu/whlsl/lexing.html: Removed.
* webgpu/whlsl/literals-expected.txt: Removed.
* webgpu/whlsl/literals.html: Removed.
* webgpu/whlsl/logical-negation-expected.txt: Removed.
* webgpu/whlsl/logical-negation.html: Removed.
* webgpu/whlsl/loops-break-expected.html: Removed.
* webgpu/whlsl/loops-break.html: Removed.
* webgpu/whlsl/loops-continue-expected.html: Removed.
* webgpu/whlsl/loops-continue.html: Removed.
* webgpu/whlsl/loops-expected.html: Removed.
* webgpu/whlsl/loops-spec-tests-expected.txt: Removed.
* webgpu/whlsl/loops-spec-tests.html: Removed.
* webgpu/whlsl/loops.html: Removed.
* webgpu/whlsl/lots-of-local-variables-expected.txt: Removed.
* webgpu/whlsl/lots-of-local-variables.html: Removed.
* webgpu/whlsl/lvalues-expected.txt: Removed.
* webgpu/whlsl/lvalues.html: Removed.
* webgpu/whlsl/make-array-ref-spec-tests-expected.txt: Removed.
* webgpu/whlsl/make-array-ref-spec-tests.html: Removed.
* webgpu/whlsl/make-array-reference-expected.txt: Removed.
* webgpu/whlsl/make-array-reference.html: Removed.
* webgpu/whlsl/matrices-spec-tests-expected.txt: Removed.
* webgpu/whlsl/matrices-spec-tests.html: Removed.
* webgpu/whlsl/matrix-2-expected.txt: Removed.
* webgpu/whlsl/matrix-2.html: Removed.
* webgpu/whlsl/matrix-alignment-expected.txt: Removed.
* webgpu/whlsl/matrix-alignment.html: Removed.
* webgpu/whlsl/matrix-compare-expected.txt: Removed.
* webgpu/whlsl/matrix-compare.html: Removed.
* webgpu/whlsl/matrix-constructors-expected.txt: Removed.
* webgpu/whlsl/matrix-constructors-list-of-scalars-expected.txt: Removed.
* webgpu/whlsl/matrix-constructors-list-of-scalars.html: Removed.
* webgpu/whlsl/matrix-constructors.html: Removed.
* webgpu/whlsl/matrix-expected.txt: Removed.
* webgpu/whlsl/matrix-index-assign-expected.txt: Removed.
* webgpu/whlsl/matrix-index-assign.html: Removed.
* webgpu/whlsl/matrix-index-order-expected.txt: Removed.
* webgpu/whlsl/matrix-index-order.html: Removed.
* webgpu/whlsl/matrix-memory-layout-expected.txt: Removed.
* webgpu/whlsl/matrix-memory-layout.html: Removed.
* webgpu/whlsl/matrix.html: Removed.
* webgpu/whlsl/nested-dot-expression-rvalue-expected.html: Removed.
* webgpu/whlsl/nested-dot-expression-rvalue.html: Removed.
* webgpu/whlsl/nested-loop-expected.html: Removed.
* webgpu/whlsl/nested-loop.html: Removed.
* webgpu/whlsl/null-arg-expected.txt: Removed.
* webgpu/whlsl/null-arg.html: Removed.
* webgpu/whlsl/null-array-property-access-expected.txt: Removed.
* webgpu/whlsl/null-array-property-access.html: Removed.
* webgpu/whlsl/null-array-ref.html: Removed.
* webgpu/whlsl/oob-access-2-expected.txt: Removed.
* webgpu/whlsl/oob-access-2.html: Removed.
* webgpu/whlsl/oob-access-expected.txt: Removed.
* webgpu/whlsl/oob-access.html: Removed.
* webgpu/whlsl/operator-div-expected.txt: Removed.
* webgpu/whlsl/operator-div.html: Removed.
* webgpu/whlsl/operator-equal-equal-expected.txt: Removed.
* webgpu/whlsl/operator-equal-equal.html: Removed.
* webgpu/whlsl/operator-minus-expected.txt: Removed.
* webgpu/whlsl/operator-minus.html: Removed.
* webgpu/whlsl/operator-overload-expected.txt: Removed.
* webgpu/whlsl/operator-overload.html: Removed.
* webgpu/whlsl/operator-plus-expected.txt: Removed.
* webgpu/whlsl/operator-plus.html: Removed.
* webgpu/whlsl/operator-syntax-expected.txt: Removed.
* webgpu/whlsl/operator-syntax.html: Removed.
* webgpu/whlsl/operator-times-expected.txt: Removed.
* webgpu/whlsl/operator-times.html: Removed.
* webgpu/whlsl/operator-vector-assign-expected.txt: Removed.
* webgpu/whlsl/operator-vector-assign.html: Removed.
* webgpu/whlsl/operator-vector-load-expected.txt: Removed.
* webgpu/whlsl/operator-vector-load.html: Removed.
* webgpu/whlsl/operator-xy-expected.txt: Removed.
* webgpu/whlsl/operator-xy.html: Removed.
* webgpu/whlsl/overload-expected.txt: Removed.
* webgpu/whlsl/overload.html: Removed.
* webgpu/whlsl/plus-equals-expected.txt: Removed.
* webgpu/whlsl/plus-equals.html: Removed.
* webgpu/whlsl/pointer-spec-tests-expected.txt: Removed.
* webgpu/whlsl/pointer-spec-tests.html: Removed.
* webgpu/whlsl/postfix-prefix-expected.txt: Removed.
* webgpu/whlsl/postfix-prefix.html: Removed.
* webgpu/whlsl/property-evaluation-order-expected.txt: Removed.
* webgpu/whlsl/property-evaluation-order.html: Removed.
* webgpu/whlsl/read-modify-write-expected.txt: Removed.
* webgpu/whlsl/read-modify-write-high-zombies-expected.txt: Removed.
* webgpu/whlsl/read-modify-write-high-zombies.html: Removed.
* webgpu/whlsl/read-modify-write.html: Removed.
* webgpu/whlsl/recursive-structs-expected.txt: Removed.
* webgpu/whlsl/recursive-structs.html: Removed.
* webgpu/whlsl/return-local-variable-expected.html: Removed.
* webgpu/whlsl/return-local-variable.html: Removed.
* webgpu/whlsl/return-spec-tests-expected.txt: Removed.
* webgpu/whlsl/return-spec-tests.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-10-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-10.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-11-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-11.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-12-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-12.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-13-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-13.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-14-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-14.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-15-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-15.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-16-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-16.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-17-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-17.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-18-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-18.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-19-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-19.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-2-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-2.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-20-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-20.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-21-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-21.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-22-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-22.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-23-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-23.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-24-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-24.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-25-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-25.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-26-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-26.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-27-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-27.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-3-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-3.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-4-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-4.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-5-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-5.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-6-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-6.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-7-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-7.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-8-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-8.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-9-expected.txt: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-9.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-expected.html: Removed.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules.html: Removed.
* webgpu/whlsl/setter-spec-tests-expected.txt: Removed.
* webgpu/whlsl/setter-spec-tests.html: Removed.
* webgpu/whlsl/simple-arrays-expected.txt: Removed.
* webgpu/whlsl/simple-arrays.html: Removed.
* webgpu/whlsl/simple-getter-setter-expected.txt: Removed.
* webgpu/whlsl/simple-getter-setter.html: Removed.
* webgpu/whlsl/simple-tests-expected.txt: Removed.
* webgpu/whlsl/simple-tests.html: Removed.
* webgpu/whlsl/simple-while-loop-expected.txt: Removed.
* webgpu/whlsl/simple-while-loop.html: Removed.
* webgpu/whlsl/smaller-than-32-bit-types-expected.txt: Removed.
* webgpu/whlsl/smaller-than-32-bit-types.html: Removed.
* webgpu/whlsl/sparse-bind-group-2-expected.txt: Removed.
* webgpu/whlsl/sparse-bind-group-2.html: Removed.
* webgpu/whlsl/sparse-bind-group-3-expected.txt: Removed.
* webgpu/whlsl/sparse-bind-group-3.html: Removed.
* webgpu/whlsl/sparse-bind-group-expected.txt: Removed.
* webgpu/whlsl/sparse-bind-group.html: Removed.
* webgpu/whlsl/store-null-expected.txt: Removed.
* webgpu/whlsl/store-null.html: Removed.
* webgpu/whlsl/store-to-property-updates-properly-expected.html: Removed.
* webgpu/whlsl/store-to-property-updates-properly.html: Removed.
* webgpu/whlsl/struct-expected.txt: Removed.
* webgpu/whlsl/struct.html: Removed.
* webgpu/whlsl/structure-field-enumeration-element-clash-expected.txt: Removed.
* webgpu/whlsl/structure-field-enumeration-element-clash.html: Removed.
* webgpu/whlsl/switch-expected.txt: Removed.
* webgpu/whlsl/switch.html: Removed.
* webgpu/whlsl/ternary-spec-test-expected.txt: Removed.
* webgpu/whlsl/ternary-spec-test.html: Removed.
* webgpu/whlsl/test-harness-test-expected.txt: Removed.
* webgpu/whlsl/test-harness-test.html: Removed.
* webgpu/whlsl/textures-getdimensions-expected.txt: Removed.
* webgpu/whlsl/textures-getdimensions.html: Removed.
* webgpu/whlsl/textures-load-expected.html: Removed.
* webgpu/whlsl/textures-load.html: Removed.
* webgpu/whlsl/textures-sample-bias-expected.html: Removed.
* webgpu/whlsl/textures-sample-bias.html: Removed.
* webgpu/whlsl/textures-sample-expected.html: Removed.
* webgpu/whlsl/textures-sample-grad-expected.html: Removed.
* webgpu/whlsl/textures-sample-grad.html: Removed.
* webgpu/whlsl/textures-sample-level-expected.html: Removed.
* webgpu/whlsl/textures-sample-level.html: Removed.
* webgpu/whlsl/textures-sample.html: Removed.
* webgpu/whlsl/two-dimensional-array-expected.txt: Removed.
* webgpu/whlsl/two-dimensional-array.html: Removed.
* webgpu/whlsl/type-mismatch-expected.txt: Removed.
* webgpu/whlsl/type-mismatch.html: Removed.
* webgpu/whlsl/uint-bitwise-expected.txt: Removed.
* webgpu/whlsl/uint-bitwise.html: Removed.
* webgpu/whlsl/use-undefined-variable-2-expected.txt: Removed.
* webgpu/whlsl/use-undefined-variable-2.html: Removed.
* webgpu/whlsl/use-undefined-variable-expected.txt: Removed.
* webgpu/whlsl/use-undefined-variable.html: Removed.
* webgpu/whlsl/variable-shadowing-expected.txt: Removed.
* webgpu/whlsl/variable-shadowing.html: Removed.
* webgpu/whlsl/vector-compare-expected.txt: Removed.
* webgpu/whlsl/vector-compare.html: Removed.
* webgpu/whlsl/vector-constructors-expected.txt: Removed.
* webgpu/whlsl/vector-constructors.html: Removed.
* webgpu/whlsl/vector-matrix-addition-subtraction-expected.txt: Removed.
* webgpu/whlsl/vector-matrix-addition-subtraction.html: Removed.
* webgpu/whlsl/vector-syntax-expected.txt: Removed.
* webgpu/whlsl/vector-syntax.html: Removed.
* webgpu/whlsl/void-variable-parameter-expected.txt: Removed.
* webgpu/whlsl/void-variable-parameter.html: Removed.
* webgpu/whlsl/while-loop-break-expected.html: Removed.
* webgpu/whlsl/while-loop-break.html: Removed.
* webgpu/whlsl/while-loop-continue-expected.html: Removed.
* webgpu/whlsl/while-loop-continue.html: Removed.
* webgpu/whlsl/whlsl-expected.html: Removed.
* webgpu/whlsl/whlsl.html: Removed.
* webgpu/whlsl/wrong-argument-length-expected.txt: Removed.
* webgpu/whlsl/wrong-argument-length.html: Removed.
* webgpu/whlsl/wrong-types-expected.txt: Removed.
* webgpu/whlsl/wrong-types.html: Removed.
* webgpu/whlsl/zero-initialize-values-2-expected.html: Removed.
* webgpu/whlsl/zero-initialize-values-2.html: Removed.
* webgpu/whlsl/zero-initialize-values-expected.html: Removed.
* webgpu/whlsl/zero-initialize-values.html: Removed.

Canonical link: https://commits.webkit.org/240102@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-30 03:53:49 +00:00
Jean-Yves Avenard f1a836c378 [WebAudio] Add webm/opus container support
https://bugs.webkit.org/show_bug.cgi?id=227110
<rdar://problem/79437067>

Reviewed by Jer Noble.

Source/WebCore:

Add support for webm in Web Audio.
As decoding needs to be performed in the web content process we
need to ensure that the decoders are available there. For security
reasons, com.apple.audio.AudioComponentRegistrar mach calls are blocked
which prevents registering a new audio component.
We instead register it in the UI process so that AudioComponentFetchServerRegistrations
SPI can forward the registration in the web process.
Unfortunately, for unknown reasons, this fails for Vorbis audio codec (bug 228139).

To demux the webm content, we use the existing SourceBufferParserWebM to extract all
audio packets. We then iterate over all CM Samples and decode them into PCM, performing
resampling as needed on the fly.
There are things left to fix.
- Opus and Vorbis encoder delay isn't handled (bug 228140) which leaves audible
silence at the beginning of the destination buffer.
- We can only decode mono and stereo content. Opus and Vorbis let you define a
custom channel ordering, this is particularly used with ambisonic audio (with opus 255 mode).
CoreMedia doesn't easily deal with such re-ordering as it appears to be essentially
designed for audible content. With more than 2 channels, decoding will either fail
or produce channels in the wrong order.

Test: webaudio/decode-audio-data-webm-opus.html

* Headers.cmake: Export header so that we can register the decoder in the UI process.
* WebCore.xcodeproj/project.pbxproj: same as above.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType const): Make canPlayType(webm/audio; codecs=opus)
work if features is set.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebMWebAudioEnabled):
(WebCore::RuntimeEnabledFeatures::webMWebAudioEnabled const):
* platform/MediaSample.h: Fly-by fix: remove unnecessary WEBCORE_EXPORT
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::setLength):
* platform/audio/AudioBus.h: Add setLength method. Will change the reported length
without touching the underlying storage.
* platform/audio/AudioChannel.h: Add setLength method. Will change the reported
length without touching the underlying storage.
* platform/audio/cocoa/AudioFileReaderCocoa.cpp:
(WebCore::tryCreateAudioBufferList): Fix checkedInt use to catch potential overflow
(WebCore::AudioBufferListHolder::AudioBufferListHolder): Add convenience class that
free wrapped AudioBufferList object on exit.
(WebCore::AudioBufferListHolder::~AudioBufferListHolder):
(WebCore::AudioBufferListHolder::operator bool const):
(WebCore::AudioBufferListHolder::operator-> const):
(WebCore::AudioBufferListHolder::operator* const):
(WebCore::AudioBufferListHolder::isValid const):
(WebCore::AudioFileReader::AudioFileReader):
(WebCore::AudioFileReader::isMaybeWebM const): Method to check if the buffer
contains WebM data.
(WebCore::passthroughInputDataCallback): Required for AudioConverterFillComplexBuffer.
Will feed the decoder the data to decode, splitting the multiple packets found
in the CMSampleBuffer.
(WebCore::AudioFileReader::numberOfFrames const): Return the total number of
decoded frames in the packets.
(WebCore::AudioFileReader::fileDataFormat const): Create AudioStreamBasicDescription
related to the demuxed audio track. nullopt if unsupported content.
(WebCore::AudioFileReader::clientDataFormat const):
(WebCore::AudioFileReader::createBus):
(WebCore::AudioFileReader::logChannel const):
* platform/audio/cocoa/AudioFileReaderCocoa.h:
* platform/audio/cocoa/AudioSampleDataSource.h: Remove unused typedef.
* platform/audio/cocoa/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::~AudioSampleDataSource): Fly-by fix, make it use
PAL softlinks
(WebCore::AudioSampleDataSource::setupConverter): Fly-by fix, make it use PAL
softlinks
* platform/gamepad/mac/HIDGamepadProvider.mm: Fly-by fix, add missing header.
* platform/graphics/TrackPrivateBase.cpp: Fly-by fix, add missing header.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
Fly-by fix required by webkit-prepare : don't tag the whole class as WEBCORE_EXPORT.
Move constructor and destructor function definitions out-of-line to prevent
linkage errors.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Move code
* platform/graphics/cocoa/WebCoreDecompressionSession.mm: Fly-by fix, add missing header.
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h: Export some symbols, add new
method definitions.
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:
(WebCore::registerDecoderFactory): Instead of attempting to register the decoder
by dl-opening the required library, first attempting to see if the decoder is
already available. Calling AudioComponentRegister in the web content process
when the GPU process is enabled will fail due to sandbox settings. Which would
incorrectly report the codec to not be available when it was.
(WebCore::createAudioFormatDescriptionForFormat):
(WebCore::isOpusDecoderAvailable): Fly-by fix, should the method be called
on non-mac platform it would have return the unitialized value of the available
static variable.
(WebCore::registerOpusDecoderIfNeeded): Added
(WebCore::isVorbisDecoderAvailable): Same as isOpusDecoderAvailable
(WebCore::registerVorbisDecoderIfNeeded): Added

Source/WebCore/PAL:

Add various AVFoundation (AVAudioConverter) related methods and
CoreMedia to access required CMSampleBuffer related methods.

* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:
* pal/cocoa/AVFoundationSoftLink.h:
* pal/cocoa/AVFoundationSoftLink.mm:

Source/WebKit:

Add default value for webm_webaudio feature flag for the different platforms.
Disabled by default on all platforms.
Fly-by fix: don't make webm parser dependent on VP9 support.

* FeatureFlags/WebKit-appletvos.plist:
* FeatureFlags/WebKit-ios.plist:
* FeatureFlags/WebKit-macos.plist:
* FeatureFlags/WebKit-watchos.plist:
* GPUProcess/GPUProcess.h:
* GPUProcess/GPUProcess.messages.in:
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultWebMWebAudioEnabled):
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::sendAudioComponentRegistrations):

Source/WTF:

Add WebMWebAudioEnabled preference to make canPlayType return probably for mimetype:
"audio/webm; codecs=opus"
Disabled by default.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

* platform/mac/TestExpectations: Only enable test on macOS Monterey
* webaudio/decode-audio-data-basic.html: fix whitespace
* webaudio/decode-audio-data-webm-opus-expected.txt: Added.
* webaudio/decode-audio-data-webm-opus.html: Added.
* webaudio/resources/media/opus.webm: Added.
* webaudio/resources/media/vorbis.webm: Added.


Canonical link: https://commits.webkit.org/240056@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-29 04:18:16 +00:00
Jer Noble 0c05aaec18 [Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
https://bugs.webkit.org/show_bug.cgi?id=228299
<rdar://80802982>

Reviewed by Eric Carlson.

Source/WebKit:

Tie registering for GroupActivities notifications to the MediaSessionCoordinatorEnabled
WebPreference, and make the default value for that preference depend on having the
"com.apple.developer.group-session.urlactivity" entitlement. All WebKit clients with
that entitlement will have the preference enabled by default; all other clients will
have that preference disabled by default.

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultMediaSessionCoordinatorEnabled):
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::m_limitsNavigationsToAppBoundDomains):
(WebKit::WebPageProxy::~WebPageProxy):
(WebKit::WebPageProxy::didCommitLoadForFrame):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:


Canonical link: https://commits.webkit.org/239974@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-27 00:06:18 +00:00
Jer Noble f8247a6613 [iOS] All home screen web apps resume when any home screen web app is foregrounded
https://bugs.webkit.org/show_bug.cgi?id=228246
<rdar://72949281>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-page-visibility-restriction.html

On iOS, home screen web apps all run from the same UIProcess, SafariViewService. So when
one Web App is foregrounded, the SafariViewService itself is foregrounded, and all WKWebViews
(one for each Web App) are foregrounded as well, allowing all Web Apps to resume audio
playback. This is not ideal; ideally, all Web Apps will be allowed to continue to play
audio in the background. But until we can fix that bug, the current behavior of pausing
audio from Web App A when A is backgrounded, and resuming audio from A when Web App B is
foregrounded feels super broken.

Add a new WKPreference/WebPreference/Setting and matching MediaElementSession restriction
that will block playback of audible media elements when the media element's page is not
visible. When adopted by SafariViewService, this would keep multiple Web Apps (and indeed
SafariViewController pages) from starting playback when any other is foregrounded.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::initializeMediaSession):
(WebCore::HTMLMediaElement::visibilityStateChanged):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::visibilityChanged):
(WebCore::MediaElementSession::playbackStateChangePermitted const):
* html/MediaElementSession.h:
* platform/audio/PlatformMediaSession.h:
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions):

Source/WebKit:

Add a private WKPreference for setting the new WebPreference.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _requiresPageVisibilityToPlayAudio]):
(-[WKPreferences _setRequiresPageVisibilityToPlayAudio:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:

LayoutTests:

* media/video-page-visibility-restriction-expected.txt: Added.
* media/video-page-visibility-restriction.html: Added.


Canonical link: https://commits.webkit.org/239951@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-26 17:51:09 +00:00
Philippe Normand 423aa6c327 [GLib] Remove libportal dependency
https://bugs.webkit.org/show_bug.cgi?id=228056

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/FindLIBPORTAL.cmake: Removed.
* Source/cmake/GStreamerChecks.cmake:

Source/WebCore:

The pure-GDBus approach allows us to request the input device (Monitor or Window) depending
on the CaptureDevice type and make the mouse cursor visible in the generated video stream.
Also requesting capture support within computeCaptureDevices() was a bad idea because this
being used by the enumerateMediaDevices API could potentially spam the user with permission
popups.

* platform/GStreamer.cmake:
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:
* platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp: Added.
(WebCore::GStreamerDisplayCaptureDeviceManager::singleton):
(WebCore::GStreamerDisplayCaptureDeviceManager::GStreamerDisplayCaptureDeviceManager):
(WebCore::GStreamerDisplayCaptureDeviceManager::~GStreamerDisplayCaptureDeviceManager):
(WebCore::GStreamerDisplayCaptureDeviceManager::computeCaptureDevices):
(WebCore::GStreamerDisplayCaptureDeviceManager::createDisplayCaptureSource):
(WebCore::GStreamerDisplayCaptureDeviceManager::stopSource):
(WebCore::GStreamerDisplayCaptureDeviceManager::waitResponseSignal):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::createPipewireSource):
(WebCore::GStreamerVideoCaptureSource::factory):
(WebCore::GStreamerVideoCaptureSource::displayFactory):
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
(WebCore::GStreamerVideoCaptureSource::stopProducingData):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen capture on GStreamer
ports. The PIPEWIRE ifdef is redundant.

Canonical link: https://commits.webkit.org/239909@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-23 10:51:17 +00:00
Jean-Yves Avenard 2b12755e87 [Wk1] media/media-source/media-webm-opus-partial.html is a consistent failure (Enable VP8/VP9/Vorbis/Opus in WebKitLegacy)
https://bugs.webkit.org/show_bug.cgi?id=228005
rdar://80346720

Reviewed by Jer Noble.

Source/WebCore:

There are already tests running under Wk1 that will exercise this code (and will no longer fail)

* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::setVorbisDecoderEnabled):
Carry settings to PlatformMediaSessionManager
(WebCore::RuntimeEnabledFeatures::setOpusDecoderEnabled):
Carry settings to PlatformMediaSessionManager
* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferencesDefaultValues.cpp:
* Shared/WebPreferencesDefaultValues.h: Don't make webm parser conditional on VP9
being enabled; it's used with other codecs too and is codec-agnostic to start with.

Source/WebKitLegacy/mac:

* WebView/WebPreferencesDefaultValues.h: Add relevant settings getter methods.
* WebView/WebPreferencesDefaultValues.mm:
(WebKit::defaultWebMParserEnabled):
(WebKit::defaultVP8DecoderEnabled):
(WebKit::defaultVP9DecoderEnabled):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable VP8/VP9/Vorbis/Opus
codecs for WebKitLegacy, no reasons they weren't already enabled.


Canonical link: https://commits.webkit.org/239717@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-16 02:09:39 +00:00
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
Philippe Normand 1941d20ae5 [GStreamer][Pipewire] Implement getDisplayMedia() backend
https://bugs.webkit.org/show_bug.cgi?id=210926

Reviewed by Xabier Rodriguez-Calvar.

.:

* Source/cmake/FindLIBPORTAL.cmake: Added.
* Source/cmake/GStreamerChecks.cmake: Enable Pipewire support if libportal was found.

Source/WebCore:

Display capture is now supported by GStreamer ports. When requested, the capture device
manager queries the host through the libportal API. The user is presented with a prompt
allowing to select either a monitor or an application window. Once selected, the manager
creates the associated CaptureDevice, passing the pipewire file descriptor along. The
existing GStreamer video capture source infrastructure is reused, leveraging the GStreamer
pipewiresrc element to generate a live video stream of the display device.

As display capture devices need to respect the aspect-ratio of the video frame, taking into
account max-{widther,height}, some code was reused from the Cocoa display capture code and
placed in RealtimeVideoCaptureSource as ensureIntrinsicSizeMaintainsAspectRatio().

Unfortunately this aspect-ratio enforcing feature is currently used only for mock capture
sources. The GStreamer pipewiresrc doesn't support caps renegotiation well yet, so we can't
comply with the aspect-ratio enforcing, for the time being.

This patch is covered by newly unskipped layout tests and API tests.

* platform/GStreamer.cmake:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setIntrinsicSize):
(WebCore::RealtimeMediaSource::hashedId const):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::ensureIntrinsicSizeMaintainsAspectRatio):
* platform/mediastream/RealtimeVideoCaptureSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::sourceSettingsChanged):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerDisplayCaptureDeviceManager::GStreamerDisplayCaptureDeviceManager):
(WebCore::GStreamerDisplayCaptureDeviceManager::~GStreamerDisplayCaptureDeviceManager):
(WebCore::GStreamerDisplayCaptureDeviceManager::computeCaptureDevices):
(WebCore::GStreamerDisplayCaptureDeviceManager::setSession):
(WebCore::GStreamerDisplayCaptureDeviceManager::sessionStarted):
(WebCore::GStreamerDisplayCaptureDeviceManager::notifyClient):
(WebCore::GStreamerDisplayCaptureDeviceManager::sessionWasClosed):
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::GStreamerCapturer):
(WebCore::GStreamerCapturer::Observer::~Observer):
(WebCore::GStreamerCapturer::addObserver):
(WebCore::GStreamerCapturer::removeObserver):
(WebCore::GStreamerCapturer::forEachObserver):
(WebCore::GStreamerCapturer::createSource):
* platform/mediastream/gstreamer/GStreamerCapturer.h:
(WebCore::GStreamerCapturer::Observer::sourceCapsChanged):
(WebCore::GStreamerCapturer::deviceType const):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create):
(WebCore::GStreamerVideoCaptureSource::createPipewireSource):
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
(WebCore::m_deviceType):
(WebCore::GStreamerVideoCaptureSource::~GStreamerVideoCaptureSource):
(WebCore::GStreamerVideoCaptureSource::sourceCapsChanged):
(WebCore::GStreamerVideoCaptureSource::startProducingData):
(WebCore::GStreamerVideoCaptureSource::stopProducingData):
(WebCore::m_capturer): Deleted.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::initializeDebugCategory):
(WebCore::GStreamerVideoCapturer::GStreamerVideoCapturer):
(WebCore::GStreamerVideoCapturer::createSource):
(WebCore::GStreamerVideoCapturer::setPipewireFD):
(WebCore::GStreamerVideoCapturer::setSize):
(WebCore::GStreamerVideoCapturer::setFrameRate):
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
(WebCore::MockRealtimeVideoSource::create):
(WebCore::MockRealtimeVideoSourceGStreamer::createMockDisplayCaptureSource):
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::capabilities):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen-capture if libportal
was found.

LayoutTests:

* platform/glib/TestExpectations: Unskip now-passing getDisplayMedia tests.

Canonical link: https://commits.webkit.org/239684@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-15 11:48:58 +00:00
Brent Fulgham 3d517b4d92 [Cocoa] Expose SPI to opt out of Extensible SSO authentication
https://bugs.webkit.org/show_bug.cgi?id=227729
<rdar://problem/75647892>

Reviewed by Tim Horton.

Source/WebKit:

WKWebView clients should be able to disable Extensible SSO authentication flows, so exposing the internal
mechanism as SPI. This is especially important for use cases where a WKWebView will be used to load content
without being attached to a Window, since a Window is required to present the Extensible SSO authentication
UI. Without a Window, WebKit will wait for a Window to be attached causing loads to timeout. By adopting this
API, developers can opt out of Extensible SSO, allowing loads to fail quickly rather than waiting for a timeout.

Tested by a new TestWebKitAPI test case: SOAuthorizationRedirect.DisableSSO

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _extensibleSSOEnabled]): Add getter for new preference.
(-[WKPreferences _setExtensibleSSOEnabled:]): Add setter.
* UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
(WebKit::NavigationSOAuthorizationSession::shouldStartInternal): Add new logging so developers can see when a WKWebView
without a Window is attempting to participate in Extensible SSO flows.
* UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
(WebKit::PopUpSOAuthorizationSession::initSecretWebView): Switch from SPI to API.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Ditto.
* UIProcess/WebPageProxy.h:

Source/WTF:

Create new WKPreference to allow WebKit clients to opt out of Extensible SSO authentication.

* Scripts/Preferences/WebPreferences.yaml:

Tools:

Add a new test to confirm that Extenstible SSO authentication flows are bypassed when the new WKPreference
is used. Updated other tests to confirm that the SSO delegate is called when expected.

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(-[TestSOAuthorizationDelegate _webView:decidePolicyForSOAuthorizationLoadWithCurrentPolicy:forExtension:completionHandler:]):
(resetState):
(TestWebKitAPI::TEST):


Canonical link: https://commits.webkit.org/239528@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-08 22:13:59 +00:00
Brent Fulgham ce84f68415 [macOS] Only use WebGL on Metal by default on safe versions of macOS
https://bugs.webkit.org/show_bug.cgi?id=227633
<rdar://problem/78527887>

Reviewed by Dean Jackson.

Tested by WebGL test suite.

* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformHave.h:


Canonical link: https://commits.webkit.org/239374@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-02 23:21:00 +00:00
Youenn Fablet f14eb5cfe1 [Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
LayoutTests/imported/w3c:

Reviewed by Eric Carlson.

Rebasing tests as timing changes a bit.
This aligns with Chrome and Firefox behavior.

* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:

Source/ThirdParty/libwebrtc:

Reviewed by Eric Carlson.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Reviewed by Eric Carlson.

Add infrastructure to new experimental feature flag for NW backed UDP sockets.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCPlatformTCPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformTCPSocketsEnabled):
(WebCore::RuntimeEnabledFeatures::webRTCPlatformUDPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformUDPSocketsEnabled):

Source/WebKit:

Reviewed by Eric Carlson.

Migrate UDP socket handling from WebRTC physical socket server to nw API for Cocoa ports.

For each UDP socket opened, we open a nw_listener that will listen to inbound connections.
On inbound connection, we receive a nw_connection that we store in a address -> connection map.

Whenever sending a packet, we look at the remote address.
If needed, we create a nw_connection to that particular remote address and store it in the address -> connection map.
We then use the pre-existing or newly created nw_connection to send the packet.

Make sure to cancel NW connection in case of failure before releasing the socket.

Covered by existing tests

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
(WebKit::NetworkRTCProvider::setPlatformTCPSocketsEnabled):
(WebKit::NetworkRTCProvider::setPlatformUDPSocketsEnabled):
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.h.
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: Renamed from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm.
(WebKit::tcpSocketQueue):
(WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket):
(WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa):
(WebKit::NetworkRTCTCPSocketCocoa::close):
(WebKit::NetworkRTCTCPSocketCocoa::setOption):
(WebKit::NetworkRTCTCPSocketCocoa::createMessageBuffer):
(WebKit::NetworkRTCTCPSocketCocoa::sendTo):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: Added.
(WTF::DefaultHash<rtc::SocketAddress>::hash):
(WTF::DefaultHash<rtc::SocketAddress>::equal):
(WTF::HashTraits<rtc::SocketAddress>::emptyValue):
(WTF::HashTraits<rtc::SocketAddress>::constructDeletedValue):
(WTF::HashTraits<rtc::SocketAddress>::isDeletedValue):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: Added.
(WebKit::NetworkRTCUDPSocketCocoaConnections::create):
(WebKit::NetworkRTCUDPSocketCocoaConnections::WTF_GUARDED_BY_LOCK):
(WebKit::udpSocketQueue):
(WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket):
(WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::~NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::close):
(WebKit::NetworkRTCUDPSocketCocoa::setOption):
(WebKit::NetworkRTCUDPSocketCocoa::sendTo):
(WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections):
(WebKit::NetworkRTCUDPSocketCocoaConnections::close):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setOption):
(WebKit::processUDPData):
(WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setupNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::sendTo):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::setConnection):

Source/WTF:

Reviewed by Eric Carlson.

Add a new experimental flag for NW backed UDP sockets.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

<rdar://problem/79859045>

Reviewed by Eric Carlson.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as failed, as this test is using unsupported API (transport).


Canonical link: https://commits.webkit.org/239317@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 10:37:39 +00:00
Truitt Savell 6a8d0a29e8 Unreviewed, reverting r279405.
Casued 50+ webrtc crashes on Big Sur Debug

Reverted changeset:

"[Cocoa] Migrate WebRTC UDP socket handling to NW API"
https://bugs.webkit.org/show_bug.cgi?id=227210
https://commits.webkit.org/r279405

Canonical link: https://commits.webkit.org/239291@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-30 21:16:16 +00:00
Youenn Fablet 737bcaa98a [Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
LayoutTests/imported/w3c:

Reviewed by Eric Carlson.

Rebasing tests as timing changes a bit.
This aligns with Chrome and Firefox behavior.

* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:

Source/ThirdParty/libwebrtc:

Reviewed by Eric Carlson.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Reviewed by Eric Carlson.

Add infrastructure to new experimental feature flag for NW backed UDP sockets.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCPlatformTCPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformTCPSocketsEnabled):
(WebCore::RuntimeEnabledFeatures::webRTCPlatformUDPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformUDPSocketsEnabled):

Source/WebKit:

Reviewed by Eric Carlson.

Migrate UDP socket handling from WebRTC physical socket server to nw API for Cocoa ports.

For each UDP socket opened, we open a nw_listener that will listen to inbound connections.
On inbound connection, we receive a nw_connection that we store in a address -> connection map.

Whenever sending a packet, we look at the remote address.
If needed, we create a nw_connection to that particular remote address and store it in the address -> connection map.
We then use the pre-existing or newly created nw_connection to send the packet.

Make sure to cancel NW connection in case of failure before releasing the socket.

Covered by existing tests

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
(WebKit::NetworkRTCProvider::setPlatformTCPSocketsEnabled):
(WebKit::NetworkRTCProvider::setPlatformUDPSocketsEnabled):
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.h.
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: Renamed from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm.
(WebKit::tcpSocketQueue):
(WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket):
(WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa):
(WebKit::NetworkRTCTCPSocketCocoa::close):
(WebKit::NetworkRTCTCPSocketCocoa::setOption):
(WebKit::NetworkRTCTCPSocketCocoa::createMessageBuffer):
(WebKit::NetworkRTCTCPSocketCocoa::sendTo):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: Added.
(WTF::DefaultHash<rtc::SocketAddress>::hash):
(WTF::DefaultHash<rtc::SocketAddress>::equal):
(WTF::HashTraits<rtc::SocketAddress>::emptyValue):
(WTF::HashTraits<rtc::SocketAddress>::constructDeletedValue):
(WTF::HashTraits<rtc::SocketAddress>::isDeletedValue):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: Added.
(WebKit::NetworkRTCUDPSocketCocoaConnections::create):
(WebKit::NetworkRTCUDPSocketCocoaConnections::WTF_GUARDED_BY_LOCK):
(WebKit::udpSocketQueue):
(WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket):
(WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::~NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::close):
(WebKit::NetworkRTCUDPSocketCocoa::setOption):
(WebKit::NetworkRTCUDPSocketCocoa::sendTo):
(WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections):
(WebKit::NetworkRTCUDPSocketCocoaConnections::close):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setOption):
(WebKit::processUDPData):
(WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setupNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::sendTo):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::setConnection):

Source/WTF:

Reviewed by Eric Carlson.

Add a new experimental flag for NW backed UDP sockets.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

<rdar://problem/79859045>

Reviewed by Eric Carlson.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as failed, as this test is using unsupported API (transport).


Canonical link: https://commits.webkit.org/239270@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-30 08:46:38 +00:00
Dana Estra ea34dd95cc Refactor MacOS keyboard scrolling and use KeyboardScroll struct
https://bugs.webkit.org/show_bug.cgi?id=226986

Patch by Dana Estra <destra@apple.com> on 2021-06-28
Reviewed by Tim Horton.
Source/WebCore:

No tests yet.

* page/EventHandler.cpp:
(WebCore::EventHandler::defaultSpaceEventHandler):

Added usage of switch EventDrivenSmoothKeyboardScrolling
that when enabled sends KeyboardEvent to
HandleKeyboardScrolling.

(WebCore::EventHandler::scrollDistance):
(WebCore::EventHandler::handleKeyboardScrolling):

Makes KeyboardScroll and calls scrollRecursively.

(WebCore::EventHandler::defaultArrowEventHandler):

Added usage of switch EventDrivenSmoothKeyboardScrolling
that when enabled sends KeyboardEvent to
HandleKeyboardScrolling.

* page/EventHandler.h:
* page/KeyboardScroll.cpp: Added.
* page/KeyboardScroll.h: Added.

Source/WebKit:

In addition to notes underneath, changed usage of WebKit::KeyboardScroll, WebKit::ScrollingIncrement, and WebKit::ScrollingDirection to
WebCore::KeyboardScroll, WebCore::ScrollGranularity, and WebCore::ScrollDirection, respectively.

* UIProcess/ios/WKKeyboardScrollingAnimator.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator parameters]):

Deleted. Now lives in WebCore/KeyboardScroll.h.

(unitVector):

Deleted. Now lives in WebCore/KeyboardScroll.h.

(perpendicularAbsoluteUnitVector):
(boxSide):
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
(-[WKKeyboardScrollingAnimator beginWithEvent:]):
(farthestPointInDirection):
(-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleEditingKeyboardEvent):
(WebKit::WebPage::performNonEditingBehaviorForSelector):

Added switch that removes selectors that are now handled by
EventHandler when EventHandlerDrivenSmoothKeyboardScrolling
is enabled.

Canonical link: https://commits.webkit.org/239223@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-29 00:39:15 +00:00
Kenneth Russell 878015bc0d Set ImageBitmap experimental feature flag to true
https://bugs.webkit.org/show_bug.cgi?id=227140

Patch by Kenneth Russell <kbr@chromium.org> on 2021-06-25
Reviewed by Dean Jackson.

Web developers - most recently Google's Meet team - have asked for
ImageBitmap support in WebKit. The implementation was
substantially upgraded during development of WebGL 2.0, and is
thoroughly tested on the EWS. Change the default value for
ImageBitmap's experimental flag to true; this can be removed
completely after one release cycle.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Canonical link: https://commits.webkit.org/239173@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-25 20:50:25 +00:00
Wenson Hsieh f81550c124 [Live Text] [macOS] Add an internal option to disable inline text selection in images
https://bugs.webkit.org/show_bug.cgi?id=227265
rdar://79460142

Reviewed by Tim Horton.

Source/WebCore:

Add support for the new feature flag. See WebKit/ChangeLog for more details.

* en.lproj/Localizable.strings:

Add additional localizable strings to represent each of the possible titles for the "Quick Look"/"Look Up"
context menu item. When inline text selection is enabled, the item shows up as "Look Up", and is only added if
we actually discover visual search results.

However, when inline text selection is disabled, this item will always be added to the context menu under the
title "Quick Look", and will be retitled to either "Look Up in Quick Look" or "Select Text in Quick Look" once
either visual search results or text is recognized, respectively.

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):

In the case where inline text selection is disabled, add the Quick Look item to the end of the context menu,
after a separator. Note that in the case where inline text selection is enabled, it doesn't actually matter
where we add this item, since it is automatically removed and only reinserted if we find visual search results
for the image.

(WebCore::ContextMenuController::checkOrEnableIfNeeded const):

Rename the existing ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage, since it is no longer
limited to the visual look up feature.

* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):

Consult the feature flag and avoid kicking off the text recognition timer if inline text selection is disabled.

* platform/ContextMenuItem.cpp:
(WebCore::isValidContextMenuAction):
* platform/ContextMenuItem.h:
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagQuickLookImage):
(WebCore::contextMenuItemTagQuickLookImageForTextSelection):
(WebCore::contextMenuItemTagQuickLookImageForVisualSearch):

Source/WebKit:

Refactor Live Text and Visual Look Up logic, such that the ability to select text inside of images is behind an
internal feature flag that can be toggled at runtime. When Live Text is disabled, we'll unconditionally show the
"Look Up" context menu action using the more generic title "Quick Look". This "Quick Look" action is then
retitled to either "Look Up in Quick Look" or "Select Text in Quick Look" once image analysis completes.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):

Rename ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage.

* UIProcess/Cocoa/QuickLookPreviewActivity.h: Copied from Source/WebKit/UIProcess/mac/WKQuickLookPreviewController.h.

Move this enum out of WKQuickLookPreviewController.h, such that we can use and import it in non-Cocoa headers
and implementation files.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::computeHasImageAnalysisResults):

Rename `computeHasVisualSearchResults` to `computeHasImageAnalysisResults`, and allow it to take a flag to
indicate whether or not it should request text recognition results or visual search results. We use this for the
"Quick Look" context menu action when inline text selection is disabled, in order to retitle the item to "Select
Text in Quick Look".

(WebKit::WebViewImpl::computeHasVisualSearchResults): Deleted.
* UIProcess/PageClient.h:
(WebKit::PageClient::computeHasImageAnalysisResults):
(WebKit::PageClient::computeHasVisualSearchResults): Deleted.
* UIProcess/WebContextMenuProxy.h:
(WebKit::WebContextMenuProxy::quickLookPreviewActivity const):

Add a flag to WebContextMenuProxy to determine what initial activity to use when presenting the QuickLook
preview panel after selecting the ContextMenuItemTagQuickLookImage item.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):
(WebKit::WebPageProxy::computeHasImageAnalysisResults):
(WebKit::WebPageProxy::computeHasVisualSearchResults): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::computeHasImageAnalysisResults):
(WebKit::PageClientImpl::computeHasVisualSearchResults): Deleted.
* UIProcess/mac/WKQuickLookPreviewController.h:
* UIProcess/mac/WKQuickLookPreviewController.mm:
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::menuItemIdentifier):
(WebKit::WebContextMenuProxyMac::getContextMenuFromItems):

Add logic to either remove and reinsert the "Look Up" context menu action (if inline text selection in images is
enabled), or to promote the "Quick Look" context menu action to either "Select Text in Quick Look" or "Look Up
in Quick Look" in the case where inline text selection in images is disabled.

Note that when inline text selection in images is disabled, we'll first check for visual search results before
checking for text. This is because visual search results will take precedence over text selection (i.e., we'll
show "Look Up in Quick Look" even if both visual search results and text is present), so we can avoid performing
text analysis in the case where we already found visual search results.

(WebKit::WebContextMenuProxyMac::insertOrUpdateQuickLookImageItem):
(WebKit::WebContextMenuProxyMac::updateQuickLookContextMenuItemTitle):

Add a helper method to find and update the title of the NSMenuItem corresponding to
ContextMenuItemTagQuickLookImage. See `getContextMenuFromItems` above for more details.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::handleContextMenuQuickLookImage):
(WebKit::WebPageProxy::handleContextMenuLookUpImage): Deleted.

Rename this to `handleContextMenuQuickLookImage`, and have it take an argument to indicate whether the QuickLook
panel should start out in Visual Look Up mode.

* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

Rename ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage.

* WebView/WebHTMLView.mm:
(toTag):

Source/WTF:

Add a new internal feature flag. See WebKit ChangeLog for more details.

* Scripts/Preferences/WebPreferencesInternal.yaml:


Canonical link: https://commits.webkit.org/239061@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 01:32:54 +00:00
Alex Christensen d230ad72a7 Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize
https://bugs.webkit.org/show_bug.cgi?id=226629

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

* web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt:
* web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt:
* web-platform-tests/navigation-timing/test_document_onload-expected.txt:
* web-platform-tests/resource-timing/TAO-case-insensitive-null-opaque-origin.sub-expected.txt:
* web-platform-tests/resource-timing/TAO-crossorigin-port.sub-expected.txt:
* web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt:
This apparent regression is actually just uncovering an existing failure.
The test expects the sum of many values to not be equal to zero.
It used to be adding undefined to many 0 values, which returned undefined, which is not equal to zero.
Now it's adding 0's and getting 0 which correctly indicates that we are not exposing timing values where we should.
* web-platform-tests/resource-timing/cors-preflight.any-expected.txt:
* web-platform-tests/resource-timing/cors-preflight.any.worker-expected.txt:
* web-platform-tests/resource-timing/idlharness.any-expected.txt:
* web-platform-tests/resource-timing/idlharness.any.worker-expected.txt:
* web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt:
* web-platform-tests/resource-timing/resource_connection_reuse-expected.txt:
* web-platform-tests/resource-timing/resource_connection_reuse.https-expected.txt:
* web-platform-tests/resource-timing/single-entry-per-resource-expected.txt:
* web-platform-tests/resource-timing/test_resource_timing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/resource-timing-cross-origin.https-expected.txt:

Source/WebCore:

The tests for TAO are entangled with the tests for these properties.  Having an implementation helps see what is still broken.
Covered by web platform tests.

* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::transferSize const):
(WebCore::PerformanceResourceTiming::encodedBodySize const):
(WebCore::PerformanceResourceTiming::decodedBodySize const):
* page/PerformanceResourceTiming.h:
* page/PerformanceResourceTiming.idl:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

* performance-api/resource-timing-apis-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt: Removed.



Canonical link: https://commits.webkit.org/238495@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-04 18:35:42 +00:00
Alex Christensen 9303ca8b34 Add support for Navigation Timing Level 2
https://bugs.webkit.org/show_bug.cgi?id=184363

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/navigation-timing/META.yml: Added.
* web-platform-tests/navigation-timing/dom_interactive_image_document-expected.txt: Added.
* web-platform-tests/navigation-timing/dom_interactive_image_document.html: Added.
* web-platform-tests/navigation-timing/dom_interactive_media_document-expected.txt: Added.
* web-platform-tests/navigation-timing/dom_interactive_media_document.html: Added.
* web-platform-tests/navigation-timing/idlharness.window.js:
* web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_attributes_exist.html: Added.
This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl
* web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_attributes_values.html: Added.
This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl
* web-platform-tests/navigation-timing/nav2_test_document_open-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_document_open.html:
* web-platform-tests/navigation-timing/nav2_test_document_replaced-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_document_replaced.html:
* web-platform-tests/navigation-timing/nav2_test_frame_removed-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start.html:
* web-platform-tests/navigation-timing/nav2_test_instance_accessors-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_instance_accessors.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_iframe-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_within_document-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_navigate_within_document.html:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward.html:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_reload-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_reload.html:
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin-expected.txt: Added.
This test fails because our test infrastructure doesn't support loading from www.localhost.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html: Copied from LayoutTests/imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in-expected.txt:
This test fails because our test infrastructure doesn't support loading from www.localhost.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html:
* web-platform-tests/navigation-timing/nav2_test_redirect_none-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_none.html: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_server-expected.txt:
This test failure needs further investigation.
* web-platform-tests/navigation-timing/nav2_test_redirect_server.html:
* web-platform-tests/navigation-timing/nav2_test_redirect_xserver-expected.txt:
This test fails because our test infrastructure doesn't support loading from www.localhost.
* web-platform-tests/navigation-timing/nav2_test_redirect_xserver.html:
* web-platform-tests/navigation-timing/nav2_test_unique_nav_instances-expected.txt: Added.
This test failure needs further investigation.
* web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html: Added.
* web-platform-tests/navigation-timing/po-navigation-expected.txt: Added.
* web-platform-tests/navigation-timing/po-navigation.html: Added.
* web-platform-tests/navigation-timing/resources/webperftestharness.js:
(test_namespace):
(test_attribute_exists):
(test_enum):
* web-platform-tests/navigation-timing/secure-connection-start-reuse.https-expected.txt: Added.
* web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html: Added.
* web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt:
This test has been marked as flaky.  It needs to be fixed to not rely on no initial connection reuse.
* web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt:
* web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt:
* web-platform-tests/navigation-timing/test_document_onload-expected.txt: Added.
* web-platform-tests/navigation-timing/test_document_onload.html: Added.
This test failure needs further investigation.
* web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt:
* web-platform-tests/navigation-timing/unload-event-same-origin-check.html:
* web-platform-tests/performance-timeline/META.yml: Added.
* web-platform-tests/performance-timeline/buffered-flag-after-timeout.any.js: Added.
(async_test.t.t.step_timeout):
* web-platform-tests/performance-timeline/buffered-flag-observer.any.js: Added.
* web-platform-tests/performance-timeline/get-invalid-entries-expected.txt: Added.
* web-platform-tests/performance-timeline/get-invalid-entries.html: Added.
* web-platform-tests/performance-timeline/idlharness.any.js: Added.
(async idl_array):
* web-platform-tests/performance-timeline/multiple-buffered-flag-observers.any.js: Added.
(promise_test):
* web-platform-tests/performance-timeline/not-clonable-expected.txt: Added.
* web-platform-tests/performance-timeline/not-clonable.html: Added.
* web-platform-tests/performance-timeline/observer-buffered-false.any.js: Added.
(async_test.t.t.step_timeout):
* web-platform-tests/performance-timeline/performanceentry-tojson.any.js: Added.
(test):
* web-platform-tests/performance-timeline/po-callback-mutate.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-disconnect-removes-observed-types.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-disconnect.any.js: Added.
(async_test):
(test):
* web-platform-tests/performance-timeline/po-entries-sort.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-getentries.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-mark-measure.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-observe-expected.txt: Added.
* web-platform-tests/performance-timeline/po-observe-repeated-type.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-observe.html: Added.
* web-platform-tests/performance-timeline/po-resource-expected.txt: Added.
* web-platform-tests/performance-timeline/po-resource.html: Added.
* web-platform-tests/performance-timeline/po-takeRecords.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/resources/postmessage-entry.html: Added.
* web-platform-tests/performance-timeline/resources/worker-invalid-entries.js: Added.
* web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js: Added.
(catch):
* web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt:
This test failure needs further investigation.  It's a bindings generation problem I've unsuccessfully looked into before.
* web-platform-tests/performance-timeline/supportedEntryTypes.any.js:
(test):
* web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt:
* web-platform-tests/performance-timeline/webtiming-resolution.any.js: Added.
(testTimeResolution):
(timeByUserTiming):
* web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt: Added.
* web-platform-tests/performance-timeline/worker-with-performance-observer.html: Added.
* web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt:
This existing test failure needs more investigation.  We are probably close to a fix after this patch.

Source/WebCore:

This is basically just a new shape for exposing the same data as window.performance.navigation, but with a shape that fits better into the rest of the
performance timeline measurements that have been added to the web platform since performance.navigation.

I noted that exposing transfer size is problematic, and some of the tests for reading transfer size still fail.
There are still a few relatively minor test failures to fix in future patches.  Each one is annotated in the LayoutTests ChangeLogs.

Tests: imported/w3c/web-platform-tests/navigation-timing/dom_interactive_image_document.html
       imported/w3c/web-platform-tests/navigation-timing/dom_interactive_media_document.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_exist.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_instance_accessors.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_none.html
       imported/w3c/web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html
       imported/w3c/web-platform-tests/navigation-timing/po-navigation.html
       imported/w3c/web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html
       imported/w3c/web-platform-tests/navigation-timing/test_document_onload.html
       imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html
       imported/w3c/web-platform-tests/performance-timeline/not-clonable.html
       imported/w3c/web-platform-tests/performance-timeline/po-observe.html
       imported/w3c/web-platform-tests/performance-timeline/po-resource.html
       imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* dom/Document.cpp:
(WebCore::Document::setReadyState):
Sometimes the ready state jumps right to Complete without hitting Interactive along the way.
When this happens, we want to mark both m_documentTiming.domComplete and m_documentTiming.domInteractive.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
Call addNavigationTiming in notifyFinished to create the navigation timing object when we are done navigating
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didFinishLoading):
* loader/ResourceLoader.h:
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::fromLoad):
Add a URL parameter.  Sometimes we need to use the request's URL and sometimes the response's.  Different specs written at different times.
(WebCore::ResourceTiming::populateServerTiming const):
(WebCore::ResourceTiming::populateServerTiming): Deleted.
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::url const):
(WebCore::ResourceTiming::initiator const):
(WebCore::ResourceTiming::loadTiming const):
(WebCore::ResourceTiming::networkLoadMetrics const):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::reportResourceTiming):
* page/Performance.cpp:
(WebCore::Performance::getEntries const):
(WebCore::Performance::getEntriesByType const):
(WebCore::Performance::getEntriesByName const):
(WebCore::Performance::appendBufferedEntriesByType const):
(WebCore::Performance::addNavigationTiming):
(WebCore::Performance::registerPerformanceObserver):
(WebCore::Performance::queueEntry):
(WebCore::Performance::scheduleTaskIfNeeded):
* page/Performance.h:
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::startTime const):
(WebCore::PerformanceEntry::duration const):
(WebCore::PerformanceEntry::isResource const): Deleted.
(WebCore::PerformanceEntry::isMark const): Deleted.
(WebCore::PerformanceEntry::isMeasure const): Deleted.
(WebCore::PerformanceEntry::isPaint const): Deleted.
* page/PerformanceMark.h:
(isType): Deleted.
SPECIALIZE_TYPE_TRAITS_BEGIN/END doesn't work well with PerformanceNavigationTiming which inherits from PerformanceResourceTiming which both have distinct types.
is<PerformanceResourceTiming> doesn't give us the info we need.  I replaced that with "switch (entry->performanceEntryType())" in the one place it's used, and it works like a charm.
Also renamed type to performanceEntryType so it doesn't conflict with PerformanceNavigationTiming::type, which is specified in the idl.
* page/PerformanceMeasure.h:
(isType): Deleted.
* page/PerformanceNavigationTiming.cpp: Added.
(WebCore::toPerformanceNavigationTimingNavigationType):
(WebCore::PerformanceNavigationTiming::PerformanceNavigationTiming):
(WebCore::PerformanceNavigationTiming::millisecondsSinceOrigin const):
(WebCore::PerformanceNavigationTiming::sameOriginCheckFails const):
(WebCore::PerformanceNavigationTiming::unloadEventStart const):
(WebCore::PerformanceNavigationTiming::unloadEventEnd const):
(WebCore::PerformanceNavigationTiming::domInteractive const):
(WebCore::PerformanceNavigationTiming::domContentLoadedEventStart const):
(WebCore::PerformanceNavigationTiming::domContentLoadedEventEnd const):
(WebCore::PerformanceNavigationTiming::domComplete const):
(WebCore::PerformanceNavigationTiming::loadEventStart const):
(WebCore::PerformanceNavigationTiming::loadEventEnd const):
(WebCore::PerformanceNavigationTiming::type const):
(WebCore::PerformanceNavigationTiming::redirectCount const):
(WebCore::PerformanceNavigationTiming::startTime const):
(WebCore::PerformanceNavigationTiming::duration const):
* page/PerformanceNavigationTiming.h: Added.
* page/PerformanceNavigationTiming.idl: Copied from Source/WebCore/page/PerformanceObserver.idl.
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::takeRecords):
(WebCore::PerformanceObserver::disconnect):
(WebCore::PerformanceObserver::deliver):
(WebCore::PerformanceObserver::supportedEntryTypes):
* page/PerformanceObserver.h:
* page/PerformanceObserver.idl:
* page/PerformanceObserverEntryList.cpp:
(WebCore::PerformanceObserverEntryList::getEntriesByName const):
* page/PerformancePaintTiming.h:
(isType): Deleted.
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::nextHopProtocol const):
(WebCore::PerformanceResourceTiming::redirectStart const):
(WebCore::PerformanceResourceTiming::redirectEnd const):
(WebCore::PerformanceResourceTiming::fetchStart const):
(WebCore::PerformanceResourceTiming::domainLookupStart const):
(WebCore::PerformanceResourceTiming::domainLookupEnd const):
(WebCore::PerformanceResourceTiming::connectStart const):
(WebCore::PerformanceResourceTiming::connectEnd const):
(WebCore::PerformanceResourceTiming::secureConnectionStart const):
(WebCore::PerformanceResourceTiming::requestStart const):
(WebCore::PerformanceResourceTiming::responseStart const):
(WebCore::PerformanceResourceTiming::responseEnd const):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp const):
* page/PerformanceResourceTiming.h:
(WebCore::PerformanceResourceTiming::initiatorType const):
(isType): Deleted.
* page/PerformanceResourceTiming.idl:
* platform/network/BlobResourceHandle.cpp:
(WebCore::doNotifyFinish):
* platform/network/NetworkLoadMetrics.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
Pass metrics including the response end time from NSURLConnection so we don't assert in WebKitLegacy.
* platform/network/cocoa/NetworkLoadMetrics.mm:
(WebCore::copyTimingData):
Use currentRequest instead of passing in the response so we can call it from didFinishLoading, where we don't have a response stored anywhere.
We're just looking for whether it's http or https, so the currentRequest (which is the request after all the redirects) fits our purpose.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::handleDataURL):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Mark reused TLS connections in complete metrics like I did in incomplete metrics in r277493.

Source/WebKitLegacy:

* WebCoreSupport/PingHandle.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

* TestExpectations:
Annoyingly secure_connection_start_non_zero.https.html becomes flaky with a correct implementation because it assumes
that no connection is reused.  However, when running this test after other tests, another connection is often reused.
* performance-api/paint-timing/performance-observer-first-contentful-paint-expected.txt:
* performance-api/paint-timing/performance-observer-first-contentful-paint.html:
* performance-api/performance-observer-api-expected.txt:
* performance-api/performance-timeline-api-expected.txt:
* performance-api/resources/timeline-api.js:
* platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt:
Next hop protocol isn't implemented in ResourceHandle.  That's probably no big deal because WebKitLegacy is deprecated and not used by Safari.



Canonical link: https://commits.webkit.org/237930@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-20 00:33:02 +00:00
Ryosuke Niwa 0f56588ba3 Delete WebSQL code from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=225739

Reviewed by Sihui Liu.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebSQLEnabled): Replaced setWebSQLDisabled.

Source/WebKit:

Deleted WebSQL code. We keep some code for website data store since it's possible
for user's device to still have WebSQL data, and we should be able to delete them.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
* Shared/WebProcessDataStoreParameters.h:
(WebKit::WebProcessDataStoreParameters::encode const):
(WebKit::WebProcessDataStoreParameters::decode):
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebSQLDisabled):
(WKPreferencesGetWebSQLDisabled):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::webProcessDataStoreParameters):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setWebsiteDataStoreParameters):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetWebsiteDataStoreParameters):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::notifyPreferencesChanged):

Source/WTF:

Deleted the experimental feature to disable WebSQL since we've been shipping this,
and made the flag to selectively enable WebSQL in WebKit1 an internal debug setting
since nobody should be enabling this now.

* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:

Tools:

* MiniBrowser/playstation/WebContext.cpp:
(WebContext::WebContext):
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(runWebsiteDataStoreCustomPaths):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::configureWebsiteDataStoreTemporaryDirectories):


Canonical link: https://commits.webkit.org/237792@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-16 06:36:30 +00:00
Sam Weinig cab85f7611 Allow conditionally enabling OffscreenCanvas only for non-worker contexts
https://bugs.webkit.org/show_bug.cgi?id=225845

Reviewed by Darin Adler.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/WebKitFeatures.cmake:
Match current behavior of ENABLE_OFFSCREEN_CANVAS for ENABLE_OFFSCREEN_CANVAS_IN_WORKERS.

Source/WebCore:

Enable both compile time and runtime conditional enablement of just the
non-worker OffscreenCanvas code path.

To make this work a new IDL extended attribute was needed, ConditionalForWorker=FOO,
which allows specifying an additional macro to check for whether the constructor
should be exposed on workers. Ideally this would be generic for any context type,
but at the moment, the limited syntax of extended attributes makes that hard. If
generalization is needed (or a similar syntax is needed for something else) this can
be revisited.

To support runtime conditional exposure, the existing EnabledForContext, which calls
a static function on the implementation class passing the ScriptExecutationContext
is used. If conditional per context type ever becomes a common thing, we should add
another extended attribute (and add syntax to support like above) that allows specifying
both the context type and the setting name.

Other than that, uses of ENABLE_OFFSCREEN_CANVAS that guarded worker specific functionality
were replaced by ENABLE_OFFSCREEN_CANVAS_IN_WORKERS.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::computeMemoryCost const):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::SerializedScriptValue):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* html/HTMLCanvasElement.idl:
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::enabledForContext):
* html/OffscreenCanvas.h:
* html/OffscreenCanvas.idl:
* html/canvas/OffscreenCanvasRenderingContext2D.cpp:
(WebCore::OffscreenCanvasRenderingContext2D::enabledForContext):
* html/canvas/OffscreenCanvasRenderingContext2D.h:
* html/canvas/OffscreenCanvasRenderingContext2D.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setOffscreenCanvasInWorkersEnabled):
(WebCore::RuntimeEnabledFeatures::offscreenCanvasInWorkersEnabled const):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/WorkerAnimationController.cpp:
* workers/WorkerAnimationController.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:
Add new OffscreenCanvasInWorkersEnabled preference.

* wtf/PlatformEnable.h:
Add new ENABLE_OFFSCREEN_CANVAS_IN_WORKERS macro.

Tools:

* Scripts/webkitperl/FeatureList.pm:
* WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):
Match current behavior of ENABLE_OFFSCREEN_CANVAS and OffscreenCanvasEnabled
for ENABLE_OFFSCREEN_CANVAS_IN_WORKERS and OffscreenCanvasInWorkersEnabled.


Canonical link: https://commits.webkit.org/237788@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-16 03:14:57 +00:00
Chris Dumez fb621eb7e5 Drop legacy / prefixed WebAudio implementation
https://bugs.webkit.org/show_bug.cgi?id=225832

Reviewed by Darin Adler.

Source/WebCore:

Drop legacy / prefixed WebAudio implementation now that it is no longer
present in shipping and we have received any reports of issues.

This drops all the legacy code but she should be able to clean up the
code further in follow-ups. In particular, I believe some code can
now be moved from BaseAudioContext to OfflineAudioContext.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::~AudioBufferSourceNode):
(WebCore::AudioBufferSourceNode::totalPitchRate):
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/AudioBufferSourceNode.idl:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::create):
(WebCore::AudioContext::AudioContext):
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioListener.h:
* Modules/webaudio/AudioListener.idl:
* Modules/webaudio/AudioNode.cpp:
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNode.idl:
* Modules/webaudio/AudioParam.h:
* Modules/webaudio/BaseAudioContext.cpp:
(WebCore::BaseAudioContext::BaseAudioContext):
* Modules/webaudio/BaseAudioContext.h:
(WebCore::BaseAudioContext::isOfflineContext const):
(WebCore::BaseAudioContext::BaseAudioContext):
* Modules/webaudio/DynamicsCompressorNode.cpp:
* Modules/webaudio/DynamicsCompressorNode.h:
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::OfflineAudioContext):
* Modules/webaudio/OscillatorNode.h:
* Modules/webaudio/OscillatorNode.idl:
* Modules/webaudio/WebKitAudioBufferSourceNode.h: Removed.
* Modules/webaudio/WebKitAudioBufferSourceNode.idl: Removed.
* Modules/webaudio/WebKitAudioContext.cpp: Removed.
* Modules/webaudio/WebKitAudioContext.h: Removed.
* Modules/webaudio/WebKitAudioContext.idl: Removed.
* Modules/webaudio/WebKitAudioListener.h: Removed.
* Modules/webaudio/WebKitAudioListener.idl: Removed.
* Modules/webaudio/WebKitAudioPannerNode.cpp: Removed.
* Modules/webaudio/WebKitAudioPannerNode.h: Removed.
* Modules/webaudio/WebKitAudioPannerNode.idl: Removed.
* Modules/webaudio/WebKitDynamicsCompressorNode.h: Removed.
* Modules/webaudio/WebKitDynamicsCompressorNode.idl: Removed.
* Modules/webaudio/WebKitOfflineAudioContext.cpp: Removed.
* Modules/webaudio/WebKitOfflineAudioContext.h: Removed.
* Modules/webaudio/WebKitOfflineAudioContext.idl: Removed.
* Modules/webaudio/WebKitOscillatorNode.h: Removed.
* Modules/webaudio/WebKitOscillatorNode.idl: Removed.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::setAudioContextRestrictions):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKitLegacy/win:

Stop explicitly disabled with prefixed WebAudio implementation given that
it no longer exists.

* WebView.cpp:
(WebView::notifyPreferencesChanged):

Source/WTF:

Drop preference for prefixed WebAudio, which was disabled everywhere.

* Scripts/Preferences/WebPreferencesInternal.yaml:


Canonical link: https://commits.webkit.org/237758@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-15 04:18:38 +00:00
Devin Rousso 070d57d485 Promote `-[WKWebView _pageExtendedBackgroundColor]` SPI to `-[WKWebView underPageBackgroundColor]` API
https://bugs.webkit.org/show_bug.cgi?id=225615
<rdar://problem/76568094>

Reviewed by Wenson Hsieh.

Source/WebCore:

`underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity)
 - the most recent non-null value provided
 - the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`)
 - the underlying platform view's background color
Modifications to this property will not have any effect until control is returned to the runloop.

Tests: WKWebViewUnderPageBackgroundColor.OnLoad
       WKWebViewUnderPageBackgroundColor.SingleSolidColor
       WKWebViewUnderPageBackgroundColor.SingleBlendedColor
       WKWebViewUnderPageBackgroundColor.MultipleSolidColors
       WKWebViewUnderPageBackgroundColor.MultipleBlendedColors
       WKWebViewUnderPageBackgroundColor.KVO
       WKWebViewUnderPageBackgroundColor.MatchesScrollView

* page/Page.h:
(WebCore::Page::underPageBackgroundColorOverride const): Added.
* page/Page.cpp:
(WebCore::Page::setUnderPageBackgroundColorOverride): Added.
Hold the client-overriden value for `underPageBackgroundColor` so that it can be used when
drawing the overscroll layer.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerForOverhangAreasBackgroundColor):
Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor` and
`UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default
overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`.

* dom/Document.cpp:
(WebCore::Document::themeColorChanged):
It's no longer necessary to force the overscroll area to redraw since that'll be handled by
a client calling `-[WKWebView setUnderPageBackgroundColor:]` (possibly in response to a
`-[WKWebView themeColor]` KVO notification).

Source/WebKit:

`underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity)
 - the most recent non-null value provided
 - the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`)
 - the underlying platform view's background color
Modifications to this property will not have any effect until control is returned to the runloop.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView underPageBackgroundColor]): Added.
(-[WKWebView setUnderPageBackgroundColor:]): Added.
(+[WKWebView automaticallyNotifiesObserversOfUnderPageBackgroundColor]): Added.

* UIProcess/API/ios/WKWebViewIOS.mm:
(baseScrollViewBackgroundColor):
(scrollViewBackgroundColor):
Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor` and
`UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default
overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`.

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::underPageBackgroundColor const): Added.
(WebKit::WebPageProxy::setUnderPageBackgroundColorOverride): Added.
(WebKit::WebPageProxy::pageExtendedBackgroundColorDidChange):
(WebKit::WebPageProxy::platformUnderPageBackgroundColor const): Added.
(WebKit::WebPageProxy::scrollAreaBackgroundColor const): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::platformUnderPageBackgroundColor const): Added.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::platformUnderPageBackgroundColor const): Added.
Store the client-overriden value for `underPageBackgroundColor` and manage state changes.

* UIProcess/PageClient.h:
(WebKit::PageClient::underPageBackgroundColorWillChange): Added.
(WebKit::PageClient::underPageBackgroundColorDidChange): Added.
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::underPageBackgroundColorWillChange): Added.
(WebKit::PageClientImplCocoa::underPageBackgroundColorDidChange): Added.
Add ObjC KVO support for `-[WKWebView underPageBackgroundColor]`.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::contentViewBackgroundColor): Added.
Provide a way to get the `backgroundColor` of the `WKContentView`. This is needed on iOS
because `scrollViewBackgroundColor` (now `WebPageProxy::platformUnderPageBackgroundColor`)
would use this value before falling back to the underlying platform view's background color.

* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUnderPageBackgroundColorOverride): Added.
Pass the client-overriden value for `underPageBackgroundColor` to the WebProcess so that it
can be used when drawing the overscroll layer.

* UIProcess/ViewSnapshotStore.cpp:
(WebKit::ViewSnapshotStore::recordSnapshot):
Go back to using the `pageExtendedBackgroundColor` (before r273083).

Source/WTF:

`underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity)
 - the most recent non-null value provided
 - the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`)
 - the underlying platform view's background color
Modifications to this property will not have any effect until control is returned to the runloop.

* Scripts/Preferences/WebPreferencesInternal.yaml:
Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor`and
`UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default
overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewUnderPageBackgroundColor.mm: Renamed from PageExtendedBackgroundColor.mm.
(defaultBackgroundColor): Added.
(TEST.WKWebViewUnderPageBackgroundColor.OnLoad):
(TEST.WKWebViewUnderPageBackgroundColor.SingleSolidColor): Added.
(TEST.WKWebViewUnderPageBackgroundColor.SingleBlendedColor): Added.
(TEST.WKWebViewUnderPageBackgroundColor.MultipleSolidColors): Added.
(TEST.WKWebViewUnderPageBackgroundColor.MultipleBlendedColors): Added.
(-[WKWebViewUnderPageBackgroundColorObserver initWithWebView:]): Added.
(-[WKWebViewUnderPageBackgroundColorObserver observeValueForKeyPath:ofObject:change:context:]): Added.
(TEST.WKWebViewUnderPageBackgroundColor.KVO):
(TEST.WKWebViewUnderPageBackgroundColor.MatchesScrollView): Added.
(TEST.WKWebViewUnderPageBackgroundColor.MultipleStyles): Deleted.
(-[WKWebViewPageExtendedBackgroundColorObserver initWithWebView:]): Deleted.
(-[WKWebViewPageExtendedBackgroundColorObserver observeValueForKeyPath:ofObject:change:context:]): Deleted.

* TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm:
(createWebViewWithSampledPageTopColorMaxDifference):
(TEST.SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewThemeColor.mm:
(createWebView): Deleted.
(TEST.WKWebView.ExperimentalUseThemeColorForScrollAreaBackgroundColor): Deleted.
Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor` and
`UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default
overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:


Canonical link: https://commits.webkit.org/237736@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-14 21:34:46 +00:00
Rob Buis f580025c03 Implement <form>.requestSubmit()
https://bugs.webkit.org/show_bug.cgi?id=197958

Patch by Rob Buis <rbuis@igalia.com> on 2021-05-10
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update improved test results and import requestSubmit tests.

* web-platform-tests/html/dom/idlharness.https-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-0/request-submit-activation-expected.txt: Added.
* web-platform-tests/html/semantics/forms/form-submission-0/request-submit-activation.html: Added.
* web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-autofocus-expected.txt: Added.
* web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-autofocus.html: Added.
* web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-expected.txt:
* web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html:

Source/WebCore:

Implement the requestSubmit method as defined here [1].

Behavior matches Chrome and Firefox.

[1] https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit

Tests: imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html
       imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/request-submit-activation.html
       imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-autofocus.html

* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
(WebCore::HTMLButtonElement::isSubmitButton const):
* html/HTMLButtonElement.h:
* html/HTMLFormControlElement.h:
(WebCore::HTMLFormControlElement::isSubmitButton const):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submitImplicitly):
(WebCore::HTMLFormElement::submitIfPossible):
(WebCore::HTMLFormElement::requestSubmit):
(WebCore::HTMLFormElement::findSubmitButton):
(WebCore::HTMLFormElement::submit):
(WebCore::HTMLFormElement::effectiveTarget const):
(WebCore::HTMLFormElement::findSubmitter const):
(WebCore::HTMLFormElement::reportValidity):
(WebCore::HTMLFormElement::prepareForSubmission): Deleted.
(WebCore::HTMLFormElement::findSubmitButton const): Deleted.
* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.h:
* html/ImageInputType.cpp:
(WebCore::ImageInputType::handleDOMActivateEvent):
* html/ImageInputType.h:
* html/InputType.h:
(WebCore::InputType::isSubmitButton const):
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::handleDOMActivateEvent):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/FormSubmission.h:

Source/WTF:

Add requestSubmit as experimental feature, disabled by default.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

Update improved test results.

* platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:

Canonical link: https://commits.webkit.org/237526@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 07:16:13 +00:00
Tim Horton 1eb9705c4d Add an experimental alternative display-list-based RemoteLayerBackingStore implementation
https://bugs.webkit.org/show_bug.cgi?id=225508

Reviewed by Sam Weinig.

Source/WebKit:

* Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp: Added.
(WebKit::CGDisplayListImageBufferBackend::calculateMemoryCost):
(WebKit::CGDisplayListImageBufferBackend::create):
(WebKit::CGDisplayListImageBufferBackend::CGDisplayListImageBufferBackend):
(WebKit::CGDisplayListImageBufferBackend::createImageBufferBackendHandle const):
(WebKit::CGDisplayListImageBufferBackend::context const):
(WebKit::CGDisplayListImageBufferBackend::backendSize const):
(WebKit::CGDisplayListImageBufferBackend::bytesPerRow const):
(WebKit::CGDisplayListImageBufferBackend::copyNativeImage const):
(WebKit::CGDisplayListImageBufferBackend::toBGRAData const):
(WebKit::CGDisplayListImageBufferBackend::getImageData const):
(WebKit::CGDisplayListImageBufferBackend::putImageData):
* Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h: Added.
Add an ImageBuffer backend backed by a CG display list.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
Add a new RemoteLayerBackingStore type that uses CGDisplayListImageBufferBackend.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::encode const):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
(WebKit::RemoteLayerBackingStore::supportsPartialRepaint):
Disable partial repaint if using display-list-based backing store,
because we don't currently have any way to mutate display lists.

(WebKit::RemoteLayerBackingStore::display):
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
When applying a display-list-based backing store to a layer, we just
pass the encodede data directly to the layer, and tell it to use the
display list to render.

* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::createWithPlainLayer):
(-[WKPlainRemoteLayer description]): Deleted.
Move WKPlainRemoteLayer to RemoteLayerTreeLayers, and rename it to WKCompositingLayer.
It will now back all WKCompositingViews.

* UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h: Added.
* UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm: Added.
(-[WKCompositingLayer description]):
(-[WKCompositingLayer _setWKContentsDisplayList:]):
(-[WKCompositingLayer _wkContentsDisplayList]):
(-[WKCompositingLayer drawInContext:]):
Make WKCompositingLayer replay the given display list in drawRect
(just because we're currently missing API to actually directly pass
the encoded display list data to CA).

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(+[WKCompositingView layerClass]):
Use WKCompositingLayer as the layer class for all WKCompositingViews.

* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/graphics/ImageBufferBackendHandle.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::updateBackingStore):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
(WebKit::RemoteLayerTreeContext::useCGDisplayListsForDOMRendering const):
(WebKit::RemoteLayerTreeContext::setUseCGDisplayListsForDOMRendering):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
Plumb the internal feature flag from WebPreferences to RemoteLayerTreeContext
to PlatformCALayerRemote to RemoteLayerBackingStore; if the preference is
on and the feature is available, we'll always prefer display-list backed
surfaces over either of the bitmap types.

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:


Canonical link: https://commits.webkit.org/237482@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-07 23:46:04 +00:00
Devin Rousso 90bf4c3597 Sampled Page Top Color: take additional snapshots further down the page to see if the sampled top color is more than just a tiny strip
https://bugs.webkit.org/show_bug.cgi?id=225323

Reviewed by Beth Dakin.

Source/WebCore:

Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.

Tests: SampledPageTopColor.VerticalGradientBelowMaxDifference
       SampledPageTopColor.VerticalGradientAboveMaxDifference

* dom/Document.cpp:
(WebCore::Document::determineSampledPageTopColor):

Source/WebKit:

Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.

* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setSampledPageTopColorMinHeight:]): Added.
(-[WKWebViewConfiguration _sampledPageTopColorMinHeight]): Added.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setupPageConfiguration:]):
Provide SPI to configure the `SampledPageTopColorMinHeight` preference when creating the `WKWebView`.

Source/WTF:

Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.

* Scripts/Preferences/WebPreferences.yaml:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm:
(createWebViewWithSampledPageTopColorMaxDifference):
(createHTMLGradientWithColorStops):
(TEST.SampledPageTopColor.ZeroMaxDifference):
(TEST.SampledPageTopColor.NegativeMaxDifference):
(TEST.SampledPageTopColor.SolidColor):
(TEST.SampledPageTopColor.DifferentColorsWithoutOutlierBelowMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithLeftOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithMiddleOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithRightOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsIndividuallyAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsCumulativelyAboveMaxDifference):
(TEST.SampledPageTopColor.VerticalGradientBelowMaxDifference): Added.
(TEST.SampledPageTopColor.VerticalGradientAboveMaxDifference): Added.
(TEST.SampledPageTopColor.DISABLED_DisplayP3):
(TEST.SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor):


Canonical link: https://commits.webkit.org/237343@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-05 18:17:53 +00:00
Sam Weinig 28e215969b Add preliminary support for specifying a color space for 2D canvas
https://bugs.webkit.org/show_bug.cgi?id=225286

Reviewed by Dean Jackson.

Source/WebCore:

Tests: fast/canvas/CanvasRenderingContext2DSettings-colorSpace-disabled.html
       fast/canvas/CanvasRenderingContext2DSettings-colorSpace-enabled.html
       fast/canvas/canvas-color-space-display-p3.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* html/canvas/CanvasRenderingContext2DSettings.idl:
* html/canvas/CanvasRenderingContext2DSettings.h:
Add a new setting blocked member to the CanvasRenderingContext2DSettings
dictionary for specifying a color space.

* html/canvas/PredefinedColorSpace.cpp: Added.
* html/canvas/PredefinedColorSpace.h: Added.
* html/canvas/PredefinedColorSpace.idl: Added.
Add a new IDL enumeration to represent the possible color spaces supported.
For ports that don't support DisplayP3, trying to use it will result in
type error from JS.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::reset):
Add checks for color space and pixel format to 2d context reset optimation.
This can happen if the image buffer is allocated prior to the context being
requested (such as via canvas.toDataURL() or canvas.toBlob()).

(WebCore::HTMLCanvasElement::createImageBuffer const):
Pass the correct color space and pixel format (though
the later is always BGRA8 at the moment) to the ImageBuffer
create function to make a backing store in the right format.

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::createBufferForPainting const):
* html/HTMLVideoElement.h:
Pass color space and pixel format through to ensure the helper
buffer matches the correct color space.

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
Pass the existing defaults to HTMLVideoElement::createBufferForPainting.
In the future, ImageBitmap will also gain color space and pixel
format specificity and this will be updated.

* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::pixelFormat const):
(WebCore::CanvasRenderingContext::colorSpace const):
* html/canvas/CanvasRenderingContext.h:
Add virtual base implementations of colorSpace and pixelFormat
which CanvasRenderingContext2D can override to return the
values specified in the CanvasRenderingContext2DSettings.

* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::fontProxy const):
Fix incorrect formatting.

(WebCore::CanvasRenderingContext2D::pixelFormat const):
(WebCore::CanvasRenderingContext2D::colorSpace const):
Add overrides, return m_settings.colorSpace for colorSpace.

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
(WebCore::CanvasRenderingContext2DBase::createCompositingBuffer):
(WebCore::CanvasRenderingContext2DBase::createPattern):
(WebCore::CanvasRenderingContext2DBase::drawTextUnchecked):
Pass along the colorSpace and pixelFormat when creating buffers.

* html/shadow/DateTimeSymbolicFieldElement.cpp:
Add missing includes that are now needed.

Source/WTF:

Add new experimental feature, CanvasColorSpaceEnabled, which blocks
access to the new ability to specify color spaces for 2D canvas.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Tools:

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):
Add CanvasColorSpaceEnabled for windows.

LayoutTests:

Add basic tests for color space in canvas support.

* fast/canvas/CanvasRenderingContext2DSettings-colorSpace-disabled-expected.txt: Added.
* fast/canvas/CanvasRenderingContext2DSettings-colorSpace-disabled.html: Added.
* fast/canvas/CanvasRenderingContext2DSettings-colorSpace-enabled-expected.txt: Added.
* fast/canvas/CanvasRenderingContext2DSettings-colorSpace-enabled.html: Added.
* fast/canvas/canvas-color-space-display-p3-expected.html: Added.
* fast/canvas/canvas-color-space-display-p3.html: Added.


Canonical link: https://commits.webkit.org/237338@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-05 16:36:55 +00:00
Kimmo Kinnunen d433fbaa4d [GPUP] Move GPUProcess WebGL to Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=222836
rdar://75048190

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-05-03
Reviewed by Brent Fulgham.

Move the setting for WebGL in GPU process
to experimental features but disable it by default,
even on layout tests.

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:

Tools:

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):

Canonical link: https://commits.webkit.org/237281@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-04 06:33:52 +00:00
Devin Rousso 7ecb43ef8b experiment with averaging sampling colors across the top of the page as the scroll area background
https://bugs.webkit.org/show_bug.cgi?id=224987
<rdar://problem/76251889>

Reviewed by Darin Adler.

Source/WebCore:

Tests: SampledPageTopColor.ZeroMaxDifference
       SampledPageTopColor.NegativeMaxDifference
       SampledPageTopColor.SolidColor
       SampledPageTopColor.DifferentColorsWithoutOutlierBelowMaxDifference
       SampledPageTopColor.DifferentColorsWithLeftOutlierAboveMaxDifference
       SampledPageTopColor.DifferentColorsWithMiddleOutlierAboveMaxDifference
       SampledPageTopColor.DifferentColorsWithRightOutlierAboveMaxDifference
       SampledPageTopColor.DifferentColorsIndividuallyAboveMaxDifference
       SampledPageTopColor.DifferentColorsCumulativelyAboveMaxDifference
       SampledPageTopColor.DisplayP3
       SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor

* dom/Document.h:
(WebCore::Document::sampledPageTopColor const): Added.
* dom/Document.cpp:
(WebCore::Document::enqueuePaintTimingEntryIfNeeded):
(WebCore::colorDifference): Added.
(WebCore::averageColor): Added.
(WebCore::Document::determineSampledPageTopColor): Added.
Wait until the first contentful paint before sampling. Don't sample if that location would
fall into a 3rd-party `<iframe>`. Currently use 5 snapshots across the top of the page,
allowing for one of either the first or last snapshot to be an outlier, which is not
included in the average of the other snapshots that's used as the final color value. If the
Lab color difference between any two snapshots (unless it's the first or last snapshot as
described above) or across all the (non-outlier) snapshots is too large, bail. Only enabled
if the `SampledPageTopColorMaxDifference` setting is greater than 0.

* page/Page.h:
* page/Page.cpp:
(WebCore::Page::sampledPageTopColor const): Added.
* page/ChromeClient.h:
(WebCore::ChromeClient::didSamplePageTopColor const): Added.
Pass along the `sampledPageTopColor` to the UIProcess after it's determined or if the above
logic bails (so that the `WKWebView` can adjust `_sampledPageTopColor` to `nil`).

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
Use the `sampledPageTopColor` if the `UseSampledPageTopColorForScrollAreaBackgroundColor`
internal preference is enabled instead of the CSS `background-color` of the `<html>`/`<body>`.

Source/WebKit:

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didSamplePageTopColor const): Added.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didSamplePageTopColor): Added.
Pass along the `sampledPageTopColor` to the UIProcess.

* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::sampledPageTopColor): Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::scrollAreaBackgroundColor const):
(WebKit::WebPageProxy::didSamplePageTopColor): Added.
Use the `sampledPageTopColor` if the `UseSampledPageTopColorForScrollAreaBackgroundColor`
internal preference is enabled instead of the CSS `background-color` of the `<html>`/`<body>`.

* UIProcess/PageClient.h:
(WebKit::PageClient::sampledPageTopColorWillChange): Added.
(WebKit::PageClient::sampledPageTopColorDidChange): Added.
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::sampledPageTopColorWillChange): Added.
(WebKit::PageClientImplCocoa::sampledPageTopColorDidChange): Added.
Add ObjC KVO support for `-[WKWebView _sampledPageTopColor]`.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setupPageConfiguration:]):
(-[WKWebView _sampledPageTopColor]): Added.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setSampledPageTopColorMaxDifference:]): Added.
(-[WKWebViewConfiguration _sampledPageTopColorMaxDifference]): Added.
Provide SPI to configure the `SampledPageTopColorMaxDifference` preference when
creating the `WKWebView`. Expose the result as `_sampledPageTopColor` SPI.

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:
Add a `SampledPageTopColorMaxDifference` setting that controls both whether or not to sample
colors from the top of the page (only if value > 0) and the max Lab color difference allowed
across all samples.

* Scripts/Preferences/WebPreferencesInternal.yaml:
Add a `UseSampledPageTopColorForScrollAreaBackgroundColor` internal setting that controls
whether the sampled page top color can be used as the overscroll area background color.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm: Added.
(-[TestKVOWrapper initWithObservable:keyPath:callback:]):
(-[TestKVOWrapper dealloc]):
(-[TestKVOWrapper observeValueForKeyPath:ofObject:change:context:]):
(createWebViewWithSampledPageTopColorMaxDifference):
(waitForSampledPageTopColorToChangeForHTML):
(createHTMLGradientWithColorStops):
(TEST.SampledPageTopColor.ZeroMaxDifference):
(TEST.SampledPageTopColor.NegativeMaxDifference):
(TEST.SampledPageTopColor.SolidColor):
(TEST.SampledPageTopColor.DifferentColorsWithoutOutlierBelowMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithLeftOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithMiddleOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithRightOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsIndividuallyAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsCumulativelyAboveMaxDifference):
(TEST.SampledPageTopColor.DisplayP3):
(TEST.SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor):

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:


Canonical link: https://commits.webkit.org/237144@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-29 00:51:46 +00:00
Alex Christensen e53d1b3560 Remove support for NPAPI plugins in WebView
https://bugs.webkit.org/show_bug.cgi?id=224449

Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-28
Reviewed by Geoffrey Garen.

Source/WebKitLegacy/mac:

In r275912 I turned off all plugin support in WebView after looking into use of NP_Initialize, the entry point for NPAPI plugins.
That was too aggressive, as we found some use of the older WebKit plugin entry point, plugInViewWithArguments, and reverted in r276652.
This cuts out only support for NPAPI plugins for now.

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createPlugin):

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:

Tools:

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):

Canonical link: https://commits.webkit.org/237124@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 17:19:32 +00:00
Chris Dumez 23f8829da0 Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags
https://bugs.webkit.org/show_bug.cgi?id=225130

Reviewed by Eric Carlson.

Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags now that
these features have shipped. It also doesn't make sense to disable them given
that the prefixed WebAudio API is no longer exposed and there is no feature flag
to turn the legacy prefixed API back on.

Source/WebCore:

* Modules/webaudio/AnalyserNode.idl:
* Modules/webaudio/AudioBuffer.idl:
* Modules/webaudio/AudioBufferSourceNode.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/AudioParamMap.idl:
* Modules/webaudio/AudioProcessingEvent.idl:
* Modules/webaudio/AudioWorklet.idl:
* Modules/webaudio/AudioWorkletNode.idl:
* Modules/webaudio/AudioWorkletNodeOptions.idl:
* Modules/webaudio/BaseAudioContext.idl:
* Modules/webaudio/BiquadFilterNode.idl:
* Modules/webaudio/ChannelMergerNode.idl:
* Modules/webaudio/ChannelSplitterNode.idl:
* Modules/webaudio/ConstantSourceNode.idl:
* Modules/webaudio/ConstantSourceOptions.idl:
* Modules/webaudio/ConvolverNode.idl:
* Modules/webaudio/DelayNode.idl:
* Modules/webaudio/DynamicsCompressorNode.idl:
* Modules/webaudio/GainNode.idl:
* Modules/webaudio/IIRFilterNode.idl:
* Modules/webaudio/MediaElementAudioSourceNode.idl:
* Modules/webaudio/MediaStreamAudioDestinationNode.idl:
* Modules/webaudio/MediaStreamAudioSourceNode.idl:
* Modules/webaudio/OfflineAudioContext.idl:
* Modules/webaudio/OscillatorNode.idl:
* Modules/webaudio/PannerNode.idl:
* Modules/webaudio/PeriodicWave.idl:
* Modules/webaudio/StereoPannerNode.idl:
* Modules/webaudio/WaveShaperNode.idl:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences modernUnprefixedWebAudioEnabled]): Deleted.
(-[WebPreferences setModernUnprefixedWebAudioEnabled:]): Deleted.
(-[WebPreferences audioWorkletEnabled]): Deleted.
(-[WebPreferences setAudioWorkletEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:


Canonical link: https://commits.webkit.org/237119@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 15:44:02 +00:00
Alex Christensen 74df1a2f89 Unreviewed, reverting r275912.
rdar://77179042

Broke internal client

Reverted changeset:

"Remove support for NPAPI plugins in WebView"
https://bugs.webkit.org/show_bug.cgi?id=224449
https://commits.webkit.org/r275912


Canonical link: https://commits.webkit.org/237079@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-27 18:52:48 +00:00
Martin Robinson f80fe3e907 [GTK] Turn on editable <input type=date> and <input type=time> fields
https://bugs.webkit.org/show_bug.cgi?id=224921

Reviewed by Carlos Garcia Campos.

.:

Turn on editable date and time inputs for GTK

* Source/cmake/OptionsGTK.cmake: Add new source file to the list.

Source/WebCore:

Turn on editable date and time inputs for GTK.

No new tests. This is covered by enabling existing <input type=date>
and <input type=time> tests.

* Headers.cmake: Add headers to the list.
* loader/EmptyClients.cpp: Add missing header include.

Source/WebKit:

Turn on editable date and time inputs for GTK.

* SourcesGTK.txt: Add source file.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDateTimePicker): Added.
* UIProcess/API/gtk/PageClientImpl.h: Added method declaration.
* UIProcess/gtk/WebDateTimePickerGtk.cpp: Added. Stub for date/time picker which
doesn't have any user interface. This will allow clients to use the editable shadow
DOM date/time input editable fields.
(WebKit::WebDateTimePickerGtk::create):
(WebKit::WebDateTimePickerGtk::~WebDateTimePickerGtk):
(WebKit::WebDateTimePickerGtk::WebDateTimePickerGtk):
(WebKit::WebDateTimePickerGtk::endPicker):
(WebKit::WebDateTimePickerGtk::showDateTimePicker):
* UIProcess/gtk/WebDateTimePickerGtk.h: Added.

Source/WTF:

Turn on editable date and time inputs for GTK.

* Scripts/Preferences/WebPreferencesInternal.yaml: Set editable date/time inputs
on by default for GTK as well.

LayoutTests:

Turn on editable date and time inputs for GTK.

* platform/gtk/TestExpectations: Enable new forms test for WebKitGTK.
* platform/gtk/fast/forms/date/date-input-rendering-basic-expected.txt: Added.
* platform/gtk/fast/forms/date/date-pseudo-elements-expected.txt: Added.
* platform/gtk/fast/forms/time/time-input-rendering-basic-expected.txt: Added.


Canonical link: https://commits.webkit.org/236908@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-22 18:09:53 +00:00
Eric Carlson fa809bdfa3 [Cocoa] Enable MediaSession and MediaSessionCoordinator experimental features
https://bugs.webkit.org/show_bug.cgi?id=224822
<rdar://problem/76908014>

Reviewed by Jer Noble.

* Scripts/Preferences/WebPreferencesExperimental.yaml: Change the defaults for
MediaSessionCoordinatorEnabled and MediaSessionEnabled to true.


Canonical link: https://commits.webkit.org/236816@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-21 00:48:09 +00:00
Sam Weinig de6f156f9b Move RuntimeEnabledFeatures to Settings (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=224440

Reviewed by Alex Christensen.

Move a few RuntimeEnabledFeatures to Settings to consolidate settings
in one object and removes the need for additional boilerplate. This
is now possible as Settings are now accessible in workers.

Moves PeerConnectionEnabled, WebGLUsingMetal, WebGL2Enabled, WebGPUEnabled
and MaskWebGLStringsEnabled.

Source/WebCore:

* Modules/mediastream/RTCAnswerOptions.idl:
* Modules/mediastream/RTCCertificate.idl:
* Modules/mediastream/RTCConfiguration.idl:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCDataChannelEvent.idl:
* Modules/mediastream/RTCIceCandidate.idl:
* Modules/mediastream/RTCIceCandidateInit.idl:
* Modules/mediastream/RTCIceConnectionState.idl:
* Modules/mediastream/RTCIceGatheringState.idl:
* Modules/mediastream/RTCIceServer.idl:
* Modules/mediastream/RTCIceTransport.idl:
* Modules/mediastream/RTCIceTransportState.idl:
* Modules/mediastream/RTCOfferAnswerOptions.idl:
* Modules/mediastream/RTCOfferOptions.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl:
* Modules/mediastream/RTCPeerConnectionIceEvent.idl:
* Modules/mediastream/RTCPeerConnectionState.idl:
* Modules/mediastream/RTCPriorityType.idl:
* Modules/mediastream/RTCRtcpParameters.idl:
* Modules/mediastream/RTCRtpCapabilities.idl:
* Modules/mediastream/RTCRtpCodecCapability.idl:
* Modules/mediastream/RTCRtpCodecParameters.idl:
* Modules/mediastream/RTCRtpCodingParameters.idl:
* Modules/mediastream/RTCRtpContributingSource.idl:
* Modules/mediastream/RTCRtpDecodingParameters.idl:
* Modules/mediastream/RTCRtpEncodingParameters.idl:
* Modules/mediastream/RTCRtpFecParameters.idl:
* Modules/mediastream/RTCRtpHeaderExtensionParameters.idl:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpRtxParameters.idl:
* Modules/mediastream/RTCRtpSendParameters.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpSynchronizationSource.idl:
* Modules/mediastream/RTCRtpTransceiver.idl:
* Modules/mediastream/RTCRtpTransceiverDirection.idl:
* Modules/mediastream/RTCSdpType.idl:
* Modules/mediastream/RTCSessionDescription.idl:
* Modules/mediastream/RTCSignalingState.idl:
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/RTCTrackEvent.idl:
* Modules/webgpu/GPUBindGroupLayoutBinding.idl:
* Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
* Modules/webgpu/GPUBlendDescriptor.idl:
* Modules/webgpu/GPUBufferDescriptor.idl:
* Modules/webgpu/GPUBufferUsage.idl:
* Modules/webgpu/GPUCanvasContext.idl:
* Modules/webgpu/GPUColor.idl:
* Modules/webgpu/GPUColorStateDescriptor.idl:
* Modules/webgpu/GPUColorWrite.idl:
* Modules/webgpu/GPUCompareFunction.idl:
* Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
* Modules/webgpu/GPUErrorFilter.idl:
* Modules/webgpu/GPUExtent3D.idl:
* Modules/webgpu/GPULoadOp.idl:
* Modules/webgpu/GPUOrigin3D.idl:
* Modules/webgpu/GPUOutOfMemoryError.idl:
* Modules/webgpu/GPURequestAdapterOptions.idl:
* Modules/webgpu/GPUSamplerDescriptor.idl:
* Modules/webgpu/GPUShaderStage.idl:
* Modules/webgpu/GPUStoreOp.idl:
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/GPUTextureFormat.idl:
* Modules/webgpu/GPUTextureUsage.idl:
* Modules/webgpu/GPUUncapturedErrorEvent.idl:
* Modules/webgpu/GPUValidationError.idl:
* Modules/webgpu/GPUVertexAttributeDescriptor.idl:
* Modules/webgpu/GPUVertexBufferDescriptor.idl:
* Modules/webgpu/GPUVertexInputDescriptor.idl:
* Modules/webgpu/Navigator+GPU.idl:
* Modules/webgpu/NavigatorGPU.cpp:
* Modules/webgpu/WebGPU.idl:
* Modules/webgpu/WebGPUAdapter.idl:
* Modules/webgpu/WebGPUBindGroup.idl:
* Modules/webgpu/WebGPUBindGroupBinding.idl:
* Modules/webgpu/WebGPUBindGroupDescriptor.idl:
* Modules/webgpu/WebGPUBindGroupLayout.idl:
* Modules/webgpu/WebGPUBuffer.idl:
* Modules/webgpu/WebGPUBufferBinding.idl:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPUCommandEncoder.idl:
* Modules/webgpu/WebGPUComputePassEncoder.idl:
* Modules/webgpu/WebGPUComputePipeline.idl:
* Modules/webgpu/WebGPUComputePipelineDescriptor.idl:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUDeviceErrorScopes.idl:
* Modules/webgpu/WebGPUDeviceEventHandler.idl:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
* Modules/webgpu/WebGPUPipelineLayout.idl:
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPUProgrammableStageDescriptor.idl:
* Modules/webgpu/WebGPUQueue.idl:
* Modules/webgpu/WebGPURenderPassDescriptor.idl:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPURenderPipeline.idl:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Modules/webgpu/WebGPUSampler.idl:
* Modules/webgpu/WebGPUShaderModule.idl:
* Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/WebGPUTexture.idl:
* Modules/webgpu/WebGPUTextureView.idl:
* Modules/webgpu/WorkerNavigator+GPU.idl:
* Modules/webgpu/WorkerNavigatorGPU.cpp:
* Modules/webxr/Navigator+WebXR.idl:
* Modules/webxr/WebXRBoundedReferenceSpace.idl:
* Modules/webxr/WebXRFrame.idl:
* Modules/webxr/WebXRInputSource.idl:
* Modules/webxr/WebXRInputSourceArray.idl:
* Modules/webxr/WebXRLayer.idl:
* Modules/webxr/WebXRPose.idl:
* Modules/webxr/WebXRReferenceSpace.idl:
* Modules/webxr/WebXRRenderState.idl:
* Modules/webxr/WebXRRigidTransform.idl:
* Modules/webxr/WebXRSession.idl:
* Modules/webxr/WebXRSpace.idl:
* Modules/webxr/WebXRSystem.cpp:
* Modules/webxr/WebXRSystem.idl:
* Modules/webxr/WebXRView.idl:
* Modules/webxr/WebXRViewerPose.idl:
* Modules/webxr/WebXRViewport.idl:
* Modules/webxr/WebXRWebGLLayer.idl:
* Modules/webxr/XREnvironmentBlendMode.idl:
* Modules/webxr/XREye.idl:
* Modules/webxr/XRHandedness.idl:
* Modules/webxr/XRInputSourceEvent.idl:
* Modules/webxr/XRInputSourcesChangeEvent.idl:
* Modules/webxr/XRInteractionMode.idl:
* Modules/webxr/XRReferenceSpaceEvent.idl:
* Modules/webxr/XRReferenceSpaceType.idl:
* Modules/webxr/XRRenderStateInit.idl:
* Modules/webxr/XRSessionEvent.idl:
* Modules/webxr/XRSessionInit.idl:
* Modules/webxr/XRSessionMode.idl:
* Modules/webxr/XRTargetRayMode.idl:
* Modules/webxr/XRVisibilityState.idl:
* Modules/webxr/XRWebGLLayerInit.idl:
* html/HTMLCanvasElement.cpp:
* html/canvas/WebGL2RenderingContext.cpp:
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLRenderingContextBase.cpp:
* html/canvas/WebGLTransformFeedback.idl:
* html/canvas/WebGLVertexArrayObject.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::peerConnectionEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebGLUsingMetal): Deleted.
(WebCore::RuntimeEnabledFeatures::webGLUsingMetal const): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebGL2Enabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webGL2Enabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setMaskWebGLStringsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::maskWebGLStringsEnabled const): Deleted.
* testing/FakeXRBoundsPoint.idl:
* testing/FakeXRButtonStateInit.idl:
* testing/FakeXRInputSourceInit.idl:
* testing/FakeXRRigidTransformInit.idl:
* testing/FakeXRViewInit.idl:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebGL2Enabled): Deleted.
(WebCore::InternalSettings::setWebGPUEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
* testing/WebFakeXRDevice.idl:
* testing/WebFakeXRInputController.idl:
* testing/WebXRTest.idl:
* testing/XRSimulateUserActivationFunction.idl:

Source/WebKit:

* WebProcess/Inspector/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::RemoteWebInspectorUI):
* WebProcess/Inspector/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::enableFrontendFeatures):
(WebKit::WebInspectorUI::WebInspectorUI):
* WebProcess/Inspector/WebInspectorUI.h:

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:
* Scripts/Preferences/WebPreferencesExperimental.yaml:


Canonical link: https://commits.webkit.org/236686@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 20:07:30 +00:00
Alex Christensen 6012498fbf Disable ApplicationCache with linkedOnOrAfter check
https://bugs.webkit.org/show_bug.cgi?id=224629

Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-16
Reviewed by Brady Eidson.

Source/WebCore:

ApplicationCache has been deprecated for two years in WebKit with a message to developers since r227225.

Firefox removed support in https://bugzilla.mozilla.org/show_bug.cgi?id=1619673 which shipped with Firefox 84 on Dec 15, 2020.

Chrome removed support in https://bugs.chromium.org/p/chromium/issues/detail?id=582750 by default in Chrome 85 on August 25, 2020
but they have a reverse origin trial program running right now so that some origins have it working, but they are planning to remove
even that support October 2021.

We have kept it working for a reason related to rdar://38505756, specifically the 4th and 5th comment in that bug.
That reason is now passed.

This patch removes support for new apps but keeps it working for 3rd party apps linked with existing SDKs.  Once those apps update
to a new SDK, they will be unable to use ApplicationCache.  They will need to migrate to use fetch service workers instead.

* platform/cocoa/VersionChecks.h:

Source/WebKit:

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultOfflineWebApplicationCacheEnabled):
* Shared/WebPreferencesDefaultValues.h:

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:

Tools:

* TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):
* WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):

Canonical link: https://commits.webkit.org/236651@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-16 20:41:08 +00:00
Tyler Wilcock d720a89a49 [css-counter-styles] Parse and add feature flag for @counter-style
https://bugs.webkit.org/show_bug.cgi?id=223150

Patch by Tyler Wilcock <twilco.o@protonmail.com> on 2021-04-16
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

@counter-style and its descriptors are now exposed behind a feature
flag, so pass some tests and fail others for a different reason
because this patch doesn't actually implement descriptor parsing and
setting yet.

* web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/idlharness-expected.txt:
* web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt:

Source/WebCore:

Parse @counter-style (without implementing descriptor parsing) behind
a new feature flag, CSSCounterStyleAtRulesEnabled.  A separate feature
flag for @counter-style <image> symbol values has also been added, as
image symbols have extra complexities that we won't want to hold the
entire feature back on.
https://www.w3.org/TR/css-counter-styles-3

The CSSCounterStyleRule IDL interface is also added and implemented,
and similarly feature flagged.
https://www.w3.org/TR/css-counter-styles-3/#apis

Test: webexposed/counter-style-is-not-exposed.html and existing WPTs.

* CMakeLists.txt:
Add CSSCounterStyleRule.idl.

* DerivedSources-input.xcfilelist:
Add CSSCounterStyleRule.idl.

* DerivedSources-output.xcfilelist:
Add JSCSSCounterStyleRule.h and JSCSSCounterStyleRule.cpp.

* DerivedSources.make:
Add CSSCounterStyleRule.idl.

* Sources.txt:
Add CSSCounterStyleRule.cpp and JSCSSCounterStyleRule.cpp.

* WebCore.xcodeproj/project.pbxproj:
Add CounterStyle.h, CounterStyle.cpp, and CounterStyle.idl.

* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
Support CSSCounterStyleRule.

* bindings/js/WebCoreBuiltinNames.h:
Add macro(CSSCounterStyleRule) to generate counter-style built-in
names.

* css/CSSCounterStyleRule.cpp: Added.
(WebCore::StyleRuleCounterStyle::StyleRuleCounterStyle):
(WebCore::StyleRuleCounterStyle::create):
(WebCore::StyleRuleCounterStyle::mutableProperties):
(WebCore::CSSCounterStyleRule::CSSCounterStyleRule):
(WebCore::CSSCounterStyleRule::reattach):
(WebCore::CSSCounterStyleRule::cssText const):

* css/CSSCounterStyleRule.h: Added.
(isType): Add specialized rule.isCounterStyleRule() implementation.

* css/CSSCounterStyleRule.idl: Added.
* css/CSSRule.cpp: Add new StyleRuleType::CounterStyle COMPILE_ASSERT.
* css/CSSRule.h:
Add COUNTER_STYLE_RULE constant.  Also add comment `// WebIDL enum` to
disable enum_casing lint, since these values are named to match IDL
attributes.
* css/CSSRule.idl: Add COUNTER_STYLE_RULE constant behind flag.

* css/StyleRule.cpp:
(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy const):
(WebCore::StyleRuleBase::createCSSOMWrapper const):
Handle newly added StyleRuleType::CounterStyle.

* css/StyleRule.h:
(WebCore::StyleRuleBase::isCounterStyleRule const): Added.

* css/StyleRuleType.h: Add StyleRuleType::CounterStyle

* css/StyleSheetContents.cpp:
(WebCore::traverseRulesInVector):
(WebCore::StyleSheetContents::traverseSubresources const):
If @counter-style image symbols flag is enabled, do traverse
subresources.

* css/parser/CSSAtRuleID.cpp:
If the @counter-style feature flag is enabled, return newly added
CSSAtRuleCounterStyle ID.

(WebCore::cssAtRuleID):
* css/parser/CSSAtRuleID.h:
Add CSSAtRuleCounterStyle ID.

* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
Add cssCounterStyleAtRulesEnabled and
cssCounterStyleAtRuleImageSymbolsEnabled flags.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle
method.

* css/parser/CSSParserImpl.cpp:
(WebCore::computeNewAllowedRules):
(WebCore::CSSParserImpl::consumeAtRule):
(WebCore::CSSParserImpl::consumeCounterStyleRule): Added.
(WebCore::CSSParserImpl::consumeDeclarationList):
(WebCore::CSSParserImpl::consumeDeclaration):
* css/parser/CSSParserImpl.h:
Handle new @counter-style rule.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseValue): Handle
StyleRuleType::CounterStyle.
(WebCore::consumeCounterContent):
Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle
method.
(WebCore::CSSPropertyParser::parseCounterStyleDescriptor):
Add placeholder for future @counter-style descriptor parsing work.

* css/parser/CSSPropertyParser.h:
Add parseCounterStyleDescriptor method

* css/parser/CSSPropertyParserHelpers.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
Add new flag that allows consumed custom ident values to be lowercased
on-parse.  This is necessary for some <counter-style-name> values.
(WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Added.
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleName):
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude):
Parse @counter-style names, both in-prelude names and non-prelude
names (e.g. as part of the `extends` descriptor).

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:
 Add CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags.

Tools:

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):
Add `false` defaults for CSSCounterStyleAtRulesEnabled and
CSSCounterStyleAtRuleImageSymbolsEnabled flags.

LayoutTests:

Add tests ensuring @counter-style is not exposed when feature flag is
disabled.

* webexposed/counter-style-is-not-exposed-expected.txt: Added.
* webexposed/counter-style-is-not-exposed.html: Added.

Canonical link: https://commits.webkit.org/236643@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-16 19:19:04 +00:00
Alex Christensen 7b31fcc135 Remove support for NPAPI plugins in WebView
https://bugs.webkit.org/show_bug.cgi?id=224449

Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-13
Reviewed by Chris Dumez.

Source/WebKitLegacy/mac:

* WebView/WebPreferences.mm:
(-[WebPreferences setPlugInsEnabled:]):

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:

Tools:

Keep them on in tests until we remove the code.

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):

Canonical link: https://commits.webkit.org/236476@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-13 21:20:56 +00:00
Youenn Fablet 296c14ff9d Enable NSURLSession WebSocket code path by default
https://bugs.webkit.org/show_bug.cgi?id=224102

Reviewed by Alex Christensen.

* Scripts/Preferences/WebPreferencesExperimental.yaml:


Canonical link: https://commits.webkit.org/236153@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 08:54:06 +00:00
Wenson Hsieh cce687ded5 REGRESSION: ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUsesIdempotentMode() on various tests
https://bugs.webkit.org/show_bug.cgi?id=209450
<rdar://problem/60799255>

Reviewed by Tim Horton.

Source/WebCore:

When running layout tests without idempotent text autosizing after layout tests with idempotent text autosizing
enabled, it's possible to get into a state where the text size adjustment timer (which is used to schedule
idempotent text autosizing style adjustments) is scheduled, but idempotent text autosizing is disabled before
the timer fires. This causes the assertion in `resetIdempotentTextAutosizingIfNeeded` to fail, leading to a
debug assertion.

To prevent this, we simply add a client method to call out to WebPage to stop its idempotent text autosizing
timer when the idempotent text autosizing WebCore setting changes to disabled.

This fixes assertions on these four tests, which are normally run after fast/text-autosizing:
- fast/text/control-characters/visible-control-characters-1.html
- fast/text/firstline/001.html
- fast/text-indicator/text-indicator-empty-link.html
- fast/text/basic/001.html

* page/ChromeClient.h:
(WebCore::ChromeClient::textAutosizingUsesIdempotentModeChanged):

Add the new chrome client hook (see WebKit2 change for more details).

* page/SettingsBase.cpp:
(WebCore::SettingsBase::textAutosizingUsesIdempotentModeChanged):

Replace the existing settings change handler (`setNeedsRecalcStyleInAllFrames`) with a custom change handler
(`textAutosizingUsesIdempotentModeChanged`) that invokes the client hook above, in addition to flagging all
frames for a style recalc.

* page/SettingsBase.h:

Source/WebKit:

See WebCore for more details.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::textAutosizingUsesIdempotentModeChanged):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::textAutosizingUsesIdempotentModeChanged):

Stop the idempotent text autosizing recomputation timer (`m_textAutoSizingAdjustmentTimer`) when idempotent text
autosizing is disabled.

* WebProcess/WebPage/WebPage.h:

Source/WTF:

Replace the call to `setNeedsRecalcStyleInAllFrames` with `textAutosizingUsesIdempotentModeChanged` when
changing whether idempotent text autosizing is enabled.

* Scripts/Preferences/WebPreferencesInternal.yaml:

LayoutTests:

Remove crashing expectations for several tests that previously hit this assertion, due to running immediately
after some layout tests in `fast/text-autosizing` that enable idempotent text autosizing.

* platform/ios-wk2/TestExpectations:


Canonical link: https://commits.webkit.org/236138@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 02:36:12 +00:00
Simon Fraser 3cbd2e47d2 Enable PreferPageRenderingUpdatesNear60FPSEnabled by default
https://bugs.webkit.org/show_bug.cgi?id=224133

Reviewed by Tim Horton.

Turn the PreferPageRenderingUpdatesNear60FPSEnabled internal setting on by default. This
means that requestAnimationFrame on 144Hz displays will fire at 72Hz. 60Hz displays are
unaffected.

Firing at "close to 60fps" was determined to be necessary for web compatibility and power.

* Scripts/Preferences/WebPreferencesInternal.yaml:

Canonical link: https://commits.webkit.org/236110@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-02 22:57:56 +00:00