Skip to content

Conversation

@sosukesuzuki
Copy link
Member

No description provided.

adetaylor and others added 30 commits October 3, 2025 09:03
https://bugs.webkit.org/show_bug.cgi?id=300011
rdar://161796662

Reviewed by Richard Robinson.

Comments on WebKit#51245 suggest that
this is a better way to structure this modulemap.

Canonical link: https://commits.webkit.org/300948@main
https://bugs.webkit.org/show_bug.cgi?id=300069

Reviewed by Timothy Hatcher.

Instead of decoding data: URLs manually, use the WebCore::DataURLDecoder to decode data: urls, and return the resulting URL.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm:
(WebKit::WebExtension::resourceDataForPath):

Canonical link: https://commits.webkit.org/300949@main
https://bugs.webkit.org/show_bug.cgi?id=300073
rdar://161868858

Reviewed by Timothy Hatcher.

In 299859@main I introduced a lifetime model of _WKJSHandle that allowed them to be
put into arrays and dictionaries with later messages from JS able to remove the same
object representation from the containers.  This worked well, except it introduced a
race condition if you are rapidly creating and destroying _WKJSHandles:
If a _WKJSHandle is destroyed near the same time when the web process is sending a
message to the UI process with the same handle, the web process would receive a message
saying the handle was destroyed near the same time as when the UI process receives a
message with the _WKJSHandle, which would then fail when used because the JSC::Strong
had already been removed from the map, so lookup with the identifier would fail.  This
caused assertions when running TestWebKitAPI.SiteIsolation.HitTesting:

ASSERTION FAILED: objectMap().contains(strong.get())
.../Source/WebCore/page/WebKitJSHandle.cpp(71) : static void WebCore::WebKitJSHandle::jsHandleDestroyed(JSHandleIdentifier)

I fix this issue by removing the unneeded === equality in JS and pointer equality
in ObjC while maintaining the isEqual equality in ObjC, which is what really mattered.
I make a ref counting system that allows multiple handles to point to the same object
and be destroyed whenever they are destroyed.  I also rename the JS entry point from
jsHandle back to createJSHandle because we are creating new handles each time again.

Tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/JSHandle.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/WebTransport.mm
* Source/WebCore/page/WebKitJSHandle.cpp:
(WebCore::WebKitJSHandle::create):
(WebCore::WebKitJSHandle::jsHandleDestroyed):
(WebCore::WebKitJSHandle::WebKitJSHandle):
(WebCore::objectMap): Deleted.
(WebCore::WebKitJSHandle::getOrCreate): Deleted.
* Source/WebCore/page/WebKitJSHandle.h:
* Source/WebCore/page/WebKitNamespace.cpp:
(WebCore::WebKitNamespace::createJSHandle):
(WebCore::WebKitNamespace::jsHandle): Deleted.
* Source/WebCore/page/WebKitNamespace.h:
* Source/WebCore/page/WebKitNamespace.idl:
* Source/WebKit/Shared/JSHandleInfo.cpp:
(WebKit::JSHandleInfo::operator== const):
* Source/WebKit/Shared/JSHandleInfo.h:
* Source/WebKit/Shared/JavaScriptEvaluationResult.cpp:
(WebKit::JavaScriptEvaluationResult::APIInserter::toAPI):
* Source/WebKit/Shared/JavaScriptEvaluationResult.mm:
(WebKit::JavaScriptEvaluationResult::ObjCInserter::toID):
* Source/WebKit/UIProcess/API/APIJSHandle.cpp:
(API::JSHandle::create):
(API::JSHandle::JSHandle):
(API::JSHandle::~JSHandle):
(API::handleMap): Deleted.
(API::JSHandle::getOrCreate): Deleted.
* Source/WebKit/UIProcess/API/APIJSHandle.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _hitTestAtPoint:inFrameCoordinateSpace:completionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/_WKContentWorldConfiguration.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKJSHandle.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKJSHandle.mm:
(-[_WKJSHandle isEqual:]):
(-[_WKJSHandle hash]):
(-[_WKJSHandle copyWithZone:]):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hitTestAtPoint):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/JSHandle.mm:
(TestWebKitAPI::TEST(JSHandle, Basic)):
(TestWebKitAPI::TEST(JSHandle, Equality)):
(TestWebKitAPI::TEST(JSHandle, WebpagePreferences)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm:
(TestWebKitAPI::TEST(WKWebView, SnapshotNodeByJSHandle)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebTransport.mm:
(TestWebKitAPI::TEST(WebTransport, CreateStreamsBeforeReady)):
* Tools/WebKitTestRunner/TestController.cpp:

Canonical link: https://commits.webkit.org/300950@main
https://bugs.webkit.org/show_bug.cgi?id=300114
rdar://161902154

Unreviewed.

The test was timing out sometimes.  The test doesn't need to check that stream closing
works, it just needs to test that the connection succeeds.  Simplify the test to make
it stop timing out.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebTransport.mm:
(TestWebKitAPI::TEST(WebTransport, ServerCertificateHashes)):

Canonical link: https://commits.webkit.org/300951@main
https://bugs.webkit.org/show_bug.cgi?id=300106
rdar://161895900

Reviewed by Yusuke Suzuki.

When zero initializing locals, the full 16-byte stack slot
needs to be zeroed since the local could be a v128.

* JSTests/wasm/stress/simd-get-set.js:
(Test.that.uninitialized.v128.local.is.fully.zeroed.all.16.bytes.func.async test):
(Test.global.and.global.func.async test.setI32x4): Deleted.
(Test.global.and.global.func.async test.getI32x4): Deleted.
(Test.global.and.global.func.async test): Deleted.
* Source/JavaScriptCore/llint/InPlaceInterpreter64.asm:

Canonical link: https://commits.webkit.org/300952@main
https://bugs.webkit.org/show_bug.cgi?id=298896
rdar://160640689

Reviewed by Jonathan Bedard.

From buildbot v4.1.0 onwards: getBuilder and getBuilders now return a BuilderModel instead of a dictionary.
Reference: https://docs.buildbot.net/current/relnotes/index.html

This change should be compatible with both older and newer buildbot versions.

* Tools/CISupport/ews-build/events.py:
(Events.buildStarted):
(Events.buildFinished):

Canonical link: https://commits.webkit.org/300953@main
https://bugs.webkit.org/show_bug.cgi?id=300101

Reviewed by Ryosuke Niwa.

Files that were not unskipped have false positives that
are currently being addressed in the checker.

* Source/WebKit/Platform/mac/MenuUtilities.h:
* Source/WebKit/Platform/mac/MenuUtilities.mm:
(WebKit::menuItemTitleForTelephoneNumberGroup):
* Source/WebKit/SaferCPPExpectations/UnretainedCallArgsCheckerExpectations:
* Source/WebKit/UIProcess/API/APIAttachment.h:
* Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::associatedElementNSData const):
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu):
(WebKit::menuItemIdentifier):
(WebKit::createMenuActionItem):
(WebKit::WebContextMenuProxyMac::getContextMenuItem):
(WebKit::WebContextMenuProxyMac::window const):
* Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):

Canonical link: https://commits.webkit.org/300954@main
https://bugs.webkit.org/show_bug.cgi?id=300021

Reviewed by Justin Michaud.

This makes the intent clearer and means the 32-bit version can stay
closer to the 64-bit code.

Canonical link: https://commits.webkit.org/300955@main
https://bugs.webkit.org/show_bug.cgi?id=300042

Reviewed by Antoine Quint and Antti Koivisto.

Started adding property specific types for AcceleratedEffect values,
initially focusing on removing the remaining uses of WebCore::Length
and WebCore::LengthPoint in AcceleratedEffectValues.

Added layering violation comments to indicate further work needed
to resolve the layering.

* Source/WebCore/CMakeLists.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/LengthFunctions.cpp:
* Source/WebCore/platform/LengthFunctions.h:
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
* Source/WebCore/platform/animation/AcceleratedEffectValues.cpp:
* Source/WebCore/platform/animation/AcceleratedEffectValues.h:
* Source/WebCore/platform/animation/AnimationUtilities.h:
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetAnchor.cpp: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetAnchor.h: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetDistance.cpp: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetDistance.h: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetPosition.cpp: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetPosition.h: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetRotate.cpp: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOffsetRotate.h: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOpacity.cpp: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectOpacity.h: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectTransformBox.h: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectTransformOrigin.cpp: Added.
* Source/WebCore/platform/animation/values/AcceleratedEffectTransformOrigin.h: Added.
* Source/WebCore/rendering/MotionPath.cpp:
* Source/WebCore/rendering/MotionPath.h:
* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/rendering/style/StyleMiscNonInheritedData.h:
* Source/WebCore/rendering/style/StyleRareNonInheritedData.h:
* Source/WebCore/style/StyleExtractorConverter.h:
* Source/WebCore/style/StyleExtractorSerializer.h:
* Source/WebCore/style/values/color/StyleOpacity.h:
* Source/WebCore/style/values/motion/StyleOffsetAnchor.cpp:
* Source/WebCore/style/values/motion/StyleOffsetAnchor.h:
* Source/WebCore/style/values/motion/StyleOffsetDistance.h:
* Source/WebCore/style/values/motion/StyleOffsetPosition.cpp:
* Source/WebCore/style/values/motion/StyleOffsetPosition.h:
* Source/WebCore/style/values/motion/StyleOffsetRotate.cpp:
* Source/WebCore/style/values/motion/StyleOffsetRotate.h:
* Source/WebCore/style/values/primitives/StylePosition.cpp:
* Source/WebCore/style/values/primitives/StylePosition.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAcceleratedEffectStack.mm:

Canonical link: https://commits.webkit.org/300956@main
…ed symbol "WebCore::Node::document() const"

rdar://161863117
https://bugs.webkit.org/show_bug.cgi?id=300121

Unreviewed build fix; add missing include.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:

Canonical link: https://commits.webkit.org/300957@main
https://bugs.webkit.org/show_bug.cgi?id=299702

Reviewed by Darin Adler.

Converts the 'font-size-adjust' property to use strong style types.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/platform/graphics/FontCascadeDescription.h:
* Source/WebCore/platform/graphics/FontDescription.cpp:
* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
* Source/WebCore/style/StyleBuilderConverter.h:
* Source/WebCore/style/StyleBuilderCustom.h:
* Source/WebCore/style/StyleBuilderState.h:
* Source/WebCore/style/StyleBuilderStateInlines.h:
* Source/WebCore/style/StyleExtractorConverter.h:
* Source/WebCore/style/StyleExtractorSerializer.h:
* Source/WebCore/style/StyleFontSizeFunctions.cpp:
* Source/WebCore/style/StyleFontSizeFunctions.h:
* Source/WebCore/style/StyleInterpolationFunctions.h:
* Source/WebCore/style/StyleInterpolationWrappers.h:
* Source/WebCore/style/StyleResolveForFont.cpp:
* Source/WebCore/style/StyleResolveForFont.h:
* Source/WebCore/style/values/fonts/StyleFontSizeAdjust.cpp: Added.
* Source/WebCore/style/values/fonts/StyleFontSizeAdjust.h: Added.

Canonical link: https://commits.webkit.org/300958@main
WebKit-7623.1.11

Canonical link: https://commits.webkit.org/300959@main
https://bugs.webkit.org/show_bug.cgi?id=299488
rdar://161273712

Reviewed by Daniel Liu.

As announced on September 9th, the SoCs used in the next generation of
iPhones will include support for ARM'S Memory Tagging Extension
functionality. As part of Apple's MIE (Memory Integrity Enforcement)
feature, libpas should thus implement support for MTE and related
memory-safety functionality to ensure that WebKit is up to par with the
new memory safety standards set by the rest of the system.

In particular, this patch ensures that when possible we allocate memory
with backing MTE tag pages and tag allocations made within them prior to
returning allocation memory to the caller. Not all memory can be tagged
this way: in particular, objects >= 32K and objects which may be
referenced via compact pointers cannot be MTE tagged. There are other
exceptions as well, depending on process/object-type/platform.
It also implements a variety of hardening strategies to further
strengthen the feature and prevent certain well-known kinds of attacks.

Trying this again, since the previous attempt caused build breakages
in certain configurations.

Canonical link: https://commits.webkit.org/300960@main
https://bugs.webkit.org/show_bug.cgi?id=300058
rdar://problem/161856764

Reviewed by Alan Baradlay.

This patch adds the overall logic that we will use to support aligning
grid items after we have determined their sizes. Note that since
alignment is done with respect to the grid area, which acts as the
containing block for the grid item, the border box position that is
returned will be in the coordinate space of the grid area.

With this patch, we only support start alignment for the flex items, so
there is realistically no movement that is needed for the grid item's
margin box, so the final border box position will just be the same as
the value of the top margin. In order to support other alignment values,
we will likely need the size of the grid area along with the border box
dimensions of the grid item.

* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
(WebCore::Layout::GridFormattingContext::constructPlacedGridItems const):
In order to perform alignment, we will need the align-self and
justify-self values for the grid item. If the value for this property is
not auto, then that is the value that will be used; otherwise, we refer to
the value of align-items/justify-items on the grid.

* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::GridLayout::layout):

(WebCore::Layout::GridLayout::performInlineAxisSelfAlignment):
(WebCore::Layout::GridLayout::performBlockAxisSelfAlignment):
The basic idea between these two functions is the same: first, we need to
find out what the margin box position will be to satisfy the needs of
the alignment value, and from there, we can just add in the start margin
to get the final position of the item's border box. Since the most basic
version of start alignment (without considering any sort of safety) does
not move the item from the start of the grid area, we can just return a
value of 0 to indicate that it is at the start of the grid area.

Canonical link: https://commits.webkit.org/300961@main
https://bugs.webkit.org/show_bug.cgi?id=300054
rdar://161853921

Reviewed by Yusuke Suzuki.

Add support for GC struct and arrays with v128 field and element type.

Testing: run JSTests/wasm/gc/simd.js with --useWasmIPIntSIMD=true

* Source/JavaScriptCore/llint/InPlaceInterpreter64.asm:
* Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp:
(JSC::IPInt::WASM_IPINT_EXTERN_CPP_DECL):
* Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.h:
* Source/JavaScriptCore/wasm/WasmOperationsInlines.h:
(JSC::Wasm::arrayNew):
(JSC::Wasm::tryCopyElementsInReverse):
(JSC::Wasm::arrayNewFixed):
(JSC::Wasm::arrayGet):
(JSC::Wasm::arraySet):
(JSC::Wasm::structNew):
(JSC::Wasm::structGet):
(JSC::Wasm::structSet):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.h:
* Source/JavaScriptCore/wasm/js/JSWebAssemblyArrayInlines.h:
(JSC::JSWebAssemblyArray::getVector):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp:
(JSC::JSWebAssemblyStruct::get const):
(JSC::JSWebAssemblyStruct::getVector const):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.h:

Canonical link: https://commits.webkit.org/300962@main
…axedSIMD=1

https://bugs.webkit.org/show_bug.cgi?id=300112
rdar://161901342

Reviewed by Daniel Liu.

Let's not block enabling --useWasmIPIntSIMD by default on relaxed SIMD
support in IPInt.

However, we won't be able to remove the path that tiers up immediately
to BBQ until the relaxed SIMD support is added to IPInt (or we stop
testing --useWasmRelaxedSIMD=1 until the relaxed SIMD support is
completed).

* JSTests/wasm/stress/simd-const-relaxed-f32-madd.js:
* JSTests/wasm/stress/simd-const-relaxed-f32-trunc.js:
* JSTests/wasm/stress/simd-const-relaxed-f64-madd.js:
* JSTests/wasm/stress/simd-const-relaxed-f64-trunc.js:
* JSTests/wasm/stress/simd-const-relaxed-lane-select.js:
* JSTests/wasm/stress/simd-const-relaxed-swizzle.js:
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::Options::assertOptionsAreCoherent):

Canonical link: https://commits.webkit.org/300963@main
…ocess cache

https://bugs.webkit.org/show_bug.cgi?id=299916

Reviewed by Ben Nham.

Made shared process for site isolation work with the Web process cache. WebProcessCache is extended to
maintain a separate map of shared processes per top-level domain in addition to the existing cache of
"main" processes. The size and the capacity of WebProcessCache now takes into account both types of the
process caches. In addition to being segregated by the top-level domain, when a given domain receives
an user interaction from the user, the existing shared process cache which had loaded the same domain
will no longer be eligible for the cache reuse.

This PR also fixes the bug that a wrong BrowsingContextGroup is used during a back/forward navigation.
Store the relevant BrowsingContextGroup in WebBackForwardListItem and use this BrowsingContextGroup
when back/forward navigating to the item.

In addition, this PR also fixes the bug in WebPageProxy::receivedNavigationActionPolicyDecision that
we were creating a new BrowsingContextGroup even when the result of redirect chain ended up navigating
back to the same site. We now avoid creating a new BrowsingContextGroup when main frame's site did not
change per navigation.

Test: TestWebKitAPI.SiteIsolation.SharedProcessBasicWebProcessCache
      TestWebKitAPI.SiteIsolation.SharedProcessWebProcessCacheSharedProcessForSiteWithUserInteraction

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm
* Source/WebKit/Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::create): Optionally store BrowsingContextGroup.
(WebKit::WebBackForwardListItem::WebBackForwardListItem):
* Source/WebKit/Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::browsingContextGroup const):
* Source/WebKit/UIProcess/BrowsingContextGroup.cpp:
(WebKit::BrowsingContextGroup::sharedProcessForSite):
(WebKit::BrowsingContextGroup::ensureProcessForSite):
* Source/WebKit/UIProcess/BrowsingContextGroup.h:
* Source/WebKit/UIProcess/FrameProcess.cpp:
(WebKit::FrameProcess::FrameProcess):
* Source/WebKit/UIProcess/FrameProcess.h:
(WebKit::FrameProcess::sharedProcessMainFrameSite const):
(WebKit::FrameProcess::create):
* Source/WebKit/UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::backForwardAddItemShared):
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::prepareForProvisionalLoadInProcess):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcess):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::receivedNavigationActionPolicyDecision): Fixed a subtle bug that this code was
using a wrong BrowsingContextGroup to find the shared process when the navigation is supposed to swap
the BrowsingContextGroup.
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebProcessCache.cpp: Improved the logging code in this file to use
SENSITIVE_LOG_STRING of PRIVATE_LOG_STRING since it logs the site name.
(WebKit::WebProcessCache::canCacheProcess const):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::evictAtRandomIfNeeded): Extracted from addProcess. We try to evict a shared
process before trying to evict the "main" process since the main process needs to launch sooner.
(WebKit::WebProcessCache::takeProcess):
(WebKit::WebProcessCache::takeSharedProcess): Added.
* Source/WebKit/UIProcess/WebProcessCache.h:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForSite): Added the logic to reuse a cached shared process.
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::prepareProcessForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addSharedProcessDomain): Added.
(WebKit::WebProcessProxy::didStartUsingProcessForSiteIsolation):
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::siteIsolatedViewWithSharedProcess):
(TestWebKitAPI::(SiteIsolation, SharedProcessBasicWebProcessCache)): Added
(TestWebKitAPI::(SiteIsolation, SharedProcessWithResourceLoadStatistics)):
(TestWebKitAPI::(SiteIsolation, SharedProcessAfterClick)):
(TestWebKitAPI::(SiteIsolation, SharedProcessAfterKeyDown)):
(TestWebKitAPI::(SiteIsolation, SharedProcessAfterUserInteractionInSharedProcesss)):
(TestWebKitAPI::(SiteIsolation, SharedProcessWebProcessCacheSharedProcessForSiteWithUserInteraction)):
Added.

Canonical link: https://commits.webkit.org/300964@main
https://bugs.webkit.org/show_bug.cgi?id=300124
rdar://160150633

Reviewed by Matthew Finkel.

Before this PR, if the network failed or the server terminated the connection group,
JS would receive no notification that that happened.  Now it does.

Tests: Tools/TestWebKitAPI/NetworkConnection.h
       Tools/TestWebKitAPI/NetworkConnection.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/WebTransport.mm
* Source/WebCore/Modules/webtransport/WebTransport.cpp:
(WebCore::WebTransport::didFail):
(WebCore::WebTransport::networkProcessCrashed): Deleted.
* Source/WebCore/Modules/webtransport/WebTransport.h:
* Source/WebCore/Modules/webtransport/WebTransportSessionClient.h:
* Source/WebCore/Modules/webtransport/WorkerWebTransportSession.cpp:
(WebCore::WorkerWebTransportSession::didFail):
(WebCore::WorkerWebTransportSession::networkProcessCrashed): Deleted.
* Source/WebCore/Modules/webtransport/WorkerWebTransportSession.h:
* Source/WebKit/NetworkProcess/webtransport/cocoa/NetworkTransportSessionCocoa.mm:
(WebKit::NetworkTransportSession::initialize):
* Source/WebKit/WebProcess/Network/WebTransportSession.cpp:
(WebKit::WebTransportSession::didFail):
(WebKit::WebTransportSession::networkProcessCrashed): Deleted.
* Source/WebKit/WebProcess/Network/WebTransportSession.h:
* Source/WebKit/WebProcess/Network/WebTransportSession.messages.in:
* Source/WebKit/WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):
* Tools/TestWebKitAPI/NetworkConnection.h:
* Tools/TestWebKitAPI/NetworkConnection.mm:
(TestWebKitAPI::ConnectionGroup::cancel):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebTransport.mm:
(TestWebKitAPI::TEST(WebTransport, ServerConnectionTermination)):

Canonical link: https://commits.webkit.org/300965@main
https://bugs.webkit.org/show_bug.cgi?id=299915
<rdar://161690817>

Reviewed by Abrar Rahman Protyasha.

Use localized string for image controls label. Also detect system RTL
language usage and adjust layout as appropriate.

* Source/WebCore/html/shadow/SpatialImageControls.cpp:
(WebCore::SpatialImageControls::ensureSpatialControls):
* Source/WebCore/html/shadow/spatialImageControls.css:
(div#label):
(span#spatial-glyph):
(span#pano-glyph):
Mirror layout iff system is in RTL language.

* Source/WebCore/en.lproj/Localizable.strings:
* Source/WebCore/platform/LocalizedStrings.cpp:
(WebCore::imageControlsLabelSpatial):
(WebCore::imageControlsLabelPanorama):
* Source/WebCore/platform/LocalizedStrings.h:
Make label text localizable strings.

* LayoutTests/TestExpectations:
* LayoutTests/fast/images/spatial-image-controls-expected.html:
* LayoutTests/fast/images/spatial-image-controls-rtl-expected.html:
* LayoutTests/fast/images/spatial-image-controls-rtl.html:
* LayoutTests/platform/visionos/TestExpectations:
Add test coverage for RTL support.

Canonical link: https://commits.webkit.org/300966@main
https://bugs.webkit.org/show_bug.cgi?id=300133
rdar://161539144

Reviewed by Yusuke Suzuki and Dan Hecht.

The global.get Wasm opcode in constant expression position currently doesn't
support v128.

Testing covered by additions to JSTests/wasm/gc/simd.js.

* JSTests/wasm/gc/simd.js:
(testSIMDGlobal):
* Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp:
(JSC::Wasm::ConstExprGenerator::getGlobal):

Canonical link: https://commits.webkit.org/300967@main
https://bugs.webkit.org/show_bug.cgi?id=300055
rdar://161854148

Reviewed by Abrar Rahman Protyasha.

Avoids unsafe downcast of key{up/down/press} events to KeyboardEvent,
which was crashing on iOS simulated keyboard events. Crashes were
occurring in these two API tests:

- KeyboardInputTests.InsertDictationAlternativesSimulatingKeyboardInput
- KeyboardInputTests.InsertTextSimulatingKeyboardInput

(these tests are not currently being exercised by automation
because the feature is currently behind a feature flag)

* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::computeInteractionID):
(WebCore::LocalDOMWindow::finalizeEventTimingEntry):

Canonical link: https://commits.webkit.org/300968@main
https://bugs.webkit.org/show_bug.cgi?id=300036

Reviewed by Abrar Rahman Protyasha.

Update UITextInput protocol in SPI headers (this protocol is actually
API, but WKWebView still uses a pre-API internal protocol). This needs
to be visible from Swift, so add it to the bridging header. Unlike our
frameworks, the test bundle is not itself a module, so we do not need to
modularize UIKitSPIForTesting.h and friends to be able to use it from
swift code.

Along the way, fix a couple of public build issues, noted below.

Test: Tools/TestWebKitAPI/Tests/WebKit Swift/TestWebKitAPIBundle-Bridging-Header.h

Test: Tools/TestWebKitAPI/Tests/WebKit Swift/TestWebKitAPIBundle-Bridging-Header.h

* Configurations/CommonBase.xcconfig: Change the definition of
  SDKDB_HAS_148943382 to be internal only. When we generate partial
  SDKDBs from the public SDK, they do not exhibit the same bug. This
  change reverts an earlier attempt to work around the bug in
  300877@main.

* Source/WebCore/Configurations/AllowedSPI-legacy.toml: Revert an
  earlier attempt to fix the above problem (300877@main).

* Tools/TestRunnerShared/spi/UIKitSPIForTesting.h:
* Tools/TestWebKitAPI/Tests/WebKit Swift/TestWebKitAPIBundle-Bridging-Header.h:

* WebKitLibraries/SDKs/iphoneos26.0-additions.sdk/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore.tbd:
  Removed. The public build gets UIKit symbols from UIKit.tbd directly,
  not by binding to UIKitCore. This sidesteps an issue where WebKitSwift
  binds to different UIKit symbols in debug and release configurations,
  which confuses extract-tbds-from-internal-sdk.
* WebKitLibraries/SDKs/iphonesimulator26.0-additions.sdk/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore.tbd: Removed.

Canonical link: https://commits.webkit.org/300969@main
https://bugs.webkit.org/show_bug.cgi?id=300063
rdar://161639791

Reviewed by Matthew Finkel.

Fix CoreIPC fuzz blocker by checking that the NSURLRequest from the
ResourceRequest in NetworkSessionCocoa is not nil before use.

Test: ipc/networksessioncocoa-empty-resource-request.html

Test: ipc/networksessioncocoa-empty-resource-request.html
* LayoutTests/ipc/networksessioncocoa-empty-resource-request-expected.txt: Added.
* LayoutTests/ipc/networksessioncocoa-empty-resource-request.html: Added.
* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::createWebSocketTask):

Canonical link: https://commits.webkit.org/300970@main
https://bugs.webkit.org/show_bug.cgi?id=291839
rdar://149683032

Reviewed by Chris Dumez.

WebContent logs during launch are not emitted when logd is blocked in the sandbox because the log streaming channel
to the UI process is not set up until WebProcess::platformInitializeWebProcess is called. This patch addresses this
by sending logs emitted in this time interval over the XPC connection to the UI process and emit the logs there.

Test: Tools/TestWebKitAPI/Tests/WebKit/LogForwarding.mm

* Source/JavaScriptCore/API/JSValue.mm:
(createStructHandlerMap):
* Source/JavaScriptCore/API/JSWrapperMap.mm:
(parsePropertyAttributes):
* Source/JavaScriptCore/API/ObjcRuntimeExtras.h:
(adoptSystem): Deleted.
* Source/WTF/wtf/SystemFree.h:
(WTF::adoptSystem):
* Source/WebKit/Shared/Cocoa/LaunchLogHook.h: Added.
* Source/WebKit/Shared/Cocoa/LaunchLogHook.mm: Added.
(WebKit::LaunchLogHook::singleton):
(WebKit::LaunchLogHook::initialize):
(WebKit::LaunchLogHook::disable):
* Source/WebKit/Shared/Cocoa/LaunchLogMessages.h: Added.
* Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::initializeLogd):
(WebKit::XPCServiceEventHandler):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _launchLogsCountForTesting]):
* Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::xpcEventHandler const):
(WebKit::WebProcessProxy::XPCEventHandler::handleXPCEvent const):
(WebKit::WebProcessProxy::XPCEventHandler::XPCEventHandler):
* Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::registerLogClient):
* Tools/TestWebKitAPI/Tests/WebKit/LogForwarding.mm:
(TEST(WebKit, LaunchLogs)):

Canonical link: https://commits.webkit.org/300971@main
https://bugs.webkit.org/show_bug.cgi?id=299961
rdar://problem/161742137

Reviewed by Brian Weinstein and Timothy Hatcher.

Add support for browser.runtime.getVersion().
This was proposed in the WECG: w3c/webextensions#878

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIRuntime.mm
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm:
(WebKit::WebExtensionAPIRuntime::getVersion):
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIRuntime.h:
* Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIRuntime.idl:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIRuntime.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIRuntime, GetVersion)):

Canonical link: https://commits.webkit.org/300972@main
…dentifiers.end()

https://bugs.webkit.org/show_bug.cgi?id=299996
rdar://161779919

Reviewed by Eric Carlson.

Calling AudioVideoRendererAVFObjC::addTrack could trigger a call to notifyRequiresFlushToResume,
before returning: as such the track identifier wouldn't have been inserted in the hash map yet
causing the assertion.

We ensure that the callback `notifyRequiresFlushToResume` isn't called when
we just added the video track, as no video data would have been enqueued yet: so there's
nothing to flush yet.

Re-enabling tests.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.mm:
(WebCore::AudioVideoRendererAVFObjC::stageVideoRenderer):

Canonical link: https://commits.webkit.org/300973@main
https://bugs.webkit.org/show_bug.cgi?id=299838
rdar://161612789

Reviewed by Jer Noble.

Enable preference for testing, covered by existing webm tests.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::WTF_REQUIRES_LOCK): Swap the order of registration of MediaPlayerFactory.
MSE and MP4 are more commonly used as webm. It makes more sense to try those first.
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::cancelLoad): We incorrectly set the networkState
to idle when the load was cancelled. When running in the GPUP, it didn't make
a difference as the MediaPlayerPrivateRemote stopped accepting new events from
the GPUP once unloaded.
But when running in the content process, it would cause the element to incorrectly
fire the "suspend" event and causing tests to fail.

Canonical link: https://commits.webkit.org/300974@main
https://bugs.webkit.org/show_bug.cgi?id=299580

Reviewed by Sihui Liu.

Introduce a new DOM event, webkitshadowrootattached, which gets fired on an element
whenever a non-user-agent shadow root attached to the element.

We dispatch this event whenever DOM wrapper world is supposed to have access to all
shadow roots regardless of its mode.

Tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/FormValidation.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm

* LayoutTests/fast/dom/gc-dom-tree-lifetime-shadow-tree.html: Fixed the test to wait
with a 0s timer so that we perform the liveness check after webkitshadowrootattached
has been dispatched.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::addShadowRoot):
(WebCore::Element::enqueueShadowRootAttachedEvent):
(WebCore::Element::dispatchShadowRootAttachedEvent):
* Source/WebCore/dom/Element.h:
(WebCore::Element::didDispatchShadowRootAttachedEvent):
* Source/WebCore/dom/Event.h:
(WebCore::Event::isShadowRootAttachedEvent):
(WebCore::Event::setIsShadowRootAttachedEvent):
* Source/WebCore/dom/EventNames.json:
* Source/WebCore/dom/EventTarget.cpp:
(WebCore::EventTarget::innerInvokeEventListeners):
* Source/WebCore/dom/MutationObserver.cpp:
(WebCore::MutationObserver::enqueueShadowRootAttachedEvent):
(WebCore::MutationObserver::notifyMutationObservers):
* Source/WebCore/dom/MutationObserver.h:
* Source/WebCore/dom/Node.h:
* Source/WebCore/dom/WindowEventLoop.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/FormValidation.mm:
(TestWebKitAPI::TEST(WebKit, DidAssociateFormControls)): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST(WKUserContentController, DidAssociateFormControls)):
(TEST(WKUserContentController, ShadowRootAttachedEvent)):

Canonical link: https://commits.webkit.org/300975@main
https://bugs.webkit.org/show_bug.cgi?id=300134
<rdar://161909905>

Reviewed by Aditya Keerthi and Abrar Rahman Protyasha.

Guard relevant recent changes with PANORAMA_IMAGE_CONTROLS feature flag.

* Source/WebCore/html/shadow/SpatialImageControls.cpp:
(WebCore::SpatialImageControls::shouldHaveSpatialControls):
(WebCore::SpatialImageControls::ensureSpatialControls):
* Source/WebCore/html/shadow/spatialImageControls.css:
Add new compile-time feature flag.

* LayoutTests/platform/visionos/TestExpectations:
Skip layout test since necessary changes are now compiled out.

Canonical link: https://commits.webkit.org/300976@main
https://bugs.webkit.org/show_bug.cgi?id=299813
rdar://161584294

Unreviewed build fix

* Source/WebGPU/Configurations/WebGPU.xcconfig:

Canonical link: https://commits.webkit.org/300977@main
@sosukesuzuki
Copy link
Member Author

/build-preview

@github-actions
Copy link

🔄 Preview build started

Release tag: autobuild-preview-pr-113-68ce1d24
Workflow: View progress

@github-actions
Copy link

✅ Preview build completed

Release: autobuild-preview-pr-113-68ce1d24

@sosukesuzuki
Copy link
Member Author

/build-preview

@github-actions
Copy link

🔄 Preview build started

Release tag: autobuild-preview-pr-113-58e9ebc3
Workflow: View progress

@github-actions
Copy link

✅ Preview build completed

Release: autobuild-preview-pr-113-58e9ebc3

@sosukesuzuki
Copy link
Member Author

/build-preview

@github-actions
Copy link

🔄 Preview build started

Release tag: autobuild-preview-pr-113-341e207c
Workflow: View progress

@github-actions
Copy link

✅ Preview build completed

Release: autobuild-preview-pr-113-341e207c

@sosukesuzuki
Copy link
Member Author

/build-preview

@github-actions
Copy link

🔄 Preview build started

Release tag: autobuild-preview-pr-113-5434fc4c
Workflow: View progress

@github-actions
Copy link

✅ Preview build completed

Release: autobuild-preview-pr-113-5434fc4c

@sosukesuzuki
Copy link
Member Author

/build-preview

@github-actions
Copy link

🔄 Preview build started

Release tag: autobuild-preview-pr-113-22206137
Workflow: View progress

@github-actions
Copy link

✅ Preview build completed

Release: autobuild-preview-pr-113-22206137

@sosukesuzuki
Copy link
Member Author

/build-preview

@github-actions
Copy link

🔄 Preview build started

Release tag: autobuild-preview-pr-113-c3634e29
Workflow: View progress

@github-actions
Copy link

✅ Preview build completed

Release: autobuild-preview-pr-113-c3634e29

@sosukesuzuki
Copy link
Member Author

/build-preview

@github-actions
Copy link

🔄 Preview build started

Release tag: autobuild-preview-pr-113-a8c96c80
Workflow: View progress

@github-actions
Copy link

✅ Preview build completed

Release: autobuild-preview-pr-113-a8c96c80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.