Skip to content

Conversation

@caitp
Copy link
Owner

@caitp caitp commented Sep 29, 2021

No description provided.

@caitp caitp changed the title Suppoed [Exposed=*] IDL ExtendedAttribute Support [Exposed=*] IDL ExtendedAttribute Sep 29, 2021
smfr and others added 27 commits October 26, 2021 15:55
https://bugs.webkit.org/show_bug.cgi?id=232294

Reviewed by Martin Robinson.

ImageDiff currently only outputs the diff image when any pixel exceeds its built-in
tolerance.

To prepare for moving the "pass/fail" decision to script, have ImageDiff output the diff
image when any pixel is different. Also have it write "#EOF" so that we're not reliant on
the "diff:" line to terminate reading the output.

Fix up webkitpy unit tests for #EOF parsing, presence of image when the test passes via
tolerance, and to actually test which image data is present in the ImageDiffResult.

* ImageDiff/ImageDiff.cpp:
(processImages):
(main):
* ImageDiff/PlatformImage.cpp:
(ImageDiff::PlatformImage::difference): Track legacyDistanceMax if any pixel diff is non-zero,
since it's needed to scale the diff image.
* Scripts/webkitpy/port/image_diff.py:
(ImageDiffer._read): Look for "#EOF" to terminate the output. Save the diff image, even
if the test passed.
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.test_diff_image.make_proc):
(PortTestCase.test_diff_image):
(PortTestCase.test_diff_image_passed):
(PortTestCase.test_diff_image_failed):
(PortTestCase.test_diff_image_crashed):


Canonical link: https://commits.webkit.org/243547@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284870 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232185

Patch by Gabriel Nava Marino <gnavamarino@apple.com> on 2021-10-26
Reviewed by Tim Nguyen and Antti Koivisto.

Source/WebCore:

The marker renderer can be set as a child of RenderMultiColumnFlowThread
instead of RenderListItem in some instances. RenderMultiColumnFlowThread is
an anonymous box and doesn't have an associated element, so we instead should
loop through the parents until we find the RenderListItem which does have an
associated element.

Test: fast/animation/css-animation-marker-crash.html

* style/Styleable.cpp:
(WebCore::Styleable::fromRenderer):

LayoutTests:

* fast/animation/css-animation-marker-crash-expected.txt: Added.
* fast/animation/css-animation-marker-crash.html: Added.

Canonical link: https://commits.webkit.org/243548@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284871 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…blank-using-return-key.html is a timeout

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

Unreviewed, add rel="opener" to the form since it has target="_blank" and the test still expects an
opener.

* fast/events/ios/submit-form-target-blank-using-return-key.html:

Canonical link: https://commits.webkit.org/243549@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…flaky image failure.

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

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/243550@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…or the main frame

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

Reviewed by Darin Adler.

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


Canonical link: https://commits.webkit.org/243551@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…esults in app initiated loads in Safari

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

Reviewed by Brent Fulgham.

Source/WebKit:

Update session restore code to also set the app initiated value on
the current document loader. Previously, this was only set on the new
document loader. This is a problem because the main resource load
uses the old document loader, so if we restore from a previous session
state, the main resource load will have the incorrect attribution
value.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem):

Tools:

Update API test in 2 ways. First, close the original WebView to
destroy the page's document loader as if the application was being
quit. Second, clear history to make sure there are no cached loads.

* TestWebKitAPI/Tests/WebKitCocoa/AppPrivacyReport.mm:


Canonical link: https://commits.webkit.org/243552@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232240

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

Update the following test and expectation files -
* LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set-expected.txt:
* LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set.html:
* LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
* LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html:
* web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid-expected.txt:
* web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-auto-flow.html:

Source/WebCore:

This is to fix the serialization issue of grid-auto-flow where the word 'row' has been
included necessarily.

This Change is an import of chromium CL at
https://chromium-review.googlesource.com/c/chromium/src/+/3179598

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGridAutoFlow):


Canonical link: https://commits.webkit.org/243553@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… crash.

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

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

Canonical link: https://commits.webkit.org/243554@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232225

Reviewed by Martin Robinson.

Rather than have ImageDiff decide if the comparison passes or fails (with some built-in
tolerance), have it just print the percentage difference, and have the script compare it
against the tolerance.

Code to prettify diff_percent is moved into the script (but should eventually
move closer to display time).

* ImageDiff/ImageDiff.cpp:
(processImages):
* Scripts/webkitpy/port/image_diff.py:
(ImageDiffer._read):
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.test_diff_image.make_proc):
(PortTestCase.test_diff_image_passed):
(PortTestCase):
(PortTestCase.test_diff_image_passed_with_tolerance):
(PortTestCase.test_diff_image_failed_with_rounded_diff):
(PortTestCase.test_diff_image_failed):


Canonical link: https://commits.webkit.org/243555@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…bution-conversion-through-cross-site-image-redirect.html.

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

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/243558@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…flaky crash.

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

Unreviewed test gardening.

* platform/win/TestExpectations:

Canonical link: https://commits.webkit.org/243559@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232309

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

* web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events-expected.txt:

Source/WebCore:

We had logic to only fire a single load / error event for <link> elements, even
though they could do several loads. This logic is not part of the specification
and was causing us to fail some WPT tests.

No new tests, unskipped existing tests.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::HTMLLinkElement):
(WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources):
* html/HTMLLinkElement.h:

LayoutTests:

Unskip tests that are no longer timing out.

* TestExpectations:


Canonical link: https://commits.webkit.org/243560@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…a flaky timeout.

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

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/243561@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ky failure.

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

Unreviewed test gardening.

* platform/mac/TestExpectations:

Canonical link: https://commits.webkit.org/243562@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…d round trip a message to it

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

Reviewed by Alex Christensen.

Source/WebKit:

No new tests (No behavior change yet)

This patch:
- Adds classes representing the WebPushDaemon and connections to it
- Adds classes/constants/macros related to messaging that daemon
- Adds SPI for configuring a connect to that daemon
- Gets MiniBrowser closer to supporting built-in notifications
- Has way more commented out code than usual for a patch, but that enables a great stopping-point milestone

* NetworkProcess/Notifications/Cocoa/WebPushDaemonConnectionCocoa.mm: Added.
(WebKit::WebPushD::addVersionAndEncodedMessageToDictionary):
(WebKit::WebPushD::Connection::newConnectionWasInitialized const):
(WebKit::WebPushD::Connection::connectionReceivedEvent const):
(WebKit::WebPushD::Connection::dictionaryFromMessage const):

* NetworkProcess/Notifications/NetworkNotificationManager.cpp:
(WebKit::NetworkNotificationManager::NetworkNotificationManager):
(WebKit::NetworkNotificationManager::showNotification):
(WebKit::NetworkNotificationManager::cancelNotification):
(WebKit::NetworkNotificationManager::clearNotifications):
(WebKit::NetworkNotificationManager::didDestroyNotification):
(WebKit::NetworkNotificationManager::sendMessage const):
(WebKit::ReplyCaller<>::callReply):
(WebKit::ReplyCaller<String>::callReply):
(WebKit::NetworkNotificationManager::sendMessageWithReply const):
* NetworkProcess/Notifications/NetworkNotificationManager.h:
(WebKit::NetworkNotificationManager::networkSession const):

* NetworkProcess/Notifications/WebPushDaemonConnection.cpp: Copied from Source/WebKit/Platform/IPC/DaemonConnection.cpp.
(WebKit::WebPushD::Connection::Connection):
(WebKit::WebPushD::Connection::networkSession const):
* NetworkProcess/Notifications/WebPushDaemonConnection.h: Copied from Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.h.

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

* Platform/IPC/DaemonConnection.cpp:
* Platform/IPC/DaemonConnection.h:
(WebKit::Daemon::ConnectionToMachService::machServiceName const):
* Platform/IPC/cocoa/DaemonConnectionCocoa.mm:

* Platform/Logging.h:

* Shared/WebPushDaemonConstants.h: Copied from Source/WebKit/Platform/IPC/DaemonConnection.cpp.
(WebKit::WebPushD::messageTypeSendsReply):

* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):

* webpushd/WebPushDaemon.h: Copied from Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.h.
* webpushd/WebPushDaemon.mm: Copied from Source/WebKit/webpushd/WebPushDaemonMain.mm.
(WebPushD::MessageInfo::echoTwice::encodeReply):
(WebPushD::handleWebPushDMessageWithReply):
(WebPushD::Daemon::singleton):
(WebPushD::Daemon::connectionEventHandler):
(WebPushD::Daemon::connectionAdded):
(WebPushD::Daemon::connectionRemoved):
(WebPushD::CompletionHandler<void):
(WebPushD::Daemon::decodeAndHandleMessage):
(WebPushD::Daemon::echoTwice):

* webpushd/WebPushDaemonMain.mm:
(WebPushD::connectionEventHandler):
(WebPushD::connectionAdded):
(WebPushD::connectionRemoved):
(WebPushD::CompletionHandler<void): Deleted.
(WebPushD::echoTwice): Deleted.
(WebPushD::decodeMessageAndSendReply): Deleted.

* Sources.txt:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:

Tools:

* MiniBrowser/mac/AppDelegate.m:
(persistentDataStore):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController _webView:requestNotificationPermissionForSecurityOrigin:decisionHandler:]):


Canonical link: https://commits.webkit.org/243564@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ed to the CTM

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

Reviewed by Darin Adler.

Source/WebCore:

New test: BifurcatedGraphicsContextTests.TransformedClip

* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::clip):
(WebCore::DisplayList::Recorder::clipPath):
(WebCore::DisplayList::Recorder::clipBounds const):
Instead of updating clipBounds any time the CTM changes, store
clipBounds in base coordinates and map through the CTM when retrieved.

This matches CG's behavior and makes the clipBounds much sturdier.
For example, previously, applying a `scale(1, -1)` to the context
would immediately result in the clipBounds' height becoming negative,
making the bounds empty and confusing anything that reads from it.

(WebCore::DisplayList::Recorder::ContextState::translate):
(WebCore::DisplayList::Recorder::ContextState::rotate):
(WebCore::DisplayList::Recorder::ContextState::scale):
(WebCore::DisplayList::Recorder::ContextState::setCTM):
(WebCore::DisplayList::Recorder::ContextState::concatCTM):
Stop updating the clipBounds when the CTM changes, this is no longer necessary.

* platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::extentFromLocalBounds):
Since the clipBounds is now in base space, map the display list
item bounds to base space /before/ intersecting it with clipBounds.

* platform/graphics/displaylists/DisplayListRecorder.h:
Drive-by add a default parameter so getCTM can be called on the subclass the same way it can on GraphicsContext.

* platform/graphics/transforms/AffineTransform.h: Fix a typo.

Tools:

* TestWebKitAPI/Tests/WebCore/cg/BifurcatedGraphicsContextTestsCG.cpp:
(TestWebKitAPI::TEST):
Add a test ensuring that our clipBounds and CG's match through a series
of simple transforms.


Canonical link: https://commits.webkit.org/243565@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… when long pressing a link in Mail

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

Reviewed by Tim Horton.

In the case where the WebKit client isn't overriding the context menu configuration via WebKit context menu UI
delegate methods, `_contextMenuElementInfo` on WKContentView will end up being nil while presenting the context
menu via long press.

After the changes in r281054, this means that when the last view is removed from our WKTargetedPreviewContainer,
we'll unparent WKTargetedPreviewContainer too early, since `_contextMenuElementInfo` won't prevent us from
bailing in `-_removeContextMenuHintContainerIfPossible`. To fix this, we add a boolean flag to track when the
context menu presentation animation is running, and avoid unparenting the preview container if the flag is set.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setUpInteraction]):
(-[WKContentView _removeContextMenuHintContainerIfPossible]):
(-[WKContentView _contentsOfUserInterfaceItem:]):
(-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):

To test this change, add an assertion that fires if the context menu preview hint container has already been
unparented by the time we've presented the context menu. This assertion already fires during the extant layout
test fast/events/touch/ios/long-press-on-link.html, which technically exhibits the bug (albeit in a more subtle
way).

(-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):


Canonical link: https://commits.webkit.org/243566@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=231048

Patch by Alex Christensen <achristensen@webkit.org> on 2021-10-26
Reviewed by John Wilander.

Source/WTF:

* wtf/PlatformHave.h:

Tools:

In rdar://79069615 support for public keys with rsaEncryption OIDs was removed as stated on the blog at
https://webkit.org/blog/11940/pcm-click-fraud-prevention-and-attribution-sent-to-advertiser/
This implements enough ASN1 serialization to serialize a public key in the form accepted by WebKit now,
which is described at https://datatracker.ietf.org/doc/html/rfc8017#appendix-A.2.3

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ASN1Utilities.cpp: Added.
(ASN1::Object::sizeSerializedSize const):
(ASN1::Object::serializeSize const):
(ASN1::ObjectIdentifier::ObjectIdentifier):
(ASN1::ObjectIdentifier::bytes const):
(ASN1::Sequence::create):
(ASN1::Sequence::Sequence):
(ASN1::Sequence::elementEncodedLengthBytes const):
(ASN1::IndexWrapper::IndexWrapper):
(ASN1::Integer::Integer):
(ASN1::BitString::BitString):
(TestWebKitAPI::wrapPublicKeyWithRSAPSSOID):
* TestWebKitAPI/Tests/WebCore/ASN1Utilities.h: Added.
* TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/243567@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232225

Unreviewed; respond to review feedback.

* Scripts/webkitpy/port/image_diff.py:
(ImageDiffer._read):

Canonical link: https://commits.webkit.org/243568@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232095
<rdar://problem/84515738>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/remote/bitbucket.py:
(BitBucket.request): Add support for activities, opening and closing pull-request.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/remote/git_hub.py:
(GitHub.__init__): Add issues.
(GitHub.request): Access issue underlying pull-request (which includes global comments).
* Scripts/libraries/webkitscmpy/webkitscmpy/pull_request.py:
(PullRequest.Exception): Added.
(PullRequest.Comment): Added.
(PullRequest.__init__): Add list of pull-request comments, metadata used by generator.
(PullRequest.open): Re-open the pull-request.
(PullRequest.close): Close the pull-request.
(PullRequest.comment): Make a comment on the pull-request.
(PullRequest.comments): List all comments on a pull-request.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/bitbucket.py:
(BitBucket.PRGenerator.update): Handle closing and opening of the pull-request.
(BitBucket.PRGenerator.comment): Make a comment on a pull-request.
(BitBucket.PRGenerator.comments): List all comments on a pull-request.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py:
(GitHub.PRGenerator.update): Handle closing and opening of the pull-request.
(GitHub.PRGenerator.comment): Make a comment on a issue underpinning a pull-request.
(GitHub.PRGenerator.comments): List all comments on the pull-request.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/scm.py:
(Scm.PRGenerator.update): Add support for opening and closing a pull-request.
(Scm.PRGenerator.comment): Make a comment on a pull-request.
(Scm.PRGenerator.comments): List all comments for a pull-request
* Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py:


Canonical link: https://commits.webkit.org/243569@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ng out

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

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

* web-platform-tests/html/semantics/embedded-content/the-img-element/adoption-expected.txt:

Source/WebCore:

When an <img> moves to a new document, we're supposed to update the image's data.
In HTMLImageElement::didMoveToNewDocument(), we would call HTMLPictureElement::sourcesChanged()
if the <img> element has a parent <picture> element, which would update the image's data.
However, in the absence of a parent <picture> element, we would do nothing. This patch calls
selectImageSource() when the <img> element as a src / srcset attribute to make sure the
image data gets updated.

No new tests, rebaselined existing test.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::didMoveToNewDocument):


Canonical link: https://commits.webkit.org/243571@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/232291>
<rdar://problem/84643135>

Reviewed by Yusuke Suzuki.

Define PAS_FORMAT_PRINTF() macro in pas_utils.h, apply it to
functions that take format strings, then fix all the issues
found during compilation.

These changes also let us remove the clang pragma macros that
ignored -Wformat-nonliteral warnings in pas_log.c and
pas_string_stream.c.

* libpas/src/libpas/pas_all_heaps.c:
(verify_in_steady_state_segregated_directory_callback):
* libpas/src/libpas/pas_bitfit_directory.c:
(pas_bitfit_directory_take_last_empty):
* libpas/src/libpas/pas_bitfit_heap.c:
(pas_bitfit_heap_select_variant):
* libpas/src/libpas/pas_bitfit_page_inlines.h:
(pas_bitfit_page_allocate):
(pas_bitfit_page_deallocate_with_page_impl):
* libpas/src/libpas/pas_commit_span.c:
(pas_commit_span_construct):
(pas_commit_span_add_unchanged):
* libpas/src/libpas/pas_enumerate_large_heaps.c:
(record_span):
(pas_enumerate_large_heaps):
* libpas/src/libpas/pas_fd_stream.c:
(fd_stream_vprintf):
* libpas/src/libpas/pas_fd_stream.h:
* libpas/src/libpas/pas_hashtable.h:
* libpas/src/libpas/pas_large_map.c:
(pas_large_map_add):
(pas_large_map_take):
* libpas/src/libpas/pas_large_sharing_pool.c:
(validate_min_heap):
* libpas/src/libpas/pas_local_allocator_inlines.h:
(pas_local_allocator_scan_bits_to_set_up_free_bits):
(pas_local_allocator_return_memory_to_page):
(pas_local_allocator_try_allocate_inline_cases):
* libpas/src/libpas/pas_log.c:
* libpas/src/libpas/pas_log.h:
* libpas/src/libpas/pas_page_sharing_pool.c:
(pas_page_sharing_pool_add_at_index):
* libpas/src/libpas/pas_segregated_directory_inlines.h:
(pas_segregated_directory_iterate_iterate_callback):
(pas_segregated_directory_iterate_forward):
* libpas/src/libpas/pas_segregated_heap.c:
(pas_segregated_heap_ensure_size_directory_for_count):
* libpas/src/libpas/pas_segregated_shared_page_directory.c:
(pas_segregated_shared_page_directory_find_first_eligible):
* libpas/src/libpas/pas_segregated_shared_view.c:
(compute_summary):
* libpas/src/libpas/pas_segregated_view.c:
(for_each_live_object):
(should_be_eligible):
* libpas/src/libpas/pas_status_reporter.c:
(pas_status_reporter_dump_large_map):
* libpas/src/libpas/pas_stream.h:
* libpas/src/libpas/pas_string_stream.c:
(string_stream_vprintf):
* libpas/src/libpas/pas_string_stream.h:
* libpas/src/libpas/pas_thread_local_cache.c:
(suspend):
* libpas/src/libpas/pas_tiny_large_map_entry.h:
(pas_tiny_large_map_entry_can_create):
* libpas/src/libpas/pas_try_allocate_common.h:
(pas_try_allocate_common_impl_fast):
(pas_try_allocate_common_impl_slow):
* libpas/src/libpas/pas_try_allocate_intrinsic.h:
* libpas/src/libpas/pas_utils.h:


Canonical link: https://commits.webkit.org/243572@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232311
<rdar://problem/55199117>

Reviewed by Kate Cheney.

Avoid attempting to present a nil NSViewController. Instead, just treat the interaction as if
the authentication was cancelled.

* UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.mm:
(-[WKSOAuthorizationDelegate authorization:presentViewController:withCompletion:]):


Canonical link: https://commits.webkit.org/243573@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284896 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nmoucht and others added 24 commits November 1, 2021 22:04
…thml/relations/html5-tree/dynamic-childlist-001.html

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

Reviewed by Myles C. Maxfield.

* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/mac-bigsur/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-001-expected.txt: Added.
* platform/mac/TestExpectations:



Canonical link: https://commits.webkit.org/243773@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…html is a flaky crash.

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

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:


Canonical link: https://commits.webkit.org/243774@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…tent needs bidi split

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

Reviewed by Antti Koivisto.

When we know we are going to do bidi processing, these inline item width results will most likely become stale at breakAndComputeBidiLevels.

* layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::breakAndComputeBidiLevels):
(WebCore::Layout::InlineItemsBuilder::handleTextContent):
(WebCore::Layout::InlineItemsBuilder::enterBidiContext):
(WebCore::Layout::InlineItemsBuilder::exitBidiContext):
(WebCore::Layout::InlineItemsBuilder::buildPreviousTextContent):
* layout/formattingContexts/inline/InlineItemsBuilder.h:
(WebCore::Layout::InlineItemsBuilder::isBiDiContent const):



Canonical link: https://commits.webkit.org/243775@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232576

Reviewed by Jonathan Bedard.

Some of these are largely copied from layout_tests/run_webkit_tests_integrationtest.py, but
in unit test form for the test finder.

* Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy_unittest.py:
(LayoutTestFinderTests.__init__):
(LayoutTestFinderTests):
(LayoutTestFinderTests.setUp):
(LayoutTestFinderTests.tearDown):
(LayoutTestFinderTests.test_find_no_paths_specified):
(LayoutTestFinderTests.test_find_no_paths_sorted):
(LayoutTestFinderTests.test_find_all_no_paths):
(LayoutTestFinderTests.test_includes_other_platforms):
(LayoutTestFinderTests.test_find_one_test):
(LayoutTestFinderTests.test_find_platform):
(LayoutTestFinderTests.test_find_platform_self):
(LayoutTestFinderTests.test_find_platform_other):
(LayoutTestFinderTests.test_find_platform_specific):
(LayoutTestFinderTests.test_find_platform_specific_directory):
(LayoutTestFinderTests.test_find_directory_includes_platform_specific):
(LayoutTestFinderTests.test_find_glob):
(LayoutTestFinderTests.test_find_glob_mixed_file_type_sorted):
(LayoutTestFinderTests.test_find_glob_directory):
(LayoutTestFinderTests.test_find_glob_directory_b):
(LayoutTestFinderTests.test_find_glob_directory_e):
(LayoutTestFinderTests.test_find_directory):
(LayoutTestFinderTests.test_find_directory_trailing_slash):
(LayoutTestFinderTests.test_find_directory_star):
(LayoutTestFinderTests.test_preserves_order):
(LayoutTestFinderTests.test_preserves_order_multiple_times):
(LayoutTestFinderTests.test_preserves_order_directories):
(LayoutTestFinderTests.test_preserves_order_mixed_file_type):
(LayoutTestFinderTests.test_preserves_order_mixed_file_type_b):
(LayoutTestFinderTests.test_find_directory_multiple_times):
(LayoutTestFinderTests.test_no_reference):
(LayoutTestFinderTests.test_glob_no_references):
(LayoutTestFinderTests.test_find_with_skipped_directories):
(LayoutTestFinderTests.test_find_with_skipped_directories_2):
(LayoutTestFinderTests.test_is_test_file):
(LayoutTestFinderTests.test_is_w3c_resource_file):
(LayoutTestFinderTests.make_finder): Deleted.
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(RunTest.setUp): Re-enable tests on Python 3, as this now works
(RunTest.test_child_processes_min): Also ignore tests in platform/
* Scripts/webkitpy/port/test.py:



Canonical link: https://commits.webkit.org/243776@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232579

Reviewed by Alex Christensen.

Avoid heap-allocating ImportanceAssertion since this is just a wrapper around a
mach_port.

Also update the ImportanceAssertion destructor to null out the mach port as
hardening given <rdar://75139294>.

* Platform/IPC/Decoder.cpp:
(IPC::Decoder::setImportanceAssertion):
* Platform/IPC/Decoder.h:
* Platform/IPC/cocoa/ConnectionCocoa.mm:
(IPC::Connection::receiveSourceEventHandler):
* Platform/IPC/cocoa/ImportanceAssertion.h:
(IPC::ImportanceAssertion::ImportanceAssertion):
(IPC::ImportanceAssertion::operator=):
(IPC::ImportanceAssertion::~ImportanceAssertion):



Canonical link: https://commits.webkit.org/243777@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…GPUDevice

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

Reviewed by Tim Horton.

We should have called it GPUPrewarming from the beginning, because that's what it does.

No new tests because there is no behavior change.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/ProcessWarming.cpp:
* platform/graphics/gpu/GPUPrewarming.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUDevice.h.
* platform/graphics/gpu/cocoa/GPUPrewarmingMetal.mm: Renamed from Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm.



Canonical link: https://commits.webkit.org/243778@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=231987
<rdar://problem/84434991>

Reviewed by Dewei Zhu.

GitHub will report the entire history of a review, we should only
respect the latest review state.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py:
(GitHub.PRGenerator.reviewers):
* Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py:
(TestNetworkPullRequestGitHub.test_approved_edits):



Canonical link: https://commits.webkit.org/243779@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ectory

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

Reviewed by Konstantin Tokarev.

r285096 removed WebCore/Modules/webgpu directory.

* CMakeLists.txt: Removed Modules/webgpu directory from
WebCore_IDL_INCLUDES and WebCore_PRIVATE_INCLUDE_DIRECTORIES.
* PlatformMac.cmake:


Canonical link: https://commits.webkit.org/243780@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/232587>

Reviewed by Jonathan Bedard.

* metadata/contributors.json:



Canonical link: https://commits.webkit.org/243781@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=231928

LayoutTests/imported/w3c:

Patch by Michael[tm] Smith <mike@w3.org> on 2021-11-01
Reviewed by Darin Adler

Update tests with CORS messages, by adding the status code.

* web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-data-url-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox_032-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-crossorigin-change.sub-expected.txt:
* web-platform-tests/referrer-policy/generic/sandboxed-iframe-with-opaque-origin-expected.txt:
* web-platform-tests/workers/modules/dedicated-worker-import-data-url-cross-origin-expected.txt:
* web-platform-tests/worklets/audio-worklet-credentials.https-expected.txt:
* web-platform-tests/worklets/audio-worklet-import.https-expected.txt:
* web-platform-tests/worklets/audio-worklet-referrer.https-expected.txt:

Source/WebCore:

Patch by Michael Smith <mike@w3.org> on 2021-11-01
Reviewed by Darin Adler

Make the HTTP status be included in all CORS messages that might
get logged to the Inspector console when a 4xx or 5xx error occurs.
That means these:

* Failed to load resource: Origin foo is not allowed by
Access-Control-Allow-Origin

* Failed to load resource: Preflight response is not successful

The change makes those messages read as follows (in the case of,
for example, a 500 error):

* Failed to load resource: Origin foo is not allowed by
Access-Control-Allow-Origin. Status code: 500

* Failed to load resource: Preflight response is not successful.
Status code: 500

Tests: Updates 100+ existing tests, by changing expected messages.

* loader/CrossOriginAccessControl.cpp:
(WebCore::passesAccessControlCheck):
(WebCore::validatePreflightResponse):

Source/WebKit:

Patch by Michael[tm] Smith <mike@w3.org> on 2021-11-01
Reviewed by Darin Adler

Make the HTTP status be included in all CORS messages that might
get logged to the Inspector console when a 4xx or 5xx error occurs.
That means these:

* Failed to load resource: Origin foo is not allowed by
Access-Control-Allow-Origin

* Failed to load resource: Preflight response is not successful

The change makes those messages read as follows (in the case of,
for example, a 500 error):

* Failed to load resource: Origin foo is not allowed by
Access-Control-Allow-Origin. Status code: 500

* Failed to load resource: Preflight response is not successful.
Status code: 500

Tests: Updates 100+ existing tests, by changing expected messages.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):

LayoutTests:

Patch by Michael Smith <mike@w3.org> on 2021-11-01
Reviewed by Darin Adler

Update tests with CORS messages, by adding the status code.

* http/tests/eventsource/eventsource-cors-basic-expected.txt:
* http/tests/loading/cross-origin-XHR-willLoadRequest-expected.txt:
* http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt:
* http/tests/security/cached-cross-origin-preloaded-css-stylesheet-expected.txt:
* http/tests/security/cached-cross-origin-preloading-css-stylesheet-expected.txt:
* http/tests/security/cannot-read-cssrules-expected.txt:
* http/tests/security/cannot-read-cssrules-redirect-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:
* http/tests/security/cookie-module-import-propagate-expected.txt:
* http/tests/security/cross-origin-cached-images-expected.txt:
* http/tests/security/cross-origin-cached-resource-expected.txt:
* http/tests/security/cross-origin-cached-scripts-expected.txt:
* http/tests/security/cross-origin-cached-scripts-parallel-expected.txt:
* http/tests/security/img-with-failed-cors-check-fails-to-load-expected.txt:
* http/tests/security/import-module-crossorigin-loads-error-expected.txt:
* http/tests/security/import-module-crossorigin-loads-error-src-expected.txt:
* http/tests/security/import-script-crossorigin-loads-error-expected.txt:
* http/tests/security/isolatedWorld/cross-origin-xhr-expected.txt:
* http/tests/security/load-image-after-redirection-2-expected.txt:
* http/tests/security/load-image-after-redirection-expected.txt:
* http/tests/security/script-with-failed-cors-check-fails-to-load-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-3-expected.txt:
* http/tests/security/text-track-crossorigin-expected.txt:
* http/tests/security/video-cross-origin-accessfailure-expected.txt:
* http/tests/security/video-poster-cross-origin-crash-expected.txt:
* http/tests/security/video-poster-cross-origin-crash2-expected.txt:
* http/tests/subresource-integrity/sri-fetch-expected.txt:
* http/tests/subresource-integrity/sri-fetch-worker-expected.txt:
* http/tests/subresource-integrity/sri-module-expected.txt:
* http/tests/subresource-integrity/sri-script-expected.txt:
* http/tests/subresource-integrity/sri-style-expected.txt:
* http/tests/workers/service/service-worker-crossorigin-fetch-expected.txt:
* http/tests/workers/service/serviceworkerclients-claim.https-expected.txt:
* http/tests/workers/service/shift-reload-navigation-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-post-fail-non-simple-content-type-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-async-not-supported-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-sync-not-supported-expected.txt:
* http/tests/xmlhttprequest/access-control-repeated-failed-preflight-crash-expected.txt:
* http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-without-wildcard-expected.txt:
* http/tests/xmlhttprequest/cross-origin-no-credential-prompt-expected.txt:
* http/tests/xmlhttprequest/cross-site-denied-response-expected.txt:
* http/tests/xmlhttprequest/cross-site-denied-response-sync-2-expected.txt:
* http/tests/xmlhttprequest/cross-site-denied-response-sync-expected.txt:
* http/tests/xmlhttprequest/onerror-event-expected.txt:
* http/tests/xmlhttprequest/origin-allow-list-https-expected.txt:
* http/tests/xmlhttprequest/origin-allow-list-ip-addresses-with-subdomains-expected.txt:
* http/tests/xmlhttprequest/origin-allow-list-removal-expected.txt:
* http/tests/xmlhttprequest/origin-exact-matching-expected.txt:
* http/tests/xmlhttprequest/post-blob-content-type-async-expected.txt:
* http/tests/xmlhttprequest/post-blob-content-type-sync-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-2-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-post-sync-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-sync-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-sync-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-sync-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
* http/tests/xmlhttprequest/upload-request-error-event-order-expected.txt:
* http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt:
* http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
* http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:
* http/wpt/resource-timing/rt-resource-errors-expected.txt:
* http/wpt/webaudio/audioworklet-addModule-cors.sub.https-expected.txt:
* platform/glib/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
* platform/gtk/http/tests/security/video-cross-origin-accessfailure-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt:
* platform/ios/http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/post-blob-content-type-async-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/post-blob-content-type-sync-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-none.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-require-corp.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-none.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-require-corp.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt:
* platform/win/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
* platform/win/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* platform/win/http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* platform/win/http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt:
* platform/win/http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:
* platform/win/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
* platform/win/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:
* platform/wincairo-wk1/http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt:
* platform/wincairo-wk1/http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
* platform/wincairo/http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:


Canonical link: https://commits.webkit.org/243782@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232586

Reviewed by Ross Kirsling.

.:

Setting CURLOPT_COOKIEFILE to NULL to disable the cookie engine was not added till 7.77.0
so require that version or later.

* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWinCairo.cmake:

Source/WebCore:

Explicitly disable the cookie engine inside curl.

* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::CurlHandle):



Canonical link: https://commits.webkit.org/243783@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232590
<rdar://problem/84904540>

Unreviewed build fix.

In r285092 the signature of childrenChanged went from AXCoreObject* to AccessibilityObject*
but wasn't updated when accessibility is disabled.


* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::checkedStateChanged):
(WebCore::AXObjectCache::childrenChanged):



Canonical link: https://commits.webkit.org/243784@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232588

Reviewed by David Kilzer.

* WebCoreSupport/WebChromeClient.h:



Canonical link: https://commits.webkit.org/243785@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=228552
rdar://81217357

Reviewed by Saam Barati.

LLIntCallee can be used for signaling memory and bounds-checking memory.
Thus it should have two replacements for each mode.

* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::work):
* wasm/WasmCallee.h:
(JSC::Wasm::Callee::setOSREntryCallee):
* wasm/WasmOMGForOSREntryPlan.cpp:
(JSC::Wasm::OMGForOSREntryPlan::work):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::updateCallSitesToCallUs):
* wasm/WasmSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::WASM_SLOW_PATH_DECL):



Canonical link: https://commits.webkit.org/243786@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…uires an argument of type 'unsigned long', but variadic argument 2 has type 'size_t'

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

Reviewed by Don Olmstead.

Since r284764, MSVC reports the following warning and a suggestion.

> Tools\ImageDiff\ImageDiff.cpp(74): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 2 has type 'size_t'
> Tools\ImageDiff\ImageDiff.cpp(74): note: consider using '%zu' in the format string

* ImageDiff/ImageDiff.cpp:
(processImages): Use %zu for size_t.



Canonical link: https://commits.webkit.org/243787@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232591

Reviewed by Ross Kirsling.

Reorder member initializer list in CurlRequest::CurlRequest to follow the ordering of
members in its declaration.

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):



Canonical link: https://commits.webkit.org/243788@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…rands are labelled in reverse

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

Reviewed by Saam Barati.

In offlineasm, `OP a, b, c` is `c = a OP b` but `OP a, b` is `b = b OP a`.

This can make identifiers like `left` and `right` quite confusing --
simple cases like `subd left, right` are already misleading, while OpDiv literally
passes its RHS to a macro as `left` and then checks `left` for division by zero.
It becomes difficult to keep this all in one's brain without rewriting it on paper.

This patch may not constitute a "complete solution", but it at least makes our naming honest:
1. Use 3-argument syntax (as `left, right, result`) whenever possible.
2. When not possible (e.g. because `bsubio` isn't flexible about its arguments or
   because x86 doesn't have 3-argument shift operations), then say `rhs, lhs` explicitly.

* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:



Canonical link: https://commits.webkit.org/243789@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232604

Reviewed by Yusuke Suzuki.

* heap/Heap.cpp:
(JSC::Heap::notifyThreadStopping):
* heap/Heap.h:



Canonical link: https://commits.webkit.org/243790@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…tom URI scheme handlers

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

Patch by Zixing Liu <liushuyu011@gmail.com> on 2021-11-02
Reviewed by Carlos Garcia Campos.

Source/WebKit:

* SourcesGTK.txt: Added WebKitURISchemeResponse.cpp
* SourcesWPE.txt: Added WebKitURISchemeResponse.cpp
* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
(webkit_uri_scheme_request_get_http_method): Added new API function
(webkit_uri_request_finish_with_response): Added new API function
* UIProcess/API/glib/WebKitURISchemeRequestPrivate.h:  Added.
* UIProcess/API/glib/WebKitURISchemeResponse.cpp: Added.
(webkit_uri_scheme_response_class_init): Added init function for the new type
(webkit_uri_scheme_response_new): Added new API function
(webkit_uri_scheme_response_set_status): Added new API function
(webkit_uri_scheme_response_set_content_type): Added new API function
* UIProcess/API/glib/WebKitURISchemeResponsePrivate.h: Copied from Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequestPrivate.h.
* UIProcess/API/gtk/WebKitAutocleanups.h: Register clean-up function for WebkitURISchemeResponse
* UIProcess/API/gtk/WebKitURISchemeRequest.h: Added function prototype for
webkit_uri_scheme_request_get_http_method
* UIProcess/API/gtk/WebKitURISchemeResponse.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new symbols and new types
* UIProcess/API/gtk/webkit2.h: Include a new header: WebKitURISchemeResponse.h
* UIProcess/API/wpe/WebKitURISchemeRequest.h: Added function prototype for
webkit_uri_scheme_request_get_http_method
* UIProcess/API/gtk/WebKitURISchemeResponse.h: Added.
* UIProcess/API/wpe/webkit.h: Include a new header: WebKitURISchemeResponse.h
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt: Added new symbols and new types

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp:
(testWebContextURIScheme): Added tests to test new public APIs for WebKitGtk


Canonical link: https://commits.webkit.org/243791@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…te spanning inline box geometry

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

Reviewed by Antti Koivisto.

Now that we have dedicated LineSpanningInlineBoxStart line run type, let's use it to update the associated inline box geometry.

* layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::build):
(WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineContent): Move the update logic over here from the createBoxesAndUpdateGeometryForLineSpanningInlineBoxes loop.
(WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineSpanningInlineBoxes): Deleted.
* layout/formattingContexts/inline/InlineDisplayContentBuilder.h:



Canonical link: https://commits.webkit.org/243792@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232600

Reviewed by Antti Koivisto.

In this patch we compute the visual order for the bidi runs if needed. This visual order is then passed
in to the display box builder so that the final display boxes are constructed in the right order (horizontal positions are not yet adjusted).

* layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::createBoxesAndUpdateGeometryForLineContent):
* layout/formattingContexts/inline/InlineLine.h:
(WebCore::Layout::Line::contentNeedsBidiReordering const):
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
* layout/formattingContexts/inline/InlineLineBuilder.h:



Canonical link: https://commits.webkit.org/243793@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232463
<rdar://problem/84784354>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
(PullRequest.title_for): Compute pull-request title for a set of commits.
(PullRequest.main): Generalize pull-request title generation.



Canonical link: https://commits.webkit.org/243794@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=232458
<rdar://82657744>

Reviewed by Simon Fraser.

Source/WebKit:

Use higher QoS for WheelEvent and DisplayWasRefreshed IPCs since those are high priority. The
UIProcess's main thread has high UserInteractive QoS but the IPC thread has a lower QoS by default.

We cannot raise the QoS of the IPC thread without regressing some performance benchmarks since not
all IPC is high priority.

Making this change helps with responsiveness under heavy load scenarios.

* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):
* Platform/IPC/Connection.h:
(IPC::Connection::send):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sendWheelEvent):
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::notifyObserversDisplayWasRefreshed):

Source/WTF:

Add dispatchWithQOS() function to WorkQueue to dispatch a task with a given QoS.

* wtf/WorkQueue.cpp:
(WTF::WorkQueueBase::dispatchWithQOS):
* wtf/WorkQueue.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueueBase::dispatchWithQOS):



Canonical link: https://commits.webkit.org/243795@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
caitp pushed a commit that referenced this pull request Nov 29, 2021
https://bugs.webkit.org/show_bug.cgi?id=232265

Patch by Mikhail R. Gadelha <mikhail@igalia.com> on 2021-11-09
Reviewed by Saam Barati.

Follow-up from https://bugs.webkit.org/show_bug.cgi?id=232242,
this patch includes several small code changes but the patch doesn't
add/remove any feature:

1. Removed several calls to operationPutByVal*Cell* that were
only used by the 32 bit code paths due to the lack of registers.
These calls were replaced by the calls used by the 64 bit paths,
that expect EncodedJSValues
2. Because of #1, this patch removes those methods, since no one
uses them anymore.
3. Created compilePutByVal to handle all cases (similar to compileGetByVal).
4. Removed the Edge& childX from the PutByVal handling (and all methods
that expected them) in favor of getting them from node when needed.
5. Unified compileContiguousPutByVal so it could be used by both 32
and 64 bit archs.
6. Removed a lot of whitespace.

* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileContiguousPutByVal):
(JSC::DFG::SpeculativeJIT::compileDoublePutByVal):
(JSC::DFG::SpeculativeJIT::compilePutByVal):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
(JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithString): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithSymbol): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetPrivateName): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetPrivateNameByVal): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetPrivateNameById): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutByValForCellWithString): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutByValForCellWithSymbol): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetByValWithThis): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutPrivateName): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutPrivateNameById): Deleted.
(JSC::DFG::SpeculativeJIT::compileCheckPrivateBrand): Deleted.
(JSC::DFG::SpeculativeJIT::compileSetPrivateBrand): Deleted.
(JSC::DFG::SpeculativeJIT::compileCheckTypeInfoFlags): Deleted.
(JSC::DFG::SpeculativeJIT::compileParseInt): Deleted.
(JSC::DFG::SpeculativeJIT::compileOverridesHasInstance): Deleted.
(JSC::DFG::SpeculativeJIT::compileInstanceOfForCells): Deleted.
(JSC::DFG::SpeculativeJIT::compileInstanceOf): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueBitNot): Deleted.
(JSC::DFG::SpeculativeJIT::compileBitwiseNot): Deleted.
(JSC::DFG::SpeculativeJIT::emitUntypedOrAnyBigIntBitOp): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueBitwiseOp): Deleted.
(JSC::DFG::SpeculativeJIT::compileBitwiseOp): Deleted.
(JSC::DFG::SpeculativeJIT::emitUntypedOrBigIntRightShiftBitOp): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueLShiftOp): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueBitRShift): Deleted.
(JSC::DFG::SpeculativeJIT::compileShiftOp): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueAdd): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueSub): Deleted.
(JSC::DFG::SpeculativeJIT::compileMathIC): Deleted.
(JSC::DFG::SpeculativeJIT::compileInstanceOfCustom): Deleted.
(JSC::DFG::SpeculativeJIT::compileIsCellWithType): Deleted.
(JSC::DFG::SpeculativeJIT::compileIsTypedArrayView): Deleted.
(JSC::DFG::SpeculativeJIT::compileToObjectOrCallObjectConstructor): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithAdd): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithAbs): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithClz32): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithDoubleUnaryOp): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithSub): Deleted.
(JSC::DFG::SpeculativeJIT::compileIncOrDec): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueNegate): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithNegate): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueMul): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithMul): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueDiv): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithDiv): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithFRound): Deleted.
(JSC::DFG::SpeculativeJIT::compileValueMod): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithMod): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithRounding): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithUnary): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithSqrt): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithMinMax): Deleted.
(JSC::DFG::compileArithPowIntegerFastPath): Deleted.
(JSC::DFG::SpeculativeJIT::compileValuePow): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithPow): Deleted.
(JSC::DFG::SpeculativeJIT::compare): Deleted.
(JSC::DFG::SpeculativeJIT::compileCompareUnsigned): Deleted.
(JSC::DFG::SpeculativeJIT::compileStrictEq): Deleted.
(JSC::DFG::SpeculativeJIT::compileBooleanCompare): Deleted.
(JSC::DFG::SpeculativeJIT::compileInt32Compare): Deleted.
(JSC::DFG::SpeculativeJIT::compileDoubleCompare): Deleted.
(JSC::DFG::SpeculativeJIT::compileObjectEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileSymbolEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compilePeepHoleSymbolEquality): Deleted.
(JSC::DFG::SpeculativeJIT::emitBitwiseJSValueEquality): Deleted.
(JSC::DFG::SpeculativeJIT::emitBranchOnBitwiseJSValueEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileNotDoubleNeitherDoubleNorHeapBigIntNorStringStrictEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compilePeepHoleNotDoubleNeitherDoubleNorHeapBigIntNorStringStrictEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileStringEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileStringToUntypedEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileStringIdentEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileStringIdentToNotStringVarEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileStringCompare): Deleted.
(JSC::DFG::SpeculativeJIT::compileStringIdentCompare): Deleted.
(JSC::DFG::SpeculativeJIT::compileSameValue): Deleted.
(JSC::DFG::SpeculativeJIT::compileToBooleanString): Deleted.
(JSC::DFG::SpeculativeJIT::compileToBooleanStringOrOther): Deleted.
(JSC::DFG::SpeculativeJIT::emitStringBranch): Deleted.
(JSC::DFG::SpeculativeJIT::emitStringOrOtherBranch): Deleted.
(JSC::DFG::SpeculativeJIT::compileConstantStoragePointer): Deleted.
(JSC::DFG::SpeculativeJIT::cageTypedArrayStorage): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetByValOnDirectArguments): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetScope): Deleted.
(JSC::DFG::SpeculativeJIT::compileSkipScope): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetGlobalObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetGlobalThis): Deleted.
(JSC::DFG::SpeculativeJIT::canBeRope): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetArrayLength): Deleted.
(JSC::DFG::SpeculativeJIT::compileCheckIdent): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewFunction): Deleted.
(JSC::DFG::SpeculativeJIT::compileSetFunctionName): Deleted.
(JSC::DFG::SpeculativeJIT::compileVarargsLength): Deleted.
(JSC::DFG::SpeculativeJIT::compileLoadVarargs): Deleted.
(JSC::DFG::SpeculativeJIT::compileForwardVarargs): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateActivation): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateDirectArguments): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetFromArguments): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutToArguments): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetArgument): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateScopedArguments): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateClonedArguments): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateArgumentsButterfly): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateRest): Deleted.
(JSC::DFG::SpeculativeJIT::compileSpread): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewArray): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSpread): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetRestLength): Deleted.
(JSC::DFG::SpeculativeJIT::emitPopulateSliceIndex): Deleted.
(JSC::DFG::SpeculativeJIT::compileArraySlice): Deleted.
(JSC::DFG::SpeculativeJIT::compileArrayIndexOf): Deleted.
(JSC::DFG::SpeculativeJIT::compileArrayPush): Deleted.
(JSC::DFG::SpeculativeJIT::compileNotifyWrite): Deleted.
(JSC::DFG::SpeculativeJIT::compileIsObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileTypeOfIsObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileIsCallable): Deleted.
(JSC::DFG::SpeculativeJIT::compileIsConstructor): Deleted.
(JSC::DFG::SpeculativeJIT::compileTypeOf): Deleted.
(JSC::DFG::SpeculativeJIT::emitStructureCheck): Deleted.
(JSC::DFG::SpeculativeJIT::compileCheckIsConstant): Deleted.
(JSC::DFG::SpeculativeJIT::compileCheckNotEmpty): Deleted.
(JSC::DFG::SpeculativeJIT::compileCheckStructure): Deleted.
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage): Deleted.
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage): Deleted.
(JSC::DFG::SpeculativeJIT::compileNukeStructureAndSetButterfly): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetButterfly): Deleted.
(JSC::DFG::allocateTemporaryRegistersForSnippet): Deleted.
(JSC::DFG::SpeculativeJIT::compileCallDOM): Deleted.
(JSC::DFG::SpeculativeJIT::compileCallDOMGetter): Deleted.
(JSC::DFG::SpeculativeJIT::compileCheckJSCast): Deleted.
(JSC::DFG::SpeculativeJIT::temporaryRegisterForPutByVal): Deleted.
(JSC::DFG::SpeculativeJIT::compileToStringOrCallStringConstructorOrStringValueOf): Deleted.
(JSC::DFG::getExecutable): Deleted.
(JSC::DFG::SpeculativeJIT::compileFunctionToString): Deleted.
(JSC::DFG::SpeculativeJIT::compileNumberToStringWithValidRadixConstant): Deleted.
(JSC::DFG::SpeculativeJIT::compileNumberToStringWithRadix): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewStringObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewSymbol): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewTypedArrayWithSize): Deleted.
(JSC::DFG::SpeculativeJIT::emitNewTypedArrayWithSizeInRegister): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewRegexp): Deleted.
(JSC::DFG::SpeculativeJIT::speculateCellTypeWithoutTypeFiltering): Deleted.
(JSC::DFG::SpeculativeJIT::speculateCellType): Deleted.
(JSC::DFG::SpeculativeJIT::speculateInt32): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNumber): Deleted.
(JSC::DFG::SpeculativeJIT::speculateRealNumber): Deleted.
(JSC::DFG::SpeculativeJIT::speculateDoubleRepReal): Deleted.
(JSC::DFG::SpeculativeJIT::speculateBoolean): Deleted.
(JSC::DFG::SpeculativeJIT::speculateCell): Deleted.
(JSC::DFG::SpeculativeJIT::speculateCellOrOther): Deleted.
(JSC::DFG::SpeculativeJIT::speculateObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateFunction): Deleted.
(JSC::DFG::SpeculativeJIT::speculateFinalObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateRegExpObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateArray): Deleted.
(JSC::DFG::SpeculativeJIT::speculateProxyObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateDerivedArray): Deleted.
(JSC::DFG::SpeculativeJIT::speculatePromiseObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateDateObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateMapObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateSetObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateWeakMapObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateWeakSetObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateDataViewObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateObjectOrOther): Deleted.
(JSC::DFG::SpeculativeJIT::speculateString): Deleted.
(JSC::DFG::SpeculativeJIT::speculateStringOrOther): Deleted.
(JSC::DFG::SpeculativeJIT::speculateStringIdentAndLoadStorage): Deleted.
(JSC::DFG::SpeculativeJIT::speculateStringIdent): Deleted.
(JSC::DFG::SpeculativeJIT::speculateStringObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateStringOrStringObject): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNotStringVar): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNotSymbol): Deleted.
(JSC::DFG::SpeculativeJIT::speculateSymbol): Deleted.
(JSC::DFG::SpeculativeJIT::speculateHeapBigInt): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNotCell): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNotCellNorBigInt): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNotDouble): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNeitherDoubleNorHeapBigInt): Deleted.
(JSC::DFG::SpeculativeJIT::speculateNeitherDoubleNorHeapBigIntNorString): Deleted.
(JSC::DFG::SpeculativeJIT::speculateOther): Deleted.
(JSC::DFG::SpeculativeJIT::speculateMisc): Deleted.
(JSC::DFG::SpeculativeJIT::speculate): Deleted.
(JSC::DFG::SpeculativeJIT::emitSwitchIntJump): Deleted.
(JSC::DFG::SpeculativeJIT::emitSwitchImm): Deleted.
(JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump): Deleted.
(JSC::DFG::SpeculativeJIT::emitSwitchChar): Deleted.
(JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): Deleted.
(JSC::DFG::SpeculativeJIT::emitSwitchStringOnString): Deleted.
(JSC::DFG::SpeculativeJIT::emitSwitchString): Deleted.
(JSC::DFG::SpeculativeJIT::emitSwitch): Deleted.
(JSC::DFG::SpeculativeJIT::addBranch): Deleted.
(JSC::DFG::SpeculativeJIT::linkBranches): Deleted.
(JSC::DFG::SpeculativeJIT::compileStoreBarrier): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutAccessorById): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutGetterSetterById): Deleted.
(JSC::DFG::SpeculativeJIT::compileResolveScope): Deleted.
(JSC::DFG::SpeculativeJIT::compileResolveScopeForHoistingFuncDeclInEval): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetGlobalVariable): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutGlobalVariable): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetDynamicVar): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutDynamicVar): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetClosureVar): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutClosureVar): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetInternalField): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutInternalField): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutAccessorByVal): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetRegExpObjectLastIndex): Deleted.
(JSC::DFG::SpeculativeJIT::compileSetRegExpObjectLastIndex): Deleted.
(JSC::DFG::SpeculativeJIT::compileRegExpExec): Deleted.
(JSC::DFG::SpeculativeJIT::compileRegExpTest): Deleted.
(JSC::DFG::SpeculativeJIT::compileStringReplace): Deleted.
(JSC::DFG::SpeculativeJIT::compileRegExpExecNonGlobalOrSticky): Deleted.
(JSC::DFG::SpeculativeJIT::compileRegExpMatchFastGlobal): Deleted.
(JSC::DFG::SpeculativeJIT::compileRegExpMatchFast): Deleted.
(JSC::DFG::SpeculativeJIT::compileLazyJSConstant): Deleted.
(JSC::DFG::SpeculativeJIT::compileMaterializeNewObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileRecordRegExpCachedResult): Deleted.
(JSC::DFG::SpeculativeJIT::compileDefineDataProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compileDefineAccessorProperty): Deleted.
(JSC::DFG::SpeculativeJIT::emitAllocateButterfly): Deleted.
(JSC::DFG::SpeculativeJIT::compileNormalizeMapKey): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetMapBucketHead): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetMapBucketNext): Deleted.
(JSC::DFG::SpeculativeJIT::compileLoadKeyFromMapBucket): Deleted.
(JSC::DFG::SpeculativeJIT::compileLoadValueFromMapBucket): Deleted.
(JSC::DFG::SpeculativeJIT::compileExtractValueFromWeakMapGet): Deleted.
(JSC::DFG::SpeculativeJIT::compileThrow): Deleted.
(JSC::DFG::SpeculativeJIT::compileThrowStaticError): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextUpdateIndexAndMode): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextExtractIndex): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextExtractMode): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextUpdatePropertyName): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorHasProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorInByVal): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorHasOwnProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutByIdFlush): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutById): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutByIdDirect): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutByIdWithThis): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetByOffset): Deleted.
(JSC::DFG::SpeculativeJIT::compilePutByOffset): Deleted.
(JSC::DFG::SpeculativeJIT::compileMatchStructure): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetPropertyEnumerator): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetExecutable): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetGetter): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetSetter): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetCallee): Deleted.
(JSC::DFG::SpeculativeJIT::compileSetCallee): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetArgumentCountIncludingThis): Deleted.
(JSC::DFG::SpeculativeJIT::compileSetArgumentCountIncludingThis): Deleted.
(JSC::DFG::SpeculativeJIT::compileStrCat): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewArrayBuffer): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSize): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewTypedArray): Deleted.
(JSC::DFG::SpeculativeJIT::compileToThis): Deleted.
(JSC::DFG::SpeculativeJIT::compileObjectKeysOrObjectGetOwnPropertyNames): Deleted.
(JSC::DFG::SpeculativeJIT::compileObjectAssign): Deleted.
(JSC::DFG::SpeculativeJIT::compileObjectCreate): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateThis): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreatePromise): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateInternalFieldObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateGenerator): Deleted.
(JSC::DFG::SpeculativeJIT::compileCreateAsyncGenerator): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewInternalFieldObjectImpl): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewGenerator): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewAsyncGenerator): Deleted.
(JSC::DFG::SpeculativeJIT::compileNewInternalFieldObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileToPrimitive): Deleted.
(JSC::DFG::SpeculativeJIT::compileToPropertyKey): Deleted.
(JSC::DFG::SpeculativeJIT::compileToNumeric): Deleted.
(JSC::DFG::SpeculativeJIT::compileCallNumberConstructor): Deleted.
(JSC::DFG::SpeculativeJIT::compileLogShadowChickenPrologue): Deleted.
(JSC::DFG::SpeculativeJIT::compileLogShadowChickenTail): Deleted.
(JSC::DFG::SpeculativeJIT::compileSetAdd): Deleted.
(JSC::DFG::SpeculativeJIT::compileMapSet): Deleted.
(JSC::DFG::SpeculativeJIT::compileWeakMapGet): Deleted.
(JSC::DFG::SpeculativeJIT::compileWeakSetAdd): Deleted.
(JSC::DFG::SpeculativeJIT::compileWeakMapSet): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetPrototypeOf): Deleted.
(JSC::DFG::SpeculativeJIT::compileIdentity): Deleted.
(JSC::DFG::SpeculativeJIT::compileMiscStrictEq): Deleted.
(JSC::DFG::SpeculativeJIT::emitInitializeButterfly): Deleted.
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): Deleted.
(JSC::DFG::SpeculativeJIT::compileHasIndexedProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compileExtractCatchLocal): Deleted.
(JSC::DFG::SpeculativeJIT::compileClearCatchLocals): Deleted.
(JSC::DFG::SpeculativeJIT::compileProfileType): Deleted.
(JSC::DFG::SpeculativeJIT::cachedPutById): Deleted.
(JSC::DFG::SpeculativeJIT::genericJSValueNonPeepholeCompare): Deleted.
(JSC::DFG::SpeculativeJIT::genericJSValuePeepholeBranch): Deleted.
(JSC::DFG::SpeculativeJIT::compileHeapBigIntEquality): Deleted.
(JSC::DFG::SpeculativeJIT::compileMakeRope): Deleted.
(JSC::DFG::SpeculativeJIT::compileEnumeratorGetByVal): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileContiguousPutByVal): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::branchIfEmpty):
(JSC::AssemblyHelpers::branchIfNotEmpty):


Canonical link: https://commits.webkit.org/244047@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
caitp pushed a commit that referenced this pull request Dec 14, 2022
…a rejected promise

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

Reviewed by Yusuke Suzuki.

Rest parameter should be caught in async function. So, running this
JavaScript program should print "caught".
```
async function f(...[[]]) { }
f().catch(e => print("caught"));
```

V8 (used console.log)
```
$ node input.js
caught
```

GraalJS
```
$ js input.js
caught
```

https://tc39.es/ecma262/#sec-async-function-definitions
...
AsyncFunctionDeclaration[Yield, Await, Default] :
    async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await] ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }
    [+Default] async [no LineTerminator here] function ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }

AsyncFunctionExpression :
    async [no LineTerminator here] function BindingIdentifier[~Yield, +Await]opt ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }
...

According to the spec, it indicates `FormalParameters` is used for Async
Function, where `FormalParameters` can be converted to `FunctionRestParameter`.

https://tc39.es/ecma262/#sec-parameter-lists
...
FormalParameters[Yield, Await] :
    [empty]
    FunctionRestParameter[?Yield, ?Await]
    FormalParameterList[?Yield, ?Await]
    FormalParameterList[?Yield, ?Await] ,
    FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
...

And based on RS: EvaluateAsyncFunctionBody, it will invoke the promise.reject
callback function with abrupt value ([[value]] of non-normal completion record).

https://tc39.es/ecma262/#sec-runtime-semantics-evaluateasyncfunctionbody
...
2. Let declResult be Completion(FunctionDeclarationInstantiation(functionObject, argumentsList)).
3. If declResult is an abrupt completion, then
    a. Perform ! Call(promiseCapability.[[Reject]], undefined, « declResult.[[Value]] »).
...

In that case, any non-normal results of evaluating rest parameters should be
caught and passed to the reject callback function.

To resolve this problem, we should allow the emitted RestParameterNode be wrapped
by the catch handler for promise. However, we should remove `m_restParameter` and
emit rest parameter byte code in `initializeDefaultParameterValuesAndSetupFunctionScopeStack`
if we can prove that change has no side effect. In that case, we can only use one
exception handler.

Current fix is to add another exception handler. And move the handler byte codes to
the bottom of code block in order to make other byte codes as much compact as possible.

Input:
```
async function f(arg0, ...[[]]) { }
f();
```

Dumped Byte Codes:
```
...

bb#2
Predecessors: [ #1 ]
[  20] mov                dst:loc9, src:<JSValue()>(const0)
...

bb#3
Predecessors: [ #2 ]
[  29] get_rest_length    dst:loc11, numParametersToSkip:1
...

bb#12
Predecessors: [ WebKit#8 WebKit#9 WebKit#10 ]
[ 138] new_func_exp       dst:loc10, scope:loc4, functionDecl:0
...

bb#13
Predecessors: [ ]
[ 170] catch              exception:loc10, thrownValue:loc8
[ 174] jmp                targetLabel:8(->182)
Successors: [ WebKit#15 ]

bb#14
Predecessors: [ WebKit#7 WebKit#11 ]
[ 176] catch              exception:loc10, thrownValue:loc8
[ 180] jmp                targetLabel:2(->182)
Successors: [ WebKit#15 ]

bb#15
Predecessors: [ WebKit#13 WebKit#14 ]
[ 182] mov                dst:loc12, src:Undefined(const1)
...

Exception Handlers:
	 1: { start: [  20] end: [  29] target: [ 170] } synthesized catch
	 2: { start: [  29] end: [ 138] target: [ 176] } synthesized catch
```

* JSTests/stress/catch-rest-parameter.js: Added.
(throwError):
(shouldThrow):
(async f):
(throwError.async f):
(throwError.async let):
(async let):
(x.async f):
(x):
(async shouldThrow):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:

Canonical link: https://commits.webkit.org/256864@main
caitp pushed a commit that referenced this pull request Jan 4, 2023
https://bugs.webkit.org/show_bug.cgi?id=249765
rdar://103631099

Reviewed by Mark Lam.

In ARM64, we are leveraging LDR style address, which can take 32bit index in addressing and zero-extend / sign-extend that in load/store.
This is useful since WasmAddress' index is 32bit and we need to zero-extend it. However, we cannot use this addressing when there is an
offset since this addressing cannot encode offset. As a result, we are emitting Move32 and Add64 when there is an offset.
However, ARM64 can do even better for that case since ARM64 add / sub instructions also support LDR style extension.

This patch adds AddZeroExtend64 and AddSignExtend64. They take 32bit second operand and extend it before adding. This is particularly useful
when computing WasmAddress. We also leverage this in AirIRGenerator.

In the added testb3, the generated code is changed as follows.

    Before:
        O2: testWasmAddressWithOffset()...
        Generated JIT code for Compilation:
            Code at [0x115f74980, 0x115f749a0):
                     <0> 0x115f74980:    pacibsp
                     <4> 0x115f74984:    stp      fp, lr, [sp, #-16]!
                     <8> 0x115f74988:    mov      fp, sp
                    <12> 0x115f7498c:    ubfx     x0, x0, #0, WebKit#32; emitSave
                    <16> 0x115f74990:    add      x0, x2, x0
                    <20> 0x115f74994:    sturb    w1, [x0, #1]
                    <24> 0x115f74998:    ldp      fp, lr, [sp], WebKit#16
                    <28> 0x115f7499c:    retab

    After:
        O2: testWasmAddressWithOffset()...
        Generated JIT code for Compilation:
            Code at [0x121108980, 0x1211089a0):
                     <0> 0x121108980:    pacibsp
                     <4> 0x121108984:    stp      fp, lr, [sp, #-16]!
                     <8> 0x121108988:    mov      fp, sp
                    <12> 0x12110898c:    add      x0, x2, w0, uxtw; emitSave
                    <16> 0x121108990:    sturb    w1, [x0, #1]
                    <20> 0x121108994:    ldp      fp, lr, [sp], WebKit#16
                    <24> 0x121108998:    retab

* Source/JavaScriptCore/assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::addZeroExtend64):
(JSC::MacroAssemblerARM64::addSignExtend64):
* Source/JavaScriptCore/b3/B3LowerToAir.cpp:
* Source/JavaScriptCore/b3/air/AirInstInlines.h:
(JSC::B3::Air::isAddZeroExtend64Valid):
(JSC::B3::Air::isAddSignExtend64Valid):
* Source/JavaScriptCore/b3/air/AirOpcode.opcodes:

Canonical link: https://commits.webkit.org/258259@main
caitp pushed a commit that referenced this pull request Feb 2, 2023
https://bugs.webkit.org/show_bug.cgi?id=250196
rdar://98798050

Reviewed by Simon Fraser and Dean Jackson.

WebKit has long accidentally depended on the combination of two somewhat
unusual behavioral quirks in CGIOSurfaceContext:

1) (Source) If you make a CGImageRef from one CGIOSurfaceContext via
CGIOSurfaceContextCreateImage, and mutate the original IOSurface under the hood
(or in a different process) in a way that CGIOSurfaceContext does not know,
CGIOSurfaceContextCreateImage will return the same CGImageRef when called later.

2) (Destination) If you make a CGImageRef from one CGIOSurfaceContext via
CGIOSurfaceContextCreateImage, paint it into a different CGIOSurfaceContext,
then mutate the original IOSurface, and paint the same CGImageRef again,
the updated IOSurface contents will be used the second time.

The second quirk has never worked with unaccelerated CoreGraphics bitmap context
destinations. Instead, in the unaccelerated case, the CGImageRef acts as a
snapshot of the surface at the time it was created.

We've long had code to handle this, forcing CGIOSurfaceContextCreateImage to
re-create the CGImageRef each time we paint it (by drawing an empty rect into
the CGIOSurfaceContext), working around quirk #1 and thus bypassing quirk #2,
if we're painting into an unaccelerated backing store.

It turns out our CG display list backing store implementation behaves like a
CG bitmap context (without quirk #2), and so currently any IOSurfaces painted into
CG display list backing store from a CGImageRef created by CGIOSurfaceContextCreateImage
(but not -CreateImageReference) become stale if painted multiple times.

To avoid this, extend the workaround to apply to any destination context that
claims that it needs the workaround, and use it whenever painting an IOSurface
into anything other than a CGIOSurfaceContext.

* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.cpp:
(WebCore::BifurcatedGraphicsContext::needsCachedNativeImageInvalidationWorkaround):
* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.h:
Make BifurcatedGraphicsContext assume the more conservative mode of its two children.

* Source/WebCore/platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::needsCachedNativeImageInvalidationWorkaround):
Assume that by default, GraphicsContexts need the workaround.

* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::needsCachedNativeImageInvalidationWorkaround):
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.h:
GraphicsContextCG needs the workaround, except in the IOSurface->IOSurface case.

* Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::finalizeDrawIntoContext):
Confer with the GraphicsContext about its need for the workaround
instead of hardcoding the behavior here.

* Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.mm:
CG display list graphics contexts need the workaround.

Canonical link: https://commits.webkit.org/258586@main
caitp pushed a commit that referenced this pull request Feb 2, 2023
https://bugs.webkit.org/show_bug.cgi?id=251063
rdar://104585575

Reviewed by Mark Lam and Justin Michaud.

This patch enhances CallFrame::dump to support wasm frames in btjs stacktrace.
The example is as follows.

    frame #0: 0x00000001035fca78 JavaScriptCore`JSC::functionBreakpoint(globalObject=0x000000012f410068, callFrame=0x000000016fdfa9d0) at JSDollarVM.cpp:2273:9 [opt]
    frame #1: 0x000000010ec44204 0x10eccc5dc
    frame #2: 0x000000010eccc5dc callback#Dwaxn6 [Baseline bc#50](Undefined)
    frame WebKit#3: 0x000000010ec4ca84 wasm-stub [WasmToJS](Wasm::Instance: 0x10d29da40)
    frame WebKit#4: 0x000000010ed0c060 <?>.wasm-function[1] [OMG](Wasm::Instance: 0x10d29da40)
    frame WebKit#5: 0x000000010ed100d0 jsToWasm#CWTx6k [FTL bc#22](Cell[JSModuleEnvironment]: 0x12f524540, Cell[WebAssemblyFunction]: 0x10d06a3a8, 1, 2, 3)
    frame WebKit#6: 0x000000010ec881b0 #D5ymZE [Baseline bc#733](Undefined, Cell[Generator]: 0x12f55c180, 1, Cell[Object]: 0x12f69dfc0, 0, Cell[JSLexicalEnvironment]: 0x12f52cee0)
    frame WebKit#7: 0x000000010ec3c008 asyncFunctionResume#A4ayYg [LLInt bc#49](Undefined, Cell[Generator]: 0x12f55c180, Cell[Object]: 0x12f69dfc0, 0)
    frame WebKit#8: 0x000000010ec3c008 promiseReactionJobWithoutPromise#D0yDF1 [LLInt bc#25](Undefined, Cell[Function]: 0x12f44f3c0, Cell[Object]: 0x12f69dfc0, Cell[Generator]: 0x12f55c180)
    frame WebKit#9: 0x000000010ec80ec0 promiseReactionJob#EdShZz [Baseline bc#74](Undefined, Undefined, Cell[Function]: 0x12f44f3c0, Cell[Object]: 0x12f69dfc0, Cell[Generator]: 0x12f55c180)
    frame WebKit#10: 0x000000010ec3c728
    frame WebKit#11: 0x0000000103137560 JavaScriptCore`JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) [inlined] JSC::JITCode::execute(this=<unavailable>, vm=<unavailable>, protoCallFrame=<unavailable>) at JITCodeInlines.h:42:38 [opt]
    frame WebKit#12: 0x0000000103137524 JavaScriptCore`JSC::Interpreter::executeCall(this=<unavailable>, lexicalGlobalObject=<unavailable>, function=<unavailable>, callData=<unavailable>, thisValue=<unavailable>, args=<unavailable>) at Interpreter.cpp:1093:27 [opt]
    frame WebKit#13: 0x000000010349d6d0 JavaScriptCore`JSC::runJSMicrotask(globalObject=0x000000012f410068, identifier=(m_identifier = 81), job=JSValue @ x22, argument0=JSValue @ x26, argument1=JSValue @ x25, argument2=<unavailable>, argument3=<unavailable>) at JSMicrotask.cpp:98:9 [opt]
    frame WebKit#14: 0x00000001039dfc54 JavaScriptCore`JSC::VM::drainMicrotasks() (.cold.1) at VM.cpp:0:9 [opt]
    frame WebKit#15: 0x00000001035e58a4 JavaScriptCore`JSC::VM::drainMicrotasks() [inlined] JSC::MicrotaskQueue::dequeue(this=<unavailable>) at VM.cpp:0:9 [opt]
    frame WebKit#16: 0x00000001035e5894 JavaScriptCore`JSC::VM::drainMicrotasks(this=0x000000012f000000) at VM.cpp:1255:46 [opt]
    ...

* Source/JavaScriptCore/interpreter/CallFrame.cpp:
(JSC::CallFrame::dump const):

Canonical link: https://commits.webkit.org/259262@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.