Skip to content

Upgrade again - #52

Merged
Jarred-Sumner merged 176 commits into
mainfrom
jarred/upgrade-a-third-time
Apr 15, 2024
Merged

Jarred-Sumner merged 176 commits into
mainfrom
jarred/upgrade-a-third-time

Conversation

@Jarred-Sumner

Copy link
Copy Markdown
Collaborator

Upgrade again

abigailfox and others added 30 commits April 10, 2024 16:22
https://bugs.webkit.org/show_bug.cgi?id=272287
rdar://126027057

Reviewed by Antti Koivisto.

* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::featureEvaluationContextForQuery const):
(WebCore::Style::ContainerQueryEvaluator::selectContainer):

Canonical link: https://commits.webkit.org/277330@main
…solation enabled

https://bugs.webkit.org/show_bug.cgi?id=272373
rdar://126114826

Reviewed by Charlie Wolfe and Sihui Liu.

There were two issues here:

1. Document::topOrigin was using topDocument() to get the SecurityOrigin, and with site isolation
enabled the top document isn't necessarily the main frame's Document.  Instead, use a strategy
like we do with mainFrameURL where the Page has the main frame's origin in all processes, whether
the main frame is remote or not.

2. In WebProcessPool::processForNavigation when navigating the main frame, use the RegistrableDomain
from the navigation instead of the PageLoadState, which may not have the activeURL yet.

With these 2 changes, we stop getting failures in NetworkProcess::allowsFirstPartyForCookies in 2 tests
when run with --site-isolation.  The tests change from crashes to regular time-outs.

* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::topOrigin const):
* Source/WebCore/dom/Document.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::setMainFrameURL):
(WebCore::Page::mainFrameOrigin const):
* Source/WebCore/page/Page.h:
* Source/WebCore/page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::opaqueOrigin):
* Source/WebCore/page/SecurityOrigin.h:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):

Canonical link: https://commits.webkit.org/277331@main
…onally be separated by a space

https://bugs.webkit.org/show_bug.cgi?id=272194
rdar://problem/125935544

Reviewed by Andres Gonzalez.

When building textUnderElement, we used to unconditionally separate tokens with a space. This is
not the right behavior for every sequence of CSS display types. For example, for:

<button>foo<span>bar</span>baz</button>

We generate an accname of "foo bar baz", but it is rendered as "foobarbaz", and thus that is what
we should be exposing.

With this patch, we now only insert a space based on a few heuristics, namely:
  - The CSS display type
  - Whether the object is a control
  - Whether text was retrieved through non "raw text" means, e.g. via attribute: aria-label, alt, etc.

This fixes 16 WPT subtests. Other tests have been updated as well because they tested for incorrect
accnames, which are fixed with this patch. I have explicitly checked each one, and confirmed the new
behavior is more correct (it matches the rendering, unlike the old behavior).

* LayoutTests/accessibility/internal-link-anchors2-expected.txt:
* LayoutTests/accessibility/ios-simulator/link-with-images-text-expected.txt:
* LayoutTests/accessibility/ios-simulator/link-with-images-text.html:
* LayoutTests/accessibility/listitem-title-expected.txt:
* LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt:
* LayoutTests/accessibility/mac/label-element-changing-children-string-value.html:
* LayoutTests/accessibility/render-counter-text.html:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_name_from_content-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_text_node-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-display/accessibility/display-contents-role-and-label-expected.txt:
* LayoutTests/platform/glib/accessibility/css-content-attribute-expected.txt:
* LayoutTests/platform/glib/accessibility/generated-content-with-display-table-crash-expected.txt:
* LayoutTests/platform/glib/accessibility/render-counter-text-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-display/accessibility/display-contents-role-and-label-expected.txt:
* Source/WebCore/accessibility/AXCoreObject.h:
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AccessibilityMathMLElement.h:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::appendNameToStringBuilder):
(WebCore::displayTypeNeedsSpace):
(WebCore::needsSpaceFromDisplay):
(WebCore::shouldPrependSpace):
(WebCore::AccessibilityNodeObject::textUnderElement const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
Drive-by fix to change PLATFORM(ATSPI) to USE(ATSPI). The former is not correct (it will not evaluate true for ATSPI
or any platform / configuration).

Canonical link: https://commits.webkit.org/277332@main
https://bugs.webkit.org/show_bug.cgi?id=272494
rdar://126089415

Reviewed by Justin Michaud.

We're seeing crashes from these asserts but it's not clear what the state is at that
time. Adding some extra logging.

* Source/WTF/wtf/Assertions.h:
(wtfCrashArg):
* Source/WTF/wtf/threads/Signals.cpp:
(WTF::setExceptionPorts):
(WTF::registerThreadForMachExceptionHandling):

Canonical link: https://commits.webkit.org/277333@main
https://bugs.webkit.org/show_bug.cgi?id=272420
rdar://126166325

Reviewed by Matthew Finkel and Chris Dumez.

Add a setting on WebsiteDataStore to allow enabling site validation on storage messages. The flag is not in use yet, so
there is no behavior change.

* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setStorageSiteValidationEnabled):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/NetworkProcess/NetworkProcess.messages.in:
* Source/WebKit/NetworkProcess/NetworkSession.cpp:
(WebKit::createNetworkStorageManager):
* Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h:
* Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.serialization.in:
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:
(WebKit::NetworkStorageManager::create):
(WebKit::NetworkStorageManager::NetworkStorageManager):
(WebKit::NetworkStorageManager::setStorageSiteValidationEnabledInternal):
(WebKit::NetworkStorageManager::setStorageSiteValidationEnabled):
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _storageSiteValidationEnabled]):
(-[WKWebsiteDataStore _setStorageSiteValidationEnabled:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setStorageSiteValidationEnabled):
(WebKit::WebsiteDataStore::parameters):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::storageSiteValidationEnabled const):

Canonical link: https://commits.webkit.org/277334@main
…nstantly crashing in http/wpt/service-workers/ and inspector/

https://bugs.webkit.org/show_bug.cgi?id=272465
rdar://126212622

Unreviewed test gardening.

Adding test expectation

* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/277335@main
https://bugs.webkit.org/show_bug.cgi?id=272422
rdar://problem/126168150

Reviewed by Chris Dumez.

* Source/WebCore/accessibility/AXCoreObject.cpp:
(WebCore::AXCoreObject::hasPopup const):
(WebCore::AXCoreObject::tableLevel const):
(WebCore::AXCoreObject::selectedCells):
(WebCore::AXCoreObject::linkedObjects const):
(WebCore::AXCoreObject::appendRadioButtonGroupMembers const):

Canonical link: https://commits.webkit.org/277337@main
https://bugs.webkit.org/show_bug.cgi?id=271075
rdar://124708190

Reviewed by Sihui Liu.

We had some power issues that were harder to diagnose than they should have been because data tasks
created by _WKDataTask (which eventually calls down to NetworkProcess::dataTaskWithRequest) don't
have signposts like other NetworkProcess data tasks. This adds those signposts so future bugs will
be easier to triage.

* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::dataTaskWithRequest):
* Source/WebKit/NetworkProcess/cocoa/WKURLSessionTaskDelegate.h:
* Source/WebKit/NetworkProcess/cocoa/WKURLSessionTaskDelegate.mm:
(-[WKURLSessionTaskDelegate initWithTask:identifier:session:]):
(-[WKURLSessionTaskDelegate dealloc]):
(-[WKURLSessionTaskDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKURLSessionTaskDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKURLSessionTaskDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(-[WKURLSessionTaskDelegate URLSession:dataTask:didReceiveData:]):
(-[WKURLSessionTaskDelegate URLSession:task:didCompleteWithError:]):
(-[WKURLSessionTaskDelegate initWithIdentifier:session:]): Deleted.

Canonical link: https://commits.webkit.org/277338@main
…ross-origin iframe.

https://bugs.webkit.org/show_bug.cgi?id=272419
<rdar://126160881>

Reviewed by Alex Christensen.

When Page::layoutIfNeeded tries to layout all documents (and flush their compositing
layers), it should do so for all root frames, not just the main frame.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::layoutIfNeeded):

Canonical link: https://commits.webkit.org/277339@main
https://bugs.webkit.org/show_bug.cgi?id=267959
rdar://problem/121472279

Reviewed by Chris Dumez.

When doing certain types of perf analysis it's useful to have a signpost interval appear around
every IPC message sent.

This adds an ENABLE_CORE_IPC_SIGNPOSTS macro (which is disabled by default) that places signposts
around every IPC message.

* Source/WTF/wtf/SystemTracing.h:
* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::Connection::generateSignpostIdentifier):
(IPC::Connection::sendMessage):
(IPC::Connection::sendMessageImpl):
(IPC::Connection::sendMessageWithAsyncReply):
(IPC::Connection::sendSyncReply):
(IPC::Connection::waitForMessage):
(IPC::Connection::sendSyncMessage):
* Source/WebKit/Platform/IPC/Connection.h:
* Source/WebKit/Platform/IPC/StreamClientConnection.h:
(IPC::StreamClientConnection::send):
(IPC::StreamClientConnection::sendWithAsyncReply):
(IPC::StreamClientConnection::sendSync):

Canonical link: https://commits.webkit.org/277340@main
https://bugs.webkit.org/show_bug.cgi?id=272348
rdar://124234028

Reviewed by Eric Carlson.

Taught PlaybackSessionInterfaceLMK to set ContentMetadata on its LinearMediaPlayer consisting of the
title, subtitle, and artwork vended to Now Playing. Since Now Playing metadata can change
arbitrarily after entering fullscreen, this requried adding a mechanism to observe changes to
Now Playing.

Added a WeakHashSet of NowPlayingMetadataObservers to PlatformMediaSessionManager and taught WebPage
to add itself as an observer when requested by its proxy. These observers are called by
MediaSessionManagerCocoa when m_nowPlayingInfo's metadata changes. To make this easier, metadata
(title, artist, album, artwork, and sourceApplicationIdentifier) was broken out into its own struct
named NowPlayingMetadata.

Also added a WeakHashSet of NowPlayingMetadataObservers to WebPageProxy. When the first observer is
added, WebPageProxy asks WebPage to add itself as an observer of PlatformMediaSessionManager and
send a message to WebPageProxy when the observer is called. PlaybackSessionInterfaceLMK adds itself
as a WebPageProxy observer when entering fullscreen. WKWebViewTesting also adds itself as an
observer to support API testing.

Added API tests.

* Source/WTF/wtf/Forward.h:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::updateNowPlayingInfo):
* Source/WebCore/Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::nowPlayingInfo const):
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/html/HTMLMediaElement.cpp:
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::computeNowPlayingInfo const):
* Source/WebCore/platform/MediaStrategy.h:
* Source/WebCore/platform/NowPlayingManager.cpp:
(WebCore::NowPlayingManager::setNowPlayingInfo):
(WebCore::NowPlayingManager::setNowPlayingInfoPrivate):
* Source/WebCore/platform/audio/NowPlayingInfo.h:
* Source/WebCore/platform/audio/NowPlayingMetadataObserver.h: Copied from Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h.
* Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::nowPlayingInfo const):
(WebCore::PlatformMediaSessionManager::addNowPlayingMetadataObserver):
(WebCore::PlatformMediaSessionManager::removeNowPlayingMetadataObserver):
(WebCore::PlatformMediaSessionManager::nowPlayingMetadataChanged):
* Source/WebCore/platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::nowPlayingInfo const): Deleted.
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::setNowPlayingInfo):
(WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo):
* Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp:
(WebCore::MediaSessionGLib::getMetadataAsGVariant):
* Source/WebCore/platform/audio/glib/MediaSessionManagerGLib.cpp:
(WebCore::MediaSessionManagerGLib::updateNowPlayingInfo):
* Source/WebCore/platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModel::addNowPlayingMetadataObserver):
(WebCore::PlaybackSessionModel::removeNowPlayingMetadataObserver):
* Source/WebCore/platform/cocoa/VideoPresentationModel.h:
* Source/WebCore/platform/ios/PlaybackSessionInterfaceIOS.h:
* Source/WebCore/platform/ios/PlaybackSessionInterfaceIOS.mm:
(WebCore::PlaybackSessionInterfaceIOS::startObservingNowPlayingMetadata):
(WebCore::PlaybackSessionInterfaceIOS::stopObservingNowPlayingMetadata):
* Source/WebKit/Platform/ios/PlaybackSessionInterfaceLMK.h:
* Source/WebKit/Platform/ios/PlaybackSessionInterfaceLMK.mm:
(WebKit::nowPlayingMetadataObserver):
(WebKit::PlaybackSessionInterfaceLMK::startObservingNowPlayingMetadata):
(WebKit::PlaybackSessionInterfaceLMK::stopObservingNowPlayingMetadata):
(WebKit::artworkData):
(WebKit::PlaybackSessionInterfaceLMK::nowPlayingMetadataChanged):
* Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.mm:
(WebKit::VideoPresentationInterfaceLMK::presentFullscreen):
(WebKit::VideoPresentationInterfaceLMK::dismissFullscreen):
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo:]):
(-[WKWebView _setNowPlayingMetadataObserver:]):
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::addNowPlayingMetadataObserver):
(WebKit::PlaybackSessionModelContext::removeNowPlayingMetadataObserver):
(WebKit::PlaybackSessionManagerProxy::addNowPlayingMetadataObserver):
(WebKit::PlaybackSessionManagerProxy::removeNowPlayingMetadataObserver):
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h:
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::addNowPlayingMetadataObserver):
(WebKit::WebPageProxy::removeNowPlayingMetadataObserver):
(WebKit::WebPageProxy::setNowPlayingMetadataObserverForTesting):
(WebKit::WebPageProxy::nowPlayingMetadataChanged):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::nowPlayingMediaTitleAndArtist):
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift:
(SwiftOnlyData.peculiarEntity):
(WKSLinearMediaPlayer.contentMetadata):
(WKSLinearMediaPlayer.contentMetadataPublisher):
(SwiftOnlyData.contentMetadata): Deleted.
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaTypes.swift:
(WKSLinearMediaContentMetadata.contentMetadata):
* Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaPlayer.h:
* Source/WebKit/WebKitSwift/LinearMediaKit/WKSLinearMediaTypes.h:
* Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::startObservingNowPlayingMetadata):
(WebKit::WebPage::stopObservingNowPlayingMetadata):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingMetadataObserver.mm: Added.
(TestWebKitAPI::TEST(NowPlayingMetadataObserver, VideoTitle)):
(TestWebKitAPI::TEST(NowPlayingMetadataObserver, VideoTitleUpdatedByMediaSession)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/large-video-test-now-playing.html:

Canonical link: https://commits.webkit.org/277341@main
https://bugs.webkit.org/show_bug.cgi?id=272467
rdar://126142996

Reviewed by Tim Horton.

The _spatialTrackingView is interefering with scrolling layers in the WKContentView's view
hierarchy. Both make the view centered and 0w x 0h, as well as disabling the spatial tracking
view's user interaction flag.

* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):

Canonical link: https://commits.webkit.org/277342@main
https://bugs.webkit.org/show_bug.cgi?id=272485
rdar://126233155

Reviewed by Chris Dumez and David Kilzer.

Our current style guidelines discourage the use of the "protected" prefix or "protector" in new variable names when creating ref counted variables.
This updates the style checker to align with the current standard.

* Tools/Scripts/webkitpy/style/checkers/cpp.py:
(check_identifier_name_in_declaration):
* Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_names):

Canonical link: https://commits.webkit.org/277343@main
https://bugs.webkit.org/show_bug.cgi?id=272463
rdar://126211299

Reviewed by Chris Dumez.

Fix CHECKED_POINTER_DEBUG flag failed to build after 275125@main

* Source/WebCore/Modules/speech/SpeechRecognitionCaptureSourceImpl.h:
* Source/WebCore/dom/PendingScriptClient.h:
* Source/WebCore/dom/ScriptRunner.h:
* Source/WebCore/dom/TreeScope.cpp:
(WebCore::TreeScope::registerCheckedPtr const): Deleted.
(WebCore::TreeScope::copyCheckedPtr const): Deleted.
(WebCore::TreeScope::moveCheckedPtr const): Deleted.
(WebCore::TreeScope::unregisterCheckedPtr const): Deleted.
* Source/WebCore/html/parser/HTMLDocumentParser.h:
* Source/WebCore/platform/cocoa/PlaybackSessionModel.h:
* Source/WebCore/platform/cocoa/VideoPresentationModel.h:
* Source/WebCore/platform/cocoa/WebAVPlayerLayer.mm:
* Source/WebCore/platform/graphics/cocoa/NullPlaybackSessionInterface.h:
* Source/WebCore/platform/graphics/cocoa/NullVideoPresentationInterface.h:
* Source/WebCore/platform/ios/PlaybackSessionInterfaceIOS.h:
* Source/WebCore/platform/ios/PlaybackSessionInterfaceIOS.mm:
(WebCore::PlaybackSessionInterfaceIOS::registerCheckedPtr const):
(WebCore::PlaybackSessionInterfaceIOS::copyCheckedPtr const):
(WebCore::PlaybackSessionInterfaceIOS::moveCheckedPtr const):
(WebCore::PlaybackSessionInterfaceIOS::unregisterCheckedPtr const):
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h:
* Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:
* Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h:
* Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::registerCheckedPtr const):
(WebCore::PlaybackSessionInterfaceMac::copyCheckedPtr const):
(WebCore::PlaybackSessionInterfaceMac::moveCheckedPtr const):
(WebCore::PlaybackSessionInterfaceMac::unregisterCheckedPtr const):
* Source/WebCore/platform/mac/VideoPresentationInterfaceMac.h:
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h:
* Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h:
* Source/WebCore/platform/mediastream/RealtimeMediaSource.h:
* Source/WebCore/platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.h:
* Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
* Source/WebCore/testing/Internals.h:
* Source/WebCore/xml/parser/XMLDocumentParser.h:
* Source/WebKit/NetworkProcess/Downloads/DownloadManager.h:
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
* Source/WebKit/WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp:
* Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h:
* Source/WebKit/WebProcess/cocoa/VideoPresentationManager.h:

Canonical link: https://commits.webkit.org/277344@main
https://bugs.webkit.org/show_bug.cgi?id=272481
<rdar://126231948>

Reviewed by Chris Dumez.

* Configurations/Sanitizers.xcconfig:
(WK_UNDEFINED_BEHAVIOR_SANITIZER_OTHER_CFLAGS_YES):
- Add local-bounds to existing -fsanitize argument.

Canonical link: https://commits.webkit.org/277345@main
https://bugs.webkit.org/show_bug.cgi?id=272371
rdar://126113799

Reviewed by Alan Baradlay.

Avoid calling `isOrthogonal()` multiple times.

Use local copies of localLeft/Right/Top/Bottom, clarifying which get modified in the course
of the function.

* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::computeBlockStaticDistance):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced const):

Canonical link: https://commits.webkit.org/277346@main
https://bugs.webkit.org/show_bug.cgi?id=272434
rdar://126183686

Reviewed by Ryosuke Niwa.

Implements and tests the toJSON() method for the GeolocationCoordinates interface, as proposed:
w3c/geolocation#147

* LayoutTests/fast/dom/Geolocation/coordinates-interface-toJSON-expected.txt: Added.
* LayoutTests/fast/dom/Geolocation/coordinates-interface-toJSON.html: Added.
* Source/WebCore/Modules/geolocation/GeolocationCoordinates.idl:

Canonical link: https://commits.webkit.org/277347@main
…work process several times

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

Reviewed by Ben Nham and Per Arne Vollan.

WebProcessPool::notifyPreferencesChanged() may notify the network process
several times for the same preference change.

On Cocoa ports, the NetworkProcessProxy is a singleton object. As a result,
iterating over each data store and notifying the data store's network process
keep notifying the same network process.

* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::notifyPreferencesChanged):

Canonical link: https://commits.webkit.org/277348@main
https://bugs.webkit.org/show_bug.cgi?id=272483
rdar://126232174

Reviewed by Richard Robinson.

* Source/WebCore/editing/Editor.h:
* Source/WebCore/editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::insertMultiRepresentationHEIC):

Add alt text if it is non-empty.

* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::insertMultiRepresentationHEIC):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::updateTextTouchBar):
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::insertMultiRepresentationHEIC):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

Canonical link: https://commits.webkit.org/277349@main
https://bugs.webkit.org/show_bug.cgi?id=272490
rdar://126237086

Reviewed by Tim Horton and Sammy Gill.

Fix copypasta in `zoomOut:`

* Tools/MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController zoomOut:]):

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

Reviewed by Alex Christensen.

Modify also the return value of a couple of member methods
to use smart pointers instead of raw ones and allow their
serialization.

* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/PlatformMac.cmake:
* Source/WebKit/Shared/API/Cocoa/RemoteObjectInvocation.h:
(WebKit::RemoteObjectInvocation::encodedInvocation const):
(WebKit::RemoteObjectInvocation::replyInfo const):
* Source/WebKit/Shared/API/Cocoa/RemoteObjectInvocation.mm:
(WebKit::RemoteObjectInvocation::encode const): Deleted.
(WebKit::RemoteObjectInvocation::decode): Deleted.
* Source/WebKit/Shared/API/Cocoa/RemoteObjectRegistry.mm:
(WebKit::RemoteObjectRegistry::sendInvocation):
* Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _invokeMethod:]):
* Source/WebKit/Shared/Cocoa/RemoteObjectInvocation.serialization.in: Added.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm:
(SerializedTypeInfo)): Update accordingly.

Canonical link: https://commits.webkit.org/277351@main
…omed in.

https://bugs.webkit.org/show_bug.cgi?id=272432
<rdar://124304151>

Reviewed by Simon Fraser.

UI-side compositing equivalent of bug 272430. We need to make sure the content scale
is forwarded to the underlying CALayer for the container, as well as the tile controller.

* LayoutTests/css3/filters/backdrop-filter-page-scale-expected.html: Added.
* LayoutTests/css3/filters/backdrop-filter-page-scale.html: Added.
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
(WebKit::PlatformCALayerRemoteTiledBacking::setContentsScale):

Canonical link: https://commits.webkit.org/277352@main
…or-based visibility adjustment

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

Reviewed by Aditya Keerthi.

Add a new UI delegate method to notify clients when selector-based visibility adjustment occurs. See
below for more details.

* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::didAdjustVisibilityWithSelectors):

Add a new `ChromeClient` method that eventually makes an IPC call out to the application process,
where it invokes the new UI delegate method.

* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::ElementTargetingController::applyVisibilityAdjustmentFromSelectors):

Call into the chrome client method here; also, make a couple of minor tweaks to ensure that we only
apply adjustment to content that is actually rendered (with a non-empty client rect).

* Source/WebKit/UIProcess/API/APIUIClient.h:
(API::UIClient::didAdjustVisibilityWithSelectors):
* Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didAdjustVisibilityWithSelectors):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didAdjustVisibilityWithSelectors):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didAdjustVisibilityWithSelectors):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didAdjustVisibilityWithSelectors):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(TestWebKitAPI::TEST(ElementTargeting, AdjustVisibilityFromSelectors)):
(TestWebKitAPI::TEST(ElementTargeting, AdjustVisibilityFromPseudoSelectors)):
* Tools/TestWebKitAPI/cocoa/TestUIDelegate.h:
* Tools/TestWebKitAPI/cocoa/TestUIDelegate.mm:
(-[TestUIDelegate _webView:didAdjustVisibilityWithSelectors:]):

Add test coverage by augmenting two existing API tests to also check that the new delegate method is
called, with the right selector strings.

Canonical link: https://commits.webkit.org/277353@main
https://bugs.webkit.org/show_bug.cgi?id=272478
rdar://126228812

Reviewed by Chris Dumez.

Based on our new safe guidelines.

* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didClose):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::hasLocalStorage):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigin):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::processDidResume):
(WebKit::NetworkProcess::syncLocalStorage):
(WebKit::NetworkProcess::resetQuota):
(WebKit::NetworkProcess::setOriginQuotaRatioEnabledForTesting):
(WebKit::NetworkProcess::resetStoragePersistedState):
(WebKit::NetworkProcess::cloneSessionStorageForWebPage):
(WebKit::NetworkProcess::didIncreaseQuota):
(WebKit::NetworkProcess::renameOriginInWebsiteData):
(WebKit::NetworkProcess::websiteDataOriginDirectoryForTesting):
(WebKit::NetworkProcess::connectionToWebProcessClosed):
(WebKit::NetworkProcess::removeWebPageNetworkParameters):
* Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::setBackupExclusionPeriodForTesting):

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

Reviewed by Simon Fraser.

* Source/WebCore/rendering/RenderBlock.h:
(WebCore::RenderBlock::invalidateLineLayoutPath): Deleted.
* Source/WebCore/rendering/RenderBlockFlow.h:

Canonical link: https://commits.webkit.org/277355@main
https://bugs.webkit.org/show_bug.cgi?id=272473
rdar://126218919

Reviewed by Wenson Hsieh.

Enable additional text indicator styling.

* Source/WebKit/Shared/Cocoa/TextIndicatorStyleType.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _enableTextIndicatorStylingAfterElementWithID:]):
(-[WKWebView _enableTextIndicatorStylingForElementWithID:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::enableTextIndicatorStyleForElementWithID):
* Source/WebKit/UIProcess/WKSTextStyleManager.h:
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView addTextIndicatorStyleForID:withStyleType:]):
(-[WKContentView addTextIndicatorStyleForID:]): Deleted.
* Source/WebKit/UIProcess/mac/WKTextIndicatorStyleManager.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::addTextIndicatorStyleForID):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::enableTextIndicatorStyleForElementWithID):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

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

Reviewed by Ryosuke Niwa.

Merge: https://source.chromium.org/chromium/chromium/src/+/4c5856f9e9618dc3e76dc34033e866bbe28a1fbc

This changes the test into single using `testharness` and
`assert-selection`, making them easier to maintain and highlight any
platform specific failure better.

* LayoutTests/editing/selection/extend-selection-bidi.html: Rebaselined
* LayoutTests/editing/selection/extend-selection-bidi-expected.txt: Rebaselined

> Deleted Test Expectations:
* LayoutTests/platform/gtk/editing/selection/extend-selection-bidi-expected.png:
* LayoutTests/platform/gtk/editing/selection/extend-selection-bidi-expected.txt:
* LayoutTests/platform/ios/editing/selection/extend-selection-bidi-expected.png:
* LayoutTests/platform/mac/editing/selection/extend-selection-bidi-expected.png:
* LayoutTests/platform/mac/editing/selection/extend-selection-bidi-expected.txt:
* LayoutTests/platform/wincairo/editing/selection/extend-selection-bidi-expected.txt:

Canonical link: https://commits.webkit.org/277357@main
https://bugs.webkit.org/show_bug.cgi?id=272499
rdar://126244115

Reviewed by Ryosuke Niwa and Chris Dumez.

LRUList has a `moveToLastIfPresent()` so use that instead of removing and re-adding just to get
something to the end of the LRU list.

* Source/WebCore/loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAccessDecodedData):
* Source/WebCore/loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::moveToEndOfLiveDecodedResourcesListIfPresent):
(WebCore::MemoryCache::pruneSoon):
* Source/WebCore/loader/cache/MemoryCache.h:

Canonical link: https://commits.webkit.org/277358@main
https://bugs.webkit.org/show_bug.cgi?id=256186
rdar://problem/108762653

Reviewed by Andres Gonzalez.

Fix this by changing AccessibilityObject::isARIAHidden to check if the given object is within a hidden slot.

To help accomplish this, a new Element::attributeWithDefaultARIA function is added, as it is needed to check the
slot's aria-hidden attribute, and this logic was repeated several times throughout accessibility code.

* LayoutTests/accessibility/hidden-slot-expected.txt: Added.
* LayoutTests/accessibility/hidden-slot.html: Added.
* LayoutTests/platform/ios/TestExpectations: Enable new test.
* Source/WebCore/Headers.cmake:
CustomElementDefaultARIA.h should have been present in this file, but
wasn't — this patch adds it.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
CustomElementDefaultARIA.h should have been under Private membership to
WebCore, but was Public. This is wrong per https://github.com/WebKit/WebKit/blob/main/Introduction.md#how-to-add-a-new-h-or-cpp-file,
and caused compilation failures. It's now Private.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isModalElement const):
(WebCore::nodeHasRole):
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::getAttribute const):
(WebCore::AccessibilityObject::isARIAHidden const):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::customElementDefaultARIAIfExists const):
(WebCore::Element::customElementDefaultARIAIfExists): Deleted.
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ElementInlines.h:
(WebCore::Element::attributeWithDefaultARIA const):

Canonical link: https://commits.webkit.org/277359@main
Sam Weinig and others added 27 commits April 14, 2024 18:06
https://bugs.webkit.org/show_bug.cgi?id=272651

Reviewed by Tim Nguyen.

Update WPT css/css-color/parsing to daa07cf3c47652ed67e637f2a39bbc34f91cfe10.

* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/WEB_FEATURES.yml: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-relative-color-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-relative-color.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-invalid-color-mix-function-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-invalid-color-mix-function.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-invalid-relative-color-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-invalid-relative-color.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-color-mix-function-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-color-mix-function.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-relative-color-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-relative-color.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/w3c-import.log:

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

Reviewed by Darin Adler and Sam Weinig.

* Source/WTF/wtf/Algorithms.h:
(WTF::spanReinterpretCast): Deleted.
(WTF::sizeof): Deleted.
(WTF::equalSpans): Deleted.
(WTF::memcpySpan): Deleted.
(WTF::memsetSpan): Deleted.
* Source/WTF/wtf/StdLibExtras.h:
(WTF::spanReinterpretCast):
(WTF::sizeof):
(WTF::equalSpans):
(WTF::memcpySpan):
(WTF::memsetSpan):
* Source/WTF/wtf/persistence/PersistentCoders.cpp:
* Source/WTF/wtf/persistence/PersistentCoders.h:
* Source/WTF/wtf/text/Base64.cpp:
* Source/WTF/wtf/text/WTFString.cpp:
* Source/WebCore/PAL/pal/text/win/TextCodecWin.cpp:
* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
* Source/WebCore/dom/TextEncoder.cpp:
* Source/WebCore/platform/generic/KeyedEncoderGeneric.cpp:
* Source/WebCore/platform/sql/SQLiteStatement.cpp:
* Source/WebCore/workers/ScriptBuffer.cpp:
* Source/WebKit/Platform/IPC/DaemonCoders.h:
* Source/WebKit/Platform/IPC/Decoder.h:
* Source/WebKit/Platform/IPC/Encoder.h:
* Source/WebKit/Platform/IPC/StreamConnectionEncoder.h:
* Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp:
* Source/WebKit/UIProcess/API/C/WKPage.cpp:
* Source/WebKit/UIProcess/DeviceIdHashSaltStorage.cpp:
* Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
* Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp:

* Tools/TestWebKitAPI/glib/CMakeLists.txt:
Stop forcing build with C++17 since std::span requires C++20.

Canonical link: https://commits.webkit.org/277480@main
…ial implementation

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

Reviewed by Tim Nguyen.

Adds support for the four additional color interpolation methods,
`display-p3`, `a98-rgb`, `prophoto-rgb` and `rec2020`, that have
been added as valid interpolation method color spaces since the
initial implementation.

Tests updated:
    imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function.html
    imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-color-mix-function.html

* Source/WebCore/css/CSSGradientValue.cpp:
(WebCore::appendColorInterpolationMethod):
(WebCore::appendHueInterpolationMethod): Deleted.
Refactor to re-use more of the existing serialization in ColorInterpolationMethod.h
and reduce duplication by using a generic overload.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeColorInterpolationMethod):
Adds support for parsing the new color spaces. Also fixes the comment
with the spec text to remove "specified" as a hue-interpolation-method
as that is no longer supported (both in the spec and WebCore).

* Source/WebCore/platform/graphics/ColorInterpolationMethod.cpp:
(WebCore::serializationForCSS):
(WebCore::operator<<):
* Source/WebCore/platform/graphics/ColorInterpolationMethod.h:
(WebCore::serializationForCSS):
Add new interpolation method color spaces and their serialization.
Expose a few serialization helpers so that the gradient serialization
can use them as well.

* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
Update to match new definitions.

Canonical link: https://commits.webkit.org/277481@main
… frame

https://bugs.webkit.org/show_bug.cgi?id=272496
<rdar://126240398>

Reviewed by Tim Nguyen.

The existing code only read the visual overflow rect of the old element, and used it for
both the new and old pseudo elements. The visual overflow of the new element should
be copied every frame, and updated on the relevant pseudo element.

This also exposed a bug where we were used the computed value for width and height as the
specified style for the group pseudo, instead of using the border-box size.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-changes-overflow-left-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-changes-overflow-left-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/new-content-changes-overflow-left.html: Added.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::captureOldState):
(WebCore::ViewTransition::copyElementBaseProperties):
(WebCore::ViewTransition::updatePseudoElementStyles):
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* Source/WebCore/rendering/RenderViewTransitionCapture.cpp:
(WebCore::RenderViewTransitionCapture::setImage):
(WebCore::RenderViewTransitionCapture::setSize):
* Source/WebCore/rendering/RenderViewTransitionCapture.h:
* Source/WebCore/rendering/updating/RenderTreeUpdaterViewTransition.cpp:
(WebCore::createRendererIfNeeded):

Canonical link: https://commits.webkit.org/277482@main
…creen-nested-worker-serialization.html is a constant timeout

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

Unreviewed test gardening.

Adding test expectation.

* LayoutTests/platform/mac-wk1/TestExpectations:

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

Several build bots using GCC10.2 (Debian 11) and GCC 11.4 (Ubuntu 22.04)
are failing, possibly due to limitations in the compiler.

* Source/WebCore/loader/appcache/ApplicationCacheManifestParser.cpp:
(WebCore::parseApplicationCacheManifest):
* Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parse):
* Source/WebCore/page/csp/ContentSecurityPolicyTrustedTypesDirective.cpp:
(WebCore::ContentSecurityPolicyTrustedTypesDirective::parse):

Canonical link: https://commits.webkit.org/277484@main
… logical coordinates

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

Reviewed by Alejandro G. Castro.

Apply the monitor scale when setting the size and position and update
the documentation to clarify we use logical coordianates.

* Source/WebKit/WPEPlatform/wpe/WPEMonitor.cpp:
(wpe_monitor_class_init):
* Source/WebKit/WPEPlatform/wpe/drm/WPEMonitorDRM.cpp:
(wpeMonitorDRMCreate):
* Source/WebKit/WPEPlatform/wpe/wayland/WPEMonitorWayland.cpp:

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

Reviewed by Carlos Garcia Campos.

Changeset '277428@main' makes use of function 'drmGetFormatName', which is
only available since libdrm version '2.4.113'.

* Tools/gtk/jhbuild.modules:
* Tools/jhbuild/jhbuild-minimal.modules:
* Tools/wpe/jhbuild.modules:

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

Reviewed by Darin Adler.

The back/forward/traverseTo implementation needs to check whether the document is fully active and throw an exception if not [1].
Similar rules apply to reload [2] and navigate [3].

To fix the frame/document detachment, add an IDL attribute [BypassDocumentFullyActiveCheck], which ignores the script execution context being suspended and avoids the ASSERT in DOMPromise::promise().
This behaviour matches callPromiseFunction, which simply returns the JSPromise and ignores the script execution context.

[1] https://html.spec.whatwg.org/multipage/nav-history-apis.html#performing-a-navigation-api-traversal (step 5)
[2] https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-reload (step 5)
[3] https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-navigate (step 7)

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-already-detached-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-detach-in-serialization-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/traverseTo-already-detached-expected.txt:
* Source/WebCore/bindings/IDLTypes.h:
* Source/WebCore/bindings/js/JSDOMConvertPromise.h:
(WebCore::JSConverter<IDLPromiseIgnoringSuspension<T>>::convert):
* Source/WebCore/bindings/js/JSDOMPromiseDeferredForward.h:
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(GetBaseIDLType):
* Source/WebCore/bindings/scripts/IDLAttributes.json:
* Source/WebCore/page/Navigation.cpp:
(WebCore::Navigation::reload):
(WebCore::Navigation::navigate):
(WebCore::Navigation::performTraversal):
(WebCore::Navigation::updateCurrentEntry):
* Source/WebCore/page/Navigation.idl:

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

Reviewed by Xabier Rodriguez-Calvar.

The decoder tests were failing mostly due to incomplete colorimetry handling in dav1ddec, which was
fixed upstream. The low-latency decoding test was failing because we were not configuring the
decoder to internally use a single thread. The parser was discarding corrupted frames, leading to
another test failure, so it was removed from the harnessed pipeline (the decoder rejects corrupted
frames already).

* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any.worker_av1-expected.txt: Removed.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any_av1-expected.txt: Removed.
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::configureVideoDecoderForHarnessing):
* Source/WebCore/platform/graphics/gstreamer/VideoDecoderGStreamer.cpp:
(WebCore::GStreamerInternalVideoDecoder::GStreamerInternalVideoDecoder):

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

Reviewed by Carlos Garcia Campos.

Adapt GLFence to use only EGL/GL calls so it doesn't require a
current GLContext. Also, take advantage of the static methods
in GLContext to parse the version and extension strings.

* Source/WebCore/platform/graphics/egl/GLContext.cpp:
(WebCore::GLContext::versionFromString):
(WebCore::GLContext::version):
* Source/WebCore/platform/graphics/egl/GLContext.h:
* Source/WebCore/platform/graphics/egl/GLFence.cpp:
(WebCore::isGLFenceSyncSupported):
(WebCore::GLFence::create):

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

Reviewed by Ross Kirsling.

update test262 to tc39/test262@c5a8099

* JSTests/test262/expectations.yaml:
* JSTests/test262/latest-changes-summary.txt:
* JSTests/test262/test262-Revision.txt:

Canonical link: https://commits.webkit.org/277491@main
https://bugs.webkit.org/show_bug.cgi?id=272536
rdar://126286458

Reviewed by Mike Wyrzykowski.

The id attribute validation was missing the upper bound check.

* LayoutTests/http/tests/webgpu/webgpu/shader/validation/decl/override-expected.txt: Added.
* LayoutTests/http/tests/webgpu/webgpu/shader/validation/shader_io/id-expected.txt: Added.
* Source/WebGPU/WGSL/AttributeValidator.cpp:
(WGSL::AttributeValidator::visit):

Canonical link: https://commits.webkit.org/277492@main
https://bugs.webkit.org/show_bug.cgi?id=272604
rdar://126372152

Reviewed by Mike Wyrzykowski.

Update WebGPU CTS to the latest revision using import-webgpu-cts.

* LayoutTests/http/tests/webgpu/common/framework/fixture.js:
Truncated due to commit message length, it was an auto import using import-webgpu-cts

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

Reviewed by Darin Adler.

It's used to indicate there will be frequent get image data operations,
in which case an accelerated canvas can be slower than unaccelerated
one. This patch turns off hardware acceleration for the 2D canvas when
willReadFrequently is true in settings.
See https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

Test: fast/canvas/canvas-will-read-frequently.html

* LayoutTests/TestExpectations: Skip the test in all platforms.
* LayoutTests/fast/canvas/canvas-will-read-frequently-expected.txt: Added.
* LayoutTests/fast/canvas/canvas-will-read-frequently.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d-getcontext-options-expected.txt:
* LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt:
* LayoutTests/inspector/canvas/recording-2d-full-expected.txt:
* LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt:
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-frameCount-expected.txt:
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-full-expected.txt:
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-memoryLimit-expected.txt:
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/gtk/inspector/canvas/context-attributes-expected.txt:
* PerformanceTests/Canvas/getImageDataCPU.html: Added.
* PerformanceTests/Canvas/getImageDataGPU.html: Added.
* Source/JavaScriptCore/inspector/protocol/Canvas.json:
* Source/WebCore/html/CanvasBase.cpp:
(WebCore::CanvasBase::allocateImageBuffer const):
* Source/WebCore/html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::willReadFrequently const):
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::willReadFrequently const):
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h:
* Source/WebCore/html/canvas/CanvasRenderingContext2DSettings.h:
* Source/WebCore/html/canvas/CanvasRenderingContext2DSettings.idl:
* Source/WebCore/inspector/InspectorCanvas.cpp:
(WebCore::buildObjectForCanvasContextAttributes):

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

Reviewed by Carlos Garcia Campos.

Create a fence for each WebGL frame that's generated. The fence is passed
together with the buffer through the proxy to the compositor. During the
composition, before painting the buffer there's a wait for the fence to
ensure that the WebGL is finished.

* Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.cpp:
(WebCore::GraphicsContextGLGBM::prepareForDisplay):
* Source/WebCore/platform/graphics/gbm/GraphicsContextGLGBM.h:
* Source/WebCore/platform/graphics/nicosia/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
* Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLTextureMapperANGLE::prepareForDisplay):
* Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::setFence):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.h:

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

Reviewed by Miguel Gomez.

Accelerated offscreen canvas requires more work to support different
skia GL contexts per thread, so fo nor we can use non-accelerated canvas
to make offscreen canvas work.

* Source/WebCore/html/CanvasBase.cpp:
(WebCore::CanvasBase::shouldAccelerate const):
* Source/WebCore/platform/graphics/nicosia/NicosiaImageBufferPipe.cpp:
(Nicosia::NicosiaImageBufferPipeSource::handle):

Canonical link: https://commits.webkit.org/277496@main
https://bugs.webkit.org/show_bug.cgi?id=272649
rdar://126446654

Reviewed by Abrar Rahman Protyasha.

Just ran a formatter

* LayoutTests/http/tests/paymentrequest/ApplePayModifier-disbursementPaymentRequest.https.html:

Canonical link: https://commits.webkit.org/277497@main
…alar_vector:* appears to hang

https://bugs.webkit.org/show_bug.cgi?id=272574
rdar://126331501

Reviewed by Mike Wyrzykowski.

There 2 bugs in this test:
- the constant shift left builtin incorrectly reported an overflow on abstract
  integers due to using a 32 bit value for the mask it uses to validate
- the lexer used a double to represent all literal values, which can not represent
  all 64-bit integers

All of the new abstract integer CTS tests are now passing. I also added the
expectations for the bitcast test which includes some cases for abstract integers.

* LayoutTests/http/tests/webgpu/webgpu/shader/execution/expression/binary/ai_arithmetic-expected.txt: Added.
* LayoutTests/http/tests/webgpu/webgpu/shader/execution/expression/binary/ai_comparison-expected.txt: Added.
* LayoutTests/http/tests/webgpu/webgpu/shader/execution/expression/call/builtin/bitcast-expected.txt: Added.
* LayoutTests/http/tests/webgpu/webgpu/shader/execution/expression/unary/ai_arithmetic-expected.txt: Added.
* LayoutTests/http/tests/webgpu/webgpu/shader/execution/expression/unary/ai_assignment-expected.txt: Added.
* LayoutTests/http/tests/webgpu/webgpu/shader/execution/expression/unary/ai_complement-expected.txt: Added.
* Source/WebGPU/WGSL/ConstantFunctions.h:
(WGSL::CONSTANT_FUNCTION):
* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<T>::lexNumber):
* Source/WebGPU/WGSL/Lexer.h:
(WGSL::Lexer::makeFloatToken):
(WGSL::Lexer::makeIntegerToken):
(WGSL::Lexer::makeLiteralToken): Deleted.
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parsePrimaryExpression):
* Source/WebGPU/WGSL/Token.h:
(WGSL::Token::Token):
(WGSL::Token::operator=):
* Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp:
(TestWGSLAPI::checkSingleIntegerLiteral):
(TestWGSLAPI::checkSingleFloatLiteral):
(TestWGSLAPI::checkNextTokenIsIntegerLiteral):
(TestWGSLAPI::checkNextTokenIsFloatLiteral):
(TestWGSLAPI::TEST(WGSLLexerTests, SingleTokens)):
(TestWGSLAPI::TEST(WGSLLexerTests, ComputeShader)):
(TestWGSLAPI::TEST(WGSLLexerTests, GraphicsShader)):
(TestWGSLAPI::TEST(WGSLLexerTests, TriangleVert)):
(TestWGSLAPI::checkSingleLiteral): Deleted.
(TestWGSLAPI::checkNextTokenIsLiteral): Deleted.

Canonical link: https://commits.webkit.org/277498@main
…sive with xywh() and rect() clip-paths

https://bugs.webkit.org/show_bug.cgi?id=270296
rdar://123508905

Reviewed by Darin Adler.

Clip path serialization produces inset() values which requires constructing calc expressions if the original
values are not insets. The code for this didn't work correctly if the values were calc expressions thenselves.

* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed-expected.txt:

The results are correct though FAILs because they are not maximally simplified.

* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed.html:

Update from the WPT repo.

* Source/WebCore/css/BasicShapeFunctions.cpp:

Use the existing convertTo100PercentMinusLength instead of trying to do this manually.

(WebCore::valueForBasicShape):
* Source/WebCore/platform/Length.cpp:
(WebCore::convertTo100PercentMinusLengthSum):

Add a separate dual-argument version. This is needed so we can do some manual simplification (see the comment).

* Source/WebCore/platform/Length.h:

Canonical link: https://commits.webkit.org/277500@main
…nders

https://bugs.webkit.org/show_bug.cgi?id=272665
rdar://125644808

Reviewed by Alan Baradlay.

Percent height out-of-flow positioned boxes taking the fast path may end up with miscomputed height.

* LayoutTests/fast/block/positioning/simple-out-of-flow-percent-height-expected.html: Added.
* LayoutTests/fast/block/positioning/simple-out-of-flow-percent-height.html: Added.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutModernLines):

Disable the out-of-flow fast path if there are percent height boxes. The problem is that the fast path
does a synchronous layout for these boxes before the height of the parent is computed.

The synchronous layout itself is a workaround but fixing it may be more complicated.

Canonical link: https://commits.webkit.org/277501@main
…ss restrictive on mobile sites

https://bugs.webkit.org/show_bug.cgi?id=272654
rdar://126271452

Reviewed by Abrar Rahman Protyasha.

Currently, the constants used to identify absolutely-positioned or in-flow candidates when finding
targets have been (for the most part) tested against desktop content on macOS. However, these
thresholds are slightly too restrictive on mobile, where potential targets tend to fill a larger
portion of the viewport.

To account for this, this patch turns the 5 constant values below into linearly-interpolated values,
depending on the viewport area. At roughly desktop-class viewport areas, these are equivalent to
their current values; on mobile, these are tuned to be relatively larger.

```
Form Factor    Area       Max AbsPos      Max In-Flow    Min In-Flow    Max Nearby    Max Adj. Area
---------------------------------------------------------------------------------------------------
Desktop        800000     0.750           0.500          0.005          0.250         0.250
Mobile         200000     1.000           1.000          0.010          0.500         0.300
```

* Source/WebCore/page/ElementTargetingController.cpp:
(WebCore::linearlyInterpolatedViewportRatio):
(WebCore::maximumAreaRatioForAbsolutelyPositionedContent):
(WebCore::maximumAreaRatioForInFlowContent):
(WebCore::maximumAreaRatioForNearbyTargets):
(WebCore::minimumAreaRatioForInFlowContent):
(WebCore::maximumAreaRatioForTrackingAdjustmentAreas):

Turn all of these hard-coded constants into helper functions that take the current viewport size as
input, and return linearly-interpolated values, clamped to the given minimum/maximum values.

(WebCore::inflatedClientRectForAdjustmentRegionTracking):
(WebCore::ElementTargetingController::findTargets):

Make an additional adjustment: treat candidates with no children as targets, even if they're above
size thresholds.

* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ElementTargetingTests.mm:
(-[WKWebView expectSingleTargetedSelector:at:]):

Pull this testing helper out of `ElementTargeting.ParentRelativeSelectors` and into a helper method
in a testing category on `TestWKWebView`, so that we can use it from both of the below tests.

(TestWebKitAPI::TEST(ElementTargeting, ParentRelativeSelectors)):
(TestWebKitAPI::TEST(ElementTargeting, TargetInFlowElements)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/element-targeting-6.html: Added.

Canonical link: https://commits.webkit.org/277502@main
…ampler is not compatible with sampler_comparison

https://bugs.webkit.org/show_bug.cgi?id=272599
<rdar://problem/126385846>

Reviewed by Dan Glastonbury.

We are only supposed to validate BindGroupLayout compatibility
with 'statically used' variables in the WGSL source, not all
of the variables which exist.

In this case, PlayCanvas has a mismatch, but they don't use the variable
in the shader, so it shouldn't be a validation error.

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::insertStructs):

Canonical link: https://commits.webkit.org/277503@main
…nting/reftests/percentage-attribute.svg is a consistent image failure

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

Unreviewed test gardening.

Adding test expectation.

* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/277504@main
@Jarred-Sumner
Jarred-Sumner merged commit 4bdb96d into main Apr 15, 2024
sosukesuzuki pushed a commit that referenced this pull request Apr 17, 2026
https://bugs.webkit.org/show_bug.cgi?id=312485
rdar://174932570

Reviewed by Yusuke Suzuki.

Use value - trunc(value) == 0.0 for isInteger, which rejects NaN and
Infinity without an explicit isFinite check since NaN - NaN and
Inf - Inf both produce NaN.

Add MacroAssembler::isDoubleInteger helper and use it in the DFG
NumberIsInteger path, removing the manual exponent-bit extraction
branch. Simplify the FTL NumberIsInteger path similarly using B3 IR.

Remove redundant isFinite checks from DFG and FTL NumberIsSafeInteger,
since the range check against maxSafeInteger already rejects Infinity.

On ARM64 the difference in codegen is roughly:

isIntegerOld(double):
        frintz  d1, d0
        fmov    x8, d0
        mov     w9, WebKit#2047
        ubfx    x8, x8, #52, #11
        fcmp    d1, d0
        ccmp    x8, x9, #2, eq
        cset    w0, lo
        ret

isIntegerNew(double):
        frintz  d1, d0
        fsub    d0, d0, d1
        fcmp    d0, #0.0
        cset    w0, eq
        ret

No new tests, no behavior change. Covered by existing tests.

Canonical link: https://commits.webkit.org/311413@main
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.