WebKit.git
3 months agoUnreviewed, check in some more files for a blog post.
fpizlo@apple.com [Tue, 21 Apr 2020 22:27:16 +0000 (22:27 +0000)]
Unreviewed, check in some more files for a blog post.

* blog-files/speculation-in-jsc/abstract-heaps.graffle: Added.
* blog-files/speculation-in-jsc/abstract-heaps.svg: Added.

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

3 months agoOne more build fix after r260407
timothy_horton@apple.com [Tue, 21 Apr 2020 21:50:37 +0000 (21:50 +0000)]
One more build fix after r260407

* Configurations/WebKit.xcconfig:

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

3 months ago[iOS] Provide better names for ProcessThrottler process assertions
cdumez@apple.com [Tue, 21 Apr 2020 21:22:25 +0000 (21:22 +0000)]
[iOS] Provide better names for ProcessThrottler process assertions
https://bugs.webkit.org/show_bug.cgi?id=210808

Reviewed by Geoffrey Garen.

Provide better names for ProcessThrottler process assertions, to facilitate debugging.

* UIProcess/GPU/GPUProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::ProcessAssertion):
* UIProcess/ProcessAssertion.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::assertionName const):
(WebKit::ProcessThrottler::setAssertionType):
* UIProcess/ProcessThrottler.h:
* UIProcess/ProcessThrottlerClient.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):

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

3 months agoWTF API test for StringConcatenate failing for internal Apple builds
darin@apple.com [Tue, 21 Apr 2020 20:52:54 +0000 (20:52 +0000)]
WTF API test for StringConcatenate failing for internal Apple builds
https://bugs.webkit.org/show_bug.cgi?id=210812

Reviewed by Brent Fulgham.

* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST): Add back a case for when UChar is uint16_t.

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

3 months agoMove WebKit.WebViewCategory test to InAppBrowserPrivacy.mm
katherine_cheney@apple.com [Tue, 21 Apr 2020 20:49:32 +0000 (20:49 +0000)]
Move WebKit.WebViewCategory test to InAppBrowserPrivacy.mm
https://bugs.webkit.org/show_bug.cgi?id=210811
<rdar://problem/60972505>

Reviewed by Alexey Proskuryakov.

This test was added before InAppBrowserPrivacy.mm existed. It should
be moved here so it has access to all setup/cleanup needed by these
tests.

* TestWebKitAPI/Tests/WebKitCocoa/Configuration.mm:
* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:

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

3 months ago[Async overflow scroll] Overflow that's hidden on one axis is scrollable on that...
simon.fraser@apple.com [Tue, 21 Apr 2020 20:36:41 +0000 (20:36 +0000)]
[Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
https://bugs.webkit.org/show_bug.cgi?id=210771
<rdar://problem/62080331>

Reviewed by Tim Horton.

Source/WebCore:

eventCanScrollContents() should check the presence of enabled scrollbars, like
ScrollAnimator::handleWheelEvent() does.

Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):

LayoutTests:

* fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis-expected.txt: Added.
* fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html: Added.

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

3 months ago[iOS] -_didFinishTextInteractionInTextInputContext should only zoom to reveal focused...
dbates@webkit.org [Tue, 21 Apr 2020 20:22:11 +0000 (20:22 +0000)]
[iOS] -_didFinishTextInteractionInTextInputContext should only zoom to reveal focused element if it changed
https://bugs.webkit.org/show_bug.cgi?id=210697
<rdar://problem/60997530>

Source/WebCore:

Reviewed by Wenson Hsieh.

For now, add a comment about the return value of setFocusedElement: it returns
whether focus was blocked. If focused wasn't blocked then it will return true
even if the element wasn't actually focused. For example, it will return true
for non-focusable elements: <input disabled>.

I was tempted to fix setFocusedElement() to return true when it actually focused
the element or if the element was already focused, but I decided to defer this
until I audit the callers and run some tests.

* dom/Document.h:

Source/WebKit:

Reviewed by Wenson Hsieh.

Add a new state variable to use to track whether -_focusTextInputContext invoked during a
text interaction actually focused an element. Then in -_didFinishTextInteractionInTextInputContext
condition marking the page to reveal the focused element on this state.

* UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _willBeginTextInteractionInTextInputContext:]): Turn around and call the same
function on the content view.
(-[WKWebView _didFinishTextInteractionInTextInputContext:]): Ditto.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanUpInteraction]): Reset state.
(-[WKContentView _didCommitLoadForMainFrame]): Ditto.
(-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]): Update state to
indicate whether the focusd element did change or not. I use bitwise ORing instead of strict
assignment to update it because this function can be called multiple times by an internal
Apple client during a text interaction (e.g. <rdar://problem/59430806>). I thought about
making this a FIXME, but this function is otherwise capable of handling multiple invocations
so I didn't.
(-[WKContentView _willBeginTextInteractionInTextInputContext:]): Reset added state.
(-[WKContentView _didFinishTextInteractionInTextInputContext:]): Check if state was set to
indicate that a focus change happened. If so, do what we do now + reset state. Otherwise,
do everything we do now except for marking the page as needing to reveal the focused element
on the next editor state update.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::focusTextInputContextAndPlaceCaret): Check that the target is focusable
before calling FocusController::setFocusedElement() because it ultimately calls Document::setFocusedElement()
that can return true for a non-focusable element. I added a comment in Document.h to explain
this subtlety. I also decided not to check the return value of FocusController::setFocusedElement().
Instead I am checking the more important condition that the focused element is the target
element. Passing true to visiblePositionInFocusedNodeForPoint() will ultimately assert this
to be true. Note that setFocusedElement() may not have done anything as m_focusedElement
could have already been equal to the target element. This is OK and I still update the
caret position.

Tools:

Reviewed by Wenson Hsieh.

I use the term "assisted" below and in the tests to describe an element that is both DOM
focused and the UI process is showing an input view (like the software keyboard) for it.
For many of the tests I check for a zoom scale change as a way to detect if the page
zoomed to reveal the focused element.

Add some tests for the following cases:
    1. Place the caret in a focused field that isn't being assisted.
    2. Focusing an assisted element should not scroll the page.
    3. Focusing an offscreen read-only element should not change zoom scale.
    4. Focusing an offscreen element should change the zoom scale.
    5. Calling -_focusTextInputContext on an offscreen element multiple times
    during a text interaction should change the zoom scale. The purpose of this test is
    to ensure that later calls that do not focus the element (because it is already focused)
    don't prevent zooming for the first call that did focus the element.
    6. Focusing an offscreen element, defocusing it, disabling it, and focusing it
    again during a text interaction should not change zoom scale.
    7. Focusing an offscreen element, defocusing it, and focusing it again during a
    text interaction should change zoom scale.
    8. Focusing an assisted element during a text interaction should not change zoom scale.
    9. Focusing a non-assisted focused element during a text interaction should change zoom scale.

While I am here, I consolidated the RAII helper classes IPhoneUserInterfaceSwizzler and
IPadUserInterfaceSwizzler into a single UserInterfaceSwizzler templated class and defined
the former two as template instances.

* TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
(TextInteractionForScope::TextInteractionForScope):
(TextInteractionForScope::~TextInteractionForScope):
Added convenience RAII object to call -_willBeginTextInteractionInTextInputContext
and -_didFinishTextInteractionInTextInputContext.
(TEST): Added.
* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
* TestWebKitAPI/ios/IPadUserInterfaceSwizzler.h: Removed.
* TestWebKitAPI/ios/PreferredContentMode.mm:
(IPhoneUserInterfaceSwizzler::IPhoneUserInterfaceSwizzler): Deleted; movedinto UserInterfaceSwizzler.h.
(IPhoneUserInterfaceSwizzler::phoneUserInterfaceIdiom): Deleted; no longer needed.
* TestWebKitAPI/ios/UserInterfaceSwizzler.h: Renamed from Tools/TestWebKitAPI/ios/IPadUserInterfaceSwizzler.h.
(TestWebKitAPI::UserInterfaceSwizzler::UserInterfaceSwizzler): Formerly named IPadUserInterfaceSwizzler;
repurposed into general purpose template class, consolidating code from PreferredContentMode.mm.
Privately inherits from InstanceMethodSwizzler instead of using composition as that simplifies
the source code a tiny bit.
(TestWebKitAPI::UserInterfaceSwizzler::effectiveUserInterfaceIdiom): Renamed; formerly padUserInterfaceIdiom.

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

3 months agoFix for remoteParentObject and platformWidget not being stored properly in the AXIsol...
andresg_22@apple.com [Tue, 21 Apr 2020 20:21:04 +0000 (20:21 +0000)]
Fix for remoteParentObject and platformWidget not being stored properly in the AXIsolatedObject attributes variant.
https://bugs.webkit.org/show_bug.cgi?id=210809

Reviewed by Chris Fleizach.

Adding these properties to the AXIsolatedObject attributes variant as
WeakPtr<void*> fails. So they are now cached as member variables.

* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::platformWidget const):
* accessibility/isolatedtree/AXIsolatedObject.h:
(WebCore::AXIsolatedObject::propertyValue const): Deleted.
* accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::initializePlatformProperties):
(WebCore::AXIsolatedObject::remoteParentObject const):

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

3 months agoconstructObjectFromPropertyDescriptor() is incorrect with partial descriptors
shvaikalesh@gmail.com [Tue, 21 Apr 2020 19:18:36 +0000 (19:18 +0000)]
constructObjectFromPropertyDescriptor() is incorrect with partial descriptors
https://bugs.webkit.org/show_bug.cgi?id=184629

Reviewed by Ross Kirsling.

JSTests:

* test262/expectations.yaml: Mark 4 test cases as passing.

Source/JavaScriptCore:

Before this change, constructObjectFromPropertyDescriptor() serialized a value-only descriptor
with nullish m_seenAttributes to {value, writable: false, enumerable: false, configurable: false}
instead of just {value}. This was observable when ordinarySetSlow() was called on a Proxy
`receiver` with "defineProperty" trap.

This patch makes constructObjectFromPropertyDescriptor() 1:1 with the spec [2], aligning JSC
with V8 and SpiderMonkey, and also cleans up its call sites from handling exceptions and
`undefined` value returns.

[1]: https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor (step 3.d.iv)
[2]: https://tc39.es/ecma262/#sec-frompropertydescriptor

* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptors):
* runtime/ObjectConstructor.h:
(JSC::constructObjectFromPropertyDescriptor):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performDefineOwnProperty):

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

3 months agoReset m_userScriptsNotified when web process crashes.
timothy@apple.com [Tue, 21 Apr 2020 18:42:45 +0000 (18:42 +0000)]
Reset m_userScriptsNotified when web process crashes.
https://bugs.webkit.org/show_bug.cgi?id=210807

Reviewed by Alex Christensen.

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebPageProxy::resetStateAfterProcessExited): Set m_userScriptsNotified to false.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST): Test crashing the web process and reloading.

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

3 months agoHorizontal overflow overlay scrollbar is misplaced in RTL
simon.fraser@apple.com [Tue, 21 Apr 2020 18:17:10 +0000 (18:17 +0000)]
Horizontal overflow overlay scrollbar is misplaced in RTL
https://bugs.webkit.org/show_bug.cgi?id=210673
<rdar://problem/61950751>

Reviewed by Antti Koivisto.
Source/WebCore:

Code for positioning RenderLayer overflow controls (scrollbars and scroll corner)
was scattered across lots of different functions, making it hard to follow,
and prone to bugs.

Fix by making one source of truth, overflowControlsRects(), which computes
rects for the two scrollbars, the "scroll corner" (the square in the corner which
shows, only for non-overlay scrollbars, when both scrollbars or the resize control
is visible), and the resize control which shows when style specifies the "resize" property.

Call this function in all the places that need to know about overflow control
geometry. RenderLayer::hitTestResizerInFragments() is a little tricky because it wants
the resize control relative to the fragment rect; achieve this by computing the position
of the resizer rect relative to the border box, then shifting it into position relative
to the fragment bounds (which include border).

Test: compositing/overflow/rtl-scrollbar-layer-positioning.html

* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollCornerRect const):
(WebCore::RenderLayer::overflowControlsRects const):
(WebCore::RenderLayer::scrollbarOffset const):
(WebCore::RenderLayer::invalidateScrollbarRect):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::overflowControlsIntersectRect const):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::isPointInResizeControl const):
(WebCore::RenderLayer::hitTestOverflowControls):
(WebCore::RenderLayer::hitTestResizerInFragments const):
(WebCore::cornerStart): Deleted.
(WebCore::cornerRect): Deleted.
(WebCore::resizerCornerRect): Deleted.
(WebCore::RenderLayer::scrollCornerAndResizerRect const): Deleted.
(WebCore::RenderLayer::rectForHorizontalScrollbar const): Deleted.
(WebCore::RenderLayer::rectForVerticalScrollbar const): Deleted.
(WebCore::RenderLayer::verticalScrollbarStart const): Deleted.
(WebCore::RenderLayer::horizontalScrollbarStart const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::paintContents):

LayoutTests:

* compositing/overflow/rtl-scrollbar-layer-positioning-expected.txt: Added.
* compositing/overflow/rtl-scrollbar-layer-positioning.html: Added.
* platform/ios-wk2/compositing/overflow/rtl-scrollbar-layer-positioning-expected.txt: Added.
* platform/mac-wk1/compositing/overflow/rtl-scrollbar-layer-positioning-expected.txt: Added.

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

3 months ago[ews] Display error message when submit for EWS analysis button doesn't work
aakash_jain@apple.com [Tue, 21 Apr 2020 18:13:36 +0000 (18:13 +0000)]
[ews] Display error message when submit for EWS analysis button doesn't work
https://bugs.webkit.org/show_bug.cgi?id=210803

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/submittoews.py:
(SubmitToEWS.post): Display relevant error message on submit for EWS analysis button failure.
* BuildSlaveSupport/ews-app/ews/fetcher.py:
(BugzillaPatchFetcher.fetch):
(BugzillaPatchFetcher.send_patches_to_buildbot):
* BuildSlaveSupport/ews-app/ews/config.py: Add few more error codes.

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

3 months agoMove value-pow-ai-rule-should-box-the-same-way-as-the-runtime.js to JSTests/stress/
ysuzuki@apple.com [Tue, 21 Apr 2020 18:10:08 +0000 (18:10 +0000)]
Move value-pow-ai-rule-should-box-the-same-way-as-the-runtime.js to JSTests/stress/
https://bugs.webkit.org/show_bug.cgi?id=210805

Reviewed by Saam Barati.

r251408 accidentally puts value-pow-ai-rule-should-box-the-same-way-as-the-runtime.js in JSTests/ instead of JSTests/stress/.
This patch fixes that.

* stress/value-pow-ai-rule-should-box-the-same-way-as-the-runtime.js: Renamed from JSTests/value-pow-ai-rule-should-box-the-same-way-as-the-runtime.js.

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

3 months ago[GStreamer][JHBuild] Update to 1.16.2
lmoura@igalia.com [Tue, 21 Apr 2020 17:50:56 +0000 (17:50 +0000)]
[GStreamer][JHBuild] Update to 1.16.2
https://bugs.webkit.org/show_bug.cgi?id=210730

Reviewed by Philippe Normand.

Moving the bots closer to the flatpak SDK versions.

* gstreamer/jhbuild.modules:
* gstreamer/patches/base-0001-glupload-Add-VideoMetas-and-GLSyncMeta-to-the-raw-up.patch: Removed.

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

3 months agoFix the build
timothy_horton@apple.com [Tue, 21 Apr 2020 17:48:03 +0000 (17:48 +0000)]
Fix the build

* Configurations/WebKit.xcconfig:

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

3 months ago[IPC hardening] ShareableResource::create() should validate its parameters
ddkilzer@apple.com [Tue, 21 Apr 2020 17:30:19 +0000 (17:30 +0000)]
[IPC hardening] ShareableResource::create() should validate its parameters
<https://webkit.org/b/210779>
<rdar://problem/60887693>

Reviewed by Chris Dumez.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didFinishLoadForQuickLookDocumentInMainFrame):
- Handle nullptr returned from ShareableResource::create().

* Shared/ShareableResource.cpp:
(WebKit::ShareableResource::create):
- Change to return RefPtr<>.
- Validate parameters before calling constructor.  Return
  nullptr on failure.
(WebKit::ShareableResource::ShareableResource):
- Remove assert and comment since checks are now done in
  ShareableResource::create().
* Shared/ShareableResource.h:
(WebKit::ShareableResource::create):
- Change to return RefPtr<>.

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

3 months agoUnreviewed, reverting r260432.
svillar@igalia.com [Tue, 21 Apr 2020 17:20:20 +0000 (17:20 +0000)]
Unreviewed, reverting r260432.

Broke WPE build

Reverted changeset:

"[WebXR] Test IDLs and stubs"
https://bugs.webkit.org/show_bug.cgi?id=209859
https://trac.webkit.org/changeset/260432

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

3 months agoREGRESSION (r256808): “A problem repeatedly occurred” when attempting to load https...
cdumez@apple.com [Tue, 21 Apr 2020 17:14:08 +0000 (17:14 +0000)]
REGRESSION (r256808): “A problem repeatedly occurred” when attempting to load https://bungalow.com/listings/bay-area
https://bugs.webkit.org/show_bug.cgi?id=210801
<rdar://problem/61658940>

Reviewed by Antti Koivisto.

Even though the page uses the 'async' attribute on the mapbox-gl.js script, deferring the execution of this
script gets the page into a bad state, causing it to use a lot of CPU & memory until the process crashes.
Since we don't have any other evidence of breakage from r256808 yet and since r256808 was a massive PLT
progression, I am opting to add a quirk to disable the async script optimization on bungalow.com for now.

* dom/Document.cpp:
(WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
* page/Quirks.cpp:
(WebCore::Quirks::shouldBypassAsyncScriptDeferring const):
* page/Quirks.h:
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::operator== const):

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

3 months agoCheck Structure attributes in Object.assign exhaustively
ysuzuki@apple.com [Tue, 21 Apr 2020 17:10:47 +0000 (17:10 +0000)]
Check Structure attributes in Object.assign exhaustively
https://bugs.webkit.org/show_bug.cgi?id=210782
<rdar://problem/62065853>

Reviewed by Mark Lam.

* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorAssign):

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

3 months agoCorrect the path to libclang_rt.asan_iossim_dynamic.dylib in LC_RPATH
ap@apple.com [Tue, 21 Apr 2020 16:58:55 +0000 (16:58 +0000)]
Correct the path to libclang_rt.asan_iossim_dynamic.dylib in LC_RPATH
https://bugs.webkit.org/show_bug.cgi?id=210770
rdar://problem/61904541

Reviewed by Alex Christensen.

* asan/asan.xcconfig:

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

3 months ago[WebXR] Test IDLs and stubs
svillar@igalia.com [Tue, 21 Apr 2020 16:30:31 +0000 (16:30 +0000)]
[WebXR] Test IDLs and stubs
https://bugs.webkit.org/show_bug.cgi?id=209859

Reviewed by Dean Jackson and Youenn Fablet.

Source/WebCore:

WebXR testing is hard as it might involve interaction with actual
devices. That's why the WebXR testing
API (https://immersive-web.github.io/webxr-test-api/) was
proposed. In fact, all the current WebXR tests from
web-platform-tests are using that testing API. This new testing
API supplements navigator.xr and is accessed through
navigator.xr.test.

In order not to expose the API to the web we're adding the XRTest
interface to Internals instead. The mapping from internals.xrTest to
navigator.xr.test happens in the WPT code.

We're adding the required IDLs and very basic (mostly empty)
implementations for testing methods. We're adding testing
infrastructure, adding tests make no sense for this change.

* CMakeLists.txt: Added new files.
* DerivedSources.make: Ditto.
* Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code.
* Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods.
* Sources.txt: Added new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/WebCoreBuiltinNames.h: Added some new macros.
* testing/FakeXRBoundsPoint.h: Added.
* testing/FakeXRBoundsPoint.idl: Added.
* testing/FakeXRButtonStateInit.h: Added.
* testing/FakeXRButtonStateInit.idl: Added.
* testing/FakeXRInputSourceInit.h: Added.
* testing/FakeXRInputSourceInit.idl: Added.
* testing/FakeXRRigidTransformInit.h: Added.
* testing/FakeXRRigidTransformInit.idl: Added.
* testing/FakeXRViewInit.h: Added.
* testing/FakeXRViewInit.idl: Added.
* testing/Internals.cpp:
(WebCore::Internals::xrTest): Added WebXRTest to Internals.
* testing/Internals.h: Added xrTest() accessor.
* testing/Internals.idl: Added xrTest attribute.
* testing/WebFakeXRDevice.cpp: Added.
(WebCore::WebFakeXRDevice::setViews):
(WebCore::WebFakeXRDevice::disconnect):
(WebCore::WebFakeXRDevice::setViewerOrigin):
(WebCore::WebFakeXRDevice::clearViewerOrigin):
(WebCore::WebFakeXRDevice::simulateVisibilityChange):
(WebCore::WebFakeXRDevice::setBoundsGeometry):
(WebCore::WebFakeXRDevice::setFloorOrigin):
(WebCore::WebFakeXRDevice::clearFloorOrigin):
(WebCore::WebFakeXRDevice::simulateResetPose):
(WebCore::WebFakeXRDevice::simulateInputSourceConnection):
* testing/WebFakeXRDevice.h: Added.
* testing/WebFakeXRDevice.idl: Added.
* testing/WebFakeXRInputController.cpp: Added.
(WebCore::WebFakeXRInputController::setHandedness):
(WebCore::WebFakeXRInputController::setTargetRayMode):
(WebCore::WebFakeXRInputController::setProfiles):
(WebCore::WebFakeXRInputController::setGripOrigin):
(WebCore::WebFakeXRInputController::clearGripOrigin):
(WebCore::WebFakeXRInputController::setPointerOrigin):
(WebCore::WebFakeXRInputController::disconnect):
(WebCore::WebFakeXRInputController::reconnect):
(WebCore::WebFakeXRInputController::startSelection):
(WebCore::WebFakeXRInputController::endSelection):
(WebCore::WebFakeXRInputController::simulateSelect):
(WebCore::WebFakeXRInputController::setSupportedButtons):
(WebCore::WebFakeXRInputController::updateButtonState):
* testing/WebFakeXRInputController.h: Added.
* testing/WebFakeXRInputController.idl: Added.
* testing/WebXRTest.cpp: Added.
(WebCore::WebXRTest::simulateDeviceConnection const):
(WebCore::WebXRTest::simulateUserActivation):
(WebCore::WebXRTest::disconnectAllDevices):
* testing/WebXRTest.h: Added.
(WebCore::WebXRTest::create):
* testing/WebXRTest.idl: Added.
* testing/XRSimulateUserActivationFunction.h: Added.
* testing/XRSimulateUserActivationFunction.idl: Ditto.

LayoutTests:

* platform/wpe/TestExpectations: Added bug number to the passing webxr test.

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

3 months ago[Clang 10] Fix warning: definition of implicit copy assignment operator for 'PageBloc...
cturner@igalia.com [Tue, 21 Apr 2020 16:21:31 +0000 (16:21 +0000)]
[Clang 10] Fix warning: definition of implicit copy assignment operator for 'PageBlock' is deprecated because it has a user-declared copy constructor
https://bugs.webkit.org/show_bug.cgi?id=210748

Reviewed by Adrian Perez de Castro.

Recent Clang's will issue a warning if you declare an explicit
copy construction, but leave the compiler to fill in an implicit
assignment operator. I think this is to catch cases where you do
something exciting in an assignment operator/copy constructor and
forget to do the same exciting thing in the other.

* wtf/PageAllocation.h: Import the base's constructor to avoid
defining our own identical one.
* wtf/PageBlock.h: Remove trivial constructor and replace with
member initializers. Remove copy constructor. This looks identical
to what the compiler would generate anyway.

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

3 months ago[GTK] Gardening of WPT tests for Intersection Observer v2 after r260388
clopez@igalia.com [Tue, 21 Apr 2020 16:12:38 +0000 (16:12 +0000)]
[GTK] Gardening of  WPT tests for Intersection Observer v2 after r260388

Unreviewed.

* platform/gtk/TestExpectations: Due to the override for Pass/Fail in the folder above
its needed to repeat the Skip expectation here to avoid the Missing result.

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

3 months ago[Cocoa] Tighten up some more IPC message checks in WebPasteboardProxy
wenson_hsieh@apple.com [Tue, 21 Apr 2020 16:05:46 +0000 (16:05 +0000)]
[Cocoa] Tighten up some more IPC message checks in WebPasteboardProxy
https://bugs.webkit.org/show_bug.cgi?id=210780
<rdar://problem/62088479>

Reviewed by Alex Christensen.

Adjust some existing IPC message checks in WebPasteboardProxy, and also introduces some new ones. See below for
more details.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::didModifyContentsOfPasteboard):

Move the `pasteboardName` check here out of `didModifyContentsOfPasteboard`, and into each call site, such that
we bail and kill the web process before invoking `didModifyContentsOfPasteboard` in the case where the name is
empty.

(WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
(WebKit::WebPasteboardProxy::getPasteboardStringForType):
(WebKit::WebPasteboardProxy::getPasteboardStringsForType):
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::addPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardURL):
(WebKit::WebPasteboardProxy::setPasteboardColor):
(WebKit::WebPasteboardProxy::setPasteboardStringForType):

Add message checks for empty pasteboard types.

(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
(WebKit::WebPasteboardProxy::writeCustomData):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
(WebKit::WebPasteboardProxy::writeURLToPasteboard):
(WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
(WebKit::WebPasteboardProxy::writeImageToPasteboard):
(WebKit::WebPasteboardProxy::writeStringToPasteboard):

Add a message check for empty pasteboard types, but only when the string is also empty; this is because iOS
clears pasteboard data by writing an empty pasteboard string and type.

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

3 months ago[Flatpak SDK] Keep env variable 'RESULTS_SERVER_API_KEY'
dpino@igalia.com [Tue, 21 Apr 2020 15:51:13 +0000 (15:51 +0000)]
[Flatpak SDK] Keep env variable 'RESULTS_SERVER_API_KEY'
https://bugs.webkit.org/show_bug.cgi?id=210798

Reviewed by Philippe Normand.

The variable is needed by several bot steps to upload results.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):

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

3 months ago[GTK][CMake] Make gtk-unix-print a component of FindGTK.cmake
aperez@igalia.com [Tue, 21 Apr 2020 15:26:53 +0000 (15:26 +0000)]
[GTK][CMake] Make gtk-unix-print a component of FindGTK.cmake
https://bugs.webkit.org/show_bug.cgi?id=210792

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/FindGTK.cmake: Support an "unix-print" component.
* Source/cmake/FindGTKUnixPrint.cmake: Removed.
* Source/cmake/OptionsGTK.cmake: Use the "unix-print" component of the GTK find module.

Source/WebKit:

No new tests needed.

* PlatformGTK.cmake: Use the GTK::UnixPrint imported target.

Tools:

* TestWebKitAPI/glib/PlatformGTK.cmake: Use the GTK::UnixPrint imported target.

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

3 months ago[Flatpak SDK] Silence git stderr output
philn@webkit.org [Tue, 21 Apr 2020 13:26:37 +0000 (13:26 +0000)]
[Flatpak SDK] Silence git stderr output
https://bugs.webkit.org/show_bug.cgi?id=210789

Reviewed by Sergio Villar Senin.

* flatpak/flatpakutils.py:
(WebkitFlatpak.is_branch_build): Don't display git errors, usually
emitted when operating on a SVN checkout.

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

3 months ago[GTK4] Adapt to GtkIconTheme API changes
csaavedra@igalia.com [Tue, 21 Apr 2020 12:31:22 +0000 (12:31 +0000)]
[GTK4] Adapt to GtkIconTheme API changes
https://bugs.webkit.org/show_bug.cgi?id=210745

Reviewed by Adrian Perez de Castro.

Source/WebCore:

No new tests needed.

GtkIconTheme changes in GTK and since we're no longer following
the theme we can drop the missing image from the icon theme, so remove
now unnecessary code.

* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::Image::loadPlatformResource): Directly load image from compiled
GResource.
(WebCore::loadResourceSharedBuffer): Deleted.
(WebCore::loadMissingImageIconFromTheme): Deleted.

Source/WTF:

* wtf/glib/GTypedefs.h: Remove unneeded GtkIconInfo definition.

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

3 months agoImport latest changes from web-platform-test/webxr/resources to enable testing in...
svillar@igalia.com [Tue, 21 Apr 2020 10:33:58 +0000 (10:33 +0000)]
Import latest changes from web-platform-test/webxr/resources to enable testing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=210788

Reviewed by Žan Doberšek.

We landed in wpt new code in webxr_utils.js to map internal.xrTest to
navigator.xr.test to be able to run WebXR WPT in WebKit. Import those changes
from upstream in order to be able to run the tests.

Apart from that we take the chance to import the latest fixes to the
files in resources/ directory.

* web-platform-tests/webxr/resources/webxr_test_constants.js: Updated.
* web-platform-tests/webxr/resources/webxr_test_constants_fake_world.js:
(createFakeWorld): Ditto.
* web-platform-tests/webxr/resources/webxr_util.js: Map internals.xrTest
to navigator.xr.test for WebKit browsers.
(xr_debug): Updated.
(async xr_session_promise_test): Ditto.
(xr_promise_test): Deleted.

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

3 months agoExit early in FrameLoader::loadURL when redirecting to another frame
commit-queue@webkit.org [Tue, 21 Apr 2020 10:31:08 +0000 (10:31 +0000)]
Exit early in FrameLoader::loadURL when redirecting to another frame
https://bugs.webkit.org/show_bug.cgi?id=210751

Patch by Rob Buis <rbuis@igalia.com> on 2020-04-21
Reviewed by Geoffrey Garen.

Exit early in FrameLoader::loadURL when redirecting to another frame, previously we were preparing
request needlessly, doing it twice in case of frame redirecting. Also move some variables to
where they are actually used.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:

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

3 months ago[ARMv7][EWS] stress/check-stack-overflow-before-value-profiling-arguments.js is failing
commit-queue@webkit.org [Tue, 21 Apr 2020 10:28:37 +0000 (10:28 +0000)]
[ARMv7][EWS] stress/check-stack-overflow-before-value-profiling-arguments.js is failing
https://bugs.webkit.org/show_bug.cgi?id=210720

Unreviewed gardening.

Skip test on arm since it is failing on EWS, causing significant delays.

Patch by Paulo Matos <pmatos@igalia.com> on 2020-04-21

* stress/check-stack-overflow-before-value-profiling-arguments.js:

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

3 months agoRe-enable previously skipped mips tests
commit-queue@webkit.org [Tue, 21 Apr 2020 09:52:46 +0000 (09:52 +0000)]
Re-enable previously skipped mips tests
https://bugs.webkit.org/show_bug.cgi?id=209964

Patch by Paulo Matos <pmatos@igalia.com> on 2020-04-21
Reviewed by Mark Lam.

Followup to r259454 - where we re-enabled a few stress tests for arm.

* stress/JSArrayBufferView-byteOffset-is-racy-from-compiler-thread.js:
* stress/dont-range-based-iterate-vector-that-is-mutated.js:
* stress/ensure-code-block-is-not-precise-allocation.js:
* stress/generator-cell-with-type.js:
* stress/racy-slow-put-cloned-arguments-when-having-a-bad-time.js:
* stress/symbol-is-destructed-before-refing-underlying-symbol-impl.js:
* stress/toctou-having-a-bad-time-new-array.js:

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

3 months ago[GTK] Remove PlatformMouseEventGtk
carlosgc@webkit.org [Tue, 21 Apr 2020 08:47:11 +0000 (08:47 +0000)]
[GTK] Remove PlatformMouseEventGtk
https://bugs.webkit.org/show_bug.cgi?id=210743

Reviewed by Adrian Perez de Castro.

It's unused, we no longer create PlatformMouseEvent from a GdkEvent since WebKit2.

* SourcesGTK.txt:
* platform/PlatformMouseEvent.h:
* platform/gtk/PlatformMouseEventGtk.cpp: Removed.

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

3 months agoSource/WebKit:
philn@webkit.org [Tue, 21 Apr 2020 08:41:11 +0000 (08:41 +0000)]
Source/WebKit:
[CMake] gst-build-backed build fails
https://bugs.webkit.org/show_bug.cgi?id=210742

Reviewed by Xabier Rodriguez-Calvar.

* PlatformWPE.cmake:

Tools:
[CMake][Flatpak SDK] gst-build-backed build fails
https://bugs.webkit.org/show_bug.cgi?id=210742

Reviewed by Xabier Rodriguez-Calvar.

Add non-core GStreamer include-dirs necessary for the compilation
of the GStreamer API test. Usually GSTREAMER_INCLUDE_DIRS is
sufficient because on a GStreamer system-wide installation, all
headers are stored in the same root include dir, the same as the
core GStreamer library.

But when building with gst-build, include-dirs are scattered all
over the place.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:

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

3 months ago[GTK4] Fix platform GDK includes
csaavedra@igalia.com [Tue, 21 Apr 2020 08:38:23 +0000 (08:38 +0000)]
[GTK4] Fix platform GDK includes
https://bugs.webkit.org/show_bug.cgi?id=210746

Reviewed by Carlos Garcia Campos.

* platform/graphics/PlatformDisplay.cpp: Wayland, X11, etc.
platform includes changed path, so update accordingly.

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

3 months agoNon-unified build fixes late February 2020 edition
aperez@igalia.com [Tue, 21 Apr 2020 07:48:52 +0000 (07:48 +0000)]
Non-unified build fixes late February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=210767

Unreviewed build fix.

Source/JavaScriptCore:

* dfg/DFGValueRepReductionPhase.cpp: Add missing JSCJSValueInlines.h header.
* jit/JITCall.cpp: Add missing SlowPathCall.h header.
* runtime/AggregateError.cpp: Add missing JSCJSValueInlines.h, JSCellInlines.h, and
JSGlobalObjectInlines.h headers.
* runtime/AggregateErrorConstructor.cpp: Added missing JSCJSValueInlines.h, JSCellInlines.h,
and VMInlines.h headers.
* runtime/AggregateErrorPrototype.cpp: Added missing AggregateError.h, IdentifierInlines.h,
JSCJSValueInlines.h, JSCellInlines.h, JSGlobalObjectInlines.h, and VMInlines.h headers.
* runtime/Intrinsic.h: Added missing wtf/Optional.h header.

Source/WebCore:

No new tests needed.

* css/MediaQueryListEvent.cpp: Add missing wtf/IsoMallocInlines.h header.
* css/MediaQueryMatcher.cpp: Add missing MediaQueryListEvent.h header.
* platform/graphics/FloatQuad.cpp: Add missing wtf/text/TextStream.h header.

Source/WebKit:

* NetworkProcess/NetworkResourceLoadMap.h: Add missing wtf/Function.h header.

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

3 months ago[GTK] Gardening, update expectations after r260356
dpino@igalia.com [Tue, 21 Apr 2020 06:59:14 +0000 (06:59 +0000)]
[GTK] Gardening, update expectations after r260356
https://bugs.webkit.org/show_bug.cgi?id=210786

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

3 months agoClasses marked final should not use protected access specifier
ross.kirsling@sony.com [Tue, 21 Apr 2020 06:11:07 +0000 (06:11 +0000)]
Classes marked final should not use protected access specifier
https://bugs.webkit.org/show_bug.cgi?id=210775

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* API/JSAPIValueWrapper.h:
* API/JSCallbackConstructor.h:
* API/JSCallbackObject.h:
* b3/B3ExtractValue.h:
* bytecode/UnlinkedFunctionExecutable.h:
* inspector/JSGlobalObjectConsoleClient.h:
* inspector/JSInjectedScriptHost.h:
* inspector/JSJavaScriptCallFrame.h:
* jsc.cpp:
* runtime/AggregateError.h:
* runtime/AggregateErrorPrototype.h:
* runtime/ArrayConstructor.h:
* runtime/ArrayPrototype.h:
* runtime/AsyncFunctionPrototype.h:
* runtime/AsyncGeneratorFunctionPrototype.h:
* runtime/AtomicsObject.h:
* runtime/BigIntConstructor.h:
* runtime/BigIntObject.h:
* runtime/BigIntPrototype.h:
* runtime/BooleanConstructor.h:
* runtime/BooleanPrototype.h:
* runtime/ConsoleObject.h:
* runtime/DateConstructor.h:
* runtime/DatePrototype.h:
* runtime/ErrorConstructor.h:
* runtime/ErrorPrototype.h:
* runtime/FileBasedFuzzerAgent.h:
* runtime/FunctionPrototype.h:
* runtime/FunctionRareData.h:
* runtime/GeneratorFunctionPrototype.h:
* runtime/GenericTypedArrayView.h:
* runtime/InspectorInstrumentationObject.h:
* runtime/IntlCollator.h:
* runtime/IntlCollatorConstructor.h:
* runtime/IntlCollatorPrototype.h:
* runtime/IntlDateTimeFormat.h:
* runtime/IntlDateTimeFormatConstructor.h:
* runtime/IntlDateTimeFormatPrototype.h:
* runtime/IntlNumberFormat.h:
* runtime/IntlNumberFormatConstructor.h:
* runtime/IntlNumberFormatPrototype.h:
* runtime/IntlPluralRules.h:
* runtime/IntlPluralRulesConstructor.h:
* runtime/IntlPluralRulesPrototype.h:
* runtime/IntlRelativeTimeFormatConstructor.h:
* runtime/IntlRelativeTimeFormatPrototype.h:
* runtime/JSArrayBuffer.h:
* runtime/JSArrayBufferConstructor.h:
* runtime/JSArrayBufferPrototype.h:
* runtime/JSAsyncGenerator.h:
* runtime/JSBoundFunction.h:
* runtime/JSCustomGetterSetterFunction.h:
* runtime/JSDataView.h:
* runtime/JSDataViewPrototype.h:
* runtime/JSGenerator.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewConstructor.h:
* runtime/JSGenericTypedArrayViewPrototype.h:
* runtime/JSGlobalLexicalEnvironment.h:
* runtime/JSModuleLoader.h:
* runtime/JSModuleNamespaceObject.h:
* runtime/JSNativeStdFunction.h:
* runtime/JSONObject.h:
* runtime/JSObject.h:
* runtime/JSTemplateObjectDescriptor.h:
* runtime/JSTypedArrayViewConstructor.h:
* runtime/JSTypedArrayViewPrototype.h:
* runtime/MathObject.h:
* runtime/NativeExecutable.h:
* runtime/NumberConstructor.h:
* runtime/NumberPrototype.h:
* runtime/ObjectConstructor.h:
* runtime/ObjectPrototype.h:
* runtime/PredictionFileCreatingFuzzerAgent.h:
* runtime/ReflectObject.h:
* runtime/RegExp.h:
* runtime/RegExpConstructor.h:
* runtime/RegExpObject.h:
* runtime/RegExpPrototype.h:
* runtime/StringPrototype.h:
* runtime/Structure.h:
* runtime/Symbol.h:
* runtime/SymbolConstructor.h:
* runtime/SymbolObject.h:
* runtime/SymbolPrototype.h:
* runtime/VMTraps.cpp:
* testRegExp.cpp:
* wasm/WasmBBQPlan.h:
* wasm/WasmLLIntPlan.h:
* wasm/WasmWorklist.cpp:
* wasm/js/JSWebAssembly.h:
* wasm/js/JSWebAssemblyCompileError.h:
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/JSWebAssemblyLinkError.h:
* wasm/js/JSWebAssemblyRuntimeError.h:
* wasm/js/WebAssemblyCompileErrorConstructor.h:
* wasm/js/WebAssemblyCompileErrorPrototype.h:
* wasm/js/WebAssemblyGlobalConstructor.h:
* wasm/js/WebAssemblyGlobalPrototype.h:
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyInstancePrototype.h:
* wasm/js/WebAssemblyLinkErrorConstructor.h:
* wasm/js/WebAssemblyLinkErrorPrototype.h:
* wasm/js/WebAssemblyMemoryConstructor.h:
* wasm/js/WebAssemblyMemoryPrototype.h:
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyModulePrototype.h:
* wasm/js/WebAssemblyRuntimeErrorConstructor.h:
* wasm/js/WebAssemblyRuntimeErrorPrototype.h:
* wasm/js/WebAssemblyTableConstructor.h:
* wasm/js/WebAssemblyTablePrototype.h:
* wasm/js/WebAssemblyWrapperFunction.h:

Source/WebCore:

* Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
* Modules/applepay/ApplePayValidateMerchantEvent.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
* Modules/webaudio/BiquadDSPKernel.h:
* Modules/webaudio/WaveShaperDSPKernel.h:
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* Modules/webxr/WebXRSession.h:
* Modules/webxr/WebXRSystem.h:
* accessibility/AccessibilityARIAGridCell.h:
* accessibility/AccessibleSetValueEvent.h:
* animation/CSSAnimation.h:
* bindings/js/ReadableStream.h:
* bridge/objc/objc_runtime.h:
* bridge/runtime_array.h:
* css/CSSImageSetValue.h:
* html/HTMLKeygenElement.cpp:
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLFramebuffer.h:
* html/canvas/WebGLProgram.h:
* html/canvas/WebGLQuery.h:
* html/canvas/WebGLRenderbuffer.h:
* html/canvas/WebGLSampler.h:
* html/canvas/WebGLSync.h:
* html/canvas/WebGLTransformFeedback.h:
* html/canvas/WebGLUniformLocation.h:
* html/shadow/TextControlInnerElements.h:
* inspector/InspectorStyleSheet.h:
* inspector/WebInjectedScriptManager.h:
* loader/cache/CachedCSSStyleSheet.h:
* page/Frame.h:
* page/FrameView.h:
* page/PageConsoleClient.h:
* page/animation/KeyframeAnimation.h:
* page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h:
* platform/audio/AudioBus.h:
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h:
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* platform/graphics/iso/ISOSchemeInformationBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:
* platform/graphics/iso/ISOTrackEncryptionBox.h:
* platform/graphics/iso/ISOVTTCue.cpp:
* platform/graphics/iso/ISOVTTCue.h:
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mock/mediasource/MockBox.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.h:
* rendering/RenderMultiColumnSet.h:
* rendering/RenderRuby.h:
* rendering/RenderScrollbarPart.h:
* rendering/RenderScrollbarTheme.h:
* rendering/RenderTableCell.h:
* rendering/RenderTableSection.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderView.h:
* rendering/svg/RenderSVGResourceClipper.h:
* svg/SVGTextPathElement.h:
* workers/WorkerConsoleClient.h:
* worklets/Worklet.h:

Source/WebKit:

* Shared/API/APIDictionary.h:
* WebProcess/GPU/media/TextTrackPrivateRemote.h:
* WebProcess/Plugins/Netscape/JSNPMethod.h:
* WebProcess/Plugins/Netscape/JSNPObject.h:

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.h:

Source/WebKitLegacy/win:

* DefaultDownloadDelegate.h:
* DefaultPolicyDelegate.h:
* MemoryStream.h:
* WebApplicationCache.h:
* WebArchive.h:
* WebBackForwardList.h:
* WebCache.h:
* WebCoreStatistics.h:
* WebDataSource.h:
* WebElementPropertyBag.h:
* WebError.h:
* WebFrame.h:
* WebFramePolicyListener.h:
* WebHTMLRepresentation.h:
* WebHistoryItem.h:
* WebJavaScriptCollector.h:
* WebKitClassFactory.h:
* WebKitStatistics.h:
* WebMutableURLRequest.h:
* WebNotification.h:
* WebNotificationCenter.h:
* WebPreferences.h:
* WebResource.h:
* WebURLAuthenticationChallenge.h:
* WebURLCredential.h:
* WebURLProtectionSpace.h:
* WebURLResponse.h:

Tools:

* DumpRenderTree/win/DefaultPolicyDelegate.h:
* DumpRenderTree/win/UIDelegate.h:

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

3 months ago[JSC] Import V8 BigInt tests generated by bigint-tester.py
ysuzuki@apple.com [Tue, 21 Apr 2020 04:51:44 +0000 (04:51 +0000)]
[JSC] Import V8 BigInt tests generated by bigint-tester.py
https://bugs.webkit.org/show_bug.cgi?id=210783

Reviewed by Ross Kirsling.

This patch adds BigInt tests generated by V8 bigint-tester.py, which is modified for JSC use.

* stress/v8-bigint-add.js: Added.
* stress/v8-bigint-and.js: Added.
* stress/v8-bigint-dec.js: Added.
* stress/v8-bigint-div.js: Added.
* stress/v8-bigint-inc.js: Added.
* stress/v8-bigint-mod.js: Added.
* stress/v8-bigint-mul.js: Added.
* stress/v8-bigint-neg.js: Added.
* stress/v8-bigint-not.js: Added.
* stress/v8-bigint-or.js: Added.
* stress/v8-bigint-sar.js: Added.
* stress/v8-bigint-shl.js: Added.
* stress/v8-bigint-sub.js: Added.
* stress/v8-bigint-xor.js: Added.

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

3 months agoTry to fix the build after r260407
timothy_horton@apple.com [Tue, 21 Apr 2020 04:48:51 +0000 (04:48 +0000)]
Try to fix the build after r260407

* wtf/PlatformHave.h:

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

3 months agoFix build failures when video fullscreen and picture-in-picture is disabled
peng.liu6@apple.com [Tue, 21 Apr 2020 04:06:11 +0000 (04:06 +0000)]
Fix build failures when video fullscreen and picture-in-picture is disabled
https://bugs.webkit.org/show_bug.cgi?id=210777

Reviewed by Eric Carlson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".

* Configurations/FeatureDefines.xcconfig:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
(WebCore::VideoLayerManagerObjC::setVideoLayer):
(WebCore::VideoLayerManagerObjC::requiresTextTrackRepresentation const):
(WebCore::VideoLayerManagerObjC::syncTextTrackBounds):
(WebCore::VideoLayerManagerObjC::setTextTrackRepresentation):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".

* Configurations/FeatureDefines.xcconfig:
* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::setVideoFullscreenGravity):
(WebKit::RemoteMediaPlayerProxy::updateVideoFullscreenInlineImage):
(WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
(WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
(WebKit::RemoteMediaPlayerProxy::setBufferingPolicy):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
(WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::prepareForPlayback):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/PlatformEnable.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

3 months agoIntl classes shouldn't need an m_initialized* field
ross.kirsling@sony.com [Tue, 21 Apr 2020 04:04:10 +0000 (04:04 +0000)]
Intl classes shouldn't need an m_initialized* field
https://bugs.webkit.org/show_bug.cgi?id=210764

Reviewed by Darin Adler.

Existing Intl classes each have a field like m_initializedNumberFormat, but this is unnecessary on two levels:
  1. The thing that gets initialized is a unique pointer to an ICU struct, so we can check it directly.
  2. Everywhere we're checking this is redundant since we've already done the same check on the prototype side,
     therefore we can just ASSERT before using said ICU struct.

While we're at it, clean up other stuff like:
  - Move stuff that doesn't need to be part of the class to the CPP file (e.g. UFieldPositionIteratorDeleter).
  - Merge createCollator into initializeCollator (seems like this is probably the oldest code in this space).

* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
(JSC::IntlCollator::compareStrings):
(JSC::IntlCollator::resolvedOptions):
(JSC::IntlCollator::createCollator): Deleted.
* runtime/IntlCollator.h:
* runtime/IntlDateTimeFormat.cpp:
(JSC::UFieldPositionIteratorDeleter::operator() const):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::resolvedOptions):
(JSC::IntlDateTimeFormat::format):
(JSC::partTypeString):
(JSC::IntlDateTimeFormat::formatToParts):
(JSC::IntlDateTimeFormat::UFieldPositionIteratorDeleter::operator() const): Deleted.
(JSC::IntlDateTimeFormat::partTypeString): Deleted.
* runtime/IntlDateTimeFormat.h:
* runtime/IntlNumberFormat.cpp:
(JSC::UFieldPositionIteratorDeleter::operator() const):
(JSC::IntlNumberFormatField::IntlNumberFormatField):
(JSC::IntlNumberFormat::initializeNumberFormat):
(JSC::IntlNumberFormat::format):
(JSC::IntlNumberFormat::resolvedOptions):
(JSC::partTypeString):
(JSC::IntlNumberFormat::formatToParts):
(JSC::IntlNumberFormat::UFieldPositionIteratorDeleter::operator() const): Deleted.
(JSC::IntlNumberFormat::partTypeString): Deleted.
* runtime/IntlNumberFormat.h:
* runtime/IntlPluralRules.cpp:
(JSC::localeData):
(JSC::IntlPluralRules::initializePluralRules):
(JSC::IntlPluralRules::resolvedOptions):
(JSC::IntlPluralRules::select):
(JSC::IntlPRInternal::localeData): Deleted.
* runtime/IntlPluralRules.h:

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

3 months agoSPI clients using fastServerTrustEvaluationEnabled need SPI to inform them of modern...
commit-queue@webkit.org [Tue, 21 Apr 2020 03:23:53 +0000 (03:23 +0000)]
SPI clients using fastServerTrustEvaluationEnabled need SPI to inform them of modern TLS negotiation
https://bugs.webkit.org/show_bug.cgi?id=210533

Patch by Alex Christensen <achristensen@webkit.org> on 2020-04-20
Reviewed by Brady Eidson.

Source/WebKit:

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::didNegotiateModernTLS):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didNegotiateModernTLS):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didNegotiateModernTLS):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didNegotiateModernTLS):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::didNegotiateModernTLS):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didNegotiateModernTLS):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
(-[TLSNavigationDelegate waitForDidNegotiateModernTLS]):
(-[TLSNavigationDelegate _webView:didNegotiateModernTLS:]):
(TestWebKitAPI::TEST):

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

3 months agoAdd document about WTF malloc-related macros
ysuzuki@apple.com [Tue, 21 Apr 2020 02:52:51 +0000 (02:52 +0000)]
Add document about WTF malloc-related macros
https://bugs.webkit.org/show_bug.cgi?id=208367

Reviewed by Anders Carlsson, Simon Fraser, and Darin Adler.

This adds document about WTF malloc-related macros since we have bunch of macros now.

* wtf/FastMalloc.h:

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

3 months agoApp-bound domain behavior should abide by the limitsNavigationsToAppBoundDomains...
katherine_cheney@apple.com [Tue, 21 Apr 2020 02:36:27 +0000 (02:36 +0000)]
App-bound domain behavior should abide by the limitsNavigationsToAppBoundDomains argument in WKWebView configuration
https://bugs.webkit.org/show_bug.cgi?id=210769
<rdar://problem/62065241>

Reviewed by Brent Fulgham.

Source/WebKit:

Changes app-bound domain behavior to be triggered by the value of
limitsNavigationsToAppBoundDomains, a WebView configuration flag.
If the WebView has this parameter set and is currently navigating to
an app bound domain, then app-bound privileges will be granted.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted):
Update this function to return a boolean to indicate whether the
navigation should fail. A failure should occur if a WebView has set
the limitsNavigationsToAppBoundDomains flag and attempts to navigate
away from an app-bound domain.

If the limitsNavigationsToAppBoundDomains value has not been set to
true, maintain non-app bound behavior regardless of whether the domain
is app-bound or not.

(WebKit::WebPageProxy::decidePolicyForNavigationAction):
Check the result of setIsNavigatingToAppBoundDomainAndCheckIfPermitted and fail the
navigation if needed, with both RELEASE logging and an appropriate
error message.

(WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain): Deleted.
* UIProcess/WebPageProxy.h:
Renamed for clarity.

Tools:

Removes any tests for swapping between app-bound and non app-bound
domains as this behavior is no longer supported.

Sets the limitsNavigationsToAppBoundDomains flag for tests which should
have app-bound behavior to maintain test functionality.

Adds 5 new tests for new behavior.

* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
(TEST):
(-[AppBoundDomainDelegate webView:didFinishNavigation:]):
(-[AppBoundDomainDelegate webView:didFailProvisionalNavigation:withError:]):
(-[AppBoundDomainDelegate waitForDidFinishNavigation]):
(-[AppBoundDomainDelegate waitForDidFailProvisionalNavigationError]):

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

3 months agoWK2 Quicklook for attachments
nmouchtaris@apple.com [Tue, 21 Apr 2020 00:27:46 +0000 (00:27 +0000)]
WK2 Quicklook for attachments
https://bugs.webkit.org/show_bug.cgi?id=208891

Reviewed by Darin Adler.

Source/WebCore:

Added to HTMLAttachmentElement to have member image representing
QuickLook thumbnail. Added code to render this image on both iOS and Mac.

No new tests. Test will be added after additions to test infrastructure.

* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::updateThumbnailRepresentation):
Allow setting of thumbnail member.
* html/HTMLAttachmentElement.h:
* rendering/RenderThemeIOS.mm:
Added rendering of image member of attachment element.
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
(WebCore::paintAttachmentIcon):
(WebCore::RenderThemeIOS::paintAttachment):
* rendering/RenderThemeMac.mm:
(WebCore::paintAttachmentIcon):

Source/WebKit:

Allow attachment elements to render QuickLook thumbnail generated
from contents of the file as its icon, rather than the default
icons associated with each mime type.

* Configurations/WebKit.xcconfig:
Link QuickLook thumbnailing framework.
* UIProcess/API/APIAttachment.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
Create thumbnail request and add to queue.
(WebKit::convertNSImageToBitmap):
(WebKit::convertUIImageToBitmap):
(WebKit::WebPageProxy::getQLThumbnailForGenerationRequestion):
(WebKit::WebPageProxy::getQLThumbnailForFileWrapper):
(WebKit::WebPageProxy::getQLThumbnailForAttachment):
* UIProcess/QLThumbnailLoad.h: Added.
* UIProcess/QLThumbnailLoad.mm: Added.
Add code to request thumbnail for file data.
(-[WKQLThumbnailQueueManager init]):
(+[WKQLThumbnailQueueManager sharedInstance]):
(-[WKQLThumbnailLoadOperation initWithAttachment:identifier:]):
(-[WKQLThumbnailLoadOperation initWithURL:identifier:]):
(-[WKQLThumbnailLoadOperation start]):
(-[WKQLThumbnailLoadOperation isAsynchronous]):
(-[WKQLThumbnailLoadOperation isExecuting]):
(-[WKQLThumbnailLoadOperation setExecuting:]):
(-[WKQLThumbnailLoadOperation isFinished]):
(-[WKQLThumbnailLoadOperation setFinished:]):
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateAttachmentIcon):
Set thumbnail of attachment element
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Thumbnail request message.

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

3 months agoUnreviewed macCatalyst build fix.
katherine_cheney@apple.com [Mon, 20 Apr 2020 23:08:51 +0000 (23:08 +0000)]
Unreviewed macCatalyst build fix.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::disableServiceWorkerEntitlementInNetworkProcess):
(WebKit::WebPageProxy::clearServiceWorkerEntitlementOverride):

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

3 months agoAdd more structure-cloning tests for BigInt
ysuzuki@apple.com [Mon, 20 Apr 2020 22:32:59 +0000 (22:32 +0000)]
Add more structure-cloning tests for BigInt
https://bugs.webkit.org/show_bug.cgi?id=210765

Reviewed by Mark Lam.

Source/WebCore:

This patch adds safe-guard for future JSC primitive extension for structure-cloning.
We throw DataCloneError if we see unknown primitive value, which can happen if JSC
extends primitive value.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImmediate):
(WebCore::CloneSerializer::dumpIfTerminal):

LayoutTests:

Add more tests for BigInt outside of WPT (they are already tested in WPT, but this adds more tests).

* fast/dom/Window/window-postmessage-clone-expected.txt:
* fast/dom/Window/window-postmessage-clone.html:
* platform/gtk/fast/dom/Window/window-postmessage-clone-expected.txt:

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

3 months agoScrolling with background-attachment: fixed needs to trigger repaints
simon.fraser@apple.com [Mon, 20 Apr 2020 21:55:38 +0000 (21:55 +0000)]
Scrolling with background-attachment: fixed needs to trigger repaints
https://bugs.webkit.org/show_bug.cgi?id=193893
<rdar://problem/47587017>

Reviewed by Dean Jackson.

Source/WebCore:

When scrolling an overflow scroll which has "background-atttachment:fixed" in the content,
the node will have non-empty synchronous scrolling reasons. In this case we need to
send the scroll to the main thread, and trigger a repaint on scroll.

If handling the wheel event on the scrolling thread determines that the scroll must be sent
to the main thread, EventDispatcher::wheelEvent() does so in the callback function.

To trigger the repaint, RenderLayer::scrollTo() asks the composited layers backing whether
the node has synchronous scrolling reasons; this is implemented by asking the scrolling
coordinator.

Test: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-repaint.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::hasSynchronousScrollingReasons const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::hasSynchronousScrollingReasons const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::hasSynchronousScrollingReasons const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): Return SendToMainThread if this node
needs to do synchronous scrolling.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::needsRepaintOnCompositedScroll const):
(WebCore::RenderLayerBacking::setRequiresOwnBackingStore):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
* rendering/RenderLayerBacking.h:

Source/WebKit:

When scrolling an overflow scroll which has "background-atttachment:fixed" in the content,
the node will have non-empty synchronous scrolling reasons. In this case we need to
send the scroll to the main thread, and trigger a repaint on scroll.

If handling the wheel event on the scrolling thread determines that the scroll must be sent
to the main thread, EventDispatcher::wheelEvent() does so in the callback function.

To trigger the repaint, RenderLayer::scrollTo() asks the composited layers backing whether
the node has synchronous scrolling reasons; this is implemented by asking the scrolling
coordinator.

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):

LayoutTests:

* scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-repaint-expected.html: Added.
* scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-repaint.html: Added.

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

3 months agoDate and Time form controls not showing correct initial values on immediate second...
megan_gardner@apple.com [Mon, 20 Apr 2020 21:45:03 +0000 (21:45 +0000)]
Date and Time form controls not showing correct initial values on immediate second invocation.
https://bugs.webkit.org/show_bug.cgi?id=210613

Reviewed by Wenson Hsieh.

Source/WebKit:

Updating the webprocess with the newly picked time did not update the local store of that data in the
UI process, so when the control was activated a second time, and we skipped the round trip to the
webprocess to get the data we were certian we already had, we did not start the popover in the
correct state. We now update the webprocess and the local UI stored variable at the same time.

Test: fast/forms/ios/time-picker-value-change.html

* UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView timePickerValueHour]):
(-[WKWebView timePickerValueMinute]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView updateValueAsNumberForViewController:]):
(-[WKContentView updateValueForViewController:]):
(-[WKContentView setTimePickerValueToHour:minute:]):
(-[WKContentView timePickerValueHour]):
(-[WKContentView timePickerValueMinute]):
* UIProcess/ios/forms/WKFormInputControl.h:
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKDateTimePicker hour]):
(-[WKDateTimePicker minute]):
(-[WKDateTimePicker _dateChangedSetAsNumber]):
(-[WKDateTimePicker _dateChangedSetAsString]):
(-[WKDateTimePicker setHour:minute:]):
(-[WKFormInputControl setTimePickerHour:minute:]):
(-[WKFormInputControl timePickerValueHour]):
(-[WKFormInputControl timePickerValueMinute]):
(-[WKDateTimePopover setHour:minute:]):
(-[WKDateTimePopover hour]):
(-[WKDateTimePopover minute]):

Tools:

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::timePickerValueHour const):
(WTR::UIScriptController::timePickerValueMinute const):
* WebKitTestRunner/ios/UIScriptControllerIOS.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::timePickerValueHour const):
(WTR::UIScriptControllerIOS::timePickerValueMinute const):

LayoutTests:

* fast/forms/ios/time-picker-value-change-expected.txt: Added.
* fast/forms/ios/time-picker-value-change.html: Added.
* resources/ui-helper.js:
(window.UIHelper.timerPickerValues):

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

3 months agoTry to fix the macCatalyst build after r260366
timothy_horton@apple.com [Mon, 20 Apr 2020 21:29:18 +0000 (21:29 +0000)]
Try to fix the macCatalyst build after r260366

* UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h:

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

3 months agoSkip tests related with missing reftest-wait support for imported WPT tests.
clopez@igalia.com [Mon, 20 Apr 2020 21:17:53 +0000 (21:17 +0000)]
Skip tests related with missing reftest-wait support for imported WPT tests.

Unreviewed gardening.

Also fix a few typos on the bug numbers for the expectations.

* TestExpectations:
* platform/gtk/TestExpectations:

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

3 months agoFTL doesn't observe the use kind of CheckIsConstant's child1
keith_miller@apple.com [Mon, 20 Apr 2020 21:05:54 +0000 (21:05 +0000)]
FTL doesn't observe the use kind of CheckIsConstant's child1
https://bugs.webkit.org/show_bug.cgi?id=210763

Reviewed by Yusuke Suzuki.

Somehow, this didn't get added when I changed CheckIsConstant and didn't show up
when I tested r260377 because I tested in release. Fortunately, the produced
DFG IR will be the same.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCheckIsConstant):

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

3 months agoMSVC: LayoutUnits.h(248): warning C4245: 'argument': conversion from 'const int'...
Hironori.Fujii@sony.com [Mon, 20 Apr 2020 20:38:44 +0000 (20:38 +0000)]
MSVC: LayoutUnits.h(248): warning C4245: 'argument': conversion from 'const int' to 'size_t', signed/unsigned mismatch
https://bugs.webkit.org/show_bug.cgi?id=210592

Reviewed by Zalan Bujtas.

* layout/LayoutUnits.h:
(WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue):
Use std::numeric_limits<size_t>::max() for empty and deleted
values instead of WebCore::intMinForLayoutUnit.

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

3 months agoText manipulation sometimes fails to replace text in title elements
wenson_hsieh@apple.com [Mon, 20 Apr 2020 20:19:54 +0000 (20:19 +0000)]
Text manipulation sometimes fails to replace text in title elements
https://bugs.webkit.org/show_bug.cgi?id=210750
<rdar://problem/61066103>

Reviewed by Tim Horton and Darin Adler.

Source/WebCore:

Internal clients using WebKit text manipulation APIs currently fail to replace text in title and option elements
in the case where text manipulation has been completed with more than one token. These are elements for which we
want to replace the entire text as a single token, even if the text manipulation client ends up breaking the
token into multiple chunks.

To handle this case, pull the `title || option` check out into a helper function, and consult it when completing
text manipulation in the case where the manipulation data lacks either start or end positions. If
`canPerformTextManipulationByReplacingEntireTextContent` is true and there are multiple replacement tokens,
allow ourselves to process the replacement by combining the replacement tokens into a space-separated string.

Test: TextManipulation.CompleteTextManipulationShouldReplaceTextContentWithMultipleTokens

* editing/TextManipulationController.cpp:
(WebCore::canPerformTextManipulationByReplacingEntireTextContent):
(WebCore::TextManipulationController::observeParagraphs):
(WebCore::TextManipulationController::replace):

Tools:

Add a new API test to verify that a single title or option element may be replaced with multiple tokens, as long
as all the token identifiers match.

* TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:

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

3 months agoThe rect for the primary screen should be retrieved on the main thread.
andresg_22@apple.com [Mon, 20 Apr 2020 20:11:09 +0000 (20:11 +0000)]
The rect for the primary screen should be retrieved on the main thread.
https://bugs.webkit.org/show_bug.cgi?id=210760

Reviewed by Chris Fleizach.

- Call to screenRectForPrimaryScreen is dispatched to main thread.
- This value is cached since it is very unlikely to change in normal
usage and this would avoid hitting the main thread repeatedly.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper primaryScreenHeight]):

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

3 months agoFix build when !ENABLE(RESOURCE_LOAD_STATISTICS)
stephan.szabo@sony.com [Mon, 20 Apr 2020 20:09:47 +0000 (20:09 +0000)]
Fix build when !ENABLE(RESOURCE_LOAD_STATISTICS)
https://bugs.webkit.org/show_bug.cgi?id=210757

Reviewed by Ross Kirsling.

Build fix, no new tests

* NetworkProcess/NetworkDataTask.cpp:
Add ENABLE(RESOURCE_LOAD_STATISTICS) around block
using NetworkSession functions only declared when
that is enabled.

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

3 months agoWhen SpeculativeLoadManager is destroyed, properly clean up its PendingFrameLoads
commit-queue@webkit.org [Mon, 20 Apr 2020 20:04:49 +0000 (20:04 +0000)]
When SpeculativeLoadManager is destroyed, properly clean up its PendingFrameLoads
https://bugs.webkit.org/show_bug.cgi?id=210759
<rdar://problem/62056856>

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

Recent work on the resourceLoadStatistics layout tests increased the amount we swap out the WebsiteDataStore.
When this happens, the NetworkSession is eventually destroyed in the NetworkProcess, sometimes when running the next test.
An assertion was firing in the PendingFrameLoad destructor because it hadn't been marked as complete when it was destroyed.
Rather than remove the assertion, when we destroy the SpeculativeLoadManager (which only happens when a WebsiteDataStore
is destroyed) during a speculative pending frame load, just mark the pending frame load as complete because it is being cancelled.
Marking the pending frame load as complete can tell the SpeculativeLoadManager to mutate m_pendingFrameLoads, which we don't want
to do while iterating, so copy the RefPtrs into a Vector first then iterate that to get them all.

This fixes an assertion that was sometimes hit in http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
but only after running other tests that had initiated speculative pending frame loads.  This was ostensibly started by r260322 but is quite unrelated.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::~SpeculativeLoadManager):

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

3 months ago[GTK][WPE] Gardening, update expectations after r260322
dpino@igalia.com [Mon, 20 Apr 2020 19:56:08 +0000 (19:56 +0000)]
[GTK][WPE] Gardening, update expectations after r260322
https://bugs.webkit.org/show_bug.cgi?id=210761

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

3 months agoClean and merge test expectations for WPT tests for Intersection Observer v2.
clopez@igalia.com [Mon, 20 Apr 2020 19:44:07 +0000 (19:44 +0000)]
Clean and merge test expectations for WPT tests for Intersection Observer v2.

Unreviewed gardening.

Merge the expectations for the tests cross-origin-effects.sub.html
and cross-origin-occlusion.sub.html on the common TestExpectations file.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/wpe/TestExpectations:

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

3 months ago[PlayStation] Fix build after r260277
stephan.szabo@sony.com [Mon, 20 Apr 2020 19:37:03 +0000 (19:37 +0000)]
[PlayStation] Fix build after r260277
https://bugs.webkit.org/show_bug.cgi?id=210756

Reviewed by Don Olmstead.

Source/WebKit:

Build fix, no new tests.

* PlatformPlayStation.cmake:

Tools:

* TestWebKitAPI/PlatformPlayStation.cmake:

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

3 months agoWeb Inspector: the filter bar in the navigation sidebar should respect the global...
drousso@apple.com [Mon, 20 Apr 2020 19:35:22 +0000 (19:35 +0000)]
Web Inspector: the filter bar in the navigation sidebar should respect the global search settings
https://bugs.webkit.org/show_bug.cgi?id=210679

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype.updateFilter):

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

3 months ago[WebXR] Update WebXRSession and WebXRSystem interfaces
svillar@igalia.com [Mon, 20 Apr 2020 19:21:18 +0000 (19:21 +0000)]
[WebXR] Update WebXRSession and WebXRSystem interfaces
https://bugs.webkit.org/show_bug.cgi?id=210553

Reviewed by Žan Doberšek.

LayoutTests/imported/w3c:

* web-platform-tests/webxr/idlharness.https.window-expected.txt: Added.

Source/WebCore:

Update WebXRSession and WebXRSystem to the latest changes in the specs.

* Modules/webxr/WebXRSession.idl: Added 3 new events.
* Modules/webxr/WebXRSystem.idl: Interface name is XR not XRSystem.
* bindings/js/WebCoreBuiltinNames.h: Renamed macro.
* dom/EventNames.h: Added 3 new events.

LayoutTests:

* platform/wpe/TestExpectations: Mark idlharness.https.window.html test as Passed.

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

3 months ago[JSC] Skip test262 for non-safe-integer range BigIntConstructor
ysuzuki@apple.com [Mon, 20 Apr 2020 19:11:46 +0000 (19:11 +0000)]
[JSC] Skip test262 for non-safe-integer range BigIntConstructor
https://bugs.webkit.org/show_bug.cgi?id=210749

Reviewed by Keith Miller.

JSTests:

We skip test262 test/built-ins/BigInt/constructor-integer.js for now. As it is shown in old test262 JSTests/test262/expectations.yaml,
this test was failing before BigInt flag is enabled. And new BigInt patch changes error message while we are failing in the same way.
While we implemented BigInt, this test is based on spec change introduced[1], and we are not implementing this. So we mark it skipped,
as it is skipped before BigInt is enabled.

[1]: https://github.com/tc39/proposal-bigint/pull/138

* test262/config.yaml:

Source/JavaScriptCore:

* runtime/BigIntConstructor.cpp:
(JSC::callBigIntConstructor):

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

3 months agoREGRESSION (r253987): StringImpl::adopt(Vector&&) copies only half of the characters...
darin@apple.com [Mon, 20 Apr 2020 19:10:00 +0000 (19:10 +0000)]
REGRESSION (r253987): StringImpl::adopt(Vector&&) copies only half of the characters in the Vector when copying across malloc zones
https://bugs.webkit.org/show_bug.cgi?id=210736

Reviewed by Yusuke Suzuki.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::replace): Use copyCharacters instead of memcpy.

* wtf/text/StringImpl.h: Use std::is_same_v instead of std::is_same.
(WTF::StringImpl::StringImpl): Use copyCharacters instead of memcpy.
Also drop C-style cast to cast away const.
(WTF::StringImpl::adopt): Don't even try to adopt across malloc zones.

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

3 months agoSending beacons when Fetch KeepAlive feature is disabled crashes the WebProcess
cdumez@apple.com [Mon, 20 Apr 2020 18:43:45 +0000 (18:43 +0000)]
Sending beacons when Fetch KeepAlive feature is disabled crashes the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=210753
<rdar://problem/61896221>

Reviewed by Geoffrey Garen.

Source/WebCore:

Test: http/wpt/beacon/beacon-legacy-code-path.html

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setFetchAPIKeepAliveEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Add internal settings to disable Fetch Keep Alive for layout testing.

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::startPingLoad):
Make sure NetworkResourceLoadParameters's webPageProxyID / webPageID / webFrameID are properly
initialized before sending the IPC or IPC decoding will fail.

LayoutTests:

Add layout test coverage.

* http/wpt/beacon/beacon-legacy-code-path-expected.txt: Added.
* http/wpt/beacon/beacon-legacy-code-path.html: Added.

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

3 months ago[IPC hardening] Use ObjectIdentifier<> for geolocationID
ddkilzer@apple.com [Mon, 20 Apr 2020 18:41:29 +0000 (18:41 +0000)]
[IPC hardening] Use ObjectIdentifier<> for geolocationID
<https://webkit.org/b/210680>
<rdar://problem/58892340>

Reviewed by Chris Dumez.

Replace uses of uint64_t with GeolocationIdentifier.

* Scripts/webkit/messages.py:
* UIProcess/GeolocationIdentifier.h: Add.
* UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
(WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
(WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
* UIProcess/GeolocationPermissionRequestManagerProxy.h:
* UIProcess/GeolocationPermissionRequestProxy.cpp:
(WebKit::GeolocationPermissionRequestProxy::GeolocationPermissionRequestProxy):
* UIProcess/GeolocationPermissionRequestProxy.h:
(WebKit::GeolocationPermissionRequestProxy::create):
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
(WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation):
(WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision):
(WebKit::generateGeolocationID): Delete.
- Replace with GeolocationIdentifier::generate().
* WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceiveGeolocationPermissionDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

3 months agoMediaPlayerPrivateMediaStreamAVFObjC should start play a newly added audio track...
youenn@apple.com [Mon, 20 Apr 2020 18:16:57 +0000 (18:16 +0000)]
MediaPlayerPrivateMediaStreamAVFObjC should start play a newly added audio track if it is playing
https://bugs.webkit.org/show_bug.cgi?id=210740

Reviewed by Eric Carlson.

Source/WebCore:

Before the patch, MediaPlayerPrivateMediaStreamAVFObjC was not calling play on the audio renderer when the audio renderer
was added after the MediaPlayerPrivateMediaStreamAVFObjC was asked to play.
This patch makes it so that, on configuration of an audio track, it will be asked to play if its MediaPlayerPrivateMediaStreamAVFObjC is playing.
Add internals API to be able to write a test.

Test: fast/mediastream/play-newly-added-audio-track.html

* html/track/AudioTrack.h:
* html/track/AudioTrack.idl:
* platform/graphics/AudioTrackPrivate.h:
(WebCore::AudioTrackPrivate::isBackedByMediaStreamTrack const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
* platform/mediastream/AudioTrackPrivateMediaStream.cpp:
(WebCore::AudioTrackPrivateMediaStream::play):
* platform/mediastream/AudioTrackPrivateMediaStream.h:
(isType):
* testing/Internals.cpp:
(WebCore::Internals::isMockRealtimeMediaSourceCenterEnabled):
(WebCore::Internals::shouldAudioTrackPlay):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/mediastream/play-newly-added-audio-track-expected.txt: Added.
* fast/mediastream/play-newly-added-audio-track.html: Added.

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

3 months agoUse a WeakHashSet to store MediaStreamPrivate observers
youenn@apple.com [Mon, 20 Apr 2020 18:14:37 +0000 (18:14 +0000)]
Use a WeakHashSet to store MediaStreamPrivate observers
https://bugs.webkit.org/show_bug.cgi?id=210494

Reviewed by Eric Carlson.

Remove observers from the MediaStream and migrate existing client (MediaRecorder) to MediaStreamPrivate::Observer.
Make use of WeakHashSet in MediaStreamPrivate to improve robustness of the code.
Any time the MediaStreamPrivate tracks are modified, observers will be notified.
MediaStream needs now to decide when to send an event when its MediaStreamPrivate notifies of new/deleted tracks,
Modernize a bit the code to use more references.
Covered by existing tests.

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::handleTrackChange):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::createTrackPrivateVector):
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::addTrack):
(WebCore::MediaStream::removeTrack):
(WebCore::MediaStream::getTrackById):
(WebCore::MediaStream::didAddTrack):
(WebCore::MediaStream::didRemoveTrack):
(WebCore::MediaStream::addTrackFromPlatform):
(WebCore::MediaStream::internalAddTrack):
(WebCore::MediaStream::internalTakeTrack):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::MediaStreamPrivate):
(WebCore::MediaStreamPrivate::addObserver):
(WebCore::MediaStreamPrivate::removeObserver):
(WebCore::MediaStreamPrivate::forEachObserver):
(WebCore::MediaStreamPrivate::computeActiveState):
(WebCore::MediaStreamPrivate::updateActiveState):
(WebCore::MediaStreamPrivate::addTrack):
(WebCore::MediaStreamPrivate::removeTrack):
(WebCore::MediaStreamPrivate::trackEnded):
* platform/mediastream/MediaStreamPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::removeMediaStreamTrack):

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

3 months agofast/layoutformattingcontext/simple-absolute-positioned-replaced-inline-element-with...
zalan@apple.com [Mon, 20 Apr 2020 18:11:24 +0000 (18:11 +0000)]
fast/layoutformattingcontext/simple-absolute-positioned-replaced-inline-element-with-percentage-height.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=210754

Unreviewed test gardening.

Let's not use subframe layout in LFC tests for now.

* fast/layoutformattingcontext/simple-absolute-positioned-replaced-inline-element-with-percentage-height.html:

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

3 months agoFix CheckIsConstant for non-constant values and checking for empty
keith_miller@apple.com [Mon, 20 Apr 2020 18:06:26 +0000 (18:06 +0000)]
Fix CheckIsConstant for non-constant values and checking for empty
https://bugs.webkit.org/show_bug.cgi?id=210752

Reviewed by Saam Barati.

We need to make sure that we only have one speculated type if our value
is empty.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

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

3 months agoWeb Inspector: removing a `WI.TreeElement` in a `WI.NavigationSidebar` doesn't check...
drousso@apple.com [Mon, 20 Apr 2020 18:02:03 +0000 (18:02 +0000)]
Web Inspector: removing a `WI.TreeElement` in a `WI.NavigationSidebar` doesn't check if the `WI.TreeOutline` still matches the current filter
https://bugs.webkit.org/show_bug.cgi?id=210672

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype.createContentTreeOutline):
(WI.NavigationSidebarPanel.prototype.updateFilter):
(WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults):
(WI.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
(WI.NavigationSidebarPanel.prototype._handleTreeElementRemoved): Added.

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

3 months agoVersioning.
alancoon@apple.com [Mon, 20 Apr 2020 17:59:42 +0000 (17:59 +0000)]
Versioning.

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

3 months ago[iOS] Refactor WebKit media playback process assertion logic to minimize chances...
cdumez@apple.com [Mon, 20 Apr 2020 17:48:42 +0000 (17:48 +0000)]
[iOS] Refactor WebKit media playback process assertion logic to minimize chances of leaking them
https://bugs.webkit.org/show_bug.cgi?id=210670

Reviewed by Geoffrey Garen.

Refactor WebKit media playback process assertion logic to minimize chances of leaking them. In particular,
the following changes were made:
1. Instead of the WebProcessPool having a HashMap of media playback process assertions for
   the WebProcess, we now store the assertion on the WebProcessProxy object itself. This is
   less likely to get out of sync and leak.
2. Add a RefCounter to the WebProcessPool to count WebProcesses that have audible media.
   Whenever a WebProcess starts or stops playing audible media, it merely grabs a RefCounter
   token or releases it. The WebProcessPool relies on this counter to decide whether or not
   to take a media playback assertion on behalf of the UIProcess. Since this is token-based
   and the token is stored on the WebProcessProxy object, it makes it less likely to leak
   the assertion.
3. The WebProcessProxy object now has a AudibleMediaActivity data structure wrapping both
   its media playback assertion and its WebProcessWithAudibleMediaToken that it got from
   the WebProcessPool. When the WebProcess shuts down (normally or due to crash/termination),
   we make sure to clear this data structure.
4. Make sure that the WebProcessProxy updates its AudibleMediaActivity whenever a page is
   removed from the WebProcess.

* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::m_webProcessWithAudibleMediaCounter):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::webProcessWithAudibleMediaToken const):
(WebKit::WebProcessPool::updateAudibleMediaAssertions):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::updateAudibleMediaAssertions):
* UIProcess/WebProcessProxy.h:

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

3 months ago<rdar://problem/62059046>
katherine_cheney@apple.com [Mon, 20 Apr 2020 17:15:28 +0000 (17:15 +0000)]
<rdar://problem/62059046>

Unreviewed macCatalyst build fix.

* NetworkProcess/NetworkProcess.messages.in:

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

3 months agoContent disappears on CSS parallax example
simon.fraser@apple.com [Mon, 20 Apr 2020 17:14:51 +0000 (17:14 +0000)]
Content disappears on CSS parallax example
https://bugs.webkit.org/show_bug.cgi?id=210732
Source/WebCore:

<rdar://problem/61997636>

Reviewed by Darin Adler.

If scrolling affects the computation of coverage rect of a TiledBacking, we plumb
that expanded coverage back into TransformState which is maintained during GraphicsLayer flushing,
and it's used to compute coverage rect for descendants.

It's passed into TransformState::setLastPlanarSecondaryQuad(), which has to map it back into
the coordinate system of the last flattening ancestor. However, TransformState::mapQuad()
had a missing return and the quad mapping was wrong. The new code is now the same as
TransformState::mappedPoint() (you can see where the copy/paste error came from).

Test: compositing/tiling/coverage-adjustment-secondary-quad-mapping.html

* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::mapQuad const):
(WebCore::TransformState::flattenWithTransform):

LayoutTests:

Reviewed by Darin Adler.

* compositing/tiling/coverage-adjustment-secondary-quad-mapping-expected.txt: Added.
* compositing/tiling/coverage-adjustment-secondary-quad-mapping.html: Added.
* platform/ios-wk2/compositing/tiling/coverage-adjustment-secondary-quad-mapping-expected.txt: Added.
* platform/mac-wk1/compositing/tiling/coverage-adjustment-secondary-quad-mapping-expected.txt: Added.

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

3 months ago[LFC][TFC] Add support for border-collapse: collapse.
zalan@apple.com [Mon, 20 Apr 2020 16:16:19 +0000 (16:16 +0000)]
[LFC][TFC] Add support for border-collapse: collapse.
https://bugs.webkit.org/show_bug.cgi?id=210747

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-flex-width-border-collapse.html

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::ensureTableGrid):

LayoutTests:

* fast/layoutformattingcontext/table-flex-width-border-collapse.html: Added.

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

3 months agoOversized caret and selection rects in text fields on ganji.com and netflix.com/login
wenson_hsieh@apple.com [Mon, 20 Apr 2020 15:53:48 +0000 (15:53 +0000)]
Oversized caret and selection rects in text fields on ganji.com and netflix.com/login
https://bugs.webkit.org/show_bug.cgi?id=210622
<rdar://problem/45945636>

Reviewed by Darin Adler.

Source/WebCore:

Currently, selection and caret rects in text fields on some web pages can be excessively tall. This patch makes
a small adjustment to allow the top of the caret or selection rect to snap to the top of the inline box instead
of being at the end of the previous line, in the case where there is no previous inline box.

In the case where we compute the caret rect for an empty renderer (i.e. no children), we make an additional
tweak so that the caret rect's height is based on the computed font height instead of line height, and then we
ensure that the caret is (logically) vertically centered.

See below for more details.

Test: editing/selection/selection-and-caret-do-not-extend-to-line-height.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):

Specify ForHitTesting::Yes when asking for selectionTop().

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):

Use FontMetric's height when computing the height of the caret rect, and then center it vertically in the
renderer.

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):

Specify ForHitTesting::Yes when asking for selectionTop(). See below for more information.

* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::positionForPoint const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::selectionTop const):

When computing selectionTop(), we currently fall back to using the top of the containing RenderBlockFlow
(`blockFlow().borderAndPaddingBefore()`) in the case where there is no previous root box. However, this can lead
to selection and caret rects being taller than expected; instead, we can use the max of the `selectionTop`
(that is, the top of the line box, adjusted for annotations) and the top of the RenderBlockFlow. This has the
effect of allowing the caret and selection to visually snap to the top of a run of text, provided there is not
already a line of text that precedes it. Taking the maximum of the two values ensures that we don't
unintentionally make the selection or caret rects even larger, if the line top is above the top of the block.

Note that we also avoid shrinking the selection and caret rects when hit-testing renderers for positions and
ranges. This allows users to still click and drag to select text in the extra line-height area above a piece of
text, even if the selection is only painted over the text (and not in the region containing the line-height).
This behavior was established in the fix for webkit.org/b/14911, and is covered by the layout test
`editing/selection/inline-closest-leaf-child.html`.

* rendering/RootInlineBox.h:

Tools:

Rebaseline some expected selection and caret rects in some iOS API tests.

* TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm:
(TEST):
* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):

LayoutTests:

Rebaseline existing tests, and add a new test to verify that caret and selection rects do not extend to match
the line height in empty and non-empty editable elements, in both horizontal and vertical writing modes.

* editing/selection/ios/absolute-selection-after-scroll-expected.txt:
* editing/selection/ios/absolute-selection-after-scroll.html:
* editing/selection/ios/change-selection-after-tapping-focused-element-expected.txt:
* editing/selection/ios/change-selection-after-tapping-focused-element.html:
* editing/selection/ios/fixed-selection-after-scroll-expected.txt:
* editing/selection/ios/fixed-selection-after-scroll.html:
* editing/selection/ios/selection-after-changing-text-with-callout-menu-expected.txt:
* editing/selection/ios/selection-after-changing-text-with-callout-menu.html:
* editing/selection/ios/selection-handles-after-touch-end-expected.txt:
* editing/selection/ios/update-selection-after-overflow-scroll-expected.txt:
* editing/selection/ios/update-selection-after-overflow-scroll.html:
* editing/selection/selection-and-caret-do-not-extend-to-line-height-expected.txt: Added.
* editing/selection/selection-and-caret-do-not-extend-to-line-height.html: Added.
* fast/repaint/focus-ring-repaint-expected.txt:
* platform/ios/editing/selection/ios/selection-handles-after-touch-end-expected.txt: Removed.

Delete this redundant test expectation.

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

3 months agoUse #import instead of #include in Objective-C and don't use #pragma once
darin@apple.com [Mon, 20 Apr 2020 15:32:36 +0000 (15:32 +0000)]
Use #import instead of #include in Objective-C and don't use #pragma once
https://bugs.webkit.org/show_bug.cgi?id=210724

Reviewed by David Kilzer.

Source/JavaScriptCore:

* API/JSAPIWrapperObject.mm:
* API/JSContext.h:
* API/JSContext.mm:
* API/JSScriptInternal.h:
* API/JSValue.mm:
* API/JSVirtualMachine.mm:
* API/JSVirtualMachinePrivate.h:
* API/JSWrapperMap.mm:
* API/ObjCCallbackFunction.mm:
* API/tests/CurrentThisInsideBlockGetterTest.mm:
More #import, less #pragma once.

Source/WebCore:

* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::sansSerifTraditionalHanFontFamily): Deleted.
(WebCore::sansSerifSimplifiedHanFontFamily): Deleted.
(WebCore::SettingsBase::initializeDefaultFontFamilies): Just use font name
strings directly since there are no conditionals any more.

* Modules/applepay/PaymentRequestValidator.mm:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* bridge/objc/WebScriptObjectPrivate.h:
* bridge/objc/objc_class.mm:
* bridge/testbindings.mm:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
* editing/cocoa/WebArchiveResourceFromNSAttributedString.h:
* editing/cocoa/WebArchiveResourceWebResourceHandler.h:
* editing/cocoa/WebContentReaderCocoa.mm:
* history/mac/HistoryItemMac.mm:
* loader/cocoa/DiskCacheMonitorCocoa.mm:
* loader/cocoa/SubresourceLoaderCocoa.mm:
* loader/mac/ResourceLoaderMac.mm:
* page/cocoa/MemoryReleaseCocoa.mm:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
* page/cocoa/ResourceUsageThreadCocoa.mm:
* page/ios/WebEventRegion.h:
* page/mac/ChromeMac.mm:
* page/mac/EventHandlerMac.mm:
* page/mac/WheelEventDeltaFilterMac.mm:
* page/scrolling/cocoa/ScrollingStateNode.mm:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingThreadMac.mm:
* page/scrolling/mac/ScrollingTreeMac.mm:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
* platform/audio/mac/AudioSampleDataSource.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/cocoa/PasteboardCocoa.mm:
* platform/cocoa/ScrollSnapAnimatorState.mm:
* platform/cocoa/SystemVersion.mm:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* platform/graphics/ca/cocoa/WebSystemBackdropLayer.h:
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
* platform/graphics/ca/cocoa/WebVideoContainerLayer.h:
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
* platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
* platform/graphics/cocoa/WebGPULayer.h:
* platform/graphics/cocoa/WebGPULayer.mm:
* platform/graphics/cv/ImageRotationSessionVT.mm:
* platform/graphics/cv/ImageTransferSessionVT.mm:
* platform/graphics/cv/TextureCacheCV.mm:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
* platform/graphics/mac/FloatPointMac.mm:
* platform/graphics/mac/FloatSizeMac.mm:
* platform/graphics/mac/IntPointMac.mm:
* platform/graphics/mac/IntSizeMac.mm:
* platform/graphics/mac/WebLayer.h:
* platform/graphics/mac/WebLayer.mm:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileGrid.mm:
* platform/ios/LegacyTileGridTile.mm:
* platform/ios/LegacyTileLayer.h:
* platform/ios/LegacyTileLayer.mm:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/LocalCurrentTraitCollection.mm:
* platform/ios/LocalizedDeviceModel.mm:
* platform/ios/ScrollbarThemeIOS.mm:
* platform/ios/WebCoreMotionManager.h:
* platform/ios/WebItemProviderPasteboard.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/mac/LocalCurrentGraphicsContext.mm:
* platform/mac/LocalDefaultSystemAppearance.mm:
* platform/mac/LoggingMac.mm:
* platform/mac/PlatformEventFactoryMac.mm:
* platform/mac/RemoteCommandListenerMac.mm:
* platform/mac/ScrollAnimatorMac.mm:
* platform/mac/SerializedPlatformDataCueMac.mm:
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
* platform/mac/WebCoreFullScreenWarningView.h:
* platform/mac/WebCoreFullScreenWarningView.mm:
* platform/mac/WebCoreFullScreenWindow.h:
* platform/mac/WebCoreObjCExtras.mm:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
* platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm:
* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
* platform/mediastream/mac/RealtimeVideoUtilities.mm:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
* platform/network/cocoa/CertificateInfoCocoa.mm:
* platform/network/cocoa/WebCoreNSURLSession.h:
* platform/network/mac/BlobDataFileReferenceMac.mm:
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/SynchronousLoaderClient.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/text/cocoa/LocaleCocoa.mm:
* testing/ServiceWorkerInternals.mm:
* testing/cocoa/WebViewVisualIdentificationOverlay.h:
More #import, less #pragma once.

Source/WebCore/PAL:

* pal/cocoa/AppSSOSoftLink.mm:
* pal/cocoa/FileSizeFormatterCocoa.mm:
* pal/cocoa/UsageTrackingSoftLink.mm:
* pal/ios/ManagedConfigurationSoftLink.mm:
* pal/ios/UIKitSoftLink.mm:
* pal/mac/LookupSoftLink.mm:
* pal/spi/cocoa/AVFoundationSPI.h:
* pal/spi/cocoa/AccessibilitySupportSoftLink.cpp:
* pal/spi/cocoa/AppSSOSPI.h:
* pal/spi/cocoa/AuthKitSPI.h:
* pal/spi/cocoa/DataDetectorsCoreSPI.h:
* pal/spi/cocoa/LaunchServicesSPI.h:
* pal/spi/cocoa/NSAccessibilitySPI.h:
* pal/spi/cocoa/NSAttributedStringSPI.h:
* pal/spi/cocoa/NSProgressSPI.h:
* pal/spi/cocoa/NSURLDownloadSPI.h:
* pal/spi/cocoa/NSUserDefaultsSPI.h:
* pal/spi/cocoa/NSXPCConnectionSPI.h:
* pal/spi/cocoa/PassKitSPI.h:
* pal/spi/cocoa/SecKeyProxySPI.h:
* pal/spi/ios/CelestialSPI.h:
* pal/spi/mac/DataDetectorsSPI.h:
* pal/spi/mac/NSColorWellSPI.h:
* pal/spi/mac/NSGraphicsSPI.h:
* pal/spi/mac/NSPopoverColorWellSPI.h:
* pal/spi/mac/NSScrollerImpSPI.h:
More #import, less #pragma once.

Source/WebKit:

* mac/MigrateHeadersFromWebKitLegacy.make: Delete stale MemoryMeasure.h
forwarding header from incremental WebKit builds and ignore when generating
new forwarding headers.

* Platform/foundation/LoggingFoundation.mm:
(WebKit::logLevelString): Use string directly instead of a named constant.

* UIProcess/mac/WebColorPickerMac.h: Mark class final.

* GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:
* NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
* NetworkProcess/webrtc/NetworkRTCProvider.mm:
* Platform/spi/Cocoa/DeviceManagementSPI.h:
* Platform/spi/Cocoa/LocalAuthenticationSPI.h:
* Platform/spi/Cocoa/NearFieldSPI.h:
* Platform/spi/Cocoa/SafeBrowsingSPI.h:
* Platform/spi/mac/AppKitSPI.h:
* Shared/API/Cocoa/RemoteObjectInvocation.mm:
* Shared/API/Cocoa/WKMain.mm:
* Shared/APIWebArchive.mm:
* Shared/APIWebArchiveResource.mm:
* Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm:
* Shared/Cocoa/LoadParametersCocoa.mm:
* Shared/Cocoa/SandboxInitialiationParametersCocoa.mm:
* Shared/Cocoa/WKNSData.mm:
* Shared/DocumentEditingContext.mm:
* Shared/Plugins/mac/PluginSandboxProfile.mm:
* Shared/RemoteLayerTree/WKAnimationDelegate.h:
* Shared/UserInterfaceIdiom.mm:
* Shared/ios/WebIconUtilities.mm:
* Shared/mac/CodeSigning.mm:
* Shared/mac/ColorSpaceData.mm:
* Shared/mac/HangDetectionDisablerMac.mm:
* Shared/mac/PDFKitImports.mm:
* UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
* UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
* UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
* UIProcess/API/Cocoa/WKContentRuleList.mm:
* UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:
* UIProcess/API/Cocoa/_WKApplicationManifest.h:
* UIProcess/API/Cocoa/_WKAttachment.h:
* UIProcess/API/Cocoa/_WKResourceLoadInfoInternal.h:
* UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstPartyInternal.h:
* UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdPartyInternal.h:
* UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm:
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
* UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponseInternal.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
* UIProcess/Authentication/mac/WebCredentialMac.mm:
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
* UIProcess/Cocoa/IconLoadingDelegate.mm:
* UIProcess/Cocoa/MediaUtilities.mm:
* UIProcess/Cocoa/PreferenceObserver.h:
* UIProcess/Cocoa/PreferenceObserver.mm:
* UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.h:
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
* UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h:
* UIProcess/Cocoa/WKEditCommand.h:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
* UIProcess/Inspector/mac/WKInspectorViewController.h:
* UIProcess/Inspector/mac/WKInspectorWKWebView.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
* UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* UIProcess/ios/WKDeferringGestureRecognizer.h:
* UIProcess/ios/WKHighlightLongPressGestureRecognizer.h:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
* UIProcess/ios/forms/WKDatePickerViewController.h:
* UIProcess/ios/forms/WKDatePickerViewController.mm:
* UIProcess/ios/forms/WKFocusedFormControlView.h:
* UIProcess/ios/forms/WKFocusedFormControlView.mm:
* UIProcess/ios/forms/WKFormColorPicker.mm:
* UIProcess/ios/forms/WKNumberPadViewController.h:
* UIProcess/ios/forms/WKNumberPadViewController.mm:
* UIProcess/ios/forms/WKQuickboardListViewController.h:
* UIProcess/ios/forms/WKQuickboardListViewController.mm:
* UIProcess/ios/forms/WKSelectMenuListViewController.h:
* UIProcess/ios/forms/WKTimePickerViewController.h:
* UIProcess/ios/forms/WKTimePickerViewController.mm:
* UIProcess/ios/fullscreen/WKFullScreenViewController.h:
* UIProcess/ios/fullscreen/WKFullscreenStackView.h:
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
* UIProcess/mac/PageClientImplMac.mm:
* UIProcess/mac/WKSharingServicePickerDelegate.h:
* WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
* WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.h:
* WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.h:
* WebProcess/WebPage/mac/PageBannerMac.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
More #import, less #pragma once.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj: Removed MemoryMeasure.h/mm.

Source/WebKitLegacy/ios:

* Misc/MemoryMeasure.h: Removed.
* Misc/MemoryMeasure.mm: Removed.
* WebKit.iOS.exp: Removed MemoryMeasure symbols.

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig: Removed MemoryMeasure.h from
EXCLUDED_SOURCE_FILE_NAMES.

* Misc/WebCache.mm:
(+[WebCache emptyInMemoryResources]): Removed invocation of MemoryMeasure.
This is no longer used for anything.

* History/BackForwardList.mm:
* Plugins/Hosted/ProxyRuntimeObject.mm:
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
* WebCoreSupport/SearchPopupMenuMac.mm:
* WebCoreSupport/WebAlternativeTextClient.mm:
* WebCoreSupport/WebSecurityOriginInternal.h:
* WebInspector/WebInspector.mm:
* WebView/WebFramePrivate.h:
* WebView/WebScriptWorld.h:
* WebView/WebView.mm:
More #import, less #pragma once.

Source/WTF:

* wtf/cocoa/Entitlements.mm:
* wtf/cocoa/FileSystemCocoa.mm:
* wtf/cocoa/MainThreadCocoa.mm:
* wtf/cocoa/SystemTracingCocoa.cpp:
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
* wtf/mac/SchedulePairMac.mm:
* wtf/text/cocoa/StringCocoa.mm:
* wtf/text/cocoa/TextStreamCocoa.mm:
More #import.

Tools:

* DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm:
* DumpRenderTree/ios/DumpRenderTreeAppMain.mm:
* DumpRenderTree/mac/AccessibilityCommonMac.h:
* DumpRenderTree/mac/DumpRenderTreeMain.mm:
* TestRunnerShared/cocoa/ClassMethodSwizzler.mm:
* TestRunnerShared/cocoa/InstanceMethodSwizzler.mm:
* TestRunnerShared/cocoa/LayoutTestSpellChecker.h:
* TestRunnerShared/mac/NSPasteboardAdditions.h:
* TestRunnerShared/spi/AppKitTestSPI.h:
* TestRunnerShared/spi/PencilKitTestSPI.h:
* TestWebKitAPI/DataDetectorsCoreSPI.h:
* TestWebKitAPI/EditingTestHarness.h:
* TestWebKitAPI/EditingTestHarness.mm:
* TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm:
* TestWebKitAPI/Tests/WebCore/LineBreaking.mm:
* TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:
* TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm:
* TestWebKitAPI/Tests/WebKit/AGXCompilerService.mm:
* TestWebKitAPI/Tests/WebKit/AccessibilityRemoteUIApp.mm:
* TestWebKitAPI/Tests/WebKit/BacklightLevelNotification.mm:
* TestWebKitAPI/Tests/WebKit/Battery.mm:
* TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm:
* TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm:
* TestWebKitAPI/Tests/WebKit/FindMatches.mm:
* TestWebKitAPI/Tests/WebKit/GrantAccessToMobileAssets.mm:
* TestWebKitAPI/Tests/WebKit/GrantAccessToPreferencesService.mm:
* TestWebKitAPI/Tests/WebKit/LocalizedDeviceModel.mm:
* TestWebKitAPI/Tests/WebKit/MimeTypes.mm:
* TestWebKitAPI/Tests/WebKit/NoHistoryItemScrollToFragment.mm:
* TestWebKitAPI/Tests/WebKit/PasteboardNotifications.mm:
* TestWebKitAPI/Tests/WebKit/PictureInPictureSupport.mm:
* TestWebKitAPI/Tests/WebKit/PreferenceChanges.mm:
* TestWebKitAPI/Tests/WebKit/SleepDisabler.mm:
* TestWebKitAPI/Tests/WebKit/ViewportSizeForViewportUnits.mm:
* TestWebKitAPI/Tests/WebKit/WKThumbnailView.mm:
* TestWebKitAPI/Tests/WebKit/WebFilter.mm:
* TestWebKitAPI/Tests/WebKit/mac/AttributedSubstringForProposedRangeWithImage.mm:
* TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm:
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleObject.h:
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm:
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter_Bundle.mm:
* TestWebKitAPI/Tests/WebKit/mac/EditorCommands.mm:
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm:
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle_Bundle.mm:
* TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CloseWebViewAfterEnterFullscreen.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CloseWebViewDuringEnterFullscreen.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CookieAcceptPolicy.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CookiePrivateBrowsing.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CopyRTF.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CopyURL.mm:
* TestWebKitAPI/Tests/WebKitCocoa/CustomUserAgent.mm:
* TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:
* TestWebKitAPI/Tests/WebKitCocoa/DecidePolicyForNavigationAction.mm:
* TestWebKitAPI/Tests/WebKitCocoa/DeviceManagementRestrictions.mm:
* TestWebKitAPI/Tests/WebKitCocoa/DoAfterNextPresentationUpdateAfterCrash.mm:
* TestWebKitAPI/Tests/WebKitCocoa/EditorStateTests.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FindInPageAPI.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FirstVisuallyNonEmptyMilestone.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FixedLayoutSize.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenAlert.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm:
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:
* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
* TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm:
* TestWebKitAPI/Tests/WebKitCocoa/JavaScriptDuringNavigation.mm:
* TestWebKitAPI/Tests/WebKitCocoa/LoadFileThenReload.mm:
* TestWebKitAPI/Tests/WebKitCocoa/LoadFileURL.mm:
* TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm:
* TestWebKitAPI/Tests/WebKitCocoa/MediaBufferingPolicy.mm:
* TestWebKitAPI/Tests/WebKitCocoa/MediaType.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ModalAlerts.mm:
* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
* TestWebKitAPI/Tests/WebKitCocoa/NavigationAction.mm:
* TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:
* TestWebKitAPI/Tests/WebKitCocoa/NetworkProcessCrashNonPersistentDataStore.mm:
* TestWebKitAPI/Tests/WebKitCocoa/NoPauseWhenSwitchingTabs.mm:
* TestWebKitAPI/Tests/WebKitCocoa/NowPlaying.mm:
* TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ObservedRenderingProgressEventsAfterCrash.mm:
* TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm:
* TestWebKitAPI/Tests/WebKitCocoa/OverrideViewportArguments.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PageZoom.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenTests.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PasteMixedContent.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PasteRTFD.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSuspendMediaBuffering.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ReparentWebViewTimeout.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ResponsivenessTimer.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ResponsivenessTimerDoesntFireEarly.mm:
* TestWebKitAPI/Tests/WebKitCocoa/RestoreSessionStateWithoutNavigation.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ShouldGoToBackForwardListItem.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ShouldOpenExternalURLsInNewWindowActions.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ShrinkToFit.mm:
* TestWebKitAPI/Tests/WebKitCocoa/StopSuspendResumeAllMedia.mm:
* TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm:
* TestWebKitAPI/Tests/WebKitCocoa/SystemColors.mm:
* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
* TestWebKitAPI/Tests/WebKitCocoa/TabOutOfWebView.mm:
* TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.h:
* TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.mm:
* TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:
* TestWebKitAPI/Tests/WebKitCocoa/TextSize.mm:
* TestWebKitAPI/Tests/WebKitCocoa/TextWidth.mm:
* TestWebKitAPI/Tests/WebKitCocoa/TopContentInset.mm:
* TestWebKitAPI/Tests/WebKitCocoa/UserInitiatedActionInNavigationAction.mm:
* TestWebKitAPI/Tests/WebKitCocoa/VideoControlsManager.mm:
* TestWebKitAPI/Tests/WebKitCocoa/VideoQualityDisplayCompositing.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WKRequestActivatedElementInfo.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewFindString.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WebContentProcessDidTerminate.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
* TestWebKitAPI/Tests/WebKitCocoa/_WKInputDelegate.mm:
* TestWebKitAPI/Tests/WebKitLegacy/ios/ScrollingDoesNotPauseMedia.mm:
* TestWebKitAPI/Tests/WebKitLegacy/mac/AccessingPastedImage.mm:
* TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm:
* TestWebKitAPI/Tests/ios/DataDetectorsTestIOS.mm:
* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
* TestWebKitAPI/Tests/ios/OverflowScrollViewTests.mm:
* TestWebKitAPI/Tests/ios/RenderingProgressTests.mm:
* TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm:
* TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm:
* TestWebKitAPI/Tests/ios/SelectionByWord.mm:
* TestWebKitAPI/Tests/ios/SelectionModifyByParagraphBoundary.mm:
* TestWebKitAPI/Tests/ios/TestInputDelegate.h:
* TestWebKitAPI/Tests/ios/TestInputDelegate.mm:
* TestWebKitAPI/Tests/ios/TextAutosizingBoost.mm:
* TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
* TestWebKitAPI/Tests/ios/WKScrollViewTests.mm:
* TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm:
* TestWebKitAPI/Tests/ios/WKWebViewPausePlayingAudioTests.mm:
* TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm:
* TestWebKitAPI/Tests/mac/AdditionalSupportedImageTypes.mm:
* TestWebKitAPI/Tests/mac/BackForwardList.mm:
* TestWebKitAPI/Tests/mac/BackgroundColor.mm:
* TestWebKitAPI/Tests/mac/CandidateTests.mm:
* TestWebKitAPI/Tests/mac/DOMHTMLTableCellCellAbove.mm:
* TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm:
* TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm:
* TestWebKitAPI/Tests/mac/HTMLCollectionNamedItem.mm:
* TestWebKitAPI/Tests/mac/HTMLFormCollectionNamedItem.mm:
* TestWebKitAPI/Tests/mac/IsNavigationActionTrusted.mm:
* TestWebKitAPI/Tests/mac/LegacyDragAndDropTests.mm:
* TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm:
* TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm:
* TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:
* TestWebKitAPI/Tests/mac/SetDocumentURI.mm:
* TestWebKitAPI/Tests/mac/SimplifyMarkup.mm:
* TestWebKitAPI/Tests/mac/SubresourceErrorCrash.mm:
* TestWebKitAPI/Tests/mac/TypingStyleCrash.mm:
* TestWebKitAPI/Tests/mac/WKWebViewMacEditingTests.mm:
* TestWebKitAPI/Tests/mac/WebScriptObjectDescription.mm:
* TestWebKitAPI/Tests/mac/WindowlessWebViewWithMedia.mm:
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/cocoa/NSItemProviderAdditions.h:
* TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm:
* TestWebKitAPI/cocoa/TestContextMenuDriver.h:
* TestWebKitAPI/cocoa/TestNavigationDelegate.h:
* TestWebKitAPI/cocoa/TestProtocol.mm:
* TestWebKitAPI/cocoa/TestUIDelegate.h:
* TestWebKitAPI/cocoa/UtilitiesCocoa.mm:
* TestWebKitAPI/ios/PencilKitTestSPI.h:
* TestWebKitAPI/mac/JavaScriptTestMac.mm:
* TestWebKitAPI/mac/NSFontPanelTesting.h:
* TestWebKitAPI/mac/NSFontPanelTesting.mm:
* TestWebKitAPI/mac/OffscreenWindow.h:
* TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
* TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.mm:
* TestWebKitAPI/mac/TestDraggingInfo.h:
* TestWebKitAPI/mac/TestFilePromiseReceiver.h:
* TestWebKitAPI/mac/TestFontOptions.h:
* TestWebKitAPI/mac/TestInspectorBar.h:
* TestWebKitAPI/mac/WebKitAgnosticTest.mm:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h:
* WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h:
* WebKitTestRunner/mac/PoseAsClass.mm:
More #import, less #pragma once.

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

3 months ago[Flatpak SDK] Prevent exception when calling git in a non-git repository
dpino@igalia.com [Mon, 20 Apr 2020 15:24:17 +0000 (15:24 +0000)]
[Flatpak SDK] Prevent exception when calling git in a non-git repository
https://bugs.webkit.org/show_bug.cgi?id=210737

Reviewed by Philippe Normand.

* flatpak/flatpakutils.py:
(WebkitFlatpak.is_branch_build): Return false if command executes in a
non-git repository (i.e SVN).

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

3 months agoSafari doesn't apply frameRate limit when request stream from Camera
youenn@apple.com [Mon, 20 Apr 2020 14:37:47 +0000 (14:37 +0000)]
Safari doesn't apply frameRate limit when request stream from Camera
https://bugs.webkit.org/show_bug.cgi?id=210186
<rdar://problem/61452794>

Reviewed by Eric Carlson.

Source/WebCore:

Add support to RealtimeVideoSource to decimate the video samples based on the observed frame rate of its capture source.
This allows supporting two tracks using the same capture device, one track being low frame rate and the other one high frame rate.

Clean-up refactoring to make RealtimeVideoSource directly inherit from RealtimeVideoCaptureSource.
Migrate size and format of frame adaptation from RealtimeVideoCaptureSource to RealtimeVideoSource.
Fix mock capture source to update its frame rate when asked by applyConstraints.

Tests: fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html
       fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html
       fast/mediastream/mediastreamtrack-video-frameRate-decreasing.html
       fast/mediastream/mediastreamtrack-video-frameRate-increasing.html

* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
(WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
* platform/mediastream/RealtimeVideoCaptureSource.h:
(WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource):
(WebCore::m_source):
(WebCore::RealtimeVideoSource::adaptVideoSample):
(WebCore::RealtimeVideoSource::videoSampleAvailable):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
* testing/Internals.cpp:
(WebCore::Internals::observeMediaStreamTrack):

LayoutTests:

* fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing-expected.txt: Added.
* fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html: Added.
* fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing-expected.txt: Added.
* fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html: Added.
* fast/mediastream/mediastreamtrack-video-framerate-decreasing-expected.txt: added.
* fast/mediastream/mediastreamtrack-video-framerate-decreasing.html: added.
* fast/mediastream/mediastreamtrack-video-framerate-increasing-expected.txt: added.
* fast/mediastream/mediastreamtrack-video-framerate-increasing.html: added.
* webrtc/routines.js:

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

3 months ago[Flatpak SDK] Drive-by fixes
philn@webkit.org [Mon, 20 Apr 2020 12:29:23 +0000 (12:29 +0000)]
[Flatpak SDK] Drive-by fixes
https://bugs.webkit.org/show_bug.cgi?id=210557

Reviewed by Žan Doberšek.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox): Properly format error message.
(WebkitFlatpak.main): Show flatpak update output.

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

3 months agoUnreviewed, revert accidental test changes.
keith_miller@apple.com [Mon, 20 Apr 2020 12:10:03 +0000 (12:10 +0000)]
Unreviewed, revert accidental test changes.

* microbenchmarks/for-of-iterate-array-entries.js:
(foo):

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

3 months ago[32-bits] stress/for-of-array-different-globals.js is failing
commit-queue@webkit.org [Mon, 20 Apr 2020 12:01:56 +0000 (12:01 +0000)]
[32-bits] stress/for-of-array-different-globals.js is failing
https://bugs.webkit.org/show_bug.cgi?id=210718

Unreviewed gardening.

Skip test for arm and mips, failing due to r260323

Patch by Paulo Matos <pmatos@igalia.com> on 2020-04-20

* stress/for-of-array-different-globals.js:

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

3 months agoWebAnimations API doesn't properly apply keyframe easings to transforms
graouts@webkit.org [Mon, 20 Apr 2020 11:56:55 +0000 (11:56 +0000)]
WebAnimations API doesn't properly apply keyframe easings to transforms
https://bugs.webkit.org/show_bug.cgi?id=210526
<rdar://problem/61800424>

Reviewed by Antti Koivisto.

Source/WebCore:

GraphicsLayerCA has code that determines whether an animation can be accelerated looking at the timing function of its keyframes and excluding
animations that use a steps timing function as one of its values. However, we we would fail to set the timing function on the KeyframeValue for
each keyframe in the KeyframeList we create for a JS-originated animation. We now do this correctly.

Test: webanimations/transform-animation-with-steps-timing-function-not-accelerated.html

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::updateBlendingKeyframes):

LayoutTests:

Add a new test that checks that an animation targeting an accelerted property does not yield an accelerated animation if one of its keyframes contains a steps timing function.

* webanimations/transform-animation-with-steps-timing-function-not-accelerated-expected.txt: Added.
* webanimations/transform-animation-with-steps-timing-function-not-accelerated.html: Added.

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

3 months ago[GTK][WPE] lowWatermarkPages() in MemoryPressureMonitor.cpp only searches the "low...
psaavedra@igalia.com [Mon, 20 Apr 2020 10:22:53 +0000 (10:22 +0000)]
[GTK][WPE] lowWatermarkPages() in MemoryPressureMonitor.cpp only searches the "low" value inside the first "Node" section
https://bugs.webkit.org/show_bug.cgi?id=210345

Reviewed by Adrian Perez de Castro.

* UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::lowWatermarkPages):

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

3 months agoStructuredClone algorithm should be aware of BigInt
ysuzuki@apple.com [Mon, 20 Apr 2020 09:54:34 +0000 (09:54 +0000)]
StructuredClone algorithm should be aware of BigInt
https://bugs.webkit.org/show_bug.cgi?id=210728

Reviewed by Mark Lam.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/bigint_value-expected.txt:
* web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_bigint-expected.txt:

Source/JavaScriptCore:

* CMakeLists.txt:
* runtime/BigIntObject.h:
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::digit): Deleted.
(JSC::JSBigInt::setDigit): Deleted.
* runtime/JSBigInt.h:
(JSC::JSBigInt::digit):
(JSC::JSBigInt::setDigit):

Source/WebCore:

This patch adds structured-cloning for BigInt and BigIntObject.
The logic is adding BigIntTag & BigIntObjectTag. And then we put content of BigInt with length.
And deserialization reads them to reconstruct BigInt or BigIntObject.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImmediate):
(WebCore::CloneSerializer::dumpBigIntData):
(WebCore::CloneSerializer::dumpBigInt32Data):
(WebCore::CloneSerializer::dumpHeapBigIntData):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readBigInt):
(WebCore::CloneDeserializer::readTerminal):

LayoutTests:

* inspector/model/remote-object/number-expected.txt:
* inspector/model/remote-object/object-expected.txt:

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

3 months ago[WebXR][WPE] Let XR_RUNTIME_JSON environment variable go through for testing
svillar@igalia.com [Mon, 20 Apr 2020 09:20:30 +0000 (09:20 +0000)]
[WebXR][WPE] Let XR_RUNTIME_JSON environment variable go through for testing
https://bugs.webkit.org/show_bug.cgi?id=210738

Reviewed by Žan Doberšek.

The OpenXR loader might be instructed to load a specific runtime by
using the XR_RUNTIME_JSON environment variable. Let it get in for testing.

* Scripts/webkitpy/port/wpe.py:
(WPEPort.setup_environ_for_server): Copy XR_RUNTIME_JSON if set.

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

3 months ago[GTK][WPE] Enable resource load statistics
carlosgc@webkit.org [Mon, 20 Apr 2020 08:33:58 +0000 (08:33 +0000)]
[GTK][WPE] Enable resource load statistics
https://bugs.webkit.org/show_bug.cgi?id=210184

Reviewed by Žan Doberšek.

.:

Enable resource load statistics.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const): Return early if cookies are blocked and update the
persistent cookies expiration if needed.
(WebCore::NetworkStorageSession::deleteCookiesForHostnames): Implement this when receiving
IncludeHttpOnlyCookies parameter.
(WebCore::NetworkStorageSession::hasCookies const): Implement this.
(WebCore::NetworkStorageSession::getRawCookies const): Honor shouldAskITP parameter.
(WebCore::cookiesForSession): Ditto.
(WebCore::NetworkStorageSession::cookiesForDOM const): Ditto.
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Ditto.

Source/WebKit:

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create): Pass page and frame identifiers to the constructor.
(WebKit::NetworkDataTask::isThirdPartyRequest const): Moved from NetworkDataTaskCocoa.mm.
(WebKit::NetworkDataTask::restrictRequestReferrerToOriginIfNeeded): Ditto.
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Initialize m_frameID and m_pageID.
(WebKit::NetworkDataTaskSoup::createRequest): Add WasBlockingCookies parameter. Call
restrictRequestReferrerToOriginIfNeeded() and disable cookies in the soup message if cookies should be blocked.
(WebKit::NetworkDataTaskSoup::clearRequest): Reset m_isBlockingCookies.
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection): Pass WasBlockingCookies to createRequest().
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadedThirdPartyDomains): Added for tests.
(WKPageClearLoadedThirdPartyDomains): Ditto.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/glib/WebsiteDataStoreGLib.cpp:
(WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Use lowercase for consistency with other
default directories.

Tools:

Implement TestController::loadedThirdPartyDomains() and TestController::clearLoadedThirdPartyDomains() for
non-cocoa ports.

* WebKitTestRunner/TestController.cpp:
(WTR::LoadedThirdPartyDomainsCallbackContext::LoadedThirdPartyDomainsCallbackContext):
(WTR::loadedThirdPartyDomainsCallback):
(WTR::TestController::loadedThirdPartyDomains):
(WTR::TestController::clearLoadedThirdPartyDomains):

LayoutTests:

Unskip tests that are now passing and add expectations for the two reminaing failures.

* http/tests/resourceLoadStatistics/loaded-registrable-domains-get-reported.html: Use setTimeout in onload
handler to avoid a deadlock due to sync injected bundle messages.
* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

3 months agocheck-webkit-style should not complain about missing config.h header in WebKitLegacy...
ddkilzer@apple.com [Mon, 20 Apr 2020 08:25:33 +0000 (08:25 +0000)]
check-webkit-style should not complain about missing config.h header in WebKitLegacy source files
<https://webkit.org/b/210734>

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(_NO_CONFIG_H_PATH_PATTERNS):
- Add '^Source/WebKitLegacy/' to the list.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(OrderOfIncludesTest.test_primary_header):
- Add test for Source/WebKitLegacy source file.

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

3 months agoREGRESSION (r259610): Leak of RBSAssertionInvalidationCallbackType due to missing...
ddkilzer@apple.com [Mon, 20 Apr 2020 07:11:28 +0000 (07:11 +0000)]
REGRESSION (r259610): Leak of RBSAssertionInvalidationCallbackType due to missing -dealloc
<https://webkit.org/b/210711>
<rdar://problem/61993361>

Reviewed by Geoffrey Garen.

* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKRBSAssertionDelegate dealloc]): Add.
- Release _invalidationCallback to fix the leak.

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

3 months agoUse Optional<FloatQuad> in TransformState
simon.fraser@apple.com [Mon, 20 Apr 2020 06:32:49 +0000 (06:32 +0000)]
Use Optional<FloatQuad> in TransformState
https://bugs.webkit.org/show_bug.cgi?id=144226

Reviewed by Sam Weinig.

Use Optional<> instead of pointers in TransformState, make it loggable, make FloatQuad loggable.

* platform/graphics/FloatQuad.cpp:
(WebCore::operator<<):
* platform/graphics/FloatQuad.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::operator=):
(WebCore::TransformState::mappedSecondaryQuad const):
(WebCore::TransformState::setLastPlanarSecondaryQuad):
(WebCore::TransformState::flattenWithTransform):
(WebCore::operator<<):
* platform/graphics/transforms/TransformState.h:
(WebCore::TransformState::setSecondaryQuad):
(WebCore::TransformState::lastPlanarSecondaryQuad const):
(WebCore::TransformState::isMappingSecondaryQuad const):
(WebCore::TransformState::accumulatedTransform const):

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

3 months agoUnreviewed, skip imported/w3c/web-platform-tests/IndexedDB/structured-clone
ysuzuki@apple.com [Mon, 20 Apr 2020 06:30:35 +0000 (06:30 +0000)]
Unreviewed, skip imported/w3c/web-platform-tests/IndexedDB/structured-clone
https://bugs.webkit.org/show_bug.cgi?id=210731#c4

Skipping this test based on the following rationales.

    1. This test was previously *effectively* skipped because it is including BigInt syntax. This test immediately throws SyntaxError. So nothing in this test was executed before.
    2. Now JSC supports BigInt syntax. Then, this test is now executed finally. And crash happens when deserializaing DOMMatrixReadOnly.
    3. This is because DOMMatrixReadOnly requires JSDOMGlobalObject since DOMMatrixReadOnly is WebCore object, not JSC object.
    4. However, IDBSerializationContext.cpp is using plain JSGlobalObject. This is not correct since it is JSC JSGlobalObject and it does not include DOMMatrix implementations.
    5. So, nothing is related to BigInt here.

* TestExpectations:

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

3 months agoRemove unneeded code from FrameLoader::loadURL
commit-queue@webkit.org [Mon, 20 Apr 2020 06:20:07 +0000 (06:20 +0000)]
Remove unneeded code from FrameLoader::loadURL
https://bugs.webkit.org/show_bug.cgi?id=210696

Patch by Rob Buis <rbuis@igalia.com> on 2020-04-19
Reviewed by Darin Adler.

Remove unneeded code from FrameLoader::loadURL, since the only way the load type can be Reload
is if loadFrameRequest set it, and the only way loadFrameRequest can set it is if cachePolicy
is ReloadIgnoringCacheData, so no need to set it again in FrameLoader::loadURL.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):

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

3 months agoAdd WKScriptMessageHandler API that asynchronously responds with a promise.
beidson@apple.com [Mon, 20 Apr 2020 05:55:13 +0000 (05:55 +0000)]
Add WKScriptMessageHandler API that asynchronously responds with a promise.
rdar://problem/57243492 and https://bugs.webkit.org/show_bug.cgi?id=206398

Reviewed by Andy Estes.
Source/WebCore:

Covered by new API tests.

Updated for moving an #include into implementation files:
* bindings/js/JSDOMPromiseDeferred.cpp:
* bindings/js/JSDOMPromiseDeferred.h:
* html/HTMLMediaElement.cpp:
* page/DOMWindow.cpp:
* workers/service/ServiceWorkerGlobalScope.cpp:

* page/UserMessageHandler.cpp:
(WebCore::UserMessageHandler::postMessage): Return a promise to be fulfilled by the API client.
* page/UserMessageHandler.h:
* page/UserMessageHandler.idl:
* page/UserMessageHandlerDescriptor.h:

Source/WebKit:

Change webkit.messageHandlers.<name>.postMessage() to return a promise instead of undefined.

Allow for that promise to be resolved by an asynchronous reply block up in the API client.
This is like the spiritual opposite version of [WKWebView callAsyncFunction:...]

And while we're adding a new script message handler variant, we're adding it sandboxed by WKContentWorld.

* Shared/API/APISerializedScriptValue.h:
* UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
(API::validateObject):
(API::coreValueFromNSObject):
(API::SerializedScriptValue::createFromNSObject):
(API::SerializedScriptValue::wireBytesFromNSObject): Deleted.

* UIProcess/API/Cocoa/WKScriptMessage.h: Now that script message handlers can be per-world, messages
  declare which world they were posted from.
* UIProcess/API/Cocoa/WKScriptMessage.mm:
(-[WKScriptMessage _initWithBody:webView:frameInfo:name:world:]):
(-[WKScriptMessage world]):
(-[WKScriptMessage _initWithBody:webView:frameInfo:name:]): Deleted.
* UIProcess/API/Cocoa/WKScriptMessageInternal.h:

* UIProcess/API/Cocoa/WKScriptMessageHandlerWithReply.h: Added.
  Declare the new protocol for a script message handler that can reply to messages asynchronously.

* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController _addScriptMessageHandler:]):
(-[WKUserContentController addScriptMessageHandler:name:]):
(-[WKUserContentController addScriptMessageHandler:contentWorld:name:]):
(-[WKUserContentController addScriptMessageHandlerWithReply:contentWorld:name:]):
(-[WKUserContentController removeScriptMessageHandlerForName:contentWorld:]):
(-[WKUserContentController removeAllScriptMessageHandlersFromContentWorld:]):
(-[WKUserContentController removeAllScriptMessageHandlers]):
* UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]):
Update for new shared API::SerializedScriptValue initialization.

* UIProcess/API/glib/WebKitUserContentManager.cpp:
* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
* UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp:

* UIProcess/UserContent/WebScriptMessageHandler.h:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
(WebKit::WebUserContentControllerProxy::didPostMessage):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/UserContent/WebUserContentControllerProxy.messages.in:

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
(webkit_dom_dom_window_webkit_message_handlers_post_message):

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::removeAllUserScriptMessageHandlers):
(WebKit::WebUserContentController::removeAllUserScriptMessageHandlersForWorlds):
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:

Source/WTF:

* wtf/CompletionHandler.h:
(WTF::CompletionHandlerWithFinalizer<Out): Add a variant of CompletionHandler that allows for a Finalizer function
  to handle cases where the Completion function hasn't been called at destruction time.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST):
(webViewForScriptMessageHandlerMultipleHandlerRemovalTest):
(-[AsyncScriptMessageHandler userContentController:didReceiveScriptMessage:replyHandler:]):

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

3 months ago[ECMA-402] Intl.RelativeTimeFormat missing in WebKit
ross.kirsling@sony.com [Mon, 20 Apr 2020 05:15:35 +0000 (05:15 +0000)]
[ECMA-402] Intl.RelativeTimeFormat missing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=209770

Reviewed by Darin Adler.

JSTests:

* stress/intl-relativetimeformat.js: Added.

* test262/config.yaml:
Enable Intl.RelativeTimeFormat feature with flag.

* test262/expectations.yaml:
Mark known failures.
Test for locale validation is not specific to RelativeTimeFormat and should be investigated separately.
Tests for Polish appear to be wrong and should be corrected in test262.

Source/JavaScriptCore:

This patch implements the recent ECMA-402 feature Intl.RelativeTimeFormat.

RelativeTimeFormat has format / formatToParts functions like NumberFormat / DateTimeFormat
and is used to turn a number and unit into a formatted relative time string, e.g.:

  new Intl.RelativeTimeFormat('en').format(10, 'day')
  > 'in 10 days'

  new Intl.RelativeTimeFormat('en', { numeric: 'auto' }).format(0, 'day')
  > 'today'

Implementation of RelativeTimeFormat#formatToParts makes direct use of NumberFormat#formatToParts,
as the relative time string consists of at most one formatted number with optional literal text on either side.

This feature is runtime-guarded by the `useIntlRelativeTimeFormat` option.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* runtime/CommonIdentifiers.h:
* runtime/IntlRelativeTimeFormat.cpp: Added.
* runtime/IntlRelativeTimeFormat.h: Added.
* runtime/IntlRelativeTimeFormatConstructor.cpp: Added.
* runtime/IntlRelativeTimeFormatConstructor.h: Added.
* runtime/IntlRelativeTimeFormatPrototype.cpp: Added.
* runtime/IntlRelativeTimeFormatPrototype.h: Added.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::relativeTimeFormatStructure):
* runtime/OptionsList.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
Add feature and runtime option.

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::formatToParts):
* runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::initializePluralRules):
(JSC::IntlPluralRules::resolvedOptions):
Make "type" a property name.

* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
(JSC::IntlNumberFormat::resolvedOptions):
(JSC::IntlNumberFormat::formatToPartsInternal):
(JSC::IntlNumberFormat::formatToParts):
* runtime/IntlNumberFormat.h:
Factor out formatToPartsInternal so that RelativeTimeFormat can use it with its own UNumberFormat.
(This logic is too complicated to duplicate; it's because ICU won't split, e.g., "10,000" into parts for us.)

* runtime/IntlObject.cpp:
(JSC::IntlObject::IntlObject):
(JSC::IntlObject::create):
(JSC::IntlObject::finishCreation):
(JSC::intlAvailableLocales):
(JSC::intlCollatorAvailableLocales):
(JSC::isUnicodeLocaleIdentifierType):
(JSC::supportedLocales):
(JSC::intlDateTimeFormatAvailableLocales): Deleted.
(JSC::intlNumberFormatAvailableLocales): Deleted.
* runtime/IntlObject.h:
(JSC::intlDateTimeFormatAvailableLocales):
(JSC::intlNumberFormatAvailableLocales):
(JSC::intlPluralRulesAvailableLocales):
(JSC::intlRelativeTimeFormatAvailableLocales):
Perform three corrections for Intl classes:
  1. Collator should be the only class with unique "available locales".
     [unum|udat]_getAvailable exist but they've deferred to uloc_getAvailable for 20 years.
  2. isUnicodeLocaleIdentifierType isn't just `alphanum{3,8}` but rather `alphanum{3,8} (sep alphanum{3,8})*`.
     This is my own mistake from r239941.
  3. supportedLocalesOf entries should not be frozen.
     Changed in https://github.com/tc39/ecma402/pull/278.

* tools/JSDollarVM.cpp:
(JSC::functionICUVersion):
(JSC::JSDollarVM::finishCreation):
Add $vm.icuVersion so that we can add per-line skips to stress tests.

Tools:

* Scripts/run-jsc-stress-tests:
Add runIntlRelativeTimeFormatEnabled.

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

3 months agoREGRESSION (r244091): Leak of TaskStateChangedCallbackType due to missing -dealloc
ddkilzer@apple.com [Mon, 20 Apr 2020 03:46:40 +0000 (03:46 +0000)]
REGRESSION (r244091): Leak of TaskStateChangedCallbackType due to missing -dealloc
<https://webkit.org/b/210710>
<rdar://problem/61992856>

Reviewed by Darin Adler.

* Shared/Cocoa/ProcessTaskStateObserver.mm:
(-[WKProcessTaskStateObserverDelegate dealloc]): Add.
- Release _taskStateChangedCallback to fix the leak.

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

3 months ago[IPC hardening] Use MESSAGE_CHECK in WebPageProxy::loadRecentSearches() and WebPagePr...
ddkilzer@apple.com [Mon, 20 Apr 2020 02:18:32 +0000 (02:18 +0000)]
[IPC hardening] Use MESSAGE_CHECK in WebPageProxy::loadRecentSearches() and WebPageProxy::saveRecentSearches()
<https://webkit.org/b/210683>
<rdar://problem/59240446>

Reviewed by Geoffrey Garen.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(MESSAGE_CHECK): Add.
(MESSAGE_CHECK_COMPLETION): Add.
(WebKit::WebPageProxy::saveRecentSearches):
(WebKit::WebPageProxy::loadRecentSearches):
- Replace boolean check of const String& with MESSAGE_CHECK.

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

3 months ago[JSC] SlowPathCall is not supported by callOperation in Windows
ysuzuki@apple.com [Mon, 20 Apr 2020 01:56:24 +0000 (01:56 +0000)]
[JSC] SlowPathCall is not supported by callOperation in Windows
https://bugs.webkit.org/show_bug.cgi?id=210727

Reviewed by Ross Kirsling.

In Windows, SlowPathCall should be handled by JITSlowPathCall, otherwise, stack is not correctly allocated.

* jit/JITCall.cpp:
(JSC::JIT::emit_op_iterator_open):
(JSC::JIT::emit_op_iterator_next):
* jit/SlowPathCall.h:
(JSC::JITSlowPathCall::call):

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

3 months ago[JSC] Enable BigInt
ysuzuki@apple.com [Mon, 20 Apr 2020 00:59:00 +0000 (00:59 +0000)]
[JSC] Enable BigInt
https://bugs.webkit.org/show_bug.cgi?id=210726

Reviewed by Mark Lam.

Source/JavaScriptCore:

* runtime/OptionsList.h:

Source/WTF:

* wtf/PlatformUse.h:

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