WebKit-https.git
4 months agoFix security check in ScriptController::canAccessFromCurrentOrigin()
cdumez@apple.com [Mon, 20 May 2019 22:53:03 +0000 (22:53 +0000)]
Fix security check in ScriptController::canAccessFromCurrentOrigin()
https://bugs.webkit.org/show_bug.cgi?id=196730
<rdar://problem/49731231>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fix security check in ScriptController::canAccessFromCurrentOrigin() when there is no
current JS exec state. Instead of returning true unconditionally, we now fall back to
using the accessing document's origin for the security check. The new behavior is
aligned with Blink:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_frame_element_base.cc?rcl=d3f22423d512b45466f1694020e20da9e0c6ee6a&l=62

This fix is based on a patch from Sergei Glazunov <glazunov@google.com>.

Test: http/tests/security/showModalDialog-sync-cross-origin-page-load2.html

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::canAccessFromCurrentOrigin):
* bindings/js/ScriptController.h:
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::isURLAllowed const):

LayoutTests:

Add layout test coverage.

* http/tests/security/showModalDialog-sync-cross-origin-page-load2-expected.txt: Added.
* http/tests/security/showModalDialog-sync-cross-origin-page-load2.html: Added.

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

4 months ago[WinCairo] Implement Remote Web Inspector Client.
ross.kirsling@sony.com [Mon, 20 May 2019 21:17:02 +0000 (21:17 +0000)]
[WinCairo] Implement Remote Web Inspector Client.
https://bugs.webkit.org/show_bug.cgi?id=197434

Reviewed by Don Olmstead.

.:

* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:

Source/JavaScriptCore:

* inspector/remote/socket/RemoteInspectorConnectionClient.cpp:
(Inspector::RemoteInspectorConnectionClient::didAccept): Deleted.
* inspector/remote/socket/RemoteInspectorConnectionClient.h:
(Inspector::RemoteInspectorConnectionClient::didAccept):
* inspector/remote/socket/RemoteInspectorServer.cpp:
(Inspector::RemoteInspectorServer::dispatchMap):

Source/WebKit:

* PlatformWin.cmake:
* UIProcess/RemoteWebInspectorProxy.cpp:
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/socket/RemoteInspectorClient.cpp: Added.
* UIProcess/socket/RemoteInspectorClient.h: Added.
* UIProcess/socket/RemoteInspectorProtocolHandler.cpp: Added.
* UIProcess/socket/RemoteInspectorProtocolHandler.h: Added.
* UIProcess/win/RemoteWebInspectorProxyWin.cpp: Added.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView):

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

4 months agoWeb Inspector: Storage tab crashes easily when adding new local/session storage entries.
drousso@apple.com [Mon, 20 May 2019 20:45:22 +0000 (20:45 +0000)]
Web Inspector: Storage tab crashes easily when adding new local/session storage entries.
https://bugs.webkit.org/show_bug.cgi?id=198004

Reviewed by Ross Kirsling.

* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._startEditingNodeAtColumnIndex):
Force a layout in the case that a new `PlaceholderDataGridNode` was added to the end of the
`DataGrid` as part of the `editCallback`. Web Inspector won't crash without this, but it
won't properly select/focus the next row when tabbing from the last column to the next row.

(WI.DataGrid.prototype._editingCommitted):
Save the new value of the column before removing the editing styles, as that refreshes the
`DataGridNode`. If the new value isn't saved, the old value is used during the refresh.

(WI.DataGrid.prototype._keyDown):
Drive-by: use `get element` instead of using the member variable directly, as the underlying
value might not have been initialized yet.

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

4 months agoRange getBoundingClientRect returning zero rect on simple text node with <br> before it
commit-queue@webkit.org [Mon, 20 May 2019 20:32:35 +0000 (20:32 +0000)]
Range getBoundingClientRect returning zero rect on simple text node with <br> before it
https://bugs.webkit.org/show_bug.cgi?id=182181

Patch by Gabe Giosia <giosia@google.com> on 2019-05-20
Reviewed by Antti Koivisto.

Source/WebCore:

Correct rect of RenderText in a block element when used in a Range
over a line break element. The end offset was miscalculated.

Addded line-break case to fast/dom/Range/getBoundingClientRect.html

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const):

LayoutTests:

Test getBoundingClientRect with a Range that contains a line break.

* fast/dom/Range/getBoundingClientRect-expected.txt:
* fast/dom/Range/getBoundingClientRect.html:

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

4 months ago[macOS] STP can't launch any WebContent processes
pvollan@apple.com [Mon, 20 May 2019 19:18:42 +0000 (19:18 +0000)]
[macOS] STP can't launch any WebContent processes
https://bugs.webkit.org/show_bug.cgi?id=198045
<rdar://problem/50931110>

Reviewed by Brent Fulgham.

This is caused by a syscall sandbox violation.

* WebProcess/com.apple.WebProcess.sb.in:

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

4 months agogenerate-xcfilelists is stranding temporary files
krollin@apple.com [Mon, 20 May 2019 18:24:43 +0000 (18:24 +0000)]
generate-xcfilelists is stranding temporary files
https://bugs.webkit.org/show_bug.cgi?id=198008
<rdar://problem/50893659>

Reviewed by Jonathan Bedard.

generate-xcfilelists makes use of temporary files on disk. These files
are opened with the OS's "temporary" bit set, causing them to get
deleted when closed or the process exists. However, these temporary
files actually end up persisting after the script exists. This is
because `sed` is used to process the files, and is done so in a way
that causes the "temporary" bit to get cleared.

Address this issue by no longer using `sed` and instead performing the
equivalent processing the file content in-memory.

* Scripts/webkitpy/generate_xcfilelists_lib/generators.py:
(BaseGenerator._generate_derived):
(BaseGenerator._generate_unified):
(BaseGenerator._replace):
(BaseGenerator._unexpand):
(BaseGenerator._find_added_lines.get_lines):
(BaseGenerator._find_added_lines):

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

4 months agoUnreviewed test gardening after r245482.
ryanhaddad@apple.com [Mon, 20 May 2019 17:51:55 +0000 (17:51 +0000)]
Unreviewed test gardening after r245482.

* platform/mac/TestExpectations: Explicitly mark webgl/2.0.0/conformance2/textures/misc/copy-texture-image-luma-format.html
as slow for High Sierra.

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

4 months agoAllow WebContent mach-lookup AGXCompilerService
commit-queue@webkit.org [Mon, 20 May 2019 17:41:16 +0000 (17:41 +0000)]
Allow WebContent mach-lookup AGXCompilerService
https://bugs.webkit.org/show_bug.cgi?id=198031
<rdar://problem/50552974>

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-05-20
Reviewed by Per Arne Vollan.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

4 months agoHitpoint for link which spans two lines in web content is incorrect
commit-queue@webkit.org [Mon, 20 May 2019 17:24:20 +0000 (17:24 +0000)]
Hitpoint for link which spans two lines in web content is incorrect
https://bugs.webkit.org/show_bug.cgi?id=197511
<rdar://problem/49971483>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-05-20
Reviewed by Chris Fleizach.

* accessibility/ios-simulator/links-activation.html:
* accessibility/links-activation-expected.txt:
* accessibility/links-activation.html:

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

4 months ago[ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal...
sihui_liu@apple.com [Mon, 20 May 2019 17:14:33 +0000 (17:14 +0000)]
[ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196307
<rdar://problem/49345360>

Reviewed by Alex Christensen.

Source/WebKit:

Delay dumping statistics if there is data being removed.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
(WebKit::WebResourceLoadStatisticsStore::tryDumpResourceLoadStatistics):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:

LayoutTests:

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

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

4 months ago[WPE][Qt] Use C++17 instead of C++14
commit-queue@webkit.org [Mon, 20 May 2019 14:50:54 +0000 (14:50 +0000)]
[WPE][Qt] Use C++17 instead of C++14
https://bugs.webkit.org/show_bug.cgi?id=197415

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-05-20
Reviewed by Philippe Normand.

There was a regression introduced with the commit https://bugs.webkit.org/show_bug.cgi?id=197131
The WPE Qt port was not updated to C++17 and this leaded to a compilation error.

Source/WebKit:

* PlatformWPE.cmake:

Tools:

* TestWebKitAPI/glib/CMakeLists.txt:

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

4 months ago[Flatpak][Qt] Meson: Unknown type feature for gstreamer
commit-queue@webkit.org [Mon, 20 May 2019 14:49:46 +0000 (14:49 +0000)]
[Flatpak][Qt] Meson: Unknown type feature for gstreamer
https://bugs.webkit.org/show_bug.cgi?id=197408

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-05-20
Reviewed by Philippe Normand.

This is a regression that has been introduced when
GStreamer was updated to version 1.16.0
https://bugs.webkit.org/show_bug.cgi?id=197157

Now GStreamer requires meson >= 0.47.0
Updating the Kde runtime to version 5.12 we fulfill
this requirement.

* flatpak/org.webkit.WPEQT.yaml:

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

4 months ago[GLIB] Crash when instantiating a js object registered with jsc_context_register_clas...
carlosgc@webkit.org [Mon, 20 May 2019 13:48:04 +0000 (13:48 +0000)]
[GLIB] Crash when instantiating a js object registered with jsc_context_register_class on window object cleared
https://bugs.webkit.org/show_bug.cgi?id=198037

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

This happens because JSCClass is keeping a pointer to the JSCContext used when the class is registered, and the
context can be destroyed before the class. We can't a reference to the context, because we don't really want to
keep it alive. The life of the JSCClass is not attached to the JSCContext, but to its wrapped global context, so
we can keep a pointer to the JSGlobalContextRef instead and create a new JSCContext wrapping it when
needed. This patch is also making the context property of JSCClass non-readable, which was always the intention,
that's why there isn't a public getter in the API.

* API/glib/JSCCallbackFunction.cpp:
(JSC::JSCCallbackFunction::construct): Pass the context to jscClassGetOrCreateJSWrapper().
* API/glib/JSCClass.cpp:
(jscClassGetProperty): Remove the getter for context property.
(jscClassSetProperty): Get the JSGlobalContextRef from the given JSCContext.
(jsc_class_class_init): Make context writable only.
(jscClassCreate): Use the passed in context instead of the member.
(jscClassGetOrCreateJSWrapper): It receives now the context as parameter.
(jscClassCreateContextWithJSWrapper): Ditto.
(jscClassCreateConstructor): Get or create a JSCContext for our JSGlobalContextRef.
(jscClassAddMethod): Ditto.
(jsc_class_add_property): Ditto.
* API/glib/JSCClassPrivate.h:
* API/glib/JSCContext.cpp:
(jsc_context_evaluate_in_object): Pass the context to jscClassCreateContextWithJSWrapper().
* API/glib/JSCValue.cpp:
(jsc_value_new_object): Pass the context to jscClassGetOrCreateJSWrapper().

Tools:

Add a test case to check the crash is fixed.

* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(testWebExtensionWindowObjectCleared):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(windowObjectCleared):

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

4 months ago[GTK] Use a repeating timer to populate emoji chooser
carlosgc@webkit.org [Mon, 20 May 2019 08:15:27 +0000 (08:15 +0000)]
[GTK] Use a repeating timer to populate emoji chooser
https://bugs.webkit.org/show_bug.cgi?id=197984

Reviewed by Michael Catanzaro.

It ensures the emoji chooser popover is shown as soon as it's requested.

* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
(webkitEmojiChooserSetupSectionBox):
(webkitEmojiChooserSetupRecent):
(webkitEmojiChooserSetupEmojiSections):
(webkitEmojiChooserConstructed):

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

4 months ago[GLIB] Repeating timer is not stopped when stop is called from the callback
carlosgc@webkit.org [Mon, 20 May 2019 08:10:57 +0000 (08:10 +0000)]
[GLIB] Repeating timer is not stopped when stop is called from the callback
https://bugs.webkit.org/show_bug.cgi?id=197986

Reviewed by Michael Catanzaro.

Source/WTF:

In case of repeating timers we always update the ready time to fire interval after the user callback is called.

* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.

Tools:

Check the timer is no longer active after it has been stopped.

* TestWebKitAPI/Tests/WTF/RunLoop.cpp:
(TestWebKitAPI::TEST):

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

4 months agoAdd support for %pid in dumpJITMemoryPath
tzagallo@apple.com [Mon, 20 May 2019 06:08:47 +0000 (06:08 +0000)]
Add support for %pid in dumpJITMemoryPath
https://bugs.webkit.org/show_bug.cgi?id=198026

Reviewed by Saam Barati.

This is necessary when using dumpJITMemory with Safari. Otherwise, multiple WebContent
processes will try to write to the same file at the same time, which will crash since
the file is open with exclusive locking.

* jit/ExecutableAllocator.cpp:
(JSC::dumpJITMemory):

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

4 months agoUnreviewed build fix after r245508.
bfulgham@apple.com [Mon, 20 May 2019 03:40:24 +0000 (03:40 +0000)]
Unreviewed build fix after r245508.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Don't use
an 'import' directive in a C++ file.

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

4 months agoWait to get frame until after layout has been run
bfulgham@apple.com [Mon, 20 May 2019 03:15:30 +0000 (03:15 +0000)]
Wait to get frame until after layout has been run
https://bugs.webkit.org/show_bug.cgi?id=197999
<rdar://problem/50800345>

Reviewed by Alex Christensen.

Source/WebCore:

The current frame can change when layout runs, so don't bother retrieving
the frame until the final layout pass is complete.

Test: fast/dom/window-inner-width-crash.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::innerHeight const): Move frame access past the
layout operation.
(WebCore::DOMWindow::innerWidth const): Ditto.
(WebCore::DOMWindow::scrollX const): Ditto.
(WebCore::DOMWindow::scrollY const): Ditto.

LayoutTests:

* fast/dom/window-inner-width-crash-expected.txt: Added.
* fast/dom/window-inner-width-crash.html: Added.

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

4 months agoUnreviewed build fix
bfulgham@apple.com [Mon, 20 May 2019 00:48:59 +0000 (00:48 +0000)]
Unreviewed build fix

Attempting to build with only Open Source sources on shipping software with
ASan enabled triggers build failures due to missing includes. This patch adds
the necessary includes to cleanly build WebCore.

* Modules/applepay/ApplePaySession.cpp:
* Modules/applepay/PaymentSession.cpp:
* Modules/mediastream/UserMediaController.cpp:
* bindings/js/ScriptController.cpp:
* contentextensions/ContentExtensionsBackend.cpp:
* dom/Document.cpp:
* dom/ScriptedAnimationController.cpp:
* editing/cocoa/EditorCocoa.mm:
* editing/cocoa/HTMLConverter.mm:
* editing/cocoa/WebContentReaderCocoa.mm:
* editing/markup.cpp:
* history/CachedFrame.cpp:
* html/HTMLDocument.cpp:
* html/HTMLHtmlElement.cpp:
* html/HTMLMediaElement.cpp:
* html/ImageDocument.cpp:
* html/MediaDocument.cpp:
* html/PluginDocument.cpp:
* html/parser/HTMLDocumentParser.cpp:
* html/parser/XSSAuditor.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
* inspector/agents/InspectorNetworkAgent.cpp:
* inspector/agents/InspectorPageAgent.cpp:
* inspector/agents/page/PageNetworkAgent.cpp:
* loader/ApplicationManifestLoader.cpp:
* loader/FrameLoader.cpp:
* loader/LoadTiming.cpp:
* loader/NetscapePlugInStreamLoader.cpp:
* loader/ResourceLoader.cpp:
* loader/SubresourceLoader.cpp:
* loader/appcache/ApplicationCacheHost.cpp:
* loader/archive/cf/LegacyWebArchive.cpp:
* loader/icon/IconLoader.cpp:
* page/ContextMenuController.cpp:
* page/FrameView.cpp:
* page/Page.cpp:
* page/Performance.cpp:
* page/PerformanceNavigation.cpp:
* page/Quirks.cpp:
* page/UserContentProvider.cpp:
* page/csp/ContentSecurityPolicy.cpp:
* page/mac/PageMac.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* svg/graphics/SVGImage.cpp:
* testing/Internals.cpp:

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

4 months ago[Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "point...
graouts@webkit.org [Sun, 19 May 2019 21:43:58 +0000 (21:43 +0000)]
[Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS
https://bugs.webkit.org/show_bug.cgi?id=197882
<rdar://problem/50769116>

Reviewed by Dean Jackson.

Source/WebCore:

Tests: pointerevents/ios/pointerenter-alone.html
       pointerevents/ios/pointerleave-alone.html
       pointerevents/ios/pointerout-alone.html
       pointerevents/ios/pointerover-alone.html

* dom/EventNames.h:
(WebCore::EventNames::isTouchRelatedEventType const):
(WebCore::EventNames::touchRelatedEventNames const):
(WebCore::EventNames::extendedTouchRelatedEventNames const):

Source/WebKit:

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

LayoutTests:

Add new tests that check that adding a "pointerover", "pointerenter", "pointerout" or "pointerleave" event listener alone dispatches the
event as expected.

* pointerevents/ios/pointerenter-alone-expected.txt: Added.
* pointerevents/ios/pointerenter-alone.html: Added.
* pointerevents/ios/pointerleave-alone-expected.txt: Added.
* pointerevents/ios/pointerleave-alone.html: Added.
* pointerevents/ios/pointerout-alone-expected.txt: Added.
* pointerevents/ios/pointerout-alone.html: Added.
* pointerevents/ios/pointerover-alone-expected.txt: Added.
* pointerevents/ios/pointerover-alone.html: Added.

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

4 months ago[Pointer Events] The pointerup, pointerout and pointerleave events may be fired twice
graouts@webkit.org [Sun, 19 May 2019 21:37:44 +0000 (21:37 +0000)]
[Pointer Events] The pointerup, pointerout and pointerleave events may be fired twice
https://bugs.webkit.org/show_bug.cgi?id=198028
<rdar://problem/50769425>

Reviewed by Dean Jackson.

Add a new test that checks that we're firing a "pointermove" event when the touch pressure
changes, even when the touch is stationary, and that a single "pointerup" event is fired
as the touch ends and the pressure changes. The relevant code change is done in WebKitAdditions.

* pointerevents/ios/pressure-change-expected.txt: Added.
* pointerevents/ios/pressure-change.html: Added.
* pointerevents/utils.js:
(prototype._handlePointerEvent):
(prototype.stationary):
(prototype._action):

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

4 months ago[Pointer Events] A pointer should be marked as primary for all of its events
graouts@webkit.org [Sun, 19 May 2019 21:34:24 +0000 (21:34 +0000)]
[Pointer Events] A pointer should be marked as primary for all of its events
https://bugs.webkit.org/show_bug.cgi?id=197909
<rdar://problem/50801608>

Reviewed by Dean Jackson.

Source/WebCore:

Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
of the very first touch to start in a given sequence.

* page/EventHandler.h:

LayoutTests:

Update tests to match expectations that only the first touch of a sequence is the primary pointer,
which applies to all of its events, even after the even is no longer touching the digitizer.

* pointerevents/ios/over-enter-out-leave.html:
* pointerevents/ios/pointer-event-order.html:
* pointerevents/ios/pointer-events-implicit-capture.html:
* pointerevents/ios/pointer-events-is-primary-expected.txt:
* pointerevents/ios/pointer-events-is-primary.html:

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

4 months agoChange String::number to use "shortest" instead of "fixed precision 6 digits"
darin@apple.com [Sun, 19 May 2019 18:17:40 +0000 (18:17 +0000)]
Change String::number to use "shortest" instead of "fixed precision 6 digits"
https://bugs.webkit.org/show_bug.cgi?id=178319

Reviewed by Sam Weinig.

Source/WebCore:

* accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
(webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision
instead of String::number to be explicit about the fact that it's fixed precision.
* page/linux/ResourceUsageOverlayLinux.cpp:
(gcTimerString): Ditto.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printTransform): Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision.
(printLayer): Ditto.
(WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(buildVariationSettings): Ditto.

* svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision. We'll consider moving
to shortest later.

* svg/SVGPathUtilities.cpp:
(WebCore::buildStringFromPath): Use appendNumberShortest instead of
appendNumberECMAScript since these are single-precision.

* svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision. We'll consider moving
to shortest later.
* svg/SVGTransformValue.h: Ditto.

Source/WTF:

* wtf/text/StringBuilder.h: Delete appendNumber for floating point and
appendECMAScriptNumber for single-precision.

* wtf/text/WTFString.h: Delete String::number for floating point and
numberToStringECMAScript for single-precision.

Tools:

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::testStringNumberFixedPrecision): Use String::numberToStringFixedPrecision.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(attributesOfElement): Use appendFixedPrecisionNumber.

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

4 months agoWeb Inspector: Decrease spacing before and after tooltip paragraphs
nvasilyev@apple.com [Sun, 19 May 2019 17:12:04 +0000 (17:12 +0000)]
Web Inspector: Decrease spacing before and after tooltip paragraphs
https://bugs.webkit.org/show_bug.cgi?id=198024

Reviewed by Joseph Pecoraro.

* UserInterface/Views/Popover.css:
(.popover p): Added.
(.popover p + p): Added.

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

4 months agoLayers painting into shared backing need to contribute to overlap
simon.fraser@apple.com [Sun, 19 May 2019 14:01:15 +0000 (14:01 +0000)]
Layers painting into shared backing need to contribute to overlap
https://bugs.webkit.org/show_bug.cgi?id=198021

Reviewed by Zalan Bujtas.
Source/WebCore:

Layers that paint into a composited (non-root) layer get added to the overlap map so
that later layers correct overlap them; this is done via the test against currentState.compositingAncestor.

We need the same logic for layers that paint into shared backing; they need to behave
the same way in terms of how they contribute to overlap. We already had currentState.backingSharingAncestor
which was unused, but now use it for this, and correctly null it out when a layer composites.

Bug was noticed during testing, and not known to affect any websites (though it probably does).

Also move the overlap container popping into updateOverlapMap() so the two callers can
share the code, and more explicitly track whether a container was pushed.

Test: compositing/shared-backing/sharing-child-contributes-to-overlap.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::updateOverlapMap const):
* rendering/RenderLayerCompositor.h:

LayoutTests:

* compositing/shared-backing/sharing-child-contributes-to-overlap-expected.html: Added.
* compositing/shared-backing/sharing-child-contributes-to-overlap.html: Added.

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

4 months agoRevert r240956
commit-queue@webkit.org [Sun, 19 May 2019 07:46:45 +0000 (07:46 +0000)]
Revert r240956
https://bugs.webkit.org/show_bug.cgi?id=198007
<rdar://problem/49808949>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-19
Reviewed by Alexey Proskuryakov.

r240956 made SafariForWebKitDevelopment crash when using WebKit nightly builds.
Since it's not needed and the binary reduction wasn't too big, just revert that revision.

* Shared/API/Cocoa/WKMain.h: Removed.
* Shared/API/Cocoa/WKMain.mm: Removed.
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Removed.
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:

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

4 months ago[WebAuthN] Allow authenticators that support both CTAP and U2F to try U2F if CTAP...
jiewen_tan@apple.com [Sun, 19 May 2019 00:42:16 +0000 (00:42 +0000)]
[WebAuthN] Allow authenticators that support both CTAP and U2F to try U2F if CTAP fails in authenticatorGetAssertion
https://bugs.webkit.org/show_bug.cgi?id=197974
<rdar://problem/50879746>

Reviewed by Brent Fulgham.

Source/WebKit:

Authenticators that support both CTAP and U2F protocols can be used in a U2F enabled browser to create a credential in
U2F format. When such authenticator is used to login in WebKit, it will be treated as a CTAP authenticator. Since the
previous credential is in U2F format, the authenticator will not consider that as a valid credential when CTAP requests
come along for that U2F credential. Therefore the previous created U2F credential will not be asked at all, and users
will not be able to login. This situation is not well documented in the CTAP/WebAuthN spec yet.

To workaround the above issue, an authenticator that supports both protocols will be downgraded to a U2F authenticator
to ask a potential U2F credential once a valid error is returned regarding to the first CTAP request.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Authenticator.h:
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::downgrade):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::parseRequest):
(WebKit::MockHidConnection::feedReports):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::getAssertion):
(WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived):
(WebKit::CtapHidAuthenticator::tryDowngrade):
(WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const): Deleted.
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h:

Tools:

Add a canDowngrade option for mock hid devices to simulate the situation.

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAuthenticationMockConfiguration):

LayoutTests:

* http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https-expected.txt:
* http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html:
* http/wpt/webauthn/public-key-credential-get-failure-hid.https-expected.txt:
* http/wpt/webauthn/public-key-credential-get-failure-hid.https.html:
* http/wpt/webauthn/public-key-credential-get-success-u2f.https-expected.txt:
* http/wpt/webauthn/public-key-credential-get-success-u2f.https.html:
* http/wpt/webauthn/resources/util.js:

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

4 months agoAdd extra information to dumpJITMemory
tzagallo@apple.com [Sat, 18 May 2019 07:12:17 +0000 (07:12 +0000)]
Add extra information to dumpJITMemory
https://bugs.webkit.org/show_bug.cgi?id=197998

Reviewed by Saam Barati.

Source/JavaScriptCore:

Add ktrace events around the memory dump and mach_absolute_time to link the
events with the entries in the dump. Additionally, add a background queue
to flush on a configurable interval, since the atexit callback does not work
in every situation.

* jit/ExecutableAllocator.cpp:
(JSC::dumpJITMemory):
* runtime/Options.h:

Source/WTF:

Add a new trace point code for JSC::dumpJITMemory

* wtf/SystemTracing.h:

Tools:

Add description for the new dumpJITMemory trace point code.

* Tracing/SystemTracePoints.plist:

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

4 months agoWeb Inspector: Timelines: CPU/memory timeline bars sometimes don't draw correctly...
drousso@apple.com [Sat, 18 May 2019 05:27:06 +0000 (05:27 +0000)]
Web Inspector: Timelines: CPU/memory timeline bars sometimes don't draw correctly and jump around on scrolling
https://bugs.webkit.org/show_bug.cgi?id=197440
<rdar://problem/46886315>

Reviewed by Joseph Pecoraro.

When drawing the Memory/CPU graphs, we need to know about the record immediately before/after
what's overlapping the visible range so that the graph correctly slopes off the screen.

* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype.recordsInTimeRange):
(WI.Timeline.prototype.recordsOverlappingTimeRange): Deleted.
Merge `recordsOverlappingTimeRange` into `recordsInTimeRange` by accepting an options object
that determines whether to include the record before/after the first/last record that are
at all overlapping the range.

* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord):
(WI.CPUTimelineRecord.get samplingRatePerSecond): Added.
(WI.CPUTimelineRecord.prototype.adjustStartTimeToLastRecord): Added.
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord):
(WI.MemoryTimelineRecord.get samplingRatePerSecond): Added.
(WI.MemoryTimelineRecord.prototype.adjustStartTimeToLastRecord): Added.
Adjust the `startTime` of the record by the sampling rate (which is 500ms).

* UserInterface/Models/CPUTimeline.js: Added.
(WI.CPUTimeline.prototype.addRecord):
* UserInterface/Models/MemoryTimeline.js:
(WI.MemoryTimeline.prototype.addRecord): Added.
Adjust the `startTime` of the new record to be equal to the `endTime` of the last record.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype._recordSelected):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
(WI.CPUTimelineView.prototype._computeStatisticsData):
(WI.CPUTimelineView.prototype._attemptSelectIndicatatorTimelineRecord):
* UserInterface/Views/CPUTimelineOverviewGraph.js:
(WI.CPUTimelineOverviewGraph.prototype.layout):
(WI.CPUTimelineOverviewGraph.prototype._handleChartClick):
(WI.CPUTimelineOverviewGraph.prototype.get samplingRatePerSecond): Deleted.
(WI.CPUTimelineOverviewGraph.prototype.layout.yScaleForRecord): Deleted.

* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.prototype.layout):
* UserInterface/Views/MemoryTimelineOverviewGraph.js:
(WI.MemoryTimelineOverviewGraph.prototype.layout):

* UserInterface/Main.html:
* UserInterface/Test.html:

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

4 months agoWeb Inspector: Audit: make it easier to jump to any returned DOM node in the Elements tab
drousso@apple.com [Sat, 18 May 2019 05:10:30 +0000 (05:10 +0000)]
Web Inspector: Audit: make it easier to jump to any returned DOM node in the Elements tab
https://bugs.webkit.org/show_bug.cgi?id=197470
<rdar://problem/50466774>

Reviewed by Joseph Pecoraro.

Right now, the only way to jump to the Elements tab for any DOM nodes returned by an audit
is to context menu and "Reveal in DOM Tree". Providing a more visible/discoverable way to
jump to the Elements tab will help developers diagnose issues easier.

* UserInterface/Views/AuditTestCaseContentView.js:
(WI.AuditTestCaseContentView.prototype.layout):
* UserInterface/Views/AuditTestCaseContentView.css:
(.content-view.audit-test-case > section table):

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.set showGoToArrow): Added.
(WI.DOMTreeElement.prototype._buildTagDOM):
(WI.DOMTreeElement.prototype._nodeTitleInfo):
Provide a way to insert a go-to arrow right after the:
 - open tag, if the close tag is rendered on a separate line
 - close tag, if the close tag is rendered on the same line

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline):
Allow `DOMTreeOutline` to be non-selectable.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom:not(.non-selectable):focus li:matches(.selected, .hovered) .selection-area): Added.
(.tree-outline.dom:not(.non-selectable) li.hovered:not(.selected) .selection-area): Added.
(.tree-outline.dom li .html-tag ~ .go-to-arrow): Added.
(.tree-outline.dom li:not(.hovered) .html-tag ~ .go-to-arrow): Added.
(.tree-outline.dom:focus li:matches(.selected, .hovered) .selection-area): Deleted.
(.tree-outline.dom li.hovered:not(.selected) .selection-area): Deleted.
Ensure that hovering a non-selectable node doesn't change the background color.

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

4 months ago[WASM-References] Add support for Anyref in parameters and return types, Ref.null...
justin_michaud@apple.com [Sat, 18 May 2019 04:58:36 +0000 (04:58 +0000)]
[WASM-References] Add support for Anyref in parameters and return types, Ref.null and Ref.is_null for Anyref values.
https://bugs.webkit.org/show_bug.cgi?id=197969

JSTests:

Reviewed by Keith Miller.

Support the anyref type in Builder.js, plus add some extra error logging.
Add new folder for wasm references tests.

* wasm.yaml:
* wasm/Builder.js:
(const._isValidValue):
* wasm/references/anyref_modules.js: Added.
(Call.3.RefIsNull.End.End.WebAssembly.js.ident):
(Call.3.RefIsNull.End.End.WebAssembly.js.make_null):
(Call.3.RefIsNull.End.End.WebAssembly):
(undefined):
* wasm/references/is_null.js: Added.
* wasm/references/is_null_error.js: Added.
* wasm/spec-harness/index.js:
* wasm/wasm.json:

Source/JavaScriptCore:

Reviewed by Keith Miller.

Add a new runtime option for wasm references.
Add support for Anyref as a value type.
Add support for Anyref in parameters and return types of Wasm functions. JSValues are marshalled into/out of wasm Anyrefs
        as a black box, except null which becomes a Nullref value. Nullref is not expressible in the bytecode or in the js API.
Add Ref.null and Ref.is_null for Anyref values. Support for these functions with funcrefs is out of scope.

* runtime/Options.h:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::tmpForType):
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::AirIRGenerator::addConstant):
(JSC::Wasm::AirIRGenerator::addRefIsNull):
(JSC::Wasm::AirIRGenerator::addReturn):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addRefIsNull):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConventionAir::marshallArgument const):
(JSC::Wasm::CallingConventionAir::setupCall const):
* wasm/WasmFormat.h:
(JSC::Wasm::isValueType):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::FunctionParser):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::addRefIsNull):
* wasm/generateWasmOpsHeader.py:
(bitSet):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
* wasm/wasm.json:

Tools:

Run wasm tests additionally with wasmBBQUsesAir=0.

Reviewed by Keith Miller.

* Scripts/run-jsc-stress-tests:

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

4 months agoWeb Inspector: Elements: context menu items in DOM tree should work when not clicking...
drousso@apple.com [Sat, 18 May 2019 04:44:34 +0000 (04:44 +0000)]
Web Inspector: Elements: context menu items in DOM tree should work when not clicking directly on the node representation
https://bugs.webkit.org/show_bug.cgi?id=197541

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu): Added.
(WI.DOMTreeElement.prototype._populateTagContextMenu): Deleted.
(WI.DOMTreeElement.prototype._populateTextContextMenu): Deleted.
(WI.DOMTreeElement.prototype._populateNodeContextMenu): Deleted.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):

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

4 months agoImplement CSS `display: flow-root` (modern clearfix)
commit-queue@webkit.org [Sat, 18 May 2019 04:29:48 +0000 (04:29 +0000)]
Implement CSS `display: flow-root` (modern clearfix)
https://bugs.webkit.org/show_bug.cgi?id=165603

Patch by Joonghun Park <pjh0718@gmail.com> on 2019-05-17
Reviewed by Zalan Bujtas.

This change follows https://drafts.csswg.org/css-display-3/#valdef-display-flow-root as below.

'display: flow-root' generates a block container box, and lays out its contents using flow layout.
It always establishes a new block formatting context for its contents.

Source/WebCore:

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::equivalentBlockDisplay):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::createsNewFormattingContext const):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/style/RenderStyleConstants.h:

Source/WebInspectorUI:

* UserInterface/External/CodeMirror/css.js:

LayoutTests:

* TestExpectations:

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

4 months ago[CMake] Use builtin FindICU
don.olmstead@sony.com [Sat, 18 May 2019 02:38:38 +0000 (02:38 +0000)]
[CMake] Use builtin FindICU
https://bugs.webkit.org/show_bug.cgi?id=197934

Reviewed by Michael Catanzaro.

.:

Update CMake minimum required to 3.7. 3.7 has a FindICU module so the WebKit one
is removed. For non-Apple ports this just requires adding individual components of
ICU to find_package(ICU). For Apple ports the module does not work so the targets
created in FindICU are mirrored in target/icu.cmake.

* CMakeLists.txt:
* Source/cmake/FindICU.cmake: Removed.
* Source/cmake/OptionsAppleWin.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/target/icu.cmake: Added.

Source/JavaScriptCore:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebCore:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformPlayStation.cmake:
* PlatformWPE.cmake:

Source/WebCore/PAL:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* pal/CMakeLists.txt:

Source/WebDriver:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* PlatformWPE.cmake:

Source/WebKit:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:

Source/WebKitLegacy:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WTF:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
up propagating to all consumers of WTF.

* wtf/CMakeLists.txt:
* wtf/PlatformPlayStation.cmake:

Tools:

Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

* TestWebKitAPI/PlatformMac.cmake:
* TestWebKitAPI/PlatformPlayStation.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* WebKitTestRunner/CMakeLists.txt:

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

4 months agoEnable legacy EME for iOS WKWebView
commit-queue@webkit.org [Sat, 18 May 2019 02:12:13 +0000 (02:12 +0000)]
Enable legacy EME for iOS WKWebView
https://bugs.webkit.org/show_bug.cgi?id=197964
<rdar://problem/50625666>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-17
Reviewed by Wenson Hsieh.

Source/WebCore:

This was attempted unsuccessfully in r230169.
Verified manually that it works as desired.

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm:
(TEST):

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

4 months agoREGRESSION (r245170): gmail.com inbox table header flickers
simon.fraser@apple.com [Sat, 18 May 2019 01:32:03 +0000 (01:32 +0000)]
REGRESSION (r245170): gmail.com inbox table header flickers
https://bugs.webkit.org/show_bug.cgi?id=198005
<rdar://problem/50907718>

Reviewed by Antti Koivisto.

Source/WebCore:

When a layer started as painting into shared backing, but then became independently
composited (e.g. by having to clip composited children), it wouldn't have the "overlap"
indirect compositing reason. This allowed requiresOwnBackingStore() to say that it
could paint into some ancestor, but this breaks overlap. So in this code path,
put IndirectCompositingReason::Overlap back on the layer which restores the previous
behavior.

Make some logging changes to help diagnose things like this.

Test: compositing/shared-backing/overlap-after-end-sharing.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
* rendering/RenderLayerCompositor.h:

LayoutTests:

* compositing/shared-backing/overlap-after-end-sharing-expected.html: Added.
* compositing/shared-backing/overlap-after-end-sharing.html: Added.

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

4 months ago[ews-build] Add clickable url in UI for uploaded S3 archive
aakash_jain@apple.com [Fri, 17 May 2019 23:45:38 +0000 (23:45 +0000)]
[ews-build] Add clickable url in UI for uploaded S3 archive
https://bugs.webkit.org/show_bug.cgi?id=197996

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:

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

4 months agoASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDelete...
sihui_liu@apple.com [Fri, 17 May 2019 23:44:23 +0000 (23:44 +0000)]
ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)
https://bugs.webkit.org/show_bug.cgi?id=197741
<rdar://problem/50625006>

Reviewed by Youenn Fablet.

If an open request is made before a delete request, open task should be performed before delete task on the
database thread. After r242911, open request needs to wait decision of StorageQuotaManager before posting task
to database thread, while delete request needs not. This makes deletion happen before open.

We need to make sure tasks are in correct order by not starting next open or delete request when database is in
the middle of open or deletion.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):

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

4 months ago[ews-app] Status bubble should not turn orange when any build step has warnings
aakash_jain@apple.com [Fri, 17 May 2019 23:41:47 +0000 (23:41 +0000)]
[ews-app] Status bubble should not turn orange when any build step has warnings
https://bugs.webkit.org/show_bug.cgi?id=198000

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._does_build_contains_any_failed_step):

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

4 months agoREGRESSION(r244350): Web Inspector: Storage tab data grids aren't editable.
ross.kirsling@sony.com [Fri, 17 May 2019 23:11:02 +0000 (23:11 +0000)]
REGRESSION(r244350): Web Inspector: Storage tab data grids aren't editable.
https://bugs.webkit.org/show_bug.cgi?id=198003

Reviewed by Devin Rousso.

* UserInterface/Views/DOMStorageContentView.js:
(WI.DOMStorageContentView):
Fix typo.

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

4 months agoWeb Inspector: Dark Mode: Fix colors in network table waterfall container
commit-queue@webkit.org [Fri, 17 May 2019 23:07:21 +0000 (23:07 +0000)]
Web Inspector: Dark Mode: Fix colors in network table waterfall container
https://bugs.webkit.org/show_bug.cgi?id=197955

Patch by Jamal Nasser <jamaln@mail.com> on 2019-05-17
Reviewed by Devin Rousso.

* UserInterface/Views/NetworkTableContentView.css:
(.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-event):
(.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-activity):
(.network-table :not(.header) .cell.waterfall .waterfall-container > .area.dom-fullscreen):

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

4 months agoAdd a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
graouts@webkit.org [Fri, 17 May 2019 22:05:07 +0000 (22:05 +0000)]
Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
https://bugs.webkit.org/show_bug.cgi?id=197943
<rdar://problem/49078202>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html
       platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html

* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
(WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):

Source/WebKit:

* Shared/WebsiteLegacyOverflowScrollingTouchPolicy.h: Added.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

* fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode-expected.html: Added.
* fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html: Added.
* platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode-expected.txt: Added.
* platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html: Added.
* platform/ios/TestExpectations: Skip the new tests since they depend on code in WebKitAdditions.

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

4 months agoUnreviewed test gardening for macOS.
ryanhaddad@apple.com [Fri, 17 May 2019 21:55:11 +0000 (21:55 +0000)]
Unreviewed test gardening for macOS.

* platform/mac/TestExpectations: Land test expectations for rdar://problem/46000736.

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

4 months agoAdd SPI to set a list of hosts to which to send custom header fields cross-origin
achristensen@apple.com [Fri, 17 May 2019 21:50:02 +0000 (21:50 +0000)]
Add SPI to set a list of hosts to which to send custom header fields cross-origin
https://bugs.webkit.org/show_bug.cgi?id=197397

Reviewed by Geoff Garen.

Source/WebCore:

In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
We need the ability to specify what origins to send these headers to even if they are not first party requests.
We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
indicating that the headers are to be sent to all subdomains.

I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
I also added some new API tests for the new behavior.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/CustomHeaderFields.cpp: Added.
(WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
* loader/CustomHeaderFields.h: Added.
(WebCore::CustomHeaderFields::encode const):
(WebCore::CustomHeaderFields::decode):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomHeaderFields):
(WebCore::DocumentLoader::customHeaderFields const):
(WebCore::DocumentLoader::customHeaderFields): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

Source/WebKit:

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* SourcesCocoa.txt:
* UIProcess/API/APICustomHeaderFields.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesCopyCustomHeaderFields):
(WKWebsitePoliciesSetCustomHeaderFields):
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _customHeaderFields]):
(-[WKWebpagePreferences _setCustomHeaderFields:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
* UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
(-[_WKCustomHeaderFields init]):
(-[_WKCustomHeaderFields dealloc]):
(-[_WKCustomHeaderFields fields]):
(-[_WKCustomHeaderFields setFields:]):
(-[_WKCustomHeaderFields thirdPartyDomains]):
(-[_WKCustomHeaderFields setThirdPartyDomains:]):
(-[_WKCustomHeaderFields _apiObject]):
* UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies customHeaderFields]): Deleted.
(-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
(WebKit::WebViewImpl::accessibilityAttributeValue):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(TEST):
(expectLegacyHeaders):
(expectHeaders):
(-[CustomHeaderFieldsDelegate webView:decidePolicyForNavigationAction:preferences:decisionHandler:]):
(-[CustomHeaderFieldsDelegate webView:startURLSchemeTask:]):
(-[CustomHeaderFieldsDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.

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

4 months agoAvoid races in taking networking assertions for downloads by having both Networking...
beidson@apple.com [Fri, 17 May 2019 21:37:07 +0000 (21:37 +0000)]
Avoid races in taking networking assertions for downloads by having both Networking and UIProcess do it.
<rdar://problem/50564630> and https://bugs.webkit.org/show_bug.cgi?id=197995

Reviewed by Chris Dumez.

There's a fairly indeterminant time gap between when the UIProcess decides a load becomes a download
and when the NetworkProcess Download object is created, and therefore the download assertion to be taken.

The time gap can be long enough for the Networking process to suspend before the download actually starts.

There's the reverse race when the UIProcess tells a download to stop, as well.

By having both the UIProcess and NetworkProcess take an assertion on behalf of the NetworkProcess we
avoid the race.

* NetworkProcess/Downloads/DownloadMap.cpp:
(WebKit::DownloadMap::add):
(WebKit::DownloadMap::remove):

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):

* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
(WebKit::DownloadProxyMap::downloadFinished):
(WebKit::DownloadProxyMap::invalidate):
* UIProcess/Downloads/DownloadProxyMap.h:

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

4 months agoMake AVVideoCaptureSource more robust to configuration failures
youenn@apple.com [Fri, 17 May 2019 21:29:14 +0000 (21:29 +0000)]
Make AVVideoCaptureSource more robust to configuration failures
https://bugs.webkit.org/show_bug.cgi?id=197997
rdar://problem/50875662

Reviewed by Eric Carlson.

Covered by manual testing.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
Make sure to commit configuration once calling beginConfiguration.
In case of error in setting frame rate, log the error but continue capturing.

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

4 months agoUnreviewed build fix.
krollin@apple.com [Fri, 17 May 2019 20:36:47 +0000 (20:36 +0000)]
Unreviewed build fix.

Teach generate-xcfilelists about iphonesimulator.

* Scripts/webkitpy/generate_xcfilelists_lib/generators.py:
(JavaScriptCoreGenerator):
(WebCoreGenerator):
(WebKitGenerator):

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

4 months agoImplement imagesrcset and imagesizes attributes on link rel=preload
commit-queue@webkit.org [Fri, 17 May 2019 20:34:42 +0000 (20:34 +0000)]
Implement imagesrcset and imagesizes attributes on link rel=preload
https://bugs.webkit.org/show_bug.cgi?id=192950

Patch by Rob Buis <rbuis@igalia.com> on 2019-05-17
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Import relevant tests for this feature.

* web-platform-tests/preload/dynamic-adding-preload-imagesrcset-expected.txt: Added.
* web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html: Added.
* web-platform-tests/preload/link-header-preload-delay-onload-expected.txt: Added.
* web-platform-tests/preload/link-header-preload-delay-onload.html: Added.
* web-platform-tests/preload/link-header-preload-delay-onload.html.headers: Added.
* web-platform-tests/preload/link-header-preload-expected.txt: Added.
* web-platform-tests/preload/link-header-preload-imagesrcset-expected.txt: Added.
* web-platform-tests/preload/link-header-preload-imagesrcset.html: Added.
* web-platform-tests/preload/link-header-preload-imagesrcset.html.headers: Added.
* web-platform-tests/preload/link-header-preload-nonce-expected.txt: Added.
* web-platform-tests/preload/link-header-preload-nonce.html: Added.
* web-platform-tests/preload/link-header-preload-nonce.html.headers: Added.
* web-platform-tests/preload/link-header-preload.html: Added.
* web-platform-tests/preload/link-header-preload.html.headers: Added.
* web-platform-tests/preload/onload-event-expected.txt: Added.
* web-platform-tests/preload/onload-event.html: Added.
* web-platform-tests/preload/preload-csp.sub-expected.txt:
* web-platform-tests/preload/preload-csp.sub.html:
* web-platform-tests/preload/preload-default-csp.sub-expected.txt:
* web-platform-tests/preload/preload-default-csp.sub.html:
* web-platform-tests/preload/preload-with-type-expected.txt: Added.
* web-platform-tests/preload/preload-with-type.html: Added.
* web-platform-tests/preload/resources/A4.ogv: Added.
* web-platform-tests/preload/resources/A4.ogv.sub.headers: Added.
* web-platform-tests/preload/resources/cross-origin-module.py: Added.
(main):
* web-platform-tests/preload/resources/dummy-preloads-subresource.css: Added.
* web-platform-tests/preload/resources/dummy-preloads-subresource.css.sub.headers: Added.
* web-platform-tests/preload/resources/empty.html: Added.
* web-platform-tests/preload/resources/empty.html.sub.headers: Added.
* web-platform-tests/preload/resources/foo.vtt.sub.headers: Added.
* web-platform-tests/preload/resources/module1.js: Added.
* web-platform-tests/preload/resources/module2.js: Added.
* web-platform-tests/preload/resources/preload_helper.js:
(verifyNumberOfResourceTimingEntries):
(numberOfResourceTimingEntries):
(verifyLoadedAndNoDoubleDownload):
* web-platform-tests/preload/single-download-preload-expected.txt:
* web-platform-tests/preload/single-download-preload.html:

Source/WebCore:

Implement imagesrcset and imagesizes attributes for both Link header
and link element.

Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html
       imported/w3c/web-platform-tests/preload/link-header-preload-delay-onload.html
       imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html
       imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html
       imported/w3c/web-platform-tests/preload/link-header-preload.html
       imported/w3c/web-platform-tests/preload/onload-event.html
       imported/w3c/web-platform-tests/preload/preload-with-type.html

* html/HTMLAttributeNames.in:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/HTMLLinkElement.idl:
* loader/LinkHeader.cpp:
(WebCore::paramterNameFromString):
(WebCore::LinkHeader::setValue):
(WebCore::LinkHeader::LinkHeader):
* loader/LinkHeader.h:
(WebCore::LinkHeader::imageSrcSet const):
(WebCore::LinkHeader::imageSizes const):
(WebCore::LinkHeader::isViewportDependent const):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader):
(WebCore::LinkLoader::preloadIfNeeded):
(WebCore::LinkLoader::loadLink):
* loader/LinkLoader.h:

LayoutTests:

Write special expectation for link-header-preload-imagesrcset.html because test runner
uses different dimensions on iOS.

* platform/ios-simulator-12-wk2/imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset-expected.txt: Added.
* platform/ios-simulator-12-wk2/imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset-expected.txt: Added.

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

4 months agoRe-enable generate-xcfilelists
krollin@apple.com [Fri, 17 May 2019 19:29:17 +0000 (19:29 +0000)]
Re-enable generate-xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=197933
<rdar://problem/50831677>

Reviewed by Jonathan Bedard.

The following two tasks have been completed, and we can re-enable
generate-xcfilelists:

Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)

Source/JavaScriptCore:

* Scripts/check-xcfilelists.sh:

Source/WebCore:

No new tests -- no change in user-visible functionality.

* Scripts/check-xcfilelists.sh:

Source/WebKit:

* Scripts/check-xcfilelists.sh:

Tools:

* DumpRenderTree/Scripts/check-xcfilelists.sh:
* WebKitTestRunner/Scripts/check-xcfilelists.sh:

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

4 months agomedia/controls-after-reload.html failing on iOS after unskip
sroberts@apple.com [Fri, 17 May 2019 19:05:01 +0000 (19:05 +0000)]
media/controls-after-reload.html failing on iOS after unskip

Unreviewed test gardening.

* platform/ios/TestExpectations: Skipping in iOS

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

4 months agoFix a typo in some user agent string logic
wenson_hsieh@apple.com [Fri, 17 May 2019 18:56:59 +0000 (18:56 +0000)]
Fix a typo in some user agent string logic
https://bugs.webkit.org/show_bug.cgi?id=197992
<rdar://problem/50895962>

Reviewed by Brent Fulgham.

Adjust the major version number for the desktop user agent string.

* platform/ios/UserAgentIOS.mm:
(WebCore::standardUserAgentWithApplicationName):

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

4 months agoREGRESSION (r245170): gmail.com header flickers when hovering over the animating...
simon.fraser@apple.com [Fri, 17 May 2019 18:28:34 +0000 (18:28 +0000)]
REGRESSION (r245170): gmail.com header flickers when hovering over the animating buttons
https://bugs.webkit.org/show_bug.cgi?id=197975
<rdar://problem/50865946>

Reviewed by Antti Koivisto.

Source/WebCore:

When computeCompositingRequirements() determined that a layer could paint into shared backing, it
pushed an overlap container. If that layer then converted to normal composting, we'd push a second
overlap container, which left the overlap map in a bad state for the rest of the compositing
traversal, causing layers to not get composited when necessary.

Test: compositing/shared-backing/overlap-after-shared-to-composited.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):

LayoutTests:

* compositing/shared-backing/overlap-after-shared-to-composited-expected.html: Added.
* compositing/shared-backing/overlap-after-shared-to-composited.html: Added.

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

4 months agoUnreviewed, rolling out r245401.
commit-queue@webkit.org [Fri, 17 May 2019 17:30:22 +0000 (17:30 +0000)]
Unreviewed, rolling out r245401.
https://bugs.webkit.org/show_bug.cgi?id=197990

Causing internal build failures (Requested by ShawnRoberts on
#webkit).

Reverted changeset:

"Add SPI to set a list of hosts to which to send custom header
fields cross-origin"
https://bugs.webkit.org/show_bug.cgi?id=197397
https://trac.webkit.org/changeset/245401

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

4 months agoSVGElement should detach itself from all its properties before it is deleted
said@apple.com [Fri, 17 May 2019 17:26:05 +0000 (17:26 +0000)]
SVGElement should detach itself from all its properties before it is deleted
https://bugs.webkit.org/show_bug.cgi?id=197954

Reviewed by Simon Fraser.

Source/WebCore:

Before deleting the SVGElement node, SVGElement::detachAllProperties()
needs to be called. This will make the properties be detached objects
which means no change will be committed unless these properties are
attached to another owner.

Test: svg/dom/svg-properties-detach-change.html

* dom/Node.cpp:
(WebCore::Node::removedLastRef):
* svg/SVGElement.h:
(WebCore::SVGElement::detachAllProperties):

LayoutTests:

* svg/dom/svg-properties-detach-change-expected.txt: Added.
* svg/dom/svg-properties-detach-change.html : Added.

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

4 months agoUnreviewed, rolling out r245418.
commit-queue@webkit.org [Fri, 17 May 2019 17:22:40 +0000 (17:22 +0000)]
Unreviewed, rolling out r245418.
https://bugs.webkit.org/show_bug.cgi?id=197989

New API test causing crashes on Mojave testers (Requested by
ShawnRoberts on #webkit).

Reverted changeset:

"Add a unit test for client certificate authentication"
https://bugs.webkit.org/show_bug.cgi?id=197800
https://trac.webkit.org/changeset/245418

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

4 months agoAllow sequential playback of media files when initial playback started with a user...
eric.carlson@apple.com [Fri, 17 May 2019 16:39:09 +0000 (16:39 +0000)]
Allow sequential playback of media files when initial playback started with a user gesture
https://bugs.webkit.org/show_bug.cgi?id=197959
<rdar://problem/50655207>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: media/playlist-inherits-user-gesture.html

* dom/Document.cpp:
(WebCore::Document::processingUserGestureForMedia const): Return true if it is within
one second of the last HTMLMediaElement 'ended' event.
* dom/Document.h:
(WebCore::Document::mediaFinishedPlaying):

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): removeBehaviorsRestrictionsAfterFirstUserGesture ->
removeBehaviorRestrictionsAfterFirstUserGesture.
(WebCore::HTMLMediaElement::load): Ditto. Don't call removeBehaviorsRestrictionsAfterFirstUserGesture,
it will be done in prepareForLoad.
(WebCore::HTMLMediaElement::prepareForLoad): removeBehaviorsRestrictionsAfterFirstUserGesture ->
removeBehaviorRestrictionsAfterFirstUserGesture.
(WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto.
(WebCore::HTMLMediaElement::play): Ditto.
(WebCore::HTMLMediaElement::pause): Ditto.
(WebCore::HTMLMediaElement::setVolume): Ditto.
(WebCore::HTMLMediaElement::setMuted): Ditto.
(WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Ditto.
(WebCore::HTMLMediaElement::dispatchEvent): Call document().mediaFinishedPlaying()
when dispatching the 'ended' event.
(WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture): Rename. Set
m_removedBehaviorRestrictionsAfterFirstUserGesture.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Deleted.
* html/HTMLMediaElement.h:

* html/HTMLVideoElement.cpp:
(WebCore:HTMLVideoElement::nativeImageForCurrentTime): Convert to runtime logging.
(WebCore:HTMLVideoElement::webkitEnterFullscreen): Ditto.
(WebCore:HTMLVideoElement::webkitSetPresentationMode): Ditto.
(WebCore:HTMLVideoElement::fullscreenModeChanged): Ditto.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::removeBehaviorRestriction): Update log message.

LayoutTests:

* media/media-fullscreen.js: Insert a pause between tests to clear the user gesture
used in the first test.
* media/playlist-inherits-user-gesture-expected.txt: Added.
* media/playlist-inherits-user-gesture.html: Added.

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

4 months agoUnmark several skipped tests in wk2
tsavell@apple.com [Fri, 17 May 2019 16:27:34 +0000 (16:27 +0000)]
Unmark several skipped tests in wk2
https://bugs.webkit.org/show_bug.cgi?id=197987

Unreviewed test gardening

* platform/wk2/TestExpectations:

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

4 months ago[iOS] Respect scrolling="no" on composited frames
antti@apple.com [Fri, 17 May 2019 16:14:06 +0000 (16:14 +0000)]
[iOS] Respect scrolling="no" on composited frames
https://bugs.webkit.org/show_bug.cgi?id=197972
<rdar://problem/50252398>

Reviewed by Simon Fraser.

Source/WebKit:

* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

Disallow scrolling based on canHaveScrollbars, similar to main frame.

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):

Factor into a function.

LayoutTests:

* fast/scrolling/ios/body-overflow-hidden-frame-expected.html:
* fast/scrolling/ios/body-overflow-hidden-frame.html:

Also fix overflow:hidden test so that the frame content forces composition.

* fast/scrolling/ios/frame-scrolling-no-expected.html: Added.
* fast/scrolling/ios/frame-scrolling-no.html: Added.

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

4 months agoHardening: Prevent FrameLoader crash due to SetForScope
bfulgham@apple.com [Fri, 17 May 2019 16:03:36 +0000 (16:03 +0000)]
Hardening: Prevent FrameLoader crash due to SetForScope
https://bugs.webkit.org/show_bug.cgi?id=197458
<rdar://problem/50368338>

Reviewed by Chris Dumez.

Since SetForScope takes action during a function returns, it might cause
a crash if its scope is broader than the value it is resetting.

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

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

4 months agoUnreviewed. Fix variations shown in GTK emoji chooser after r245460.
carlosgc@webkit.org [Fri, 17 May 2019 15:07:14 +0000 (15:07 +0000)]
Unreviewed. Fix variations shown in GTK emoji chooser after r245460.

We are tno showing the variations in the sub-popover because of a missing parameter in
webkitEmojiChooserAddEmoji() call.

* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
(webkitEmojiChooserShowVariations): Pass prepend parameter to webkitEmojiChooserAddEmoji().

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

4 months ago[ews-build] Add build step to Transfer archive to S3
aakash_jain@apple.com [Fri, 17 May 2019 14:32:17 +0000 (14:32 +0000)]
[ews-build] Add build step to Transfer archive to S3
https://bugs.webkit.org/show_bug.cgi?id=197922

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(TransferToS3):
(TransferToS3.finished): Invoke triggers after transfer is successful.
(TransferToS3.getResultSummary): Create more readable failure string.
(UploadBuiltProduct.finished): Deleted. Moved the trigger invocation after TransferToS3.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

4 months ago[GTK] Need WebKitContextMenuItemType to open emoji picker
carlosgc@webkit.org [Fri, 17 May 2019 12:39:30 +0000 (12:39 +0000)]
[GTK] Need WebKitContextMenuItemType to open emoji picker
https://bugs.webkit.org/show_bug.cgi?id=176760

Reviewed by Michael Catanzaro.

Source/WebCore:

Add a new context menu item to insert an emoji.

* loader/EmptyClients.cpp: Empty implementation of ContextMenuClient::insertEmoji().
* page/ContextMenuClient.h: Add insertEmoji for GTK port.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Handle insert emoji action.
(WebCore::ContextMenuController::populate): Add insert emoji item after select all.
(WebCore::ContextMenuController::checkOrEnableIfNeeded const): Handle insert emoji action.
* platform/ContextMenuItem.h: Add insert emoji action.
* platform/LocalizedStrings.h:
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::contextMenuItemTagInsertEmoji):

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add WebKitEmojiChooser.cpp.

Source/WebKit:

Add a default implementation to show the emoji chooser when requested by the application, either using the
context menu or keyboard shortcuts. GtkEmojiChooser is private in GTK, so we include our own copy, adapted to
the WebKit coding style. The emoji chooser is always shown by default when using GTK >= 3.24 for any editable
content. I'm going to add public API in a follow up patch to be able to use your own chooser, or even prevent
the default chooser from being shown, similar to what we do for other UI elements like file chooser, color
chooser, print dialog, etc.

* Shared/API/glib/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetActionTag): Handle insert emoji action.
(webkitContextMenuActionGetForContextMenuItem): Ditto.
(webkitContextMenuActionGetLabel): Ditto.
* SourcesGTK.txt:
* UIProcess/API/gtk/WebKitContextMenuActions.h:
* UIProcess/API/gtk/WebKitEmojiChooser.cpp: Added.
(webkitEmojiChooserAddEmoji):
(webkitEmojiChooserAddRecentItem):
(emojiActivated):
(emojiDataHasVariations):
(webkitEmojiChooserShowVariations):
(emojiLongPressed):
(emojiPressed):
(emojiPopupMenu):
(verticalAdjustmentChanged):
(webkitEmojiChooserSetupSectionBox):
(scrollToSection):
(webkitEmojiChooserSetupSectionButton):
(webkitEmojiChooserSetupRecent):
(webkitEmojiChooserEnsureEmptyResult):
(webkitEmojiChooserSearchChanged):
(webkitEmojiChooserSetupFilters):
(webkitEmojiChooserInitializeEmojiMaxWidth):
(webkitEmojiChooserConstructed):
(webkitEmojiChooserShow):
(webkit_emoji_chooser_class_init):
(webkitEmojiChooserNew):
* UIProcess/API/gtk/WebKitEmojiChooser.h: Added.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate): Add a timer to release the emoji chooser if not used
after 2 minutes.
(_WebKitWebViewBasePrivate::releaseEmojiChooserTimerFired): Destroy the emoji chooser.
(emojiChooserEmojiPicked): Complete the operation using the given emoji text.
(emojiChooserClosed): Complete the operation if needed using an empty string.
(webkitWebViewBaseShowEmojiChooser): Create the emoji chooser if needed and show it.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/WebPageProxy.h: Add showEmojiPicker().
* UIProcess/WebPageProxy.messages.in: Add ShowEmojiPicker message.
* UIProcess/gtk/KeyBindingTranslator.cpp:
(WebKit::insertEmojiCallback): Add GtkInsertEmoji command.
(WebKit::KeyBindingTranslator::KeyBindingTranslator): Connect to insert-emoji signal.
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::showEmojiPicker): Call webkitWebViewBaseShowEmojiChooser().
* WebProcess/WebCoreSupport/WebContextMenuClient.h: Override insertEmoji() for GTK port.
* WebProcess/WebCoreSupport/WebEditorClient.h: Add insertEmoji() for GTK port.
* WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
(WebKit::WebContextMenuClient::insertEmoji): Call WebPage::showEmojiPicker().
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleGtkEditorCommand): Call WebPage::showEmojiPicker() if command is GtkInsertEmoji.
(WebKit::WebEditorClient::executePendingEditorCommands): Handle Gtk specific commands.
(WebKit::WebEditorClient::handleKeyboardEvent): Use a reference instead of a pointer for Frame.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::showEmojiPicker): Send ShowEmojiPicker message to the UI process.

Tools:

Update context menu test to check insert emoji action is included in default context menu for editable content.

* TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp:

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

5 months ago[ews-build] Download archives from S3
aakash_jain@apple.com [Fri, 17 May 2019 04:30:32 +0000 (04:30 +0000)]
[ews-build] Download archives from S3
https://bugs.webkit.org/show_bug.cgi?id=197949

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(DownloadBuiltProduct): Updated to use S3 URL.
(DownloadBuiltProduct.getResultSummary): Method to display custom failure string.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

5 months agoWasm should cage the memory base pointers in structs
keith_miller@apple.com [Fri, 17 May 2019 02:21:51 +0000 (02:21 +0000)]
Wasm should cage the memory base pointers in structs
https://bugs.webkit.org/show_bug.cgi?id=197620

Reviewed by Saam Barati.

Source/bmalloc:

Fix signature to take Gigacage::Kind, which matches GIGACAGE_ENABLED build.

* bmalloc/Gigacage.h:
(Gigacage::isEnabled):

Source/JavaScriptCore:

Currently, we use cageConditionally; this only matters for API
users since the web content process cannot disable primitive
gigacage. This patch also adds a set helper for union/intersection
of RegisterSets.

* assembler/CPU.h:
(JSC::isARM64E):
* jit/RegisterSet.h:
(JSC::RegisterSet::set):
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::AirIRGenerator::addCallIndirect):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmInstance.h:
(JSC::Wasm::Instance::cachedMemory const):
(JSC::Wasm::Instance::updateCachedMemory):
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::grow):
* wasm/WasmMemory.h:
(JSC::Wasm::Memory::memory const):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

Source/WTF:

Rename reauthenticate to recage.

* wtf/CagedPtr.h:
(WTF::CagedPtr::recage):
(WTF::CagedPtr::reauthenticate): Deleted.

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

5 months agoREGRESSION (r15133): Fix leak of JSStringRef in minidom
ddkilzer@apple.com [Fri, 17 May 2019 01:17:47 +0000 (01:17 +0000)]
REGRESSION (r15133): Fix leak of JSStringRef in minidom
<https://webkit.org/b/197968>
<rdar://problem/50872430>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* API/tests/minidom.c:
(print): Call JSStringRelease() to fix the leak.

Tools:

* TestWebKitAPI/Tests/WebKitObjC/UserContentTest.mm:
(expectScriptValueIsString): Drive-by fix to use adopt() instead
of JSRetainPtr<JSStringRef> string(Adopt, JSValueToStringCopy(...)).

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

5 months agoAX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
commit-queue@webkit.org [Fri, 17 May 2019 00:07:44 +0000 (00:07 +0000)]
AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
https://bugs.webkit.org/show_bug.cgi?id=197764
<rdar://problem/50649689>

Patch by Greg Doolittle <gr3g@apple.com> on 2019-05-16
Reviewed by Chris Fleizach.

Specifically these:
- ariaActiveDescendant
- ariaControls
- ariaDescribedBy
- ariaDetails
- ariaErrorMessage
- ariaFlowTo
- ariaLabelledBy
- ariaOwns

Source/WebCore:

Test: LayoutTests/accessibility/ARIA-reflections.html (updated)

* accessibility/AriaAttributes.idl:

LayoutTests:

* accessibility/ARIA-reflection-expected.txt: Updated.
* accessibility/ARIA-reflection.html: Updated.

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

5 months agoStorage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasSto...
wilander@apple.com [Thu, 16 May 2019 23:33:39 +0000 (23:33 +0000)]
Storage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess() when feature is off
https://bugs.webkit.org/show_bug.cgi?id=197967
<rdar://problem/50753129>

Reviewed by Brent Fulgham.

Source/WebKit:

NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess()
should call their completion handlers when there is no Resource Load Statistics object, i.e. when Resource
Load Statistics is off. This happens for ephemeral sessions which made code for federated login providers
hang, waiting for the result to document.hasStorageAccess().

The existing layout test case was augmented to use an ephemeral session.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):

LayoutTests:

* http/tests/storageAccess/has-storage-access-true-if-feature-off.html:
* platform/mac-wk2/TestExpectations:
    Test case marked as [ Pass ].

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

5 months agoREGRESSION (r84160): Leak of OpaqueJSString under WTR::JSTestRunner::pathToLocalResou...
ddkilzer@apple.com [Thu, 16 May 2019 23:24:10 +0000 (23:24 +0000)]
REGRESSION (r84160): Leak of OpaqueJSString under WTR::JSTestRunner::pathToLocalResource (32 bytes) in com.apple.WebKit.WebContent running layout tests
<https://webkit.org/b/197965>

Reviewed by Joseph Pecoraro.

* WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm:
(WTR::TestRunner::pathToLocalResource): Don't call
JSStringRetain() here because the JSRetainPtr<JSStringRef>
return type will increment the retain count for us.

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

5 months agoAdd a unit test for client certificate authentication
commit-queue@webkit.org [Thu, 16 May 2019 23:08:46 +0000 (23:08 +0000)]
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-16
Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/cf/ArgumentCodersCF.cpp:
Move SPI declarations to SecuritySPI.h.

Source/WTF:

* wtf/spi/cocoa/SecuritySPI.h:
Move declarations from ArgumentCodersCF.cpp so they can be shared.

Tools:

Make better abstractions for reading and writing from/to TCPServer.
Add a unit test that causes a client certificate authentication challenge to happen.

* TestWebKitAPI/TCPServer.cpp:
(TestWebKitAPI::TCPServer::TCPServer):
(TestWebKitAPI::TCPServer::read):
(TestWebKitAPI::TCPServer::write):
(TestWebKitAPI::TCPServer::respondWithChallengeThenOK):
(TestWebKitAPI::TCPServer::respondWithOK):
* TestWebKitAPI/TCPServer.h:
* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(credentialWithIdentity):
(-[ChallengeDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(TEST):
(-[ClientCertificateDelegate webView:didFinishNavigation:]):
(-[ClientCertificateDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(-[ClientCertificateDelegate challengeCount]):
(TestWebKitAPI::TEST):
(respondWithChallengeThenOK): Deleted.
(credentialWithIdentityAndKeychainPath): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
(TEST):
(readRequest): Deleted.
(writeResponse): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):
(TestWebKitAPI::respondWithChallengeThenOK): Deleted.

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

5 months agoCoreAudioCaptureSource should be marked as an audio capture track
youenn@apple.com [Thu, 16 May 2019 21:50:05 +0000 (21:50 +0000)]
CoreAudioCaptureSource should be marked as an audio capture track
https://bugs.webkit.org/show_bug.cgi?id=197953
<rdar://problem/50552007>

Reviewed by Eric Carlson.

Manually tested.

* platform/mediastream/mac/CoreAudioCaptureSource.h:
Mark it as microphone so that it can get muted properly.

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

5 months ago[JSC] Invalid AssignmentTargetType should be an early error.
ross.kirsling@sony.com [Thu, 16 May 2019 20:08:22 +0000 (20:08 +0000)]
[JSC] Invalid AssignmentTargetType should be an early error.
https://bugs.webkit.org/show_bug.cgi?id=197603

Reviewed by Keith Miller.

JSTests:

* test262/expectations.yaml:
Update expectations to reflect new SyntaxErrors.
(Ideally, these should all be viewed as passing in the near future.)

* stress/async-await-basic.js:
* stress/big-int-literals.js:
Update tests to reflect new SyntaxErrors.

* ChakraCore.yaml:
* ChakraCore/test/EH/try6.baseline-jsc:
* ChakraCore/test/Error/variousErrors3.baseline-jsc: Added.
Update baselines to reflect new SyntaxErrors.

Source/JavaScriptCore:

Since ES6, expressions like 0++, ++0, 0 = 0, and 0 += 0 are all specified as early errors:
  https://tc39.github.io/ecma262/#sec-update-expressions-static-semantics-early-errors
  https://tc39.github.io/ecma262/#sec-assignment-operators-static-semantics-early-errors

We currently throw late ReferenceErrors for these -- let's turn them into early SyntaxErrors.
(This is based on the expectation that https://github.com/tc39/ecma262/pull/1527 will be accepted;
if that doesn't come to pass, we can subsequently introduce early ReferenceError and revise these.)

* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitBytecode): Add an assert for "function call LHS" case.
(JSC::PrefixNode::emitBytecode): Add an assert for "function call LHS" case.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::isLocation): Added.
(JSC::ASTBuilder::isAssignmentLocation): Fix misleading parameter name.
(JSC::ASTBuilder::isFunctionCall): Added.
(JSC::ASTBuilder::makeAssignNode): Add an assert for "function call LHS" case.
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::isLocation): Added.
(JSC::SyntaxChecker::isAssignmentLocation): Fix incorrect definition and align with ASTBuilder.
(JSC::SyntaxChecker::isFunctionCall): Added.
* parser/Nodes.h:
(JSC::ExpressionNode::isFunctionCall const): Added.
Ensure that the parser can check whether an expression node is a function call.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::isSimpleAssignmentTarget): Added.
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseUnaryExpression): See below.
* parser/Parser.h:
Throw SyntaxError whenever an assignment or update expression's target is invalid.
Unfortunately, it seems that web compatibility obliges us to exempt the "function call LHS" case in sloppy mode.
(https://github.com/tc39/ecma262/issues/257#issuecomment-195106880)

Additional cleanup items:
  - Make use of `semanticFailIfTrue` for `isMetaProperty` checks, as it's equivalent.
  - Rename `requiresLExpr` to `hasPrefixUpdateOp` since it's now confusing,
    and get rid of `modifiesExpr` since it refers to the exact same condition.
  - Stop setting `lastOperator` near the end -- one case was incorrect and regardless neither is used.

LayoutTests:

* fast/events/window-onerror4-expected.txt:
* ietestcenter/Javascript/11.13.1-1-1-expected.txt:
* ietestcenter/Javascript/11.13.1-1-2-expected.txt:
* ietestcenter/Javascript/11.13.1-1-3-expected.txt:
* ietestcenter/Javascript/11.13.1-1-4-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/dom/assign-expected.txt:
* js/dom/line-column-numbers-expected.txt:
* js/dom/line-column-numbers.html:
* js/dom/postfix-syntax-expected.txt:
* js/dom/prefix-syntax-expected.txt:
* js/dom/script-tests/line-column-numbers.js:
* js/function-toString-parentheses-expected.txt:
* js/parser-syntax-check-expected.txt:
* js/parser-xml-close-comment-expected.txt:
* js/script-tests/function-toString-parentheses.js:
* js/script-tests/parser-syntax-check.js:
Update tests & expectations to reflect new SyntaxErrors.

* js/script-tests/toString-prefix-postfix-preserve-parens.js:
* js/toString-prefix-postfix-preserve-parens-expected.txt:
None of the prefix/postfix tests make sense here now that they're all SyntaxErrors;
remove them and just leave the typeof tests.

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

5 months agoLayout Test http/wpt/cache-storage/cache-quota-add.any.html is a flaky failure
youenn@apple.com [Thu, 16 May 2019 18:31:23 +0000 (18:31 +0000)]
Layout Test http/wpt/cache-storage/cache-quota-add.any.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=197952
<rdar://problem/50859168>

Unreviewed.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as slow as per flakiness dashboard.

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

5 months agoAdd SPI to set a list of hosts to which to send custom header fields cross-origin
commit-queue@webkit.org [Thu, 16 May 2019 18:08:30 +0000 (18:08 +0000)]
Add SPI to set a list of hosts to which to send custom header fields cross-origin
https://bugs.webkit.org/show_bug.cgi?id=197397

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-16
Reviewed by Geoff Garen.

Source/WebCore:

In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
We need the ability to specify what origins to send these headers to even if they are not first party requests.
We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
indicating that the headers are to be sent to all subdomains.

I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
I also added some new API tests for the new behavior.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/CustomHeaderFields.cpp: Added.
(WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
* loader/CustomHeaderFields.h: Added.
(WebCore::CustomHeaderFields::encode const):
(WebCore::CustomHeaderFields::decode):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomHeaderFields):
(WebCore::DocumentLoader::customHeaderFields const):
(WebCore::DocumentLoader::customHeaderFields): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

Source/WebKit:

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* SourcesCocoa.txt:
* UIProcess/API/APICustomHeaderFields.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesCopyCustomHeaderFields):
(WKWebsitePoliciesSetCustomHeaderFields):
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _customHeaderFields]):
(-[WKWebpagePreferences _setCustomHeaderFields:]):
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
* UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
* UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
(-[_WKCustomHeaderFields init]):
(-[_WKCustomHeaderFields dealloc]):
(-[_WKCustomHeaderFields fields]):
(-[_WKCustomHeaderFields setFields:]):
(-[_WKCustomHeaderFields thirdPartyDomains]):
(-[_WKCustomHeaderFields setThirdPartyDomains:]):
(-[_WKCustomHeaderFields _apiObject]):
* UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies customHeaderFields]): Deleted.
(-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeFocus):
(WebKit::WebViewImpl::accessibilityAttributeValue):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(TEST):
(expectLegacyHeaders):
(expectHeaders):
(-[CustomHeaderFieldsDelegate webView:decidePolicyForNavigationAction:preferences:decisionHandler:]):
(-[CustomHeaderFieldsDelegate webView:startURLSchemeTask:]):
(-[CustomHeaderFieldsDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.

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

5 months ago[iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key...
dbates@webkit.org [Thu, 16 May 2019 17:31:01 +0000 (17:31 +0000)]
[iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key (hardware or software keyboard)
https://bugs.webkit.org/show_bug.cgi?id=197632
<rdar://problem/47902054>

Add missing file that was inadvertently omitted from the patch.

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

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

5 months ago[iOS] Select all with existing range selection replaces range instead of selecting...
dbates@webkit.org [Thu, 16 May 2019 17:27:55 +0000 (17:27 +0000)]
[iOS] Select all with existing range selection replaces range instead of selecting all text
https://bugs.webkit.org/show_bug.cgi?id=197950
<rdar://problem/50245131>

Add missing file that was inadvertently omitted from the patch.

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

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

5 months ago[IntersectionObserver] Regression: No initial observation when nothing else triggers...
ajuma@chromium.org [Thu, 16 May 2019 13:54:56 +0000 (13:54 +0000)]
[IntersectionObserver] Regression: No initial observation when nothing else triggers rendering
https://bugs.webkit.org/show_bug.cgi?id=197891

Reviewed by Simon Fraser.

Source/WebCore:

Schedule a rendering update whenever a new IntersectionObserver target is added.

Test: intersection-observer/initial-observation.html

* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):

LayoutTests:

Add a test where other timers that can schedule rendering updates are disabled,
in order to verify that IntersectionObserver is scheduling rendering updates
itself.

* intersection-observer/initial-observation.html: Added.

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

5 months agoFix memcpy() call for big endian
commit-queue@webkit.org [Thu, 16 May 2019 13:38:10 +0000 (13:38 +0000)]
Fix memcpy() call for big endian
https://bugs.webkit.org/show_bug.cgi?id=197945

Patch by Eike Rathke <erack@redhat.com> on 2019-05-16
Reviewed by Michael Catanzaro.

* wtf/Packed.h:
(WTF::alignof):

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

5 months ago[WPE] Rendering on a HiDPI display looks scaled up instead of rendered at 2x
commit-queue@webkit.org [Thu, 16 May 2019 11:48:52 +0000 (11:48 +0000)]
[WPE] Rendering on a HiDPI display looks scaled up instead of rendered at 2x
https://bugs.webkit.org/show_bug.cgi?id=185764

Patch by Ryan Walklin <ryan@testtoast.com> on 2019-05-16
Reviewed by Carlos Garcia Campos.

Add a function to the wpe_view_backend_client struct which accepts a device scale factor
configured through wpe_view_backend_dispatch_set_device_scale_factor() and calls
setIntrinsicDeviceScaleFactor for the the current View.Page object. The
function definition has been added in libwpe 1.3.

* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend): Add set_device_scale_factor implementation declared by libwpe.

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

5 months ago[FreeType] Some character sequences with a variation selector are not rendered
carlosgc@webkit.org [Thu, 16 May 2019 09:31:16 +0000 (09:31 +0000)]
[FreeType] Some character sequences with a variation selector are not rendered
https://bugs.webkit.org/show_bug.cgi?id=197838

Reviewed by Michael Catanzaro.

We get the invalid glyph instead. See http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/. In the table at
the end the Emoji and Text columns are not correctly rendered. It happens also when copying an emoji from
GtkEmojiChooser and pasting in WebKit text field, because GTK appends U+FE0F to all emojis to force the emoji
style. We need to take into account the variation selector when checking if a font can render a combining
sequence, using FT_Face_GetCharVariantIndex to get the right glyph in case of variation character present.

* platform/graphics/Font.cpp:
(WebCore::Font::platformSupportsCodePoint const): Add optional variation parameter.
(WebCore::Font::canRenderCombiningCharacterSequence const): Take into account variation selector characters
* platform/graphics/Font.h:
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Check variation selectors 0xFE0E and 0xFE0F to
decide whether to use the emoji or text style.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformSupportsCodePoint const): Return false when a variation character is passed so that
characters are checked individually.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformSupportsCodePoint const): Use FT_Face_GetCharVariantIndex when a variation character is
passed.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::harfBuzzFontFunctions): Do not return true when FT_Face_GetCharVariantIndex returns 0.

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

5 months agoUpdated screenHasInvertedColors to use AppKit when available
commit-queue@webkit.org [Thu, 16 May 2019 09:22:22 +0000 (09:22 +0000)]
Updated screenHasInvertedColors to use AppKit when available
https://bugs.webkit.org/show_bug.cgi?id=197935
<rdar://problem/50834405>

Patch by Greg Hughes <ghughes@apple.com> on 2019-05-16
Reviewed by Chris Fleizach.

* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::screenHasInvertedColors):

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

5 months agoAvoid a recursive descendants layer walk sometimes
simon.fraser@apple.com [Thu, 16 May 2019 05:41:08 +0000 (05:41 +0000)]
Avoid a recursive descendants layer walk sometimes
https://bugs.webkit.org/show_bug.cgi?id=197939

Reviewed by Zalan Bujtas.

If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive
descendant tree walk to add layers to the overlap map. However, all the descendants would already
have contributed to the overlap map if some non-root ancestor was already composited. So we can
skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's
a non-root composited ancestor.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):

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

5 months agoClean up code related to compositing overlap map maintenance
simon.fraser@apple.com [Thu, 16 May 2019 04:07:37 +0000 (04:07 +0000)]
Clean up code related to compositing overlap map maintenance
https://bugs.webkit.org/show_bug.cgi?id=197936

Reviewed by Zalan Bujtas.

Clarify the logic around updating the overlap map:

When a layer becomes composited, or paints into a non-root composited layer, we add it to the overlap map
after traversing descendants (since it only affets layers later in traversal).

If a layer became composited after traversing descendants, we need to go back and add all the descendants
to the overlap map with a recursive traversal.

We can do all this near the end of computeCompositingRequirements/traverseUnchangedSubtree because
we only check overlap when we enter this function on later layers.

Add a CompositingOverlap log channel and use it to log the state of the overlap map.

* platform/Logging.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::addToOverlapMap const):
(WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const):
(WebCore::RenderLayerCompositor::updateOverlapMap const):
(WebCore::RenderLayerCompositor::addToOverlapMap): Deleted.
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive): Deleted.
* rendering/RenderLayerCompositor.h:

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

5 months agoClean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchange...
simon.fraser@apple.com [Thu, 16 May 2019 02:51:15 +0000 (02:51 +0000)]
Clean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchangedSubtree()
https://bugs.webkit.org/show_bug.cgi?id=197931

Reviewed by Zalan Bujtas.

These functions have grown and become hard to maintain, so try to undo some technical debt.

Rename "childState" to "currentState" since it's the state we pass to children, but also
is state we change when the current layer becomes composited.

Separate the layerWillComposite() lambda from layerWillCompositePostDescendants().

Group the chunks of code at end of the functions into:
    - updating bits on RenderLayer
    - updating compositingState with changes from children and our state
    - doing post-traversal work on overlapMap and backingSharingState

Code shared between the two functions is pushed into CompositingState::updateWithDescendantStateAndLayer().

This moves code around but should not cause any behavior change.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty const):
(WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::clipsCompositingDescendants):
(WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): Deleted.
(WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): Deleted.
(WebCore::RenderLayerCompositor::clipsCompositingDescendants const): Deleted.
* rendering/RenderLayerCompositor.h:

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

5 months agoMake LayerOverlapMap able to output to a TextStream
simon.fraser@apple.com [Thu, 16 May 2019 02:51:12 +0000 (02:51 +0000)]
Make LayerOverlapMap able to output to a TextStream
https://bugs.webkit.org/show_bug.cgi?id=197923

Reviewed by Zalan Bujtas.

Make it possible output LayerOverlapMap to a TextStream for logging.

* rendering/LayerOverlapMap.cpp:
(WebCore::OverlapMapContainer::rectList const):
(WebCore::operator<<):
* rendering/LayerOverlapMap.h:
(WebCore::LayerOverlapMap::overlapStack const):

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

5 months ago[PlayStation] WTFCrash should preserve register state.
ross.kirsling@sony.com [Thu, 16 May 2019 01:30:18 +0000 (01:30 +0000)]
[PlayStation] WTFCrash should preserve register state.
https://bugs.webkit.org/show_bug.cgi?id=197932

Reviewed by Don Olmstead.

* wtf/Assertions.cpp:
* wtf/Assertions.h:
Let r196397 apply to PlayStation port as well.

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

5 months agoREGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleC...
timothy@apple.com [Wed, 15 May 2019 23:50:34 +0000 (23:50 +0000)]
REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance
https://bugs.webkit.org/show_bug.cgi?id=197930
rdar://problem/49833954

Reviewed by Wenson Hsieh and Megan Gardner.

Add some code that was missing from Document in my original patch for r245072.

* dom/Document.cpp:
(WebCore::Document::useSystemAppearance const): Drive-by fix code style.
(WebCore::Document::useInactiveAppearance const): Added.
(WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
* dom/Document.h: Added useInactiveAppearance().

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

5 months agoWeb Inspector: user gesture toggle should also force user interaction flag
drousso@apple.com [Wed, 15 May 2019 22:42:00 +0000 (22:42 +0000)]
Web Inspector: user gesture toggle should also force user interaction flag
https://bugs.webkit.org/show_bug.cgi?id=197269

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html

* inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::evaluate):

* page/ChromeClient.h:
(WebCore::ChromeClient::userIsInteracting const): Added.
(WebCore::ChromeClient::setUserIsInteracting): Added.

* testing/Internals.idl:
* testing/Internals.h:
* testing/Internals.cpp:
(WebCore::Internals::userIsInteracting): Added.

Source/WebKit:

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::userIsInteracting const): Added.
(WebKit::WebChromeClient::setUserIsInteracting): Added.

* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userIsInteracting const): Added.
(WebKit::WebPage::setUserIsInteracting): Added.

LayoutTests:

* inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html: Added.
* inspector/runtime/evaluate-userGestureEmulation-userIsInteracting-expected.txt: Added.

* TestExpectations:
* platform/wk2/TestExpectations:
Only enable the above test on WK2, as the user interaction state is only supported by WK2.

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

5 months agoReplace double-quotes with single quotes in steps.py
aakash_jain@apple.com [Wed, 15 May 2019 22:41:59 +0000 (22:41 +0000)]
Replace double-quotes with single quotes in steps.py
https://bugs.webkit.org/show_bug.cgi?id=197921

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:

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

5 months agoRewrite generate-xcfilelists in Python
krollin@apple.com [Wed, 15 May 2019 22:39:57 +0000 (22:39 +0000)]
Rewrite generate-xcfilelists in Python
https://bugs.webkit.org/show_bug.cgi?id=197622
<rdar://problem/50508222>

Reviewed by Jonathan Bedard, Alex Christensen.

For a number of reasons, rewrite generate-xcfilelists in Python:

- The previous bash script was large and unmaintainable.
- We have more internal expertise with Python than with bash.
- The bash script used temporary files in /tmp that got stranded and
  were owned by root, making them awkward to clear out.
  <rdar://problem/49490262>
- We needed to complete support for engineers that built with Xcode
  rather than the command line.
- There are some bugs leading to mildly corrupted .xcfilelist files.
  It's not apparent the source of the bugs, but one general reason
  might be due to approaches born of using bash. Rewriting in Python
  may clear these up.

* Scripts/generate-xcfilelists:
* Scripts/webkitpy/common/attribute_saver.py: Added.
(AttributeSaver):
(AttributeSaver.__init__):
(AttributeSaver.__enter__):
(AttributeSaver.__exit__):
* Scripts/webkitpy/common/attribute_saver_unittest.py: Added.
(AttributeSaverTest):
(AttributeSaverTest.SimpleTestClass):
(AttributeSaverTest.SimpleTestClass.__init__):
(AttributeSaverTest.test_class):
(AttributeSaverTest.test_normal_default):
(AttributeSaverTest.test_normal_value):
(AttributeSaverTest.test_normal_value_on_exception):
(AttributeSaverTest.test_normal_value_on_normal_exit):
(AttributeSaverTest.test_normal_value_with_finally_on_exception):
(AttributeSaverTest.test_normal_value_with_finally_on_normal_exit):
(AttributeSaverTest.test_normal_value_with_else_on_exception):
(AttributeSaverTest.test_normal_value_with_else_on_normal_exit):
* Scripts/webkitpy/generate_xcfilelists_lib/__init__.py: Added.
* Scripts/webkitpy/generate_xcfilelists_lib/application.py: Added.
(Application):
(Application.__init__):
(Application.run):
(Application._initialize):
(Application._initialize.collect_attributes):
(Application._create_parser):
(_validate_args):
(_cmd_generate):
(_cmd_check):
(_cmd_subgenerate):
(_cmd_help):
(_do_generate):
(_do_merge):
(_report_results):
(_report_merge_results):
(_report_remediation_steps):
(_report_remediation_steps.add_to_message):
(_any_have_errors):
(_any_have_actions):
(_log_progress):
(_log_results):
(get_generate_xcfilelists_script_path):
(_get_root_dir):
(get_opensource_dir):
(get_build_scripts_dir):
(get_extract_dependencies_from_makefile_script):
(get_xcode_built_products_dir):
(_getenv):
* Scripts/webkitpy/generate_xcfilelists_lib/generators.py: Added.
(BaseGenerator):
(BaseGenerator.__init__):
(BaseGenerator.__str__):
(BaseGenerator.generate):
(BaseGenerator._sublaunch_under_xcode):
(BaseGenerator.subgenerate):
(BaseGenerator.merge):
(BaseGenerator.pickle_to_file):
(BaseGenerator.has_action):
(BaseGenerator.has_error):
(BaseGenerator.is_valid):
(BaseGenerator.report_error):
(BaseGenerator._generate_derived):
(BaseGenerator._merge_derived):
(BaseGenerator._generate_unified):
(BaseGenerator._merge_unified):
(BaseGenerator._replace):
(BaseGenerator._unexpand):
(BaseGenerator._find_added_lines):
(BaseGenerator._merge_added_lines):
(BaseGenerator._get_file_lines):
(BaseGenerator._getenv):
(BaseGenerator._get_project_file_path):
(BaseGenerator._get_project_dir):
(BaseGenerator._get_project_file_name):
(BaseGenerator._get_project_name):
(BaseGenerator._get_sym_root):
(BaseGenerator._get_obj_root):
(BaseGenerator._get_shared_precomps_dir):
(BaseGenerator._get_build_dirs):
(BaseGenerator._get_build_dirs.define_xcode_build_dirs):
(BaseGenerator._get_build_dirs.define_xcode_build_dirs.read_xcode_user_default):
(BaseGenerator._get_build_dirs.define_command_line_build_dirs):
(BaseGenerator._get_derived_sources_dir):
(BaseGenerator._get_xcfilelist_dir):
(BaseGenerator._get_input_derived_xcfilelist_project_path):
(BaseGenerator._get_output_derived_xcfilelist_project_path):
(BaseGenerator._get_input_unified_xcfilelist_project_path):
(BaseGenerator._get_output_unified_xcfilelist_project_path):
(BaseGenerator._get_generate_derived_sources_script):
(BaseGenerator._get_generate_unified_sources_script):
(JavaScriptCoreGenerator):
(JavaScriptCoreGenerator._get_project_file_path):
(JavaScriptCoreGenerator._get_generate_derived_sources_script):
(JavaScriptCoreGenerator._get_generate_unified_sources_script):
(WebCoreGenerator):
(WebCoreGenerator._get_project_file_path):
(WebCoreGenerator._get_generate_derived_sources_script):
(WebCoreGenerator._get_generate_unified_sources_script):
(WebKitGenerator):
(WebKitGenerator._get_project_file_path):
(WebKitGenerator._get_derived_sources_dir):
(WebKitGenerator._get_generate_derived_sources_script):
(WebKitGenerator._get_generate_unified_sources_script):
(DumpRenderTreeGenerator):
(DumpRenderTreeGenerator._get_project_file_path):
(DumpRenderTreeGenerator._get_generate_derived_sources_script):
(WebKitTestRunnerGenerator):
(WebKitTestRunnerGenerator._get_project_file_path):
(WebKitTestRunnerGenerator._get_generate_derived_sources_script):
* Scripts/webkitpy/generate_xcfilelists_lib/util.py: Added.
(debug_log):
(LogEntryHelper):
(LogEntryHelper.__init__):
(LogEntryHelper.log_entry):
(LogEntryHelper.log_result):
(LogEntryHelper.log_exception):
(LogEntryHelper._print):
(LogEntryExit):
(LogEntryExit._show_debug_logging):
(LogEntryExitClass):
(LogEntryExitClass._show_debug_logging):
(LogEntryExitGlobal):
(LogEntryExitGlobal._show_debug_logging):
(subprocess_run):
(is_running_under_xcode):
(CheckValidItemAction):
(CheckValidItemAction.__init__):
(CheckValidItemAction.__call__):
(CheckValidItemAction.validate_item):
(CheckCommandAction):
(CheckCommandAction.__call__):
(InvalidCommandError):
(InvalidArgumentError):
(InvalidConfigurationError):
(CalledProcessError):
(CalledProcessError.__str__):
* Scripts/webkitpy/xcode/__init__.py:
(xcode_hash_for_path):
(xcode_hash_for_path.convert_to_string):
* Scripts/webkitpy/xcode/sdk.py: Added.
(SDK):
(SDK.__init__):
(SDK.__repr__):
(SDK.as_xcode_specification):
(SDK.get_preferred_sdk_for_platform):
(SDK._parse_sdk):
* Scripts/webkitpy/xcode/sdk_unittest.py: Added.
(SDKTest):

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

5 months agoREGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilterin...
drousso@apple.com [Wed, 15 May 2019 22:37:12 +0000 (22:37 +0000)]
REGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilteringEnabled.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=194437
<rdar://problem/48008005>

Reviewed by Joseph Pecoraro.

* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
* inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt:

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

5 months agoREGRESSION (r242741) [Mac WK1 Debug] Layout Test inspector/timeline/exception-in...
drousso@apple.com [Wed, 15 May 2019 22:36:34 +0000 (22:36 +0000)]
REGRESSION (r242741) [Mac WK1 Debug] Layout Test inspector/timeline/exception-in-injected-script-while-recording.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=197442
<rdar://problem/50354090>

Reviewed by Joseph Pecoraro.

Ever since r198774, we don't allow a timeline recording to be active at the same time as the
debugger being paused. As such, these tests are unnecessary.

* inspector/timeline/debugger-paused-while-recording.html: Removed.
* inspector/timeline/debugger-paused-while-recording-expected.txt: Removed.
* inspector/timeline/exception-in-injected-script-while-recording.html: Removed.
* inspector/timeline/exception-in-injected-script-while-recording-expected.txt: Removed.
* inspector/timeline/resources/timeline-helper.js: Removed.
* TestExpectations:

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

5 months agoDo not create a shape object outside of the layout context
zalan@apple.com [Wed, 15 May 2019 22:34:09 +0000 (22:34 +0000)]
Do not create a shape object outside of the layout context
https://bugs.webkit.org/show_bug.cgi?id=197926
<rdar://problem/50627858>

Reviewed by Simon Fraser.

Source/WebCore:

ShapeOutside objects are used to compute line constrains during layout (in a strict sense, they are part of the layout context and should only be mutated during layout).
If we don't create one during layout, we probably don't need to know its geometry during paint (or any other non-layout activity) either.

Test: fast/block/float/float-with-shape-outside-crash.html

* rendering/FloatingObjects.cpp:
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):

LayoutTests:

* fast/block/float/float-with-shape-outside-crash-expected.txt: Added.
* fast/block/float/float-with-shape-outside-crash.html: Added.

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

5 months agoRevise sandbox to allow IOKit properties needed by Metal and LaunchServices
bfulgham@apple.com [Wed, 15 May 2019 22:27:09 +0000 (22:27 +0000)]
Revise sandbox to allow IOKit properties needed by Metal and LaunchServices
https://bugs.webkit.org/show_bug.cgi?id=197924
<rdar://problem/50823976>

Reviewed by Per Arne Vollan.

Update sandbox to allow access to some IOKit properties to avoid sandbox violations that could
lower performance or increase launch times:

* WebProcess/com.apple.WebProcess.sb.in:

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

5 months ago[ews-build] Enabling uploading EWS archives to S3
aakash_jain@apple.com [Wed, 15 May 2019 22:21:24 +0000 (22:21 +0000)]
[ews-build] Enabling uploading EWS archives to S3
https://bugs.webkit.org/show_bug.cgi?id=197914

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/Shared: Added.
* BuildSlaveSupport/Shared/transfer-archive-to-s3: Moved from Tools/BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3.
(archiveExists): Replace tab with space.
(main): Added main method.
* BuildSlaveSupport/build.webkit.org-config/steps.py:
(TransferToS3): Updated path to the script.
* BuildSlaveSupport/build.webkit.org-config/transfer-archive-to-s3: Moved to Shared folder.

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

5 months agoMark beacon and ping loads as low priority
youenn@apple.com [Wed, 15 May 2019 21:28:57 +0000 (21:28 +0000)]
Mark beacon and ping loads as low priority
https://bugs.webkit.org/show_bug.cgi?id=197919
<rdar://problem/50818286>

Reviewed by Alex Christensen.

No JS observable change of behavior.

* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendPing):

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

5 months agoUnreviewed, fix assertion introduced in r245339.
cdumez@apple.com [Wed, 15 May 2019 21:14:33 +0000 (21:14 +0000)]
Unreviewed, fix assertion introduced in r245339.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::CachedProcess::CachedProcess):

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

5 months agoBound liveness of SetArgumentMaybe nodes when maximal flush insertion phase is enabled
sbarati@apple.com [Wed, 15 May 2019 20:30:16 +0000 (20:30 +0000)]
Bound liveness of SetArgumentMaybe nodes when maximal flush insertion phase is enabled
https://bugs.webkit.org/show_bug.cgi?id=197855
<rdar://problem/50236506>

Reviewed by Michael Saboff.

JSTests:

* stress/set-argument-maybe-maximal-flush-should-not-extend-liveness-2.js: Added.
(f0):
(bar):
(foo):
* stress/set-argument-maybe-maximal-flush-should-not-extend-liveness.js: Added.
(f1):
(f2):
(foo):

Source/JavaScriptCore:

Maximal flush insertion phase assumes it can extend the live range of
variables. However, this is not true with SetArgumentMaybe nodes, because
they are not guaranteed to demarcate the birth of a variable in the way
that SetArgumentDefinitely does. This caused things to break in SSA conversion
when we wanted to use the result of a SetArgumentMaybe node. To obviate this,
when we're done inlining something with SetArgumentMaybes, we SetLocal(undefined)
to the same set of locals. This caps the live range of the SetArgumentMaybe
and makes it so that extending the live range of the SetLocal is valid.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):

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

5 months agoLayout tests http/wpt/webauthn/public-key-credential-create-success-hid.https.html
sroberts@apple.com [Wed, 15 May 2019 19:56:40 +0000 (19:56 +0000)]
Layout tests http/wpt/webauthn/public-key-credential-create-success-hid.https.html
http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky crashes
https://bugs.webkit.org/show_bug.cgi?id=197917

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Skipping tests on Debug

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

5 months agoAdd assertions to help diagnose crash at WebProcessProxy::processPool()
sihui_liu@apple.com [Wed, 15 May 2019 19:50:54 +0000 (19:50 +0000)]
Add assertions to help diagnose crash at WebProcessProxy::processPool()
https://bugs.webkit.org/show_bug.cgi?id=197856
<rdar://problem/49341366>

Reviewed by Chris Dumez.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::CachedProcess::CachedProcess):
* UIProcess/WebProcessLifetimeObserver.cpp:
(WebKit::WebProcessLifetimeObserver::addWebPage):
(WebKit::WebProcessLifetimeObserver::removeWebPage):
* UIProcess/WebProcessLifetimeObserver.h:
(WebKit::WebProcessLifetimeObserver::hasProcess const):

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

5 months agoinputmode="numeric" should show a number pad with digits 0-9, instead of the numeric...
wenson_hsieh@apple.com [Wed, 15 May 2019 19:24:16 +0000 (19:24 +0000)]
inputmode="numeric" should show a number pad with digits 0-9, instead of the numeric keyplane
https://bugs.webkit.org/show_bug.cgi?id=197916
<rdar://problem/50815427>

Reviewed by Timothy Hatcher.

Source/WebKit:

Use UIKeyboardTypeNumberPad instead of UIKeyboardTypeNumbersAndPunctuation when presenting a keyboard for a
field with inputmode="numeric". While the WhatWG specification merely requires the UA to display a keyboard
"capable of numeric input", it suggests that the keyboard should be "useful for PIN entry", which loosely
implies a number pad.

This is also generally in line with feedback from web developers.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textInputTraits]):

Tools:

Re-enable this previously flaky test, and rebaseline the result to to expect UIKeyboardTypeNumberPad for
inputmode="numeric".

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(TestWebKitAPI::TEST):

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