WebKit-https.git
11 months agoUnreviewed, reverting r290220.
jbedard@apple.com [Tue, 22 Feb 2022 15:16:21 +0000 (15:16 +0000)]
Unreviewed, reverting r290220.

Tests still fail with with fuzzy data

Reverted changeset:

"Test gardening for [CSS Blending] Non-separable blend modes
don't work"
https://bugs.webkit.org/show_bug.cgi?id=131354
https://commits.webkit.org/r290220

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290303 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[Flatpak SDK] Update FDO junction for GDB 11.x
commit-queue@webkit.org [Tue, 22 Feb 2022 14:10:52 +0000 (14:10 +0000)]
[Flatpak SDK] Update FDO junction for GDB 11.x
https://bugs.webkit.org/show_bug.cgi?id=236979

Patch by Philippe Normand <pnormand@igalia.com> on 2022-02-22
Reviewed by Adrian Perez de Castro.

* elements/freedesktop-sdk.bst: gdb 10 is crashy in the current SDK, but was fixed in the
upstream FDO SDK, by updating to the 11.x version.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290302 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoPermission API: handle non-fully active documents
commit-queue@webkit.org [Tue, 22 Feb 2022 13:35:13 +0000 (13:35 +0000)]
Permission API: handle non-fully active documents
https://bugs.webkit.org/show_bug.cgi?id=236952

LayoutTests/imported/w3c:

Web Platform Test
https://github.com/web-platform-tests/wpt/pull/32921

Patch by Marcos Caceres <marcos@marcosc.com> on 2022-02-22
Reviewed by Youenn Fablet.

* web-platform-tests/permissions/non-fully-active.https-expected.txt: Added.
* web-platform-tests/permissions/non-fully-active.https.html: Added.
* web-platform-tests/permissions/resources/empty.html: Added.

Source/WebCore:

Spec change:
https://github.com/w3c/permissions/pull/365

Patch by Marcos Caceres <marcos@marcosc.com> on 2022-02-22
Reviewed by Youenn Fablet.

Test: imported/w3c/web-platform-tests/permissions/non-fully-active.https.html

* Modules/permissions/PermissionStatus.cpp:
(WebCore::PermissionStatus::stateChanged):
* Modules/permissions/Permissions.cpp:
(WebCore::Permissions::query):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoInitial support for Wasm/ESM-integration in the WebCore module loader
commit-queue@webkit.org [Tue, 22 Feb 2022 13:21:01 +0000 (13:21 +0000)]
Initial support for Wasm/ESM-integration in the WebCore module loader
https://bugs.webkit.org/show_bug.cgi?id=236268

Patch by Asumu Takikawa <asumu@igalia.com> on 2022-02-22
Reviewed by Yusuke Suzuki.

LayoutTests/imported/w3c:

Add test suite for Wasm/ESM integration proposal to WPT Wasm WebAPI
tests.

* web-platform-tests/wasm/webapi/esm-integration/execute-start.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/execute-start.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/exported-names.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/exported-names.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/invalid-bytecode.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/invalid-bytecode.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/js-wasm-cycle-errors.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/js-wasm-cycle-errors.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/js-wasm-cycle.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/js-wasm-cycle.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/module-parse-error.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/module-parse-error.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/resolve-export.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resolve-export.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/resolve-export.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/execute-start.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/exported-names.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/invalid-bytecode.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/invalid-module.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-function-error.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-function-error.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-global.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-global.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-memory.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-memory.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-table.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-table.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-value.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle-value.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle.js: Added.
(f):
* web-platform-tests/wasm/webapi/esm-integration/resources/js-wasm-cycle.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/log.js: Added.
(export.logExec):
* web-platform-tests/wasm/webapi/esm-integration/resources/resolve-export.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-export-i64-global.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-export-to-wasm.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-error-from-wasm.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-from-wasm.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-func.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-func.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-global.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-global.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-memory.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-memory.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-table.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-import-table.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-js-cycle.js: Added.
(let.jsFunc):
(export.mutateBindings):
* web-platform-tests/wasm/webapi/esm-integration/resources/wasm-js-cycle.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/worker-helper.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/worker.js: Added.
* web-platform-tests/wasm/webapi/esm-integration/resources/worker.wasm: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-import-wasm-export.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-import-wasm-export.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-import.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-import.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-js-cycle.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-js-cycle.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-to-wasm-link-error.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/wasm-to-wasm-link-error.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/worker-import.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/worker-import.tentative.html: Added.
* web-platform-tests/wasm/webapi/esm-integration/worker.tentative-expected.txt: Added.
* web-platform-tests/wasm/webapi/esm-integration/worker.tentative.html: Added.

Source/JavaScriptCore:

Adjust WebAssemblySourceProvider to inherit from a new abstract base
class that exposes the data as a pointer and size, to allow
implementations other than a Vector. Also add initialization
and cleanup methods managed by RAII class.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* parser/SourceProvider.cpp:
(JSC::BaseWebAssemblySourceProvider::BaseWebAssemblySourceProvider):
* parser/SourceProvider.h:
(JSC::BaseWebAssemblySourceProvider::lockUnderlyingBuffer):
(JSC::BaseWebAssemblySourceProvider::unlockUnderlyingBuffer):
(JSC::WebAssemblySourceProviderBufferGuard::WebAssemblySourceProviderBufferGuard):
(JSC::WebAssemblySourceProviderBufferGuard::~WebAssemblySourceProviderBufferGuard):
* runtime/CachedTypes.cpp:
(JSC::CachedWebAssemblySourceProvider::encode):
* tools/JSDollarVM.cpp:
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::getWasmBufferFromValue):
(JSC::createSourceBufferFromValue):

Source/WebCore:

Add initial WebAssembly script support for WebCore module loading. It
does not yet support Wasm scripts in workers. Detection of Wasm
modules is currently done by MIME type, not by import assertions.

* Headers.cmake:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::hasWasmMIMEType const):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateModule):
* bindings/js/ScriptController.h:
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::evaluate):
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/ScriptModuleLoader.h:
* bindings/js/WebAssemblyCachedScriptSourceProvider.h: Added.
* bindings/js/WebAssemblyScriptSourceCode.h: Copied from Source/JavaScriptCore/parser/SourceProvider.cpp.
(WebCore::WebAssemblyScriptSourceCode::WebAssemblyScriptSourceCode):
(WebCore::WebAssemblyScriptSourceCode::jsSourceCode const):
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedWebAssemblyMIMEType):
* platform/MIMETypeRegistry.h:
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::evaluateModule):
* workers/WorkerOrWorkletScriptController.h:

Source/WTF:

Add preference flag for Wasm/ESM Integration.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

Add Wasm module MIME type for HTTP tests, and add tests.

* http/conf/mime.types:
* http/tests/wasm/resources/empty-module.wasm: Added.
* http/tests/wasm/wasm-esm-disabled-with-setting-expected.txt: Added.
* http/tests/wasm/wasm-esm-disabled-with-setting.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290300 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoProperly uninitialize EGL display before termination
psaavedra@igalia.com [Tue, 22 Feb 2022 10:29:37 +0000 (10:29 +0000)]
Properly uninitialize EGL display before termination
https://bugs.webkit.org/show_bug.cgi?id=236766

From the docs [1], if contexts or surfaces associated with display
is current to any thread, they are not released until they
are no longer current as a result of eglMakeCurrent.

So call eglMakeCurrent() to such effect.

[1] https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglMakeCurrent.xhtml

Reviewed by Carlos Garcia Campos.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::terminateEGLDisplay):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290299 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Guard against dead remotes in numberOfProcessors
angelos@igalia.com [Tue, 22 Feb 2022 10:25:37 +0000 (10:25 +0000)]
[JSC] Guard against dead remotes in numberOfProcessors
https://bugs.webkit.org/show_bug.cgi?id=236643

Reviewed by Adrian Perez de Castro.

Instead of using only the first remote (and then defaulting to 1 when
it happens to not respond), try all the remotes in sequence.

Also, instead of trying the sysctl version on all hosts first and
only try nproc after sysctl has failed on all hosts, combine
sysctl and nproc in one command to speed things along.

This change also removes the numProcessors == 0 typo in the rescue
path.

* Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290298 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] ShadowRealm JSRemoteFunction creation should convert CopyNameAndLength errors...
ysuzuki@apple.com [Tue, 22 Feb 2022 10:14:20 +0000 (10:14 +0000)]
[JSC] ShadowRealm JSRemoteFunction creation should convert CopyNameAndLength errors to TypeError
https://bugs.webkit.org/show_bug.cgi?id=237007

Reviewed by Alexey Shvayka.

JSTests:

* test262/expectations.yaml:

Source/JavaScriptCore:

1. Rename JSRemoteFunction::create to tryCreate since it can throw an error.
2. Passing JSGlobalObject* as a first parameter to JSRemoteFunction::tryCreate since it can throw an error.
3. Extract CopyNameAndLength part and convert errors to TypeError as specified.

* jit/JITOperations.cpp:
(JSC::getWrappedValue):
(JSC::JSC_DEFINE_JIT_OPERATION):
* runtime/JSRemoteFunction.cpp:
(JSC::wrapValue):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSRemoteFunction::tryCreate):
(JSC::JSRemoteFunction::copyNameAndLength):
(JSC::JSRemoteFunction::finishCreation):
(JSC::JSRemoteFunction::create): Deleted.
* runtime/JSRemoteFunction.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] TypeError from JSRemoteFunction should be generated by JSRemoteFunction's JSGlo...
ysuzuki@apple.com [Tue, 22 Feb 2022 10:08:59 +0000 (10:08 +0000)]
[JSC] TypeError from JSRemoteFunction should be generated by JSRemoteFunction's JSGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=237013

Reviewed by Saam Barati.

JSTests:

* test262/expectations.yaml:

Source/JavaScriptCore:

Our unwinding converts any errors inside JSRemoteFunction to TypeError. At that time, we should
use JSRemoteFunction's JSGlobalObject for this type error.

* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::UnwindFunctor):
(JSC::UnwindFunctor::operator() const):
(JSC::sanitizeRemoteFunctionException):
(JSC::Interpreter::unwind):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290296 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoAvoid having to iterate the whole frame tree(s) every time we need to dispatch storag...
cdumez@apple.com [Tue, 22 Feb 2022 09:47:45 +0000 (09:47 +0000)]
Avoid having to iterate the whole frame tree(s) every time we need to dispatch storage events
https://bugs.webkit.org/show_bug.cgi?id=236985

Reviewed by Darin Adler.

Avoid having to iterate the whole frame tree(s) every time we need to dispatch storage events,
by keeping track of window objects interested in storage events. A Window object is interested
in storage events if both of the following conditions is true:
1. It has a Storage object (either localStorage or sessionStorage)
2. It has a storage event listener registered.

This patch also refactors the code so that we share more logic between WebKit1 and WebKit2.

Source/WebCore:

* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
(WebCore::InspectorDOMStorageAgent::clearDOMStorageItems):
* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
(WebCore::windowsInterestedInStorageEvents):
(WebCore::DOMWindow::forEachWindowInterestedInStorageEvents):
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::eventListenersDidChange):
* page/DOMWindow.h:
* page/DOMWindowProperty.h:
* storage/Storage.cpp:
(WebCore::Storage::setItem):
(WebCore::Storage::removeItem):
(WebCore::Storage::clear):
* storage/StorageArea.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::dispatchSessionStorageEventsToWindows):
(WebCore::dispatchLocalStorageEventsToWindows):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames): Deleted.
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Deleted.
* storage/StorageEventDispatcher.h:

Source/WebKit:

* WebProcess/WebStorage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::setItem):
(WebKit::StorageAreaImpl::removeItem):
(WebKit::StorageAreaImpl::clear):
* WebProcess/WebStorage/StorageAreaImpl.h:
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::setItem):
(WebKit::StorageAreaMap::removeItem):
(WebKit::StorageAreaMap::clear):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
(WebKit::framesForEventDispatching): Deleted.
* WebProcess/WebStorage/StorageAreaMap.h:

Source/WebKitLegacy:

* Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::setItem):
(WebKit::StorageAreaImpl::removeItem):
(WebKit::StorageAreaImpl::clear):
(WebKit::StorageAreaImpl::dispatchStorageEvent):
* Storage/StorageAreaImpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290295 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[GTK] Can't run performance tests due to a11y errors
carlosgc@webkit.org [Tue, 22 Feb 2022 09:24:18 +0000 (09:24 +0000)]
[GTK] Can't run performance tests due to a11y errors
https://bugs.webkit.org/show_bug.cgi?id=230705

Reviewed by Sergio Villar Senin.

Disable a11y in WTR since it's no longer nedded with ATSPI.

* WebKitTestRunner/gtk/main.cpp:
(main):
* WebKitTestRunner/wpe/main.cpp:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290293 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoNSSharingServicePicker gets deallocated when using the standard share menu item
katherine_cheney@apple.com [Tue, 22 Feb 2022 09:05:51 +0000 (09:05 +0000)]
NSSharingServicePicker gets deallocated when using the standard share menu item
https://bugs.webkit.org/show_bug.cgi?id=236998
<rdar://problem/89174827>

Reviewed by Wenson Hsieh.

The NSMenuItem should keep the NSSharingServicePicker alive.

* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::getShareMenuItem):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290292 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[GTK][WPE] Suspend web process after some time in the process cache
carlosgc@webkit.org [Tue, 22 Feb 2022 08:47:33 +0000 (08:47 +0000)]
[GTK][WPE] Suspend web process after some time in the process cache
https://bugs.webkit.org/show_bug.cgi?id=236971

Reviewed by Michael Catanzaro.

Implement platformSuspendProcess() and platformResumeProcess() for GTK and WPE ports.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::CachedProcess::CachedProcess):
(WebKit::WebProcessCache::CachedProcess::~CachedProcess):
(WebKit::WebProcessCache::CachedProcess::takeProcess):
* UIProcess/WebProcessCache.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformSuspendProcess):
(WebKit::WebProcessProxy::platformResumeProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Format the output of --reportTotalPhaseTimes=1 more nicely
rmorisset@apple.com [Tue, 22 Feb 2022 06:53:58 +0000 (06:53 +0000)]
[JSC] Format the output of --reportTotalPhaseTimes=1 more nicely
https://bugs.webkit.org/show_bug.cgi?id=237005

Reviewed by Saam Barati.

Source/JavaScriptCore:

Before this patch:
[B3] moveConstants total ms: 64.307583 max ms: 1.703167
[B3] lowerToAir total ms: 151.297782 max ms: 5.426375
[B3] generateToAir total ms: 1623.987166 max ms: 92.826750
[B3] simplifyCFG total ms: 11.760463 max ms: 1.088083
[B3] Air::lowerMacros total ms: 5.975679 max ms: 0.382000

After this patch:
total ms:   66.328 max ms:   2.283 [B3] moveConstants
total ms:  148.097 max ms:   5.361 [B3] lowerToAir
total ms: 1619.115 max ms:  96.307 [Total B3] generateToAir
total ms:   11.959 max ms:   1.185 [Air] simplifyCFG
total ms:    6.519 max ms:   0.697 [Air] Air::lowerMacros

Concretely there are two changes:
- use FixedWidthDouble (also introduced to WTF in this patch) to line-up the total times.
  This makes it possible to see at a glance which phases are worth optimizing and which aren't.
- Tag phases more precisely, and in particular replace [B3] by [Air] where relevant,
  and give different tags to measurements that correspond to groups of phases instead of a single phase (e.g. generateToAir).

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Compile.cpp:
(JSC::B3::compile):
* b3/B3FixSSA.cpp:
* b3/B3Generate.cpp:
(JSC::B3::prepareForGeneration):
(JSC::B3::generateToAir):
* b3/B3PhaseScope.cpp:
(JSC::B3::PhaseScope::PhaseScope):
* b3/B3PhaseScope.h:
* b3/B3TimingScope.h: Removed.
(JSC::B3::TimingScope::TimingScope): Deleted.
* b3/B3VariableLiveness.cpp:
(JSC::B3::VariableLiveness::VariableLiveness):
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp:
(JSC::B3::Air::GenerateAndAllocateRegisters::generate):
* b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
(JSC::B3::Air::generateWithAlreadyAllocatedRegisters):
* b3/air/AirLiveness.h:
(JSC::B3::Air::Liveness::Liveness):
* b3/air/AirPhaseScope.cpp:
(JSC::B3::Air::PhaseScope::PhaseScope):
* b3/air/AirPhaseScope.h:
* tools/CompilerTimingScope.cpp:

Source/WTF:

Add FixedWidthDouble, which allows easily printing a double with some whitespace to pad it out if it is smaller than expected.
Its design roughly follows RawPointer which similarly allows special formatting of a kind of number.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FixedWidthDouble.h: Added.
(WTF::FixedWidthDouble::FixedWidthDouble):
(WTF::FixedWidthDouble::value const):
(WTF::FixedWidthDouble::width const):
(WTF::FixedWidthDouble::precision const):
* wtf/PrintStream.cpp:
(WTF::printInternal):
* wtf/PrintStream.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290290 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUse ArgumentParser for parsing args in generate-compile-commands
commit-queue@webkit.org [Tue, 22 Feb 2022 06:43:37 +0000 (06:43 +0000)]
Use ArgumentParser for parsing args in generate-compile-commands
https://bugs.webkit.org/show_bug.cgi?id=236995

Patch by Brandon Stewart <brandonstewart@apple.com> on 2022-02-21
Reviewed by Alexey Proskuryakov.

Use argument parser instead of sys.argv[1] for getting build dir.

* Scripts/generate-compile-commands:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290289 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoAllow adattributiond to start on iOS devices
achristensen@apple.com [Tue, 22 Feb 2022 04:57:51 +0000 (04:57 +0000)]
Allow adattributiond to start on iOS devices
https://bugs.webkit.org/show_bug.cgi?id=237009
<rdar://89062166>

Reviewed by Per Arne Vollan.

There were three more problems preventing it from starting:
1. The code signature said to look for a sandbox profile with "webkit" in the name, but the profile had "WebKit" in the name.
   These names are case sensitive.
2. The sandbox profile would not let it load the WebKit framework, so dyld would fail and the process would fail to launch.
   I added the framework directories that the XPC services are allowed to access.
3. Once it started, it would crash inside WTF::initializeMainThread when calling WTF::pageSize which requires access to the hw.pagesize_compat syscall.
   As a starting point, I'm going to allow all the syscalls that the network process currently has access to,
   which is enough to get it to respond without crashing.
4. We need access to com.apple.diagnosticd and com.apple.analyticsd in order to be able to generate crash reports.  This is quite useful.
Yes, I know I said there were only three problems, but the 4th is so useful I thought I'd put it in the list.

* Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb:
* Scripts/process-entitlements.sh:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290288 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoImprove const correctness for SecurityOrigin accessors
achristensen@apple.com [Tue, 22 Feb 2022 04:57:01 +0000 (04:57 +0000)]
Improve const correctness for SecurityOrigin accessors
https://bugs.webkit.org/show_bug.cgi?id=236983

Reviewed by Chris Dumez.

Source/WebCore:

* loader/SubresourceLoader.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::origin const):
(WebCore::CachedResource::origin):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::origin const):
(WebCore::CachedResourceRequest::origin):

Source/WebKit:

* UIProcess/Notifications/WebNotification.h:
(WebKit::WebNotification::origin const):
(WebKit::WebNotification::origin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290287 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[iOS] Adjust some behaviors around the "Markup Image" action in the callout bar
wenson_hsieh@apple.com [Tue, 22 Feb 2022 04:03:59 +0000 (04:03 +0000)]
[iOS] Adjust some behaviors around the "Markup Image" action in the callout bar
https://bugs.webkit.org/show_bug.cgi?id=236980

Reviewed by Aditya Keerthi.

Source/WebKit:

Adjust the following behaviors around the "Markup Image" callout bar item on iOS:
1.  The item should be present as long as the selection range contains a single image item (not only if the
    selection range exactly encompasses a single image element.
2.  The item should appear in the callout bar before other WebKit-client-provided menu controller items.

This patch also adds a new API test to exercise these behaviors and, in doing so, also refactors logic around
determining whether or not to show this item so that it's dependent on a WebKit internal feature instead of just
the system feature flag (with the default value of the internal feature being equal to whether or not the system
feature is enabled). This means we can run tests for these features without requiring the system feature flag to
be enabled.

See below for more details.

Test: ImageAnalysisTests.MenuControllerItems

* Platform/cocoa/TextRecognitionUtilities.mm:
(WebKit::makeTextRecognitionResult):

Drive-by fix for some API tests: only attempt to send the platform image analysis result over IPC if it is a
`VKCImageAnalysis`. In some API tests, we use mock objects here instead, which currently causes the IPC message
send to fail due to encoding failure.

* Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
(WebKit::defaultImageAnalysisMarkupEnabled):
* Shared/WebPreferencesDefaultValues.h:

Make the new internal feature flag default to the system feature flag.

* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):

Consult a new delegate method (`-actionSheetAssistantShouldIncludeCopyCroppedImageAction:`) instead of checking
the system feature flag directly.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView updateImageAnalysisMarkupMenuItems:]):

Append the "Markup Image" item at the start of the list of additional menu items.

(-[WKContentView canPerformImageAnalysisMarkup]):

Check the internal feature instead of the system feature flag.

(-[WKContentView performImageAnalysisMarkup:]):

Now that this action can be triggered even when the current selection doens't encompass only a single image, we
need to use `replaceWithPasteboardData()` instead, passing in the element context of the image element we want
to replace.

(-[WKContentView actionSheetAssistantShouldIncludeCopyCroppedImageAction:]):

Only attempt to show the new items if the internal feature is enabled. Consulted by `WKActionSheetAssistant`
above.

* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu):

Check the internal feature instead of the system feature flag.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPlatformEditorState const):

Make a minor adjustment here to bail early only if we find multiple image elements in the selected range,
rather than bailing if we find anything that's not an image element.

Source/WTF:

Add a WebKit internal feature flag to control whether or not the "Markup Image" and related "Copy Cropped Image"
menu items should be enabled on iOS and macOS. This enables us to test these features in API and layout tests
without requiring the corresponding system feature flag to be enabled.

* Scripts/Preferences/WebPreferencesInternal.yaml:

Tools:

Add an API test to verify that "Markup Image" appears as the first non-default callout bar item when a single
image element is in the selection range. The test is comprised of three parts:

1. Select just a single image, and expect the "Markup Image" item.
2. Select all images in the document, and expect no "Markup Image" item.
3. Select a single image and some surrounding text, and expect the "Markup Image" item.

See WebKit/ChangeLog for more details.

* TestWebKitAPI/Tests/WebKitCocoa/ImageAnalysisTests.mm:
(TestWebKitAPI::createWebViewWithTextRecognitionEnhancements):
(TestWebKitAPI::swizzledSetMenuItems):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/multiple-images.html:

Add some text before and after each image so that we can select a single image alongside some text, and exercise
the changes in `WebPage::getPlatformEditorState` (see WebKit changes for more information).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290286 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoEnsure layer has backing during traversal
commit-queue@webkit.org [Tue, 22 Feb 2022 03:57:42 +0000 (03:57 +0000)]
Ensure layer has backing during traversal
https://bugs.webkit.org/show_bug.cgi?id=236858

Patch by Brandon Stewart <brandonstewart@apple.com> on 2022-02-21
Reviewed by Simon Fraser.

Ensure the layer has a backing attached to it before trying to append
the node id.

* rendering/RenderLayerCompositor.cpp:
(WebCore::collectStationaryLayerRelatedOverflowNodes):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290285 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoMake input element UA shadow tree creation lazy
heycam@apple.com [Tue, 22 Feb 2022 03:36:52 +0000 (03:36 +0000)]
Make input element UA shadow tree creation lazy
https://bugs.webkit.org/show_bug.cgi?id=236747

Reviewed by Aditya Keerthi.

Source/WebCore:

We currently delay InputType creation for parser inserted elements until
just after the attributes have been set, so that we don't wastefully
create an InputType and the UA shadow tree creation if a non-text
type="" was specified on the tag. We don't do anything similar for
script inserted input elements. We could make the InputType creation
lazy, but most of the wasted time is due to the shadow tree creation.

This patch makes InputType shadow tree creation lazy by delaying it
until one of the following happens:

1. the element is inserted into the document
2. the type="" or value="" attributes are changed before the element
   is inserted into the document
3. any DOM methods that need access to the innerTextElement() are
   called on the element before the element is inserted into the
   document

Not all places where we call innerTextElement() on the
HTMLInputElement are safe to lazily create the shadow trees, so we
have two accessors:

- innerTextElement() returns the inner text element if it's been
  created already
- innerTextElementCreatingShadowSubtreeIfNeeded will perform the lazy
  shadow tree construction if it hasn't already been done

Since the existing
createShadowSubtreeAndUpdateInnerTextElementEditability function has
more responsibility than just creating the subtree and ensuring the
editability is set appropriately, it's renamed to a more manageable
createShadowSubtree.

This change is a 0.5% progression on Speedometer 2.

Test: fast/forms/lazy-shadow-tree-creation.html

* html/BaseDateAndTimeInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/ColorInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/FileInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree):
(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/RangeInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/SearchInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed createShadowSubtreeAndUpdateInnerTextElementEditability to
createShadowSubtree and remove the "isInnerTextElementEditable"
argument, since we can ask the element() for its value if needed.
createShadowSubtree is now also responsible for creating the shadow
root.

* html/TextFieldInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed. Ensure all shadow tree state is up to date now that it can be
created later.

* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::hasCreatedShadowSubtree const):
New functions to create the shadow subtree if it hasn't been done
already, and to query whether it's been done.

* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextAreaElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextFormControlElement.h:
* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::innerTextElementCreatingShadowSubtreeIfNeeded):
New functions to first create the shadow subtree before returning
innerTextElement(). HTMLTextAreaElement never lazily creates its
shadow subtree and so just returns innerTextElement().

* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
Deleted. Just call through to m_inputType->createShadowTree()
directly.

(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::create):
(WebCore::HTMLInputElement::initializeInputType):
(WebCore::HTMLInputElement::updateType):
Don't immediately create the shadow tree.

(WebCore::HTMLInputElement::didFinishInsertingNode):
Create the shadow subtree now that the element's been inserted. No
need to call dataListMayHaveChanged since
TextFieldInputType::createShadowSubtree will now do this.

* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::updateInnerTextValue):
Ensure the shadow subtree is created since we need to poke at it.

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::forwardEvent):
Don't forward the event if the shadow tree hasn't been created yet.

(WebCore::HTMLTextFormControlElement::setSelectionRange):
Ensure the shadow tree has been created. This is needed if the
selection APIs are called on the input element before it's inserted
into the document.

(WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
Assert that the shadow tree has been created, since editing
functionality should only be needed if the element's been inserted
into the document.

(WebCore::HTMLTextFormControlElement::setInnerTextValue):
Ensure the shadow tree has been created.

* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::handleKeydownEvent):
Ensure the shadow tree has been created in case the event will change
the value.

(WebCore::RangeInputType::sliderTrackElement const):
Only return the element if it's been created.

(WebCore::RangeInputType::typedSliderThumbElement const):
Assert that the element has been created.

(WebCore::RangeInputType::dataListMayHaveChanged):
Only try to re-layout if the shadow tree has been created.

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isEmptyValue const):
Avoid creating the shadow subtree.

(WebCore::TextFieldInputType::forwardEvent):
Move the element assertion up to be consistent with other functions.

(WebCore::TextFieldInputType::innerTextElement const):
Don't assert, since this now can legitimately return null.

* html/FileInputType.cpp:
(WebCore::FileInputType::disabledStateChanged):
(WebCore::FileInputType::attributeChanged):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::disabledStateChanged):
(WebCore::RangeInputType::attributeChanged):
(WebCore::RangeInputType::setValue):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::disabledStateChanged):
(WebCore::TextFieldInputType::readOnlyStateChanged):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::updateAutoFillButton):
(WebCore::TextFieldInputType::dataListMayHaveChanged):
Don't update the shadow tree contents if it hasn't been created yet.
createShadowTree is responsible for ensuring it creates the shadow
tree contents reflecting the current state.

LayoutTests:

* fast/forms/lazy-shadow-tree-creation-expected.html: Added.
* fast/forms/lazy-shadow-tree-creation.html: Added.
* fast/forms/lazy-shadow-tree-creation.js: Added.
(supportsType):
(makeAndAppendInput):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290284 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Fix ShadowRealm unwinding
ysuzuki@apple.com [Tue, 22 Feb 2022 02:16:28 +0000 (02:16 +0000)]
[JSC] Fix ShadowRealm unwinding
https://bugs.webkit.org/show_bug.cgi?id=237001

Reviewed by Saam Barati.

JSTests:

* test262/expectations.yaml:

Source/JavaScriptCore:

This patch fixes a crash bug found by test262. Regardless of it is RemoteFunction,
we should handle it as the same way to the other normal host functions except
for setting m_seenRemoteFunction = true flag. Previously, we are early returning,
this is wrong since we should stop unwinding if the caller is entry frame.

* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator() const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290283 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Temporal.PlainDate should validate input range
ysuzuki@apple.com [Tue, 22 Feb 2022 02:12:13 +0000 (02:12 +0000)]
[JSC] Temporal.PlainDate should validate input range
https://bugs.webkit.org/show_bug.cgi?id=236936

Reviewed by Darin Adler.

JSTests:

* stress/temporal-plaindate.js:
(shouldThrow):

Source/JavaScriptCore:

Implement https://tc39.es/proposal-temporal/#sec-temporal-isodatetimewithinlimits check in
PlainDate to validate input range. For example, 0x7fffffff year should be rejected since
it is larger than ECMAScript datetime representation value. This is checked via ISODateTimeWithinLimits
in the spec.

We also remove isValid assertions in ExactTime. This should not be checked in these accessors, rather,
we should call that function when we would like to check, since PlainDate can represent a bit smaller
value than ExactTime's minValue (minValue - nsPerDay).

We also extend ExactTime::fromISOPartsAndOffset to handle values via Int128 to accept int32_t range years.
By using Int128 for nanoseconds, we can even represent int32_t max / min years. And we remove
`ASSERT(y >= -999999 && y <= 999999)` check since this is not necessary.

* runtime/ISO8601.cpp:
(JSC::ISO8601::ExactTime::fromISOPartsAndOffset):
(JSC::ISO8601::isDateTimeWithinLimits):
* runtime/ISO8601.h:
(JSC::ISO8601::ExactTime::ExactTime): Deleted.
(JSC::ISO8601::ExactTime::fromEpochSeconds): Deleted.
(JSC::ISO8601::ExactTime::fromEpochMilliseconds): Deleted.
(JSC::ISO8601::ExactTime::fromEpochMicroseconds): Deleted.
(JSC::ISO8601::ExactTime::epochSeconds const): Deleted.
(JSC::ISO8601::ExactTime::epochMilliseconds const): Deleted.
(JSC::ISO8601::ExactTime::epochMicroseconds const): Deleted.
(JSC::ISO8601::ExactTime::epochNanoseconds const): Deleted.
(JSC::ISO8601::ExactTime::nanosecondsFraction const): Deleted.
(JSC::ISO8601::ExactTime::asString const): Deleted.
(JSC::ISO8601::ExactTime::isValid const): Deleted.
(JSC::ISO8601::ExactTime::operator< const): Deleted.
(JSC::ISO8601::ExactTime::operator<= const): Deleted.
(JSC::ISO8601::ExactTime::operator== const): Deleted.
(JSC::ISO8601::ExactTime::operator!= const): Deleted.
(JSC::ISO8601::ExactTime::operator>= const): Deleted.
(JSC::ISO8601::ExactTime::operator> const): Deleted.
* runtime/TemporalPlainDate.cpp:
(JSC::toPlainDate):

Source/WTF:

Add code to allow dataLog(Int128).

* wtf/Int128.cpp:
(WTF::printInternal):
* wtf/Int128.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290282 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed gardening for the GPU Process bots.
jonlee@apple.com [Tue, 22 Feb 2022 02:01:09 +0000 (02:01 +0000)]
Unreviewed gardening for the GPU Process bots.
* css3/color-filters/color-filter-text-decoration-shadow.html:
* fast/gradients/conic-gradient-alpha-unpremultiplied.html:
* fast/gradients/conic-gradient-alpha.html:
* fast/gradients/linear-two-hints-angle.html:
* fast/scrolling/overflow-inside-foreignobject.html:
* gpu-process/TestExpectations:
* imported/blink/svg/custom/crisp-edges-leak.svg:
* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290281 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoAdd test name to the image diff template
jonlee@apple.com [Tue, 22 Feb 2022 01:48:11 +0000 (01:48 +0000)]
Add test name to the image diff template
https://bugs.webkit.org/show_bug.cgi?id=237003

Reviewed by Sam Weinig.

Tools:

* Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
(TestResultWriter.write_image_diff_files):

LayoutTests:

Include the test name in the page. Workflow to update fuzzy match data becomes easier to copy-paste the name there instead of from the location bar.
* fast/harness/image-diff-template-expected.txt:
* fast/harness/image-diff-template.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290280 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoFix racy parallel build of WebKit2-4.0.gir
commit-queue@webkit.org [Tue, 22 Feb 2022 01:42:45 +0000 (01:42 +0000)]
Fix racy parallel build of WebKit2-4.0.gir
https://bugs.webkit.org/show_bug.cgi?id=232935

Patch by Alexander Kanavin <alex@linutronix.de> on 2022-02-21
Reviewed by Michael Catanzaro.

This is a target and not a command because it's used to build another .gir
and a .typelib, which would trigger two racy parallel builds when using command
(e.g. command would run twice, target runs only once).

* PlatformGTK.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290279 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoAdd test coverage for the pasteboard writing codepath added in r289839
wenson_hsieh@apple.com [Tue, 22 Feb 2022 01:37:17 +0000 (01:37 +0000)]
Add test coverage for the pasteboard writing codepath added in r289839
https://bugs.webkit.org/show_bug.cgi?id=236944

Reviewed by Aditya Keerthi.

Add test coverage for the changes in r289839 in the case where `ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)` is turned
on. To do this, we set the platform image analysis results to a new internal mock object,
`FakeImageAnalysisResult`, that returns a string for a given NSRange. This code is then exercised by several
existing layout tests that copy and paste text inside image overlays:

- fast/images/text-recognition/image-overlay-line-wrapping.html
- fast/images/text-recognition/image-overlay-text-without-leading-whitespace.html
- fast/images/text-recognition/mac/copy-image-overlay-text-with-context-menu.html

* testing/Internals.cpp:
(WebCore::Internals::installImageOverlay):
* testing/Internals.h:
* testing/Internals.mm:
(-[FakeImageAnalysisResult initWithString:]):
(-[FakeImageAnalysisResult _attributedStringForRange:]):
(WebCore::Internals::fakeImageAnalysisResultForTesting):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290278 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoSort WebCore and WebKit Xcode project files
mmaxfield@apple.com [Tue, 22 Feb 2022 01:13:21 +0000 (01:13 +0000)]
Sort WebCore and WebKit Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=237010

Unreviewed.

Source/WebCore:

No new tests because there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290277 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Fix build
mmaxfield@apple.com [Tue, 22 Feb 2022 01:07:16 +0000 (01:07 +0000)]
[WebGPU] Fix build
https://bugs.webkit.org/show_bug.cgi?id=237008

Unreviewed.

If you add a header to PAL that WebKit needs to #include, you'd better mark the header as Private.

* PAL.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290276 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[iOS] Fix the internal build after rdar://88354008
akeerthi@apple.com [Tue, 22 Feb 2022 00:22:50 +0000 (00:22 +0000)]
[iOS] Fix the internal build after rdar://88354008
https://bugs.webkit.org/show_bug.cgi?id=236999

Unreviewed build fix.

Mark deprecated implementations.

* UIProcess/API/ios/WKWebViewIOS.mm:
* UIProcess/ios/WKContentViewInteraction.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Fix release build
mmaxfield@apple.com [Tue, 22 Feb 2022 00:05:45 +0000 (00:05 +0000)]
[WebGPU] Fix release build
https://bugs.webkit.org/show_bug.cgi?id=237004

Unreviewed.

If you include WTF, you must have set NDEBUG in release builds.

* Configurations/Base.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290274 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Fix iOS build
mmaxfield@apple.com [Mon, 21 Feb 2022 23:24:21 +0000 (23:24 +0000)]
[WebGPU] Fix iOS build
https://bugs.webkit.org/show_bug.cgi?id=237000

The lowPower selector doesn't exist on iOS.

Unreviewed.

* WebGPU/Instance.mm:
(WebGPU::sortedDevices):
(WebGPU::Instance::requestAdapter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290273 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago== Rolled over to ChangeLog-2022-02-22 ==
aperez@igalia.com [Mon, 21 Feb 2022 23:11:34 +0000 (23:11 +0000)]
== Rolled over to ChangeLog-2022-02-22 ==

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290272 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 12: Migrate from C function callbacks to blocks
mmaxfield@apple.com [Mon, 21 Feb 2022 22:09:38 +0000 (22:09 +0000)]
[WebGPU] Tracer bullet part 12: Migrate from C function callbacks to blocks
https://bugs.webkit.org/show_bug.cgi?id=236934

Reviewed by Dean Jackson.

For all the C function pointer / userdata pairs, simply create a parallel entry point which accepts a block instead.

* WebGPU/Adapter.mm:
(wgpuAdapterRequestDeviceWithBlock):
* WebGPU/Buffer.mm:
(wgpuBufferMapAsyncWithBlock):
* WebGPU/CommandEncoder.mm:
(wgpuCommandEncoderSetLabel):
* WebGPU/ComputePipeline.mm:
(wgpuComputePipelineSetLabel):
* WebGPU/Device.mm:
(wgpuDeviceCreateComputePipelineAsyncWithBlock):
(wgpuDeviceCreateRenderPipelineAsyncWithBlock):
(wgpuDevicePopErrorScopeWithBlock):
(wgpuDeviceSetDeviceLostCallbackWithBlock):
(wgpuDeviceSetUncapturedErrorCallbackWithBlock):
* WebGPU/Instance.mm:
(wgpuInstanceRequestAdapterWithBlock):
* WebGPU/Queue.mm:
(wgpuQueueOnSubmittedWorkDoneWithBlock):
(wgpuQueueSetLabel):
* WebGPU/RenderPipeline.mm:
(wgpuRenderPipelineSetLabel):
* WebGPU/ShaderModule.mm:
(wgpuShaderModuleGetCompilationInfoWithBlock):
(wgpuShaderModuleSetLabel):
* WebGPU/Surface.mm:
(wgpuSurfaceGetPreferredFormat):
* WebGPU/SwapChain.mm:
(wgpuSwapChainPresent):
* WebGPU/WebGPUExt.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] ShadowRealm wrapArgument should check exceptions
ysuzuki@apple.com [Mon, 21 Feb 2022 22:06:36 +0000 (22:06 +0000)]
[JSC] ShadowRealm wrapArgument should check exceptions
https://bugs.webkit.org/show_bug.cgi?id=236984
JSTests:

Reviewed by Alexey Shvayka.

* stress/exception-in-wrap-argument-for-shadow-realm.js: Added.
(shouldThrow):

Source/JavaScriptCore:

rdar://89226554

Reviewed by Alexey Shvayka.

We should check exceptions after wrapArgument.

* runtime/JSRemoteFunction.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290269 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Update test262
ysuzuki@apple.com [Mon, 21 Feb 2022 22:00:19 +0000 (22:00 +0000)]
[JSC] Update test262
https://bugs.webkit.org/show_bug.cgi?id=236990

Reviewed by Alexey Shvayka.

* test262/expectations.yaml:
* test262/test262-Revision.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290268 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 11: Implement shader creation methods
mmaxfield@apple.com [Mon, 21 Feb 2022 21:34:13 +0000 (21:34 +0000)]
[WebGPU] Tracer bullet part 11: Implement shader creation methods
https://bugs.webkit.org/show_bug.cgi?id=236933

Reviewed by Dean Jackson.

This implements Device::createShaderModule() and Device::createComputePipeline(). The async versions (neither
the WebGPU nor the Metal flavor) aren't implemented yet; this is just the first basic implementation.

* WebGPU/ComputePipeline.mm:
(WebGPU::createLibrary):
(WebGPU::createConstantValues):
(WebGPU::createFunction):
(WebGPU::createComputePipelineState):
(WebGPU::Device::createComputePipeline):
(WebGPU::Device::createComputePipelineAsync):
* WebGPU/PipelineLayout.h:
* WebGPU/PipelineLayout.mm:
(WebGPU::PipelineLayout::operator== const):
(WebGPU::PipelineLayout::operator!= const):
* WebGPU/ShaderModule.h:
(WebGPU::ShaderModule::create):
* WebGPU/ShaderModule.mm:
(WebGPU::findShaderModuleParameters):
(WebGPU::ShaderModule::createLibrary):
(WebGPU::earlyCompileShaderModule):
(WebGPU::Device::createShaderModule):
(WebGPU::ShaderModule::ShaderModule):
(WebGPU::CompilationMessageData::CompilationMessageData):
(WebGPU::convertMessages):
(WebGPU::ShaderModule::getCompilationInfo):
(WebGPU::ShaderModule::setLabel):
(WebGPU::ShaderModule::convertPipelineLayout):
(WebGPU::ShaderModule::ast const):
(WebGPU::ShaderModule::pipelineLayoutHint const):
(WebGPU::ShaderModule::entryPointInformation const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290267 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 10: Implement setLabel() and Metal accessors
mmaxfield@apple.com [Mon, 21 Feb 2022 21:32:31 +0000 (21:32 +0000)]
[WebGPU] Tracer bullet part 10: Implement setLabel() and Metal accessors
https://bugs.webkit.org/show_bug.cgi?id=236910

Reviewed by Dean Jackson.

By adding a few various trivial functions in classes that need them, this patch completely finishes the
implementation of CommandBuffer, QuerySet, RenderBundle, Sampler, and TextureView classes (other than
their creation functions).

* WebGPU/Buffer.mm:
(WebGPU::Buffer::setLabel):
* WebGPU/CommandBuffer.h:
(WebGPU::CommandBuffer::commandBuffer const):
* WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::CommandBuffer):
(WebGPU::CommandBuffer::setLabel):
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::CommandEncoder):
(WebGPU::CommandEncoder::setLabel):
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::ComputePassEncoder):
(WebGPU::ComputePassEncoder::setLabel):
* WebGPU/ComputePipeline.h:
(WebGPU::ComputePipeline::computePipelineState const):
* WebGPU/ComputePipeline.mm:
(WebGPU::ComputePipeline::ComputePipeline):
(WebGPU::ComputePipeline::setLabel):
* WebGPU/QuerySet.h:
(WebGPU::QuerySet::counterSampleBuffer const):
* WebGPU/QuerySet.mm:
(WebGPU::QuerySet::QuerySet):
(WebGPU::QuerySet::setLabel):
* WebGPU/Queue.mm:
(WebGPU::Queue::Queue):
(WebGPU::Queue::setLabel):
* WebGPU/RenderBundle.h:
(WebGPU::RenderBundle::indirectCommandBuffer const):
* WebGPU/RenderBundle.mm:
(WebGPU::RenderBundle::RenderBundle):
(WebGPU::RenderBundle::setLabel):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::RenderBundleEncoder):
(WebGPU::RenderBundleEncoder::setLabel):
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
(WebGPU::RenderPassEncoder::setLabel):
* WebGPU/RenderPipeline.h:
(WebGPU::RenderPipeline::renderPipelineState const):
* WebGPU/RenderPipeline.mm:
(WebGPU::RenderPipeline::RenderPipeline):
(WebGPU::RenderPipeline::setLabel):
* WebGPU/Sampler.mm:
(WebGPU::Sampler::setLabel):
* WebGPU/ShaderModule.h:
(WebGPU::ShaderModule::library const):
* WebGPU/ShaderModule.mm:
(WebGPU::ShaderModule::ShaderModule):
(WebGPU::ShaderModule::setLabel):
* WebGPU/Texture.h:
(WebGPU::Texture::texture const):
* WebGPU/Texture.mm:
(WebGPU::Texture::Texture):
(WebGPU::Texture::setLabel):
* WebGPU/TextureView.mm:
(WebGPU::TextureView::setLabel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290266 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Add explicit exception check after appendWithoutSideEffects
ysuzuki@apple.com [Mon, 21 Feb 2022 21:29:03 +0000 (21:29 +0000)]
[JSC] Add explicit exception check after appendWithoutSideEffects
https://bugs.webkit.org/show_bug.cgi?id=236986
rdar://88258776

Reviewed by Saam Barati.

JSTests:

* stress/array-to-string-oom.js: Added.

Source/JavaScriptCore:

Add exception check after JSStringJoiner::appendWithoutSideEffects call since JSString::value can throw OOM error.

* runtime/ArrayPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSStringJoiner.h:
(JSC::JSStringJoiner::append):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290265 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 9: Basic implementation of bindings
mmaxfield@apple.com [Mon, 21 Feb 2022 21:27:46 +0000 (21:27 +0000)]
[WebGPU] Tracer bullet part 9: Basic implementation of bindings
https://bugs.webkit.org/show_bug.cgi?id=236903

Reviewed by Dean Jackson.

This is a basic implementation of the BindGroup, BindGroupLayout, and PipelineLayout methods.
Eventually we'll want to suballocate multiple BindGroups so they coexist within the same Buffer,
but this is an initial simple implementation that doesn't do that.

* WebGPU/BindGroup.h:
(WebGPU::BindGroup::vertexArgumentBuffer const):
(WebGPU::BindGroup::fragmentArgumentBuffer const):
(WebGPU::BindGroup::computeArgumentBuffer const):
* WebGPU/BindGroup.mm:
(WebGPU::bufferIsPresent):
(WebGPU::samplerIsPresent):
(WebGPU::textureViewIsPresent):
(WebGPU::Device::createBindGroup):
(WebGPU::BindGroup::BindGroup):
(WebGPU::BindGroup::setLabel):
* WebGPU/BindGroupLayout.h:
(WebGPU::BindGroupLayout::vertexArgumentEncoder const):
(WebGPU::BindGroupLayout::fragmentArgumentEncoder const):
(WebGPU::BindGroupLayout::computeArgumentEncoder const):
* WebGPU/BindGroupLayout.mm:
(WebGPU::isPresent):
(WebGPU::createArgumentDescriptor):
(WebGPU::Device::createBindGroupLayout):
(WebGPU::BindGroupLayout::BindGroupLayout):
(WebGPU::BindGroupLayout::setLabel):
(WebGPU::BindGroupLayout::encodedLength const):
* WebGPU/Buffer.h:
(WebGPU::Buffer::buffer const):
* WebGPU/Buffer.mm:
(WebGPU::Buffer::Buffer):
* WebGPU/PipelineLayout.h:
(WebGPU::PipelineLayout::create):
(WebGPU::PipelineLayout::numberOfBindGroupLayouts const):
(WebGPU::PipelineLayout::bindGroupLayout const):
* WebGPU/PipelineLayout.mm:
(WebGPU::Device::createPipelineLayout):
(WebGPU::PipelineLayout::PipelineLayout):
(WebGPU::PipelineLayout::setLabel):
* WebGPU/Sampler.h:
(WebGPU::Sampler::samplerState const):
* WebGPU/Sampler.mm:
(WebGPU::Sampler::Sampler):
* WebGPU/TextureView.h:
(WebGPU::TextureView::texture const):
* WebGPU/TextureView.mm:
(WebGPU::TextureView::TextureView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WinCairo] Unreviewed test gardening
Hironori.Fujii@sony.com [Mon, 21 Feb 2022 21:20:12 +0000 (21:20 +0000)]
[WinCairo] Unreviewed test gardening

* platform/wincairo/TestExpectations:
* platform/wincairo/fast/css/font-face-implicit-local-font-expected.txt:
* platform/wincairo/fast/text/international/bidi-layout-across-linebreak-expected.txt:
* platform/wincairo/fast/text/international/bidi-override-expected.txt:
* platform/wincairo/fast/text/international/text-combine-image-test-expected.txt:
* platform/wincairo/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290263 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 8: Basic implementation of device creation routines
mmaxfield@apple.com [Mon, 21 Feb 2022 20:49:00 +0000 (20:49 +0000)]
[WebGPU] Tracer bullet part 8: Basic implementation of device creation routines
https://bugs.webkit.org/show_bug.cgi?id=236902

Reviewed by Dean Jackson.

This is a basic implementation of the Instance, Adapter, and Device methods. Device limits are not
implemented yet, so for now we claim every limits is 0.

* WebGPU/Adapter.mm:
(WebGPU::Adapter::Adapter):
(WebGPU::Adapter::enumerateFeatures):
(WebGPU::Adapter::getLimits):
(WebGPU::Adapter::getProperties):
(WebGPU::Adapter::hasFeature):
(WebGPU::deviceMeetsRequiredLimits):
(WebGPU::Adapter::requestDevice):
* WebGPU/Device.h:
* WebGPU/Device.mm:
(WebGPU::Device::create):
(WebGPU::Device::Device):
(WebGPU::Device::destroy):
(WebGPU::Device::enumerateFeatures):
(WebGPU::Device::getLimits):
(WebGPU::Device::getQueue):
(WebGPU::Device::hasFeature):
(WebGPU::Device::popErrorScope):
(WebGPU::Device::pushErrorScope):
(WebGPU::Device::setDeviceLostCallback):
(WebGPU::Device::setUncapturedErrorCallback):
(WebGPU::Device::setLabel):
* WebGPU/Instance.mm:
(WebGPU::sortedDevices):
(WebGPU::Instance::requestAdapter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290262 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[webkitcorepy] Support local library in existing path
jbedard@apple.com [Mon, 21 Feb 2022 20:42:43 +0000 (20:42 +0000)]
[webkitcorepy] Support local library in existing path
https://bugs.webkit.org/show_bug.cgi?id=236978
<rdar://problem/89237767>

Reviewed by Dewei Zhu.

* Tools/Scripts/libraries/webkitcorepy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
(AutoInstall.register): Handle case where library is in an exisiting sys.path.

link: https://commits.webkit.org/247586@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290261 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[XCBuild] Use native build phases to copy PAL's headers
emw@apple.com [Mon, 21 Feb 2022 20:11:29 +0000 (20:11 +0000)]
[XCBuild] Use native build phases to copy PAL's headers
https://bugs.webkit.org/show_bug.cgi?id=236683

Reviewed by Alexey Proskuryakov.

Replaces the "Copy PAL Headers" script with a native Headers phase. Xcode copies the headers
to a flattened directory, but we hack around this using build rules. This is a different
approach than we took with WTF <https://bugs.webkit.org/show_bug.cgi?id=235744> but could be
replicated there to remove the one-build-phase-per-directory boilerplate.

The idea is that we have one build rule for each "depth" of headers: Build rule "pal/*.h" is
depth 1 and matches headers like "pal/FileSizeFormatter.h", buld rule "pal/*/*.h" is depth 2
and matches headers like "pal/text/EncodingTables.h", etc.

Each rule uses build setting macros to determine the header's relative path within
/usr/local/include/pal, and copies it there. Having one build rule per depth level is hacky,
but it's superior to adding 23 copy file phases. In the future, we'll simplify this with
<rdar://88771729>.

The legacy build system doesn't support running build rules on headers. To compensate,
legacy builds copy to a separate directory, /usr/local/include/pal_flattened. A script phase
that runs after the native Headers phase copies these flattened headers into the right place.

* Configurations/CopyPALHeaders.xcconfig: Removed.
* Configurations/PAL.xcconfig: Header settings, notably PRIVATE_HEADERS_FOLDER_PATH.
* PAL.xcodeproj/project.pbxproj: Remove target, add phases, set header attrs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290260 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 7: Clean up includes a bit
mmaxfield@apple.com [Mon, 21 Feb 2022 20:03:53 +0000 (20:03 +0000)]
[WebGPU] Tracer bullet part 7: Clean up includes a bit
https://bugs.webkit.org/show_bug.cgi?id=236900

Reviewed by Dean Jackson.

We can put includes that literally every file uses into a single place.

* WebGPU/Adapter.h:
* WebGPU/Adapter.mm:
* WebGPU/BindGroup.h:
* WebGPU/BindGroup.mm:
* WebGPU/BindGroupLayout.h:
* WebGPU/BindGroupLayout.mm:
* WebGPU/Buffer.h:
* WebGPU/Buffer.mm:
* WebGPU/CommandBuffer.h:
* WebGPU/CommandBuffer.mm:
* WebGPU/CommandEncoder.h:
* WebGPU/CommandEncoder.mm:
* WebGPU/ComputePassEncoder.h:
* WebGPU/ComputePassEncoder.mm:
* WebGPU/ComputePipeline.h:
* WebGPU/ComputePipeline.mm:
* WebGPU/Device.h:
* WebGPU/Device.mm:
* WebGPU/Instance.h:
* WebGPU/Instance.mm:
* WebGPU/PipelineLayout.h:
* WebGPU/PipelineLayout.mm:
* WebGPU/QuerySet.h:
* WebGPU/QuerySet.mm:
* WebGPU/Queue.h:
* WebGPU/Queue.mm:
* WebGPU/RenderBundle.h:
* WebGPU/RenderBundle.mm:
* WebGPU/RenderBundleEncoder.h:
* WebGPU/RenderBundleEncoder.mm:
* WebGPU/RenderPassEncoder.h:
* WebGPU/RenderPassEncoder.mm:
* WebGPU/RenderPipeline.h:
* WebGPU/RenderPipeline.mm:
* WebGPU/Sampler.h:
* WebGPU/Sampler.mm:
* WebGPU/ShaderModule.h:
* WebGPU/ShaderModule.mm:
* WebGPU/Surface.h:
* WebGPU/Surface.mm:
* WebGPU/SwapChain.h:
* WebGPU/SwapChain.mm:
* WebGPU/Texture.h:
* WebGPU/Texture.mm:
* WebGPU/TextureView.h:
* WebGPU/TextureView.mm:
* WebGPU/config.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290259 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 6: Give a RunLoop to Instance
mmaxfield@apple.com [Mon, 21 Feb 2022 19:58:46 +0000 (19:58 +0000)]
[WebGPU] Tracer bullet part 6: Give a RunLoop to Instance
https://bugs.webkit.org/show_bug.cgi?id=236899

Reviewed by Dean Jackson.

The shared header has a function, wgpuInstanceProcessEvents(), which is supposed
to synchronously call all outstanding callbacks. A natural way to do this is to
hook this up to [NSRunLoop runMode:beforeDate:].

* WebGPU/Instance.h:
(WebGPU::Instance::runLoop const):
(WebGPU::Instance::create): Deleted.
* WebGPU/Instance.mm:
(WebGPU::Instance::create):
(WebGPU::Instance::Instance):
(WebGPU::Instance::createSurface):
(WebGPU::Instance::processEvents):
(wgpuCreateInstance):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290258 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[CSS Container Queries] Support nested container queries
antti@apple.com [Mon, 21 Feb 2022 19:48:07 +0000 (19:48 +0000)]
[CSS Container Queries] Support nested container queries
https://bugs.webkit.org/show_bug.cgi?id=236963

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-contain/container-queries/container-nested-expected.txt: Added.
* web-platform-tests/css/css-contain/container-queries/container-nested.html: Added.

Source/WebCore:

"Style rules defined on an element inside multiple nested container queries apply when all of the wrapping container queries are true for that element."

https://drafts.csswg.org/css-contain-3/#container-rule

Test: imported/w3c/web-platform-tests/css/css-contain/container-queries/container-nested.html

* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
(WebCore::Style::ElementRuleCollector::containerQueriesMatch):

All nested queries need to match.

(WebCore::Style::ElementRuleCollector::containerQueryMatches): Deleted.
* style/ElementRuleCollector.h:
* style/RuleSet.h:
(WebCore::Style::RuleSet::hasContainerQueries const):
(WebCore::Style:: const):
(WebCore::Style::RuleSet::containerQueryFor const): Deleted.

Return all nested queries.
Don't unnecessarily copy FilteredContainerQuery, refer to the StyleRuleContainer instead.

* style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::addChildRules):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290257 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 5: Give Metal objects to WebGPU objects
mmaxfield@apple.com [Mon, 21 Feb 2022 19:32:30 +0000 (19:32 +0000)]
[WebGPU] Tracer bullet part 5: Give Metal objects to WebGPU objects
https://bugs.webkit.org/show_bug.cgi?id=236898

Reviewed by Dean Jackson.

Each WebGPU object gets its own backing Metal object.

* WebGPU/Adapter.h:
(WebGPU::Adapter::create):
* WebGPU/Adapter.mm:
(WebGPU::Adapter::Adapter):
* WebGPU/BindGroup.h:
(WebGPU::BindGroup::create):
* WebGPU/BindGroup.mm:
(WebGPU::Device::createBindGroup):
(WebGPU::BindGroup::BindGroup):
* WebGPU/BindGroupLayout.h:
(WebGPU::BindGroupLayout::create):
* WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
(WebGPU::BindGroupLayout::BindGroupLayout):
* WebGPU/Buffer.h:
(WebGPU::Buffer::create):
* WebGPU/Buffer.mm:
(WebGPU::Device::createBuffer):
(WebGPU::Buffer::Buffer):
* WebGPU/CommandBuffer.h:
(WebGPU::CommandBuffer::create):
* WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::CommandBuffer):
* WebGPU/CommandEncoder.h:
(WebGPU::CommandEncoder::create):
* WebGPU/CommandEncoder.mm:
(WebGPU::Device::createCommandEncoder):
(WebGPU::CommandEncoder::CommandEncoder):
(WebGPU::CommandEncoder::beginComputePass):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::finish):
* WebGPU/ComputePassEncoder.h:
(WebGPU::ComputePassEncoder::create):
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::ComputePassEncoder):
* WebGPU/ComputePipeline.h:
(WebGPU::ComputePipeline::create):
* WebGPU/ComputePipeline.mm:
(WebGPU::Device::createComputePipeline):
(WebGPU::ComputePipeline::ComputePipeline):
(WebGPU::ComputePipeline::getBindGroupLayout):
* WebGPU/Device.h:
(WebGPU::Device::create): Deleted.
* WebGPU/Device.mm:
(WebGPU::Device::create):
(WebGPU::Device::Device):
(WebGPU::Device::getQueue):
* WebGPU/Instance.h:
* WebGPU/Instance.mm:
(WebGPU::Instance::requestAdapter):
(wgpuInstanceRequestAdapter):
* WebGPU/QuerySet.h:
(WebGPU::QuerySet::create):
* WebGPU/QuerySet.mm:
(WebGPU::Device::createQuerySet):
(WebGPU::QuerySet::QuerySet):
* WebGPU/Queue.h:
(WebGPU::Queue::create):
* WebGPU/Queue.mm:
(WebGPU::Queue::Queue):
* WebGPU/RenderBundle.h:
(WebGPU::RenderBundle::create):
* WebGPU/RenderBundle.mm:
(WebGPU::RenderBundle::RenderBundle):
* WebGPU/RenderBundleEncoder.h:
(WebGPU::RenderBundleEncoder::create):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::Device::createRenderBundleEncoder):
(WebGPU::RenderBundleEncoder::RenderBundleEncoder):
(WebGPU::RenderBundleEncoder::finish):
* WebGPU/RenderPassEncoder.h:
(WebGPU::RenderPassEncoder::create):
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
* WebGPU/RenderPipeline.h:
(WebGPU::RenderPipeline::create):
* WebGPU/RenderPipeline.mm:
(WebGPU::Device::createRenderPipeline):
(WebGPU::RenderPipeline::RenderPipeline):
(WebGPU::RenderPipeline::getBindGroupLayout):
* WebGPU/Sampler.h:
(WebGPU::Sampler::create):
* WebGPU/Sampler.mm:
(WebGPU::Device::createSampler):
(WebGPU::Sampler::Sampler):
* WebGPU/ShaderModule.h:
(WebGPU::ShaderModule::create):
* WebGPU/ShaderModule.mm:
(WebGPU::Device::createShaderModule):
(WebGPU::ShaderModule::ShaderModule):
* WebGPU/SwapChain.mm:
(WebGPU::SwapChain::getCurrentTextureView):
* WebGPU/Texture.h:
(WebGPU::Texture::create):
* WebGPU/Texture.mm:
(WebGPU::Device::createTexture):
(WebGPU::Texture::Texture):
(WebGPU::Texture::createView):
* WebGPU/TextureView.h:
(WebGPU::TextureView::create):
* WebGPU/TextureView.mm:
(WebGPU::TextureView::TextureView):
* WebGPU/config.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290256 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 4: Move Device's construction methods to the files of...
mmaxfield@apple.com [Mon, 21 Feb 2022 19:23:34 +0000 (19:23 +0000)]
[WebGPU] Tracer bullet part 4: Move Device's construction methods to the files of the things they create
https://bugs.webkit.org/show_bug.cgi?id=236891

Reviewed by Dean Jackson.

Device is kind of a factory object, and has lots of methods which create
other objects in the API. To avoid Device.cpp becoming a catch-all place
for tons of unrelated creation routines, this patch moves the routine that
creates an X into X.mm.

* WebGPU/BindGroup.mm:
(WebGPU::Device::createBindGroup):
* WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
* WebGPU/Buffer.mm:
(WebGPU::Device::createBuffer):
* WebGPU/CommandEncoder.mm:
(WebGPU::Device::createCommandEncoder):
* WebGPU/ComputePipeline.mm:
(WebGPU::Device::createComputePipeline):
(WebGPU::Device::createComputePipelineAsync):
* WebGPU/Device.mm:
(WebGPU::Device::createBindGroup): Deleted.
(WebGPU::Device::createBindGroupLayout): Deleted.
(WebGPU::Device::createBuffer): Deleted.
(WebGPU::Device::createCommandEncoder): Deleted.
(WebGPU::Device::createComputePipeline): Deleted.
(WebGPU::Device::createComputePipelineAsync): Deleted.
(WebGPU::Device::createPipelineLayout): Deleted.
(WebGPU::Device::createQuerySet): Deleted.
(WebGPU::Device::createRenderBundleEncoder): Deleted.
(WebGPU::Device::createRenderPipeline): Deleted.
(WebGPU::Device::createRenderPipelineAsync): Deleted.
(WebGPU::Device::createSampler): Deleted.
(WebGPU::Device::createShaderModule): Deleted.
(WebGPU::Device::createSwapChain): Deleted.
(WebGPU::Device::createTexture): Deleted.
* WebGPU/PipelineLayout.mm:
(WebGPU::Device::createPipelineLayout):
* WebGPU/QuerySet.mm:
(WebGPU::Device::createQuerySet):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::Device::createRenderBundleEncoder):
* WebGPU/RenderPipeline.mm:
(WebGPU::Device::createRenderPipeline):
(WebGPU::Device::createRenderPipelineAsync):
* WebGPU/Sampler.mm:
(WebGPU::Device::createSampler):
* WebGPU/ShaderModule.mm:
(WebGPU::Device::createShaderModule):
* WebGPU/SwapChain.mm:
(WebGPU::Device::createSwapChain):
* WebGPU/Texture.mm:
(WebGPU::Device::createTexture):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290255 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[LBSE] Implement SVG2 rules to establish a stacking context
zimmermann@webkit.org [Mon, 21 Feb 2022 19:15:35 +0000 (19:15 +0000)]
[LBSE] Implement SVG2 rules to establish a stacking context
https://bugs.webkit.org/show_bug.cgi?id=236193

Reviewed by Rob Buis.

Follow the rules specified in https://www.w3.org/TR/SVG2/render.html#RenderingOrder,
when to create a stacking context. This is necessary to enforce layer creation.

Unlike SVG 1.1, SVG2 defines its whole rendering model, as well as painting operations
such as masking/clipping around the 'stacking-context' term that stems from CSS.
The definition is backwards compatible with SVG 1.1, except for un-spec'ed territory
missing from SVG 1.1, that's now specified for SVG2 (e.g. <foreignObject> + stacking context).

LBSE handles clipping / masking / etc. via RenderLayer, which is also responsbile for
for stacking-context managment. Therefore we need to follow the existing rules to enforce
a stacking context / RenderLayer creation in StyleAdjuster, by enforcing a non-auto 'used z-index'.

Covered by existing tests, no change in behaviour.

* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustSVGElementStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 3: Tweak WGSL API
mmaxfield@apple.com [Mon, 21 Feb 2022 18:57:52 +0000 (18:57 +0000)]
[WebGPU] Tracer bullet part 3: Tweak WGSL API
https://bugs.webkit.org/show_bug.cgi?id=236889

Reviewed by Dean Jackson.

- Give SuccessfulCheck a move constructor
- Use UniqueRef instead of std::unique_ptr
- Allow specialization constants to be looked up by name
- Model missing pipeline layouts as absent from the HashMap, rather than using an optional type

* WGSL/WGSL.cpp:
(WGSL::prepare):
(WGSL::SuccessfulCheck::~SuccessfulCheck): Deleted.
* WGSL/WGSL.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] Tracer bullet part 2: Fix infinite recursion in GPUDevice::ref()
mmaxfield@apple.com [Mon, 21 Feb 2022 18:55:08 +0000 (18:55 +0000)]
[WebGPU] Tracer bullet part 2: Fix infinite recursion in GPUDevice::ref()
https://bugs.webkit.org/show_bug.cgi?id=236888

Reviewed by Dean Jackson.

refEventTarget() calls ref() which called refEventTarget(). The solution is
to tell GPUDevice that it's using RefCounted::ref().

* Modules/WebGPU/GPUDevice.cpp:
* Modules/WebGPU/GPUDevice.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290252 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WebGPU] WebGPU.xcodeproj cannot be opened on Big Sur's Xcode
mmaxfield@apple.com [Mon, 21 Feb 2022 18:23:38 +0000 (18:23 +0000)]
[WebGPU] WebGPU.xcodeproj cannot be opened on Big Sur's Xcode
https://bugs.webkit.org/show_bug.cgi?id=236982

Unreviewed.

Just change the project version number from 55 to 51, like the rest of the projects in WebKit.

* WebGPU.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290251 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[macOS] Remove resource access in sandbox for older OS versions
pvollan@apple.com [Mon, 21 Feb 2022 18:10:40 +0000 (18:10 +0000)]
[macOS] Remove resource access in sandbox for older OS versions
https://bugs.webkit.org/show_bug.cgi?id=236975

Reviewed by Brent Fulgham.

Remove access to some resources in sandbox for older OS versions. Access to these resources were initially
added in https://trac.webkit.org/changeset/290180/webkit and https://trac.webkit.org/changeset/290066/webkit,
and was only intended to land on a branch.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoNull check parent node in outdentParagraph
commit-queue@webkit.org [Mon, 21 Feb 2022 18:07:18 +0000 (18:07 +0000)]
Null check parent node in outdentParagraph
https://bugs.webkit.org/show_bug.cgi?id=235914

Patch by Rob Buis <rbuis@igalia.com> on 2022-02-21
Reviewed by Wenson Hsieh.

Source/WebCore:

Null check parent node of enclosing node in outdentParagraph.

Test: editing/execCommand/outdent-paragraph-crash.html

* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentParagraph):

LayoutTests:

* editing/execCommand/outdent-paragraph-crash-expected.txt: Added.
* editing/execCommand/outdent-paragraph-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290249 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Add CalendarDateTime parsing
ysuzuki@apple.com [Mon, 21 Feb 2022 17:56:12 +0000 (17:56 +0000)]
[JSC] Add CalendarDateTime parsing
https://bugs.webkit.org/show_bug.cgi?id=236886

Reviewed by Dean Jackson.

JSTests:

* stress/temporal-instant.js:
* stress/temporal-plaindate.js:
* stress/temporal-plaintime.js:

Source/JavaScriptCore:

This patch adds calendar parsing code to ISO8601 so that Temporal.Instant / Temporal.PlainDate / Temporal.PlainTime
can parse string with calendar correctly via "from" methods. Currently, we are just ignoring these calendar values,
but we should create a calendar instance from that in a subsequent patch.

* runtime/ISO8601.cpp:
(JSC::ISO8601::canBeCalendar):
(JSC::ISO8601::canBeTimeZone):
(JSC::ISO8601::parseTimeZone):
(JSC::ISO8601::parseCalendar):
(JSC::ISO8601::parseTime):
(JSC::ISO8601::parseDateTime):
(JSC::ISO8601::parseCalendarTime):
(JSC::ISO8601::parseCalendarDateTime):
(JSC::ISO8601::parseInstant):
* runtime/ISO8601.h:
* runtime/TemporalPlainDate.cpp:
(JSC::TemporalPlainDate::from):
* runtime/TemporalPlainTime.cpp:
(JSC::TemporalPlainTime::from):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290248 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoPerformanceObserver: buffered flag not working in Paint Timing
noam@webkit.org [Mon, 21 Feb 2022 17:50:40 +0000 (17:50 +0000)]
PerformanceObserver: buffered flag not working in Paint Timing
https://bugs.webkit.org/show_bug.cgi?id=225305
<rdar://problem/77746237>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/paint-timing/fcp-only/buffered-flag.window-expected.txt: This test now passes

Source/WebCore:

Include paint entries when collecting buffered performance entries.

A previously failing W3C test is now marked as passing.

* page/Performance.cpp:
(WebCore::Performance::appendBufferedEntriesByType const): Add the existing FCP entry

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290247 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoChange IPC encoding of boolean type to use one bit
commit-queue@webkit.org [Mon, 21 Feb 2022 17:07:45 +0000 (17:07 +0000)]
Change IPC encoding of boolean type to use one bit
https://bugs.webkit.org/show_bug.cgi?id=236801
rdar://85811396

Patch by Simon Lewis <simon.lewis@apple.com> on 2022-02-21
Reviewed by Chris Dumez.

This patch ensures that only the lower bit is set in a boolean for IPC messages.

* Platform/IPC/ArgumentCoder.h:
(IPC::ArgumentCoder<bool>::encode):
(IPC::ArgumentCoder<bool>::decode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290246 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoAX: Add test for r290130 (https://trac.webkit.org/changeset/290130/webkit)
tyler_w@apple.com [Mon, 21 Feb 2022 15:46:11 +0000 (15:46 +0000)]
AX: Add test for r290130 (https://trac.webkit.org/changeset/290130/webkit)
https://bugs.webkit.org/show_bug.cgi?id=236848

Reviewed by Chris Fleizach.

* accessibility/dynamically-changing-iframe-remains-accessible-expected.txt: Added.
* accessibility/dynamically-changing-iframe-remains-accessible.html: Added.
* accessibility/resources/purple-pineapple-text.html:
Added so we can switch iframe source between multiple simple documents.
* platform/ios/TestExpectations:
Enable new test.
* platform/mac-wk1/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt: Added.
* resources/accessibility-helper.js:
(sleep): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290245 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[run-webkit-tests] Use Python 3 (Part 1)
jbedard@apple.com [Mon, 21 Feb 2022 15:24:30 +0000 (15:24 +0000)]
[run-webkit-tests] Use Python 3 (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=226658
<rdar://problem/78882016>

Reviewed by Dewei Zhu and Stephanie Lewis.

* Tools/CISupport/build-webkit-org/steps.py:
(RunWebKitTests): Change invocation to Python 3.
* Tools/CISupport/build-webkit-org/steps_unittest.py:

link: https://commits.webkit.org/247569@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290244 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[EWS] Enable GTK and Windows queues for PRs
jbedard@apple.com [Mon, 21 Feb 2022 15:19:23 +0000 (15:19 +0000)]
[EWS] Enable GTK and Windows queues for PRs
https://bugs.webkit.org/show_bug.cgi?id=236814
<rdar://problem/89117205>

Reviewed by Ryan Haddad.

* Tools/CISupport/ews-build/config.json:

link: https://commits.webkit.org/247568@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290243 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[Flatpak SDK] Update pango and gtk4
commit-queue@webkit.org [Mon, 21 Feb 2022 15:13:17 +0000 (15:13 +0000)]
[Flatpak SDK] Update pango and gtk4
https://bugs.webkit.org/show_bug.cgi?id=236939

Patch by Philippe Normand <pnormand@igalia.com> on 2022-02-21
Reviewed by Adrian Perez de Castro.

Update to GTK 4.6.2, which requires Pango 1.50.x, so also update Pango.

* elements/freedesktop-sdk.bst:
* elements/sdk/gtk.bst:
* patches/fdo-0001-pango-Bump-to-1.50.4.patch: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290242 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[GTK][WPE] ANGLE: make USE_ANGLE_WEBGL build option public
commit-queue@webkit.org [Mon, 21 Feb 2022 14:31:27 +0000 (14:31 +0000)]
[GTK][WPE] ANGLE: make USE_ANGLE_WEBGL build option public
https://bugs.webkit.org/show_bug.cgi?id=236962

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2022-02-21
Reviewed by Chris Lord.

Since it introduces new dependencies, the build option should be public and a fatal error message should be
shown when the option is enabled and any for the dependencies is missing.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290241 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[IFC][Integration] Take vertical-rl writing mode value into account when converting...
zalan@apple.com [Mon, 21 Feb 2022 14:12:43 +0000 (14:12 +0000)]
[IFC][Integration] Take vertical-rl writing mode value into account when converting visual margin/border/padding value to logical
https://bugs.webkit.org/show_bug.cgi?id=236948

Reviewed by Antti Koivisto.

This is in preparation for supporting vertical-rl content.
(Note that the RTL inline direction != the "rl" part of the writing mode.)

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::horizontalLogicalMargin):
(WebCore::LayoutIntegration::verticalLogicalMargin):
(WebCore::LayoutIntegration::logicalBorder):
(WebCore::LayoutIntegration::logicalPadding):
(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
(WebCore::LayoutIntegration::LineLayout::updateInlineBoxDimensions):
(WebCore::LayoutIntegration::LineLayout::updateFormattingRootGeometryAndInvalidate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290240 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoFetching website data may get wrong record after migrating data to general storage...
sihui_liu@apple.com [Mon, 21 Feb 2022 09:23:39 +0000 (09:23 +0000)]
Fetching website data may get wrong record after migrating data to general storage directory
https://bugs.webkit.org/show_bug.cgi?id=236905

Reviewed by Chris Dumez.

Source/WebKit:

To decide if an origin has data, we need to not only check if its directory exists but also if the directory is
empty.

Modified existing test to add test coverage.

* NetworkProcess/storage/OriginStorageManager.cpp:
(WebKit::OriginStorageManager::StorageBucket::resolvedLocalStoragePath):
(WebKit::OriginStorageManager::StorageBucket::resolvedIDBStoragePath): directory should be created before moving
files.
(WebKit::OriginStorageManager::StorageBucket::fetchDataTypesInListFromDisk): given that IndexedDB and
LocalStorage can have custom paths, we may just check data by type.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290239 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed, non-unified build fixes after 247508@main
lmoura@igalia.com [Mon, 21 Feb 2022 03:55:04 +0000 (03:55 +0000)]
Unreviewed, non-unified build fixes after 247508@main
https://bugs.webkit.org/show_bug.cgi?id=236945

* dom/ImageOverlay.h: Forward declare document.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290238 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoTurn WebGL in GPU Process on by default
jonlee@apple.com [Mon, 21 Feb 2022 00:02:38 +0000 (00:02 +0000)]
Turn WebGL in GPU Process on by default
https://bugs.webkit.org/show_bug.cgi?id=236382
rdar://58057431

Reviewed by Tim Horton.

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultUseGPUProcessForWebGLEnabled):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290237 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed gardening for GPU Process bots
jonlee@apple.com [Sun, 20 Feb 2022 23:58:54 +0000 (23:58 +0000)]
Unreviewed gardening for GPU Process bots

* gpu-process/TestExpectations:
* platform/ios-wk2/TestExpectations: Newly revealed flaky timeout.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290236 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed gardening.
jonlee@apple.com [Sun, 20 Feb 2022 23:50:56 +0000 (23:50 +0000)]
Unreviewed gardening.

* TestExpectations: Tests are passing after r290229.
* gpu-process/TestExpectations:
* platform/ios-simulator/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290235 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed garden for GPU Process bots.
jonlee@apple.com [Sun, 20 Feb 2022 23:36:52 +0000 (23:36 +0000)]
Unreviewed garden for GPU Process bots.

* gpu-process/TestExpectations: Annotate tests with filed bugs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290234 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoOrigin file may not be created after migrating data to general storage directory
sihui_liu@apple.com [Sun, 20 Feb 2022 23:09:55 +0000 (23:09 +0000)]
Origin file may not be created after migrating data to general storage directory
https://bugs.webkit.org/show_bug.cgi?id=236901

Reviewed by Chris Dumez.

Source/WebKit:

In r289081, we started writing origin file asynchronouly (we used to write it at creation of
OriginStorageManager), to avoid delay in replying sync WebStorage message. In the async task, we check if the
OriginStorageManager still exists. If it does not, we will not write origin file, because the
OriginStorageManager may be removed after origin data gets deleted, and there's no need to add new origin file.
It's also possible that the OriginStorageManager is created for website data fetch, and removed immediately
after the fetch task is done (see NetworkStorageManager::fetchDataFromDisk). We used to not store
new data in general storage directory during data fetch, so it's fine to not write origin file in this case.

With r289878, existing data can be migrated to general storage directory at data fetch, so it is important to
ensure we write origin to file; otherwise, we will lose track of the origin. To solve this, let's restore the
old behavior that synchronouly writes origin file at creation of OriginStorageManager. To solve the delay issue,
in the sync message handler (NetworkStorageManager::connectToStorageArea), we specifically ask to not write
origin file, and manually write origin file after message is replied.

Updated existing API test to add test coverage.

* NetworkProcess/storage/NetworkStorageManager.cpp:
(WebKit::NetworkStorageManager::localOriginStorageManager):
(WebKit::NetworkStorageManager::connectToStorageArea):
* NetworkProcess/storage/NetworkStorageManager.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290233 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoRebaseline inert-focus-in-frames.html after r290197.
ntim@apple.com [Sun, 20 Feb 2022 20:47:12 +0000 (20:47 +0000)]
Rebaseline inert-focus-in-frames.html after r290197.

Unreviewed test gardening.

For some reason, the rebaselining changes didn't make it in the patch.

* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-focus-in-frames-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290232 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[LFC][IFC] Flip inline block coords for vertical-rl before painting
zalan@apple.com [Sun, 20 Feb 2022 18:32:51 +0000 (18:32 +0000)]
[LFC][IFC] Flip inline block coords for vertical-rl before painting
https://bugs.webkit.org/show_bug.cgi?id=236896

Reviewed by Antti Koivisto.

This is similar to what we do in LegacyInlineElementBox::paint.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::paint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290231 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoVersioning.
kocsen_chung@apple.com [Sun, 20 Feb 2022 17:54:10 +0000 (17:54 +0000)]
Versioning.

WebKit-7614.1.6

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290230 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[IFC][Integration] Enable non-paginated vertical-lr writing mode
zalan@apple.com [Sun, 20 Feb 2022 17:53:37 +0000 (17:53 +0000)]
[IFC][Integration] Enable non-paginated vertical-lr writing mode
https://bugs.webkit.org/show_bug.cgi?id=236481
<rdar://problem/89123721>

Reviewed by Antti Koivisto.
LayoutTests/imported/w3c:

Progressions.

* web-platform-tests/css/cssom-view/offsetTopLeft-empty-inline-expected.txt:
* web-platform-tests/css/cssom-view/offsetTopLeft-leading-space-inline-expected.txt:

Source/WebCore:

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForStyle):
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
* layout/integration/LayoutIntegrationCoverage.h:

LayoutTests:

Progression:
* css3/flexbox/line-wrapping.html:

Legacy layout bounds floor/ceil mismatch:
* fast/block/float/float-with-fractional-height-vertical-lr.html:
* imported/blink/fast/multicol/vertical-lr/float-big-line-expected.html:
* imported/blink/fast/multicol/vertical-lr/float-big-line.html:

Progression (visually matching Chrome)
* platform/mac/fast/writing-mode/border-image-vertical-lr-expected.txt:
* platform/mac/fast/writing-mode/border-radius-clipping-vertical-lr-expected.txt:
* platform/mac/fast/writing-mode/border-styles-vertical-lr-expected.txt:
* platform/mac/fast/writing-mode/border-styles-vertical-lr-mixed-expected.txt:
* platform/mac/fast/writing-mode/box-shadow-vertical-lr-expected.txt:
* platform/mac/fast/writing-mode/text-orientation-basic-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290229 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoGenerate compile_commands.json on macOS Builds
commit-queue@webkit.org [Sun, 20 Feb 2022 16:01:42 +0000 (16:01 +0000)]
Generate compile_commands.json on macOS Builds
https://bugs.webkit.org/show_bug.cgi?id=235686

Patch by Brandon Stewart <brandonstewart@apple.com> on 2022-02-20
Reviewed by Saam Barati.

Add support for generating compile_commands.json file to WebKit.

compile_commands.json can be used by tools like clangd to provide code complete,
refactoring, formatting, and cross references.

Steps to generate the compile commands file:
make d EXPORT_COMPILE_COMMANDS=YES
generate-compile-commands WebKitBuild/Debug

.:

* Makefile.shared:

Source/WebKit:

* UIProcess/API/C/WKPageUIClient.h:

Tools:

* Scripts/build-jsc:
* Scripts/build-webkit:
* Scripts/generate-compile-commands: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290227 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[EWS] Enable iOS Simulator queues for PRs
jbedard@apple.com [Sun, 20 Feb 2022 15:45:26 +0000 (15:45 +0000)]
[EWS] Enable iOS Simulator queues for PRs
https://bugs.webkit.org/show_bug.cgi?id=236816
<rdar://problem/89117393>

Reviewed by Ryan Haddad.

* Tools/CISupport/ews-build/config.json:

link: https://commits.webkit.org/247552@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290226 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoRenderBox::flipForWritingModeForChild should take const RenderBox& as the child renderer
zalan@apple.com [Sun, 20 Feb 2022 14:17:30 +0000 (14:17 +0000)]
RenderBox::flipForWritingModeForChild should take const RenderBox& as the child renderer
https://bugs.webkit.org/show_bug.cgi?id=236895

Reviewed by Antti Koivisto.

* rendering/LegacyInlineElementBox.cpp:
(WebCore::LegacyInlineElementBox::paint):
(WebCore::LegacyInlineElementBox::nodeAtPoint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintChild):
(WebCore::RenderBlock::hitTestContents):
(WebCore::RenderBlock::paintExcludedChildrenInBorder):
(WebCore::RenderBlock::hitTestExcludedChildrenInBorder):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::paintColumnRules):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::flipForWritingModeForChild const):
(WebCore::RenderBox::topLeftLocation const):
* rendering/RenderBox.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::hitTestChildren):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paintObject):
(WebCore::RenderTable::nodeAtPoint):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::nodeAtPoint):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintCell):
(WebCore::RenderTableSection::paintObject):
(WebCore::RenderTableSection::nodeAtPoint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290225 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoREGRESSION(r289470): [Flatpak SDK] Broken local SDK handling
commit-queue@webkit.org [Sun, 20 Feb 2022 13:14:51 +0000 (13:14 +0000)]
REGRESSION(r289470): [Flatpak SDK] Broken local SDK handling
https://bugs.webkit.org/show_bug.cgi?id=236940

Patch by Philippe Normand <pnormand@igalia.com> on 2022-02-20
Reviewed by Martin Robinson.

The .Local path was incorrectly generated to WebKitBuild/UserFlatpak/.Local.

* flatpak/flatpakutils.py:
(WebkitFlatpak.clean_args): Revert .Local SDK path handling to the version before r289470.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290224 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoOptimize DOM storage event dispatch
cdumez@apple.com [Sun, 20 Feb 2022 07:12:29 +0000 (07:12 +0000)]
Optimize DOM storage event dispatch
https://bugs.webkit.org/show_bug.cgi?id=236871

Reviewed by Sihui Liu.

Made the following optimization to DOM storage event dispatch:
1. Pass a SecurityOrigin around instead of a SecurityOriginData. Otherwise,
   dispatchLocalStorageEvents() / dispatchSessionStorageEvents() just keep
   reconstructing the SecurityOrigin from the SecurityOriginData for every
   frame.
2. When gathering the list of frames where we need to dispatch the storage
   event, discard the ones that do not have a "storage" event listener.

Source/WebCore:

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::storageId):
(WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/agents/InspectorDOMStorageAgent.h:
* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* storage/StorageEventDispatcher.h:
* storage/StorageNamespace.h:
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):

Source/WebKit:

* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::framesForEventDispatching):
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebStorage/StorageAreaMap.h:
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::storageArea):
* WebProcess/WebStorage/StorageNamespaceImpl.h:

Source/WebKitLegacy:

* Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::StorageAreaImpl):
(WebKit::StorageAreaImpl::create):
(WebKit::StorageAreaImpl::clearForOriginDeletion):
(WebKit::StorageAreaImpl::sync):
(WebKit::StorageAreaImpl::sessionChanged):
* Storage/StorageAreaImpl.h:
* Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::storageArea):
* Storage/StorageNamespaceImpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290223 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed gardening for GPU Process bots.
jonlee@apple.com [Sun, 20 Feb 2022 05:15:56 +0000 (05:15 +0000)]
Unreviewed gardening for GPU Process bots.

* gpu-process/TestExpectations:
* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290222 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed gardening. Relating tests failing due to turning accel drawing on to b236904.
jonlee@apple.com [Sun, 20 Feb 2022 05:13:52 +0000 (05:13 +0000)]
Unreviewed gardening. Relating tests failing due to turning accel drawing on to b236904.
* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290221 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoTest gardening for [CSS Blending] Non-separable blend modes don't work
jonlee@apple.com [Sun, 20 Feb 2022 04:35:37 +0000 (04:35 +0000)]
Test gardening for [CSS Blending] Non-separable blend modes don't work
https://bugs.webkit.org/show_bug.cgi?id=131354

LayoutTests/imported/mozilla:

Unreviewed. Add fuzzy data.
* svg/blend-color.svg:
* svg/blend-hue.svg:
* svg/blend-luminosity.svg:

LayoutTests:

Unreviewed.
* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290220 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agomacCatalyst: WKWebView crashes whenever the view frame changes
timothy_horton@apple.com [Sun, 20 Feb 2022 01:42:23 +0000 (01:42 +0000)]
macCatalyst: WKWebView crashes whenever the view frame changes
https://bugs.webkit.org/show_bug.cgi?id=236887
<rdar://problem/89182039>

Reviewed by Chris Dumez.

* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _acquireResizeAssertionForReason:]):
Add a respondsToSelector check.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290219 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoSet custom general storage directory for custom WebsiteDataStore in TestController
sihui_liu@apple.com [Sun, 20 Feb 2022 01:34:27 +0000 (01:34 +0000)]
Set custom general storage directory for custom WebsiteDataStore in TestController
https://bugs.webkit.org/show_bug.cgi?id=236893

Reviewed by Chris Dumez.

If we don't set custom generalStorageDirectory for a custom WebsiteDataStore, it will use the same path as the
default WebsiteDataStore. That means when WebKitTestRunner creates multiple WebsiteDataStores (it may create
mutliple TestControllers to run tests in parallel), the directory will be accessed concurrently and data can be
corrupted.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::configureWebsiteDataStoreTemporaryDirectories):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290218 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[Re-landing] Provide a WebCore subspaceImplFor template to make code more readable.
mark.lam@apple.com [Sat, 19 Feb 2022 23:05:53 +0000 (23:05 +0000)]
[Re-landing] Provide a WebCore subspaceImplFor template to make code more readable.
https://bugs.webkit.org/show_bug.cgi?id=236868
rdar://problem/89170090

Reviewed by Yusuke Suzuki.

The pre-existing code is difficult to follow, especially in CodeGeneratorJS.pm.
This change also consolidates the framework implementation of subspaceForImpl in
one place rather than scattered across 3 locations.  This will make it easier to
change this code in the future.

Also introduced ExtendedDOMIsoSubspace and ExtendedDOMClientIsoSubspaces classes
and moved the FileSystemDirectoryHandleIterator subspaces in there.  This makes
the code behave more consistently for FileSystemDirectoryHandleIterator's
IsoSubspace as for other IsoSubspaces.

Also rebased bindings test results.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ExtendedDOMClientIsoSubspaces.h: Added.
* bindings/js/ExtendedDOMIsoSubspaces.h: Added.
* bindings/js/JSFileSystemDirectoryHandleIterator.cpp:
(WebCore::JSFileSystemDirectoryHandleIterator::subspaceForImpl):
* bindings/js/WebCoreJSClientData.cpp:
(WebCore::JSHeapData::JSHeapData):
(WebCore::JSVMClientData::JSVMClientData):
* bindings/js/WebCoreJSClientData.h:
(WebCore::JSHeapData::subspaces):
(WebCore::JSVMClientData::idbSerializationSpace):
(WebCore::JSVMClientData::clientSubspaces):
(WebCore::subspaceForImpl):
(WebCore::JSHeapData::fileSystemDirectoryHandleIteratorSpace): Deleted.
(WebCore::JSHeapData::setFileSystemDirectoryHandleIteratorSpace): Deleted.
(WebCore::JSVMClientData::fileSystemDirectoryHandleIteratorSpace): Deleted.
(WebCore::JSVMClientData::setFileSystemDirectoryHandleIteratorSpace): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateIterableDefinition):
* bindings/scripts/test/JS/JSDOMWindow.cpp:
(WebCore::JSDOMWindow::subspaceForImpl):
* bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp:
(WebCore::JSDedicatedWorkerGlobalScope::subspaceForImpl):
* bindings/scripts/test/JS/JSExposedStar.cpp:
(WebCore::JSExposedStar::subspaceForImpl):
* bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp:
(WebCore::JSExposedToWorkerAndWindow::subspaceForImpl):
* bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp:
(WebCore::JSPaintWorkletGlobalScope::subspaceForImpl):
* bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp:
(WebCore::JSServiceWorkerGlobalScope::subspaceForImpl):
* bindings/scripts/test/JS/JSShadowRealmGlobalScope.cpp:
(WebCore::JSShadowRealmGlobalScope::subspaceForImpl):
* bindings/scripts/test/JS/JSSharedWorkerGlobalScope.cpp:
(WebCore::JSSharedWorkerGlobalScope::subspaceForImpl):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactions::subspaceForImpl):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::JSTestCallTracer::subspaceForImpl):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructor::subspaceForImpl):
* bindings/scripts/test/JS/JSTestConditionalIncludes.cpp:
(WebCore::JSTestConditionalIncludes::subspaceForImpl):
* bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:
(WebCore::JSTestConditionallyReadWrite::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDefaultToJSON.cpp:
(WebCore::JSTestDefaultToJSON::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp:
(WebCore::JSTestDefaultToJSONFilteredByExposed::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDefaultToJSONIndirectInheritance.cpp:
(WebCore::JSTestDefaultToJSONIndirectInheritance::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp:
(WebCore::JSTestDefaultToJSONInherit::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp:
(WebCore::JSTestDefaultToJSONInheritFinal::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp:
(WebCore::JSTestDelegateToSharedSyntheticAttribute::subspaceForImpl):
* bindings/scripts/test/JS/JSTestDomainSecurity.cpp:
(WebCore::JSTestDomainSecurity::subspaceForImpl):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySetting::subspaceForImpl):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
(WebCore::JSTestEnabledForContext::subspaceForImpl):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructor::subspaceForImpl):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::subspaceForImpl):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestException::subspaceForImpl):
* bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.cpp:
(WebCore::JSTestGenerateAddOpaqueRoot::subspaceForImpl):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachable::subspaceForImpl):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::subspaceForImpl):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestIndexedSetterNoIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::JSTestIndexedSetterThrowingException::subspaceForImpl):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestIndexedSetterWithIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfacePrototypeFunction_entriesCaller):
(WebCore::JSTestInterface::subspaceForImpl):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscore::subspaceForImpl):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::jsTestIterablePrototypeFunction_entriesCaller):
(WebCore::JSTestIterable::subspaceForImpl):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructor::subspaceForImpl):
* bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp:
(WebCore::JSTestLegacyFactoryFunction::subspaceForImpl):
* bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp:
(WebCore::JSTestLegacyNoInterfaceObject::subspaceForImpl):
* bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp:
(WebCore::JSTestLegacyOverrideBuiltIns::subspaceForImpl):
* bindings/scripts/test/JS/JSTestMapLike.cpp:
(WebCore::JSTestMapLike::subspaceForImpl):
* bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp:
(WebCore::JSTestMapLikeWithOverriddenOperations::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterNoIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::JSTestNamedAndIndexedSetterThrowingException::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterWithIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::JSTestNamedDeleterNoIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::JSTestNamedDeleterThrowingException::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::JSTestNamedDeleterWithIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::JSTestNamedDeleterWithIndexedGetter::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::JSTestNamedGetterCallWith::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::JSTestNamedGetterNoIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::JSTestNamedGetterWithIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedSetterNoIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::JSTestNamedSetterThrowingException::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedSetterWithIdentifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetter::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp:
(WebCore::JSTestNamedSetterWithLegacyOverrideBuiltIns::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp:
(WebCore::JSTestNamedSetterWithLegacyUnforgeableProperties::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp:
(WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNamespaceObject.cpp:
(WebCore::JSTestNamespaceObject::subspaceForImpl):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodePrototypeFunction_entriesCaller):
(WebCore::JSTestNode::subspaceForImpl):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::subspaceForImpl):
* bindings/scripts/test/JS/JSTestOperationConditional.cpp:
(WebCore::JSTestOperationConditional::subspaceForImpl):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructors::subspaceForImpl):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequence::subspaceForImpl):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterface::subspaceForImpl):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::JSTestPromiseRejectionEvent::subspaceForImpl):
* bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp:
(WebCore::JSTestReadOnlyMapLike::subspaceForImpl):
* bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp:
(WebCore::JSTestReadOnlySetLike::subspaceForImpl):
* bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp:
(WebCore::JSTestReportExtraMemoryCost::subspaceForImpl):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::subspaceForImpl):
* bindings/scripts/test/JS/JSTestSetLike.cpp:
(WebCore::JSTestSetLike::subspaceForImpl):
* bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp:
(WebCore::JSTestSetLikeWithOverriddenOperations::subspaceForImpl):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::JSTestStringifier::subspaceForImpl):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::JSTestStringifierAnonymousOperation::subspaceForImpl):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::JSTestStringifierNamedOperation::subspaceForImpl):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::JSTestStringifierOperationImplementedAs::subspaceForImpl):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::JSTestStringifierOperationNamedToString::subspaceForImpl):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::JSTestStringifierReadOnlyAttribute::subspaceForImpl):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::JSTestStringifierReadWriteAttribute::subspaceForImpl):
* bindings/scripts/test/JS/JSTestTaggedWrapper.cpp:
(WebCore::JSTestTaggedWrapper::subspaceForImpl):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefs::subspaceForImpl):
* bindings/scripts/test/JS/JSWorkerGlobalScope.cpp:
(WebCore::JSWorkerGlobalScope::subspaceForImpl):
* bindings/scripts/test/JS/JSWorkletGlobalScope.cpp:
(WebCore::JSWorkletGlobalScope::subspaceForImpl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290217 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed, reverting r290196.
cdumez@apple.com [Sat, 19 Feb 2022 21:42:51 +0000 (21:42 +0000)]
Unreviewed, reverting r290196.

Caused Network Process crashes <rdar://89190571>

Reverted changeset:

"Add assertion that no two network sessions share the same
storage path"
https://bugs.webkit.org/show_bug.cgi?id=236844
https://commits.webkit.org/r290196

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed, reverting r290194 and r290210.
commit-queue@webkit.org [Sat, 19 Feb 2022 21:16:01 +0000 (21:16 +0000)]
Unreviewed, reverting r290194 and r290210.
https://bugs.webkit.org/show_bug.cgi?id=236890

debug crash

Reverted changesets:

"[JSC] Make ArrayPrototype just an array"
https://bugs.webkit.org/show_bug.cgi?id=236869
https://commits.webkit.org/r290194

"Unreviewed, use ArrayWithUndecided in ArrayPrototype"
https://bugs.webkit.org/show_bug.cgi?id=236869
https://commits.webkit.org/r290210

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed, fix the internal iOS build after r290154
wenson_hsieh@apple.com [Sat, 19 Feb 2022 21:02:42 +0000 (21:02 +0000)]
Unreviewed, fix the internal iOS build after r290154

`-[ASCAgentProtocol performAutoFillAuthorizationRequestsForContext:]` only exists on macOS and Catalyst; as
such, this call site needs to be guarded for those platforms.

* UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:
(WebKit::WebAuthenticatorCoordinatorProxy::performRequest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[macOS] Hovering over "Copy Cropped Image" context menu item should reveal the croppe...
wenson_hsieh@apple.com [Sat, 19 Feb 2022 19:24:02 +0000 (19:24 +0000)]
[macOS] Hovering over "Copy Cropped Image" context menu item should reveal the cropped image
https://bugs.webkit.org/show_bug.cgi?id=236845
rdar://89152746

Reviewed by Dean Jackson.

Add support for revealing the "cropped" region of an image element (while dimming out the rest of the image)
when the user highlights the new "Copy Cropped Image" context menu item on macOS. See below for more details.

* Platform/cocoa/TextRecognitionUtilities.h:

Adjust `requestImageAnalysisMarkup` to take a completion handler with both the resulting CGImageRef, as well as
a CGRect that represents the frame of the cropped image with respect to the source image, normalized to the unit
square. Additionally, tweak all call sites of `requestImageAnalysisMarkup` to pass in completion handlers that
accept both arguments.

* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::encode const):
(WebKit::ContextMenuContextData::decode):
* Shared/ContextMenuContextData.h:
(WebKit::ContextMenuContextData::hitTestedElementContext const):

Add an optional ElementContext representing the inner hit-tested element for the context menu. We use this below
in `WebPageProxy::willHighlightContextMenuItem` to know where we need to install the cropped image overlay.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didDismissContextMenu):

Reset the cached cropped image result as well as the cropped image overlay state when the context menu is
dismissed.

(WebKit::WebPageProxy::resetStateAfterProcessExited):

Also clear the above state if the process crashes.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView doAfterComputingImageAnalysisResultsForMarkup:]):
(-[WKContentView actionSheetAssistant:copyCroppedImage:sourceMIMEType:]):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(-[WKMenuDelegate menu:willHighlightItem:]):

Implement this NSMenu delegate method and call out to WebPageProxy whenever the highlighted context menu item
changes. See below for more details.

(WebKit::WebContextMenuProxyMac::applyMarkupToControlledImage):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::willHighlightContextMenuItem):

This method coordinates showing or hiding the cropped image overlay when the user highlights (but does not yet
select) the "Copy Cropped Image" context menu item. When the user first highlights this item, we trigger an
analysis request in VisionKit; when we later obtain the results, we send the image to the web process as TIFF
data, and inject it into the image using `ImageOverlay::CroppedImage::install`. Un-highlighting and re-
highlighting the menu item then respectively hides and shows the cropped image overlay by setting visibility.

(WebKit::WebPageProxy::handleContextMenuCopyCroppedImage):

Adjust this to use the cached `m_croppedImageResult` if it has already been computed.

* WebProcess/WebPage/WebContextMenu.cpp:
(WebKit::WebContextMenu::show):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didDismissContextMenu):

Destroy the `m_croppedImageOverlay` after the context menu is dismissed (which uninstalls the cropped image
overlay in the process).

(WebKit::WebPage::installCroppedImageOverlay):
(WebKit::WebPage::setCroppedImageOverlayVisibility):

Add methods to install and toggle the visibility of the cropped image overlay.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed, use ArrayWithUndecided in ArrayPrototype
ysuzuki@apple.com [Sat, 19 Feb 2022 17:51:44 +0000 (17:51 +0000)]
Unreviewed, use ArrayWithUndecided in ArrayPrototype
https://bugs.webkit.org/show_bug.cgi?id=236869

JSTests:

* stress/array-prototype-concat.js: Added.

Source/JavaScriptCore:

* runtime/ArrayPrototype.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[JSC] Implement Temporal.PlainDate
dino@apple.com [Sat, 19 Feb 2022 17:43:14 +0000 (17:43 +0000)]
[JSC] Implement Temporal.PlainDate
https://bugs.webkit.org/show_bug.cgi?id=230033
<rdar://problem/83127747>

Reviewed by Yusuke Suzuki.

JSTests:

Some basic tests for PlainDate.

* stress/temporal-plaindate.js: Added.
(shouldBe):
(shouldThrow):
(shouldBe.String.Temporal.PlainDate.from):
(let.text.of.failures.shouldThrow):

Source/JavaScriptCore:

Implement the constructor, `from` and `compare` for Temporal.PlainDate.
This is only a partial implementation, because `from` doesn't
support object parameters, and the `compare` function creates some
internally. However, it is a start!

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

* heap/Heap.cpp: Create the temporalPlainDateSpace.
* heap/Heap.h:
* heap/HeapSubspaceTypes.h:

* runtime/ISO8601.cpp:
(JSC::ISO8601::daysInMonth): Make this publicly visible.
(JSC::ISO8601::temporalDateToString): New method for printing a date.
* runtime/ISO8601.h:

* runtime/JSGlobalObject.cpp: Make the m_plainDateStructure object.
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::plainDateStructure):

* runtime/TemporalObject.cpp: Add the PlainDate constructor.
(JSC::createPlainDateConstructor):
* runtime/TemporalObject.h:

* runtime/TemporalPlainDate.cpp: Added.
(JSC::TemporalPlainDate::create):
(JSC::TemporalPlainDate::createStructure):
(JSC::TemporalPlainDate::TemporalPlainDate):
(JSC::TemporalPlainDate::finishCreation):
(JSC::TemporalPlainDate::visitChildrenImpl):
(JSC::toPlainDate):
(JSC::TemporalPlainDate::tryCreateIfValid):
(JSC::TemporalPlainDate::toString const):
(JSC::TemporalPlainDate::from):
(JSC::TemporalPlainDate::compare):
* runtime/TemporalPlainDate.h: Added.
* runtime/TemporalPlainDateConstructor.cpp: Added.
(JSC::TemporalPlainDateConstructor::create):
(JSC::TemporalPlainDateConstructor::createStructure):
(JSC::TemporalPlainDateConstructor::TemporalPlainDateConstructor):
(JSC::TemporalPlainDateConstructor::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/TemporalPlainDateConstructor.h: Added.
* runtime/TemporalPlainDatePrototype.cpp: Added.
(JSC::TemporalPlainDatePrototype::create):
(JSC::TemporalPlainDatePrototype::createStructure):
(JSC::TemporalPlainDatePrototype::TemporalPlainDatePrototype):
(JSC::TemporalPlainDatePrototype::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
* runtime/TemporalPlainDatePrototype.h: Added.

* runtime/VM.h: Define the temporalPlainDateSpace.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoUnreviewed gardening for GPU Process bots.
jonlee@apple.com [Sat, 19 Feb 2022 17:31:44 +0000 (17:31 +0000)]
Unreviewed gardening for GPU Process bots.

LayoutTests/imported/mozilla:

* svg/blend-hard-light.svg:

LayoutTests:

* gpu-process/TestExpectations:
* platform/ios/TestExpectations:

* compositing/images/positioned-image-content-rect.html:
* compositing/overlap-blending/nested-overlap.html:
* css2.1/20110323/height-applies-to-010a.htm:
* fast/borders/border-radius-on-html.html:
* fast/replaced/ul-li-word-break-break-word.html:
* imported/blink/fast/scrolling/fractional-scroll-offset-iframe-fixed-position.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[LFC][IFC] Add support for ideographic baseline with font fallback
zalan@apple.com [Sat, 19 Feb 2022 16:16:06 +0000 (16:16 +0000)]
[LFC][IFC] Add support for ideographic baseline with font fallback
https://bugs.webkit.org/show_bug.cgi?id=236872

Reviewed by Antti Koivisto.

Let's use the pre-collected fallback fonts to adjust the inline box layout bounds with their ideographic baselines.
This is in preparation for enabling vertical text.

* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::adjustLayoutBoundsWithFallbackFonts const):
(WebCore::Layout::LineBoxBuilder::collectFallbackFonts):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
(WebCore::Layout::LineBoxBuilder::adjustIdeographicBaselineIfApplicable):
* layout/formattingContexts/inline/InlineLineBoxBuilder.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290207 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[WPE][GTK] Enable Thunder and remove old Clearkey CDM/Decryptor
commit-queue@webkit.org [Sat, 19 Feb 2022 14:45:45 +0000 (14:45 +0000)]
[WPE][GTK] Enable Thunder and remove old Clearkey CDM/Decryptor
https://bugs.webkit.org/show_bug.cgi?id=235492

Patch by Philippe Normand <pnormand@igalia.com> on 2022-02-19
Reviewed by Xabier Rodriguez-Calvar.

.:

Enable Thunder in developer builds, this is now needed for the clearkey EME layout tests.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

The Thunder decryptor can now handle ClearKey payloads, as long as the underlying ocdm
library advertises it as supported. Thus the dedicated ClearKey decryptor is no longer
needed and can be removed.

Covered by existing EME ClearKey layout tests.

* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::registerWebKitGStreamerElements):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
(WebCore::CDMFactory::platformRegisterFactories):
* platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: Removed.
(): Deleted.
(WebCore::CDMProxyFactoryClearKey::singleton): Deleted.
(WebCore::CDMProxyFactoryClearKey::createCDMProxy): Deleted.
(WebCore::CDMProxyFactoryClearKey::supportsKeySystem): Deleted.
(WebCore::CDMProxyClearKey::~CDMProxyClearKey): Deleted.
(WebCore::CDMProxyClearKey::cencSetCounterVector): Deleted.
(WebCore::CDMProxyClearKey::cencSetDecryptionKey): Deleted.
(WebCore::CDMProxyClearKey::cencDecryptFullSample): Deleted.
(WebCore::CDMProxyClearKey::cencDecryptSubsampled): Deleted.
(WebCore::CDMProxyClearKey::cencDecrypt): Deleted.
(WebCore::CDMProxyClearKey::closeGCryptHandle): Deleted.
(WebCore::CDMProxyClearKey::gCryptHandle): Deleted.
* platform/graphics/gstreamer/eme/CDMProxyClearKey.h: Removed.
(): Deleted.
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMFactoryThunder::supportedKeySystems const):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: Removed.
(webkit_media_clear_key_decrypt_class_init): Deleted.
(protectionSystemId): Deleted.
(cdmProxyAttached): Deleted.
(decrypt): Deleted.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h: Removed.
* platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcSendEvent):

LayoutTests:

Update EME ClearKey baselines, a few more tests were enabled.

* platform/glib/TestExpectations:
* platform/glib/imported/w3c/web-platform-tests/encrypted-media/idlharness.https-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/idlharness.https-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290206 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[CSS Container Queries] Match container queries correctly in non-rendered subtrees
antti@apple.com [Sat, 19 Feb 2022 14:05:53 +0000 (14:05 +0000)]
[CSS Container Queries] Match container queries correctly in non-rendered subtrees
https://bugs.webkit.org/show_bug.cgi?id=236840

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-contain/container-queries/backdrop-invalidation-expected.txt:
* web-platform-tests/css/css-contain/container-queries/display-contents-expected.txt:
* web-platform-tests/css/css-contain/container-queries/display-none-expected.txt:
* web-platform-tests/css/css-contain/container-queries/pseudo-elements-001-expected.txt:
* web-platform-tests/css/css-contain/container-queries/pseudo-elements-003.tentative-expected.txt:
* web-platform-tests/css/css-contain/container-queries/size-container-no-principal-box-expected.txt:
* web-platform-tests/css/css-contain/container-queries/top-layer-dialog-container-expected.txt:
* web-platform-tests/css/css-contain/container-queries/top-layer-dialog-expected.txt:
* web-platform-tests/css/css-contain/container-queries/top-layer-nested-dialog-expected.txt:

Source/WebCore:

"If the query container does not have a principal box ... then the result of evaluating the size feature is unknown."

https://drafts.csswg.org/css-contain-3/#size-container

* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::styleForFirstLetter):

Remove the assert, this issue is tested by marked-as-failure
imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-002.tentative.html

* style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::ContainerQueryEvaluator):
(WebCore::Style::ContainerQueryEvaluator::evaluate const):
(WebCore::Style::ContainerQueryEvaluator::resolveContainer const):

Factor into a function.
If we don't have selector matching state (like we do during style resolution) then look up containers from DOM.
An element without a renderer may still be a valid container (size queries againt it evaluate to unknown).

(WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const):
* style/ContainerQueryEvaluator.h:
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::containerQueryMatches):

Evaluate to unknown if we don't have a principal box.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[LFC][IFC] Introduce LineBoxBuilder::collectFallbackFonts
zalan@apple.com [Sat, 19 Feb 2022 13:30:26 +0000 (13:30 +0000)]
[LFC][IFC] Introduce LineBoxBuilder::collectFallbackFonts
https://bugs.webkit.org/show_bug.cgi?id=236866

Reviewed by Antti Koivisto.

Let's move fallback font collect to a dedicated function and stop leaking internal line types to TextUtil.

* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::collectFallbackFonts):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
(WebCore::Layout::fallbackFontHasVerticalGlyph): Deleted.
* layout/formattingContexts/inline/InlineLineBoxBuilder.h:
* layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::fallbackFontsForText):
(WebCore::Layout::TextUtil::fallbackFontsForRun): Deleted.
* layout/formattingContexts/inline/text/TextUtil.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290204 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoREGRESSION(r290175): ASSERTION FAILED: platformSample.type == PlatformSample::CMSampl...
commit-queue@webkit.org [Sat, 19 Feb 2022 12:36:54 +0000 (12:36 +0000)]
REGRESSION(r290175): ASSERTION FAILED: platformSample.type == PlatformSample::CMSampleBufferType while running webgl tests
https://bugs.webkit.org/show_bug.cgi?id=236878

Add a missing hunk.
Unreviewed, TBR Eric Carlson.

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2022-02-19

* GPUProcess/media/RemoteVideoFrameObjectHeap.cpp:
(WebKit::RemoteVideoFrameObjectHeap::getVideoFrameBuffer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[LFC][IFC] layoutBoundsForInlineBox should read layoutBoundsPrimaryMetricsForInlineBox
zalan@apple.com [Sat, 19 Feb 2022 09:01:20 +0000 (09:01 +0000)]
[LFC][IFC] layoutBoundsForInlineBox should read layoutBoundsPrimaryMetricsForInlineBox
https://bugs.webkit.org/show_bug.cgi?id=236864

Reviewed by Antti Koivisto.

layoutBoundsForInlineBox returns the layout bounds based on the primary font.
This is in preparation for adding font fallback support for ideographic baseline.

* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::layoutBoundsPrimaryMetricsForInlineBox):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
(WebCore::Layout::LineBoxBuilder::adjustIdeographicBaselineIfApplicable):
(WebCore::Layout::layoutBoundsMetricsForInlineBox): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290202 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoREGRESSION (r287524): hihello.me does not show sliding sheet at the bottom of the...
graouts@webkit.org [Sat, 19 Feb 2022 08:48:22 +0000 (08:48 +0000)]
REGRESSION (r287524): hihello.me does not show sliding sheet at the bottom of the page
https://bugs.webkit.org/show_bug.cgi?id=236838
rdar://88672183

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Add new WPT tests to check we correctly compute implicit keyframes when a 0% and/or 100% keyframe
is defined but only specifies a timing function. One test checks the output of getKeyframes() and
the other that we correctly account for the implicit vaues when computing styles.

* web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
* web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative.html:
* web-platform-tests/css/css-animations/animation-multiple-from-to-keyframes-with-only-timing-function-expected.txt: Added.
* web-platform-tests/css/css-animations/animation-multiple-from-to-keyframes-with-only-timing-function.html: Added.

Source/WebCore:

When we fixed bug 234799 we fixed the behavior of keyframe deduplication in
Style::Resolver::keyframeRulesForName(). While this was a good fix, code that
relied on the KeyframeList that would eventually be yielded from that function
did not quite correctly add implicit keyframes for the 0% and 100% case in some
relatively obscure situation.

The site hihello.me made this shortcoming apparent. This site has this odd keyframe rule:

    from, 60%, 75%, 90%, to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }

It appears the intention of the author with this rule is to replicate the timing function
on multiple keyframes. However, this does not work. This timing function will not be used
for *anything* since if a rule is specified without an animation-timing-function value it
will use the value set on the element, not one on a different keyframe.

This also means that while there are explicit 0% and 100% keyframes, they are not adequate
to then compute implicit properties since the timing function wouldn't match the default
timing function (unless the element that those keyframes are applied to would happen to
specify that exact same timing function).

To correctly handle this, we need to do several things.

First of all, we remove the implicit keyframe code found in KeyframeEffect::getKeyframes()
and let KeyframeList::fillImplicitKeyframes() do all the work to correctly fill-in values
for properties not eplicitly specified on a 0% or 100% keyframe.

This means we need to improve that function to correctly do the task that it's supposed to
do. Now provided with a KeyframeEffect and an underlying style as parameters, for 0% and
100% it correctly:

    1. compiles a list of implicit properties for the given keyframe
    2. find a compatible keyframe for the implicit properties or create one
    3. set the implicit properties on that compatible keyframe to match the values found
       in the underlying style

This correctly takes cares of calls to getKeyframes() as well as the generation of keyframes
passed down to RenderLayerBacking when starting an accelerated animation.

But RenderLayerBacking also had some outdated assumptions on the KeyframeList it receives.
Indeed, it would always assume that a 0% or 100% keyframe would *always* specify properties
for the animated property. That was incorrect since we correctly deduplicate keyframes and
having several 0% or 100% keyframes is perfectly valid. Now we don't give special treatment
to 0% or 100% keyframes in RenderLayerBacking::startAnimation() and always check that a keyframe
features values for the animated property before creating an animation value to send down
to GraphicsLayer.

Finally, another place we make assumptions on implicit keyframes was when resolving styles
as effects are applied in KeyframeEffect::setAnimatedPropertiesInStyle(). There we assumed
that a 0% or 100% keyframe would always qualify as a keyframe containing the animated property,
whereas the steps for resolving styles as specified by the Web Animations specification has
logic to deal with the case where we don't find a 0% or 100% keyframe with an explicit value
for the animated property. So we simplified the checks there to only ever check for an
explicit value.

This rather obscure way to specify keyframes was not previously tested by WPT, so this patch
improves the testing coverage in a way that would have caught this regression in the first place.

Test: imported/w3c/web-platform-tests/css/css-animations/animation-multiple-from-to-keyframes-with-only-timing-function.html

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getKeyframes):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation):
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::insert):
(WebCore::KeyframeList::fillImplicitKeyframes):
* rendering/style/KeyframeList.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoASSERTION FAILED: !hasAnyOpenConnections() in UniqueIDBDatabase::~UniqueIDBDatabase()
sihui_liu@apple.com [Sat, 19 Feb 2022 07:22:47 +0000 (07:22 +0000)]
ASSERTION FAILED: !hasAnyOpenConnections() in UniqueIDBDatabase::~UniqueIDBDatabase()
https://bugs.webkit.org/show_bug.cgi?id=236856

Reviewed by Chris Dumez.

The assertion is hit when running API test WebKit.MigrateIndexedDBDataToGeneralStorageDirectory. We need to
properly close UniqueIDBDatabase before it's destroyed.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::storageSession): remove logging as it was added when we had check for
default session. Since we don't have the check now, the logging does not make much sense.
* NetworkProcess/storage/IDBStorageManager.cpp:
(WebKit::IDBStorageManager::~IDBStorageManager):
* NetworkProcess/storage/IDBStorageManager.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months ago[Tools] Sanitizer builds should obey `set-webkit-configuration --force-optimization...
ddkilzer@apple.com [Sat, 19 Feb 2022 07:19:34 +0000 (07:19 +0000)]
[Tools] Sanitizer builds should obey `set-webkit-configuration --force-optimization-level`
<https://webkit.org/b/236859>
<rdar://problem/89161649>

Reviewed by Brent Fulgham.

* Scripts/webkitdirs.pm:
(XcodeOptions):
- Pass WK_FORCE_OPTIMIZATION_LEVEL instead of
  GCC_OPTIMIZATION_LEVEL if sanitizers are enabled so the
  optimization level can be overridden in sanitizer.xcconfig.

* sanitizer/asan.xcconfig:
(WK_NOT_): Remove.
(WK_NOT_YES): Remove.
- Move variables to sanitizer.xcconfig.

* sanitizer/sanitizer.xcconfig:
(WK_EMPTY_): Add.
(WK_NOT_): Add.
(WK_NOT_YES): Add.
- Add utility variables originally from SDKVariant.xcconfig.
(WK_OVERRIDE_OPTIMIZATION_LEVEL): Add.
- Set to YES/NO depending on whether WK_FORCE_OPTIMIZATION_LEVEL
  is set.
(GCC_OPTIMIZATION_LEVEL):
(GCC_OPTIMIZATION_LEVEL_OVERRIDE_YES): Add.
(GCC_OPTIMIZATION_LEVEL_OVERRIDE_NO): Add.
(GCC_OPTIMIZATION_LEVEL_OVERRIDE_NO_Debug): Rename from GCC_OPTIMIZATION_LEVEL_Debug.
(GCC_OPTIMIZATION_LEVEL_OVERRIDE_NO_Production): Rename from GCC_OPTIMIZATION_LEVEL_Production.
(GCC_OPTIMIZATION_LEVEL_OVERRIDE_NO_Release): Rename from GCC_OPTIMIZATION_LEVEL_Release.
- Make use of WK_OVERRIDE_OPTIMIZATION_LEVEL and
  WK_FORCE_OPTIMIZATION_LEVEL to allow overriding the default
  optimization level for sanitizer builds.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290199 268f45cc-cd09-0410-ab3c-d52691b4dbfc