Skip to content

Upgrade WebKit, July 23rd edition - #14

Merged
Jarred-Sumner merged 1937 commits into
mainfrom
jarred/upgrade-jul23
Jul 24, 2023
Merged

Jarred-Sumner merged 1937 commits into
mainfrom
jarred/upgrade-jul23

Conversation

@Jarred-Sumner

Copy link
Copy Markdown
Collaborator

No description provided.

kshukuwa and others added 30 commits July 12, 2023 00:21
https://bugs.webkit.org/show_bug.cgi?id=259137

Reviewed by Fujii Hironori.

Two options are used to set post field size in CurlContext.cpp:
CURLOPT_POSTFIELDSIZE and CURLOPT_POSTFIELDSIZE_LARGE.
Unify these options to CURLOPT_POSTFIELDSIZE_LARGE for better readability.
Also, CURLOPT_INFILESIZE is unified to CURLOPT_INFILESIZE_LARGE.

* Source/WebCore/platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableHttpPostRequest):
(WebCore::CurlHandle::setPostFieldSize):
(WebCore::CurlHandle::enableHttpPutRequest):
(WebCore::CurlHandle::setInFileSize):
(WebCore::CurlHandle::setPostFieldLarge): Deleted.
(WebCore::CurlHandle::setInFileSizeLarge): Deleted.
* Source/WebCore/platform/network/curl/CurlContext.h:
* Source/WebCore/platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupSendData):

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

Reviewed by Fujii Hironori.

CredentialStorage::getFromPersistentStorage is not used in WebKit2.
So curl and soup port don't need the function. Therefore, to reduce
maintenance costs, remove CredentialStorage[Curl|Soup].cpp.

* Source/WebCore/platform/Curl.cmake:
* Source/WebCore/platform/SourcesSoup.txt:
* Source/WebCore/platform/network/CredentialStorage.h:
* Source/WebCore/platform/network/curl/CredentialStorageCurl.cpp: Removed.
* Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp: Removed.

Canonical link: https://commits.webkit.org/265988@main
https://bugs.webkit.org/show_bug.cgi?id=259027
rdar://108566229

Reviewed by Alan Baradlay.

To let the shadow DOM CSS correctly align and cut too-long labels, the elements need to have a `dir="auto"`
attribute, and titles with RTL filenames should add an outer right-to-left mark so that the automatic
direction works as expected.

* Source/WebCore/html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::ensureWideLayoutShadowTree):
(WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):

Canonical link: https://commits.webkit.org/265989@main
… property usage

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

Reviewed by Simon Fraser.

This patch changes the code that retrieves the ScrollbarCorner pseudo styles to check that there's no standard
property usage.

* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-006-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-006-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-006.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-007-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-007-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-007.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-008-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-008-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-008.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-009-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-009-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-009.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-010-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-010-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-scrollbars/scrollbar-color-010.html: Added.
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::updateScrollCorner):
* Source/WebCore/rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::updateScrollCornerStyle):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::usesStandardScrollbarStyle const):
(WebCore::RenderStyle::usesLegacyScrollbarStyle const):

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

Reviewed by Ryan Haddad and Carlos Alberto Lopez Perez.

Follow-up to 264145@main.

Add bots to the list of schedulers, so they can start taking incoming
jobs.

* Tools/CISupport/build-webkit-org/config.json:

Canonical link: https://commits.webkit.org/265991@main
…ect children

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

Reviewed by Chris Fleizach.

Prevent nullptr crashes by checking that each child from
AXCoreObject::children() is not null in AXCoreObject::enumerateDescendants.

In a future patch, we should make `AccessibilityChildrenVector` be a Vector of `Ref`s
rather than a Vector of `RefPtr`s as it is today. RefPtr does not make sense for this
type -- either we have a child or we don't.

* Source/WebCore/accessibility/AccessibilityObjectInterface.h:
(WebCore::Accessibility::enumerateDescendants):

Canonical link: https://commits.webkit.org/265992@main
…video-renders.html is constant ImageOnlyfailure

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

Unreviewed test gardening.

* LayoutTests/platform/mac/TestExpectations:

Canonical link: https://commits.webkit.org/265993@main
https://bugs.webkit.org/show_bug.cgi?id=258865
rdar://111764330

Unreviewed test gardening.

Adding test expectations.

* LayoutTests/platform/ios-wk2/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/265994@main
Clean tests passing, flaky tests passing, update baselines and adjust
test expectations.

* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/glib/css2.1/t1508-c527-font-09-b-expected.png: Added.
* LayoutTests/platform/glib/css2.1/t1508-c527-font-09-b-expected.txt: Renamed from LayoutTests/platform/gtk/css2.1/t1508-c527-font-09-b-expected.txt.
* LayoutTests/platform/glib/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt: Renamed from LayoutTests/platform/gtk/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-ruby/line-spacing-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-values/urls/resolve-relative-to-base.sub-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/other/editable-state-and-focus-in-shadow-dom-in-designMode.tentative-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/disabled-elements/event-propagate-disabled-keyboard.tentative-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/disabled-elements/event-propagate-disabled.tentative-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-transition.tentative-expected.txt: Renamed from LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/popovers/popover-anchor-transition.tentative-expected.txt.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/presentation-markup/mrow/stretch-along-block-axis-001-expected.txt: Renamed from LayoutTests/platform/gtk/imported/w3c/web-platform-tests/mathml/presentation-markup/mrow/stretch-along-block-axis-001-expected.txt.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/preload/onerror-event-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/preload/preload-font-crossorigin-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/preload/preload-time-to-fetch.https-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/preload/preload-type-match-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt: Added.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any.worker_av1-expected.txt:
* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/gtk/css2.1/t1508-c527-font-09-b-expected.png: Removed.
* LayoutTests/platform/wpe/TestExpectations:
* LayoutTests/platform/wpe/fast/events/updateLayoutForHitTest-expected.txt:
* LayoutTests/platform/wpe/fast/lists/drag-into-marker-expected.png: Added.
* LayoutTests/platform/wpe/fast/lists/drag-into-marker-expected.txt:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-ui/user-select-001-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/editing/other/exec-command-with-text-editor.tentative-expected.txt: Added.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/editing/other/exec-command-without-editable-element.tentative-expected.txt: Added.
* LayoutTests/platform/wpe/svg/text/selection-doubleclick-expected.png: Added.
* LayoutTests/platform/wpe/svg/text/selection-doubleclick-expected.txt:
* LayoutTests/platform/wpe/svg/text/selection-tripleclick-expected.png: Added.
* LayoutTests/platform/wpe/svg/text/selection-tripleclick-expected.txt:

Canonical link: https://commits.webkit.org/265995@main
…svg/import/animate-elem-35-t-manual.svg is failing

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

Unreviewed test gardening.

Rebaseline for macOS Monterey.

* LayoutTests/platform/mac-monterey/imported/w3c/web-platform-tests/svg/import/animate-elem-35-t-manual-expected.txt: Added.

Canonical link: https://commits.webkit.org/265996@main
https://bugs.webkit.org/show_bug.cgi?id=257092
rdar://109613703

Reviewed by Tim Nguyen.

We allow the empty string to be used as a font-family name per spec.
This also fixes a bug with non-ident family name (such as "foo bar").

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-non-ident-font-family-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-non-ident-font-family-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-palette-non-ident-font-family.html: Added.
* Source/WebCore/css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::addToFacesLookupTable):
(WebCore::CSSFontFaceSet::removeFromFacesLookupTable):
(WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
* Source/WebCore/css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontPaletteValuesRule):
(WebCore::CSSFontSelector::lookupFontPaletteValues):
(WebCore::CSSFontSelector::fontRangesForFamily):
* Source/WebCore/css/FontFace.cpp:
(WebCore::FontFace::setFamily):
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeFontPaletteValuesRule):
* Source/WebCore/platform/graphics/FontCascadeFonts.cpp:
(WebCore::realizeNextFallback):
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueFontFamily):

Canonical link: https://commits.webkit.org/265997@main
…entries map

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

Reviewed by Antti Koivisto.

Guard MatchedDeclarationsCache against destruction while modifying m_entries map.
We suspect that MatchedDeclarationsCache is getting destroyed while modifying
m_entries inside sweep().

* Source/WebCore/style/MatchedDeclarationsCache.cpp:
(WebCore::Style::MatchedDeclarationsCache::MatchedDeclarationsCache):
(WebCore::Style::MatchedDeclarationsCache::ref):
(WebCore::Style::MatchedDeclarationsCache::deref):
(WebCore::Style::MatchedDeclarationsCache::clearEntriesAffectedByViewportUnits):
(WebCore::Style::MatchedDeclarationsCache::sweep):
* Source/WebCore/style/MatchedDeclarationsCache.h:
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::Resolver):
* Source/WebCore/style/StyleResolver.h:

Canonical link: https://commits.webkit.org/265998@main
https://bugs.webkit.org/show_bug.cgi?id=259145
rdar://112135896

Reviewed by Myles C. Maxfield.

A valid tech() keyword argument should be parsed even if the represented
techonology is not supported by the engine. The engine should reject loading
the font for unsupported techonologies but this should happen only at
loading time and not at parsing time.

The reason why we were rejecting it before at parsing time it is for some
inconsistency in different parts of the spec which suggested that. That
will be fixed soon by the CWWG, see: w3c/csswg-drafts#8793

* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-face-src-tech-expected.txt:
* Source/WebCore/css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcResourceValue::fontLoadRequest):
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeFontTech):
* Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.cpp:
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontFaceSrcURI):
* Source/WebCore/css/parser/CSSSupportsParser.cpp:
(WebCore::CSSSupportsParser::consumeSupportsFontTechFunction):

Canonical link: https://commits.webkit.org/265999@main
…default value instead of clamping

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

Reviewed by Cameron McCormack.

On pre-2023-aligned Apple OSes, Core Text's behavior for optical sizing is that
out of bounds values are ignored, and default optical sizing is used instead of
clamping the specified value. We can work around this by clamping the value
ourself in WebKit, but this is somewhat unfortunate because we only know the
acceptable range after creating a CTFont, but we'd like to specify the values
during CTFont creation time.

This patch solves the problem by doing a 2-phase creation: Create a CTFont,
inspect it, determine if it needs a second phase, and if it does, modify the
CTFont to create a second, derived, CTFont. We already have some support for
this due to the TrueType GX weight/width/slope scales being different than
the CSS scales - but we don't know if a font is a TrueType GX font until we've
created the CTFont object. This patch extends that existing 2-phase creation to
also recreate the font if the optical sizing ended up wrong.

* LayoutTests/fast/text/variations/optical-sizing-out-of-bounds-expected.html: Added.
* LayoutTests/fast/text/variations/optical-sizing-out-of-bounds.html: Added.
* Source/WTF/wtf/PlatformUse.h:
* Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.cpp:
(WebCore::OpticalSizeRange::isInRange const):
(WebCore::opticalSizeRange):
(WebCore::UnrealizedCoreTextFont::rebuildReason const):
(WebCore::UnrealizedCoreTextFont::realize const):
* Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.h:
(WebCore::UnrealizedCoreTextFont::RebuildReason::hasEffect const):

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

Reviewed by Ross Kirsling.

clang-cl reported the following warnings:

> platform\graphics\win\ComplexTextControllerUniscribe.cpp(141,9): warning: unused variable 'i' [-Wunused-variable]
> platform\graphics\egl\GLContext.cpp(228,29): warning: enumeration value 'Windows' not handled in switch [-Wswitch]
> platform\graphics\egl\GLContext.cpp(359,33): warning: enumeration value 'Windows' not handled in switch [-Wswitch]
> platform\graphics\egl\GLContext.cpp(406,33): warning: enumeration value 'Windows' not handled in switch [-Wswitch]
> platform\win\KeyEventWin.cpp(238,7): warning: field 'm_windowsVirtualKeyCode' will be initialized after field 'm_autoRepeat' [-Wreorder-ctor]
> platform\win\PlatformMouseEventWin.cpp(86,7): warning: field 'm_buttons' will be initialized after field 'm_clickCount' [-Wreorder-ctor]
> platform\win\WheelEventWin.cpp(78,7): warning: field 'm_globalPosition' will be initialized after field 'm_directionInvertedFromDevice' [-Wreorder-ctor]
> platform\graphics\win\MediaPlayerPrivateMediaFoundation.cpp(84,13): warning: delete called on non-final 'WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
> platform\graphics\win\MediaPlayerPrivateMediaFoundation.cpp(2834,26): warning: unused variable 'image' [-Wunused-variable]
> Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp(154,31): warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
> dom/FullscreenManager.cpp(299,65): warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
> rendering\RenderTable.h(66,23): warning: inline function 'WebCore::RenderTable::borderTop' is not defined [-Wundefined-inline]
> rendering\RenderTable.h(67,23): warning: inline function 'WebCore::RenderTable::borderBottom' is not defined [-Wundefined-inline]

* Source/WebCore/Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::collectDataForWriting):
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::cancelFullscreen):
* Source/WebCore/platform/graphics/egl/GLContext.cpp:
(WebCore::GLContext::createWindowContext):
(WebCore::GLContext::createOffscreen):
(WebCore::GLContext::createSharing):
* Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp:
(WebCore::stringIndicesFromClusters):
* Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
* Source/WebCore/platform/win/KeyEventWin.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* Source/WebCore/platform/win/PlatformMouseEventWin.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* Source/WebCore/platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* Source/WebCore/rendering/mathml/RenderMathMLBlockInlines.h:

Canonical link: https://commits.webkit.org/266001@main
https://bugs.webkit.org/show_bug.cgi?id=259152
rdar://111806659

Reviewed by Chris Dumez and David Kilzer.

CFNetwork has an internal NSError subclass.  Since we stopped automatically
allowing deserialization of ObjC subclasses, all subclasses must be explicitly
allowed.

* Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(alwaysAllowedClasses):

Canonical link: https://commits.webkit.org/266002@main
…tests/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed.html is a flaky ImageOnlyFailure

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

Unreviewed test gardneing.

* LayoutTests/platform/ios/TestExpectations:

Canonical link: https://commits.webkit.org/266003@main
…blur-input-type-change-crash.html is a consistent failure

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

Unreviewed test gardening.

Re-baseline.

* LayoutTests/platform/ios-wk2/fast/dom/focus-dialog-blur-input-type-change-crash-expected.txt: Added.

Canonical link: https://commits.webkit.org/266004@main
…ttribution-source-through-fetch-keepalive.html is a flaky text failure

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

Unreviewed test gardening.

* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/266005@main
… API

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

Reviewed by Chris Dumez.

If querying for the cookie fails, the promise should be rejected with a TypeError.

* Source/WebCore/Modules/cookie-store/CookieStore.cpp:
(WebCore::CookieStore::get):
* Source/WebCore/loader/CookieJar.cpp:
(WebCore::CookieJar::getCookiesAsync const):
* Source/WebCore/loader/CookieJar.h:
* Source/WebCore/platform/network/NetworkStorageSession.h:
* Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookiesForSessionAsVector const):
(WebCore::NetworkStorageSession::cookiesForDOMAsVector const):
* Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::cookiesForDOMAsVector const):
* Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::cookiesForDOMAsVector const):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOMAsync):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h:
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::getCookiesAsync const):
* Source/WebKit/WebProcess/WebPage/WebCookieJar.h:

Canonical link: https://commits.webkit.org/266006@main
…css/css-color/parsing (layout-tests) are constant text failures

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

Unreviewed test gardening.

* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function-expected.txt:
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function-expected.txt.
* LayoutTests/platform/mac-monterey/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-relative-color-expected.txt: Added.
* LayoutTests/platform/mac-monterey/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-relative-color-expected.txt: Added.

Canonical link: https://commits.webkit.org/266007@main
https://bugs.webkit.org/show_bug.cgi?id=259164
rdar://problem/112158177

Unreviewed build fix.

* Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.cpp:
(WebCore::UnrealizedCoreTextFont::realize const):

Canonical link: https://commits.webkit.org/266008@main
…FuncExec

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

Reviewed by Yusuke Suzuki.

Fixed the saving and restoring of duplicate groups IDs for nested / counted Parens in the YARR
interpreter.  We only save the number of duplicate groups needed for the current parenthesis.
We were using the duplicate groups ID, which may exceed the number of duplicate IDs we need to
save.  Changed the code to save these ID using a counted index instead of their actual value.
Added an ASSERT in backupOffsetForDuplicateNamedGroup() where we calculate the offset in the
saved context buffer.

Added a new regression test case.

* JSTests/stress/regexp-duplicate-named-captures.js:
* Source/JavaScriptCore/yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::backupOffsetForDuplicateNamedGroup):

Canonical link: https://commits.webkit.org/266009@main
https://bugs.webkit.org/show_bug.cgi?id=259151
rdar://112145626

Reviewed by Mark Lam.

1. Use stp to update FreeList's data.
2. Avoid unnecessary instructions (null clear) for most of cases by passing SlowAllocationResult enum.

* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::emitAllocateJSCell):
(JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
(JSC::DFG::SpeculativeJIT::emitAllocateJSObjectWithKnownSize):
(JSC::DFG::SpeculativeJIT::emitAllocateVariableSizedJSObject):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileNewBoundFunction):
(JSC::DFG::SpeculativeJIT::compileCreateClonedArguments):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* Source/JavaScriptCore/jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitAllocateWithNonNullAllocator):
(JSC::AssemblyHelpers::emitAllocate):
(JSC::AssemblyHelpers::emitAllocateVariableSized):
* Source/JavaScriptCore/jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateJSCell):
(JSC::AssemblyHelpers::emitAllocateJSObject):
(JSC::AssemblyHelpers::emitAllocateJSObjectWithKnownSize):
(JSC::AssemblyHelpers::emitAllocateVariableSizedCell):
(JSC::AssemblyHelpers::emitAllocateVariableSizedJSObject):
* Source/JavaScriptCore/jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_new_object):
(JSC::JIT::emit_op_create_this):

Canonical link: https://commits.webkit.org/266010@main
https://bugs.webkit.org/show_bug.cgi?id=259163
rdar://111926368

Reviewed by Brent Fulgham.

Crash logs indicate m_store can be null and it crashes when it is.
In NetworkStateNotifier::startObserving we early return if it's null.
This adds another early return.

* Source/WebCore/platform/network/mac/NetworkStateNotifierMac.cpp:
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):

Canonical link: https://commits.webkit.org/266011@main
https://bugs.webkit.org/show_bug.cgi?id=259162
rdar://112157898

Reviewed by Chris Dumez.

* Source/WebKit/NetworkProcess/BackgroundFetchLoad.h:
* Source/WebKit/NetworkProcess/Downloads/PendingDownload.h:
* Source/WebKit/NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::setPendingDownload):
(WebKit::NetworkDataTask::pendingDownload const):
* Source/WebKit/NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::client const):
(WebKit::NetworkDataTask::pendingDownload const): Deleted.
(WebKit::NetworkDataTask::setPendingDownload): Deleted.
* Source/WebKit/NetworkProcess/PingLoad.h:

Canonical link: https://commits.webkit.org/266012@main
https://bugs.webkit.org/show_bug.cgi?id=259130
rdar://112108719

Reviewed by Tim Horton.

Since 253366@main all plugins are effectively blocked.
This just removes some unused infrastructure to update a list of blocked plugins.

* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/mac/BlocklistUpdater.h: Removed.
* Source/WebCore/platform/mac/BlocklistUpdater.mm: Removed.
* Source/WebCore/platform/mac/PluginBlocklist.h: Removed.
* Source/WebCore/platform/mac/PluginBlocklist.mm: Removed.
* Source/WebKit/UIProcess/API/C/mac/WKContextPrivateMac.mm:
* Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm:
(shouldBlockPlugin):

Canonical link: https://commits.webkit.org/266013@main
…ltiple flaky ImageOnlyFailures

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

Unreviewed test gardening.

* LayoutTests/platform/ios/TestExpectations:

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

Reviewed by Yusuke Suzuki.

This allows for developers to `resolve`/`reject` a `Promise` after it's been created instead of having to provide a function to `new Promise`.

For example, the following
```
function foo(target) {
    return new Promise((resolve, reject) => {
        target.addEventListener("good", resolve);
        target.addEventListener("bad", reject);
    });
}
```
can now be rewritten as
```
function foo(target, event) {
    let {promise, resolve, reject} = Promise.withResolvers();

    target.addEventListener("good", resolve);
    target.addEventListener("bad", reject);

    return promise;
}
```

Spec: https://tc39.es/proposal-promise-with-resolvers/
Proposal: https://github.com/tc39/proposal-promise-with-resolvers

* Source/JavaScriptCore/builtins/PromiseConstructor.js:
(withResolvers): Added.
* Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp:
(JSC::JSPromiseConstructor::finishCreation):

* Source/JavaScriptCore/runtime/OptionsList.h:
Add an off-by-default feature flag for this.

* JSTests/stress/promise-withResolvers.js: Added.

Canonical link: https://commits.webkit.org/266015@main
https://bugs.webkit.org/show_bug.cgi?id=258789
rdar://111993365

Reviewed by David Kilzer.

Right now several users of `base64Decode` take the `Vector` returned and immediately convert it to a `String`. This
conversion requires a copy as the `Vector` returned by `base64Decode` uses `VectorBufferMalloc` but `String` requires
that the Vector backing store is malloced with `StringImplMalloc`. This patch simply adds a `base64DecodeToString` that
calls `base64DecodeInternal` with a new template parameter telling `base64DecodeInternal` to use `StringImplMalloc`. Thus,
avoiding the extra string copy.

* Source/JavaScriptCore/jsc.cpp:
(JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/wtf/text/Base64.cpp:
(WTF::base64DecodeInternal):
(WTF::base64DecodeToString):
* Source/WTF/wtf/text/Base64.h:
* Source/WTF/wtf/text/WTFString.h:
* Source/WebCore/page/Base64Utilities.cpp:
(WebCore::Base64Utilities::atob):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):

Canonical link: https://commits.webkit.org/266016@main
sammygill and others added 28 commits July 21, 2023 11:13
https://bugs.webkit.org/show_bug.cgi?id=259399
rdar://112669430

Reviewed by Tim Nguyen.

* metadata/contributors.json:

Canonical link: https://commits.webkit.org/266209@main
… very jumpy

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

Reviewed by Simon Fraser.

When receiving a wheel event from dispatchEvent, the current design recieves this event
in the web process, and sends this request to the UI-process as a RequestedScrollData
object. This object contained a scrollPosition to animate to, but this was calculated
using the scroll position in the web process. Since this scroll position could be out
of sync with the UI-process while the user was scrolling, this could result in a scroll
to a scroll position behind the current scroll position, leading to a jumpy looking scroll.
To fix this, rather than sending across the scroll position to scroll to, simply send across
the requested scroll delta to the UI-process, and use the UI-process scroll position to
calculate the correct scroll position to animate to. Also, propagate down the original
scroll delta (if it exists), to be used in AsyncScrollingCoordinator::requestScrollToPosition,
so that we know whether to do a delta or scroll position update.

* Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollToPosition):
* Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm:
(WebKit::RemoteScrollingTreeMac::startPendingScrollAnimations):

Canonical link: https://commits.webkit.org/266210@main
…o-flipY-false.html is a constant TEXT failure

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

Unreviewed test gardening.

* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/266211@main
https://bugs.webkit.org/show_bug.cgi?id=259392
rdar://problem/112657426

Reviewed by Andres Gonzalez.

This patch fixes 15 tests for ITM. The bulk of these are scrolling tests, which needed to be made async. There was also
a bug in AccessibilityUIElement::scrollToGlobalPoint and AccessibilityUIElement::scrollToMakeVisibleWithSubFocus where
they passed the memory address of a stack variable from the main-thread to the secondary thread. I would’ve expected
this to have caused a crash, but instead it seems to just do the wrong thing and default-initialize the value. So if
we tried to scroll to NSPoint(0, 300), we were always scrolling to NSPoint(0, 0).

This patch addresses this by copying the necessary values into the lambda, rather than taking them by reference.

Several other non-scrolling AX tests are also made async, allowing them to pass with no other code changes.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
* LayoutTests/accessibility/mac/aria-tree.html:
* LayoutTests/accessibility/mac/crash-invalid-text-marker-node-expected.txt:
* LayoutTests/accessibility/mac/crash-invalid-text-marker-node.html:
* LayoutTests/accessibility/mac/test-convenience-methods-expected.txt:
* LayoutTests/accessibility/mac/test-convenience-methods.html:
* LayoutTests/accessibility/scroll-to-global-point-iframe-expected.txt:
* LayoutTests/accessibility/scroll-to-global-point-iframe-nested-expected.txt:
* LayoutTests/accessibility/scroll-to-global-point-iframe-nested.html:
* LayoutTests/accessibility/scroll-to-global-point-iframe.html:
* LayoutTests/accessibility/scroll-to-global-point-main-window-expected.txt:
* LayoutTests/accessibility/scroll-to-global-point-main-window.html:
* LayoutTests/accessibility/scroll-to-global-point-nested-expected.txt:
* LayoutTests/accessibility/scroll-to-global-point-nested.html:
* LayoutTests/accessibility/scroll-to-make-visible-div-overflow-expected.txt:
* LayoutTests/accessibility/scroll-to-make-visible-div-overflow.html:
* LayoutTests/accessibility/scroll-to-make-visible-iframe-expected.txt:
* LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen-expected.txt:
* LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen.html:
* LayoutTests/accessibility/scroll-to-make-visible-iframe.html:
* LayoutTests/accessibility/scroll-to-make-visible-nested-2-expected.txt:
* LayoutTests/accessibility/scroll-to-make-visible-nested-2.html:
* LayoutTests/accessibility/scroll-to-make-visible-nested-expected.txt:
* LayoutTests/accessibility/scroll-to-make-visible-nested.html:
* LayoutTests/accessibility/scroll-to-make-visible-with-subfocus-expected.txt:
* LayoutTests/accessibility/scroll-to-make-visible-with-subfocus.html:
* LayoutTests/accessibility/textarea-insertion-point-line-number-expected.txt:
* LayoutTests/accessibility/textarea-insertion-point-line-number.html:
* Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::scrollToGlobalPoint):
(WTR::AccessibilityUIElement::scrollToMakeVisibleWithSubFocus):

Canonical link: https://commits.webkit.org/266212@main
https://bugs.webkit.org/show_bug.cgi?id=259346
rdar://problem/112555093

Reviewed by Chris Fleizach.

We can express AXPropertyName::TableLevel purely in the form of existing
AXCoreObject functions, so there is no need to cache it separately. This
improves up-front object creation speed, reduces memory consumption, and
improves correctness, as a property that is not cached cannot become
out-of-date.

* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::tableLevel const):
* Source/WebCore/accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableLevel const): Deleted.
* Source/WebCore/accessibility/AccessibilityTable.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:

Canonical link: https://commits.webkit.org/266213@main
https://bugs.webkit.org/show_bug.cgi?id=259378
rdar://112627148

Reviewed by Yusuke Suzuki.

Add functionality for call and remaining numeric comparison and arithmetic opcodes.

* JSTests/wasm/ipint-tests/ipint-setup-stress-lol.js: Added.
* JSTests/wasm/ipint-tests/ipint-stress-lol.js: Added.
(import.as.assert.from.string_appeared_here.async test):
* JSTests/wasm/ipint-tests/ipint-stress-lol.wasm: Added.
* JSTests/wasm/ipint-tests/ipint-test-call-arg.js:
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.inc.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.1.i32.add.return.func.export.string_appeared_here.param.i32.result.i32.i32.const.1094795585.local.0.call.inc.call.inc.return.async test):
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.inc.export.string_appeared_here.param.i32.result.i32.local.0.i32.const.1.i32.add.return.func.export.string_appeared_here.param.i32.result.i32.local.0.call.inc.call.inc.return.async test): Deleted.
* JSTests/wasm/ipint-tests/ipint-test-call-fparg.js: Copied from JSTests/wasm/ipint-tests/ipint-test-call-arg.js.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.inc.export.string_appeared_here.param.f32.result.f32.local.0.f32.const.1.f32.add.return.func.export.string_appeared_here.param.f32.result.f32.local.0.call.inc.call.inc.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-f32-comparisons.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.f32.f32.result.i32.local.0.local.1.f32.eq.return.func.export.string_appeared_here.param.f32.f32.result.i32.local.0.local.1.f32.ne.return.func.export.string_appeared_here.param.f32.f32.result.i32.local.0.local.1.f32.lt.return.func.export.string_appeared_here.param.f32.f32.result.i32.local.0.local.1.f32.gt.return.func.export.string_appeared_here.param.f32.f32.result.i32.local.0.local.1.f32.le.return.func.export.string_appeared_here.param.f32.f32.result.i32.local.0.local.1.f32.ge.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-f32-ops.js:
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.f32.result.f32.local.0.f32.abs.return.func.export.string_appeared_here.param.f32.result.f32.local.0.f32.neg.return.func.export.string_appeared_here.param.f32.result.f32.local.0.f32.ceil.return.func.export.string_appeared_here.param.f32.result.f32.local.0.f32.floor.return.func.export.string_appeared_here.param.f32.result.f32.local.0.f32.trunc.return.func.export.string_appeared_here.param.f32.result.f32.local.0.f32.nearest.return.func.export.string_appeared_here.param.f32.result.f32.local.0.f32.sqrt.return.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.add.return.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.sub.return.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.mul.return.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.div.return.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.min.return.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.max.return.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.copysign.return.close):
(y.async test):
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.f32.f32.result.f32.local.0.local.1.f32.add.return.async test): Deleted.
* JSTests/wasm/ipint-tests/ipint-test-f64-comparisons.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.f64.f64.result.i32.local.0.local.1.f64.eq.return.func.export.string_appeared_here.param.f64.f64.result.i32.local.0.local.1.f64.ne.return.func.export.string_appeared_here.param.f64.f64.result.i32.local.0.local.1.f64.lt.return.func.export.string_appeared_here.param.f64.f64.result.i32.local.0.local.1.f64.gt.return.func.export.string_appeared_here.param.f64.f64.result.i32.local.0.local.1.f64.le.return.func.export.string_appeared_here.param.f64.f64.result.i32.local.0.local.1.f64.ge.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-i64-comparisons.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.param.i64.result.i32.local.0.i64.eqz.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.eq.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.ne.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.lt_s.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.lt_u.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.gt_s.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.gt_u.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.le_s.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.le_u.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.ge_s.return.func.export.string_appeared_here.param.i64.i64.result.i32.local.0.local.1.i64.ge_u.return.async test):
* JSTests/wasm/ipint-tests/ipint-test-recursion.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.recur.export.string_appeared_here.param.i32.result.i32.local.0.i32.eqz.result.i32.then.local.0.else.local.0.i32.const.1.i32.sub.call.recur.local.0.i32.add.return.async test):
* JSTests/wasm/ipint-tests/perf.py:
(progressBar):
* Source/JavaScriptCore/llint/InPlaceInterpreter.asm:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::IPIntCallee::IPIntCallee):
* Source/JavaScriptCore/wasm/WasmCallee.h:
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp:
(JSC::Wasm::FunctionIPIntMetadataGenerator::addLEB128ConstantInt32AndLength):
(JSC::Wasm::FunctionIPIntMetadataGenerator::addLEB128ConstantInt32): Deleted.
(JSC::Wasm::FunctionIPIntMetadataGenerator::addLEB128ConstantInt32AndLengthOfOtherInt32): Deleted.
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h:
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp:
(JSC::Wasm::IPIntGenerator::getLocal):
(JSC::Wasm::IPIntGenerator::setLocal):
(JSC::Wasm::IPIntGenerator::addCall):
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::doWasmIPIntCall):

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

Reviewed by Alexey Proskuryakov.

Now that we use sparse SDKs for building macOS 14, we can do the same on
other platforms. Move TBDs into the SDKs, at the same paths they exist
in internal SDKs.

* Configurations/SDKAdditions.xcconfig: Fix
  WK_HAS_UNVERSIONED_SDK_ADDITIONS to be YES in open source builds and
  in downlevel macOS builds.

* Configurations/WebKitProjectPaths.xcconfig:
  - Remove definition of WK_PRIVATE_FRAMEWORK_STUBS_DIR.
  - Add additional WK_WORKSPACE_DIR levels for dav1d (nested in libavif,
    which is nested in PAL, which is nested in WebCore!).

In project xcconfigs, remove use of WK_PRIVATE_FRAMEWORK_STUBS_DIR and
WK_DOWNLEVEL_FRAMEWORK_STUBS_DIR.

* Source/JavaScriptCore/Configurations/Base.xcconfig:
* Source/WebCore/Configurations/WebCore.xcconfig:
* Source/WebGPU/Configurations/WebGPU.xcconfig:
* Source/WebKit/Configurations/BaseTarget.xcconfig:
* Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig:
* Tools/DumpRenderTree/mac/Configurations/Base.xcconfig:
* Tools/Scripts/configure-xcode-for-embedded-development:
* Tools/TestWebKitAPI/Configurations/Base.xcconfig:
* Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
* Tools/WebKitTestRunner/Configurations/Base.xcconfig:

Partially revert 5ddcda3
(https://commits.webkit.org/265074@main), which switched a
UseSRCROOTSupportForTAPI environment variable to a user default. Testing
on Xcode 14.3 shows that the defaults value is not being recognized.
This should be safe; my reason for switching it in the first place was
merely to avoid unnecessary environment pollution.

* Tools/Scripts/build-webkit:
* Tools/Scripts/webkitdirs.pm:
(XcodeOptions):

The rest of the patch is SDK creation. Since there are different SDKs
for a platform's device and simulator variants, but our additions are
the same on both, create symlinks for simulator SDKs. We can replace
these with real SDKs in the future.

* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/SDKSettings.plist: Copied from WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/AppSupport.framework/AppSupport.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/CorePrediction.framework/CorePrediction.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/CorePrediction.framework/CorePrediction.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/FileProvider.framework/FileProvider.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/FileProvider.framework/FileProvider.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/FontServices.framework/libFontParser.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/libFontParser.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/GraphicsServices.framework/GraphicsServices.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/PrototypeTools.framework/PrototypeTools.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/PrototypeTools.framework/PrototypeTools.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/RunningBoardServices.framework/RunningBoardServices.tbd.
* WebKitLibraries/SDKs/appletvos16.0-additions.sdk/usr/local/include/AvailabilityProhibitedInternal.h: Added.
* WebKitLibraries/SDKs/appletvsimulator16.0-additions.sdk: Added.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/SDKSettings.plist: Copied from WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/AppServerSupport.framework/AppServerSupport.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/AppServerSupport.framework/AppServerSupport.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/AppStoreDaemon.framework/AppStoreDaemon.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/AppStoreDaemon.framework/AppStoreDaemon.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/AppSupport.framework/AppSupport.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/ApplePushService.framework/ApplePushService.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/ApplePushService.framework/ApplePushService.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/AuthKit.framework/AuthKit.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/AuthKit.framework/AuthKit.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/BackBoardServices.framework/BackBoardServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/BackBoardServices.framework/BackBoardServices.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/CorePrediction.framework/CorePrediction.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/CorePrediction.framework/CorePrediction.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/FontServices.framework/libFontParser.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/libFontParser.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/FrontBoardServices.framework/FrontBoardServices.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/GraphicsServices.framework/GraphicsServices.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/InstallCoordination.framework/InstallCoordination.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/InstallCoordination.framework/InstallCoordination.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/PrototypeTools.framework/PrototypeTools.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/PrototypeTools.framework/PrototypeTools.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/RunningBoardServices.framework/RunningBoardServices.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/URLFormatting.framework/URLFormatting.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/URLFormatting.framework/URLFormatting.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/System/Library/PrivateFrameworks/VisionKitCore.framework/VisionKitCore.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/VisionKitCore.framework/VisionKitCore.tbd.
* WebKitLibraries/SDKs/iphoneos16.0-additions.sdk/usr/local/include/AvailabilityProhibitedInternal.h: Added.
* WebKitLibraries/SDKs/iphonesimulator16.0-additions.sdk: Added.
* WebKitLibraries/SDKs/macosx12.0-additions.sdk/SDKSettings.plist: Copied from WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist.
* WebKitLibraries/SDKs/macosx12.0-additions.sdk/System/Library/PrivateFrameworks/AppleJPEGXL.framework/AppleJPEGXL.tbd: Copied from WebKitLibraries/DownlevelFrameworkStubs/120000/AppleJPEGXL.framework/AppleJPEGXL.tbd.
* WebKitLibraries/SDKs/macosx12.0-additions.sdk/System/Library/PrivateFrameworks/FontServices.framework/libFontParser.tbd: Copied from WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/120000/libFontParser.tbd.
* WebKitLibraries/SDKs/macosx12.0.internal-additions.sdk/SDKSettings.plist: Copied from WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist.
* WebKitLibraries/SDKs/macosx13.0-additions.sdk/SDKSettings.plist: Copied from WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist.
* WebKitLibraries/SDKs/macosx13.0-additions.sdk/System/Library/PrivateFrameworks/AppleJPEGXL.framework/AppleJPEGXL.tbd: Copied from WebKitLibraries/DownlevelFrameworkStubs/120000/AppleJPEGXL.framework/AppleJPEGXL.tbd.
* WebKitLibraries/SDKs/macosx13.0.internal-additions.sdk/SDKSettings.plist: Copied from WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist.
* WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist: Remove unnecessary keys.
* WebKitLibraries/SDKs/macosx14.0-additions.sdk/System/Library/PrivateFrameworks/FontServices.framework/libFontParser.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/120000/libFontParser.tbd.
* WebKitLibraries/SDKs/macosx14.0-additions.sdk/usr/local/include/AvailabilityProhibitedInternal.h:
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/SDKSettings.plist: Copied from WebKitLibraries/SDKs/macosx14.0-additions.sdk/SDKSettings.plist.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/AppSupport.framework/AppSupport.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/CorePrediction.framework/CorePrediction.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/CorePrediction.framework/CorePrediction.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/FileProvider.framework/FileProvider.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/FileProvider.framework/FileProvider.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/FontServices.framework/libFontParser.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/libFontParser.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/GraphicsServices.framework/GraphicsServices.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/PepperUICore.framework/PepperUICore.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/PepperUICore.framework/PepperUICore.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/PrototypeTools.framework/PrototypeTools.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/PrototypeTools.framework/PrototypeTools.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/RunningBoardServices.framework/RunningBoardServices.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/System/Library/PrivateFrameworks/URLFormatting.framework/URLFormatting.tbd: Renamed from WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/URLFormatting.framework/URLFormatting.tbd.
* WebKitLibraries/SDKs/watchos9.0-additions.sdk/usr/local/include/AvailabilityProhibitedInternal.h: Added.
* WebKitLibraries/SDKs/watchsimulator9.0-additions.sdk: Added.

Canonical link: https://commits.webkit.org/266215@main
…oRevalidatedResource()

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

Reviewed by Brent Fulgham.

In 266170@main, I updated MemoryCache::revalidationSucceeded() to deal with the fact
that there may already be a resource in the MemoryCache with the same URL when the
resource revalidation finishes. I dealt with this by assuming that the resource
already in the cache was good enough and I ignored the revalidated resource, and then
transferred the clients of the revalidation resource to the resource that is already
in the cache.

However, it turns out that this isn't safe to do because the resource already in the
cache may have a different type (even though it has the same URL). In the included
test, for example, the same URL is loaded both as a RawResource and a FontResource.
This would lead to crashes later on in switchClientsToRevalidatedResource().

To address the issue, I am reverting 266170@main and dealing with the original issue
in a simpler way. Upon successful revalidation, if there is already a resource in the
memory cache with the same URL, we now remove it from the cache before proceeding.

This is much safer and matches what would happen if you tried to load URL1 as a
RawResource and then load URL2 as a FontResource. Our MemoryCache logic would remove
the existing RawResource in the cache and create a new CachedResource of FontResource
type.

* LayoutTests/http/tests/workers/memory-cache-crash2.html: Added.
* LayoutTests/http/tests/workers/memory-cache-crash2-expected.txt: Added.
* Source/WebCore/loader/cache/CachedResource.cpp:
(WebCore::CachedResource::replaceResourceToRevalidate): Deleted.
* Source/WebCore/loader/cache/CachedResource.h:
* Source/WebCore/loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::revalidationSucceeded):

Canonical link: https://commits.webkit.org/266216@main
https://bugs.webkit.org/show_bug.cgi?id=259406
rdar://112673362

Reviewed by Wenson Hsieh.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:

Canonical link: https://commits.webkit.org/266217@main
… fullscreen

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

Reviewed by Tim Nguyen.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _sceneAspectRatioLockingEnabled]):
(-[WKFullScreenWindowController _performSpatialFullScreenTransition:completionHandler:]):

Canonical link: https://commits.webkit.org/266218@main
https://bugs.webkit.org/show_bug.cgi?id=259396
rdar://112666063

Reviewed by Chris Dumez.

* Source/WebKit/NetworkProcess/WebSocketTask.h:
* Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h:
* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate existingTask:]):
(-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
(-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
(-[WKNetworkSessionDelegate sessionFromTask:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveInformationalResponse:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
(-[WKNetworkSessionDelegate existingWebSocketTask:]):
(WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):

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

Unreviewed.

Need to update the installsrc paths for the new downlevel SDK locations.

* Makefile:

Canonical link: https://commits.webkit.org/266220@main
…d-cookies/partitioned-cookies.tentative.https.html is a flaky TEXT failure

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

Unreviewed gardening commit.

* LayoutTests/platform/wk2/TestExpectations:

Canonical link: https://commits.webkit.org/266221@main
https://bugs.webkit.org/show_bug.cgi?id=259410
rdar://112683422

Reviewed by Devin Rousso and Darin Adler.

WTF::JSON::Value is not following to what ECMA-404 (JSON spec) specifies about whitespaces.
This patch fixes it.

* Source/WTF/wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::parseJSON):
* Tools/TestWebKitAPI/Tests/WTF/JSONValue.cpp:
(TestWebKitAPI::TEST):

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

Unreviewed.

In macosx13.0.internal-additions, the path of AppleJPEGXL.tbd was wrong.

* WebKitLibraries/SDKs/macosx13.0.internal-additions.sdk/System/Library/PrivateFrameworks/AppleJPEGXL.framework/AppleJPEGXL.tbd: Renamed from WebKitLibraries/SDKs/macosx13.0.internal-additions.sdk/System/Library/PrivateFrameworks/AppleJPEGXL.tbd.

Canonical link: https://commits.webkit.org/266223@main
…yConfigurations

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

Reviewed by Chris Dumez.

266129@main reset some members of the SessionWrapper, but not all of them.
To prevent stale map entries, clear all the members at the same time.

* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::SessionWrapper::recreateSessionWithUpdatedProxyConfigurations):

Canonical link: https://commits.webkit.org/266224@main
…n premultipliedAlpha is false

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

Reviewed by Mike Wyrzykowski and Dean Jackson.

After the changes in 262518@main, the drawing buffer no longer needs to be
flipped before creating a native image to be used by drawImage.

GraphicsContextGL::paintRenderingResultsToPixelBuffer has been updated to take a
boolean specifying whether the image should be flipped when returning the
PixelBuffer. This is because the HTMLCanvasElement::getImageData() function,
used when using a canvas as a source to gl.texImage2D(), still requires the data
to be flipped.

Added new tests that exercise both code paths to catch any future regressions.

* LayoutTests/fast/canvas/webgl/canvas-drawImage-expected.html: Added.
* LayoutTests/fast/canvas/webgl/canvas-drawImage.html: Added.
* LayoutTests/fast/canvas/webgl/canvas-getImageData-expected.html: Added.
* LayoutTests/fast/canvas/webgl/canvas-getImageData.html: Added.
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getImageData):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::paintRenderingResultsToPixelBuffer):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
* Source/WebCore/platform/graphics/GraphicsContextGL.h:
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::paintRenderingResultsToPixelBuffer):
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h:
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::withDrawingBufferAsNativeImage):
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h:
(paintRenderingResultsToPixelBuffer):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp:
(WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToPixelBuffer):

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

Reviewed by Alan Baradlay.

Fix content-visibility-fieldset-size.html by preventing painting
fieldset contents where content-visibility causes the content to
be skipped.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustBorderBoxRectForPainting):
(WebCore::RenderBlock::paintRectToClipOutFromBorder):
(WebCore::RenderBlock::paintExcludedChildrenInBorder):

Canonical link: https://commits.webkit.org/266226@main
https://bugs.webkit.org/show_bug.cgi?id=259402
<rdar://112668310>

Reviewed by Tim Horton.

We already only looked at ancestors with the same absolute content box
during the `position: fixed` search. But we also need to make sure we
won't occlude siblings.

* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::isOverlay):
Update the overlay detection logic.

* LayoutTests/interaction-region/overlay-expected.txt:
* LayoutTests/interaction-region/overlay.html:
Add a test covering the change.

Canonical link: https://commits.webkit.org/266227@main
Update status of webgl/2.0.0/conformance2/textures tests.

* LayoutTests/platform/gtk/TestExpectations:

Canonical link: https://commits.webkit.org/266228@main
…ion with the spec

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

Reviewed by Yusuke Suzuki.

This change is a re-land of 265614@main with getSloppyModeHoistedFunctions() fixed not to set
IsSloppyModeHoistingCandidate bit for `var` declarations. This ensures that for a `var` binding,
which shadows a lexical declaration from an outer scope, a SyntaxError is raised even if
there is Annex B hoisted function by the same identifer.

---

For the sloppy-mode eval(), this change:

1. Removes slowish TypeError-throwing logic from executeEval() that also wasn't spec-compliant
   (SyntaxError should be raised instead), harmonizing error messages.

2. Expands resolveScopeForHoistingFuncDeclInEval() to be called for all declared variables, which
   currently includes function declarations as well, ensuring SyntaxError is thrown for duplicates
   with upper yet non-top lexical scopes [1], all while skipping CatchScopeWithSimpleParameter [2].

3. Introduces emitPutToScopeDynamic(), which circumvents default ResolveType resolution that isn't
   correct wrt skipping CatchScopeWithSimpleParameter as resolveScopeForHoistingFuncDeclInEval() does.

   We can't possibly tweak BytecodeGenerator::resolveType() to account for eval().

   This fixes both top-level and block-level function declarations to be hoisted correctly from eval()
   within simple parameter catch block by the same name.

4. Removes isExtensible() check from resolveScopeForHoistingFuncDeclInEval() because for declared
   variables, CanDeclareGlobalVar [3] is already implemented, while for Annex B hoisted functions,
   the implementation doesn't appear correct to unconditionally rely on isExtensible() even if the
   property is already present.

   Furthermore, performing CanDeclareGlobalVar in resolveScopeForHoistingFuncDeclInEval() is kinda
   superfluous given we put jsUndefined() variables in executeEval(), and results in incorrect
   error being thrown (SyntaxError instead of TypeError) if global object is non-extensible.

[1]: https://tc39.es/ecma262/#sec-evaldeclarationinstantiation (step 3.d.i.2.a.i)
[2]: https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks
[3]: https://tc39.es/ecma262/#sec-candeclareglobalvar

All JSTests changes were proven to align JSC with V8 and SpiderMonkey.

* JSTests/ChakraCore/test/Closures/bug_OS_2299723.baseline-jsc:
* JSTests/stress/const-not-strict-mode.js:
* JSTests/stress/eval-func-decl-by-the-same-name-as-callee.js: Added.
* JSTests/stress/eval-func-decl-in-eval-within-catch-scope.js:
* JSTests/stress/eval-func-decl-in-global-of-eval.js:
* JSTests/stress/eval-func-decl-within-eval-duplicate-declaration.js: Added.
* JSTests/stress/eval-func-decl-within-eval-with-reassign-to-var.js:
* JSTests/stress/eval-let-const-redeclararion.js: Added.
* JSTests/stress/global-lexical-var-injection.js:
* JSTests/stress/lexical-let-not-strict-mode.js:
* JSTests/test262/expectations.yaml: Mark 160 tests as passing.
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::hoistSloppyModeFunctionIfNecessary):
(JSC::BytecodeGenerator::emitPutToScopeDynamic):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::Interpreter::executeEval):
* Source/JavaScriptCore/parser/Parser.h:
(JSC::Scope::getSloppyModeHoistedFunctions):
* Source/JavaScriptCore/runtime/JSScope.cpp:
(JSC::JSScope::resolveScopeForHoistingFuncDeclInEval):

Canonical link: https://commits.webkit.org/266229@main
…nsolidation

https://bugs.webkit.org/show_bug.cgi?id=259398
<rdar://111551476>

Reviewed by Tim Horton.

Relax the consolidation rule when the ancestor has hover styles, so
that "buttons" with child spans get a single InteractionRegion.

* Source/WebCore/page/InteractionRegion.h:
* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::elementMatchesHoverRules):
Export `elementMatchesHoverRules`.

* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegionContext::shouldConsolidateInteractionRegion):
Allow consolidation if the ancestor has hover rules and the element is
centered in either axis.

* LayoutTests/interaction-region/consolidated-nested-regions-expected.txt:
* LayoutTests/interaction-region/consolidated-nested-regions.html:
Add a test covering the change.

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

Unreviewed.

266167@main changed Cocoa's WebKitTestRunner's preferences management
from copying from the newly allocated WKWebViewConfiguration to copying
from the long-living WKPreferencesRef to the newly allocated WKWebViewConfiguration.
This made it so that state set in previous test runs was being carried forward
to future test runs done with the same WebKitTestRunner instance.
This just reverses the copying back to how it was before 266167@main.
I verified this fixes the tests Fujii noticed in https://bugs.webkit.org/show_bug.cgi?id=259324

* Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration):
(WTR::TestController::platformAdjustContext):

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

Reviewed by Yusuke Suzuki.

Fixed the signpost patch for Speedometer 3.

* Tools/Scripts/webkitpy/benchmark_runner/data/patches/signposts/Speedometer3.patch:

Canonical link: https://commits.webkit.org/266232@main
https://bugs.webkit.org/show_bug.cgi?id=249505
rdar://103446360

Reviewed by Brady Eidson.

This will help the last 2 clients migrate from
WKPageSetPagePolicyClient to WKNavigationDelegate and WKUIDelegate.

* Source/WebKit/UIProcess/API/APINavigationAction.h:
* Source/WebKit/UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction _targetFrameName]):
* Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::createNewPage):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/NavigationAction.mm:
(TEST):

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

Reviewed by Tim Nguyen.

Updated the style for the inverted-colors media query in html.css
the new styles are taken directly from the spec.

Spec: https://drafts.csswg.org/mediaqueries-5/#inverted

* LayoutTests/fast/media/mq-inverted-colors-ua-styles-expected.txt: Added.
* LayoutTests/fast/media/mq-inverted-colors-ua-styles-img-expected.html: Added.
* LayoutTests/fast/media/mq-inverted-colors-ua-styles-img.html: Added.
* LayoutTests/fast/media/mq-inverted-colors-ua-styles.html: Added.
* Source/WebCore/css/html.css:
(@media (inverted-colors) img:not(picture>img), picture, video):
(@media (inverted-colors) img, picture, video): Deleted.

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

Reviewed by Aditya Keerthi.

In some cases, we know the selectors we are checking for exist because
they are unconditionally included in the header files.

Other times, we know they exist because the OSes that do not support
these methods are no longer supported.

According to https://build.webkit.org/dashboard/, we no longer support:
- Anything before macOS 12
- Anything before tvOS 16
- Anything before iOS 16
- Anything before watchOS 9

So any respondsToSelector calls for the sake of the OSes that do not fit
the criteria above can be removed.

* Source/WTF/wtf/PlatformHave.h: Added HAVE_NSSHARINGSERVICEPICKER
  macro.

* Source/WebCore/bridge/objc/objc_instance.mm:
  (JSC::Bindings::ObjcInstance::setValueOfUndefinedField):
  Remove comment because it is misleading.
  (JSC::Bindings::ObjcInstance::getValueOfUndefinedField const): Ditto.

* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
  (WebCore::initTypeForRequest): Remove check because
  AVContentKeyRequest.options was added in 10.14.4, and earliest
  supported macOS is macOS 12.

* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
  (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
  Remove check because setRate:time:atHostTime: is now a public API.
  (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): Ditto.

* Source/WebCore/platform/network/cocoa/CookieCocoa.mm: Remove check
  because sameSitePolicy is now a public API.

* Source/WebKit/Platform/cocoa/ImageAnalysisUtilities.mm:
  (WebKit::makeTextRecognitionResult): Remove check because
  isPassthrough is explicitly defined in the interface definition in the
  header.

* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
  (WebKit::WebContextMenuProxyMac::getShareMenuItem): Replace selector
  check with a check for HAVE_NSSHARINGSERVICEPICKER because
  standardShareMenuItem is definitely a Ventura addition. Because
  getStandardShareMenuItem cannot be called from macOS 13 and above due
  to NSSHARINGSERVICEPICKER being available, getStandardShareMenuItem
  has been wrapped around a check for not having NSSHARINGSERVICEPICKER.

* Source/WebKitLegacy/mac/WebView/WebView.mm:
  (-[WebView _handleContextMenuTranslation:]): Remove check because the
  modern counterpart does not check either, meaning this is safe to
  remove.

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