Timeline



Dec 22, 2021:

11:14 PM Changeset in webkit [287385] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebCore

RenderLayer WIP
https://bugs.webkit.org/show_bug.cgi?id=234154

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

The members to store absolute (static inline/block) and
relative offset are used orthogonally, so we just merge
them.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateLayerPosition):

  • rendering/RenderLayer.h:

(WebCore::RenderLayer::offsetForInFlowPosition const):
(WebCore::RenderLayer::staticInlinePosition const):
(WebCore::RenderLayer::staticBlockPosition const):
(WebCore::RenderLayer::setStaticInlinePosition):
(WebCore::RenderLayer::setStaticBlockPosition):

11:00 PM Changeset in webkit [287384] by commit-queue@webkit.org
  • 4 edits in trunk

Re-enable WebPushD.HandleInjectedPush API test
https://bugs.webkit.org/show_bug.cgi?id=234627

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

Source/WebKit:

I needed to make an entitlement check return true when using the non-internal SDK,
which can't sign private entitlements into a binary. I also needed to make the fake
TestWebKitAPI code signing identifier match the identifier that arm64 Macs actually get,
or else m_testingPushMessages would not contain the right key in Daemon::getPendingPushMessages
on arm64 Macs.

  • webpushd/PushClientConnection.mm:

(WebPushD::ClientConnection::hostAppCodeSigningIdentifier):
(WebPushD::ClientConnection::hostHasEntitlement):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
8:04 PM Changeset in webkit [287383] by ysuzuki@apple.com
  • 26 edits in trunk/Source/bmalloc

[libpas] Make pas_heap_type constant
https://bugs.webkit.org/show_bug.cgi?id=234486

Reviewed by Filip Pizlo.

Currently, pas_heap_type data is placed in DATA segment since it is not constant.
But they are actually a constant value, so we should put them in
DATA_CONST segment.

Still, we can have mutable type information if we want: we can const-cast the type
in each derived pas_heap_type's functions (and we should define these types with non
constant way). But currently, we have no such a type.

  • bmalloc/IsoHeap.h:

(bmalloc::api::IsoHeap::provideHeap):

  • bmalloc/bmalloc.cpp:

(bmalloc::api::mallocOutOfLine):

  • libpas/src/libpas/bmalloc_heap.c:
  • libpas/src/libpas/bmalloc_heap_innards.h:
  • libpas/src/libpas/bmalloc_heap_ref.h:
  • libpas/src/libpas/bmalloc_type.c:

(bmalloc_type_dump):
(bmalloc_type_as_heap_type_dump):

  • libpas/src/libpas/bmalloc_type.h:

(bmalloc_type_size):
(bmalloc_type_alignment):
(bmalloc_type_name):
(bmalloc_type_as_heap_type_get_type_size):
(bmalloc_type_as_heap_type_get_type_alignment):

  • libpas/src/libpas/iso_heap.c:

(iso_heap_ref_construct):
(iso_primitive_heap_ref_construct):

  • libpas/src/libpas/iso_heap_ref.h:
  • libpas/src/libpas/jit_heap_config.c:

(jit_type_dump):

  • libpas/src/libpas/jit_heap_config.h:

(jit_type_size):
(jit_type_alignment):

  • libpas/src/libpas/pas_heap.h:
  • libpas/src/libpas/pas_heap_config.h:
  • libpas/src/libpas/pas_heap_ref_prefix.h:
  • libpas/src/libpas/pas_large_heap.c:

(allocate_impl):
(pas_large_heap_try_shrink):

  • libpas/src/libpas/pas_simple_type.c:

(pas_simple_type_as_heap_type_dump):

  • libpas/src/libpas/pas_simple_type.h:

(pas_simple_type_get_key_data):
(pas_simple_type_create_with_key_data):
(pas_simple_type_as_heap_type_get_type_size):
(pas_simple_type_as_heap_type_get_type_alignment):

  • libpas/src/libpas/pas_try_allocate.h:

(pas_try_allocate_impl_casual_case):

  • libpas/src/libpas/pas_try_allocate_array.h:
  • libpas/src/libpas/pas_try_allocate_common.h:

(pas_try_allocate_common_impl_slow):

  • libpas/src/libpas/pas_try_allocate_intrinsic.h:
  • libpas/src/libpas/pas_try_reallocate.h:

(pas_try_reallocate_array_by_count):

  • libpas/src/test/ExpendableMemoryTests.cpp:
  • libpas/src/test/IsoHeapChaosTests.cpp:

(std::addAllTests):

  • libpas/src/test/ThingyAndUtilityHeapAllocationTests.cpp:

(std::createIsolatedHeapRef):

7:10 PM Changeset in webkit [287382] by msaboff@apple.com
  • 11 edits
    1 delete in trunk/Source

Fix WebKit Build issues when using system content path
https://bugs.webkit.org/show_bug.cgi?id=234624

Reviewed by Filip Pizlo.

Source/ThirdParty/ANGLE:

Changed INSTALL_PATH on macOS builds to use a fully qualified .../WebCore.framework/Versions/A/Frameworks.
Deleted unused create-symlink-to-altroot.sh script.

  • Configurations/ANGLE-dynamic.xcconfig:
  • scripts/create-symlink-to-altroot.sh: Removed.

Source/ThirdParty/libwebrtc:

Changed INSTALL_PATH on macOS builds to use fully qualified .../WebCore.framework/Versions/A/Frameworks.

  • Configurations/libwebrtc.xcconfig:

Source/WebCore:

Covered by existing tests.

Added SYSTEM_CONTENT_PATH processing to WebCore's normal location.

  • Configurations/WebCore.xcconfig:

Source/WebKit:

Added SYSTEM_CONTENT_PATH processing to the nested frameworks path (UMBRELLA_FRAMEWORKS_DIR).

  • Configurations/BaseTarget.xcconfig:
  • Configurations/WebKit.xcconfig:

Source/WebKitLegacy/mac:

Added SYSTEM_CONTENT_PATH processing to NORMAL_PRODUCTION_FRAMEWORKS_DIR.

  • Configurations/WebKitLegacy.xcconfig:
6:19 PM Changeset in webkit [287381] by Aditya Keerthi
  • 3 edits
    2 adds in trunk

[iOS] metromile.com <select> dropdowns open twice
https://bugs.webkit.org/show_bug.cgi?id=234573
rdar://84011144

Reviewed by Wenson Hsieh.

Source/WebKit:

metromile.com calls focus() twice on the same <select> element, when one
is tapped. Note that calling focus() on an already focused element still
sends the ElementDidFocus message to the UIProcess, to support scenarios
where the initial call to focus did not bring up an input peripheral.
One example of such a scenario is when the initial call is not a result
of user interaction, however, there are additional scenarios that are
dependent on UIProcess state. This makes it difficult to ensure that
ElementDidFocus is only called when it is time to show an input peripheral.

-[WKContentView _elementDidFocus:...] already contains some logic to
prevent showing another input peripheral for the same element. This
logic was added in r168744, checking for the same element by comparing
input types and bounding rects.

However, in between the first and second call to focus(), the page
applies additional padding to the element, changing its bounding rect.
This results in _elementDidFocus: going past the same element check
and presenting another dropdown.

In the time since r168744 was written, a more robust mechanism to check
for the same element was added – ElementContext.

To fix, update the same element check to use ElementContext, ensuring an
attempt to present a new peripheral for the same element is not made.

Test: fast/forms/ios/refocus-select-after-size-change.html

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

LayoutTests:

Added a layout test to verify that only one <select> dropdown is
presented when refocusing the same <select> element with a different
size. If more than one dropdown is presented, the test times out.

  • fast/forms/ios/refocus-select-after-size-change-expected.txt: Added.
  • fast/forms/ios/refocus-select-after-size-change.html: Added.
5:48 PM Changeset in webkit [287380] by Brent Fulgham
  • 2 edits in trunk/Source/WebCore

Hardening: decodeArrayBuffer is missing WARN_UNUSED_RETURN
https://bugs.webkit.org/show_bug.cgi?id=234619
<rdar://problem/62755159>

Reviewed by Alex Christensen.

  • Modules/webauthn/AuthenticatorResponseData.h:

(WebCore::decodeArrayBuffer): Add WARN_UNUSED_RETURN to declaration.

5:12 PM Changeset in webkit [287379] by sbarati@apple.com
  • 16 edits
    2 moves in trunk

LLInt should loop OSR into BBQ and BBQ should loop OSR into OMG
https://bugs.webkit.org/show_bug.cgi?id=234542

Reviewed by Yusuke Suzuki.

JSTests:

  • wasm/wast-tests/harness.js:

Source/JavaScriptCore:

It's a startup perf improvement on some Wasm benchmarks I'm running to have
Wasm LLInt do loop OSR entry into BBQ instead of OMG. This improves this
benchmark by 5%. There is probably more perf to be had here. Currently,
we're just OSR entering into B3 BBQ O1. However, in the future, we should
just compile a single Air BBQ Callee that allows for OSR entry at loop
boundaries. Maybe we can model this using EntrySwitch without any real
harm to throughput.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • assembler/MacroAssemblerCodeRef.cpp:

(JSC::shouldDumpDisassemblyFor):

  • jsc.cpp:

(JSC_DEFINE_HOST_FUNCTION):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::parseAndCompile):

  • wasm/WasmCallee.h:

(JSC::Wasm::Callee::setOSREntryCallee): Deleted.

  • wasm/WasmCalleeGroup.h:
  • wasm/WasmCompilationMode.cpp:

(JSC::Wasm::makeString):

  • wasm/WasmCompilationMode.h:

(JSC::Wasm::isOSREntry):
(JSC::Wasm::isAnyBBQ):
(JSC::Wasm::isAnyOMG):

  • wasm/WasmOMGForOSREntryPlan.cpp: Removed.
  • wasm/WasmOMGForOSREntryPlan.h: Removed.
  • wasm/WasmOSREntryPlan.cpp: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.cpp.

(JSC::Wasm::OSREntryPlan::OSREntryPlan):
(JSC::Wasm::OSREntryPlan::work):
(JSC::Wasm::OMGForOSREntryPlan::OMGForOSREntryPlan): Deleted.
(JSC::Wasm::OMGForOSREntryPlan::work): Deleted.

  • wasm/WasmOSREntryPlan.h: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.h.
  • wasm/WasmOperations.cpp:

(JSC::Wasm::doOSREntry):
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):

  • wasm/WasmPlan.cpp:

(JSC::Wasm::Plan::updateCallSitesToCallUs):

  • wasm/WasmSlowPaths.cpp:

(JSC::LLInt::WASM_SLOW_PATH_DECL):

4:49 PM Changeset in webkit [287378] by achristensen@apple.com
  • 2 edits in trunk/Tools

Disable WKInspectorExtensionDelegate.ShowAndHideTabCallbacks API test
webkit.org/b/231847

It seems to be timing out a lot everywhere.

  • TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionDelegate.mm:

(TEST):

3:55 PM Changeset in webkit [287377] by sihui_liu@apple.com
  • 11 edits in trunk

WebsiteDataStore::excludeDirectoryFromBackup should set attribute for existing directories
https://bugs.webkit.org/show_bug.cgi?id=234404

Reviewed by Youenn Fablet.

Source/WebKit:

createDirectoryAtURL returning false means directory cannot be created, but the cause can be that directory
already exists; so we should set exclude attribute on the directory no matter createDirectoryAtURL returns true
or false. Also, we can use existing FileSystem functions.

API test: WKWebView.LocalStorageDirectoryExcludedFromBackup

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::excludeDirectoryFromBackup): Deleted.

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::parameters):

  • UIProcess/WebsiteData/WebsiteDataStore.h:

Source/WTF:

  • wtf/FileSystem.cpp:

(WTF::FileSystemImpl::excludeFromBackup):
(WTF::FileSystemImpl::canExcludeFromBackup): Deleted.

  • wtf/FileSystem.h:
  • wtf/cocoa/FileSystemCocoa.mm:

(WTF::FileSystemImpl::excludeFromBackup):

  • wtf/mac/FileSystemMac.mm:

(WTF::FileSystem::canExcludeFromBackup): Deleted.
(WTF::FileSystem::excludeFromBackup): Deleted.

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm:

(TEST):

3:40 PM Changeset in webkit [287376] by Simon Fraser
  • 9 edits in trunk

Convert css3/scroll-snap/scroll-snap-wheel-event.html to use monitorWheelEvents()
https://bugs.webkit.org/show_bug.cgi?id=234526

Reviewed by Wenson Hsieh.

Source/WebCore:

This test sends a stateless wheel event and waits for the timer and subsequent scroll snap
animation, which is already tracked by WheelEventTestMonitor, but the code had a bug where
the monitor wasn't informed if no animation was required.

  • platform/mac/ScrollingEffectsController.mm:

(WebCore::ScrollingEffectsController::statelessSnapTransitionTimerFired):

LayoutTests:

Convert the test to use a UIHelper function which makes use of WheelEventTestMonitor.

  • css3/scroll-snap/scroll-snap-wheel-event.html:
  • resources/ui-helper.js:

(window.UIHelper.async statelessMouseWheelScrollAt):

3:34 PM Changeset in webkit [287375] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Close/open nested bidi contexts for new lines after force line breaks
https://bugs.webkit.org/show_bug.cgi?id=234611

Reviewed by Antti Koivisto.

Bidi handling requires us to close all the nested bidi contexts at the end of the line (triggered by forced line breaks)
and re-open it for the content on the next line.

  • layout/formattingContexts/inline/InlineItemsBuilder.cpp:

(WebCore::Layout::handleEnterExitBidiContext):
(WebCore::Layout::buildBidiParagraph):

3:16 PM Changeset in webkit [287374] by achristensen@apple.com
  • 9 edits in trunk

Re-enable CustomDisplayName and DefaultDisplayName API tests on Monterey
https://bugs.webkit.org/show_bug.cgi?id=234613

Reviewed by Brady Eidson.

Source/WebKit:

When we introduced setting the display name from the network process,
we didn't update the tests to get the information from the process that can access it.

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/NetworkConnectionToWebProcess.messages.in:
  • NetworkProcess/mac/NetworkConnectionToWebProcessMac.mm:

(WebKit::NetworkConnectionToWebProcess::updateActivePages):
(WebKit::NetworkConnectionToWebProcess::getProcessDisplayName):

  • WebProcess/WebPage/Cocoa/WebPageCocoa.mm:

(WebKit::WebPage::getProcessDisplayName):

  • WebProcess/WebProcess.h:
  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::WebProcess::auditTokenForSelf):
(WebKit::WebProcess::updateProcessName):
(WebKit::WebProcess::getProcessDisplayName):
(WebKit::WebProcess::updateActivePages):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm:

(TestWebKitAPI::TEST):

2:51 PM Changeset in webkit [287373] by Kocsen Chung
  • 1 copy in tags/Safari-612.4.8

Tag Safari-612.4.8.

2:32 PM Changeset in webkit [287372] by commit-queue@webkit.org
  • 6 edits in trunk/Source

Unreviewed, reverting r287364.
https://bugs.webkit.org/show_bug.cgi?id=234620

broke 3 API tests

Reverted changeset:

"Preferences that read from NSUserDefaults need to be
initialied from platformInitializeStore()"
https://bugs.webkit.org/show_bug.cgi?id=234488
https://commits.webkit.org/r287364

2:23 PM Changeset in webkit [287371] by Kate Cheney
  • 25 edits in trunk

PCM tests crashing with 'unlink' errors
https://bugs.webkit.org/show_bug.cgi?id=234565
<rdar://problem/86771766>

Reviewed by Alex Christensen.

Source/WebKit:

Close PCM and ITP databases before deleting their database files in
API testing. This adds 2 new SPIs on WKWebsiteDataStore to close the
respective databases. It also addresses the renaming FIXME for
NetworkProcess::simulatePrivateClickMeasurementSessionRestart.

No new tests. This will fix existing crashing PCM API tests.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::closeITPDatabase):
(WebKit::NetworkProcess::closePCMDatabase):
(WebKit::NetworkProcess::simulatePrivateClickMeasurementSessionRestart):
(WebKit::NetworkProcess::simulateResourceLoadStatisticsSessionRestart): Deleted.

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::destroyPrivateClickMeasurementStore):
(WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting):
(WebKit::NetworkSession::recreatePrivateClickMeasurementStore): Renamed.
Renamed to be more accurate. This function only deletes the database,
then the call in the completion handler recreates it. This also makes
it more clear when we reuse it to close the database.

  • NetworkProcess/NetworkSession.h:
  • UIProcess/API/C/WKPage.cpp:

(WKPageSimulatePrivateClickMeasurementSessionRestart):
(WKPageSimulateResourceLoadStatisticsSessionRestart): Deleted.

  • UIProcess/API/C/WKPagePrivate.h:
  • UIProcess/API/Cocoa/WKWebsiteDataStore.mm:

(-[WKWebsiteDataStore _closeDatabases:]):

  • UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::simulatePrivateClickMeasurementSessionRestart):
(WebKit::WebPageProxy::simulateResourceLoadStatisticsSessionRestart): Deleted.

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::closeDatabases):

  • UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/PrivateClickMeasurement.mm:

(cleanUp):
Close the databases before removing the files.

(TEST):

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::simulatePrivateClickMeasurementSessionRestart):
(WTR::TestRunner::simulateResourceLoadStatisticsSessionRestart): Deleted.

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

(WTR::TestController::simulatePrivateClickMeasurementSessionRestart):
(WTR::TestController::simulateResourceLoadStatisticsSessionRestart): Deleted.

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

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
Rename.

LayoutTests:

  • http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html:
  • http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html:
1:03 PM Changeset in webkit [287370] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Soft linebreaks have incorrect bidi paragraph positions
https://bugs.webkit.org/show_bug.cgi?id=234608

Reviewed by Antti Koivisto.

Soft linebreaks are part of the InlineTextBox content and they are appened to the bidi paragraph
together with the rest of the text content (as we append the InlineTextBox content in one block).
We need to handle their positions the same way we do with regular text content i.e. use the inline item's offset
and not the paragraphContentBuilder's length.

  • layout/formattingContexts/inline/InlineItemsBuilder.cpp:

(WebCore::Layout::buildBidiParagraph):

11:44 AM Changeset in webkit [287369] by Kocsen Chung
  • 4 edits
    2 adds in branches/safari-612-branch

Cherry-pick r287366. rdar://problem/84379650

[iOS] Scroll view pinch zoom gesture sometimes fails to recognize in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=234584
rdar://84379650

Reviewed by Simon Fraser.

Source/WebKit:

WKWebView may get into a state where the pinch zoom gesture recognizer on its scroll view sometimes fails to
transition to Changed state (and invoke its action, which sets the zoomScale of the scroll view); this happens
because the scroll view pinch gesture requires the touch start deferring gesture recognizer (TSDG) to fail, but
it's possible for TSDG to remain stuck in Possible state over the duration of a gesture after beginning a touch
over content with either passive touch event listeners, or no touch event listeners.

In the case where the TSDG is stuck in Possible state, we observe the following sequence of events (let's
suppose the user is starting a touch over a passive touch event listener on a web page):

  1. The UITouch is delivered to the web touch event gesture recognizer, which fires the action

(-_webTouchEventsRecognized:). We observe that we're over an async touch event handling region (i.e.
passive or no touch event listeners), so we immediately "lift the gesture gate" by transitioning all
deferring gesture recognizers to Failed state, (with the intent that they won't prevent native gestures
from recognizing).

  1. A UITouch is then delivered to the TSDG in the same runloop as UIKit continues to deliver the touch

event to all gestures in the NSSet of gesture recognizers on the window. Receiving the UITouch causes
TSDG (which we already set to Failed state in step (1)) to internally reset and transition back to
Possible state, underneath WebKit.

  1. TSDG is now in possible state after the gesture has begun, but we've already tried to unblock native

gestures. When performing the second touch of the pinch zoom gesture, the pinch zoom gesture fails to
commence because it's stuck waiting for TSDG to fail.

In the normal (working) scenario, step (2) happens before step (1); this ensures that TSDG is set to Failed
state and remains in Failed state over the course of the gesture, thereby preventing the bug from happening. The
order in which (1) and (2) happen is dependent on the order in which the web touch event gesture and TSDG are
iterated in UIKit's NSSet of gestures, which explains why this bug only reproduces some of the time.

This patch mitigates this by adding a mechanism to keep track of touch start deferrers that we've already
transitioned to Failed state during the course of a gesture, and uses this information to avoid adding failure
requirements to these deferring gestures that have already been "ungated". This ensures that even if the
deferring gesture resets to Possible state from underneath WebKit, we still avoid pushing out native gesture
recognition due to these deferring gestures.

As an aside, I initially attempted to avoid having TSDG transition back to Possible state altogether in this
scenario, but this doesn't seem to be avoidable (short of overriding the SPI method -_resetGestureRecognizer
and not calling the superclass, which does not seem to be supported behavior).

Test: fast/events/touch/ios/pinch-zoom-with-passive-touch-event-listeners.html

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _doneDeferringTouchStart:]): (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

LayoutTests:

Add a test to exercise the fix. Note that this test will only fail without the fix *some* of the time, since it
depends entirely on the order in which two gestures appear in an Objective-C hash datastructure (see WebKit
ChangeLog for more details).

  • fast/events/touch/ios/pinch-zoom-with-passive-touch-event-listeners-expected.txt: Added.
  • fast/events/touch/ios/pinch-zoom-with-passive-touch-event-listeners.html: Added.

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

11:39 AM Changeset in webkit [287368] by achristensen@apple.com
  • 16 edits in trunk

Fix compiling with pickier compiler
https://bugs.webkit.org/show_bug.cgi?id=234593

Reviewed by Brady Eidson.

Source/JavaScriptCore:

  • API/tests/Regress141275.mm:

(-[JSTEvaluator initWithScript:]):

  • API/tests/testapi.mm:

(checkModuleWasRejected):

Source/WebCore:

  • editing/cocoa/HTMLConverter.mm:

(HTMLConverter::_addMarkersToList):

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

(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):

  • platform/graphics/cocoa/GraphicsContextGLCocoa.mm:

(WebCore::GraphicsContextGLANGLE::checkGPUStatus):

  • platform/graphics/cocoa/SourceBufferParserWebM.cpp:
  • platform/graphics/coreimage/FEColorMatrixCoreImageApplier.mm:

(WebCore::FEColorMatrixCoreImageApplier::apply const):

Source/WebKit:

  • UIProcess/Cocoa/WebProcessPoolCocoa.mm:

(WebKit::WebProcessPool::platformInitializeWebProcess):

  • WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:

(WebKit::InjectedBundle::initialize):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:

(TestWebKitAPI::TEST):

11:20 AM Changeset in webkit [287367] by commit-queue@webkit.org
  • 6 edits in trunk/Source

[RISCV64] Add RISCV64 support in YARR
https://bugs.webkit.org/show_bug.cgi?id=234547

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

Source/JavaScriptCore:

Add RISCV64 support to YARR. This covers providing the required register
and immediate defitinitions, as well as also enabling codepaths shared
with other 64-bit architectures.

  • assembler/MacroAssemblerRISCV64.h:

(JSC::MacroAssemblerRISCV64::load16): YARR JIT also requires a load16()
overload that loads from an ExtendedAddress.

  • yarr/YarrJIT.cpp:
  • yarr/YarrJITRegisters.h:

Source/WTF:

  • wtf/PlatformEnable.h: Also enable different YARR-related flags for RISCV64.
11:12 AM Changeset in webkit [287366] by Wenson Hsieh
  • 4 edits
    2 adds in trunk

[iOS] Scroll view pinch zoom gesture sometimes fails to recognize in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=234584
rdar://84379650

Reviewed by Simon Fraser.

Source/WebKit:

WKWebView may get into a state where the pinch zoom gesture recognizer on its scroll view sometimes fails to
transition to Changed state (and invoke its action, which sets the zoomScale of the scroll view); this happens
because the scroll view pinch gesture requires the touch start deferring gesture recognizer (TSDG) to fail, but
it's possible for TSDG to remain stuck in Possible state over the duration of a gesture after beginning a touch
over content with either passive touch event listeners, or no touch event listeners.

In the case where the TSDG is stuck in Possible state, we observe the following sequence of events (let's
suppose the user is starting a touch over a passive touch event listener on a web page):

  1. The UITouch is delivered to the web touch event gesture recognizer, which fires the action

(-_webTouchEventsRecognized:). We observe that we're over an async touch event handling region (i.e.
passive or no touch event listeners), so we immediately "lift the gesture gate" by transitioning all
deferring gesture recognizers to Failed state, (with the intent that they won't prevent native gestures
from recognizing).

  1. A UITouch is then delivered to the TSDG in the same runloop as UIKit continues to deliver the touch

event to all gestures in the NSSet of gesture recognizers on the window. Receiving the UITouch causes
TSDG (which we already set to Failed state in step (1)) to internally reset and transition back to
Possible state, underneath WebKit.

  1. TSDG is now in possible state after the gesture has begun, but we've already tried to unblock native

gestures. When performing the second touch of the pinch zoom gesture, the pinch zoom gesture fails to
commence because it's stuck waiting for TSDG to fail.

In the normal (working) scenario, step (2) happens before step (1); this ensures that TSDG is set to Failed
state and remains in Failed state over the course of the gesture, thereby preventing the bug from happening. The
order in which (1) and (2) happen is dependent on the order in which the web touch event gesture and TSDG are
iterated in UIKit's NSSet of gestures, which explains why this bug only reproduces some of the time.

This patch mitigates this by adding a mechanism to keep track of touch start deferrers that we've already
transitioned to Failed state during the course of a gesture, and uses this information to avoid adding failure
requirements to these deferring gestures that have already been "ungated". This ensures that even if the
deferring gesture resets to Possible state from underneath WebKit, we still avoid pushing out native gesture
recognition due to these deferring gestures.

As an aside, I initially attempted to avoid having TSDG transition back to Possible state altogether in this
scenario, but this doesn't seem to be avoidable (short of overriding the SPI method -_resetGestureRecognizer
and not calling the superclass, which does not seem to be supported behavior).

Test: fast/events/touch/ios/pinch-zoom-with-passive-touch-event-listeners.html

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _doneDeferringTouchStart:]):
(-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

LayoutTests:

Add a test to exercise the fix. Note that this test will only fail without the fix *some* of the time, since it
depends entirely on the order in which two gestures appear in an Objective-C hash datastructure (see WebKit
ChangeLog for more details).

  • fast/events/touch/ios/pinch-zoom-with-passive-touch-event-listeners-expected.txt: Added.
  • fast/events/touch/ios/pinch-zoom-with-passive-touch-event-listeners.html: Added.
10:52 AM Changeset in webkit [287365] by achristensen@apple.com
  • 2 edits in trunk/Tools

Re-enable WebpagePreferences.WebsitePoliciesDuringRedirect API test on Monterey
https://bugs.webkit.org/show_bug.cgi?id=234607

Reviewed by Brady Eidson.

This is the same as r285057 where we were responding with one byte short of the ranges requested,
which used to give a playing event but since Monterey it doesn't. The fix is to respond with all
the bytes requested. If the request is for bytes 0-1, we need to respond with two bytes, for example.

  • TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

(-[TestSchemeHandler webView:startURLSchemeTask:]):
(TEST):

10:48 AM Changeset in webkit [287364] by Simon Fraser
  • 6 edits in trunk/Source

Preferences that read from NSUserDefaults need to be initialied from platformInitializeStore()
https://bugs.webkit.org/show_bug.cgi?id=234488

Reviewed by Sam Weinig.

Having the default value for a preference read from NSUserDefaults can cause issues
if the UIProcess and WebProcess values don't match. Instead, have platformInitializeStore()
explicitly add values for these keys; this is done for scrollAnimatorEnabledKey.

Source/WebKit:

  • UIProcess/Cocoa/WebPreferencesCocoa.mm:

(WebKit::WebPreferences::initializePlatformDependentPreferences):
(WebKit::WebPreferences::platformInitializeStore):

  • UIProcess/WebPreferences.cpp:

(WebKit::WebPreferences::initializePlatformDependentPreferences):

  • UIProcess/WebPreferences.h:

Source/WTF:

  • Scripts/Preferences/WebPreferences.yaml:
10:35 AM Changeset in webkit [287363] by Antti Koivisto
  • 14 edits
    2 adds in trunk

[:has() pseudo-class] :has() selector invalidation issue with toggling :checked
https://bugs.webkit.org/show_bug.cgi?id=234561

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

  • web-platform-tests/css/selectors/invalidation/has-pseudo-class-expected.txt: Added.
  • web-platform-tests/css/selectors/invalidation/has-pseudo-class.html: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/selectors/invalidation/has-pseudo-class.html

Pseudo-classes need to use Style::PseudoClassChangeInvalidation to support invalidation as :has() argument.
This patch adds it for :checked.

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::setChecked):

  • html/HTMLOptionElement.cpp:

(WebCore::HTMLOptionElement::HTMLOptionElement):
(WebCore::HTMLOptionElement::matchesDefaultPseudoClass const):

Use a member for :default instead of attribute test so we can do invalidation over changing it in parseAttribute.

(WebCore::HTMLOptionElement::parseAttribute):
(WebCore::HTMLOptionElement::setSelectedState):

  • html/HTMLOptionElement.h:

LayoutTests:

Results here change because we do more accurate invalidation.

  • fast/css/indirect-adjacent-style-invalidation-1-expected.txt:
  • fast/css/indirect-adjacent-style-invalidation-1.html:
  • fast/css/indirect-adjacent-style-invalidation-2-expected.txt:
  • fast/css/indirect-adjacent-style-invalidation-2.html:
  • fast/css/indirect-adjacent-style-invalidation-3-expected.txt:
  • fast/css/indirect-adjacent-style-invalidation-3.html:
  • fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation-expected.txt:
  • fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html:

Stop testing invalidation state for the element where :checked state changed. That is not
really the point of these tests anyway.
With accurate invalidation the result depends on plaform (iOS has :checked in UA sheet
while other platforms don't)

10:33 AM Changeset in webkit [287362] by Antti Koivisto
  • 3 edits
    2 adds in trunk

[:has() pseudo-class] :has() selector does not render on first pass?
https://bugs.webkit.org/show_bug.cgi?id=234531

Reviewed by Simon Fraser.

Source/WebCore:

With :has() identical sibling elements can have different style which breaks the current
assumptions of the style sharing optimization.

Test: fast/selectors/has-style-sharing.html

  • style/StyleSharingResolver.cpp:

(WebCore::Style::SharingResolver::resolve):

Disable style sharing in presence of :has() rules for now.

For a less heavy-handed approach we need to start testing for :has() rules similar to what is already done
for sibling and attribute rules.

LayoutTests:

Test case by Alex Riviere.

  • fast/selectors/has-style-sharing-expected.html: Added.
  • fast/selectors/has-style-sharing.html: Added.
10:24 AM Changeset in webkit [287361] by msaboff@apple.com
  • 2 edits in trunk/Source/WebCore

Fix WebCore install headers with alternate build
https://bugs.webkit.org/show_bug.cgi?id=234592

Reviewed by Filip Pizlo.

Covered by existing tests.

Fixed OUTPUT_ALTERNATE_ROOT_PATH for macOS to return an empty value since we don't need a symlink
as the WebCore framework is in a subdirectory of WebKit.framework.
Fixed typos with NORMAL_PRODUCTION_FRAMEWORKS_DIR_USE_SYSTEM_CONTENT_PATH_YES rules,
eliminating the ')'s at the end of the lines.

  • Configurations/WebCore.xcconfig:
9:59 AM Changeset in webkit [287360] by J Pascoe
  • 4 edits in trunk

[WebAuthn] Set Web Authentication experimental feature flag as default true
https://bugs.webkit.org/show_bug.cgi?id=234533
<rdar://problem/86743595>

Reviewed by Brent Fulgham.

Source/WTF:

The Web Authentication feature has been shipping for a while. Default value
for experimental feature flag should be true.

  • Scripts/Preferences/WebPreferencesExperimental.yaml:

Tools:

The Web Authentication feature has been shipping for a while. Default value for
experimental feature flag should be true.

  • TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:

(TestWebKitAPI::TEST):
(TestWebKitAPI::WebCore::webAuthenticationExperimentalFeature): Deleted.

9:41 AM Changeset in webkit [287359] by achristensen@apple.com
  • 2 edits in trunk/Tools

Re-enable PrivateClickMeasurement.EphemeralWithAttributedBundleIdentifier API test
https://bugs.webkit.org/show_bug.cgi?id=226548

It was fixed with r287275

  • TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:

(TestWebKitAPI::TEST):

9:37 AM Changeset in webkit [287358] by commit-queue@webkit.org
  • 3 edits
    2 deletes in trunk

Unreviewed, reverting r285087.
https://bugs.webkit.org/show_bug.cgi?id=234605

iPad PLUM3 GPUP 10% regression

Reverted changeset:

"[GPU Process] Small ImageBuffers cause the web process to
crash"
https://bugs.webkit.org/show_bug.cgi?id=232470
https://commits.webkit.org/r285087

9:35 AM Changeset in webkit [287357] by achristensen@apple.com
  • 2 edits in trunk/Tools

Remove failing API test check added in r287342
https://bugs.webkit.org/show_bug.cgi?id=234576

I added a check that has failed on some bots. No need to add it.

  • TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:

(TestWebKitAPI::TEST):

8:57 AM Changeset in webkit [287356] by ntim@apple.com
  • 22 edits in trunk

Internally unprefix -webkit-text-emphasis properties
https://bugs.webkit.org/show_bug.cgi?id=234602

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Adjust test expectations.

  • web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:

Source/WebCore:

It's already exposed unprefixed externally, let's reflect this internally as well.

Makes it easier to remove prefixed versions later on if needed, and it's also less confusing when
going through the CSSProperties.json file.

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSProperties.json:
  • css/CSSValueKeywords.in:
  • css/StyleProperties.cpp:

(WebCore::StyleProperties::getPropertyValue const):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::selectionEmphasisMarkColor const):

  • rendering/TextPaintStyle.cpp:

(WebCore::computeTextPaintStyle):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::unresolvedColorForProperty const):

  • style/PropertyAllowlist.cpp:

(WebCore::Style::isValidMarkerStyleProperty):

  • style/StyleBuilder.cpp:

(WebCore::Style::isValidVisitedLinkProperty):

  • style/StyleBuilderCustom.h:

(WebCore::Style::BuilderCustom::applyInitialTextEmphasisStyle):
(WebCore::Style::BuilderCustom::applyInheritTextEmphasisStyle):
(WebCore::Style::BuilderCustom::applyValueTextEmphasisStyle):
(WebCore::Style::BuilderCustom::applyInitialWebkitTextEmphasisStyle): Deleted.
(WebCore::Style::BuilderCustom::applyInheritWebkitTextEmphasisStyle): Deleted.
(WebCore::Style::BuilderCustom::applyValueWebkitTextEmphasisStyle): Deleted.

LayoutTests:

Adjust test expectations.

  • platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
  • platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • platform/mac/svg/css/getComputedStyle-basic-expected.txt:
7:27 AM Changeset in webkit [287355] by svillar@igalia.com
  • 4 edits
    2 adds in trunk

[REGRESSION][[css-flexbox] child elements are shrunk to fit into container after r286206
https://bugs.webkit.org/show_bug.cgi?id=234361

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-flexbox/flexbox-iframe-intrinsic-size-001-expected.html: Added.
  • web-platform-tests/css/css-flexbox/flexbox-iframe-intrinsic-size-001.html: Added.
  • web-platform-tests/css/css-flexbox/w3c-import.log:

Source/WebCore:

The patch from r286206 fixed the sizing of flex items with intrinsic aspect ratios but no intrinsic sizes
as happens with many SVG images. That fix was however way too general as it was targeted at any replaced
element. The problem of generalizing it is that replaced elements as iframes do not have intrinsic aspect
ratios although they have a default size (300x150px). Constraining the new code to SVG images fixes the
regression.

Replacing is<RenderReplaced>(child) with is<RenderSVGRoot>(child) wouldn't be enough as we need to consider
the newly added LegacySVGRoot that was added as part of the SVG layout refactoring.

Test: imported/w3c/web-platform-tests/css/css-flexbox/flexbox-iframe-intrinsic-size-001.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::isSVGRootWithIntrinsicAspectRatio):
(WebCore::childHasAspectRatio):
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const):
(WebCore::RenderFlexibleBox::childHasComputableAspectRatio const):
(WebCore::isRenderReplacedWithIntrinsicAspectRatio): Deleted.

4:31 AM Changeset in webkit [287354] by commit-queue@webkit.org
  • 3 edits
    2 adds in trunk

null ptr deref in DocumentTimeline::animate
https://bugs.webkit.org/show_bug.cgi?id=234260

Patch by Frédéric Wang <fwang@igalia.com> on 2021-12-22
Reviewed by Darin Adler.

Source/WebCore:

Test: webanimations/document-timeline-animate-crash.html

  • animation/DocumentTimeline.cpp:

(WebCore::DocumentTimeline::animate): If the WeakPtr m_document was destroyed, throw a
TypeError exception so that the call to WebAnimation::create won't cause a null ptr deref.

LayoutTests:

Add non-regression test.

  • webanimations/document-timeline-animate-crash-expected.txt: Added.
  • webanimations/document-timeline-animate-crash.html: Added.
2:13 AM Changeset in webkit [287353] by youenn@apple.com
  • 7 edits
    4 adds in trunk

Use requester when calling updateRequestAndAddExtraFields
https://bugs.webkit.org/show_bug.cgi?id=234507
<rdar://problem/85049490>

Reviewed by Brent Fulgham.

Source/WebCore:

In case of navigation loads, the requester is the fetch request client.
As such, it should be the one used to determine whether the request is cross-origin is not.
Pass the requester to updateRequestAndAddExtraFields to do the correct computation.
Validate that some request fields are now correctly observed in service workers.

Test: http/wpt/service-workers/navigation-iframe-site.https.html

  • loader/FrameLoader.cpp:
  • loader/FrameLoader.h:
  • testing/ServiceWorkerInternals.cpp:
  • testing/ServiceWorkerInternals.h:
  • testing/ServiceWorkerInternals.idl:

LayoutTests:

  • http/wpt/service-workers/navigation-iframe-site-worker.js: Added.
  • http/wpt/service-workers/navigation-iframe-site.https-expected.txt: Added.
  • http/wpt/service-workers/navigation-iframe-site.https.html: Added.
  • http/wpt/service-workers/resources/navigation-iframe-site-frame.html: Added.
1:32 AM Changeset in webkit [287352] by commit-queue@webkit.org
  • 2 edits in trunk/Source/JavaScriptCore

[RISCV64] Fix RISCV64Assembler::ImmediateDecomposition in debug builds
https://bugs.webkit.org/show_bug.cgi?id=234594

Unreviewed, fix the RISCV64Assembler::ImmediateDecomposition constructor
to build in debug mode (fixing the assert) as well as run properly in
that mode (performing manual sign-extension on the lower 12 bits of the
IImmediate value as required for this type of immediates).

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-22

  • assembler/RISCV64Assembler.h:

(JSC::RISCV64Instructions::ImmediateDecomposition::ImmediateDecomposition):

1:04 AM Changeset in webkit [287351] by commit-queue@webkit.org
  • 2 edits
    4 copies
    1 delete in trunk/LayoutTests

[GTK] Update test expectations and baselines. Unreviewed test gardening.
https://bugs.webkit.org/show_bug.cgi?id=234580

Create some GTK-specific baselines where they differ from WPE.

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

  • platform/gtk/TestExpectations:
  • platform/gtk/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-003-expected.txt: Copied from LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-003-expected.txt.
  • platform/gtk/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-shy-expected.txt: Copied from LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-shy-expected.txt.
  • platform/wpe/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-003-expected.txt: Renamed from LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoundingClientRect-003-expected.txt.
  • platform/wpe/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-shy-expected.txt: Renamed from LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-shy-expected.txt.
12:55 AM Changeset in webkit [287350] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

REGRESSION(r287021): [EME][Thunder] Build broken
https://bugs.webkit.org/show_bug.cgi?id=234434

Patch by Philippe Normand <pnormand@igalia.com> on 2021-12-22
Reviewed by Xabier Rodriguez-Calvar.

Fix build, simplify a bit the parsing of message payloads.

  • platform/graphics/gstreamer/eme/CDMThunder.cpp:

(WebCore::CDMInstanceThunder::setServerCertificate):
(WebCore::ParsedResponseMessage::ParsedResponseMessage):
(WebCore::CDMInstanceSessionThunder::errorCallback):
(WebCore::CDMInstanceSessionThunder::requestLicense):
(WebCore::CDMInstanceSessionThunder::updateLicense):
(WebCore::CDMInstanceSessionThunder::loadSession):

12:44 AM Changeset in webkit [287349] by commit-queue@webkit.org
  • 4 edits in trunk

REGRESSION(r284368) [GStreamer] test imported/w3c/web-platform-tests/media-source/mediasource-video-is-visible.html fails on GTK and WPE
https://bugs.webkit.org/show_bug.cgi?id=234352

Patch by Philippe Normand <pnormand@igalia.com> on 2021-12-22
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

r284368 introduced a new behavior in the GL sink where any downstream not being a tag event
was triggering a flush in the media player, which was not originally intended.

  • platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:

(webKitGLVideoSinkSetMediaPlayerPrivate):

LayoutTests:

  • platform/glib/TestExpectations:

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=):

Note: See TracTimeline for information about the timeline view.