Timeline



Dec 21, 2021:

10:36 PM Changeset in webkit [287348] by Brent Fulgham
  • 12 edits
    10 adds in trunk

Propagate app-initiated state to new ResourceRequests
https://bugs.webkit.org/show_bug.cgi?id=234015
<rdar://problem/86128638>

Reviewed by Kate Cheney.

Source/WebCore:

While reviewing logging we have found that some ResourceRequest objects
are missing the correct state for app-initiated loads. Typically, these
are cases where a new ResourceRequest is created from a URL string, losing
the context that came with the original load (or the context of the page
triggering the load).

This patch corrects a number of such cases.

Tests: http/tests/app-privacy-report/app-attribution-beacon-isappinitiated.html

http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated.html
http/tests/app-privacy-report/new-window-isappinitiated.html
http/tests/app-privacy-report/new-window-isnotappinitiated.html

  • Modules/beacon/NavigatorBeacon.cpp:

(WebCore::NavigatorBeacon::sendBeacon):

  • Modules/websockets/WebSocketChannel.cpp:

(WebCore::WebSocketChannel::connect):

  • Modules/websockets/WebSocketHandshake.cpp:

(WebCore::WebSocketHandshake::WebSocketHandshake):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):

  • Modules/websockets/WebSocketHandshake.h:
  • loader/CrossOriginAccessControl.cpp:

(WebCore::createPotentialAccessControlRequest):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::willLoadMediaElementURL):
(WebCore::FrameLoader::commitProvisionalLoad):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::createWindow):

Source/WebKit:

While reviewing logging we have found that some ResourceRequest objects
are missing the correct state for app-initiated loads. Typically, these
are cases where a new ResourceRequest is created from a URL string, losing
the context that came with the original load (or the context of the page
triggering the load).

This patch corrects a number of such cases.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::createNewPage): Propagate app-initiated state to newly created page.

  • NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:

(WebKit::NetworkCache::SubresourceInfo::encode const): Correct missing serialization for
app-initiated state.
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):

LayoutTests:

  • http/tests/app-privacy-report/app-attribution-beacon-isappinitiated-expected.txt: Added.
  • http/tests/app-privacy-report/app-attribution-beacon-isappinitiated.html: Added.
  • http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated-expected.txt: Added.
  • http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated.html: Added.
  • http/tests/app-privacy-report/new-window-isappinitiated.html: Added.
  • http/tests/app-privacy-report/new-window-isappinitiated-expected.txt: Added.
  • http/tests/app-privacy-report/new-window-isnotappinitiated.html: Added.
  • http/tests/app-privacy-report/new-window-isnotappinitiated-expected.txt: Added.
  • http/tests/app-privacy-report/resources/new-window-isappinitiated-win.html: Added.
  • http/tests/app-privacy-report/resources/new-window-isnotappinitiated-win.html: Added.
10:28 PM Changeset in webkit [287347] by achristensen@apple.com
  • 4 edits in trunk

Fix some API tests after r287341
https://bugs.webkit.org/show_bug.cgi?id=232857

Source/WebKit:

I found the cause of the strange failures and verified my "fix" on an Intel Mac and an Apple Silicon Mac.

  • webpushd/PushClientConnection.mm:

(WebPushD::ClientConnection::hostAppCodeSigningIdentifier):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

(TestWebKitAPI::TEST):

9:17 PM Changeset in webkit [287346] by Patrick Angle
  • 2 edits in trunk/Source/WebInspectorUI

Web Inspector: Assertion Failed removing subview in ContentViewContainer.prototype._disassociateFromContentView
https://bugs.webkit.org/show_bug.cgi?id=234572

Reviewed by Devin Rousso.

r283859 accidentally removed the checks that a content view is attached before attempting to remove it, leading
to an assertion.

  • UserInterface/Views/ContentViewContainer.js:

(WI.ContentViewContainer.prototype._disassociateFromContentView):

9:15 PM Changeset in webkit [287345] by Simon Fraser
  • 5 edits
    2 adds in trunk

Fuzzy pixel data need to be computed in terms of CSS pixels
https://bugs.webkit.org/show_bug.cgi?id=232525

Reviewed by Tim Horton.

Tools:

Pixel tolerance is computed in CSS pixels, so have ImageDiff divide the total number of
differing pixels by the square of the scale factor (a single different pixel at 1x becomes 4
different pixels at 2x).

  • ImageDiff/ImageDiff.cpp:

(processImages):

  • ImageDiff/PlatformImage.cpp:

(ImageDiff::PlatformImage::isCompatible const):
(ImageDiff::PlatformImage::difference):

LayoutTests:

Add a hidpi pixel tolerance test.

  • fast/harness/image-diff/hidpi-pixel-tolerance-expected.html: Added.
  • fast/harness/image-diff/hidpi-pixel-tolerance.html: Added.
  • platform/ios-wk2/TestExpectations: Remove fast/harness/image-diff/fuzz-2-25.html.
8:52 PM Changeset in webkit [287344] by sihui_liu@apple.com
  • 2 edits in trunk/Source/WebKit

Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup
https://bugs.webkit.org/show_bug.cgi?id=234582
rdar://86787798

Reviewed by Simon Fraser.

URLWithString may return nil while fileURLWithPath does not; and fileURLWithPath adds file:// to path correctly.

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::excludeDirectoryFromBackup):

8:18 PM Changeset in webkit [287343] by achristensen@apple.com
  • 7 edits in trunk

Re-enable ContextMenu API tests
https://bugs.webkit.org/show_bug.cgi?id=234585
Source/WebKit:

<rdar://59610140>

Reviewed by Tim Horton.

UIKit changed the internal driver interface to simulate events to show context menus for our tests.
This follows the change and makes our tests work again.

  • Platform/spi/ios/UIKitSPI.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _registerPreview]):

Tools:

Reviewed by Tim Horton.

  • TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:

(TEST):

  • TestWebKitAPI/cocoa/TestContextMenuDriver.h:
  • TestWebKitAPI/cocoa/TestContextMenuDriver.mm:

(+[TestContextMenuDriver prefersCancelsTouchesInView]):
(-[TestContextMenuDriver cancelsTouchesInView]):
(-[TestContextMenuDriver setCancelsTouchesInView:]):

8:17 PM Changeset in webkit [287342] by achristensen@apple.com
  • 2 edits in trunk/Tools

Enable Fullscreen.LayoutConstraints API test
https://bugs.webkit.org/show_bug.cgi?id=234576

Reviewed by Tim Horton.

Added in bug 159900 and not compiled until bug 232768, now it's giving us some useful test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:

(TestWebKitAPI::TEST):

8:09 PM Changeset in webkit [287341] by achristensen@apple.com
  • 2 edits in trunk/Tools

Fix some API tests after r287316
https://bugs.webkit.org/show_bug.cgi?id=232857

I saw the test behavior difference on my Monterey arm64 Mac and assumed it was because it was Monterey,
but actually it's because it's an arm64 Mac. Fix the test expectations.

  • TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

(TestWebKitAPI::TEST):

7:25 PM Changeset in webkit [287340] by Wenson Hsieh
  • 3 edits in trunk/Tools

REGRESSION (12/21/2021): [iOS] TestWebKitAPI.WebKit.AddAndRemoveDataDetectors is consistently failing
https://bugs.webkit.org/show_bug.cgi?id=234574
rdar://86782559

Reviewed by Tim Horton.

This test began failing today due to DataDetectors no longer recognizing "December 21, 2021" as a valid date in
the future. Avoid this problem (at least, until the next century) by adjusting this date to be much later.

  • TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html:
6:31 PM Changeset in webkit [287339] by beidson@apple.com
  • 45 edits in trunk

Make Notification identifiers be a UUID string instead of a uint64_t
https://bugs.webkit.org/show_bug.cgi?id=234534

Reviewed by Alex Christensen.
Source/WebCore:

No new tests (Refactor, covered by existing tests)

Before this patch, Notifications were tagged with an in-WebContent-process-unique identifier
and also tagged with a UIProcess-unique identifier.

There were maps between these two identifiers in WebKit, and both of them were exposed via API/SPI
(e.g. through the injected bundle), necessitating maps between them in WKTR as well.

This simplifies things by making a UUID identifier in the WebContent process that can be treated
as the One True Identifier within WebKit.

There's existing SPI clients that rely on the UIProcess-unique uin64_t identifier, so we sadly
couldn't get rid of that entirely. But this patch still puts us in a much better place.

  • Modules/notifications/Notification.cpp:

(WebCore::Notification::show):
(WebCore::Notification::close):
(WebCore::Notification::stop):
(WebCore::Notification::data const):
(WebCore::Notification::dataWithoutNotificationID const): Deleted.

  • Modules/notifications/Notification.h:
  • Modules/notifications/NotificationClient.h:

(WebCore::NotificationClient::clearNotifications): Deleted.

  • Modules/notifications/NotificationData.h:

(WebCore::NotificationData::decode):

Source/WebKit:

This is mostly changing a whole bunch of uint64_ts to Strings, but also gets rid of lots of weird
and fragile maps.

  • NetworkProcess/Notifications/NetworkNotificationManager.cpp:

(WebKit::NetworkNotificationManager::cancelNotification):
(WebKit::NetworkNotificationManager::clearNotifications):
(WebKit::NetworkNotificationManager::didDestroyNotification):

  • NetworkProcess/Notifications/NetworkNotificationManager.h:
  • Shared/Notifications/NotificationManagerMessageHandler.h:
  • Shared/Notifications/NotificationManagerMessageHandler.messages.in:
  • UIProcess/API/C/WKNotification.cpp:

(WKNotificationCopyCoreIDForTesting):

  • UIProcess/API/C/WKNotification.h:
  • UIProcess/API/C/WKNotificationManager.cpp:

(WKNotificationManagerProviderDidClickNotification_b):
(WKNotificationManagerProviderDidRemoveNotificationPolicies):
(WKNotificationManagerGetLocalIDForTesting): Deleted.

  • UIProcess/API/C/WKNotificationManager.h:
  • UIProcess/Notifications/WebNotification.cpp:

(WebKit::WebNotification::WebNotification):

  • UIProcess/Notifications/WebNotification.h:

(WebKit::WebNotification::create):
(WebKit::WebNotification::notificationID const):
(WebKit::WebNotification::coreNotificationID const):
(WebKit::WebNotification::pageIdentifier const):

  • UIProcess/Notifications/WebNotificationManagerMessageHandler.cpp:

(WebKit::WebNotificationManagerMessageHandler::cancelNotification):
(WebKit::WebNotificationManagerMessageHandler::clearNotifications):
(WebKit::WebNotificationManagerMessageHandler::didDestroyNotification):

  • UIProcess/Notifications/WebNotificationManagerMessageHandler.h:
  • UIProcess/Notifications/WebNotificationManagerProxy.cpp:

(WebKit::WebNotificationManagerProxy::show):
(WebKit::WebNotificationManagerProxy::cancel):
(WebKit::WebNotificationManagerProxy::didDestroyNotification):
(WebKit::pageIDsMatch):
(WebKit::pageAndNotificationIDsMatch):
(WebKit::WebNotificationManagerProxy::clearNotifications):
(WebKit::WebNotificationManagerProxy::providerDidShowNotification):
(WebKit::WebNotificationManagerProxy::providerDidClickNotification):
(WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
(WebKit::generateGlobalNotificationID): Deleted.
(WebKit::WebNotificationManagerProxy::notificationLocalIDForTesting): Deleted.

  • UIProcess/Notifications/WebNotificationManagerProxy.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::cancelNotification):
(WebKit::WebPageProxy::clearNotifications):
(WebKit::WebPageProxy::didDestroyNotification):

  • UIProcess/WebPageProxy.h:
  • WebProcess/InjectedBundle/API/c/WKBundle.cpp:

(WKBundleCopyWebNotificationID):
(WKBundleGetWebNotificationID): Deleted.

  • WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::webNotificationID):

  • WebProcess/InjectedBundle/InjectedBundle.h:
  • WebProcess/Notifications/WebNotificationManager.cpp:

(WebKit::WebNotificationManager::show):
(WebKit::WebNotificationManager::cancel):
(WebKit::WebNotificationManager::didDestroyNotification):
(WebKit::WebNotificationManager::didShowNotification):
(WebKit::WebNotificationManager::didClickNotification):
(WebKit::WebNotificationManager::didCloseNotifications):
(WebKit::generateNotificationID): Deleted.
(WebKit::WebNotificationManager::notificationIDForTesting): Deleted.
(WebKit::WebNotificationManager::clearNotifications): Deleted.
(WebKit::WebNotificationManager::removeNotificationFromContextMap): Deleted.

  • WebProcess/Notifications/WebNotificationManager.h:
  • WebProcess/Notifications/WebNotificationManager.messages.in:
  • WebProcess/WebCoreSupport/WebNotificationClient.cpp:

(WebKit::WebNotificationClient::show):
(WebKit::WebNotificationClient::cancel):
(WebKit::WebNotificationClient::notificationObjectDestroyed):
(WebKit::WebNotificationClient::clearNotifications): Deleted.

  • WebProcess/WebCoreSupport/WebNotificationClient.h:

Source/WebKitLegacy/mac:

  • WebCoreSupport/WebNotificationClient.h:
  • WebCoreSupport/WebNotificationClient.mm:

(WebNotificationClient::show):
(WebNotificationClient::cancel):
(WebNotificationClient::notificationObjectDestroyed):
(WebNotificationClient::clearNotifications): Deleted.

Source/WTF:

Add a new form of Identified that uses a UUID String as the identifier.

  • wtf/Identified.h:

(WTF::UUIDIdentified::UUIDIdentified):

Tools:

Where possible, use the String UUID identifier.
This gets rid of lots of weird maps and cleans up flaky situations that could occasionally occur.

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::postSimulateWebNotificationClick):

  • WebKitTestRunner/InjectedBundle/InjectedBundle.h:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::simulateWebNotificationClick):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::simulateWebNotificationClick):

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

  • WebKitTestRunner/WebNotificationProvider.cpp:

(WTR::WebNotificationProvider::~WebNotificationProvider):
(WTR::WebNotificationProvider::showWebNotification):
(WTR::WebNotificationProvider::closeWebNotification):
(WTR::WebNotificationProvider::addNotificationManager):
(WTR::WebNotificationProvider::removeNotificationManager):
(WTR::WebNotificationProvider::simulateWebNotificationClick):
(WTR::WebNotificationProvider::reset):
(WTR::removeGlobalIDFromIDMap): Deleted.

  • WebKitTestRunner/WebNotificationProvider.h:
5:39 PM Changeset in webkit [287338] by Patrick Angle
  • 2 edits in trunk/Source/WebInspectorUI

Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=234570

Reviewed by Devin Rousso.

Adding an event listener to listen for style changes every time we update the list of CSS variables isn't quite
correct because it means we may attempt to add the event listener multiple times. Instead, this should be done
in response to the InspectedNodeChanged event directly to avoid adding the event listener multiple time to the
same DOM node.

  • UserInterface/Models/CSSPropertyNameCompletions.js:

(WI.CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded):
(WI.CSSPropertyNameCompletions.prototype._handleInspectedNodeChanged):

4:14 PM Changeset in webkit [287337] by Russell Epstein
  • 2 edits in branches/safari-612-branch/Source/WebCore

Cherry-pick r287107. rdar://problem/85150486

Unreviewed build fix after r287077.

  • platform/network/ProtectionSpaceHash.h: (WebCore::ProtectionSpaceHash::hash):

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

4:14 PM Changeset in webkit [287336] by Russell Epstein
  • 4 edits in branches/safari-612-branch/Source/WebCore

Cherry-pick r287077. rdar://problem/85150486

http/tests/security/basic-auth-subresource.html and some other http auth tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=234314
<rdar://85150486>

Reviewed by Darin Adler.

http/tests/security/basic-auth-subresource.html and some other http auth tests are flaky.

No new tests, I will be able to unskip those layout tests in internal once this lands.

  • platform/network/ProtectionSpaceBase.cpp: (WebCore::ProtectionSpaceBase::ProtectionSpaceBase): (WebCore::ProtectionSpaceBase::host const): Deleted. (WebCore::ProtectionSpaceBase::port const): Deleted. (WebCore::ProtectionSpaceBase::serverType const): Deleted. (WebCore::ProtectionSpaceBase::realm const): Deleted. (WebCore::ProtectionSpaceBase::authenticationScheme const): Deleted.
  • platform/network/ProtectionSpaceBase.h: (WebCore::ProtectionSpaceBase::host const): (WebCore::ProtectionSpaceBase::port const): (WebCore::ProtectionSpaceBase::serverType const): (WebCore::ProtectionSpaceBase::realm const): (WebCore::ProtectionSpaceBase::authenticationScheme const): Clean up / modernise the ProtectionSpaceBase class.
  • platform/network/ProtectionSpaceHash.h: (WebCore::ProtectionSpaceHash::hash):
  • Use Hasher in ProtectionSpaceHash::hash() as it is less error-prone. I believe the previous implementation was wrong because it was calling StringHasher::hashMemory(hashCodes, codeCount) instead of StringHasher::hashMemory(hashCodes, codeCount * sizeof(unsigned)). This could have resulted in inefficiencies I believe since we were not hashing the whole array memory.
  • Fix ProtectionSpace<ProtectionSpace> so that emptyValueIsZero is false instead of true. This was a bug since the ProtectionSpaceBase constructor initializes data members to non-zero values.

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

4:14 PM Changeset in webkit [287335] by Russell Epstein
  • 3 edits
    2 adds in branches/safari-612-branch

Cherry-pick r287067. rdar://problem/86276497

Make sure to start a realtime outgoing source in case it is taken to another sender
https://bugs.webkit.org/show_bug.cgi?id=234296
<rdar://86276497>

Reviewed by Eric Carlson.

Source/WebCore:

We are asynchronously starting libwebrtc sources.
When a sender is created first and is assigned a source later, we take the source and assign it to the sender.
In that case, the source might not be started and we will not send any data.

Test: webrtc/addTransceiver-then-addTrack.html

  • Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:

LayoutTests:

  • webrtc/addTransceiver-then-addTrack-expected.txt: Added.
  • webrtc/addTransceiver-then-addTrack.html: Added.

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

3:59 PM Changeset in webkit [287334] by Russell Epstein
  • 8 edits in branches/safari-612-branch/Source

Versioning.

WebKit-7612.4.8

3:16 PM Changeset in webkit [287333] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

Fix Safari-side SafeBrowsing telemetry
https://bugs.webkit.org/show_bug.cgi?id=234439

Patch by Eliot Hsu <eliot_hsu@apple.com> on 2021-12-21
Reviewed by Alex Christensen.

Fix old (and privacy-preserving) telemetry for Safe Browsing,
which were previously reported from the Safari side.

  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::WebViewImpl::showSafeBrowsingWarning):

2:40 PM Changeset in webkit [287332] by Robert Jenner
  • 2 edits in branches/safari-612-branch/Tools

Cherry-pick r285057. rdar://problem/84000764

[ Monterey iOS15 ] TestWebKitAPI.URLSchemeHandler.Ranges is a constant timeout
https://bugs.webkit.org/show_bug.cgi?id=231394

Reviewed by Jer Noble.

For some reason, AVFoundation used to play videos from custom schemes when you respond to range requests with 1 fewer byte than requested.
They stopped successfully playing videos in such circumstances, which is fine. I had accidentally done that in my test.
When I respond properly, the test starts passing again.

  • TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:

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

2:32 PM Changeset in webkit [287331] by Robert Jenner
  • 2 edits in branches/safari-612-branch/Tools

Cherry-pick r286040. rdar://problem/80476146

[ Monterey ] TestWebKitAPI.WebpagePreferences.WebsitePoliciesDuringRedirect is a constant timeout
<rdar://80476146>

Uneviewed test gardening.

  • TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm: (TEST):

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

2:20 PM Changeset in webkit [287330] by Robert Jenner
  • 2 edits in branches/safari-612-branch/Tools

[ Monterey ] 2 TestWebKitAPI.WebKit.DisplayName (api-tests) are constantly failing
<rdar://80353834>

Uneviewed test gardening.

Adding the disable of 2 TestWebKitAPI.WebKit.DisplayName api-tests to Safari-612-Branch.

  • TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm:

(TestWebKitAPI::TEST):

2:16 PM Changeset in webkit [287329] by Alan Bujtas
  • 5 edits in trunk

[LFC][IFC] Compute visual geometry for InlineDisplay::Line
https://bugs.webkit.org/show_bug.cgi?id=234545

Reviewed by Antti Koivisto.

Source/WebCore:

  1. Compute visual geometry for InlineDisplay::Line
  2. Use this visual geometry when constructing display boxes
  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

  • layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:

(WebCore::Layout::InlineDisplayLineBuilder::build const):

LayoutTests:

2:07 PM Changeset in webkit [287328] by Russell Epstein
  • 1 copy in tags/Safari-612.4.7

Tag Safari-612.4.7.

1:56 PM Changeset in webkit [287327] by Darin Adler
  • 38 edits
    2 deletes in trunk/Source/WebCore

ScriptState.h/cpp is a remnant of JavaScript engine abstraction that can be removed
https://bugs.webkit.org/show_bug.cgi?id=234548

Reviewed by Yusuke Suzuki.

ScriptState.h/cpp is file left over from when we had a layer to abstract
JavaScript binding and usage in WebCore so it could work with both JavaScriptCore
and Google's V8 engine. We haven't needed that for years, and stripping away some
of the layers might help us make code more readable and perhaps even notice ways
to make it more efficient. For now, this patch removes the functions from
ScriptState.h/cpp and moves them to more suitable places, simplifying in the process.

Also begin to just call global objects "global object", and not "script state".

  • Headers.cmake: Removed ScriptState.h.
  • Modules/indexeddb/IDBObjectStore.cpp: Removed include of ScriptState.h.
  • Modules/indexeddb/IDBTransaction.cpp: Ditto.
  • Sources.txt: Removed ScriptState.cpp.
  • WebCore.xcodeproj/project.pbxproj: Removed ScriptState.h and .cpp.

Also allowed the script to sort the file.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::mainWorldGlobalObject): Renamed the mainWorldExecState function and
moved it here from ScriptState.cpp.

  • bindings/js/JSDOMWindowCustom.h: Tweaked formatting of the header. Added the

mainWorldGlobalObject function.

  • bindings/js/JSExecState.cpp: Removed include of ScriptState.h.

(WebCore::JSExecState::didLeaveScriptContext): Call scriptExecutionContext.
(WebCore::executionContext): Renamed the scriptExecutionContextFromExecState
function and moved it here from ScriptState.cpp.

  • bindings/js/JSExecState.h: Added the executionContext function.
  • bindings/js/JSNodeCustom.cpp: Removed include of ScriptState.h, added include

of JSDOMWindowCustom.h.
(WebCore::willCreatePossiblyOrphanedTreeByRemovalSlowCase): Call mainWorldGlobalObject.

  • bindings/js/JSNodeCustom.h: Changed willCreatePossiblyOrphanedTreeByRemoval

functions to take a Node& instead of a never-null Node*.

  • bindings/js/JSWindowProxy.h: Tweaked formatting a bit.
  • bindings/js/ScriptState.cpp: Removed.
  • bindings/js/ScriptState.h: Removed.
  • bindings/js/SerializedScriptValue.cpp: Removed include of ScriptState.h.

(WebCore::wrapCryptoKey): Update for name change of executionContext function.
(WebCore::unwrapCryptoKey): Ditto.
(WebCore::CloneDeserializer::readFile): Ditto.
(WebCore::CloneDeserializer::readOffscreenCanvas): Ditto.
(WebCore::CloneDeserializer::readRTCDataChannel): Ditto.
(WebCore::CloneDeserializer::readImageBitmap): Ditto.
(WebCore::CloneDeserializer::readTerminal): Ditto.

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
Pass reference to willCreatePossiblyOrphanedTreeByRemoval.
(WebCore::ContainerNode::removeNodeWithScriptAssertion): Ditto.

  • dom/Document.cpp: Removed include of ScriptState.h, added include

of JSDOMWindowCustom.h.
(WebCore::Document::didLogMessage): Use mainWorldGlobalObject.

  • dom/ScriptExecutionContext.cpp: Removed include of ScriptState.h.

(WebCore::ScriptExecutionContext::globalObject): Use the
ScriptController directly instead of through helper functions.

  • inspector/InspectorFrontendAPIDispatcher.cpp: Removed include of ScriptState.h.
  • inspector/InspectorFrontendClientLocal.cpp: Ditto.
  • inspector/InspectorFrontendHost.cpp: Removed include of ScriptState.h.

(WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
Use the ScriptController directly instead of through a helper function.
(WebCore::InspectorFrontendHost::showContextMenu): Ditto.

  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::frameWindowDiscardedImpl): Do
the null check here instead of in frameWindowDiscarded.

  • inspector/WebInjectedScriptManager.cpp: Removed include of ScriptState.h.

(WebCore::WebInjectedScriptManager::discardInjectedScriptsFor):
Reworked logic to use executionContext instead of domWindowFromExecState.

  • inspector/agents/InspectorCanvasAgent.cpp: Removed include of ScriptState.h.
  • inspector/agents/InspectorDOMAgent.cpp: Removed include of ScriptState.h.

(WebCore::InspectorDOMAgent::focusNode): Use std::exchange here in the
idiomatic "take and null a value" case here. Use mainWorldGlobalObject.
(WebCore::InspectorDOMAgent::buildObjectForEventListener): Use
ScriptController directly instead of through a helper function.
(WebCore::InspectorDOMAgent::resolveNode): Use mainWorldGlobalObject.

  • inspector/agents/InspectorIndexedDBAgent.cpp: Removed include of

ScriptState.h and added include of JSDOMWindowCustom.h.
(WebCore::InspectorIndexedDBAgent::requestData): Use mainWorldGlobalObject.

  • inspector/agents/InspectorNetworkAgent.cpp: Removed include of

ScriptState.h and added include of JSDOMWindowCustom.h.
(WebCore::InspectorNetworkAgent::resolveWebSocket): Use mainWorldGlobalObject.

  • inspector/agents/InspectorTimelineAgent.cpp: Removed include of ScriptState.h.

(WebCore::frame): Added. Helper function to get from a global object to a frame.
Calls executionContext and gets to the frame from there.
(WebCore::InspectorTimelineAgent::startFromConsole): Use frame.
(WebCore::InspectorTimelineAgent::breakpointActionProbe): Ditto.

  • inspector/agents/WebConsoleAgent.cpp: Removed include of ScriptState.h.

(WebCore::WebConsoleAgent::frameWindowDiscarded): Take a reference instead of
a pointer that must not be null. Use executionContext instead of
domWindowFromExecState.

  • inspector/agents/WebConsoleAgent.h: Removed unneeded includes. Removed

unneeded WTF_MAKE_NONCOPYABLE (base class is already not copyable) and
WTF_MAKE_FAST_ALLOCATED (class is an abstract base class and never allocated).
Made constructor protected. Changed the DOMWindow argument to
frameWindowDiscarded to a reference instead of a pointer that must not be null.

  • inspector/agents/page/PageAuditAgent.cpp: Removed include of

ScriptState.h and added include of JSDOMWindowCustom.h.
(WebCore::PageAuditAgent::injectedScriptForEval): Use mainWorldGlobalObject.

  • inspector/agents/page/PageDebuggerAgent.cpp: Removed include of

ScriptState.h and added include of JSDOMWindowCustom.h.
(WebCore::PageDebuggerAgent::injectedScriptForEval): Use mainWorldGlobalObject.

  • inspector/agents/page/PageNetworkAgent.cpp: Removed include of ScriptState.h.
  • inspector/agents/page/PageRuntimeAgent.cpp: Removed include of

ScriptState.h and added include of JSDOMWindowCustom.h.
(WebCore::PageRuntimeAgent::frameNavigated): Use mainWorldGlobalObject.
(WebCore::PageRuntimeAgent::injectedScriptForEval): Ditto.
(WebCore::PageRuntimeAgent::reportExecutionContextCreation): Ditto.
Also use Page::forEachFrame instead of a hand-written loop.

  • inspector/agents/worker/WorkerAuditAgent.cpp: Removed include of ScriptState.h.

(WebCore::WorkerAuditAgent::injectedScriptForEval): Use ScriptController directly
instead of through a helper function.

  • inspector/agents/worker/WorkerDebuggerAgent.cpp: Removed include of ScriptState.h.

(WebCore::WorkerDebuggerAgent::injectedScriptForEval): Use ScriptController directly
instead of through a helper function.

  • inspector/agents/worker/WorkerRuntimeAgent.cpp: Removed include of ScriptState.h.

(WebCore::WorkerRuntimeAgent::injectedScriptForEval): Use ScriptController directly
instead of through a helper function.

12:16 PM Changeset in webkit [287326] by msaboff@apple.com
  • 9 edits in trunk/Source

Fix symlinks for alternate root framework locations
https://bugs.webkit.org/show_bug.cgi?id=234567

Reviewed by Filip Pizlo.

Source/ThirdParty/ANGLE:

Eliminated the creation of symlinks for ANGLE as it is under WebCore.

  • ANGLE.xcodeproj/project.pbxproj:
  • Configurations/ANGLE-dynamic.xcconfig:

Source/WebCore:

Covered by existing tests.

Moved OUTPUT_ALTERNATE_ROOT_PATH in create symlink script from outputFileListPaths to outputPaths.

  • WebCore.xcodeproj/project.pbxproj:

Source/WebGPU:

Moved OUTPUT_ALTERNATE_ROOT_PATH in create symlink script from outputFileListPaths to outputPaths.

  • WebGPU.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

Moved OUTPUT_ALTERNATE_ROOT_PATH in create symlink script from outputFileListPaths to outputPaths.

  • WebInspectorUI.xcodeproj/project.pbxproj:
11:36 AM Changeset in webkit [287325] by Antti Koivisto
  • 6 edits in trunk/Source/WebCore

REGRESSION(r286169): 0.3% Speedometer regression
https://bugs.webkit.org/show_bug.cgi?id=234549

Reviewed by Alan Bujtas.

There is some additional work in ChildChangeInvalidation even when :has is not used.
Speedemater2 Vanilla-* subtests are very heavy on DOM mutations.

  • style/ChildChangeInvalidation.cpp:

(WebCore::Style::ChildChangeInvalidation::invalidateForHasBeforeMutation):
(WebCore::Style::ChildChangeInvalidation::invalidateForHasAfterMutation):
(WebCore::Style::ChildChangeInvalidation::traverseRemovedElements):
(WebCore::Style::ChildChangeInvalidation::traverseAddedElements):
(WebCore::Style::ChildChangeInvalidation::ChildChangeInvalidation): Deleted.
(WebCore::Style::ChildChangeInvalidation::~ChildChangeInvalidation): Deleted.
(WebCore::Style::needsTraversal): Deleted.

  • style/ChildChangeInvalidation.h:

(WebCore::Style::ChildChangeInvalidation::ChildChangeInvalidation):
(WebCore::Style::ChildChangeInvalidation::~ChildChangeInvalidation):

Inline the constructor and destructor.
Compute the :has invalidation status only once.

  • style/RuleFeature.h:

(WebCore::Style::RuleFeatureSet::usesHasPseudoClass const):

  • style/StyleScope.cpp:

(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::updateActiveStyleSheets):

  • style/StyleScope.h:

(WebCore::Style::Scope::usesStyleBasedEditability const):
(WebCore::Style::Scope::usesHasPseudoClass const):

Add a Scope bit for this for faster testing.

(WebCore::Style::Scope::usesStyleBasedEditability): Deleted.

11:15 AM Changeset in webkit [287324] by weinig@apple.com
  • 7 edits in trunk/Source/WebCore

Gradient encode/decode does not validate that the serialized stops were sorted
https://bugs.webkit.org/show_bug.cgi?id=234558

Reviewed by Simon Fraser.

Stop encoding and decoding the stopsSorted bit on Gradient for serialization as
we still need to validate the stops are sorted on deserialization.

While here, optimize things a bit by allowing one to pass all the necessary
parameters to the Gradient create function, which allows us to avoid unnecessary
extra invalidation. Now that the GradientSpreadMethod can be set on construction
there is no need for its setter.

  • platform/graphics/Gradient.cpp:

(WebCore::Gradient::create):
(WebCore::Gradient::Gradient):
(WebCore::Gradient::sortStops const):
(WebCore::Gradient::setSpreadMethod): Deleted.

  • platform/graphics/Gradient.h:

(WebCore::Gradient::create):
(WebCore::Gradient::stops const):
(WebCore::Gradient::encode const):
(WebCore::Gradient::decode):

  • rendering/svg/RenderSVGResourceGradient.cpp:

(WebCore::RenderSVGResourceGradient::stopsByApplyingColorFilter):
(WebCore::RenderSVGResourceGradient::addStops): Deleted.

  • rendering/svg/RenderSVGResourceGradient.h:
  • rendering/svg/RenderSVGResourceLinearGradient.cpp:

(WebCore::RenderSVGResourceLinearGradient::buildGradient const):

  • rendering/svg/RenderSVGResourceRadialGradient.cpp:

(WebCore::RenderSVGResourceRadialGradient::buildGradient const):

10:34 AM Changeset in webkit [287323] by Simon Fraser
  • 5 edits
    9 adds in trunk

Allow a way to specify a custom pixel tolerance in a ref test
https://bugs.webkit.org/show_bug.cgi?id=149828

Reviewed by Martin Robinson.

Tools:

When determining if a ref test failed, look for <meta name=fuzzy> in the test file,
and if present, compare the actual pixel differences with the range allowed by the
fuzzy metadata. This may cause a failing reference to match, or a passing reference
(based on ImageDiff internal tolerance) to fail.

In the case of mismatch ref tests, the fuzziness is taken into account to determine
if the mismatch still occurs. If not, then the mismatch test fails.

  • Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:

(SingleTestRunner._fuzzy_tolerance_for_reference):
(SingleTestRunner._compare_output_with_reference):

LayoutTests:

Add some ref tests using <meta name=fuzzy> to test fuzzy-based passes and failures.

  • fast/harness/image-diff/fuzz-2-25-expected.html: Added.
  • fast/harness/image-diff/fuzz-2-25.html: Added.
  • fast/harness/image-diff/fuzz-2-36-over-expected-mismatch.html: Added.
  • fast/harness/image-diff/fuzz-2-36-over.html: Added.
  • fast/harness/image-diff/fuzz-2-36-under-expected-mismatch.html: Added.
  • fast/harness/image-diff/fuzz-2-36-under.html: Added.
  • fast/harness/image-diff/zero-fuzz-expected.html: Added.
  • fast/harness/image-diff/zero-fuzz.html: Added.
10:31 AM Changeset in webkit [287322] by Kate Cheney
  • 3 edits in trunk/Source/WebKit

Harden PCM and ITP databases against crashes
https://bugs.webkit.org/show_bug.cgi?id=234528
<rdar://problem/86741319>

Reviewed by Brent Fulgham.

This patch does two things. First, it specifies a column type for the
new destination token, keyID and signature columns. This was causing
the crashes in rdar://86347439 by comparing the defined CREATE TABLE query
with types to the existing query with no types. Second, it adds
hardening to the migration code to abort migration if one of the steps
fails. This will help prevent future crashes like rdar://86347439
by aborting a migration early if a failure occurs and not leaving the
db in a messy state.

No new tests. No behavior change, this will harden against flaky issues
that may cause a migration to fail part way through, like I/O errors.

  • NetworkProcess/DatabaseUtilities.cpp:

(WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary):

  • NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:

(WebKit::PCM::Database::addDestinationTokenColumnsIfNecessary):

10:17 AM Changeset in webkit [287321] by Wenson Hsieh
  • 31 edits
    3 copies
    1 move in trunk/Source

Add support for a UI delegate method to decide how to handle detected modal containers
https://bugs.webkit.org/show_bug.cgi?id=234440
rdar://77073735

Reviewed by Darin Adler.

Source/WebCore:

Move ModalContainerControlType.h to ModalContainerTypes.h, and add a new enum flag to represent return values in
the new UI delegate decision handler.

  • Headers.cmake:
  • WebCore.xcodeproj/project.pbxproj:
  • loader/DocumentLoader.h:

Additionally remove the unused Allow and Disallow values of ModalContainerObservationPolicy, now that we will
always (effectively) "prompt" when detecting a modal container by calling into the client layer with the new
delegate method.

  • loader/EmptyClients.cpp:

(WebCore::EmptyChromeClient::decidePolicyForModalContainer):

  • loader/EmptyClients.h:
  • page/ChromeClient.h:

Add the new async chrome client hook, decidePolicyForModalContainer().

  • page/ModalContainerObserver.cpp:

(WebCore::ModalContainerObserver::collectClickableElementsTimerFired):

Call into the chrome client to decide how to handle the observed modal container.

(WebCore::ModalContainerObserver::revealModalContainer:

Add a helper method to reset the current m_container and invalidate its style (such that it will be displayed
after the next style update).

  • page/ModalContainerTypes.h: Renamed from Source/WebCore/page/ModalContainerControlType.h.

Also, tweak the ModalContainerControlType values so that they can be used as option flags when informing the
WebKit client about which control types are present in the modal container.

Source/WebKit:

Add support for a new UI delegate method, -_webView:decidePolicyForModalContainer:decisionHandler:, that is
invoked when a modal container has been detected and suppressed due to a WebKit client specifying the
_WKWebsiteModalContainerObservationPolicyPrompt option in webpage preferences. This new delegate method is
invoked with a new _WKModalContainerInfo object, which (for now) just encapsulates an option set of
ModalContainerControlTypes that indicates which types of modal containers are available.

  • Scripts/webkit/messages.py:

(headers_for_type):

  • SourcesCocoa.txt:
  • UIProcess/API/APIUIClient.h:

(API::UIClient::decidePolicyForModalContainer):

  • UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
  • UIProcess/API/Cocoa/WKWebpagePreferences.mm:

(WebKit::modalContainerObservationPolicy):
(WebKit::coreModalContainerObservationPolicy):

  • UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:

Remove support for two unused policy flags, _WKWebsiteModalContainerObservationPolicyAllow and
_WKWebsiteModalContainerObservationPolicyDisallow. These are now obviated by the new decision handler return
values _WKModalContainerDecisionHideAndAllow and _WKModalContainerDecisionHideAndDisallow, respectively.
While this leaves us with only two policy modes (such that the policy can now be turned into a single BOOL
switch), I'm keeping the named enum flags for now, since:

  1. The existing names do a better job of describing their respective behaviors than a single BOOL flag like

modalContainerObserverShouldPrompt, or modalContainerObserverEnabled, and...

  1. We'll probably need to extend this policy set to add a new value in the near future, anyways.
  • UIProcess/API/Cocoa/_WKModalContainerInfo.h:
  • UIProcess/API/Cocoa/_WKModalContainerInfo.mm:

(-[_WKModalContainerInfo initWithTypes:]):

  • UIProcess/API/Cocoa/_WKModalContainerInfoInternal.h:
  • UIProcess/Cocoa/ModalContainerControlClassifier.mm:
  • UIProcess/Cocoa/UIDelegate.h:
  • UIProcess/Cocoa/UIDelegate.mm:

(WebKit::UIDelegate::setDelegate):
(WebKit::coreModalContainerDecision):
(WebKit::UIDelegate::UIClient::decidePolicyForModalContainer):

Add plumbing for the new chrome client hook through WebChromeClient, WebPage, WebPageProxy, and finally the UI
client.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::decidePolicyForModalContainer):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::decidePolicyForModalContainer):

  • WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WebKitLegacy/mac:

See WebKit ChangeLog for more details.

  • WebCoreSupport/WebChromeClient.h:
  • WebCoreSupport/WebChromeClient.mm:

(WebChromeClient::decidePolicyForModalContainer):

Source/WebKitLegacy/win:

See WebKit ChangeLog for more details.

  • WebCoreSupport/WebChromeClient.h:
  • WebCoreSupport/WebChromeClient.cpp:

(WebChromeClient::decidePolicyForModalContainer):

9:58 AM Changeset in webkit [287320] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[LFC][IFC] Move enclosing line geometry computation to a dedicated function
https://bugs.webkit.org/show_bug.cgi?id=234537

Reviewed by Antti Koivisto.

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

  • layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:

(WebCore::Layout::InlineDisplayLineBuilder::collectEnclosingLineGeometry const):
(WebCore::Layout::InlineDisplayLineBuilder::build const):
(WebCore::Layout::InlineDisplayLineBuilder::build): Deleted.

  • layout/formattingContexts/inline/display/InlineDisplayLineBuilder.h:
9:46 AM Changeset in webkit [287319] by Alan Coon
  • 1 edit in branches/safari-612-branch/Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp

Apply patch. rdar://86742929

9:17 AM Changeset in webkit [287318] by Alan Coon
  • 1 edit in branches/safari-612-branch/Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp

Apply patch. rdar://86742929

8:46 AM Changeset in webkit [287317] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[LFC][IFC] Start using Display::Line geometry in InlineDisplayContentBuilder
https://bugs.webkit.org/show_bug.cgi?id=234532

Reviewed by Antti Koivisto.

This is in preparation for using Display::Line geometry for things like contentStartInVisualOrder in InlineDisplayContentBuilder.

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::build):
(WebCore::Layout::InlineDisplayContentBuilder::processNonBidiContent):
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h:
8:28 AM Changeset in webkit [287316] by achristensen@apple.com
  • 6 edits in trunk

ASSERT NOT REACHED under WebKit::Daemon::ConnectionToMachService seen with TestWebKitAPI.WebPushD.BasicCommunication and PermissionManagement
https://bugs.webkit.org/show_bug.cgi?id=232857

Reviewed by Darin Adler.

Source/WebKit:

When using the public SDK, don't code sign with an entitlements file that contains restricted entitlements,
otherwise webpushd won't launch. Also, don't compile files we aren't going to use.

  • Configurations/webpushd.xcconfig:
  • WebKit.xcodeproj/project.pbxproj:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

(TestWebKitAPI::TEST):

8:09 AM Changeset in webkit [287315] by J Pascoe
  • 5 edits
    1 add in trunk

[WebAuthn] Authenticator is not falling back to clientPIN after internal verification fails and is blocked.
https://bugs.webkit.org/show_bug.cgi?id=232501
<rdar://problem/84913636>

Reviewed by Darin Adler.

Whenever internal uv gets blocked, the user agent should fall back to using a pin for user verification. This
Source/WebKit:

patch starts doing that by going into the pin flow whenever the authenticator returns the pin required error
code.

Added API test for fallback.

  • UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:

(WebKit::CtapAuthenticator::makeCredential):
(WebKit::CtapAuthenticator::getAssertion):
(WebKit::CtapAuthenticator::tryRestartPin):

Tools:

adds an API test to verify this behavior.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:

(TestWebKitAPI::TEST):

8:01 AM Changeset in webkit [287314] by Alan Bujtas
  • 5 edits in trunk/Source/WebCore

[LFC][IFC] Display content builder should take Display::Line
https://bugs.webkit.org/show_bug.cgi?id=234527

Reviewed by Antti Koivisto.

This is preparation for using Display::Line visual geometries when constructing Display::Boxes in InlineDisplayContentBuilder.

  • layout/formattingContexts/inline/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::build):
(WebCore::Layout::InlineDisplayContentBuilder::processNonBidiContent):
(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):
(WebCore::Layout::InlineDisplayContentBuilder::processOverflownRunsForEllipsis):

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h:
  • layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:

(WebCore::Layout::InlineDisplayLineBuilder::build):

  • layout/integration/LayoutIntegrationCoverage.cpp:

(WebCore::LayoutIntegration::canUseForStyle):

6:07 AM Changeset in webkit [287313] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

IPC streams should not accept 0-length stream buffers
https://bugs.webkit.org/show_bug.cgi?id=234552
<rdar://79725420>

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-12-21
Reviewed by Antti Koivisto.

Make decoding 0-length stream buffers fail. These buffers are not useful.

No new tests, tests need additional implementation, will be added
in subsequent commits.

  • Platform/IPC/StreamConnectionBuffer.cpp:

(IPC::StreamConnectionBuffer::StreamConnectionBuffer):
(IPC::StreamConnectionBuffer::decode):

5:29 AM Changeset in webkit [287312] by commit-queue@webkit.org
  • 2 edits
    1 add in trunk/Source/ThirdParty/ANGLE

[GTK] build fails with undefined symbol in ANGLE if USE_ANGLE_WEBGL is enabled.
https://bugs.webkit.org/show_bug.cgi?id=234239

Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-12-21
Reviewed by Kenneth Russell.

Add a new linux.cmake file that defines angle_dma_buf_sources.
This list gets appended it into ANGLE_SOURCES in PlatformGTK.cmake.

  • linux.cmake: Added. Manual translation of src/common/linux/BUILD.gn.
  • PlatformGTK.cmake:
4:54 AM Changeset in webkit [287311] by commit-queue@webkit.org
  • 9 edits in trunk/Source/JavaScriptCore

[RISCV64] Add or enable missing CPU(RISCV64) codepaths in baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=234551

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-21
Reviewed by Yusuke Suzuki.

Sprinkle the necessary CPU(RISCV64) build guards as well as additional
RISCV64-specific codepaths encapsualted by those build guards in the
baseline JIT code. In many cases we can align with the code that ARM64
is already using.

In InlineAccess, the byte-sizes for access and replacement operations
are based on a mix of educated guessing and aggressive testing.

In baseline JIT, we can usually adopt what ARM64 already does since the
similarities are big enough.

  • bytecode/InlineAccess.h: The sizes here are based on the estimated

count of necessary instructions for access or replacement, and were
tested with the enabled crash-inducing fallback in linkCodeInline().
(JSC::InlineAccess::sizeForPropertyAccess):
(JSC::InlineAccess::sizeForPropertyReplace):
(JSC::InlineAccess::sizeForLengthAccess):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::emitLoadStructure):
(JSC::AssemblyHelpers::debugCall):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::emitSaveThenMaterializeTagRegisters):
(JSC::AssemblyHelpers::emitRestoreSavedTagRegisters):
(JSC::AssemblyHelpers::prologueStackPointerDelta):
(JSC::AssemblyHelpers::emitFunctionPrologue):
(JSC::AssemblyHelpers::emitFunctionEpilogueWithEmptyFrame):
(JSC::AssemblyHelpers::emitFunctionEpilogue):
(JSC::AssemblyHelpers::preserveReturnAddressAfterCall):
(JSC::AssemblyHelpers::restoreReturnAddressBeforeReturn):

  • jit/CCallHelpers.h:

(JSC::CCallHelpers::prepareForTailCallSlow):

  • jit/CallFrameShuffler.cpp:

(JSC::CallFrameShuffler::prepareForTailCall):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::slow_op_resolve_scopeGenerator):
(JSC::JIT::slow_op_get_from_scopeGenerator):

  • jit/RegisterSet.cpp:

(JSC::RegisterSet::macroScratchRegisters):
(JSC::RegisterSet::dfgCalleeSaveRegisters):
(JSC::RegisterSet::ftlCalleeSaveRegisters):

  • jit/ThunkGenerators.cpp:

(JSC::popThunkStackPreservesAndHandleExceptionGenerator):

4:42 AM Changeset in webkit [287310] by weinig@apple.com
  • 29 edits
    1 copy
    6 adds in trunk

Add support for premultiplied alpha interpolated gradients and defaulted off option to use them for CSS Gradients
https://bugs.webkit.org/show_bug.cgi?id=234492

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/gradients/alpha-premultiplied.html

fast/gradients/conic-gradient-alpha-unpremultiplied.html

Extracts use of CGGradientRef out of Gradient and into the new GradientRendererCG which also implements
a CGShadingRef based gradient drawing path. The GradientRendererCG picks which strategy, CGGradientRef
or CGShadingRef, based on the intepolation mode and capabilities of the underlying CoreGraphics. For
new enough CoreGraphics, both premultiplied and non-premultiplied alpha interpolation for sRGB output
are supported in the more optimizable CGGradientRef path, but on older systems we will fallback to a
a newly implemented CGShadingRef based implementation.

In addition to the platform level work in Gradient, this adds a new setting, CSSGradientPremultipliedAlphaInterpolationEnabled,
which defaults to off for now and switches what type of interpolation we use for CSS gradients. It
does not effect other gradient uses such as by canvas or SVG. Those will be enabled separately.

  • Headers.cmake:
  • PlatformAppleWin.cmake:
  • PlatformMac.cmake:
  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:

Add new files.

  • css/CSSGradientValue.cpp:

(WebCore::LinearGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
(WebCore::RadialGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
(WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
(WebCore::CSSGradientValue::computeStops):
Switch to using the new interpolateColors() function from ColorInterpolation.h
which accurately takes into account the current interpolation mode. These
blends now match what the created gradient does.

  • css/parser/CSSParserContext.cpp:
  • css/parser/CSSParserContext.h:

Add support for querying CSSGradientPremultipliedAlphaInterpolationEnabled from the CSS parser.

  • css/parser/CSSPropertyParserHelpers.cpp:

(WebCore::CSSPropertyParserHelpers::gradientAlphaPremultiplication):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
(WebCore::CSSPropertyParserHelpers::consumeConicGradient):
Depending on how CSSGradientPremultipliedAlphaInterpolationEnabled is set, use either premultiplied
or non-premultiplied interpolation for CSS gradients.

  • platform/graphics/ColorComponents.h:

(WebCore::ColorComponents::size const):
Add size() function for use by the shading strategy.

  • platform/graphics/ColorInterpolation.h:

(WebCore::preInterpolationNormalizationForComponent):
(WebCore::preInterpolationNormalization):
(WebCore::postInterpolationNormalizationForComponent):
(WebCore::postInterpolationNormalization):
(WebCore::interpolateColorComponents):
Update to use the name InterpolationMethodColorSpace consistenly for the color space part of the
interpolation method.

(WebCore::interpolateColors):
Add helper which takes and returns Color objects rather than the strongly typed color types,
automatically converting to the appropriate interpolation color space based on the provided
ColorInterpolationMethod object.

  • platform/graphics/Gradient.h:
  • platform/graphics/GradientColorStop.h: Added.

Move ColorStop and ColorStopVector defintions to new GradientColorStop file, but keep the
old nested names via using directives. This is needed to make using the ColorStopVector
from GradientRendererCG (which we also want to use in Gradient.h) possible without redeclaration.
Replace CGGradientRef member with GradientRendererCG which allows choosing between either
a CGGradientRef based implementation or CGShadingRef based one.

  • platform/graphics/cg/GradientCG.cpp:

Update to use the GradientRendererCG rathern than a CGGradientRef directly, calling into it
to do the actual draw calls.

  • platform/graphics/cg/GradientRendererCG.h: Added.
  • platform/graphics/cg/GradientRendererCG.cpp: Added.

(WebCore::GradientRendererCG::pickStrategy const):
Central function to choose which strategy to use based on system capabilities and interpolation needs.

(WebCore::GradientRendererCG::makeGradient const):
Moved from GradientCG.cpp. Removed the CGGradientCreateWithColors() path, as we can always use the
more efficient CGGradientCreateWithColorComponents() by doing the conversion to extended sRGB ourselves.
Also adds use of the kCGGradientInterpolatesPremultiplied option on supported systems to tell CoreGraphics
to use premulitplied interpolation.

(WebCore::shadingFunction):
Core function used by CGShadingRef to interpolate between color stops. Templatized to allow for optimized
versions for every ColorInterpolationColorSpace / AlphaPremultiplication pair.

(WebCore::GradientRendererCG::makeShading const):
Builds shading strategy by converting all color stops to the interpolation color space, adding stops at
0 and 1 if necessary, and creating the CGFunctionRef that the shading will own. To avoid a circular
reference, the GradientRendererCG itself is not what the CGFunctionRef retains, but rather a subobject
Data, which is a peer to the CGFunctionRef.

(WebCore::GradientRendererCG::drawLinearGradient):
(WebCore::GradientRendererCG::drawRadialGradient):
(WebCore::GradientRendererCG::drawConicGradient):
Draw the gradient or shading based on the strategy selected at construction.

Source/WebCore/PAL:

  • pal/spi/cg/CoreGraphicsSPI.h:

Add forwards for creating conic shadings and enabling premultiplied alpha interpolation for gradients.

Source/WebKitLegacy/win:

Add support for tests enabling the CSSGradientPremultipliedAlphaInterpolationEnabled preference.

  • WebPreferences.cpp:

(WebPreferences::cssGradientPremultipliedAlphaInterpolationEnabled):

  • WebPreferences.h:
  • WebView.cpp:

(WebView::notifyPreferencesChanged):

Source/WTF:

  • Scripts/Preferences/WebPreferencesExperimental.yaml:

Add a new experimental setting to enable premultiplied alpha CSS gradients.

Tools:

  • DumpRenderTree/TestOptions.cpp:

(WTR::TestOptions::defaults):
Add default for Windows WebKitLegacy testing which still requires it.

LayoutTests:

Add and update tests for gradients with alpha now that we have support for premultiplied interpolation.
By default, the tests now enable premultiplied interpolation (since it is an experimental feature) so
to continue testing the old path, the setting must be explicitly disabled.

  • fast/gradients/alpha-premultiplied-expected.html: Added.
  • fast/gradients/alpha-premultiplied.html: Added.
  • fast/gradients/conic-gradient-alpha-expected.html:
  • fast/gradients/conic-gradient-alpha-unpremultiplied-expected.html: Added.
  • fast/gradients/conic-gradient-alpha-unpremultiplied.html: Added.
4:38 AM Changeset in webkit [287309] by ntim@apple.com
  • 4 edits in trunk

<dialog> should generate implied end tags
https://bugs.webkit.org/show_bug.cgi?id=234442

Reviewed by Antti Koivisto.

See references to dialog in: https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody

LayoutTests/imported/w3c:

  • web-platform-tests/html/syntax/parsing/html5lib_blocks-expected.txt:

Source/WebCore:

Test: web-platform-tests/html/syntax/parsing/html5lib_blocks-expected.txt

  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::HTMLTreeBuilder::processStartTagForInBody):
<p>XXX<dialog></dialog> turns into: <p>XXX</p><dialog></dialog>

(WebCore::HTMLTreeBuilder::processEndTagForInBody):
<dialog><p>XXX</dialog> turns into: <dialog><p>XXX</p></dialog>

2:33 AM Changeset in webkit [287308] by ysuzuki@apple.com
  • 9 edits
    2 deletes in trunk/Source

[WTF] Remove RefCountedArray and use RefCountedFixedVector
https://bugs.webkit.org/show_bug.cgi?id=234484

Reviewed by Dean Jackson.

Source/WebCore:

Use RefCountedFixedVector intead. No semantic change.

  • layout/integration/InlineIteratorBoxLegacyPath.h:
  • platform/graphics/FontCascadeDescription.cpp:

(WebCore::FontCascadeDescription::FontCascadeDescription):

  • platform/graphics/FontCascadeDescription.h:

(WebCore::FontCascadeDescription::familyCount const):
(WebCore::FontCascadeDescription::familyAt const):
(WebCore::FontCascadeDescription::families const):
(WebCore::FontCascadeDescription::setOneFamily):
(WebCore::FontCascadeDescription::setFamilies):
(WebCore::FontCascadeDescription::operator== const):

Source/WTF:

Use RefCountedFixedVector<T> instead of RefCountedArray<T> and remove RefCountedArray<T>.
RefCountedFixedVector<T> is much simpler interface: it is just using Ref<> / RefPtr<>
instead of integrating ref-counting holder semantics into the class itself.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/CMakeLists.txt:
  • wtf/FixedVector.h:
  • wtf/RefCountedArray.cpp: Removed.
  • wtf/RefCountedArray.h: Removed.
  • wtf/WTFAssertions.cpp:
2:16 AM Changeset in webkit [287307] by youenn@apple.com
  • 2 edits in trunk/Source/WebCore

REGRESSION (r287258): Flaky crash in WebCore::RTCRtpScriptTransformer::enqueueFrame
https://bugs.webkit.org/show_bug.cgi?id=234522
<rdar://problem/86736206>

Reviewed by Darin Adler.

Covered by tests no longer crashing.

  • Modules/mediastream/RTCRtpScriptTransformer.cpp:

(WebCore::RTCRtpScriptTransformer::enqueueFrame):
Add a null check in enqueueFrame since the transformer may be cleared during the time
of hopping from webrtc frame thread to worker thread.

2:06 AM Changeset in webkit [287306] by yoshiaki.jitsukawa@sony.com
  • 11 edits
    2 adds in trunk/Source/WebCore

[LCMS] Use std::unqiue_ptr to retain LCMS objects
https://bugs.webkit.org/show_bug.cgi?id=234506

Reviewed by Michael Catanzaro.

  • platform/graphics/lcms/LCMSUniquePtr.h: Added.

Add LCMSUniquePtr.h and specialize std::unique_ptr with deleters.
LCMSProfilePtr is for cmsHPROFILE with cmsCloseProfile() as the deleter.
LCMSTransformPtr is for cmsHTRANSFORM with cmsDeleteTransform() as the deleter.

  • CMakeLists.txt:

Add WebCore/platform/graphics/lcms to WebCore_PRIVATE_INCLUDE_DIRECTORIES.
Add LCMSUniquePtr.h to WebCore_PRIVATE_FRAMEWORK_HEADERS.

  • platform/graphics/PlatformDisplay.cpp:
  • platform/graphics/PlatformDisplay.h:
  • platform/graphics/x11/PlatformDisplayX11.cpp:

Use LCMSProfilePtr to retain ICC Profile.

  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
  • platform/image-decoders/jpeg/JPEGImageDecoder.h:
  • platform/image-decoders/jpegxl/JPEGXLImageDecoder.cpp:
  • platform/image-decoders/jpegxl/JPEGXLImageDecoder.h:
  • platform/image-decoders/png/PNGImageDecoder.cpp:
  • platform/image-decoders/png/PNGImageDecoder.h:

Use LCMSProfilePtr to retain color transform.
Remove the m_iccProfile class member because m_iccTransform also retains a
reference to the LCMS's profile and m_iccProfile can be removed.

12:54 AM Changeset in webkit [287305] by commit-queue@webkit.org
  • 2 edits in trunk/Source/JavaScriptCore

[RISCV64] Add missing MacroAssemblerRISCV64 floating-point rounding, comparison methods
https://bugs.webkit.org/show_bug.cgi?id=234475

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-21
Reviewed by Yusuke Suzuki.

Add missing MacroAssemblerRISCV64 methods that cover floating-point
rounding and comparison operations. Manually detecting NaN values is
possible by classifying floating-point values, and subsequently
rounding operation or different comparison conditions have to be
handled appropriately.

Single-precision and double-precision implementations can neatly be
handled in singular templated helper methods, and precision-specific
codepaths can be determined at compile-time.

  • assembler/MacroAssemblerRISCV64.h:

(JSC::MacroAssemblerRISCV64::ceilFloat):
(JSC::MacroAssemblerRISCV64::ceilDouble):
(JSC::MacroAssemblerRISCV64::floorFloat):
(JSC::MacroAssemblerRISCV64::floorDouble):
(JSC::MacroAssemblerRISCV64::roundTowardNearestIntFloat):
(JSC::MacroAssemblerRISCV64::roundTowardNearestIntDouble):
(JSC::MacroAssemblerRISCV64::roundTowardZeroFloat):
(JSC::MacroAssemblerRISCV64::roundTowardZeroDouble):
(JSC::MacroAssemblerRISCV64::compareFloat):
(JSC::MacroAssemblerRISCV64::compareDouble):
(JSC::MacroAssemblerRISCV64::roundFP):
(JSC::MacroAssemblerRISCV64::compareFP):

12:46 AM Changeset in webkit [287304] by Carlos Garcia Campos
  • 7 edits in trunk

[GTK][a11y] Implement list markers when building with ATSPI
https://bugs.webkit.org/show_bug.cgi?id=234485

Reviewed by Adrian Perez de Castro.

Source/WebCore:

For list item markers in ATSPI we are following the chromium approach, exposing the markers as hyperlinks, so
included in the list item text string as the object replacement character. This approach also allows to expose
image markers. Since we don't have a list marker role in ATSPI, we use either text or image roles. New methods
have been added to get the role, role name and localized role name for the cases in which there isn't a direct
match between the webcore role and the atspi role.

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::stringValue const): In ATSPI we want the text with suffix.

  • accessibility/atspi/AccessibilityObjectAtspi.cpp:

(WebCore::AccessibilityObjectAtspi::interfacesForObject): Make item markers implement hyperlink interface and
either text or image.
(WebCore::atspiRole): Assert if ListMarker role is passed since that's no longer possible.
(WebCore::AccessibilityObjectAtspi::effectiveRole const): Handle the ListMarker role as special case case.
(WebCore::AccessibilityObjectAtspi::role const): Check if there's an effective role first.
(WebCore::AccessibilityObjectAtspi::effectiveRoleName const): Handle effective role here.
(WebCore::AccessibilityObjectAtspi::roleName const): Check if there's an effective role first.
(WebCore::AccessibilityObjectAtspi::effectiveLocalizedRoleName const): Handle effective role here.
(WebCore::AccessibilityObjectAtspi::localizedRoleName const): Check if there's an effective role first.

  • accessibility/atspi/AccessibilityObjectAtspi.h:
  • accessibility/atspi/AccessibilityObjectTextAtspi.cpp:

(WebCore::AccessibilityObjectAtspi::text const): Remove the main thread micro-optimization to avoid more
duplicated code and insert the object replacement character for list items having a marker.
(WebCore::adjustInputOffset): Helper function to adjust the input offset in case of having a list item marker.
(WebCore::adjustOutputOffset): Helper function to adjust the output offset in case of having a list item marker.
(WebCore::AccessibilityObjectAtspi::textInserted): Use adjustOutputOffset().
(WebCore::AccessibilityObjectAtspi::textDeleted): Ditto.
(WebCore::AccessibilityObjectAtspi::boundaryOffset const): Adjust offsets and handle words as special case to
always consider the list marker as a word.
(WebCore::AccessibilityObjectAtspi::offsetAtPoint const): Use adjustOutputOffset().
(WebCore::AccessibilityObjectAtspi::textAttributes const): Adjust offsets and handle list item marker as special
case to always consider the marker as an independent text run.

Tools:

Add test cases to check list item markers.

  • TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp:

(testAccessibleListMarkers):
(testTextListMarkers):
(testHyperlinkBasic):
(testHypertextBasic):
(beforeAll):

12:45 AM Changeset in webkit [287303] by Carlos Garcia Campos
  • 21 edits in trunk

CSP: Include the sample in eval violation reports
https://bugs.webkit.org/show_bug.cgi?id=234390

Reviewed by Kate Cheney.

LayoutTests/imported/w3c:

Update expectations.

  • web-platform-tests/content-security-policy/securitypolicyviolation/script-sample-expected.txt:

Source/JavaScriptCore:

  • interpreter/Interpreter.cpp:

(JSC::eval): Pass the code to reportViolationForUnsafeEval().

  • runtime/DirectEvalExecutable.cpp:

(JSC::DirectEvalExecutable::create): Ditto.

  • runtime/FunctionConstructor.cpp:

(JSC::stringifyFunction): Helper function with the code to stringify function to be called also for the csp
violation report.
(JSC::constructFunction): Call stringifyFunction() to get the code for reportViolationForUnsafeEval().
(JSC::constructFunctionSkippingEvalEnabledCheck): Use stringifyFunction().

  • runtime/IndirectEvalExecutable.cpp:

(JSC::IndirectEvalExecutable::createImpl): Pass the code to reportViolationForUnsafeEval().

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::reportViolationForUnsafeEval): Add string parameter for the code sample.

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION): Pass the code to reportViolationForUnsafeEval().

Source/WebCore:

  • bindings/js/JSDOMWindowBase.cpp:

(WebCore::JSDOMWindowBase::reportViolationForUnsafeEval): Handle the source parameter and pass it to allowEval().

  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSWorkerGlobalScopeBase.cpp:

(WebCore::JSWorkerGlobalScopeBase::reportViolationForUnsafeEval): Handle the source parameter.

  • bindings/js/JSWorkerGlobalScopeBase.h:
  • bindings/js/JSWorkletGlobalScopeBase.cpp:

(WebCore::JSWorkletGlobalScopeBase::reportViolationForUnsafeEval): Ditto.

  • bindings/js/JSWorkletGlobalScopeBase.h:
  • bindings/js/ScheduledAction.h:

(WebCore::ScheduledAction::code const): Return the code.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::setTimeout): Pass the code to allowEval().
(WebCore::DOMWindow::setInterval): Ditto.

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::ContentSecurityPolicy::allowEval const): Handle codeContent parameter and pass it to reportViolation().
(WebCore::ContentSecurityPolicy::reportViolation const): Ditto.

  • page/csp/ContentSecurityPolicy.h:
  • workers/WorkerGlobalScope.cpp:

(WebCore::WorkerGlobalScope::setTimeout): Pass the code to allowEval().
(WebCore::WorkerGlobalScope::setInterval): Ditto.

12:35 AM Changeset in webkit [287302] by commit-queue@webkit.org
  • 2 edits in trunk/Source/JavaScriptCore

[RISCV64] Add basic MacroAssemblerRISCV64 branching methods
https://bugs.webkit.org/show_bug.cgi?id=234474

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-21
Reviewed by Yusuke Suzuki.

Add MacroAssemblerRISCV64 implementations for the basic branching
methods. RelationalCondition enum values are aliased to the branching
condition values in RISCV64Assembler. The makeBranch() helper method
is added that generates the final branching instruction for the given
condition and the two registers holding values for the comparison and
returns the Jump object based on the label constructed at the location
of the branching placeholder.

Branching methods essentially consist of preparing the two registers
and calling the makeBranch() method. For 8-bit and 32-bit comparisons
the compared values have to be sign-extended into the scratch registers
because the branching instructions don't operate on partial values. This
might cause friction in higher JIT levels where the use of scratch
registers is disallowed.

  • assembler/MacroAssemblerRISCV64.h:

(JSC::MacroAssemblerRISCV64::invert):
(JSC::MacroAssemblerRISCV64::branch8):
(JSC::MacroAssemblerRISCV64::branch32):
(JSC::MacroAssemblerRISCV64::branch64):
(JSC::MacroAssemblerRISCV64::branch32WithUnalignedHalfWords):
(JSC::MacroAssemblerRISCV64::makeBranch):

12:33 AM Changeset in webkit [287301] by commit-queue@webkit.org
  • 9 edits in trunk/Source/JavaScriptCore

[JSC][ARMv7] Minor code size improvements
https://bugs.webkit.org/show_bug.cgi?id=234387

Patch by Geza Lore <Geza Lore> on 2021-12-21
Reviewed by Yusuke Suzuki.

A few mew code size improvements to ARMv7/Thumb-2

  • Use ldrd/strd in mode places (via AssemblyHelpers:loadValue

and AssemblyHelpers::storeValue)

  • Use BIC immediate instruction instead of AND where appropriate
  • Use a 2-byte ADDS instead of a 4-byte CMN when possible. This

applies very often as it handles testing JSValue tags.

  • Use addressTempRegister in branch32

Overall saving of about 3.5% code size on JetStream2, according to
--dumpLinkBufferStats.

  • assembler/ARMv7Assembler.h:

(JSC::ARMv7Assembler::bic):

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::and32):
(JSC::MacroAssemblerARMv7::storePair32):
(JSC::MacroAssemblerARMv7::compare32AndSetFlags):
(JSC::MacroAssemblerARMv7::branch32):

  • assembler/MacroAssemblerMIPS.h:

(JSC::MacroAssemblerMIPS::storePair32):

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateImpl):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::compileExit):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::fillJSValue):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compile):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::storeValue):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_mov):

12:28 AM Changeset in webkit [287300] by Fujii Hironori
  • 2 edits in trunk/Source/WebCore

MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return type 'T *' for overloaded 'operator ->'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234546

Reviewed by Alex Christensen.

  • svg/properties/SVGPropertyAnimator.h:

(WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):
computeCSSPropertyValue protects the first arguemnt SVGElement.
computeInheritedCSSPropertyValue doesn't need to protect "parent".
Use Element* instead of RefPtr for "parent".

Dec 20, 2021:

11:19 PM Changeset in webkit [287299] by Fujii Hironori
  • 2 edits in trunk/Source/WebCore

[Win] MSVC reports "DownloadBundleWin.cpp(87): error C2362: initialization of 'magic' is skipped by 'goto exit'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234504

Reviewed by Alex Christensen.

  • platform/network/win/DownloadBundleWin.cpp:

(WebCore::DownloadBundle::appendResumeData):
(WebCore::DownloadBundle::extractResumeData):
Removed goto statements. Use std::unique_ptr for FILE*.

10:22 PM Changeset in webkit [287298] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

REGRESSION: [ iOS ] 5 TestWebKitAPI.WebpagePreferences.* api tests are flaky timing out
https://bugs.webkit.org/show_bug.cgi?id=229094

Patch by Alex Christensen <achristensen@webkit.org> on 2021-12-20
Reviewed by Darin Adler.

The tests don't seem to time out any more. Let's try re-enabling them.

  • TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

(TEST):

8:52 PM Changeset in webkit [287297] by Fujii Hironori
  • 2 edits in trunk/Tools

[Win] MSVC reports "DumpRenderTree.cpp(633): error C2362: initialization of 'length' is skipped by 'goto exit'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234503

Reviewed by Don Olmstead.

  • DumpRenderTree/win/DumpRenderTree.cpp:

(dumpHistoryItem): Removed goto statements. Use std::unique_ptr for SAFEARRAY.

7:09 PM Changeset in webkit [287296] by Wenson Hsieh
  • 5 edits
    2 adds in trunk/Source/WebKit

Add ModalContainerControlClassifier and use it to implement classifyModalContainerControls()
https://bugs.webkit.org/show_bug.cgi?id=234322

Reviewed by Devin Rousso.

Introduce and implement ModalContainerControlClassifier. This singleton uses the NaturalLanguage and CoreML
frameworks on Cocoa to classify strings as one of four modal container control types. See below for more
details.

  • SourcesCocoa.txt:
  • UIProcess/Cocoa/ModalContainerControlClassifier.h: Added.
  • UIProcess/Cocoa/ModalContainerControlClassifier.mm: Added.

(-[WKModalContainerClassifierBatch initWithRawInputs:]):
(-[WKModalContainerClassifierBatch count]):
(-[WKModalContainerClassifierBatch featuresAtIndex:]):
(-[WKModalContainerClassifierInput initWithTokenizer:rawInput:]):
(-[WKModalContainerClassifierInput featureNames]):
(-[WKModalContainerClassifierInput featureValueForName:]):

Add Objective-C objects that implement the MLBatchProvider and MLFeatureProvider protocols, respectively.
WKModalContainerClassifierBatch is essentially a wrapper around a list of WKModalContainerClassifierInput; each
WKModalContainerClassifierInput is initialized with a raw string, and uses NLTokenizer to filter out non-word
characters and tokenize the raw input into a single space-separated, lower case string (referred to as the
"canonical" input format).

(WebKit::ModalContainerControlClassifier::ModalContainerControlClassifier):
(WebKit::ModalContainerControlClassifier::sharedClassifier):

Return the singleton instance (this must be accessed on the main thread).

(WebKit::computePredictions):

Static helper method that takes a list of strings and an MLModel, and classifies each string using the model,
and the Objective-C helper classes above.

(WebKit::ModalContainerControlClassifier::classify):

This method exposes the primary functionality of the classifier, which is to take a list of raw strings
representing text in clickable controls, and asynchronously return a list of class labels representing the
predicted control type for each of the strings. Note that this method needs to be invoked on the main thread
(and will also invoke the completion handler on the main thread), but the process of loading the MLModel and
using it to predict input strings is done in a work queue ("com.apple.WebKit.ModalContainerControlClassifier").

(WebKit::ModalContainerControlClassifier::loadModelIfNeeded):

Load the MLModel from a predetermined bundle resource name; returns immediately if the model has
already been created. While this happens synchronously, this is always invoked on a background queue and never
blocks the main thread.

  • UIProcess/Cocoa/WebPageProxyCocoa.mm:

(WebKit::WebPageProxy::classifyModalContainerControls):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::classifyModalContainerControls):

  • WebKit.xcodeproj/project.pbxproj:
6:30 PM Changeset in webkit [287295] by jonlee@apple.com
  • 2 edits in trunk/LayoutTests

Unreviewed, garden GPU Process test expectations

  • gpu-process/TestExpectations:
6:25 PM Changeset in webkit [287294] by commit-queue@webkit.org
  • 55 edits in trunk/Source

[WebIDL] convertVariadicArguments() should return a FixedVector
https://bugs.webkit.org/show_bug.cgi?id=232639

Patch by Alexey Shvayka <ashvayka@apple.com> on 2021-12-20
Reviewed by Yusuke Suzuki.

Source/WebCore:

Since it's highly unlikely (CSSNumericArray is immutable) that we would need to
mutate variadic arguments before processing them or storing, and we know their size
upfront, it makes the most sense to save some memory by utilizing a FixedVector.

This patch reduces sizeof(ScheduledAction) by 8, enabling memory-neutral addition
of a field like m_incumbentGlobalObject.

No new tests, no behavior change.

  • Modules/mediastream/PeerConnectionBackend.cpp:

(WebCore::PeerConnectionBackend::addTrack):

  • Modules/mediastream/PeerConnectionBackend.h:
  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::addTrack):

  • Modules/mediastream/RTCPeerConnection.h:
  • Modules/mediastream/RTCRtpSender.cpp:

(WebCore::RTCRtpSender::setStreams):
(WebCore::RTCRtpSender::setMediaStreamIds):

  • Modules/mediastream/RTCRtpSender.h:
  • Modules/mediastream/RTCRtpSenderBackend.h:
  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::LibWebRTCMediaEndpoint::addTrack):

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:

(WebCore::LibWebRTCPeerConnectionBackend::addTrack):

  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
  • Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:

(WebCore::LibWebRTCRtpSenderBackend::setMediaStreamIds):

  • Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
  • bindings/js/JSDOMConvertVariadic.h:

(WebCore::convertVariadicArguments):

  • bindings/js/ScheduledAction.cpp:

(WebCore::ScheduledAction::addArguments):

  • bindings/js/ScheduledAction.h:
  • css/typedom/CSSNumericValue.cpp:

(WebCore::CSSNumericValue::add):
(WebCore::CSSNumericValue::sub):
(WebCore::CSSNumericValue::mul):
(WebCore::CSSNumericValue::div):
(WebCore::CSSNumericValue::min):
(WebCore::CSSNumericValue::max):
(WebCore::CSSNumericValue::equals):
(WebCore::CSSNumericValue::toSum):

  • css/typedom/CSSNumericValue.h:
  • css/typedom/numeric/CSSMathMax.cpp:

(WebCore::CSSMathMax::create):
(WebCore::CSSMathMax::CSSMathMax):

  • css/typedom/numeric/CSSMathMax.h:
  • css/typedom/numeric/CSSMathMin.cpp:

(WebCore::CSSMathMin::create):
(WebCore::CSSMathMin::CSSMathMin):

  • css/typedom/numeric/CSSMathMin.h:
  • css/typedom/numeric/CSSMathProduct.cpp:

(WebCore::CSSMathProduct::create):
(WebCore::CSSMathProduct::CSSMathProduct):

  • css/typedom/numeric/CSSMathProduct.h:
  • css/typedom/numeric/CSSMathSum.cpp:

(WebCore::CSSMathSum::create):
(WebCore::CSSMathSum::CSSMathSum):

  • css/typedom/numeric/CSSMathSum.h:
  • css/typedom/numeric/CSSNumericArray.cpp:

(WebCore::CSSNumericArray::create):
(WebCore::CSSNumericArray::CSSNumericArray):

  • css/typedom/numeric/CSSNumericArray.h:
  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::append):
(WebCore::ContainerNode::prepend):
(WebCore::ContainerNode::replaceChildren):

  • dom/ContainerNode.h:
  • dom/Document.cpp:

(WebCore::Document::write):
(WebCore::Document::writeln):

  • dom/Document.h:
  • dom/DocumentTouch.cpp:

(WebCore::DocumentTouch::createTouchList):

  • dom/DocumentTouch.h:
  • dom/Node.cpp:

(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
(WebCore::Node::before):
(WebCore::Node::after):
(WebCore::Node::replaceWith):

  • dom/Node.h:
  • dom/TouchList.h:

(WebCore::TouchList::create):
(WebCore::TouchList::TouchList):

  • html/DOMTokenList.cpp:

(WebCore::DOMTokenList::add):
(WebCore::DOMTokenList::remove):

  • html/DOMTokenList.h:
  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::getContext):

  • html/HTMLCanvasElement.h:
  • html/OffscreenCanvas.cpp:

(WebCore::OffscreenCanvas::getContext):

  • html/OffscreenCanvas.h:
  • page/DOMWindow.cpp:

(WebCore::DOMWindow::setTimeout):
(WebCore::DOMWindow::setInterval):

  • page/DOMWindow.h:
  • workers/DedicatedWorkerGlobalScope.cpp:

(WebCore::DedicatedWorkerGlobalScope::importScripts):

  • workers/DedicatedWorkerGlobalScope.h:
  • workers/WorkerGlobalScope.cpp:

(WebCore::WorkerGlobalScope::setTimeout):
(WebCore::WorkerGlobalScope::setInterval):
(WebCore::WorkerGlobalScope::importScripts):

  • workers/WorkerGlobalScope.h:

Source/WebKit:

Add / remove tokens one by one because there is no way to retrieve
the size of va_list in advance so we could construct a FixedVector.

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:

(webkit_dom_dom_token_list_add):
(webkit_dom_dom_token_list_remove):

Source/WTF:

Introduce std::initializer_list constructor for FixedVector and a WTF::map() overload.

  • wtf/FixedVector.h:

(WTF::FixedVector::FixedVector):
(WTF::map):

  • wtf/VectorTraits.h:
6:15 PM Changeset in webkit [287293] by commit-queue@webkit.org
  • 11 edits in trunk/Source/WebCore

Introduce a fast path for replacing an attribute event listener
https://bugs.webkit.org/show_bug.cgi?id=234441

Patch by Alexey Shvayka <ashvayka@apple.com> on 2021-12-20
Reviewed by Chris Dumez.

This patch makes replacing attribute event listener (via EventHandler IDL attribute)
2.6x faster by avoiding creation of intermediate JSEventListener instance.

Reusing is safe even for JSErrorHandler listeners as they can be replaced only with
instances of the same class. Uninitialized JSLazyEventListener can also be "replaced"
if m_isInitialized if set, which makes it behave like a regular JSEventListener.
All this is caught by existing tests.

Additionaly, this change slightly (about 3% according to a microbenchmark) speeds up
lookup of attribute event listeners by removing virtual isAttribute() call and related
downcasts from the hot path. Also, inlines event handler's getters / setters,
and simplifies call forwarding.

Altogether, this patch improves Speedometer2/Inferno-TodoMVC score by 4%.

No new tests, no behavior change.

  • bindings/js/JSErrorHandler.h:

(WebCore::createJSErrorHandler): Deleted.

  • bindings/js/JSEventListener.cpp:

(WebCore::JSEventListener::create):
(WebCore::JSEventListener::replaceJSFunctionForAttributeListener):
(WebCore::eventHandlerAttribute):
(WebCore::createEventListenerForEventHandlerAttribute): Deleted.
(WebCore::setEventHandlerAttribute): Deleted.
(WebCore::windowEventHandlerAttribute): Deleted.
(WebCore::setWindowEventHandlerAttribute): Deleted.

  • bindings/js/JSEventListener.h:

Although setWindowEventHandlerAttribute<JSErrorHandler> is currently unused, it's
templatized to accommodate a follow-up patch that will fix a web-compat issue.
This change carefully preserves current (slightly incorrect) onerror behavior.

While we don't care about performance of onerror, using templates improves uniformity
(aligns signatures of create() methods) and will simplify code generation in the follow-up.

(WebCore::setEventHandlerAttribute):
(WebCore::windowEventHandlerAttribute):
(WebCore::setWindowEventHandlerAttribute):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateAttributeSetterBodyDefinition):

  • bindings/scripts/test/JS/*: Updated.
  • dom/Document.cpp:

(WebCore::Document::setWindowAttributeEventListener):
(WebCore::Document::getWindowAttributeEventListener): Deleted.

  • dom/Document.h:
  • dom/EventTarget.cpp:

(WebCore::EventTarget::setAttributeEventListener):
(WebCore::EventTarget::attributeEventListener):

  • dom/EventTarget.h:
5:31 PM Changeset in webkit [287292] by Simon Fraser
  • 12 edits in trunk/Tools

Make it possible to enable log channels in WebKitTestRunner and DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=234525

Reviewed by Wenson Hsieh.

Support a "--WebCoreLogging" argument to DumpRenderTree to enable the WebCore
log channels.

Support "--WebCoreLogging" and "--WebKitLogging" arguments to WebKitTestRunner to enable the WebCore
and WebKit log channels.

DRT requires the double dash format, so I chose to have both use double dashes
for consistency (although this is inconsistent with the single dash format used
by AppKit and UIKit apps).

  • DumpRenderTree/mac/DumpRenderTree.mm:

(initializeGlobalsFromCommandLineOptions):
(prepareConsistentTestingEnvironment):

  • WebKitTestRunner/Options.cpp:

(WTR::handleOptionLogChannels):
(WTR::OptionsHandler::OptionsHandler):

  • WebKitTestRunner/Options.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize):

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::TestController::cocoaPlatformInitialize):

  • WebKitTestRunner/gtk/TestControllerGtk.cpp:

(WTR::TestController::platformInitialize):

  • WebKitTestRunner/ios/TestControllerIOS.mm:

(WTR::TestController::platformInitialize):

  • WebKitTestRunner/mac/TestControllerMac.mm:

(WTR::TestController::platformInitialize):

  • WebKitTestRunner/win/TestControllerWin.cpp:

(WTR::TestController::platformInitialize):

  • WebKitTestRunner/wpe/TestControllerWPE.cpp:

(WTR::TestController::platformInitialize):

5:31 PM Changeset in webkit [287291] by Simon Fraser
  • 1 edit in trunk/Source/WebCore/ChangeLog

Remove EventHandler::scrollDistance()
https://bugs.webkit.org/show_bug.cgi?id=234494

Reviewed by Wenson Hsieh.

This function is unused.

  • page/EventHandler.cpp:

(WebCore::EventHandler::scrollDistance): Deleted.

  • page/EventHandler.h:
5:31 PM Changeset in webkit [287290] by Simon Fraser
  • 1 edit in trunk/Source/WebCore/ChangeLog

Minor cleanup in aisle EventHandler::handleWheelEventInAppropriateEnclosingBox()
https://bugs.webkit.org/show_bug.cgi?id=234493

Reviewed by Wenson Hsieh.

Remove a confusing RenderListBox special case, which simply existed because the loop
below didn't know how to get a ScrollableArea for a RenderListBox.

Also rename didScrollInScrollableArea() to scrollViaNonPlatformEvent() because
the past tense in the name was inaccurate.

  • page/EventHandler.cpp:

(WebCore::scrollViaNonPlatformEvent):
(WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox):
(WebCore::didScrollInScrollableArea): Deleted.

5:19 PM Changeset in webkit [287289] by Dewei Zhu
  • 3 edits
    2 adds in trunk/Tools

'run-benchmark' should launch browsers in a relative clean state.
https://bugs.webkit.org/show_bug.cgi?id=234107

Reviewed by Stephanie Lewis.

Add code to ensure Chrome and Firefox launches in a relative clean state.
Refactor browser drivers for macOS Chrome and Firefox to share more code.

  • Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py:

Added '--no-first-run', '--no-default-browser-check', '--disable-extensions' flags.
(OSXChromeDriverBase):
(OSXChromeDriverBase.launch_url):
(OSXChromeDriverBase.launch_driver):
(OSXChromeDriverBase._create_chrome_options):
(OSXChromeDriverBase._window_size_arg):
(OSXChromeDriverBase._set_chrome_binary_location):
(OSXChromeDriver):
(OSXChromeDriver._set_chrome_binary_location):
(OSXChromeCanaryDriver._set_chrome_binary_location):
(OSXChromeDriver.launch_url): Deleted.
(OSXChromeDriver.launch_driver): Deleted.
(OSXChromeCanaryDriver.launch_url): Deleted.
(OSXChromeCanaryDriver.launch_driver): Deleted.
(create_args): Deleted.
(create_chrome_options): Deleted.
(create_window_size_arg): Deleted.

  • Scripts/webkitpy/benchmark_runner/browser_driver/osx_firefox_driver.py:

Added code to use profiles to suppress default browser check and privacy notice tab.
(OSXFirefoxDriverBase):
(OSXFirefoxDriverBase.init):
(OSXFirefoxDriverBase.prepare_env):
(OSXFirefoxDriverBase.restore_env):
(OSXFirefoxDriverBase.launch_url):
(OSXFirefoxDriverBase.launch_driver):
(OSXFirefoxDriverBase._setup_temporary_profile_directory):
(OSXFirefoxDriverBase._teardown_temporary_profile_directory):
(OSXFirefoxDriverBase._set_firefox_binary_location):
(OSXFirefoxDriver):
(OSXFirefoxDriver._set_firefox_binary_location):
(OSXFirefoxNightlyDriver):
(OSXFirefoxNightlyDriver._set_firefox_binary_location):
(OSXFirefoxDriver.launch_url): Deleted.
(OSXFirefoxDriver.launch_driver): Deleted.
(OSXFirefoxNightlyDriver.launch_url): Deleted.
(OSXFirefoxNightlyDriver.launch_driver): Deleted.
(create_args): Deleted.

  • Scripts/webkitpy/benchmark_runner/data/firefox_profile/user.js: Added user preferences

so that Firefox can be launched without checking default browser and privacy notice.

4:33 PM Changeset in webkit [287288] by Fujii Hironori
  • 16 edits
    2 copies
    3 adds in trunk/Source/WebKit

WC variant RemoteGraphicsContextGL::platformLayer() should be removed
https://bugs.webkit.org/show_bug.cgi?id=233756
<rdar://problem/86261919>

Reviewed by Kimmo Kinnunen.

WinCairo is using TextureMapperGCGLPlatformLayer as the WebGL
PlatformLayer at the moment, that is using only a single output
buffer. And, WinCairo doesn't transfer the WebGL output buffer
cross-process boundary even in GPU process mode. Based on these
assumptions, r285099 added platformLayer() method to
RemoteGraphicsContextGL to get a PlatformLayer and pass it to the
compositor in GPU process.

However, this is not appropriate. The output buffer identifier
should be transferred to web process by using the completion
handler of RemoteGraphicsContextGL::PrepareForDisplay message.
Then, the identifier will be passed back to GPU process.

Added WCContentBufferManager to manage the WebGL output buffer
identifiers. However, because TextureMapperGCGLPlatformLayer has
only a single output buffer, the maximum number of identifiers is
one for each PlatformLayer now.

  • GPUProcess/GPUConnectionToWebProcess.cpp:

(WebKit::GPUConnectionToWebProcess::didClose):
(WebKit::GPUConnectionToWebProcess::releaseWCLayerTreeHost):
(WebKit::GPUConnectionToWebProcess::findRemoteGraphicsContextGL): Deleted.

  • GPUProcess/GPUConnectionToWebProcess.h:
  • GPUProcess/graphics/RemoteGraphicsContextGL.h:
  • GPUProcess/graphics/RemoteGraphicsContextGL.messages.in:
  • GPUProcess/graphics/RemoteGraphicsContextGLWin.cpp:

(WebKit::RemoteGraphicsContextGLWin::prepareForDisplay):
(WebKit::RemoteGraphicsContextGL::prepareForDisplay): Deleted.
(WebKit::RemoteGraphicsContextGL::platformLayer const): Deleted.

  • GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp:

(WebKit::RemoteWCLayerTreeHost::RemoteWCLayerTreeHost):
(WebKit::RemoteWCLayerTreeHost::update):

  • GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h:
  • GPUProcess/graphics/wc/WCContentBuffer.h: Added.
  • GPUProcess/graphics/wc/WCContentBufferManager.cpp: Added.

(WebKit::WCContentBufferManager::ProcessInfo::ProcessInfo):
(WebKit::WCContentBufferManager::ProcessInfo::acquireContentBufferIdentifier):
(WebKit::WCContentBufferManager::ProcessInfo::releaseContentBufferIdentifier):
(WebKit::WCContentBufferManager::ProcessInfo::removeContentBuffer):
(WebKit::WCContentBufferManager::singleton):
(WebKit::WCContentBufferManager::acquireContentBufferIdentifier):
(WebKit::WCContentBufferManager::releaseContentBufferIdentifier):
(WebKit::WCContentBufferManager::removeContentBuffer):
(WebKit::WCContentBufferManager::removeAllContentBuffersForProcess):

  • GPUProcess/graphics/wc/WCContentBufferManager.h: Added.
  • GPUProcess/graphics/wc/WCScene.cpp:

(WebKit::WCScene::WCScene):
(WebKit::WCScene::update):

  • GPUProcess/graphics/wc/WCScene.h:
  • PlatformWin.cmake:
  • Scripts/webkit/messages.py:

(types_that_cannot_be_forward_declared):
(conditions_for_header):

  • Shared/wc/WCContentBufferIdentifier.h: Added.
  • WebProcess/GPU/graphics/wc/RemoteGraphicsContextGLProxyWC.cpp:
  • WebProcess/GPU/graphics/wc/WCPlatformLayerGCGL.h:

(WebKit::WCPlatformLayerGCGL::takeContentBufferIdentifiers):
(WebKit::WCPlatformLayerGCGL::addContentBufferIdentifier):
(WebKit::WCPlatformLayerGCGL::WCPlatformLayerGCGL): Deleted.
(WebKit::WCPlatformLayerGCGL::graphicsContextGLIdentifier): Deleted.

  • WebProcess/WebPage/wc/GraphicsLayerWC.cpp:

(WebKit::GraphicsLayerWC::setContentsNeedsDisplay):
(WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly):

  • WebProcess/WebPage/wc/WCUpateInfo.h:

(WebKit::WCLayerUpateInfo::encode const):
(WebKit::WCLayerUpateInfo::decode):

4:33 PM Changeset in webkit [287287] by Alan Bujtas
  • 7 edits
    1 copy
    1 add in trunk/Source/WebCore

[LFC][IFC] Decouple LineBox and InlineDisplay:Line construction
https://bugs.webkit.org/show_bug.cgi?id=234519

Reviewed by Antti Koivisto.

Layout::LineBox has logical geometry while InlineDisplay::Line is all physical.
This is also in preparation for supporting RTL lines.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • layout/formattingContexts/inline/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):

  • layout/formattingContexts/inline/InlineLevelBox.h:
  • layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:

(WebCore::Layout::LineBoxBuilder::build):

  • layout/formattingContexts/inline/InlineLineBoxBuilder.h:
  • layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp: Added.

(WebCore::Layout::InlineDisplayLineBuilder::InlineDisplayLineBuilder):
(WebCore::Layout::InlineDisplayLineBuilder::build):

  • layout/formattingContexts/inline/display/InlineDisplayLineBuilder.h: Copied from Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h.

(WebCore::Layout::InlineDisplayLineBuilder::formattingContext const):
(WebCore::Layout::InlineDisplayLineBuilder::root const):
(WebCore::Layout::InlineDisplayLineBuilder::layoutState const):

4:24 PM Changeset in webkit [287286] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebCore

Don't include SVGImageForContainers in allCachedSVGImages
https://bugs.webkit.org/show_bug.cgi?id=234364

Patch by Matt Woodrow <Matt Woodrow> on 2021-12-20
Reviewed by Dean Jackson.

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::image const):
(WebCore::CachedImage::hasSVGImage const):
(WebCore::CachedImage::image): Deleted.

  • loader/cache/CachedImage.h:
4:22 PM Changeset in webkit [287285] by Robert Jenner
  • 2 edits in branches/safari-612-branch/Tools

Fix for Cherry-pick r283599. rdar://problem/83897435
https://bugs.webkit.org/show_bug.cgi?id=231246

Unreviewed test gardening.

Adding an '#endif' that got left off the cherry pick for disabling an api-test for iOS.

  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
4:08 PM Changeset in webkit [287284] by Robert Jenner
  • 2 edits in branches/safari-612-branch/Tools

Cherry-pick r283599. rdar://problem/83897435

[ iOS15 ] TestWebKitAPI.ResourceLoadStatistics.DataTaskIdentifierCollision is a constant crash
https://bugs.webkit.org/show_bug.cgi?id=231246

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

For a reason that is mysterious to me, this test was timing out on iOS
in the call to synchronouslyLoadHTMLString unless I added "addToWindow:NO"
to the TestWKWebView initialization.

For a reason that is also mysterious to me, the test was crashing when closing
because of something in the autoreleasepool, but using Vector<String> instead of
RetainPtr<NSArray<NSString *>> in DataTaskIdentifierCollisionDelegate makes that
stop crashing.

I've looked quite closely and don't see why this fixes it, but I verified that it does.

While I was at it, I migrated from TCPServer to HTTPServer to be more robust against timeouts,
because the TCPServer destructor waits forever for threads to join, and if not everything is
perfect it will make the tests time out, which isn't great. HTTPServer does everything on the
main thread with callbacks instead.

  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm: (-[DataTaskIdentifierCollisionDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): (-[DataTaskIdentifierCollisionDelegate waitForMessages:]): (waitUntilTwoServersConnected): (TEST):

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

3:25 PM Changeset in webkit [287283] by Robert Jenner
  • 2 edits in branches/safari-612-branch/Tools

Fix for Cherry-pick r284133.
https://bugs.webkit.org/show_bug.cgi?id=231700

Unreviewed test gardening.

Remove unintedned "<<<<<<< HEAD" entries in file from cherry pick that could break the build.

  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:

(TEST):

3:24 PM Changeset in webkit [287282] by commit-queue@webkit.org
  • 2 edits in trunk/LayoutTests

[GLIB] Update test expectations for some fast/box-shadow tests.
https://bugs.webkit.org/show_bug.cgi?id=234530

Unreviewed test gardening.

Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-12-20

  • platform/glib/TestExpectations:
3:01 PM Changeset in webkit [287281] by Wenson Hsieh
  • 3 edits in trunk/Source/WebCore

Adopt ChromeClient::classifyModalContainerControls() in ModalContainerObserver
https://bugs.webkit.org/show_bug.cgi?id=234323

Reviewed by Devin Rousso.

Hook into the new chrome client method introduced in bug #234320 in ModalContainerObserver, by propagating the
identified strings through the client layer for classification, and then using the predicted class labels to
fulfill the document loader's ModalContainerObservationPolicy.

  • page/ModalContainerObserver.cpp:

(WebCore::ModalContainerObserver::updateModalContainerIfNeeded):
(WebCore::ModalContainerObserver::collectClickableElementsTimerFired):

Use the predicted class labels to find a suitable element on which we should dispatch a simulated click.

  • page/ModalContainerObserver.h:
2:55 PM Changeset in webkit [287280] by Robert Jenner
  • 8 edits in branches/safari-612-branch/Tools

Cherry-pick r284133. rdar://problem/84224737

Disable failing API tests
https://bugs.webkit.org/show_bug.cgi?id=231700

Unreviewed test gardening.

  • TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDoesNotLogDuringInitialization.mm:
  • TestWebKitAPI/Tests/ios/WKWebViewPausePlayingAudioTests.mm:

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

2:14 PM Changeset in webkit [287279] by Wenson Hsieh
  • 5 edits in trunk/Source/WebKit

Add some missing API availability macros around some WebXR SPI
https://bugs.webkit.org/show_bug.cgi?id=234521

Reviewed by Tim Horton.

Add some missing API availability macros around some WebXR-related SPI that was introduced in r286318.
Also remove a few unnecessary PLATFORM(COCOA) compile-time guards, and add a missing #import to fix the
non-unified build.

  • UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
  • UIProcess/Cocoa/PlatformXRCoordinator.mm:
  • UIProcess/Cocoa/UIDelegate.h:
  • UIProcess/Cocoa/UIDelegate.mm:

(WebKit::UIDelegate::setDelegate):

2:11 PM Changeset in webkit [287278] by J Pascoe
  • 2 edits in trunk/Tools

[WebAuthn] Add option to change requestWebAuthenticationNoGesture delegate for api tests.
https://bugs.webkit.org/show_bug.cgi?id=234444
rdar://86644642

Reviewed by Brent Fulgham.

These test a lack of user gesture in local authenticator. Recently we made a change to
change user gesture behavior, causing these tests to call out to an agent that cannot be called
from TWAPI. To restore test behavior, we add an option to change the return value of the
requestWebAuthenticationNoGesture delegate in tests.

  • TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:

(-[TestWebAuthenticationPanelUIDelegate _webView:requestWebAuthenticationNoGestureForOrigin:completionHandler:]):
(TestWebKitAPI::WebCore::reset):
(TestWebKitAPI::TEST):

2:09 PM Changeset in webkit [287277] by J Pascoe
  • 2 edits in trunk/Tools

[WebAuthn] Only run WebAuthn test process on platform it is used
https://bugs.webkit.org/show_bug.cgi?id=234445
rdar://86646638

Reviewed by Brent Fulgham.

Add PLATFORM(IOS) macro around webauthn process test.

  • TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
2:04 PM Changeset in webkit [287276] by achristensen@apple.com
  • 8 edits in trunk

Prevent test functionality in AdAttributionDaemon when not running tests
https://bugs.webkit.org/show_bug.cgi?id=231258
Source/WebKit:

<rdar://84168088>

Reviewed by Brady Eidson.

adattributiond already has a private entitlement check to make sure that only the network process has permission to connect to it.
This makes it so that the network process can't manipulate state only intended to be manipulated for tests when told to do so by
an application misusing SPI.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::allowsPrivateClickMeasurementTestFunctionality const):
(WebKit::NetworkProcess::setPrivateClickMeasurementOverrideTimerForTesting):
(WebKit::NetworkProcess::simulateResourceLoadStatisticsSessionRestart):
(WebKit::NetworkProcess::markAttributedPrivateClickMeasurementsAsExpiredForTesting):
(WebKit::NetworkProcess::setPrivateClickMeasurementEphemeralMeasurementForTesting):
(WebKit::NetworkProcess::setPrivateClickMeasurementTokenPublicKeyURLForTesting):
(WebKit::NetworkProcess::setPrivateClickMeasurementTokenSignatureURLForTesting):
(WebKit::NetworkProcess::setPrivateClickMeasurementAttributionReportURLsForTesting):
(WebKit::NetworkProcess::markPrivateClickMeasurementsAsExpiredForTesting):
(WebKit::NetworkProcess::setPCMFraudPreventionValuesForTesting):
(WebKit::NetworkProcess::setPrivateClickMeasurementAppBundleIDForTesting):

  • NetworkProcess/NetworkProcess.h:

Tools:

Reviewed by Brady Eidson.

  • TestWebKitAPI/Configurations/TestWebKitAPI-macOS-internal.entitlements:
  • WebKitTestRunner/Configurations/WebKitTestRunner.entitlements:
1:58 PM Changeset in webkit [287275] by achristensen@apple.com
  • 4 edits in trunk

[ Monterey ] TestWebKitAPI.WebSocket.PageWithAttributedBundleIdentifierDestroyed (API-test) is a constant timeout
https://bugs.webkit.org/show_bug.cgi?id=233224

Reviewed by Darin Adler.

Source/WebKit:

Using NSURLSession._attributedBundleIdentifier requires the com.apple.private.network.socket-delegate entitlement,
which can't be signed into the network process with the public SDK.

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(WebKit::NetworkSessionCocoa::addWebPageNetworkParameters):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WebSocket.mm:

(TestWebKitAPI::TEST):

1:36 PM Changeset in webkit [287274] by Wenson Hsieh
  • 2 edits in trunk/Source/WebKit

Minor cleanup in AuthenticationServicesCoreSPI.h
https://bugs.webkit.org/show_bug.cgi?id=234514

Reviewed by Devin Rousso.

When using the Apple internal SDK, directly import <AuthenticationServicesCore/ASCWebKitSPISupport.h> instead of
relying on forward declarations (or, in this case, relying on a previous unified source to import the header
through WebKitAdditions).

Additionally leave a FIXME to clean up the rest of this file by importing the private headers directly when
building with the internal SDK (and falling back to forward declarations in non-internal builds).

  • Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h:
1:02 PM Changeset in webkit [287273] by Wenson Hsieh
  • 3 edits
    4 adds in trunk/Source/WebCore/PAL

Add PAL soft linking headers for CoreML and NaturalLanguage frameworks
https://bugs.webkit.org/show_bug.cgi?id=234489

Reviewed by Devin Rousso.

Add CoreMLSoftLink.h and NaturalLanguageSoftLink.h; to be used in an upcoming patch that will add support for
classifying text inside controls in "modal containers". See rdar://77073735 for more details.

  • PAL.xcodeproj/project.pbxproj:
  • pal/PlatformMac.cmake:
  • pal/cocoa/CoreMLSoftLink.h: Added.
  • pal/cocoa/CoreMLSoftLink.mm: Added.
  • pal/cocoa/NaturalLanguageSoftLink.h: Added.
  • pal/cocoa/NaturalLanguageSoftLink.mm: Added.
12:19 PM Changeset in webkit [287272] by Fujii Hironori
  • 2 edits in trunk/Source/WebKitLegacy/win

[Win] MSVC reports "COMPropertyBag.h(233): error C2385: ambiguous access of 'IUnknown'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234498

Reviewed by Don Olmstead.

Source\WebKitLegacy\win\COMPropertyBag.h(233): error C2385: ambiguous access of 'IUnknown'

This problem has been reported in the following ticket, and it has a workaround.
<https://developercommunity.visualstudio.com/t/error-c2385-ambiguous-access-of-iunknown-referring/230955>

  • COMPropertyBag.h:

(HashType>::LoadObject): Added the global namespace prefix '::' to
IUnknown for the workaround.

12:17 PM Changeset in webkit [287271] by Alan Bujtas
  • 3 edits
    2 moves in trunk/Source/WebCore

[LFC][IFC] Move display builder files under /display directory
https://bugs.webkit.org/show_bug.cgi?id=234517

Reviewed by Antti Koivisto.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp: Renamed from Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp.
  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.h: Renamed from Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.h.
12:12 PM Changeset in webkit [287270] by Patrick Griffis
  • 8 edits
    2 deletes in trunk

CSP: Always use UTF-8 encoded content when checking hashes
https://bugs.webkit.org/show_bug.cgi?id=234159

Reviewed by Kate Cheney.

LayoutTests/imported/w3c:

Update expectations as passing.

  • web-platform-tests/content-security-policy/script-src/hash-always-converted-to-utf-8/utf-8-lone-surrogate-expected.txt:
  • web-platform-tests/content-security-policy/script-src/scripthash-unicode-normalization.sub-expected.txt:

Source/WebCore:

As per the spec: https://www.w3.org/TR/CSP3/#match-element-to-source-list

Regardless of the encoding of the document, source will be converted to UTF-8

before applying any hashing algorithms.

StrictConversionReplacingUnpairedSurrogatesWithFFFD matches Chromiums behavior.

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::ContentSecurityPolicy::findHashOfContentInPolicies const):

LayoutTests:

Remove normalization tests that are counter to WPT's CSP normalization tests.

  • http/tests/security/contentSecurityPolicy/1.1/scripthash-tests-expected.txt:
  • http/tests/security/contentSecurityPolicy/1.1/scripthash-tests.html:
  • http/tests/security/contentSecurityPolicy/1.1/scripthash-unicode-normalization-expected.txt: Removed.
  • http/tests/security/contentSecurityPolicy/1.1/scripthash-unicode-normalization.html: Removed.
11:58 AM Changeset in webkit [287269] by Fujii Hironori
  • 2 edits in trunk/Source/WebKitLegacy/win

[Win] MSVC reports "COMVariantSetter.h(133): error C2760: syntax error: unexpected token 'identifier', expected ';'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234501

Reviewed by Don Olmstead.

Source\WebKitLegacy\win\COMVariantSetter.h(133): error C2760: syntax error: unexpected token 'identifier', expected ';'
Source\WebKitLegacy\win\COMVariantSetter.h(140): note: see reference to class template instantiation 'COMVariantSetter<WTF::Vector<T,0,WTF::CrashOnOverflow,16,WTF::VectorMalloc>>' being compiled

COMVariant should be used after defined.

  • COMVariantSetter.h:

(COMVariantSetter<Vector<T>>): Moved after the COMVariant
definition.

11:54 AM Changeset in webkit [287268] by Fujii Hironori
  • 2 edits in trunk/Source/WebCore

[Win] MSVC reports "DragImageCairoWin.cpp(142): error C2362: initialization of 'cr' is skipped by 'goto exit'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234505

Reviewed by Don Olmstead.

  • platform/win/DragImageCairoWin.cpp:

(WebCore::scaleDragImage):
Reimplemented without goto statements.

11:03 AM Changeset in webkit [287267] by ntim@apple.com
  • 3 edits in trunk/Tools

Stop assuming WPT is a reftest based on existence of -ref.html file
https://bugs.webkit.org/show_bug.cgi?id=234510

Reviewed by Sam Sneddon & Darin Adler.

Only the presence of <link rel="match">/<link rel="mismatch"> indicates a test is a reftest. The script
should not assume that the existence of a similarly named file with a -ref.html suffix means that the
original test file is reftest.

Here's how upstream WPT detects reftests:
https://github.com/web-platform-tests/wpt/blob/22f29564bb82b407aeaf6507c8efffdbd51b9974/tools/manifest/sourcefile.py#L1065

  • Scripts/webkitpy/w3c/test_parser.py:

(TestParser.analyze_test):
(TestParser.fuzzy_metadata):
(TestParser.is_reference_filename):
(TestParser.potential_ref_filename): Deleted.
(TestParser.is_wpt_reftest): Deleted.

  • Scripts/webkitpy/w3c/test_parser_unittest.py:
11:02 AM Changeset in webkit [287266] by ntim@apple.com
  • 10 edits
    62 adds in trunk/LayoutTests

Re-import the-dialog-element WPT
https://bugs.webkit.org/show_bug.cgi?id=234479

Reviewed by Dean Jackson.

Upstream commit: https://github.com/web-platform-tests/wpt/commit/6259400ce70fd41d25bcf5db624a04db854f304e

LayoutTests/imported/w3c:

  • resources/resource-files.json:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/backdrop-receives-element-events-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/backdrop-receives-element-events.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/closed-dialog-does-not-block-mouse-events-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/closed-dialog-does-not-block-mouse-events.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-canceling-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-canceling.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close-event-async-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close-event-async.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close-event-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close-event.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-disconnected.html:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert.html:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open-2-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open-2.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-show-modal-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-show-modal-inert-crash.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-show-modal.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-focus-in-frames-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-focus-in-frames.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-inlines-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-inlines.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-label-focus-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-label-focus.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-uneditable-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-uneditable.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unselectable-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unselectable.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inertness-with-modal-dialogs-and-iframes-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inertness-with-modal-dialogs-and-iframes.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-ancestor-is-inert-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-ancestor-is-inert.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-blocks-mouse-events-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-blocks-mouse-events.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-scroll-height-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-scroll-height.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/multiple-centered-dialogs-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/multiple-centered-dialogs.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/non-modal-dialog-does-not-block-mouse-events-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/non-modal-dialog-does-not-block-mouse-events.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/non-modal-dialog-layout-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/non-modal-dialog-layout.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/resources/dialog.css:

(.pseudodialog):

  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/resources/inert-focus-in-frames-frame1.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/resources/inert-focus-in-frames-frame2.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/resources/w3c-import.log:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/showmodal-in-shadow-crash.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/showmodal-shadow-sibling-frame-crash.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/simulated-click-inert-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/simulated-click-inert.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/submit-dialog-close-event-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/submit-dialog-close-event.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/synthetic-click-inert-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/synthetic-click-inert.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-mask.html:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-position-relative-expected.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-position-relative.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-position-static-expected.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-position-static.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-position-expected.txt: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-position.html: Added.
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log:

LayoutTests:

  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/closed-dialog-does-not-block-mouse-events-expected.txt: Added.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-inlines-expected.txt: Added.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-label-focus-expected.txt: Added.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-ancestor-is-inert-expected.txt: Added.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-blocks-mouse-events-expected.txt: Added.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/non-modal-dialog-does-not-block-mouse-events-expected.txt: Added.
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/simulated-click-inert-expected.txt: Added.
9:57 AM Changeset in webkit [287265] by Fujii Hironori
  • 3 edits in trunk/Source/WTF

MSVC reports "wtf/RetainPtr.h(196): error C3861: 'CFAutorelease': identifier not found " with /permissive- on Windows
https://bugs.webkit.org/show_bug.cgi?id=202842

Reviewed by Darin Adler.

r287200 fixed the problem, but not a right fix.

  • wtf/PlatformHave.h: Defined a new macro HAVE_CFAUTORELEASE for PLATFORM(COCOA).
  • wtf/RetainPtr.h: Use HAVE(CFAUTORELEASE) instead of PLATFORM(COCOA).
9:45 AM Changeset in webkit [287264] by Lauro Moura
  • 3 edits in trunk/Tools

[webkitcorepy] Require cryptography while on Linux with Py3
https://bugs.webkit.org/show_bug.cgi?id=234499

Reviewed by Philippe Normand.

cryptography is required by secretstorage.util. When not installed,
the import fails and the keyring backend initialization fails silently,
just removing the SecretService keyring backend from the list of
viable backends. This can happen when running the scripts from a fresh
virtualenv, for example.

  • Scripts/libraries/webkitcorepy/setup.py:
  • Scripts/libraries/webkitcorepy/webkitcorepy/init.py:
8:56 AM Changeset in webkit [287263] by svillar@igalia.com
  • 4 edits in trunk

[css-flexbox] Pre-layout orthogonal children to compute the preferred logical width
https://bugs.webkit.org/show_bug.cgi?id=234300

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt: Replaced

FAIL by PASS expectations for 2 subtests that are passing now.

Source/WebCore:

In order to properly compute the flex container intrinsic width we must layout the orthogonal
children so that we could use the children's block sizes (which are in the flex container
inline axis).

The very same solution was adopted long time ago by the RenderGrid code.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): prelayout orthogonal children.

8:23 AM Changeset in webkit [287262] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

Fixes dead code in compareIcons()
https://bugs.webkit.org/show_bug.cgi?id=234234

Patch by Karl Dubost <karl+github@la-grange.net> on 2021-12-20
Reviewed by Youenn Fablet.

  • html/LinkIconCollector.cpp:

(WebCore::compareIcons):

8:04 AM Changeset in webkit [287261] by youenn@apple.com
  • 2 edits in trunk/Source/WebKit

Improve UserMediaPermissionRequestManagerProxy logging
https://bugs.webkit.org/show_bug.cgi?id=234508

Reviewed by Eric Carlson.

Make sure the log identifier is correct and log whether there are cameras and/or microphones exposed.
No observable change of behavior.

  • UIProcess/UserMediaPermissionRequestManagerProxy.cpp:

(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):

8:01 AM Changeset in webkit [287260] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Adjust the atomic/generic inline level boxes with marginLeft in RTL
https://bugs.webkit.org/show_bug.cgi?id=234502

Reviewed by Antti Koivisto.

  • layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

7:11 AM Changeset in webkit [287259] by Alan Bujtas
  • 7 edits in trunk/Source/WebCore

[LFC][IFC] InlineDisplay::Line has physical geometry
https://bugs.webkit.org/show_bug.cgi?id=234490

Reviewed by Antti Koivisto.

Remove the term "logical" from function names and variables.

  • layout/formattingContexts/block/BlockFormattingGeometry.cpp:

(WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const):

  • layout/formattingContexts/inline/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::usedContentHeight const):
(WebCore::Layout::InlineFormattingContext::computeStaticPositionForOutOfFlowContent):
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):

  • layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:

(WebCore::Layout::LineBoxBuilder::build):
(WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):

  • layout/formattingContexts/inline/display/InlineDisplayLine.h:

(WebCore::InlineDisplay::Line::lineBoxRect const):
(WebCore::InlineDisplay::Line::contentLeft const):
(WebCore::InlineDisplay::Line::contentWidth const):
(WebCore::InlineDisplay::Line::moveVertically):
(WebCore::InlineDisplay::Line::Line):
(WebCore::InlineDisplay::Line::lineBoxLogicalRect const): Deleted.
(WebCore::InlineDisplay::Line::contentLogicalLeft const): Deleted.
(WebCore::InlineDisplay::Line::contentLogicalWidth const): Deleted.

  • layout/integration/LayoutIntegrationInlineContentBuilder.cpp:

(WebCore::LayoutIntegration::lineOverflowWidth):
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::showInlineTreeAndRuns):

4:38 AM Changeset in webkit [287258] by youenn@apple.com
  • 6 edits
    3 adds in trunk

Update RTCRtpScriptTransformer key frame API according latest spec proposal
https://bugs.webkit.org/show_bug.cgi?id=234429

Reviewed by Eric Carlson.

Source/WebCore:

Update implementation according https://github.com/w3c/webrtc-encoded-transform/pull/125.
This means adding a specific method to send a FIR, a specific method to generate a key frame on sender side.
This also means improving the error handling and the promise resolution timing.
RID support is not yet available until we can properly pipe that information down to encoders.

Test: http/wpt/webrtc/audiovideo-script-transform.html

  • Modules/mediastream/RTCRtpScriptTransformer.cpp:
  • Modules/mediastream/RTCRtpScriptTransformer.h:
  • Modules/mediastream/RTCRtpScriptTransformer.idl:

LayoutTests:

  • http/wpt/webrtc/audio-video-transform.js: Added.
  • http/wpt/webrtc/audiovideo-script-transform-expected.txt: Added.
  • http/wpt/webrtc/audiovideo-script-transform.html: Added.
  • http/wpt/webrtc/context-transform.js:
2:55 AM Changeset in webkit [287257] by ntim@apple.com
  • 2 edits in trunk/Tools

Fix Tools/Scripts/webkitpy/w3c/test_importer.py
https://bugs.webkit.org/show_bug.cgi?id=234480

Reviewed by Manuel Rego Casasnovas.

  • Scripts/webkitpy/w3c/test_importer.py:

(TestImporter.find_importable_tests):

2:40 AM Changeset in webkit [287256] by Carlos Garcia Campos
  • 1 copy in releases/WebKitGTK/webkit-2.34.3

WebKitGTK 2.34.3

2:39 AM Changeset in webkit [287255] by Carlos Garcia Campos
  • 4 edits in releases/WebKitGTK/webkit-2.34

Unreviewed. Update OptionsGTK.cmake and NEWS for 2.34.3 release

.:

  • Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit:

  • gtk/NEWS: Add release notes for 2.34.3.
1:20 AM Changeset in webkit [287254] by Lauro Moura
  • 2 edits in trunk/Tools

REGRESSION(r286936) [GLIB] WebsiteData configuration API test is failing with non-created localstorage dir
https://bugs.webkit.org/show_bug.cgi?id=234497

Reviewed by Adrian Perez de Castro.

  • TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:

(testWebsiteDataConfiguration): Ensure localStorage is created before
trying to query it.

Dec 19, 2021:

9:03 PM Changeset in webkit [287253] by beidson@apple.com
  • 20 edits
    6 copies in trunk/Source

Stub out NotificationEvent and related
https://bugs.webkit.org/show_bug.cgi?id=234420

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Disabled for now, no behavior change)

This patch adds stubs for NotificationEvent and the related classes/functions that use it.

Enabling just the stubs throws LayoutTests into a chaotic state that is not useful to manage with
test expectations files. So this also puts the related changes behind a disabled-by-default runtime switch.

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • Modules/notifications/Notification.h:
  • Modules/notifications/Notification.idl:
  • Modules/notifications/NotificationDirection.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
  • Modules/notifications/NotificationEvent.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.

(WebCore::NotificationEvent::~NotificationEvent):

  • Modules/notifications/NotificationEvent.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
  • Modules/notifications/NotificationEvent.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
  • Modules/notifications/NotificationOptions.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
  • Modules/notifications/NotificationOptions.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
  • bindings/js/WebCoreBuiltinNames.h:
  • dom/EventNames.h:
  • dom/EventNames.in:
  • page/RuntimeEnabledFeatures.h:

(WebCore::RuntimeEnabledFeatures::setNotificationEventEnabled):
(WebCore::RuntimeEnabledFeatures::notificationEventEnabled const):

  • workers/service/ServiceWorkerGlobalScope.idl:
  • workers/service/ServiceWorkerRegistration.cpp:

(WebCore::ServiceWorkerRegistration::showNotification):
(WebCore::ServiceWorkerRegistration::getNotifications):

  • workers/service/ServiceWorkerRegistration.h:
  • workers/service/ServiceWorkerRegistration.idl:

Source/WTF:

  • Scripts/Preferences/WebPreferencesInternal.yaml:
  • wtf/PlatformEnable.h:
7:37 PM Changeset in webkit [287252] by Simon Fraser
  • 2 edits in trunk/Source/WebCore

Minor cleanup in aisle EventHandler::handleWheelEventInAppropriateEnclosingBox()
https://bugs.webkit.org/show_bug.cgi?id=234493

Reviewed by Wenson Hsieh.

Remove a confusing RenderListBox special case, which simply existed because the loop
below didn't know how to get a ScrollableArea for a RenderListBox.

Also rename didScrollInScrollableArea() to scrollViaNonPlatformEvent() because
the past tense in the name was inaccurate.

  • page/EventHandler.cpp:

(WebCore::scrollViaNonPlatformEvent):
(WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox):
(WebCore::didScrollInScrollableArea): Deleted.

7:22 PM Changeset in webkit [287251] by Simon Fraser
  • 3 edits in trunk/Source/WebCore

Remove EventHandler::scrollDistance()
https://bugs.webkit.org/show_bug.cgi?id=234494

Reviewed by Wenson Hsieh.

This function is unused.

  • page/EventHandler.cpp:

(WebCore::EventHandler::scrollDistance): Deleted.

  • page/EventHandler.h:
5:12 PM Changeset in webkit [287250] by mmaxfield@apple.com
  • 2 edits in trunk/Source/WebCore

Use character names instead of hex codes in FontCascade.h
https://bugs.webkit.org/show_bug.cgi?id=234451

Reviewed by Dean Jackson.

Saying something like "c == zeroWidthNonJoiner" is much more clear than "c == 0x200c".

No new tests because there is no behavior change.

  • platform/graphics/FontCascade.h:

(WebCore::FontCascade::treatAsSpace):
(WebCore::FontCascade::treatAsZeroWidthSpace):
(WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):

4:03 PM Changeset in webkit [287249] by Jean-Yves Avenard
  • 3 edits in trunk/Source/WebCore

Don't pack audio samples with discontinuity together
https://bugs.webkit.org/show_bug.cgi?id=234458
rdar://86659914

Reviewed by Eric Carlson.

Some webm content may have a data gap between frames. Normally audio frames
are packed in 2s block. When we pack the samples with discontinuities, those
discontinuities would all be accumulated at the 2s boundary which makes them
much more audible.
The CMSampleBufferCreateReady API should allow us to pack samples with
discontinuities as we can give a vector of CMSampleTimingInfo with the
exact information for all packets.
However, this data appears to be ignored and the discontinuities is still
heard at the 2s boundary.
So we no longer pack samples with discontinuities so that the frame
timestamps will be more accurate and no audible artefacts are heard on
small gaps.

Manually tested and verified manually. This is getting around an issue
in CoreMedia that inserts very audible artifacts when there's a gap between
samples.

  • platform/graphics/cocoa/SourceBufferParserWebM.cpp:

(WebCore::SourceBufferParserWebM::AudioTrackData::resetCompleted):
(WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::AudioTrackData::createSampleBuffer):

  • platform/graphics/cocoa/SourceBufferParserWebM.h:
3:55 PM Changeset in webkit [287248] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Add support for RTL text-indent
https://bugs.webkit.org/show_bug.cgi?id=234461

Reviewed by Antti Koivisto.

See https://drafts.csswg.org/css-text/#text-indent-property

  • layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:

(WebCore::Layout::LineBoxBuilder::build):

12:43 PM Changeset in webkit [287247] by Wenson Hsieh
  • 19 edits
    1 add in trunk/Source

Add client layer plumbing for classifying modal container controls
https://bugs.webkit.org/show_bug.cgi?id=234320

Reviewed by Dean Jackson.

Source/WebCore:

Add a chrome client method to asynchronously classify text inside modal container controls as one of { Neutral,
Positive, Negative or Other }. While currently unimplemented, the next patch will add support for a singleton
ModalContainerControlClassifier in WebKit2, and use it to implement this client hook.

  • Headers.cmake:
  • WebCore.xcodeproj/project.pbxproj:
  • loader/EmptyClients.cpp:

(WebCore::EmptyChromeClient::classifyModalContainerControls):

  • loader/EmptyClients.h:
  • page/ChromeClient.h:
  • page/ModalContainerControlType.h: Added.

Source/WebKit:

See WebCore/ChangeLog for more details.

  • Scripts/webkit/messages.py:

(types_that_cannot_be_forward_declared):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::classifyModalContainerControls):

Add a method stub with a comment for now. The next patch in the sequence will implement this method hook on
Cocoa platforms.

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::requestCookieConsent):

Drive-by fix: remove an unnecessary WebCore:: prefix.

(WebKit::WebChromeClient::classifyModalContainerControls):

  • WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WebKitLegacy/mac:

See WebCore/ChangeLog for more details.

  • WebCoreSupport/WebChromeClient.h:
  • WebCoreSupport/WebChromeClient.mm:

(WebChromeClient::classifyModalContainerControls):

Source/WebKitLegacy/win:

See WebCore/ChangeLog for more details.

  • WebCoreSupport/WebChromeClient.cpp:

(WebChromeClient::classifyModalContainerControls):

  • WebCoreSupport/WebChromeClient.h:
12:34 PM Changeset in webkit [287246] by ysuzuki@apple.com
  • 98 edits in trunk/Source/bmalloc

[libpas] Add macros to disable bmalloc core so that libpas can be enabled on 64-bit watchOS
https://bugs.webkit.org/show_bug.cgi?id=234481

Reviewed by David Kilzer.

This patch re-enables libpas for watchOS by disabling compilation of bmalloc core when libpas
is enabled.

Also we found that size of libbmalloc.a is misleading: it is just collection of object
files, thus it includes a lot of duplicate inline functions, which is deduped when linking
it to JavaScriptCore.framework. Thus, that size does not directly reflect the final size of
JavaScriptCore.framework.

Before and after this patch, we see 2.4MB size reduction in total.

  1. JavaScriptCore.framework increases by 363KB.

Before: 32452544 JavaScriptCore.framework/JavaScriptCore
After: 32825088 JavaScriptCore.framework/JavaScriptCore

Most part of libbmalloc.a archive file is just many duplicate inline functions, which is deduped
in JavaScriptCore.framework (archive file v.s. framework). After deduping and after removing bmalloc
core in this patch, it only increases 363KB. Removing bmalloc core code is contributing to 70KB reduction.

  1. WebCore.framework decreases by 2.75MB

Before: 72591584 WebCore.framework/WebCore
After: 69702240 WebCore.framework/WebCore

We can get 2.75MB size reduction if we enable libpas on WebCore. This is because how IsoHeap is
implemented in bmalloc v.s. libpas. In bmalloc, we use extensive amount of distinct template-based
IsoHeap code, which bloats code size. Plus, it uses very long function name strings to fix per-process
singleton linking issue happening for C++ template. Compared to that, libpas is just using very small
C structure and functions that can be much smaller than the bmalloc's IsoHeap's code which even duplicate
slow path code. As a result, switching to libpas offers 2.75MB size deduction.

  • bmalloc/Algorithm.h:
  • bmalloc/AllIsoHeaps.cpp:
  • bmalloc/AllIsoHeaps.h:
  • bmalloc/AllIsoHeapsInlines.h:
  • bmalloc/Allocator.cpp:
  • bmalloc/Allocator.h:
  • bmalloc/BInline.h:
  • bmalloc/BPlatform.h:
  • bmalloc/Bits.h:
  • bmalloc/BulkDecommit.h:
  • bmalloc/BumpAllocator.h:
  • bmalloc/BumpRange.h:
  • bmalloc/Cache.cpp:
  • bmalloc/Cache.h:
  • bmalloc/Chunk.h:
  • bmalloc/Deallocator.cpp:
  • bmalloc/Deallocator.h:
  • bmalloc/DeferredDecommit.h:
  • bmalloc/DeferredDecommitInlines.h:
  • bmalloc/DeferredTrigger.h:
  • bmalloc/DeferredTriggerInlines.h:
  • bmalloc/EligibilityResult.h:
  • bmalloc/EligibilityResultInlines.h:
  • bmalloc/Environment.h:
  • bmalloc/FixedVector.h:
  • bmalloc/FreeList.cpp:
  • bmalloc/FreeList.h:
  • bmalloc/FreeListInlines.h:
  • bmalloc/Heap.cpp:
  • bmalloc/Heap.h:
  • bmalloc/HeapConstants.cpp:
  • bmalloc/HeapConstants.h:
  • bmalloc/IsoAllocator.h:
  • bmalloc/IsoAllocatorInlines.h:
  • bmalloc/IsoConfig.h:
  • bmalloc/IsoDeallocator.h:
  • bmalloc/IsoDeallocatorInlines.h:
  • bmalloc/IsoDirectory.h:
  • bmalloc/IsoDirectoryInlines.h:
  • bmalloc/IsoDirectoryPage.h:
  • bmalloc/IsoDirectoryPageInlines.h:
  • bmalloc/IsoHeapImpl.cpp:
  • bmalloc/IsoHeapImpl.h:
  • bmalloc/IsoHeapImplInlines.h:
  • bmalloc/IsoMallocFallback.h:
  • bmalloc/IsoPage.cpp:
  • bmalloc/IsoPage.h:
  • bmalloc/IsoPageInlines.h:
  • bmalloc/IsoPageTrigger.h:
  • bmalloc/IsoSharedConfig.h:
  • bmalloc/IsoSharedHeap.cpp:
  • bmalloc/IsoSharedHeap.h:
  • bmalloc/IsoSharedHeapInlines.h:
  • bmalloc/IsoSharedPage.cpp:
  • bmalloc/IsoSharedPage.h:
  • bmalloc/IsoSharedPageInlines.h:
  • bmalloc/IsoTLS.cpp:
  • bmalloc/IsoTLS.h:
  • bmalloc/IsoTLSAllocatorEntry.h:
  • bmalloc/IsoTLSAllocatorEntryInlines.h:
  • bmalloc/IsoTLSDeallocatorEntry.h:
  • bmalloc/IsoTLSDeallocatorEntryInlines.h:
  • bmalloc/IsoTLSEntry.cpp:
  • bmalloc/IsoTLSEntry.h:
  • bmalloc/IsoTLSEntryInlines.h:
  • bmalloc/IsoTLSInlines.h:
  • bmalloc/IsoTLSLayout.cpp:
  • bmalloc/IsoTLSLayout.h:
  • bmalloc/LargeMap.cpp:
  • bmalloc/LargeMap.h:
  • bmalloc/LargeRange.h:
  • bmalloc/LineMetadata.h:
  • bmalloc/List.h:
  • bmalloc/Map.h:
  • bmalloc/Object.h:
  • bmalloc/ObjectType.cpp:
  • bmalloc/ObjectType.h:
  • bmalloc/ObjectTypeTable.cpp:
  • bmalloc/ObjectTypeTable.h:
  • bmalloc/Packed.h:
  • bmalloc/PerHeapKind.h:
  • bmalloc/PerProcess.cpp:
  • bmalloc/PerProcess.h:
  • bmalloc/PerThread.h:
  • bmalloc/PhysicalPageMap.h:
  • bmalloc/Range.h:
  • bmalloc/Scavenger.cpp:
  • bmalloc/Scavenger.h:
  • bmalloc/Sizes.h:
  • bmalloc/SmallLine.h:
  • bmalloc/SmallPage.h:
  • bmalloc/StdLibExtras.h:
  • bmalloc/Syscall.h:
  • bmalloc/VMAllocate.h:
  • bmalloc/Vector.h:
  • bmalloc/Zone.cpp:
  • bmalloc/Zone.h:
12:24 PM Changeset in webkit [287245] by Wenson Hsieh
  • 3 edits in trunk/Source/WebCore

Add a basic heuristic for collecting and extracting text from controls in ModalContainerObserver
https://bugs.webkit.org/show_bug.cgi?id=234299

Reviewed by Dean Jackson.

Introduce a heuristic for extracting clickable controls from modal containers, that are unlikely to be links
(i.e. trigger navigation when clicked). See below for more details.

  • page/ModalContainerObserver.cpp:

(WebCore::ModalContainerObserver::ModalContainerObserver):
(WebCore::ModalContainerObserver::updateModalContainerIfNeeded):

Once a modal container has been detected, schedule a short timer to traverse the modal container's subtree in
search for clickable controls. In a future patch, we may need to lengthen this delay or even introduce a
mechanism for restarting the timer periodically if no clickable controls are discovered in the modal container.

(WebCore::accessibilityRole):
(WebCore::isClickableControl):
(WebCore::removeParentOrChildElements):
(WebCore::removeElementsWithEmptyBounds):
(WebCore::textForControl):
(WebCore::ModalContainerObserver::scheduleClickableElementCollection):
(WebCore::ModalContainerObserver::collectClickableElementsTimerFired):
(WebCore::ModalContainerObserver::collectClickableElements):

This contains the main logic for collecting clickable elements inside modal containers. This heuristic consists
mostly of three phases:

  1. We initially scan the modal container subtree in search of any elements that seem like they could be

clickable buttons or links that don't trigger navigation, and build a list of classifiableControls.

  1. We then filter the list of classifiableControls by removing any elements in the list that either contain or

are contained by other elements (using a heuristic to decide whether to remove each parent or child); in this
filtering step, we additionally remove all elements that are effectively unclickable due to having an empty
client bounding rect.

  1. In the final phase, we iterate over all of the controls in the filtered list, and attempt to extract text for

each control (looking at attributes such as title and aria-label, alt text for images, and finally falling
back to outerText()). If this raw text description is not empty and also not too long (exceeding an
arbitrarily chosen threshold of 100 characters), we add it to the final list of controls and control text
descriptions to send to the client layer for classification.

(WebCore::ModalContainerObserver::shouldHide):

Augment this to return false in the case where we're inside the scope of m_collectingClickableElements. This
allows us to run heuristics over the modal container without an adjusted display: none; style on the container
element.

  • page/ModalContainerObserver.h:
11:44 AM Changeset in webkit [287244] by Alan Bujtas
  • 4 edits in trunk/Source/WebCore

[LFC][IFC] text-indent is treated as a margin applied to the start edge of the line box.
https://bugs.webkit.org/show_bug.cgi?id=234460

Reviewed by Antti Koivisto.

See https://drafts.csswg.org/css-text/#text-indent-property
This is also in preparation for adjusting the display line geometry when the inline axis direction is rtl.

  • layout/formattingContexts/inline/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::initialize):
(WebCore::Layout::LineBuilder::initialConstraintsForLine const):

  • layout/formattingContexts/inline/InlineLineBuilder.h:
  • layout/formattingContexts/inline/InlineRect.h:

(WebCore::Layout::InlineRect::moveLeftBy):

10:52 AM Changeset in webkit [287243] by Adrian Perez de Castro
  • 1 copy in releases/WPE WebKit/webkit-2.34.3

WPE WebKit 2.34.3

10:52 AM Changeset in webkit [287242] by Adrian Perez de Castro
  • 4 edits in releases/WebKitGTK/webkit-2.34

Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.34.3 release

.:

  • Source/cmake/OptionsWPE.cmake: Bump version numbers.

Source/WebKit:

  • wpe/NEWS: Add release notes for 2.34.3.
10:43 AM Changeset in webkit [287241] by Simon Fraser
  • 4 edits
    2 adds in trunk

Keyboard shortcut to scroll to top when already at the top of the page moves to the bottom
https://bugs.webkit.org/show_bug.cgi?id=234483
<rdar://86628260>

Reviewed by Dean Jackson.
Source/WebCore:

If the page was scrolled to the top and an "up" keyboard scroll happened,
ScrollAnimator::singleAxisScroll() would trigger an unclamped scroll with a negative delta,
which fed into ScrollAnimationSmooth::startAnimatedScrollToDestination() and would result in
an animation with a zero duration, which resulted in NaNs in animateScroll().

Fix by doing clamping in ScrollAnimator::singleAxisScroll() and protecting against
animations with zero delay in ScrollAnimationSmooth.

Test: fast/scrolling/keyboard-scrolling-home.html

  • platform/ScrollAnimationSmooth.cpp:

(WebCore::ScrollAnimationSmooth::startAnimatedScrollToDestination):
(WebCore::ScrollAnimationSmooth::retargetActiveAnimation):

  • platform/ScrollAnimator.cpp:

(WebCore::ScrollAnimator::singleAxisScroll):

LayoutTests:

  • fast/scrolling/keyboard-scrolling-home-expected.txt: Added.
  • fast/scrolling/keyboard-scrolling-home.html: Added.
4:58 AM Changeset in webkit [287240] by ddkilzer@apple.com
  • 2 edits in trunk/Source/WebCore

Fix pointer to blob data in BlobResourceHandle::readDataSync()
<https://webkit.org/b/234459>
<rdar://86026618>

Reviewed by Chris Dumez.

  • platform/network/BlobResourceHandle.cpp:

(WebCore::BlobResourceHandle::readDataSync):

2:03 AM Changeset in webkit [287239] by commit-queue@webkit.org
  • 10 edits in trunk

[GTK][WPE][VTT] tests media/track/track-webvtt-* fail on GTK and WPE
https://bugs.webkit.org/show_bug.cgi?id=234083

Patch by Philippe Normand <pnormand@igalia.com> on 2021-12-19
Reviewed by Eric Carlson.

Source/WebCore:

Remove ENABLE(AVF_CAPTIONS) from cross-platform call sites. This is needed only in the
AVFoundation player. The Adwaita media controls also now properly render
-webkit-media-text-track-display-backdrop as required for media/track tests and as done in
the Apple media controls.

  • Modules/mediacontrols/mediaControlsAdwaita.css:

(video::-webkit-media-text-track-display-backdrop):
(video::-webkit-media-text-track-container b):
(video::-webkit-media-text-track-container u):
(video::-webkit-media-text-track-container i):
(video::-webkit-media-text-track-container .hidden,):

  • html/HTMLMediaElement.cpp:
  • html/HTMLMediaElement.h:
  • platform/graphics/MediaPlayer.cpp:
  • platform/graphics/MediaPlayer.h:

(WebCore::MediaPlayerClient::outOfBandTrackSources):

  • platform/graphics/MediaPlayerPrivate.h:

(WebCore::MediaPlayerPrivateInterface::notifyTrackModeChanged):

  • platform/graphics/PlatformTextTrack.h:

LayoutTests:

  • platform/glib/TestExpectations:
1:40 AM Changeset in webkit [287238] by ysuzuki@apple.com
  • 2 edits in trunk/Source/WebCore

Lazily allocate HistoricUsageData
https://bugs.webkit.org/show_bug.cgi?id=212878

Reviewed by Saam Barati.

This is only used when resource-overlay is enabled. We should allocate it lazily instead of putting this in DATA.
This also reduces binary size by 19KB.

  • page/cocoa/ResourceUsageOverlayCocoa.mm:

(WebCore::historicUsageData):

12:43 AM Changeset in webkit [287237] by jonlee@apple.com
  • 13 edits in trunk/LayoutTests

Garden tests that are passing iOS but marked failure.
https://bugs.webkit.org/show_bug.cgi?id=234464

Reviewed by Simon Fraser.

An attempt to garden the tests that are marked failing but are now passing.
These were cross-checked against bot history.

  • TestExpectations:
  • platform/ios-14/TestExpectations:
  • platform/ios-simulator-wk2/TestExpectations:
  • platform/ios-simulator/TestExpectations:
  • platform/ios-wk1/TestExpectations:
  • platform/ios-wk2/TestExpectations:
  • platform/ios/TestExpectations:
  • platform/mac-wk1/TestExpectations:
  • platform/mac-wk2/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wk2/TestExpectations:
12:33 AM Changeset in webkit [287236] by Ross Kirsling
  • 8 edits
    2 adds in trunk

[JSC] OpPow should have a "small int exponent" fast path at lower tiers
https://bugs.webkit.org/show_bug.cgi?id=234408

Reviewed by Yusuke Suzuki.

JSTests:

  • microbenchmarks/pow-double-int.js: Added.
  • microbenchmarks/pow-int-int.js: Added.

Source/JavaScriptCore:

DFG has an ArithPow fast path which just multiplies in a loop when the exponent is an int between 0 and 1000;
this can be done at lower tiers too.

Implementing this at LLInt gives the following speedup with JIT disabled:

Before After

pow-int-int 193.7180+-0.4897 100.3569+-1.9804 definitely 1.9303x faster
pow-double-int 194.0744+-0.7998 100.0346+-0.8655 definitely 1.9401x faster

<geometric> 193.8824+-0.4667 100.0964+-0.9922 definitely 1.9370x faster

Implementing this at Baseline gives similar results with DFG disabled:

Before After

pow-int-int 195.6251+-0.9577 99.9627+-0.3307 definitely 1.9570x faster
pow-double-int 196.1975+-0.9307 101.0056+-0.3124 definitely 1.9424x faster

<geometric> 195.8786+-0.5883 100.4767+-0.2333 definitely 1.9495x faster

Results are neutral otherwise.

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:
  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_pow):
(JSC::JIT::emitSlow_op_pow):

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:

Dec 18, 2021:

10:30 PM Changeset in webkit [287235] by Mikhail R. Gadelha
  • 2 edits in trunk/Source/JavaScriptCore

[JSC][32bit] Fix undefined behavior causing miscompilation with clang 13 on ARM
https://bugs.webkit.org/show_bug.cgi?id=234399

Reviewed by Yusuke Suzuki.

Compiling JSC with clang 13 on ARMv7 on linux was broken because clang
was marking the constant Infinity as poison during constant folding, if
either -O2 or -O3 were used, causing the constant to not being
initialized.

This patch removes the undefined behaviour by preventing the
static_cast to int32_t if the double is either inf or NaN.

  • runtime/MathCommon.h:

(JSC::canBeInt32):
(JSC::canBeStrictInt32):

7:38 PM Changeset in webkit [287234] by commit-queue@webkit.org
  • 8 edits in trunk/Tools

[Monterey] TestWebKitAPI.PrivateClickMeasurement.Daemon* tests timing out: Failed to connect to mach service org.webkit.pcmtestdaemon.service
https://bugs.webkit.org/show_bug.cgi?id=232890

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

Using OSLaunchdJob on macOS works, but it requires a private entitlement which the public SDK can't sign with.
Just continue using launchctl instead. Also, do the NSDictionary -> xpc dictionary conversion at runtime to reduce duplicate code.

  • TestWebKitAPI/Configurations/TestWebKitAPI-macOS-internal.entitlements:
  • TestWebKitAPI/Configurations/TestWebKitAPI-macOS.entitlements:
  • TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
  • TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:

(TestWebKitAPI::testDaemonPList):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

(TestWebKitAPI::testWebPushDaemonPList):
(TestWebKitAPI::setUpTestWebPushD):

  • TestWebKitAPI/cocoa/DaemonTestUtilities.h:
  • TestWebKitAPI/cocoa/DaemonTestUtilities.mm:

(TestWebKitAPI::convertArrayToXPC):
(TestWebKitAPI::convertDictionaryToXPC):
(TestWebKitAPI::registerPlistWithLaunchD):

4:21 PM Changeset in webkit [287233] by ddkilzer@apple.com
  • 2 edits in trunk/Source/bmalloc

[libpas] Do not compile libpas for 64-bit watchOS to save ~6 MB per architecture
<https://webkit.org/b/234478>
<rdar://problem/85620647>

Reviewed by Yusuke Suzuki.

  • bmalloc/BPlatform.h:

(BENABLE_LIBPAS):

  • Disable libpas on 64-bit watchOS.
3:57 PM Changeset in webkit [287232] by Darin Adler
  • 30 edits in trunk/Source

Hash tables, read/write, and heap memory are used unnecessarily, which may hurt performance
https://bugs.webkit.org/show_bug.cgi?id=234438

Reviewed by Anders Carlsson.

Source/WebCore:

  • Modules/mediacapabilities/MediaCapabilities.cpp:

(WebCore::bucketMIMETypes): Deleted.
(WebCore::isValidMediaMIMEType): Moved the code from bucketMIMETypes in here.
Use a SortedArraySet for bucketMIMETypes, which should be similar in performance
and uses no heap or read/write memory.

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::popupValue const): Use a loop to check the 5 valid
values here instead of making a HashSet. Should be similar in performance and
use no heap or read/write memory. Also removes call to convertToASCIILowercase,
which will also help performance and memory use a tiny bit in some cases.

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::inheritsPresentationalRole const): Use
decltype to make this declaration simpler and shorter.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateForEachEventHandlerContentAttribute): Use decltype and references
instead of pointers to make the function a little cleaner.

  • dom/Element.cpp:

(WebCore::canAttachAuthorShadowRoot): Use constexpr so the tag list here does
not use any read/write memory.

  • dom/make_names.pl:

(printFactoryCppFile): Removed the unnecessary constructors for the MapEntry
structs. Use decltype so we can make the tables constexpr so they do not use
any read/write memory.
(printWrapperFactoryCppFile): Ditto.

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::isProhibitedParagraphChild): Added a reserveInitialCapacity, which
could make the hash table here use a little less memory.

  • html/Autofill.cpp:

(WebCore::fieldNameMap): Deleted. Replaced with a SortedArrayMap, which is
entirely made out of constexpr objcts so does not use heap or read/write memory.
(WebCore::toAutofillFieldName): Updated to use SortedArrayMap functions.
(WebCore::AutofillData::createFromHTMLFormControlElement): Ditto.

  • html/HTMLDocument.cpp:

(WebCore::HTMLDocument::isCaseSensitiveAttribute): Added a reserveInitialCapacity,
which could make the hash table here use a little less memory.

  • html/HTMLObjectElement.cpp:

(WebCore::preventsParentObjectFromExposure): Ditto.

  • page/DebugPageOverlays.cpp:

(WebCore::touchEventRegionColors): Deleted.
(WebCore::NonFastScrollableRegionOverlay::drawRect): Use SortedArrayMap and
some lambdas to make this code tighter and easier to read.

  • page/PerformanceUserTiming.cpp:

(WebCore::restrictedMarkNamesToNavigationTimingFunctionMap): Deleted. Use
a SortedArrayMap instead, which should be similar in performance and uses no heap
or read/write memory.
(WebCore::restrictedMarkFunction): Deleted.
(WebCore::isRestrictedMarkNameNonMainThread): Deleted. This is now safe to do on
any thread.
(WebCore::PerformanceUserTiming::isRestrictedMarkName): Use the SortedArrayMap,
which has the benefit of relaxing the thread restrictions; this is now safe to
call on any thread.
(WebCore::PerformanceUserTiming::convertMarkToTimestamp const): Updated to use
the SortedArrayMap. There may be some additional simplification possible now
that the mark functions map can be used in any thread, but I wasn't sure.

  • platform/cocoa/RemoteCommandListenerCocoa.mm:

(WebCore::mediaRemoteCommandForPlatformCommand): Use makeOptionalFromPointer.

  • platform/graphics/FontCascade.cpp:

(WebCore::FontCascade::hasValidAverageCharWidth const): Use a SortedArraySet,
which should be similar in performance and uses no heap or read/write memory

  • platform/graphics/FontPlatformData.cpp:

(WebCore::makeOptionalFromPointer): Deleted. Moved to SortedArrayMap.h.

  • platform/graphics/HEVCUtilities.cpp:

(WebCore::makeOptionalFromPointer): Deleted. Moved to SortedArrayMap.h.

  • platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:

(WebCore::AVAssetMIMETypeCache::initializeCache): Updated for function name change.

  • platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:

Tweaked use of UNUSED_PARAM a bit across the file, relying on omitted names instead.

  • platform/graphics/cg/UTIRegistry.cpp:

(WebCore::defaultSupportedImageTypes): Use a constexpr array rather than HashSet,
on something just iterating this, not using it as a set.

  • platform/graphics/cocoa/SourceBufferParserWebM.cpp:

(WebCore::SourceBufferParserWebM::supportedMIMETypes): Renamed from webmMIMETypes,
changed to return a Span so we don't have to allocate a HashSet, since callers
simply iterate this, and don't do set operations.
(WebCore::SourceBufferParserWebM::isSupportedVideoCodec): Replaced the
supportedVideoCodecs with this. We don't need a HashSet to check for two values,
and this should be faster and use less memory.
(WebCore::SourceBufferParserWebM::isSupportedAudioCodec): Ditto.

  • platform/graphics/cocoa/SourceBufferParserWebM.h: Updated for the changes above.
  • rendering/svg/SVGResources.cpp:

(WebCore::tagSet): Added this helper to make the code in the functions below less
repetitive.
(WebCore::clipperFilterMaskerTags): Use a constexpr array instead of many separate
calls to HashSet::add to construct the set.
(WebCore::markerTags): Ditto.
(WebCore::fillAndStrokeTags): Ditto.
(WebCore::chainableResourceTags): Ditto.

Source/WebKit:

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::ResourceLoadStatisticsDatabaseStore::sortedTables): Simplify unnecessarily complicated
expression to initialize the Span.

  • Shared/Cocoa/DefaultWebBrowserChecks.h: Return a Span instead of an optional Vector.
  • Shared/Cocoa/DefaultWebBrowserChecks.mm:

(WebKit::appBoundDomainsForTesting): Renamed from getAppBoundDomainsTesting to fit WebKit
coding style a bit better, and be a little more grammatical. Removed an un-needed HashMap
that had only a single entry, used a NeverDestroyed std::array rather than a Vector so we
don't use any heap or read/write memory.

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::addTestDomains const): Rewrite to use the function above.
Fewer special cases needed since we are just using an empty Span, which efficiently
does nothing, so no need to have a distinct null value.

Source/WTF:

  • wtf/SortedArrayMap.h:

(WTF::SortedArrayMap<ArrayType>::contains const): Added. More elegant than calling tryGet and
treating the pointer as a boolean.
(WTF::makeOptionalFromPointer): Moved here so it can be reused. Might rename later, since it's
only used in a few places.

2:50 PM Changeset in webkit [287231] by Adrian Perez de Castro
  • 3 edits in releases/WebKitGTK/webkit-2.34/Source/WebCore

Unreviewed non-unified build fixes.

  • loader/DocumentWriter.cpp: Add missing DocumentLoader.h header.
  • page/PerformanceNavigationTiming.cpp: Remove "#pragma once" from non-header file.
1:34 PM Changeset in webkit [287230] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebCore

Use smart pointers for WebCoreNSURLSessionDataTask ObjC members
https://bugs.webkit.org/show_bug.cgi?id=234477
<rdar://79224869>

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

Seems like a smart thing to do.

  • platform/network/cocoa/WebCoreNSURLSession.h:
  • platform/network/cocoa/WebCoreNSURLSession.mm:

(-[WebCoreNSURLSessionDataTask originalRequest]):
(-[WebCoreNSURLSessionDataTask setOriginalRequest:]):
(-[WebCoreNSURLSessionDataTask currentRequest]):
(-[WebCoreNSURLSessionDataTask setCurrentRequest:]):
(-[WebCoreNSURLSessionDataTask error]):
(-[WebCoreNSURLSessionDataTask setError:]):
(-[WebCoreNSURLSessionDataTask taskDescription]):
(-[WebCoreNSURLSessionDataTask setTaskDescription:]):
(-[WebCoreNSURLSessionDataTask dealloc]):

12:30 PM Changeset in webkit [287229] by Chris Dumez
  • 12 edits in trunk/Source/WebKit

Move CacheStorage engines from NetworkProcess to NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=234448

Reviewed by Alex Christensen.

Move CacheStorage engines from NetworkProcess to NetworkSession, as they are per-session.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::~NetworkProcess): Deleted.
(WebKit::NetworkProcess::findCacheEngine): Deleted.
(WebKit::NetworkProcess::ensureCacheEngine): Deleted.
(WebKit::NetworkProcess::removeCacheEngine): Deleted.
(WebKit::NetworkProcess::cacheStorageRootPath): Deleted.
(WebKit::NetworkProcess::setCacheStorageParameters): Deleted.

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::invalidateAndCancel):
(WebKit::NetworkSession::ensureCacheEngine):
(WebKit::NetworkSession::clearCacheEngine):

  • NetworkProcess/NetworkSession.h:

(WebKit::NetworkSession::cacheEngine):

  • NetworkProcess/cache/CacheStorageEngine.cpp:

(WebKit::CacheStorage::Engine::create):
(WebKit::CacheStorage::Engine::fetchEntries):
(WebKit::CacheStorage::Engine::open):
(WebKit::CacheStorage::Engine::remove):
(WebKit::CacheStorage::Engine::retrieveCaches):
(WebKit::CacheStorage::Engine::retrieveRecords):
(WebKit::CacheStorage::Engine::putRecords):
(WebKit::CacheStorage::Engine::deleteMatchingRecords):
(WebKit::CacheStorage::Engine::lock):
(WebKit::CacheStorage::Engine::unlock):
(WebKit::CacheStorage::Engine::clearMemoryRepresentation):
(WebKit::CacheStorage::Engine::representation):
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):
(WebKit::CacheStorage::Engine::Engine):
(WebKit::CacheStorage::Engine::from): Deleted.
(WebKit::CacheStorage::Engine::destroyEngine): Deleted.

  • NetworkProcess/cache/CacheStorageEngine.h:
  • NetworkProcess/cache/CacheStorageEngineConnection.cpp:

(WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):
(WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
(WebKit::CacheStorageEngineConnection::engineRepresentation):

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/Network/NetworkProcessProxy.messages.in:
12:11 PM Changeset in webkit [287228] by Simon Fraser
  • 26 edits in trunk

Read the default value of the ScrollAnimatorEnabled setting from NSUserDefaults
https://bugs.webkit.org/show_bug.cgi?id=234456

Reviewed by Tim Horton.

Source/WebCore:

It's impossible for a test to run with an animated keyboard scroll because platformAllowsScrollAnimation(),
which reads from NSUserDefaults, always trumps the Setting.

Fix by initializing the setting from NSUserDefaults and removing the platformAllowsScrollAnimation()
check. This allows for a WebKitTestRunner test override the setting. Remove the WTR code
that sets @"NSScrollAnimationEnabled" to @NO.

Unfortunately in WebKitLegacy AppKit code consults the @"NSScrollAnimationEnabled" key, so
DumpRenderTree has to continue to initialize this NSUserDefault to @NO and tests that
try to change the Setting will fail.

  • platform/ScrollAnimator.cpp:

(WebCore::ScrollAnimator::singleAxisScroll):
(WebCore::ScrollAnimator::scrollAnimationEnabled const):

  • platform/ScrollAnimator.h:

(WebCore::ScrollAnimator::platformAllowsScrollAnimation const): Deleted.

  • platform/mac/ScrollAnimatorMac.h:
  • platform/mac/ScrollAnimatorMac.mm:

(WebCore::ScrollAnimatorMac::platformAllowsScrollAnimation const): Deleted.

Source/WebKit:

It's impossible for a test to run with an animated keyboard scroll because platformAllowsScrollAnimation(),
which reads from NSUserDefaults, always trumps the Setting.

Fix by initializing the setting from NSUserDefaults and removing the platformAllowsScrollAnimation()
check. This allows for a WebKitTestRunner test override the setting. Remove the WTR code
that sets @"NSScrollAnimationEnabled" to @NO.

Unfortunately in WebKitLegacy AppKit code consults the @"NSScrollAnimationEnabled" key, so
DumpRenderTree has to continue to initialize this NSUserDefault to @NO and tests that
try to change the Setting will fail.

  • Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:

(WebKit::defaultScrollAnimatorEnabled):

  • Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

It's impossible for a test to run with an animated keyboard scroll because platformAllowsScrollAnimation(),
which reads from NSUserDefaults, always trumps the Setting.

Fix by initializing the setting from NSUserDefaults and removing the platformAllowsScrollAnimation()
check. This allows for a WebKitTestRunner test override the setting.

Unfortunately in WebKitLegacy AppKit code consults the @"NSScrollAnimationEnabled" key, so
DumpRenderTree has to continue to initialize this NSUserDefault to @NO and tests that
try to change the Setting will fail.

  • WebView/WebPreferencesDefaultValues.h:
  • WebView/WebPreferencesDefaultValues.mm:

(WebKit::defaultScrollAnimatorEnabled):

Source/WTF:

It's impossible for a test to run with an animated keyboard scroll because platformAllowsScrollAnimation(),
which reads from NSUserDefaults, always trumps the Setting.

Fix by initializing the setting from NSUserDefaults and removing the platformAllowsScrollAnimation()
check. This allows for a WebKitTestRunner test override the setting. Remove the WTR code
that sets @"NSScrollAnimationEnabled" to @NO.

Unfortunately in WebKitLegacy AppKit code consults the @"NSScrollAnimationEnabled" key, so
DumpRenderTree has to continue to initialize this NSUserDefault to @NO and tests that
try to change the Setting will fail.

  • Scripts/Preferences/WebPreferences.yaml:

Tools:

It's impossible for a test to run with an animated keyboard scroll because platformAllowsScrollAnimation(),
which reads from NSUserDefaults, always trumps the Setting.

Fix by initializing the setting from NSUserDefaults and removing the platformAllowsScrollAnimation()
check. This allows for a WebKitTestRunner test override the setting.

Unfortunately in WebKitLegacy AppKit code consults the @"NSScrollAnimationEnabled" key, so
DumpRenderTree has to continue to initialize this NSUserDefault to @NO and tests that
try to change the Setting will fail.

  • WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:

(WTR::InjectedBundle::platformInitialize):

  • WebKitTestRunner/mac/main.mm:

(setDefaultsToConsistentValuesForTesting):

LayoutTests:

Now that ScrollAnimatorEnabled is true by default, turn it off for these tests.

  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal-with-keyboard-scaled.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal-with-keyboard.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-with-keyboard-scaled.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-with-keyboard.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe-horizontal-with-keyboard.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe-vertical-with-keyboard.html:
11:04 AM Changeset in webkit [287227] by Simon Fraser
  • 23 edits in trunk

Rename MockScrollAnimatorEnabled to MockScrollbarsControllerEnabled
https://bugs.webkit.org/show_bug.cgi?id=234452

Reviewed by Anders Carlsson.

The class formerly known as MockScrollAnimatorEnabled is used for logging when scrollbars
get events, so fix the name. It's a subclass of ScrollbarsController.

Source/WebCore:

  • page/FrameView.cpp:

(WebCore::FrameView::mockScrollbarsControllerEnabled const):
(WebCore::FrameView::logMockScrollbarsControllerMessage const):
(WebCore::FrameView::mockScrollAnimatorEnabled const): Deleted.
(WebCore::FrameView::logMockScrollAnimatorMessage const): Deleted.

  • page/FrameView.h:
  • platform/ScrollableArea.cpp:

(WebCore::ScrollableArea::scrollbarsController const):

  • platform/ScrollableArea.h:

(WebCore::ScrollableArea::mockScrollbarsControllerEnabled const):
(WebCore::ScrollableArea::logMockScrollbarsControllerMessage const):
(WebCore::ScrollableArea::mockScrollAnimatorEnabled const): Deleted.
(WebCore::ScrollableArea::logMockScrollAnimatorMessage const): Deleted.

  • platform/mock/ScrollbarsControllerMock.h:
  • rendering/RenderLayerScrollableArea.cpp:

(WebCore::RenderLayerScrollableArea::mockScrollbarsControllerEnabled const):
(WebCore::RenderLayerScrollableArea::logMockScrollbarsControllerMessage const):
(WebCore::RenderLayerScrollableArea::mockScrollAnimatorEnabled const): Deleted.
(WebCore::RenderLayerScrollableArea::logMockScrollAnimatorMessage const): Deleted.

  • rendering/RenderLayerScrollableArea.h:
  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::mockScrollbarsControllerEnabled const):
(WebCore::RenderListBox::logMockScrollbarsControllerMessage const):
(WebCore::RenderListBox::mockScrollAnimatorEnabled const): Deleted.
(WebCore::RenderListBox::logMockScrollAnimatorMessage const): Deleted.

  • rendering/RenderListBox.h:

Source/WTF:

  • Scripts/Preferences/WebPreferences.yaml:

Tools:

  • DumpRenderTree/TestOptions.cpp:

(WTR::TestOptions::defaults):

  • WebKitTestRunner/TestOptions.cpp:

(WTR::TestOptions::defaults):

LayoutTests:

  • fast/scrolling/scroll-animator-basic-events.html:
  • fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html:
  • fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html:
  • fast/scrolling/scroll-animator-select-list-events.html:
10:06 AM Changeset in webkit [287226] by Russell Epstein
  • 1 copy in tags/Safari-613.1.12.1

Tag Safari-613.1.12.1.

10:03 AM Changeset in webkit [287225] by Russell Epstein
  • 9 edits in branches/safari-613.1.12-branch/Source

Versioning.

WebKit-7613.1.12.1

9:46 AM Changeset in webkit [287224] by Chris Dumez
  • 39 edits in trunk/Source

Convert ProtectionSpace enums into enum classes
https://bugs.webkit.org/show_bug.cgi?id=234455

Reviewed by Alex Christensen.

Source/WebCore:

  • platform/network/CredentialStorage.cpp:

(WebCore::CredentialStorage::set):
(WebCore::CredentialStorage::removeCredentialsWithOrigin):
(WebCore::CredentialStorage::originsWithCredentials const):

  • platform/network/ProtectionSpace.h:

(WebCore::ProtectionSpace::ProtectionSpace):

  • platform/network/ProtectionSpaceBase.cpp:

(WebCore::ProtectionSpaceBase::ProtectionSpaceBase):
(WebCore::ProtectionSpaceBase::isProxy const):
(WebCore::ProtectionSpaceBase::receivesCredentialSecurely const):
(WebCore::ProtectionSpaceBase::isPasswordBased const):

  • platform/network/ProtectionSpaceBase.h:

(WebCore::ProtectionSpaceBase::serverType const):
(WebCore::ProtectionSpaceBase::authenticationScheme const):

  • platform/network/cf/AuthenticationCF.cpp:

(WebCore::createCF):
(WebCore::core):

  • platform/network/cf/ProtectionSpaceCFNet.h:

(WebCore::ProtectionSpace::ProtectionSpace):

  • platform/network/cf/ResourceHandleCFNet.cpp:

(WebCore::ResourceHandle::receivedCredential):

  • platform/network/cf/SocketStreamHandleImplCFNet.cpp:

(WebCore::authenticationSchemeFromAuthenticationMethod):

  • platform/network/cocoa/ProtectionSpaceCocoa.h:

(WebCore::ProtectionSpace::ProtectionSpace):

  • platform/network/cocoa/ProtectionSpaceCocoa.mm:

(WebCore::type):
(WebCore::scheme):
(WebCore::ProtectionSpace::nsSpace const):

  • platform/network/curl/AuthenticationChallenge.h:
  • platform/network/curl/AuthenticationChallengeCurl.cpp:

(WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
(WebCore::AuthenticationChallenge::protectionSpaceForServerTrust):
(WebCore::AuthenticationChallenge::authenticationSchemeFromCurlAuth):

  • platform/network/curl/CurlRequest.cpp:

(WebCore::CurlRequest::setAuthenticationScheme):

  • platform/network/curl/CurlRequest.h:
  • platform/network/curl/ProtectionSpaceCurl.h:

(WebCore::ProtectionSpace::ProtectionSpace):

  • platform/network/curl/ResourceHandleCurl.cpp:

(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):

  • platform/network/mac/ResourceHandleMac.mm:

(WebCore::ResourceHandle::receivedCredential):

  • platform/network/soup/AuthenticationChallengeSoup.cpp:

(WebCore::protectionSpaceServerTypeFromURL):
(WebCore::protectionSpaceFromSoupAuthAndURL):
(WebCore::protectionSpaceForClientCertificate):
(WebCore::protectionSpaceForClientCertificatePassword):

  • platform/network/soup/NetworkStorageSessionSoup.cpp:

(WebCore::schemeFromProtectionSpaceServerType):
(WebCore::authTypeFromProtectionSpaceAuthenticationScheme):

Source/WebKit:

  • NetworkProcess/NetworkCORSPreflightChecker.cpp:

(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):

  • NetworkProcess/NetworkLoad.cpp:

(WebKit::NetworkLoad::didReceiveChallenge):

  • NetworkProcess/PingLoad.cpp:

(WebKit::PingLoad::didReceiveChallenge):

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):

  • NetworkProcess/curl/NetworkDataTaskCurl.cpp:

(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::restartWithCredential):

  • NetworkProcess/soup/NetworkDataTaskSoup.cpp:

(WebKit::NetworkDataTaskSoup::completeAuthentication):
(WebKit::NetworkDataTaskSoup::cancelAuthentication):

  • Shared/Authentication/AuthenticationManager.cpp:

(WebKit::canCoalesceChallenge):

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<ProtectionSpace>::decode):

  • Shared/curl/WebCoreArgumentCodersCurl.cpp:

(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):

  • UIProcess/API/C/WKAPICast.h:

(WebKit::toAPI):

  • UIProcess/API/glib/WebKitAuthenticationRequest.cpp:

(webkit_authentication_request_get_security_origin):

  • UIProcess/Authentication/WebProtectionSpace.cpp:

(WebKit::WebProtectionSpace::serverType const):
(WebKit::WebProtectionSpace::authenticationScheme const):

  • UIProcess/Authentication/WebProtectionSpace.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::processAuthenticationChallenge):
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):

Source/WebKitLegacy/mac:

  • WebCoreSupport/WebFrameLoaderClient.mm:

(WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):

Source/WebKitLegacy/win:

  • WebURLProtectionSpace.cpp:

(WebURLProtectionSpace::authenticationMethod):
(coreScheme):
(WebURLProtectionSpace::initWithHost):
(WebURLProtectionSpace::initWithProxyHost):

9:18 AM Changeset in webkit [287223] by Chris Dumez
  • 8 edits
    1 delete in trunk/Tools

Drop ServiceWorkerTCPServer and use HTTPServer instead
https://bugs.webkit.org/show_bug.cgi?id=234443
<rdar://86646140>

Reviewed by Alex Christensen.

Drop ServiceWorkerTCPServer and use HTTPServer instead. ServiceWorkerTCPServer relies on TCPServer which is
known to cause flakiness and sometimes hang in its destruction.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/AppPrivacyReport.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerTCPServer.h: Removed.

(): Deleted.
(ServiceWorkerTCPServer::ServiceWorkerTCPServer): Deleted.
(ServiceWorkerTCPServer::request): Deleted.
(ServiceWorkerTCPServer::requestWithLocalhost): Deleted.
(ServiceWorkerTCPServer::requestWithFragment): Deleted.
(ServiceWorkerTCPServer::userAgentsChecked const): Deleted.
(ServiceWorkerTCPServer::respondToRequests): Deleted.
(ServiceWorkerTCPServer::requestWithURLString): Deleted.

  • TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm:
  • TestWebKitAPI/cocoa/HTTPServer.h:
  • TestWebKitAPI/cocoa/HTTPServer.mm:

(TestWebKitAPI::HTTPServer::scheme const):
(TestWebKitAPI::HTTPServer::request const):
(TestWebKitAPI::HTTPServer::requestWithLocalhost const):

7:11 AM Changeset in webkit [287222] by Antti Koivisto
  • 10 edits in trunk/Source/WebCore

Remove unused :-internal-direct-focus pseudo-class
https://bugs.webkit.org/show_bug.cgi?id=234431

Reviewed by Alexey Shvayka.

It was replaced by :focus-visible on the user-agent stylesheet.

  • css/CSSSelector.cpp:

(WebCore::CSSSelector::selectorText const):

  • css/CSSSelector.h:
  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::checkOne const):

  • css/SelectorCheckerTestFunctions.h:

(WebCore::matchesLegacyDirectFocusPseudoClass):
(WebCore::matchesFocusVisiblePseudoClass):
(WebCore::matchesDirectFocusPseudoClass): Deleted.

  • css/SelectorPseudoClassAndCompatibilityElementMap.in:
  • css/parser/CSSSelectorParser.cpp:

(WebCore::CSSSelectorParser::consumePseudo):

  • cssjit/SelectorCompiler.cpp:

(WebCore::SelectorCompiler::addPseudoClassType):

  • dom/Element.cpp:

(WebCore::Element::setFocus):

  • style/RuleSet.cpp:

(WebCore::Style::RuleSet::addRule):

3:19 AM Changeset in webkit [287221] by ysuzuki@apple.com
  • 8 edits in trunk/Source/JavaScriptCore

[JSC] Do not allocate m_bbqCallee and m_omgCallee until it becomes necessary
https://bugs.webkit.org/show_bug.cgi?id=234457

Reviewed by Saam Barati.

WebAssembly memory import will require initializing both Wasm::CalleeGroup.
So, we should shrink memory size of Wasm::CalleeGroup as much as possible
to avoid memory regression. This patch allocates m_bbqCallee and m_omgCallee
only when it becomes available.

  • wasm/WasmBBQPlan.cpp:

(JSC::Wasm::BBQPlan::work):

  • wasm/WasmCalleeGroup.cpp:

(JSC::Wasm::CalleeGroup::CalleeGroup):

  • wasm/WasmCalleeGroup.h:

(JSC::Wasm::CalleeGroup::compilationFinished): Deleted.
(JSC::Wasm::CalleeGroup::runnable): Deleted.
(JSC::Wasm::CalleeGroup::errorMessage): Deleted.
(JSC::Wasm::CalleeGroup::functionImportCount const): Deleted.
(JSC::Wasm::CalleeGroup::embedderEntrypointCalleeFromFunctionIndexSpace): Deleted.
(JSC::Wasm::CalleeGroup::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted.
(JSC::Wasm::CalleeGroup::wasmBBQCalleeFromFunctionIndexSpace): Deleted.
(JSC::Wasm::CalleeGroup::entrypointLoadLocationFromFunctionIndexSpace): Deleted.
(JSC::Wasm::CalleeGroup::wasmToWasmExitStub): Deleted.
(JSC::Wasm::CalleeGroup::mode const): Deleted.

  • wasm/WasmOMGForOSREntryPlan.cpp:

(JSC::Wasm::OMGForOSREntryPlan::work):

  • wasm/WasmOMGPlan.cpp:

(JSC::Wasm::OMGPlan::work):

  • wasm/WasmPlan.cpp:

(JSC::Wasm::Plan::updateCallSitesToCallUs):

  • wasm/WasmPlan.h:
2:17 AM Changeset in webkit [287220] by ysuzuki@apple.com
  • 21 edits
    5 adds in trunk

[WTF] Introduce TrailingArray
https://bugs.webkit.org/show_bug.cgi?id=234201

Reviewed by Darin Adler.

Source/JavaScriptCore:

Use ThreadSafeRefCountedFixedVector in ObjectPropertyConditionSet and Wasm::LLIntCallees.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::baselineJITConstantPool):

  • bytecode/ObjectPropertyConditionSet.cpp:

(JSC::ObjectPropertyConditionSet::mergedWith const):
(JSC::ObjectPropertyConditionSet::dumpInContext const):
(JSC::ObjectPropertyConditionSet::isValidAndWatchable const):

  • bytecode/ObjectPropertyConditionSet.h:

(JSC::ObjectPropertyConditionSet::invalid):
(JSC::ObjectPropertyConditionSet::create):
(JSC::ObjectPropertyConditionSet::isValid const):
(JSC::ObjectPropertyConditionSet::size const):
(JSC::ObjectPropertyConditionSet::begin const):
(JSC::ObjectPropertyConditionSet::end const):
(JSC::ObjectPropertyConditionSet::ObjectPropertyConditionSet): Deleted.
(JSC::ObjectPropertyConditionSet::releaseRawPointer): Deleted.
(JSC::ObjectPropertyConditionSet::adoptRawPointer): Deleted.
(JSC::ObjectPropertyConditionSet::fromRawPointer): Deleted.
(JSC::ObjectPropertyConditionSet::Data::Data): Deleted.

  • jit/JIT.cpp:

(JSC::JIT::compileAndLinkWithoutFinalizing):

  • jit/JITInlines.h:

(JSC::JIT::loadConstant):

  • llint/LLIntOffsetsExtractor.cpp:
  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • wasm/WasmCallee.h:

(JSC::Wasm::LLIntCallees::create): Deleted.
(JSC::Wasm::LLIntCallees::at const): Deleted.
(JSC::Wasm::LLIntCallees::data const): Deleted.
(JSC::Wasm::LLIntCallees::LLIntCallees): Deleted.

  • wasm/WasmCodeBlock.cpp:

(JSC::Wasm::CodeBlock::create):
(JSC::Wasm::CodeBlock::CodeBlock):

  • wasm/WasmCodeBlock.h:
  • wasm/WasmModule.cpp:

(JSC::Wasm::Module::Module):
(JSC::Wasm::Module::getOrCreateCodeBlock):

  • wasm/WasmModule.h:

Source/WTF:

This patch implements TrailingArray<Derived, T>, which allows us to implement class
with trailing array easily. By using this, we implement EmbeddedFixedVector and RefCountedFixedVector.
Plus, we replace underlying implementation of FixedVector from RefCountedArray to EmbeddedFixedVector
since ref-counting is not necessary. This is great for swapping: while RefCountedArray will decrease ref
and touching memory when destryoing, EmbeddedFixedVector does not, so we can keep memory untouched if
EmbeddedFixedVector's T is POD when destroying.

In a subsequent patch, we will remove RefCountedArray and use RefCountedFixedVector since RefCountedFixedVector
is following normal Ref / RefPtr protocol, so easy to understand the semantics.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/CMakeLists.txt:
  • wtf/EmbeddedFixedVector.h: Added.
  • wtf/FixedVector.h:

(WTF::FixedVector::FixedVector):
(WTF::FixedVector::operator=):
(WTF::FixedVector::size const):
(WTF::FixedVector::isEmpty const):
(WTF::FixedVector::byteSize const):
(WTF::FixedVector::data):
(WTF::FixedVector::begin):
(WTF::FixedVector::end):
(WTF::FixedVector::rbegin):
(WTF::FixedVector::rend):
(WTF::FixedVector::rbegin const):
(WTF::FixedVector::rend const):
(WTF::FixedVector::at):
(WTF::FixedVector::at const):
(WTF::FixedVector::operator[]):
(WTF::FixedVector::operator[] const):
(WTF::FixedVector::fill):
(WTF::FixedVector::operator!= const):
(WTF::FixedVector::operator== const):
(WTF::FixedVector::swap):
(WTF::FixedVector::getStorage):

  • wtf/RefCountedFixedVector.h: Added.
  • wtf/TrailingArray.h: Added.

(WTF::TrailingArray::TrailingArray):
(WTF::TrailingArray::~TrailingArray):
(WTF::TrailingArray::allocationSize):
(WTF::TrailingArray::size const):
(WTF::TrailingArray::isEmpty const):
(WTF::TrailingArray::byteSize const):
(WTF::TrailingArray::data):
(WTF::TrailingArray::data const):
(WTF::TrailingArray::begin):
(WTF::TrailingArray::end):
(WTF::TrailingArray::begin const):
(WTF::TrailingArray::end const):
(WTF::TrailingArray::cbegin const):
(WTF::TrailingArray::cend const):
(WTF::TrailingArray::rbegin):
(WTF::TrailingArray::rend):
(WTF::TrailingArray::rbegin const):
(WTF::TrailingArray::rend const):
(WTF::TrailingArray::crbegin const):
(WTF::TrailingArray::crend const):
(WTF::TrailingArray::at):
(WTF::TrailingArray::at const):
(WTF::TrailingArray::operator[]):
(WTF::TrailingArray::operator[] const):
(WTF::TrailingArray::first):
(WTF::TrailingArray::first const):
(WTF::TrailingArray::last):
(WTF::TrailingArray::last const):
(WTF::TrailingArray::fill):
(WTF::TrailingArray::offsetOfSize):
(WTF::TrailingArray::offsetOfData):

Tools:

  • TestWebKitAPI/CMakeLists.txt:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WTF/EmbeddedFixedVector.cpp: Added.

(TestWebKitAPI::TEST):
(TestWebKitAPI::DestructorObserver::DestructorObserver):
(TestWebKitAPI::DestructorObserver::~DestructorObserver):
(TestWebKitAPI::DestructorObserver::operator=):

  • TestWebKitAPI/Tests/WTF/FixedVector.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WTF/RefCountedFixedVector.cpp: Added.

(TestWebKitAPI::TEST):
(TestWebKitAPI::DestructorObserver::DestructorObserver):
(TestWebKitAPI::DestructorObserver::~DestructorObserver):
(TestWebKitAPI::DestructorObserver::operator=):

Dec 17, 2021:

9:45 PM Changeset in webkit [287219] by Wenson Hsieh
  • 4 edits in trunk/Source/WebCore

Hide viewport-constrained elements that are detected by ModalContainerObserver
https://bugs.webkit.org/show_bug.cgi?id=234216

Reviewed by Tim Horton.

Make a small Style::Adjuster tweak to hide (i.e. set display: none;) on an element that is tagged as the
current "modal container" on ModalContainerObserver. See #234214 for more details.

  • page/ModalContainerObserver.cpp:

(WebCore::ModalContainerObserver::updateModalContainerIfNeeded):

Additionally invalidate style when setting m_container here, so that the style adjuster can kick in and set
display: none; on a modal container after it is detected.

(WebCore::ModalContainerObserver::shouldHide):

  • page/ModalContainerObserver.h:
  • style/StyleAdjuster.cpp:

(WebCore::Style::Adjuster::adjust const):

7:35 PM Changeset in webkit [287218] by sbarati@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

Use IRC by default on arm64
https://bugs.webkit.org/show_bug.cgi?id=234449

Reviewed by Yusuke Suzuki.

I'm seeing a Wasm perf improvement on some benchmarks of ~12% by switching
from Briggs to IRC. Let's make IRC the default on arm64.

  • b3/air/AirAllocateRegistersByGraphColoring.cpp:
  • b3/air/AirAllocateRegistersByGraphColoring.h:

(JSC::B3::Air::useIRC): Deleted.

7:06 PM Changeset in webkit [287217] by Wenson Hsieh
  • 10 edits
    2 adds in trunk/Source

Add support for detecting modal containers that contain a given search term
https://bugs.webkit.org/show_bug.cgi?id=234214

Reviewed by Tim Horton and Devin Rousso.

Source/WebCore:

Introduce ModalContainerObserver (a helper class that searches for a substring vended by the client layer in
text inside viewport-constrained renderers). If found, we keep track of the viewport-constrained container with
the matching text for use in future patches.

There is no change in behavior yet.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp:

(WebCore::Document::modalContainerObserver):

Returns the document's ModalContainerObserver, creating it only if needed (per the modal container observation
policy vended by the client).

(WebCore::Document::modalContainerObserverIfExists const):

  • dom/Document.h:
  • page/ChromeClient.h:

(WebCore::ChromeClient::searchStringForModalContainerObserver const):

  • page/FrameView.cpp:

(WebCore::FrameView::performPostLayoutTasks):

Add a hook to create and call into ModalContainerObserver to search for a modal container (if necessary).

  • page/ModalContainerObserver.cpp: Added.

(WebCore::ModalContainerObserver::isNeededFor):

Add a helper method to determine whether this "modal container observer" should be created and used for the
current document.

(WebCore::matchesSearchTerm):
(WebCore::ModalContainerObserver::updateModalContainerIfNeeded):

Iterates through all viewport-constrained render objects in the FrameView, in search of one that matches the
search term given by the client. This currently ensures that we only search any viewport-constrained element at
most once by maintaining a weak m_elementsToIgnoreWhenSearching set, but we may need a mechanism in the future
to remove elements from this set upon changing text content.

  • page/ModalContainerObserver.h: Added.

Source/WebKit:

Add a WebKitAdditions hook that implements a new chrome client method. See WebCore/ChangeLog for more details.

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::searchStringForModalContainerObserver const):

  • WebProcess/WebCoreSupport/WebChromeClient.h:
6:30 PM Changeset in webkit [287216] by ysuzuki@apple.com
  • 2 edits in trunk/Source/bmalloc

Unreviewed, pas_probabilistic_guard_malloc_allocator.c is broken when LIBPAS is not enabled
https://bugs.webkit.org/show_bug.cgi?id=234415

  • libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c:
6:09 PM Changeset in webkit [287215] by ysuzuki@apple.com
  • 3 edits in trunk/Source/bmalloc

Unreviewed, CMakeLists is missing pas_probabilistic_guard_malloc_allocator.[ch]
https://bugs.webkit.org/show_bug.cgi?id=234415

  • CMakeLists.txt:
  • libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c:
5:13 PM Changeset in webkit [287214] by ysuzuki@apple.com
  • 2 edits in trunk/Source/bmalloc

[libpas] Use inline-assembly ARM64 code in GCC too
https://bugs.webkit.org/show_bug.cgi?id=234450

Reviewed by Saam Barati.

Same problem to r287168 can happen in GCC too. Use inline assembly version
of CAS operation on ARM64 in GCC too. We also use ARM_FEATURE_ATOMICS
to determine whether LSE atomics is enabled further (but since this is very
new macro, we continue using the old check too).

  • libpas/src/libpas/pas_utils.h:

(pas_atomic_store_uint8):
(pas_compare_and_swap_uint8_weak):
(pas_compare_and_swap_uint8_strong):
(pas_compare_and_swap_uint16_weak):
(pas_compare_and_swap_uint32_weak):
(pas_compare_and_swap_uint32_strong):
(pas_compare_and_swap_uint64_weak):
(pas_compare_and_swap_uint64_strong):
(pas_compare_and_swap_pair_weak):
(pas_compare_and_swap_pair_strong):
(pas_atomic_store_pair):

4:27 PM Changeset in webkit [287213] by mmaxfield@apple.com
  • 2 edits in trunk/Source/WebCore

Add comment to r287208.
https://bugs.webkit.org/show_bug.cgi?id=234428

Unreviewed.

No new tests because there is no behavior change.

  • platform/graphics/WidthIterator.cpp:

(WebCore::WidthIterator::applyCSSVisibilityRules):

3:20 PM Changeset in webkit [287212] by Alan Coon
  • 2 edits in branches/safari-612-branch/Source/WebKit

Apply patch. rdar://problem/86635432

3:17 PM Changeset in webkit [287211] by Alan Coon
  • 8 edits in branches/safari-612-branch/Source

Versioning.

WebKit-7612.4.7

2:48 PM Changeset in webkit [287210] by Adrian Perez de Castro
  • 5 edits in releases/WebKitGTK/webkit-2.34

Merge r282084 - [wpt-improvement] Improve CSP support for window reuse
https://bugs.webkit.org/show_bug.cgi?id=229882
<rdar://78416553>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaseline a test that now passes.

  • web-platform-tests/content-security-policy/sandbox/window-reuse-sandboxed-expected.txt:

Source/WebCore:

If window.open is used to host content with a CSP sandbox header, we should always
create a new window, rather than reusing the existing one, unless the header
includes 'allow-same-site'.

This improves our WPT score.

Tested by: imported/w3c/web-platform-tests/content-security-policy/sandbox/window-reuse-sandboxed.html

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::responseReceived): Parse the HTTP headers earlier so we can
make decisions based on their state.

  • loader/DocumentWriter.cpp:

(WebCore::DocumentWriter::begin): Don't reuse the current window if 'allow-same-site'
is not allowed.

2:48 PM Changeset in webkit [287209] by Adrian Perez de Castro
  • 8 edits in releases/WebKitGTK/webkit-2.34

Merge r281941 - [COOP] html/cross-origin-opener-policy/coop-navigate-same-origin-csp-sandbox.html WPT test is failing
https://bugs.webkit.org/show_bug.cgi?id=229716

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

  • web-platform-tests/html/cross-origin-opener-policy/coop-navigate-same-origin-csp-sandbox-expected.txt:

Source/WebCore:

The COOP algorithm is relying on the response origin for some of the checks. We were computing the
response origin via SecurityOrigin::create(response.url()), which worked fine in most cases.
However, the response may contain a CSP header, which could set sandbox flags. If sandbox flags
are set, the response origin should be unique, not the origin of the response URL. This patch fixes
that.

No new tests, rebaselined existing WPT test.

  • loader/DocumentLoader.cpp:

(WebCore::computeResponseOriginAndCOOP):
(WebCore::DocumentLoader::doCrossOriginOpenerHandlingOfResponse):

  • loader/DocumentLoader.h:

(WebCore::DocumentLoader::contentSecurityPolicy const):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::didBeginDocument):

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::ContentSecurityPolicy::copyStateFrom):
(WebCore::ContentSecurityPolicy::didReceiveHeaders):

  • page/csp/ContentSecurityPolicy.h:

(WebCore::ContentSecurityPolicy::sandboxFlags const):

2:41 PM Changeset in webkit [287208] by mmaxfield@apple.com
  • 3 edits in trunk/Source/WebCore

Refactor WidthIterator::applyCSSVisibilityRules() to be a little more elegant
https://bugs.webkit.org/show_bug.cgi?id=234428

Reviewed by Alan Bujtas.

This adds a few lambda operations in this function:

  • adjustForSyntheticBold()
  • clobberGlyph()
  • clobberAdvance()
  • deleteGlyph()

And then updates the rest of the function to use those operations. I think this makes
the body of the function a little easier to understand, because the code uses a higher
level of abstraction. It shoudln't be any slower, though, because the lambdas can all
be inlined to the same code that was there before.

No new tests because there is no behavior change.

  • platform/graphics/WidthIterator.cpp:

(WebCore::WidthIterator::applyCSSVisibilityRules):
(WebCore::WidthIterator::adjustForSyntheticBold): Deleted.

  • platform/graphics/WidthIterator.h:
2:25 PM Changeset in webkit [287207] by sihui_liu@apple.com
  • 7 edits in trunk/Source

Add custom copy() method for Ref<T> to CrossThreadCopier
https://bugs.webkit.org/show_bug.cgi?id=234411

Reviewed by Youenn Fablet.

Source/WebCore:

  • Modules/filesystemaccess/FileSystemStorageConnection.h:
  • Modules/filesystemaccess/WorkerFileSystemStorageConnection.cpp:

(WebCore::WorkerFileSystemStorageConnection::getFileHandle):
(WebCore::WorkerFileSystemStorageConnection::getDirectoryHandle):
(WebCore::WorkerFileSystemStorageConnection::getHandle):
(WebCore::WorkerFileSystemStorageConnection::didGetHandleWithType): Deleted.

  • Modules/filesystemaccess/WorkerFileSystemStorageConnection.h:

Source/WTF:

  • wtf/CrossThreadCopier.cpp:
  • wtf/CrossThreadCopier.h:
2:09 PM Changeset in webkit [287206] by mmaxfield@apple.com
  • 5 edits
    2 adds in trunk/Source/WebCore

Deduplicate code in RenderText::computePreferredLogicalWidths()
https://bugs.webkit.org/show_bug.cgi?id=234424

Reviewed by Alan Bujtas.

We have 3 places with code of this form:

float result;
std::optional<float> wordTrailingSpaceWidth;
if (currentCharacterIsSpace)

wordTrailingSpaceWidth = wordTrailingSpace.width(fallbackFonts);

if (wordTrailingSpaceWidth)

result = measureText(startingCharacterIndex, length + 1) - wordTrailingSpaceWidth.value();

else

result = measureText(startingCharacterIndex, length);

This patch simply deduplicates this logic, and puts it into a single function:
RenderText::measureTextConsideringPossibleTrailingSpace(). Because the different places which call it
use different text measurement functions, this function accepts a "measure text" callback.

No new tests because there is no behavior change.

  • WebCore.xcodeproj/project.pbxproj:
  • rendering/RenderText.cpp:

(WebCore::RenderText::widthFromCacheConsideringPossibleTrailingSpace const):
(WebCore::RenderText::maxWordFragmentWidth):
(WebCore::RenderText::computePreferredLogicalWidths):

  • rendering/RenderText.h:
  • rendering/RenderTextInlines.h: Added. This function needs to be able to see into WordTrailingSpace,

but we shouldn't be adding any more #includes to RenderText.h because doing so will increase the build time.
So, instead, we can move this templated function to a new Inlines header, and have callers include that
header.
(WebCore::RenderText::measureTextConsideringPossibleTrailingSpace):

  • rendering/line/BreakingContext.h:

(WebCore::BreakingContext::textWidthConsideringPossibleTrailingSpace):
(WebCore::BreakingContext::computeAdditionalBetweenWordsWidth):
(WebCore::WordTrailingSpace::WordTrailingSpace): Deleted.
(WebCore::WordTrailingSpace::width): Deleted.

  • rendering/line/WordTrailingSpace.h: Added. BreakingContext.h defines WordTrailingSpace, but it needs

to be able to call measureTextConsideringPossibleTrailingSpace(), which needs to be able to see inside
WordTrailingSpace. Avoid the circular dependency by splitting out WordTrailingSpace into its own file.
(WebCore::WordTrailingSpace::WordTrailingSpace):
(WebCore::WordTrailingSpace::width):

1:51 PM Changeset in webkit [287205] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Use the inline box's direction to decide if start/end decorations should be applied on first/last box
https://bugs.webkit.org/show_bug.cgi?id=234423

Reviewed by Antti Koivisto.

  • layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):

1:39 PM Changeset in webkit [287204] by Fujii Hironori
  • 3 edits in trunk/Source/ThirdParty/ANGLE

[ANGLE] "WARN: driver_utils.cpp:169 (rx::GetVendorString):! Unimplemented: rx::GetVendorString" on WinCairo debug testing bot
https://bugs.webkit.org/show_bug.cgi?id=234371

Reviewed by Kenneth Russell.

After r286603 updated ANGLE, WinCairo debug testing bot was
observing annoying warning message for all WebGL tessts.

WARN: driver_utils.cpp:169 (rx::GetVendorString): ! Unimplemented: rx::GetVendorString(..\..\Source\ThirdParty\ANGLE\src\libANGLE\renderer\driver_utils.cpp:169)

The vendor ID was 0x1414 (Microsoft).
<https://pcisig.com/membership/member-companies>

  • src/libANGLE/renderer/driver_utils.cpp:

(rx::GetVendorString): Added more vendor strings for vendor IDs.

  • src/libANGLE/renderer/driver_utils.h: Added VENDOR_ID_MICROSOFT.
1:05 PM Changeset in webkit [287203] by sbarati@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

Support WasmAddress in B3 CSE
https://bugs.webkit.org/show_bug.cgi?id=234051
<rdar://problem/86552957>

Reviewed by Filip Pizlo and Yusuke Suzuki.

This patch adds support in B3's CSE phase to handle WasmAddressValue computations.
The reason this can't partake in pure CSE is that WasmAddressValue reads pinned.
To support this, we keep track of which blocks write pinned. If we're trying to
replace a value V2 with V1 because it appears there is a redundancy, we check if
any paths from V1 to V2 write pinned. If none do, we proceed with the replacement.

  • b3/B3EliminateCommonSubexpressions.cpp:
12:55 PM Changeset in webkit [287202] by ysuzuki@apple.com
  • 2 edits in trunk/Tools

[JSC] Fix runscript's standalone ability to run
https://bugs.webkit.org/show_bug.cgi?id=234166

Reviewed by Mark Lam.

r286109 broke the ability to run runscript as a standalone script to test JSC stress test package on the device.
This patch reverts the ability back.

  • Scripts/jsc-stress-test-helpers/shell-runner.sh:
12:08 PM Changeset in webkit [287201] by Alan Bujtas
  • 2 edits in trunk/LayoutTests

Rebaseline after r287199.

Unreviewed.

  • platform/ios/fast/borders/rtl-border-05-expected.txt:
11:53 AM Changeset in webkit [287200] by Fujii Hironori
  • 2 edits in trunk/Source/WTF

MSVC reports "wtf/RetainPtr.h(196): error C3861: 'CFAutorelease': identifier not found " with /permissive- on Windows
https://bugs.webkit.org/show_bug.cgi?id=202842

Reviewed by Alex Christensen and Darin Adler.

MSVC /std:c++20 option implicitly enables /permissive- option.
However, RetainPtr.h can't compile because 'CFAutorelease' is not
defined.

CFAutorelease isn't available in AppleWin's CoreFoundation and
WinCairo's OpenCFLite as of now.

  • wtf/RetainPtr.h: Enclosed RetainPtr<T>::autorelease with #if !OS(WINDOWS).
11:44 AM Changeset in webkit [287199] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Adjust the box geometry for atomic/generic inline level boxes in bidi content
https://bugs.webkit.org/show_bug.cgi?id=234419

Reviewed by Antti Koivisto.

Both the display box and the BoxGeometry need to be updated while adjusting the content position with
the inline box offsets.

  • layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):

11:29 AM Changeset in webkit [287198] by commit-queue@webkit.org
  • 17 edits
    3 deletes in trunk

Remove API::Object::Type::BundlePageGroup
https://bugs.webkit.org/show_bug.cgi?id=225611

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

Source/WebKit:

Its last use was removed in rdar://77775952 and rdar://78783988

  • Shared/API/APIObject.h:
  • Shared/API/APIPageGroupHandle.cpp: Removed.
  • Shared/API/APIPageGroupHandle.h: Removed.
  • Shared/API/c/cg/WKImageCG.cpp:
  • Shared/Cocoa/APIObject.mm:

(API::Object::newObject):

  • Shared/UserData.cpp:

(WebKit::UserData::encode):
(WebKit::UserData::decode):

  • Shared/mac/MediaFormatReader/CoreMediaWrapped.cpp:
  • Sources.txt:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::transformHandlesToObjects):
(WebKit::WebProcessProxy::transformObjectsToHandles):

  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
  • WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm:

(-[WKWebProcessPlugInPageGroup identifier]): Deleted.
(-[WKWebProcessPlugInPageGroup dealloc]): Deleted.
(-[WKWebProcessPlugInPageGroup _apiObject]): Deleted.

  • WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h: Removed.
  • WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
  • WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:

(-[WKWebProcessPlugInBrowserContextController pageGroup]): Deleted.

  • WebProcess/WebPage/WebPageGroupProxy.h:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::transformHandlesToObjects):
(WebKit::WebProcess::transformObjectsToHandles):

Tools:

  • TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp:

(TestWebKitAPI::TEST):

10:58 AM Changeset in webkit [287197] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[LFC][IFC] Let computeIsFirstIsLastBoxForInlineContent update the IsFirstForLayoutBox on the display boxes
https://bugs.webkit.org/show_bug.cgi?id=234422

Reviewed by Antti Koivisto.

Currently we pre-compute these values and cache them on the display boxes (for later use in adjustVisualGeometryForDisplayBox).

  • layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):
(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

  • layout/formattingContexts/inline/InlineDisplayContentBuilder.h:
10:55 AM Changeset in webkit [287196] by clopez@igalia.com
  • 4 edits in trunk/LayoutTests

Unskip pointerevents layout tests
https://bugs.webkit.org/show_bug.cgi?id=233498

Unreviewed gardening.

This tests were skipped for all platforms.
Skip only globally the pointerevents/ios ones that seem to fail on
all platforms (even on iOS, at least on the open source builds).
On iOS also the ones imported from WPT fail but those work on
other platforms.

  • TestExpectations:
  • platform/ios-wk2/TestExpectations:
  • platform/win/TestExpectations:
10:11 AM Changeset in webkit [287195] by mmaxfield@apple.com
  • 3 edits in trunk/Source/WebCore

Refactor hyphenation logic in RenderText::computePreferredLogicalWidths()
https://bugs.webkit.org/show_bug.cgi?id=234421

Reviewed by Alan Bujtas.

The hyphenation logic in RenderText::computePreferredLogicalWidths() was split across two functions.
If you consider the word "ABC-DEF-GHI" (where the '-' characters are hyphenation opportunities), one
function, maxWordFragmentWidth() was responsible for calculating the width of "ABC-" and "DEF-" but
not "GHI". RenderText::computePreferredLogicalWidths() called that function, and after it returned,
would then calculate the width of "GHI", and compare that to the width returned by
maxWordFragmentWidth(). A much simpler design would be to have one function, maxWordFragmentWidth(),
handle all the hyphenation logic, and do all the calculation necessary to just return a single value
to RenderText::computePreferredLogicalWidths().

No new tests because there is no behavior change.

  • rendering/RenderText.cpp:

(WebCore::RenderText::maxWordFragmentWidth):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::maxWordFragmentWidth): Deleted.

  • rendering/RenderText.h:
10:02 AM Changeset in webkit [287194] by commit-queue@webkit.org
  • 3 edits
    2 adds in trunk

null ptr deref in WebCore::findPlaceForCounter
https://bugs.webkit.org/show_bug.cgi?id=234375

Patch by Gabriel Nava Marino <gnavamarino@apple.com> on 2021-12-17
Reviewed by Alan Bujtas.

Source/WebCore:

Test: fast/css/counters/findPlaceForCounter-parent-renderer-crash.html

When the current renderer's element is an HTML document and root of the tree, parentOrPseudoHostElement can return a nullptr,
so we need to check for nullptr before trying to access the renderer() of the Element pointer it returns.

  • rendering/RenderCounter.cpp:

(WebCore::findPlaceForCounter):

LayoutTests:

  • fast/css/counters/findPlaceForCounter-parent-renderer-crash-expected.txt: Added.
  • fast/css/counters/findPlaceForCounter-parent-renderer-crash.html: Added.
9:42 AM Changeset in webkit [287193] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

Tools/Scripts/run-perf-tests is failing on Speedometer2
https://bugs.webkit.org/show_bug.cgi?id=234426

Patch by Alexey Shvayka <ashvayka@apple.com> on 2021-12-17
Reviewed by Carlos Alberto Lopez Perez.

r282357 added a debug console warning regarding 'dppx' units, which is being emitted
for TodoMVC's stylesheets, thus failing metrics parsing in PerfTest. To fix the execution
of Speedometer2 suite, this particular warning has now been added to the ignore list.

  • Scripts/webkitpy/performance_tests/perftest.py:

(PerfTest):

9:31 AM Changeset in webkit [287192] by fpizlo@apple.com
  • 36 edits
    4 adds in trunk/Source/bmalloc

[libpas] update to b1531141d8d5831b0a37efb70f200f7e2c37ff3d (initial pgm support, refactorings to further distinguish exclusive from shared)
https://bugs.webkit.org/show_bug.cgi?id=234415

Reviewed by Yusuke Suzuki.

This includes two main changes:

  • Initial PGM support thanks to Brandon Stewart.
  • Refactorings to enable more differences in behavior between exclusive pages and shared pages. This is the only useful part of my attempt to add line allocation, which turned out not to be a win.
  • bmalloc.xcodeproj/project.pbxproj:
  • libpas/.gitignore:
  • libpas/libpas.xcodeproj/project.pbxproj:
  • libpas/src/libpas/jit_heap_config.c:

(jit_small_bitfit_create_page_header):
(jit_medium_bitfit_create_page_header):

  • libpas/src/libpas/jit_heap_config.h:
  • libpas/src/libpas/pas_bitfit_allocator.c:

(pas_bitfit_allocator_commit_view):

  • libpas/src/libpas/pas_bitfit_page.c:

(pas_bitfit_page_construct):
(pas_bitfit_page_verify):

  • libpas/src/libpas/pas_bitfit_page.h:

(pas_bitfit_page_offset_to_first_object):
(pas_bitfit_page_offset_to_end_of_last_object):

  • libpas/src/libpas/pas_bitfit_page_config.h:

(pas_bitfit_page_config_object_payload_end_offset_from_boundary):

  • libpas/src/libpas/pas_compact_tagged_void_ptr.h: Added.
  • libpas/src/libpas/pas_enumerate_segregated_heaps.c:

(enumerate_exclusive_view):
(enumerate_shared_view):
(enumerate_partial_view):

  • libpas/src/libpas/pas_heap_config_utils.h:
  • libpas/src/libpas/pas_local_allocator_inlines.h:

(pas_local_allocator_set_up_free_bits):

  • libpas/src/libpas/pas_page_base.c:

(pas_page_base_header_size):

  • libpas/src/libpas/pas_page_base.h:
  • libpas/src/libpas/pas_page_base_config.h:

(pas_page_base_config_is_bitfit):
(pas_page_base_config_object_payload_end_offset_from_boundary): Deleted.

  • libpas/src/libpas/pas_page_base_config_utils.h:
  • libpas/src/libpas/pas_page_base_config_utils_inlines.h:
  • libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c: Added.

(pas_probabilistic_guard_malloc_allocate):
(pas_probabilistic_guard_malloc_deallocate):
(pas_probabilistic_guard_malloc_trigger):
(pas_probabilistic_guard_malloc_can_use):
(pas_probabilistic_guard_malloc_should_use):
(pas_probabilistic_guard_malloc_get_free_virtual_memory):
(pas_probabilistic_guard_malloc_get_free_wasted_memory):

  • libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.h: Added.
  • libpas/src/libpas/pas_segregated_exclusive_view.c:

(compute_summary_impl):

  • libpas/src/libpas/pas_segregated_heap.c:

(compute_ideal_object_size):
(pas_segregated_heap_ensure_size_directory_for_size):

  • libpas/src/libpas/pas_segregated_page.c:

(pas_segregated_page_construct):
(pas_segregated_page_verify_granules):
(pas_segregated_page_verify_num_non_empty_words): Deleted.

  • libpas/src/libpas/pas_segregated_page.h:

(pas_segregated_page_header_size):
(pas_segregated_page_offset_from_page_boundary_to_first_object_for_hugging_mode):
(pas_segregated_page_offset_from_page_boundary_to_end_of_last_object_for_hugging_mode):
(pas_segregated_page_useful_object_payload_size_for_hugging_mode):
(pas_segregated_page_best_hugging_mode):
(pas_segregated_page_offset_from_page_boundary_to_first_object_exclusive):
(pas_segregated_page_offset_from_page_boundary_to_end_of_last_object_exclusive):
(pas_segregated_page_useful_object_payload_size):
(pas_segregated_page_number_of_objects):
(pas_segregated_page_bytes_dirtied_per_object):

  • libpas/src/libpas/pas_segregated_page_config.c:

(pas_segregated_page_config_validate):

  • libpas/src/libpas/pas_segregated_page_config.h:

(pas_segregated_page_config_payload_offset_for_role):
(pas_segregated_page_config_payload_size_for_role):
(pas_segregated_page_config_payload_end_offset_for_role):
(pas_segregated_page_config_object_payload_end_offset_from_boundary): Deleted.

  • libpas/src/libpas/pas_segregated_page_config_utils.h:
  • libpas/src/libpas/pas_segregated_page_inlines.h:

(pas_segregated_page_initialize_full_use_counts):
(pas_segregated_page_offset_from_page_boundary_to_first_object): Deleted.

  • libpas/src/libpas/pas_segregated_shared_view.c:

(pas_segregated_shared_view_commit_page):
(compute_summary):

  • libpas/src/libpas/pas_segregated_shared_view.h:

(pas_segregated_shared_view_can_bump):
(pas_segregated_shared_view_compute_new_bump):

  • libpas/src/libpas/pas_segregated_size_directory.c:

(pas_segregated_size_directory_enable_exclusive_views):

  • libpas/src/libpas/pas_segregated_view.c:

(for_each_live_object):
(should_be_eligible):

  • libpas/src/libpas/pas_segregated_view_allocator_inlines.h:

(pas_segregated_view_will_start_allocating):

  • libpas/src/libpas/pas_status_reporter.c:

(report_segregated_directory_contents):

  • libpas/src/libpas/pas_utility_heap_config.h:

(pas_utility_heap_create_page_header):

  • libpas/src/test/IsoHeapChaosTests.cpp:

(std::addTheTests):

  • libpas/src/test/PGMTests.cpp: Added.

(std::testPGMSingleAlloc):
(std::testPGMMultipleAlloc):
(std::testPGMErrors):
(addPGMTests):

  • libpas/src/test/TestHarness.cpp:

(main):

  • libpas/src/test/ThingyAndUtilityHeapAllocationTests.cpp:

(std::testFreeListRefillSpans):
(std::testSpuriousEligibility):

9:25 AM Changeset in webkit [287191] by Chris Dumez
  • 5 edits in trunk/Source/WebKit

Move storage managers from the NetworkProcess to the NetworkSession class
https://bugs.webkit.org/show_bug.cgi?id=234409

Reviewed by Alex Christensen.

Move storage managers from the NetworkProcess to the NetworkSession class since they are
per session.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::lowMemoryHandler):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::hasLocalStorage):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::resume):
(WebKit::NetworkProcess::syncLocalStorage):
(WebKit::NetworkProcess::clearStorage):
(WebKit::NetworkProcess::renameOriginInWebsiteData):
(WebKit::NetworkProcess::connectionToWebProcessClosed):
(WebKit::NetworkProcess::addStorageManagerForSession): Deleted.
(WebKit::NetworkProcess::removeStorageManagerForSession): Deleted.

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::invalidateAndCancel):
(WebKit::NetworkSession::lowMemoryHandler):
(WebKit::NetworkSession::addStorageManagerSession):

  • NetworkProcess/NetworkSession.h:

(WebKit::NetworkSession::storageManager):

9:13 AM Changeset in webkit [287190] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

Fix deprecation warning in Tools/Scripts/run-jsc-benchmarks
https://bugs.webkit.org/show_bug.cgi?id=234425

Patch by Alexey Shvayka <ashvayka@apple.com> on 2021-12-17
Reviewed by Alex Christensen.

Ruby 2.4 unified Fixnum and Bignum classes into Integer [1], deprecating them as
implementation details. To get rid of the deprecation console message, this patch replaces
Fixnum type checks with Integer, which is unobservable and backwards-compatible.

[1] https://bugs.ruby-lang.org/issues/12005

  • Scripts/run-jsc-benchmarks:
8:03 AM Changeset in webkit [287189] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Line spanning inline items should use InlineItem::opaqueBidiLevel
https://bugs.webkit.org/show_bug.cgi?id=234417

Reviewed by Antti Koivisto.

The visual order of the non-empty inline boxes are driven by their content and not by
their guessed bidi levels.

  • layout/formattingContexts/inline/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::initialize):

8:02 AM Changeset in webkit [287188] by Jonathan Bedard
  • 5 edits in trunk/Tools

[reporelaypy] Accept pull-request hooks
https://bugs.webkit.org/show_bug.cgi?id=234406
<rdar://problem/86598451>

Reviewed by Dewei Zhu.

  • Tools/Scripts/libraries/reporelaypy/reporelaypy/init.py: Bump version.
  • Tools/Scripts/libraries/reporelaypy/reporelaypy/hooks.py:

(HookProcessor):
(HookProcessor.is_valid): Check 'pull_request' hook format.

  • Tools/Scripts/libraries/reporelaypy/reporelaypy/tests/hooks_unittest.py:

(HooksUnittest.test_pull_request):

  • Tools/Scripts/libraries/reporelaypy/setup.py: Bump version.

Canonical link: https://commits.webkit.org/245355@main

8:01 AM Changeset in webkit [287187] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[LFC][IFC] Inline boxes set direction for both their content and their decoration unlike other inline level elements
https://bugs.webkit.org/show_bug.cgi?id=234418

Reviewed by Antti Koivisto.

<div>

<span dir=rtl style="border-inline-start: 10px solid yellow;">

<span dir=ltr style="border-inline-start: 10px solid green;">

<img style="border-inline-start: 10px solid blue;">

</span>

</span

</div>

produces a "green/blue/yellow" pattern in visual order.

  • layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::adjustVisualGeometryForDisplayBox):

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
(WebCore::LayoutIntegration::LineLayout::updateInlineBoxDimensions):

7:51 AM Changeset in webkit [287186] by graouts@webkit.org
  • 8 edits in trunk/Source/WebCore

ActiveDOMObject::suspendIfNeeded() should not be called within constructors
https://bugs.webkit.org/show_bug.cgi?id=233945

Reviewed by Chris Dumez.

Step 4 where we convert the only remaining call to suspendIfNeeded() in a constructor, AudioScheduledSourceNode,
to be in create() methods, in this case AudioScheduledSourceNode subclasses. This was the final step, all 145
calls to ActiveDOMObject::suspendIfNeeded() have been audited to not be made within a constructor.

  • Modules/webaudio/AudioBufferSourceNode.cpp:

(WebCore::AudioBufferSourceNode::create):

  • Modules/webaudio/AudioBufferSourceNode.h:
  • Modules/webaudio/AudioScheduledSourceNode.cpp:

(WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):

  • Modules/webaudio/AudioScheduledSourceNode.h:
  • Modules/webaudio/ConstantSourceNode.cpp:

(WebCore::ConstantSourceNode::create):

  • Modules/webaudio/OscillatorNode.cpp:

(WebCore::OscillatorNode::create):

  • Modules/webaudio/OscillatorNode.h:
7:41 AM Changeset in webkit [287185] by Chris Dumez
  • 2 edits in trunk/Source/WebKit

Unreviewed, reverting r286850.

Put r282794 back in. It turns out it was an overall
progression after all

Reverted changeset:

"Unreviewed, reverting r282794."
https://bugs.webkit.org/show_bug.cgi?id=230517
https://commits.webkit.org/r286850

7:17 AM Changeset in webkit [287184] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Simple RTL content may need visual reordering
https://bugs.webkit.org/show_bug.cgi?id=234380

Reviewed by Darin Adler and Antti Koivisto.

Addressing post-commit comment (r287142).

  • layout/formattingContexts/inline/InlineItemsBuilder.cpp:

(WebCore::Layout::InlineItemsBuilder::breakAndComputeBidiLevels):

6:22 AM Changeset in webkit [287183] by Adrian Perez de Castro
  • 7 edits in releases/WebKitGTK/webkit-2.34/Source

Merge r283444 - Remove JSC hack after r283410
https://bugs.webkit.org/show_bug.cgi?id=230261

Reviewed by Mark Lam.

Source/JavaScriptCore:

  • runtime/JSObject.cpp:

(JSC::JSObject::getOwnPropertyDescriptor):

  • runtime/PropertySlot.h:

Source/WebCore:

We revert a hack for accessors in JSC since this is not necessary.

  • bindings/scripts/CodeGeneratorJS.pm:

(GetJSCAttributesForAttribute):

  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::JSTestObjDOMConstructor::construct):
(WebCore::jsTestObj_searchGetter):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::setJSTestObj_searchSetter):
(WebCore::JSC_DEFINE_CUSTOM_SETTER):

  • bindings/scripts/test/TestObj.idl:
6:20 AM Changeset in webkit [287182] by Adrian Perez de Castro
  • 17 edits in releases/WebKitGTK/webkit-2.34

Merge r283410 - Disable new incumbent-window until it is fully implemented
https://bugs.webkit.org/show_bug.cgi?id=230261
<rdar://problem/83099726>

Reviewed by Chris Dumez and Geoffrey Garen.

LayoutTests/imported/w3c:

  • web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt:
  • web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt:

Source/JavaScriptCore:

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::globalObjectOfClosestCodeBlock):

  • runtime/JSObject.cpp:

(JSC::JSObject::getOwnPropertyDescriptor):

  • runtime/PropertySlot.h:

Source/WebCore:

This patch disables new incumbent-window until it is fully implemented to avoid compatibility issue.

  • bindings/js/JSDOMConvertCallbacks.h:

(WebCore::Converter<IDLCallbackFunction<T>>::convert):
(WebCore::Converter<IDLCallbackInterface<T>>::convert):

  • bindings/js/JSDOMGlobalObject.cpp:

(WebCore::callerGlobalObject):
(WebCore::legacyActiveGlobalObjectForAccessor):

  • bindings/js/JSDOMGlobalObject.h:
  • bindings/js/JSDOMWindowBase.cpp:

(WebCore::incumbentDOMWindow):
(WebCore::legacyActiveDOMWindowForAccessor):

  • bindings/js/JSDOMWindowBase.h:
  • bindings/scripts/CodeGeneratorJS.pm:

(GetJSCAttributesForAttribute):
(GenerateCallWith):

  • page/Location.idl:

LayoutTests:

  • http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt:
5:55 AM Changeset in webkit [287181] by commit-queue@webkit.org
  • 3 edits in trunk/Source/JavaScriptCore

[RISCV64] Implement linking and patching support in RISCV64Assembler
https://bugs.webkit.org/show_bug.cgi?id=234398

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-17
Reviewed by Yusuke Suzuki.

Populate RISCV64Assembler class with the necessary implementations and
facilities to support linking and patching operations. Implementations
of different methods in MacroAssemblerRISCV64 covering calls, jumps
and patches are also added.

Helper structs are added in the RISCV64Assembler class that cover
linking of jumps, calls or branches and patching of pointer values.
Relevant methods are also implemented to utilize these helpers.

RISCV64Assembler also gains helper methods that generate placeholders
for the specific type of linking or patching. The passed-in functor is
then invoked, enabling the user (MacroAssemblerRISCV64 implementation)
to additionally generate the desired instruction sequence that utilizes
the given placeholder.

In MacroAssemblerRISCV64, different noop methods covering jumps, calls,
linking and patching are replaced with the appropriate implementations.

  • assembler/MacroAssemblerRISCV64.h:

(JSC::MacroAssemblerRISCV64::readCallTarget):
(JSC::MacroAssemblerRISCV64::replaceWithJump):
(JSC::MacroAssemblerRISCV64::startOfBranchPtrWithPatchOnRegister):
(JSC::MacroAssemblerRISCV64::revertJumpReplacementToBranchPtrWithPatch):
(JSC::MacroAssemblerRISCV64::linkCall):
(JSC::MacroAssemblerRISCV64::repatchCall):
(JSC::MacroAssemblerRISCV64::jump):
(JSC::MacroAssemblerRISCV64::farJump):
(JSC::MacroAssemblerRISCV64::nearCall):
(JSC::MacroAssemblerRISCV64::nearTailCall):
(JSC::MacroAssemblerRISCV64::threadSafePatchableNearCall):
(JSC::MacroAssemblerRISCV64::ret):
(JSC::MacroAssemblerRISCV64::call):
(JSC::MacroAssemblerRISCV64::callOperation):
(JSC::MacroAssemblerRISCV64::startOfPatchableBranchPtrWithPatchOnAddress): Deleted.
(JSC::MacroAssemblerRISCV64::startOfPatchableBranch32WithPatchOnAddress): Deleted.
(JSC::MacroAssemblerRISCV64::revertJumpReplacementToPatchableBranchPtrWithPatch): Deleted.
(JSC::MacroAssemblerRISCV64::revertJumpReplacementToPatchableBranch32WithPatch): Deleted.

  • assembler/RISCV64Assembler.h:

(JSC::RISCV64Instructions::ImmediateBase::immediateMask):
(JSC::RISCV64Instructions::ImmediateBase::v):
(JSC::RISCV64Instructions::ImmediateDecomposition::ImmediateDecomposition):
(JSC::RISCV64Assembler::getDifferenceBetweenLabels):
(JSC::RISCV64Assembler::getCallReturnOffset):
(JSC::RISCV64Assembler::labelIgnoringWatchpoints):
(JSC::RISCV64Assembler::labelForWatchpoint):
(JSC::RISCV64Assembler::label):
(JSC::RISCV64Assembler::linkJump):
(JSC::RISCV64Assembler::linkCall):
(JSC::RISCV64Assembler::linkPointer):
(JSC::RISCV64Assembler::maxJumpReplacementSize):
(JSC::RISCV64Assembler::patchableJumpSize):
(JSC::RISCV64Assembler::repatchPointer):
(JSC::RISCV64Assembler::relinkJump):
(JSC::RISCV64Assembler::relinkJumpToNop):
(JSC::RISCV64Assembler::relinkCall):
(JSC::RISCV64Assembler::replaceWithJump):
(JSC::RISCV64Assembler::revertJumpReplacementToPatch):
(JSC::RISCV64Assembler::readCallTarget):
(JSC::RISCV64Assembler::cacheFlush):
(JSC::RISCV64Assembler::fillNops):
(JSC::RISCV64Assembler::jumpPlaceholder):
(JSC::RISCV64Assembler::branchPlaceholder):
(JSC::RISCV64Assembler::pointerCallPlaceholder):
(JSC::RISCV64Assembler::nearCallPlaceholder):
(JSC::RISCV64Assembler::LinkJumpOrCallImpl::apply):
(JSC::RISCV64Assembler::LinkJumpImpl::placeholderInsn):
(JSC::RISCV64Assembler::LinkJumpImpl::generatePlaceholder):
(JSC::RISCV64Assembler::LinkCallImpl::placeholderInsn):
(JSC::RISCV64Assembler::LinkCallImpl::generatePlaceholder):
(JSC::RISCV64Assembler::LinkBranchImpl::placeholderInsn):
(JSC::RISCV64Assembler::LinkBranchImpl::generatePlaceholder):
(JSC::RISCV64Assembler::LinkBranchImpl::apply):
(JSC::RISCV64Assembler::PatchPointerImpl::placeholderInsn):
(JSC::RISCV64Assembler::PatchPointerImpl::generatePlaceholder):
(JSC::RISCV64Assembler::PatchPointerImpl::apply):
(JSC::RISCV64Assembler::PatchPointerImpl::read):

5:10 AM WebKitGTK/2.34.x edited by Philippe Normand
(diff)
4:47 AM Changeset in webkit [287180] by commit-queue@webkit.org
  • 11 edits in trunk

[GStreamer][WebRTC] Huge memory leak
https://bugs.webkit.org/show_bug.cgi?id=234134

Patch by Philippe Normand <pnormand@igalia.com> on 2021-12-17
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The main issue was RealtimeOutgoingVideoSourceLibWebRTC leaking GstSamples. Fixing this lead
me to further clean-ups in the GstSample<->LibWebRTCVideoFrame handling. Native frames
should not consume GstSamples, but reference them, otherwise there are crashes where the
dangling GstSamples would be passed to the libwebrtc video decoder...

Also the video decoders were not reporting their initialization status correctly,
WEBRTC_VIDEO_CODEC_OK is 0 hence false...

  • platform/graphics/gstreamer/MediaSampleGStreamer.cpp:

(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
(WebCore::MediaSampleGStreamer::initializeFromBuffer):

  • platform/graphics/gstreamer/MediaSampleGStreamer.h:

(WebCore::MediaSampleGStreamer::createWrappedSample):

  • platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:

(WebCore::GStreamerVideoDecoder::pullSample):

  • platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp:
  • platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:

(WebCore::convertLibWebRTCVideoFrameToGStreamerSample):
(WebCore::convertGStreamerSampleToLibWebRTCVideoFrame):
(WebCore::GStreamerVideoFrameLibWebRTC::create):
(WebCore::GStreamerSampleFromLibWebRTCVideoFrame): Deleted.
(WebCore::LibWebRTCVideoFrameFromGStreamerSample): Deleted.

  • platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.h:

(WebCore::GStreamerVideoFrameLibWebRTC::GStreamerVideoFrameLibWebRTC):
(WebCore::GStreamerVideoFrameLibWebRTC::getSample const):
(WebCore::GStreamerVideoFrameLibWebRTC::takeSample): Deleted.

  • platform/mediastream/libwebrtc/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:

(WebCore::RealtimeIncomingVideoSourceLibWebRTC::OnFrame):

  • platform/mediastream/libwebrtc/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:

(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::videoSampleAvailable):

LayoutTests:

  • platform/glib/TestExpectations: Update test expectations, #233740 was mostly due to video

decoder initialization wrongly reported as failed.
webrtc/captureCanvas-webrtc-software-h264-baseline.html no longer times out.

4:41 AM Changeset in webkit [287179] by commit-queue@webkit.org
  • 2 edits
    1 copy
    3 moves
    1 add in trunk/PerformanceTests

[css-contain][Performance test] Add test contain-paint-text-nowrap.html
https://bugs.webkit.org/show_bug.cgi?id=234001

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

Add test contain-paint-text-nowrap.html to verify that paint containment
improves the case where many contained children have inline text that is
wider than the container width. The improvement is because paint
containment clips the child content.

This patch also introduces the Containment directory to separate the
containment tests.

  • Containment/contain-paint-nowrap.html:
  • Containment/css-contain-change-size.html: Renamed from PerformanceTests/Layout/css-contain-change-size.html.
  • Containment/css-contain-layout-size-inside-complex-document.html: Renamed from PerformanceTests/Layout/css-contain-layout-size-inside-complex-document.html.
  • Containment/large-grid.html: Renamed from PerformanceTests/Layout/large-grid.html.
  • Paint/lots-of-self-painting-layers.html: use let instead of var
3:59 AM Changeset in webkit [287178] by commit-queue@webkit.org
  • 2 edits in trunk/Source/ThirdParty/ANGLE

REGRESSION (r287068): [macOS arm64] TestWebKitAPI.GraphicsContextGLCocoaTest.UnrecycledDisplayBuffersNoLeaks is failing
https://bugs.webkit.org/show_bug.cgi?id=234356
<rdar://problem/86533892>

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-12-17
Reviewed by Antti Koivisto.

Avoid leaking MTLTexture instances for render targets. Leak would happen through
temporary render pass descriptor that would ref the render target texture.
The descriptor was created without autoreleasepool in call stack.
Also fixes the error string leaks.

UnrecycledDisplayBuffersNoLeaks would report leaks of iosurface-backed
GraphicsContextGL default framebuffer bound textures if glClear was called.

  • src/libANGLE/renderer/metal/ContextMtl.mm:

(rx::ContextMtl::getRenderPassCommandEncoder):

3:58 AM Changeset in webkit [287177] by graouts@webkit.org
  • 34 edits in trunk/Source/WebCore

ActiveDOMObject::suspendIfNeeded() should not be called within constructors
https://bugs.webkit.org/show_bug.cgi?id=233945

Reviewed by Darin Adler.

Step 3 where we convert almost all remaining calls to suspendIfNeeded() in constructors to be in create() methods.
This required adding such a method to ServiceWorkerContainer. The final call left is in the AudioScheduledSourceNode
constructor, but an earlier version of this patch failed a lot of webaudio tests on EWS so I suspect my attempted fix
was wrong.

  • Modules/entriesapi/FileSystemDirectoryEntry.cpp:

(WebCore::FileSystemDirectoryEntry::create):

  • Modules/entriesapi/FileSystemDirectoryEntry.h:
  • Modules/entriesapi/FileSystemEntry.cpp:

(WebCore::FileSystemEntry::FileSystemEntry):

  • Modules/entriesapi/FileSystemEntry.h:
  • Modules/entriesapi/FileSystemFileEntry.cpp:

(WebCore::FileSystemFileEntry::create):

  • Modules/entriesapi/FileSystemFileEntry.h:
  • Modules/fetch/FetchBodyOwner.cpp:

(WebCore::FetchBodyOwner::FetchBodyOwner):

  • Modules/fetch/FetchBodyOwner.h:
  • Modules/fetch/FetchRequest.cpp:

(WebCore::FetchRequest::create):
(WebCore::FetchRequest::clone):

  • Modules/fetch/FetchRequest.h:
  • Modules/fetch/FetchResponse.cpp:

(WebCore::FetchResponse::create):
(WebCore::FetchResponse::error):
(WebCore::FetchResponse::redirect):
(WebCore::FetchResponse::fetch):

  • Modules/filesystemaccess/FileSystemDirectoryHandle.cpp:

(WebCore::FileSystemDirectoryHandle::create):

  • Modules/filesystemaccess/FileSystemFileHandle.cpp:

(WebCore::FileSystemFileHandle::create):

  • Modules/filesystemaccess/FileSystemHandle.cpp:

(WebCore::FileSystemHandle::FileSystemHandle):

  • Modules/filesystemaccess/FileSystemHandle.h:
  • Modules/mediasource/SourceBufferList.cpp:

(WebCore::SourceBufferList::create):
(WebCore::SourceBufferList::SourceBufferList):

  • Modules/mediasource/SourceBufferList.h:
  • Modules/mediastream/MediaDevices.cpp:

(WebCore::MediaDevices::MediaDevices):
(WebCore::MediaDevices::create):

  • Modules/mediastream/RTCDTMFSender.cpp:

(WebCore::RTCDTMFSender::create):
(WebCore::RTCDTMFSender::RTCDTMFSender):

  • Modules/mediastream/RTCDTMFSender.h:
  • Modules/mediastream/RTCDtlsTransport.cpp:

(WebCore::RTCDtlsTransport::create):
(WebCore::RTCDtlsTransport::RTCDtlsTransport):

  • Modules/mediastream/RTCDtlsTransport.h:
  • Modules/mediastream/RTCIceTransport.cpp:

(WebCore::RTCIceTransport::create):
(WebCore::RTCIceTransport::RTCIceTransport):

  • Modules/mediastream/RTCIceTransport.h:

(WebCore::RTCIceTransport::create): Deleted.

  • Modules/mediastream/RTCRtpSFrameTransform.cpp:

(WebCore::RTCRtpSFrameTransform::create):
(WebCore::RTCRtpSFrameTransform::RTCRtpSFrameTransform):

  • Modules/mediastream/RTCRtpSFrameTransform.h:

(WebCore::RTCRtpSFrameTransform::create): Deleted.

  • Modules/mediastream/RTCSctpTransport.cpp:

(WebCore::RTCSctpTransport::create):
(WebCore::RTCSctpTransport::RTCSctpTransport):

  • Modules/mediastream/RTCSctpTransport.h:
  • Modules/paymentrequest/PaymentResponse.cpp:

(WebCore::PaymentResponse::finishConstruction):

  • Modules/webdatabase/DatabaseContext.cpp:

(WebCore::DatabaseContext::DatabaseContext):

  • Modules/webdatabase/DatabaseManager.cpp:

(WebCore::DatabaseManager::databaseContext):

  • html/ImageBitmap.cpp:
  • page/NavigatorBase.cpp:

(WebCore::NavigatorBase::serviceWorker):

  • workers/service/ServiceWorkerContainer.cpp:

(WebCore::ServiceWorkerContainer::create):
(WebCore::ServiceWorkerContainer::ServiceWorkerContainer):

  • workers/service/ServiceWorkerContainer.h:
2:11 AM Changeset in webkit [287176] by Adrian Perez de Castro
  • 15 edits
    2 adds in releases/WebKitGTK/webkit-2.34/Source

Merge r286676 - [GStreamer] Fill in client-name property on audio sinks
https://bugs.webkit.org/show_bug.cgi?id=233826

Patch by Philippe Normand <pnormand@igalia.com> on 2021-12-08
Reviewed by Xabier Rodriguez-Calvar.

The audio sink client-name property is now set on sinks that support this property, such as
pulsesink and pipewiresink. This is picked-up by GNOME settings and the corresponding audio
streams now appear as owned by the WebKit application (MiniBrowser, ephy, etc) instead of
"WebKitWebProcess".

When the audio mixer is enabled, no media.role property is set, because the mixer can accept
music and/or video roles simultaneously, so it doesn't make sense in this context.

  • platform/audio/gstreamer/AudioDestinationGStreamer.cpp:

(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): Drive-by refactoring, using
a lambda instead of a static callback function.
(WebCore::autoAudioSinkChildAddedCallback): Deleted.

  • platform/graphics/gstreamer/GStreamerAudioMixer.cpp:

(WebCore::GStreamerAudioMixer::GStreamerAudioMixer):

  • platform/graphics/gstreamer/GStreamerCommon.cpp:

(WebCore::createAutoAudioSink):
(WebCore::createPlatformAudioSink):

  • platform/graphics/gstreamer/GStreamerCommon.h:
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamPropertiesCallback): Deleted.
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1:21 AM WebKitGTK/2.34.x edited by Adrian Perez de Castro
(diff)
1:01 AM Changeset in webkit [287175] by ysuzuki@apple.com
  • 2 edits in trunk/Source/bmalloc

[libpas] Enable libpas on ARM64 Darwin platforms (ARM64E is already enabled)
https://bugs.webkit.org/show_bug.cgi?id=234416

Reviewed by Filip Pizlo.

r287168 fixed libpas compare_and_swap on ARM64 so that we pass all libpas tests on ARM64 platforms.
Speedometer2 and JetStream2 are neutral, PLUM3 is 10.79% better, and RAMification is 2.83% better.

  • bmalloc/BPlatform.h:
Note: See TracTimeline for information about the timeline view.