WebKit-https.git
7 months agoIsolatedObject implementation of property setters.
andresg_22@apple.com [Tue, 24 Dec 2019 01:03:13 +0000 (01:03 +0000)]
IsolatedObject implementation of property setters.
https://bugs.webkit.org/show_bug.cgi?id=205566

Reviewed by Chris Fleizach.

- Implementation of setters that need to be executed in the main
thread.
- Sanity check of the associatedAXObject() before calling corresponding
method on main thread.

* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::performFunctionOnMainThread):
(WebCore::AXIsolatedObject::setARIAGrabbed):
(WebCore::AXIsolatedObject::setIsExpanded):
(WebCore::AXIsolatedObject::setValue):
(WebCore::AXIsolatedObject::setSelected):
(WebCore::AXIsolatedObject::setSelectedRows):
(WebCore::AXIsolatedObject::setFocused):
(WebCore::AXIsolatedObject::setSelectedText):
(WebCore::AXIsolatedObject::setSelectedTextRange):
(WebCore::AXIsolatedObject::setCaretBrowsingEnabled):
(WebCore::AXIsolatedObject::setPreventKeyboardDOMEventDispatch):
(WebCore::AXIsolatedObject::findTextRanges const):
(WebCore::AXIsolatedObject::performTextOperation):
(WebCore::AXIsolatedObject::widget const):
(WebCore::AXIsolatedObject::document const):
(WebCore::AXIsolatedObject::documentFrameView const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h:

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

7 months agoREGRESSION (r212693): getClientRects(), getBoundingClientRect() for range that spans...
dbates@webkit.org [Tue, 24 Dec 2019 00:32:04 +0000 (00:32 +0000)]
REGRESSION (r212693): getClientRects(), getBoundingClientRect() for range that spans multi-lines differs depending on whether text is selected
https://bugs.webkit.org/show_bug.cgi?id=205527
<rdar://problem/58128278>

Reviewed by Zalan Bujtas.

Source/WebCore:

Include empty rect when range start position coincides with the end of a simple line layout run.
This makes it match the behavior of line box layout, Firefox's behavior, as well as my understanding
of Extensions to the Range Interface: <https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface>
(Editor's Draft, 10 October 2019).

At the time of writing, there are two code paths for laying out lines: simple line layout and
line box layout. Simple line layout is not enabled when there is a selection at the time of
writing. As a result, we use line box layout to answer getClientRects(), getBoundingClientRect()
queries.

Test: fast/dom/Range/mac/getClientRects-and-getBoundingClientRect-before-and-after-selection.html

* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const): Do not skip over a run
if its end position coincides with the range's start offset. This ensures that we emit an empty rect
for this part of the box selection, which matches what we do using the analagous line box layout
code path.

LayoutTests:

For now, add a Mac-specific test. This test is specific to Mac because it depends on text metrics for the
Times font. I specifically did not use Ahem so that this test could also be used as the test for
<https://bugs.webkit.org/show_bug.cgi?id=205563>. Currently the test includes expected failure results
since that bug is not fixed.

* TestExpectations: Skip
* fast/dom/Range/mac/getClientRects-and-getBoundingClientRect-before-and-after-selection-expected.txt: Added.
* fast/dom/Range/mac/getClientRects-and-getBoundingClientRect-before-and-after-selection.html: Added.
* platform/mac/TestExpectations: Unskip the test on Mac.

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

7 months agoRemove TestExpectations for scrollingcoordinator/ios/fixed-scrolling-with-keyboard...
ap@apple.com [Mon, 23 Dec 2019 23:27:01 +0000 (23:27 +0000)]
Remove TestExpectations for scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html
https://bugs.webkit.org/show_bug.cgi?id=202283

This test has been passing lately.

* platform/ios/TestExpectations:

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

7 months agoAdd TestExpectations for http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavai...
ap@apple.com [Mon, 23 Dec 2019 23:22:17 +0000 (23:22 +0000)]
Add TestExpectations for http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
https://bugs.webkit.org/show_bug.cgi?id=197673

* TestExpectations:

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

7 months agowatchOS build fix attempt
ap@apple.com [Mon, 23 Dec 2019 20:21:55 +0000 (20:21 +0000)]
watchOS build fix attempt

Not sure what broke the build, seems like UserInterfaceIdiom.h used to be included
via unified build, and no longer is. Added the include.

While at it, removed an ancient __IPHONE_OS_VERSION_MIN_REQUIRED version check.

* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:

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

7 months agoUnreviewed, rolling out r253884.
commit-queue@webkit.org [Mon, 23 Dec 2019 20:14:20 +0000 (20:14 +0000)]
Unreviewed, rolling out r253884.
https://bugs.webkit.org/show_bug.cgi?id=205565

Broke production builds (Requested by ap on #webkit).

Reverted changeset:

"Do not build yasm for iOS and iOS simulator"
https://bugs.webkit.org/show_bug.cgi?id=205556
https://trac.webkit.org/changeset/253884

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

7 months agoUnreviewed, fix the macCatalyst build after r253866
wenson_hsieh@apple.com [Mon, 23 Dec 2019 18:49:35 +0000 (18:49 +0000)]
Unreviewed, fix the macCatalyst build after r253866

* WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

MediaPlayer::mediaKeysStorageDirectory() is guarded by ENABLE(LEGACY_ENCRYPTED_MEDIA).

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

7 months agoDo not build yasm for iOS and iOS simulator
youenn@apple.com [Mon, 23 Dec 2019 16:07:57 +0000 (16:07 +0000)]
Do not build yasm for iOS and iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=205556
<rdar://problem/58159497>

Reviewed by Eric Carlson.

Now that we no longer need yasm for iOS simulator, we can stop building it for iOS and iOS simulator.
We can also remove the hack to run yasm.

* Configurations/yasm.xcconfig:
* libwebrtc.xcodeproj/project.pbxproj:

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

7 months agoWebDriver: fix handling of session timeouts for values higher than MAX_INT
carlosgc@webkit.org [Mon, 23 Dec 2019 10:42:26 +0000 (10:42 +0000)]
WebDriver: fix handling of session timeouts for values higher than MAX_INT
https://bugs.webkit.org/show_bug.cgi?id=204114

Reviewed by Brian Burg.

Source/JavaScriptCore:

Fix generation of code with optional number in stack variable.

* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.cpp_type_for_stack_in_parameter): Do not use Optional for numbers either.
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:

Source/WebDriver:

Use double instead of Seconds for handling timeouts.

* Capabilities.h:
* Session.cpp:
(WebDriver::Session::getTimeouts): Handle the case of script timeout being null.
(WebDriver::Session::go):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::findElements):
(WebDriver::Session::waitForNavigationToComplete):
(WebDriver::Session::executeScript): Do not pass a timeout when it's null.
* Session.h:
(WebDriver::Session::scriptTimeout const):
(WebDriver::Session::pageLoadTimeout const):
(WebDriver::Session::implicitWaitTimeout const):
* WebDriverService.cpp:
(WebDriver::deserializeTimeouts): Add IgnoreUnknownTimeout, since we should only fail when processing
capabilities, but not when setting new timeouts. Also handle the case of script timeout being null.
(WebDriver::WebDriverService::parseCapabilities const): Pass IgnoreUnknownTimeout::No to deserializeTimeouts.
(WebDriver::WebDriverService::validatedCapabilities const): Ditto.
(WebDriver::WebDriverService::createSession): Handle the case of script timeout being null.
(WebDriver::WebDriverService::setTimeouts): Pass IgnoreUnknownTimeout::Yes to deserializeTimeouts.

Source/WebKit:

Use number instead of integer for all optional timeout parameters. In the case of script timeout, not passing a
value means a timeout should not be used, so use Optional<double> also for the IPC message and handle the
optional value in the web process to not set any timeout in that case.

* UIProcess/Automation/Automation.json:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::waitForNavigationToComplete):
(WebKit::WebAutomationSession::navigateBrowsingContext):
(WebKit::WebAutomationSession::goBackInBrowsingContext):
(WebKit::WebAutomationSession::goForwardInBrowsingContext):
(WebKit::WebAutomationSession::reloadBrowsingContext):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
* UIProcess/Automation/WebAutomationSession.h:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.js:
(let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction):
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:

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

7 months ago[GTK] InputMethod API unit tests don't work under X11
carlosgc@webkit.org [Mon, 23 Dec 2019 10:06:29 +0000 (10:06 +0000)]
[GTK] InputMethod API unit tests don't work under X11
https://bugs.webkit.org/show_bug.cgi?id=205497

Reviewed by Žan Doberšek.

Source/WebKit:

Assume the web view is always focused when running tests under Xvfb, since there isn't a window manager to focus
the toplevel window in that case.

* UIProcess/API/glib/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::isViewFocused const):

Tools:

Use a toplevel window instead of a popup for the input method tests, since that's required in X11 to get the web
view focused.

* TestWebKitAPI/Tests/WebKitGLib/TestInputMethodContext.cpp:
(testWebKitInputMethodContextSimple):
(testWebKitInputMethodContextSequence):
(testWebKitInputMethodContextInvalidSequence):
(testWebKitInputMethodContextCancelSequence):
(testWebKitInputMethodContextReset):

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

7 months ago[GTK][WPE] Special combination characters doesn't respect the keystroke order when...
carlosgc@webkit.org [Mon, 23 Dec 2019 09:19:50 +0000 (09:19 +0000)]
[GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
https://bugs.webkit.org/show_bug.cgi?id=185248

Reviewed by Žan Doberšek.

Source/WebCore:

Notify the editor when a key event handled by input method has been dispatched. This way we can handle the
composition results right after the event is dispatched.

* editing/Editor.cpp:
(WebCore::Editor::didDispatchInputMethodKeydown): Notify the client.
* editing/Editor.h:
* page/EditorClient.h:
(WebCore::EditorClient::didDispatchInputMethodKeydown): Added.
* page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent): Call Editor::didDispatchInputMethodKeydown() for events handled by
input method right after the event is dispatched.
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::preeditUnderlines const):
(WebCore::PlatformKeyboardEvent::preeditSelectionRangeStart const):
(WebCore::PlatformKeyboardEvent::preeditSelectionRangeLength const):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
method and remove the special case for Char events handled by input method because this is never called with
Char type for events handled by input method.
* platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
method.

Source/WebKit:

Key events are queued by the WebPageProxy so that the next event is not sent to the web process until the
previous one has been handled by the web process already. However, the composition results generated by key
events are sent to the web process using IPC messages when they happen. In case of high CPU load it can happen
that the composition results are sent to the web process even before the associated keys, that are still in the
queue waiting to be sent. We need to ensure that composition results are always processed right after its
associated key press event. So, instead of sending the results independently, we now include them as part of the
key event.

* Shared/NativeWebKeyboardEvent.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::preeditUnderlines const): Return the optional preeditUnderlines.
(WebKit::WebKeyboardEvent::preeditSelectionRange const): Return the optional preeditSelectionRange.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): Copy preeditUnderlines and
preeditSelectionRange too.
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
parameters and initialize them.
(WebKit::WebKeyboardEvent::encode const): Encode preeditUnderlines and preeditSelectionRange.
(WebKit::WebKeyboardEvent::decode): Decode preeditUnderlines and preeditSelectionRange.
* Shared/gtk/NativeWebKeyboardEventGtk.cpp:
(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
preeditSelectionRange parameters and initialize them.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
parameters and pass them to WebKeyboardEvent constructor.
* Shared/gtk/WebEventFactory.h:
* Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp:
(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
preeditSelectionRange parameters and initialize them.
* Shared/libwpe/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRang
parameters and pass them to WebKeyboardEvent constructor.
* Shared/libwpe/WebEventFactory.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewSynthesizeCompositionKeyPress): Pass the preeditUnderlines and preeditSelectionRange to platform
implementation.
(webkitWebViewSetComposition): Remove the call to WebPageProxy::setComposition().
(webkitWebViewConfirmComposition): Remove the call to WebPageProxy::confirmComposition().
(webkitWebViewCancelComposition): Call WebPageProxy::cancelComposition();
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent): Pass the preeditUnderlines and preeditSelectionRange to NativeWebKeyboardEvent constructor.
(webkitWebViewBaseKeyReleaseEvent): Ditto.
(webkitWebViewBaseSynthesizeCompositionKeyPress): Ditto.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::handleKeyboardEvent): Ditto.
(WKWPE::View::synthesizeCompositionKeyPress): Ditto.
* UIProcess/API/wpe/WPEView.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::didDispatchInputMethodKeydown): Handle the composition results here, right after the
associated key events has been dispatched.
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
(WebKit::WebEditorClient::didDispatchInputMethodKeydown): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::cancelComposition): Confirm the given string to cancel the composition.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Remove SetComposition message and rename ConfirmComposition as
CancelComposition since it's now only used for canceling.

Tools:

Remove the waits() that were added to work around this bug.

* TestWebKitAPI/Tests/WebKitGLib/TestInputMethodContext.cpp:
(testWebKitInputMethodContextSequence):
(testWebKitInputMethodContextInvalidSequence):
(testWebKitInputMethodContextCancelSequence):
(testWebKitInputMethodContextReset):

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

7 months agoLayoutTests/imported/w3c:
simon.fraser@apple.com [Mon, 23 Dec 2019 03:51:49 +0000 (03:51 +0000)]
LayoutTests/imported/w3c:
Very basic <dialog> show/close support
https://bugs.webkit.org/show_bug.cgi?id=205543

Reviewed by Antti Koivisto.

New results, some new passes.

* web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/dialog-display-expected.txt:
* web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/dialog-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-just-once-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-multiple-times-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-return-value-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/show-modal-focusing-steps-expected.txt:
* web-platform-tests/html/semantics/selectors/pseudo-classes/default-expected.txt:

Source/WebCore:
Very basic <dialog> show/close support
https://bugs.webkit.org/show_bug.cgi?id=205543

Reviewed by Antti Koivisto.

Fix HTMLDialogElement.idl for attribute reflection, and showModal() possibly throwing.

Have show/showModal() and close() toggle the "open" attribute. Implement parseAttribute()
to initialize m_isOpen from the attribute value.

Add dialog.css, which is appended to the UA stylesheets if the feature is enabled. Have
it set the display value.

Tested by web-platform-tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/dialog.css: Added.
(dialog):
(dialog[open]):
* html/HTMLDialogElement.cpp:
(WebCore::HTMLDialogElement::isOpen const):
(WebCore::HTMLDialogElement::show):
(WebCore::HTMLDialogElement::showModal):
(WebCore::HTMLDialogElement::close):
(WebCore::HTMLDialogElement::parseAttribute):
(WebCore::HTMLDialogElement::toggleOpen):
(WebCore::HTMLDialogElement::open): Deleted.
(WebCore::HTMLDialogElement::setOpen): Deleted.
* html/HTMLDialogElement.h:
* html/HTMLDialogElement.idl:
* style/InspectorCSSOMWrappers.cpp:
(WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers):
* style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
* style/UserAgentStyle.h:

Source/WebKit:
Make support for <dialog> an internal feature, off by default
https://bugs.webkit.org/show_bug.cgi?id=205542

Reviewed by Antti Koivisto.

Make DialogElementEnabled an internal feature so it shows up in the menus and
can be toggled on for experimentation.

* Shared/WebPreferences.yaml:

LayoutTests:
Very basic <dialog> show/close support
https://bugs.webkit.org/show_bug.cgi?id=205543

Reviewed by Antti Koivisto.

* imported/blink/dialog/element-removed-from-top-layer-has-original-position-expected.html: Removed.
* imported/blink/dialog/element-removed-from-top-layer-has-original-position.html: Removed. The changes tested by this patch (added in r140075) were later removed,
then this test got re-imported from blink.
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-xhtml-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt:

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

7 months agoMake support for <dialog> an experimental feature, off by default
simon.fraser@apple.com [Mon, 23 Dec 2019 03:51:39 +0000 (03:51 +0000)]
Make support for <dialog> an experimental feature, off by default
https://bugs.webkit.org/show_bug.cgi?id=205542

Reviewed by Dean Jackson.

Make DialogElementEnabled an experimental feature (off by default).

* Shared/WebPreferences.yaml:

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

7 months ago[macCatalyst] Mouse clicks dispatch duplicate pointerup and pointerdown events
wenson_hsieh@apple.com [Mon, 23 Dec 2019 01:15:07 +0000 (01:15 +0000)]
[macCatalyst] Mouse clicks dispatch duplicate pointerup and pointerdown events
https://bugs.webkit.org/show_bug.cgi?id=205551
<rdar://problem/58058268>

Reviewed by Tim Horton.

Source/WebCore:

This began occuring after r251320, wherein some mouse event handling codepaths were enabled in macCatalyst.
For compatibility, gesture recognizers still fire in the macCatalyst platform. This includes the synthetic click
gesture, which will still synthesize and send mouseup and mousedown events to the page. After the change, this
results in pointer events being dispatched under the call to `shouldIgnoreMouseEvent()`. However, at the same
time, touch event handling codepaths have already dispatched "pointerup" and "pointerdown", so we end up with
redundant events.

To fix this macCatalyst-specific bug, simply avoid dispatching pointer events in the case where the synthetic
click type is some kind of tap gesture; in this case, pointer events have already been dispatched, so we don't
need to dispatch them again via mouse event handling code.

Test: pointerevents/ios/pointer-events-with-click-handler.html

* dom/Element.cpp:
(WebCore::dispatchPointerEventIfNeeded):

Also rename shouldIgnoreMouseEvent to dispatchPointerEventIfNeeded to better reflect that this function's
primary purposee is to dispatch pointer events in response to platform mouse events; then, change the return
value to an explicit enum class indicating whether the mouse event should be subsequently ignored (as a result
of the page preventing the dispatched pointer event).

(WebCore::Element::dispatchMouseEvent):
(WebCore::shouldIgnoreMouseEvent): Deleted.

LayoutTests:

* pointerevents/ios/pointer-events-with-click-handler-expected.txt: Added.
* pointerevents/ios/pointer-events-with-click-handler.html: Added.

Add a layout test to verify that the bug does not occur. While this is a macCatalyst fix, this test needs to be
in the `ios` directory for now because macCatalyst is still considered "iOS family". This test is also still
relevant to both platforms (on iOS, synthesizing a tap behaves as expected, and in macCatalyst, it simulates a
click at the same location).

* pointerevents/utils.js:
(EventTracker.prototype.assertMatchesEvents):
(EventTracker):

Drive-by fix: flip the order of arguments to `assert_equals`, so that when tests fail, the failure output
correctly shows how many events were expected, and how many were observed.

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

7 months agoAdd TextExpectations for flaky whlsl tests.
ap@apple.com [Sun, 22 Dec 2019 20:24:28 +0000 (20:24 +0000)]
Add TextExpectations for flaky whlsl tests.

* platform/mac/TestExpectations:

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

7 months agoInvalidate only affected elements after media query evaluation changes
antti@apple.com [Sun, 22 Dec 2019 18:06:55 +0000 (18:06 +0000)]
Invalidate only affected elements after media query evaluation changes
https://bugs.webkit.org/show_bug.cgi?id=205392

Reviewed by Zalan Bujtas.

We currently invalidate style of the whole tree when a media query evaluation changes.
We can do better by constructing an invalidation RuleSet and invalidating only those
elements that are potentially affected.

* style/RuleSet.cpp:
(WebCore::Style::RuleSet::addRule):
(WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):

Construct and cache an invalidation RuleSet and associate with a set of media query changes.

(WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
(WebCore::Style::RuleSet::MediaQueryCollector::pop):
(WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):

Collect RuleFeatures which we later use to build invalidation RuleSet.

(WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded): Deleted.
* style/RuleSet.h:
(WebCore::Style::DynamicMediaQueryEvaluationChanges::append):
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::evaluateDynamicMediaQueries):
* style/StyleResolver.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::evaluateMediaQueries):

Use the invalidation RuleSet for accurate style invalidation.

* style/StyleScopeRuleSets.cpp:
(WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):

Collect invalidation RuleSets for author/user/user agent style.

* style/StyleScopeRuleSets.h:

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

7 months ago[LFC][Integration] Do not remove trailing whitespace when it is followed by a line...
zalan@apple.com [Sun, 22 Dec 2019 15:21:07 +0000 (15:21 +0000)]
[LFC][Integration] Do not remove trailing whitespace when it is followed by a line break
https://bugs.webkit.org/show_bug.cgi?id=205549
<rdar://problem/58139893>

Reviewed by Antti Koivisto.

Complex line layout quirk: keep the trailing whitespace aroun
when it is followed by a line break, unless the content overflows the line.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::removeTrailingCollapsibleContent):

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

7 months ago[LFC][Integration] Do not collapse trailing letter spacing
zalan@apple.com [Sun, 22 Dec 2019 15:12:09 +0000 (15:12 +0000)]
[LFC][Integration] Do not collapse trailing letter spacing
https://bugs.webkit.org/show_bug.cgi?id=205548
<rdar://problem/58139872>

Reviewed by Antti Koivisto.

Turn off trailing letter-spacing trimming for now.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::InlineItemRun::hasTrailingLetterSpacing const):

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

7 months agoCompile libwebrtc without hardware acceleration for iOS simulator
youenn@apple.com [Sun, 22 Dec 2019 14:42:46 +0000 (14:42 +0000)]
Compile libwebrtc without hardware acceleration for iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=205491

Reviewed by Alex Christensen.

Use c routines instead of optimized versions for iOS simulator.

* Configurations/libvpx.xcconfig:
* Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd.h:
* Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd_no_acceleration.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd.h.
* Source/third_party/libvpx/source/config/mac/x64/vpx_config.h:
* Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h:
* Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd_no_acceleration.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h.
* Source/third_party/libvpx/source/libvpx/vpx_ports/system_state.h:
* libwebrtc.xcodeproj/project.pbxproj:

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

7 months ago[Media in GPU process] Add remote media player proxy configuration
eric.carlson@apple.com [Sun, 22 Dec 2019 12:59:33 +0000 (12:59 +0000)]
[Media in GPU process] Add remote media player proxy configuration
https://bugs.webkit.org/show_bug.cgi?id=205547
<rdar://problem/58139762>

Reviewed by Tim Horton.

* GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
* GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
* GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::getConfiguration):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier):
* GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: Added.
(WebKit::RemoteMediaPlayerProxyConfiguration::encode const):
(WebKit::RemoteMediaPlayerProxyConfiguration::decode):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
(WebKit::MediaPlayerPrivateRemote::engineDescription const):
(WebKit::MediaPlayerPrivateRemote::supportsScanning const):
(WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const):
(WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const):
(WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: Added.
(WebKit::RemoteMediaPlayerConfiguration::encode const):
(WebKit::RemoteMediaPlayerConfiguration::decode):
* WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

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

7 months agoUnreviewed, fix incorrect merging
ysuzuki@apple.com [Sun, 22 Dec 2019 12:10:02 +0000 (12:10 +0000)]
Unreviewed, fix incorrect merging
https://bugs.webkit.org/show_bug.cgi?id=205327

r253862 and r253867 cause incorrect merging. This patch fixes it.

* jit/ThunkGenerators.cpp:
(JSC::boundFunctionCallGenerator):

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

7 months agoUnreviewed, fix debug failures due to missing exception checks
ysuzuki@apple.com [Sun, 22 Dec 2019 09:57:04 +0000 (09:57 +0000)]
Unreviewed, fix debug failures due to missing exception checks
https://bugs.webkit.org/show_bug.cgi?id=205327

* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):
* runtime/JSObject.cpp:
(JSC::JSObject::defineOwnNonIndexProperty):

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

7 months agoWeb Inspector: add InspectedTargetTypes diagnostic event and related hooks
bburg@apple.com [Sun, 22 Dec 2019 04:19:53 +0000 (04:19 +0000)]
Web Inspector: add InspectedTargetTypes diagnostic event and related hooks
https://bugs.webkit.org/show_bug.cgi?id=205174
<rdar://problem/57887953>

Reviewed by Devin Rousso.

Source/WebCore:

Expose debuggable information via InspectorFrontendHost.

* WebCore.xcodeproj/project.pbxproj: Add new files.

* inspector/InspectorFrontendClient.h: Add new methods.
* testing/Internals.cpp: Implement new methods.

* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::debuggableTypeToString):
(WebCore::InspectorFrontendHost::debuggableInfo const):
(WebCore::InspectorFrontendHost::debuggableType): Deleted.
Expose a `DebuggableInfo` dictionary via the .debuggableInfo getter.

Source/WebInspectorUI:

This change adds a new diagnostic recorder that reports information about
inspected targets and their type / version information.

* UserInterface/Base/DebuggableType.js:
(WI.DebuggableType.fromString):
Move the static parsing factory method to DebuggableType class.

* UserInterface/Main.html: Add new files.
* UserInterface/Base/Main.js:
(WI.contentLoaded): Add new diagnostic recorder.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.activateDomain):
Adapt to InspectorFrontendHost changes.

* UserInterface/Test/TestAppController.js:
(WI.TestAppController):
* UserInterface/Controllers/AppController.js:
(WI.AppController):
Adapt to InspectorFrontendHost changes.

Source/WebKit:

This change supplies Web Inspector with information about the debuggable that
it is connected to. This is used for diagnostics and to customize the UI based
on the target type being inspected.

For remote Web Inspector, WebKit clients can populate an instance of
_WKInspectorDebuggableInfo and use it when calling into
-[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:].

For local Web Inspector, WebInspectorProxy fills in information for the local
debuggable by consulting SystemVersion.plist (on Mac port).

The new enum _WKInspectorDebuggableType replaces _WKRemoteWebInspectorDebuggableType.
Its WebCore equivalent is Inspector::DebuggableType. The type and other information
are carried around in a _WKInspectorDebuggableInfo class. The equivalents for this
class are API::DebuggableInfo and DebuggableInfoData (for sending over IPC).

The DebuggableInfoData is sent as part of the initial message from UIProcess
to an Inspector WebProcess, similar to how a debuggableType string was sent before.

* Sources.txt:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
Add new files.

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Add new object type.
* Shared/WebCoreArgumentCoders.h: Add EnumTraits for Inspector::DebuggableType.

* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h:
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
(legacyDebuggableTypeToModernDebuggableType):
(-[_WKRemoteWebInspectorViewController loadForDebuggableType:backendCommandsURL:]):
(-[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:]):
(debuggableTypeString): Deleted.
Use the new enum in a new method that clients can switch over to. The old method
can be removed when it is no longer being used.

* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::RemoteWebInspectorProxy):
(WebKit::RemoteWebInspectorProxy::load):
(WebKit::RemoteWebInspectorProxy::reopen):
Send DebuggableInfoData struct to RemoteWebInspectorUI.

* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::openLocalInspectorFrontend):
(WebKit::WebInspectorProxy::infoForLocalDebuggable):
Send DebuggableInfoData struct to WebInspectorUI.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::systemVersionPlist):
(WebKit::WebInspectorProxy::infoForLocalDebuggable):
Add Mac implementation for local debuggables.

* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::infoForLocalDebuggable):
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::infoForLocalDebuggable):
* UIProcess/wpe/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::infoForLocalDebuggable):
Add stubs for other platforms.

* UIProcess/glib/RemoteInspectorClient.cpp:
* UIProcess/socket/RemoteInspectorClient.h:
* UIProcess/socket/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::inspect):
(WebKit::debuggableTypeToString):
(WebKit::RemoteInspectorClient::setTargetList):
Use Inspector::DebuggableType instead of String for debuggable type.

* WebProcess/WebPage/RemoteWebInspectorUI.messages.in:
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::initialize):
(WebKit::RemoteWebInspectorUI::debuggableType const):
(WebKit::RemoteWebInspectorUI::targetPlatformName const):
(WebKit::RemoteWebInspectorUI::targetBuildVersion const):
(WebKit::RemoteWebInspectorUI::targetProductVersion const):
(WebKit::RemoteWebInspectorUI::targetIsSimulator const):
Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost.

* WebProcess/WebPage/WebInspectorUI.messages.in:
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection):
(WebKit::WebInspectorUI::targetPlatformName const):
(WebKit::WebInspectorUI::targetBuildVersion const):
(WebKit::WebInspectorUI::targetProductVersion const):
Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost.

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:

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

7 months ago[JSC] Improve our bound function implementation
ysuzuki@apple.com [Sun, 22 Dec 2019 03:12:00 +0000 (03:12 +0000)]
[JSC] Improve our bound function implementation
https://bugs.webkit.org/show_bug.cgi?id=205327

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/function-bind-no-inlining-repeat-call.js: Added.
(assert):
(test):
(test2):
(foo):
(let.start.Date.now):
* stress/bind-args.js: Added.
(shouldBe):
(test):
(test2):

Source/JavaScriptCore:

This patch improves Function#bind, and calling bound function with bound arguments.

1. Rename CallFrameSlot::argumentCount to CallFrameSlot::argumentCountIncludingThis.
2. Do not include name in NativeExecutable for JSBoundFunction. Putting name in NativeExecutable is assuming that function + name pair is almost identical.
   This is true in host functions except for JSBoundFunction. JSBoundFunction should hold its name in JSBoundFunction.
3. Cache NativeExecutable for JSBoundFunction in the VM. We use a hash-map in JITThunk for NativeExecutables because we assume that host-function creation cannot be
   done by the user program: each executable is pre-defined to exactly one object by the environment, and there is no way to create host-functions repeatedly from
   the user-program. The only exception to this is JSBoundFunction so caching it on the VM avoids the hash-map lookup. This is not true for JSBoundFunction.
4. ThunkGenerator should support JSBoundFunction call with bound arguments. It turns out that Speedometer2/React-Redux-TodoMVC is using bound function with
   bound arguments. Additionally, it is used. This is really bad: when dispatching an event, we first call this function from C++, entering JS world,
   going back to C++ world again, and entering JS world to call bound function again. By using ThunkGenerator, we can eliminate this back and forth by directly
   calling the bound JS Executable from the thunk. Previously, bound arguments are stored in JSArray. But it is difficult to access them from thunk since we need to consider
   have-a-bad-time case. Instead, we use JSImmutableButterfly to save bound arguments so that JIT thunk can quickly access arguments. To capture arguments as
   JSImmutableButterfly in JS world, we introduce op_create_arguments_butterfly, and handle it in all tiers.
5. It turns out that eager materialization of "length" in JSBoundFunction takes long time while it is rarely used. This patch makes length lazily reified for JSBoundFunction.
6. To make Function.prototype.bind faster, we track whether "name" and "length" properties of JSFunction is modified or not. This skips has-own-length-property check, which
   makes Function.prototype.bind 11~% faster.

Combining things above, creation of JSBoundFunction is 80~% faster. And calling bound function with bound arguments is 3~x faster.
This improves Speedometer2/React-TodoMVC by ~3%.

* builtins/FunctionPrototype.js:
(bind):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/AccessCaseSnippetParams.cpp:
(JSC::SlowPathCallGeneratorWithArguments::generateImpl):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeList.rb:
* bytecode/BytecodeUseDef.cpp:
(JSC::computeUsesForBytecodeIndexImpl):
(JSC::computeDefsForBytecodeIndexImpl):
* bytecode/VirtualRegister.cpp:
(JSC::VirtualRegister::dump const):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitCreateArgumentsButterfly):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_createArgumentsButterfly):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGArgumentsUtilities.cpp:
(JSC::DFG::argumentsInvolveStackSlot):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::flushImpl):
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::isLiveInBytecode):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::forAllLocalsLiveInBytecode):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::emitStoreCallSiteIndex):
* dfg/DFGNodeType.h:
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::emitRestoreArguments):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::OSRExit::emitRestoreArguments):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPreciseLocalClobberize.h:
(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCreateArgumentsButterfly):
(JSC::DFG::SpeculativeJIT::compileGetArgumentCountIncludingThis):
(JSC::DFG::SpeculativeJIT::compileSetArgumentCountIncludingThis):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStackLayoutPhase.cpp:
(JSC::DFG::StackLayoutPhase::run):
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateArgumentsButterfly):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileSetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
(JSC::FTL::DFG::LowerDFGToB3::getArgumentsLength):
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):
* ftl/FTLSlowPathCall.h:
(JSC::FTL::callOperation):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::callSiteAsRawBits const):
(JSC::CallFrame::unsafeCallSiteAsRawBits const):
(JSC::CallFrame::setCurrentVPC):
* interpreter/CallFrame.h:
(JSC::CallFrame::argumentCountIncludingThis const):
(JSC::CallFrame::setArgumentCountIncludingThis):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitAssertArgumentCountSane):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::argumentCount):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::dump const):
(JSC::CallFrameShuffler::prepareForTailCall):
(JSC::CallFrameShuffler::prepareAny):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::compileWithoutLinking):
* jit/JITCall.cpp:
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::updateTopCallFrame):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_argument_count):
(JSC::JIT::emit_op_get_rest_length):
(JSC::JIT::emit_op_get_argument):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::SpecializedThunkJIT):
* jit/ThunkGenerators.cpp:
(JSC::arityFixupGenerator):
(JSC::boundFunctionCallGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator): Deleted.
* jit/ThunkGenerators.h:
* jsc.cpp:
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* llint/WebAssembly.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/ExecutableBase.h:
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::FunctionRareData):
* runtime/FunctionRareData.h:
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototypeGetterCompare):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototypeGetterFormat):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototypeGetterFormat):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/JSBoundFunction.cpp:
(JSC::boundThisNoArgsFunctionCall):
(JSC::boundFunctionCall):
(JSC::boundThisNoArgsFunctionConstruct):
(JSC::boundFunctionConstruct):
(JSC::JSBoundFunction::create):
(JSC::JSBoundFunction::JSBoundFunction):
(JSC::JSBoundFunction::boundArgsCopy):
(JSC::JSBoundFunction::visitChildren):
* runtime/JSBoundFunction.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::finishCreation):
(JSC::JSFunction::name):
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::JSFunction::reifyLength):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::reifyLazyPropertyForHostOrBuiltinIfNeeded):
(JSC::JSFunction::reifyLazyBoundNameIfNeeded):
* runtime/JSFunction.h:
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::areNameAndLengthOriginal):
* runtime/JSGlobalObject.cpp:
(JSC::makeBoundFunction):
(JSC::hasOwnLengthProperty):
* runtime/JSObject.h:
(JSC::getJSFunction):
(JSC::getCallData): Deleted.
(JSC::getConstructData): Deleted.
* runtime/JSObjectInlines.h:
(JSC::getCallData):
(JSC::getConstructData):
* runtime/VM.cpp:
(JSC::thunkGeneratorForIntrinsic):
(JSC::VM::getBoundFunction):
* runtime/VM.h:
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

Tools:

Support running slow-microbenchmarks.

* Scripts/run-jsc-benchmarks:

LayoutTests:

* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:

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

7 months ago[Media in GPU process] Add remote media player configuration
eric.carlson@apple.com [Sun, 22 Dec 2019 03:09:18 +0000 (03:09 +0000)]
[Media in GPU process] Add remote media player configuration
https://bugs.webkit.org/show_bug.cgi?id=205541
<rdar://problem/58137418>

Reviewed by Simon Fraser.

* GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
* GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
* GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

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

7 months agoMake JSString values from literals in a single consistent style
darin@apple.com [Sun, 22 Dec 2019 00:43:04 +0000 (00:43 +0000)]
Make JSString values from literals in a single consistent style
https://bugs.webkit.org/show_bug.cgi?id=205517

Reviewed by Saam Barati.

Some call sites did it like this:

    jsNontrivialString(vm, "literal"_s)

Others did it one of these:

    jsString(vm, "literal")
    jsNontrivialString(vm, "literal")

Changed all the call sites to do it the first, *slightly* more efficient, way.

* runtime/ArrayIteratorPrototype.cpp:
(JSC::ArrayIteratorPrototype::finishCreation):
* runtime/AsyncFunctionPrototype.cpp:
(JSC::AsyncFunctionPrototype::finishCreation):
* runtime/AsyncGeneratorFunctionPrototype.cpp:
(JSC::AsyncGeneratorFunctionPrototype::finishCreation):
* runtime/AsyncGeneratorPrototype.cpp:
(JSC::AsyncGeneratorPrototype::finishCreation):
* runtime/BigIntPrototype.cpp:
(JSC::BigIntPrototype::finishCreation):
* runtime/GeneratorFunctionPrototype.cpp:
(JSC::GeneratorFunctionPrototype::finishCreation):
* runtime/GeneratorPrototype.cpp:
(JSC::GeneratorPrototype::finishCreation):
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototype::finishCreation):
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::formatToParts):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::formatToParts):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototype::finishCreation):
* runtime/IntlPluralRulesPrototype.cpp:
(JSC::IntlPluralRulesPrototype::finishCreation):
* runtime/JSDataViewPrototype.cpp:
(JSC::JSDataViewPrototype::finishCreation):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
* runtime/JSONObject.cpp:
(JSC::JSONObject::finishCreation):
* runtime/JSPromisePrototype.cpp:
(JSC::JSPromisePrototype::finishCreation):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewProtoGetterFuncToStringTag):
* runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototype::finishCreation):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoGetterSource):
* runtime/RegExpStringIteratorPrototype.cpp:
(JSC::RegExpStringIteratorPrototype::finishCreation):
* runtime/SetIteratorPrototype.cpp:
(JSC::SetIteratorPrototype::finishCreation):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):
* runtime/StringIteratorPrototype.cpp:
(JSC::StringIteratorPrototype::finishCreation):
* runtime/SymbolPrototype.cpp:
(JSC::SymbolPrototype::finishCreation):
* runtime/WeakMapPrototype.cpp:
(JSC::WeakMapPrototype::finishCreation):
* runtime/WeakObjectRefPrototype.cpp:
(JSC::WeakObjectRefPrototype::finishCreation):
* runtime/WeakSetPrototype.cpp:
(JSC::WeakSetPrototype::finishCreation):
Call jsNontrivialString instead of jsString and use the _s suffix.

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

7 months agoMove Vector HashTraits to HashTraits.h to fix GCC build
antti@apple.com [Sat, 21 Dec 2019 17:18:32 +0000 (17:18 +0000)]
Move Vector HashTraits to HashTraits.h to fix GCC build
https://bugs.webkit.org/show_bug.cgi?id=205540

Reviewed by Zalan Bujtas.

Source/WebCore:

* contentextensions/DFAMinimizer.cpp:

ActionKey HashTrait claims that emptyValueIsZero. Now with Vector HashTrait having emptyValueIsZero too
HashMap<ActionKey, Vector<>> started taking the optimized path.

However ActionKey empty value wasn't actually zero because Empty enum value wasn't 0.

Source/WTF:

GCC is stricter than LLVM with partial specializations

Error: partial specialization of struct WTF::HashTraits<WTF::Vector<U, otherCapacity, WTF::CrashOnOverflow, 16> >
after instantiation of struct WTF::HashTraits<WTF::Vector<WTF::String> >

* wtf/HashTraits.h:
* wtf/VectorHash.h:

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

7 months agoAdd timeStamp to ITP database
katherine_cheney@apple.com [Sat, 21 Dec 2019 14:58:01 +0000 (14:58 +0000)]
Add timeStamp to ITP database
https://bugs.webkit.org/show_bug.cgi?id=205121
<rdar://problem/57633021>

Reviewed by John Wilander.

Source/WebCore:

* loader/ResourceLoadStatistics.h:

Source/WebKit:

This patch adds support for collecting most-recently-updated
timestamps for third-party/first-party domain pairs in the ITP database.
It updates the timestamp when new statistics are merged into the
database. It then exposes the timestamp via the
_getResourceLoadStatisticsDataSummary API.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
Changed INSERT OR IGNORE queries to be INSERT OR REPLACE so the timestamp
will be replaced upon a new attempted insert into one of the
third-party/first-party relationship tables.
ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList now
checks for the keyword "REPLACE" to know if another bind is needed
to update the timestamp.

(WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp):
Queries the most recent time that the third party has appeared as a
subframe or subresource under the first party or redirected to the first party.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
(WebKit::ThirdPartyDataForSpecificFirstParty::toString const):
Updated the toString to check if the timestamp occured in the last
24 hours for testing purposes. It doesn't print the specific time
because it would change for every run and could not be tested.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setUseITPDatabase:completionHandler:]):
Added new function that enables the ITP Database backend so the
timestamp parameter can be tested in in TestWebKitAPI.

* UIProcess/API/APIResourceLoadStatisticsFirstParty.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h:
* UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm:
(-[_WKResourceLoadStatisticsFirstParty timeLastUpdated]):
Added the new timestamp parameter to the _WKResourceLoadStatisticsFirstParty.mm
class and its wrapper to be sent via API call.

Tools:

Added checks to test that the timestamp is properly exposed via API
in the ITP database backend. This also adds an API test case using the
ITP database store. It was previously only testing the ITP memory store.

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

LayoutTests:

This patch updates test expectations which call
dumpResourceLoadStatistics to reflect the new timestamp parameter that
is now printed with the ITP data summary.

* http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access-database-expected.txt:
* http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access-expected.txt:
* http/tests/storageAccess/aggregate-sorted-data-with-storage-access-database-expected.txt:
* http/tests/storageAccess/aggregate-sorted-data-with-storage-access-expected.txt:

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

7 months ago[JSC] Remove m_globalObject field from JSFunction
ysuzuki@apple.com [Sat, 21 Dec 2019 09:49:40 +0000 (09:49 +0000)]
[JSC] Remove m_globalObject field from JSFunction
https://bugs.webkit.org/show_bug.cgi?id=205533

Reviewed by Mark Lam.

JSFunction::m_globalObject is used only when it is using NativeExecutable.
And when using NativeExecutable, JSCallee::m_scope is always pointing JSGlobalObject.
This patch removes JSFunction::m_globalObject field.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewFunction):
* jit/ThunkGenerators.cpp:
(JSC::nativeForGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSFunction.cpp:
(JSC::JSFunction::JSFunction):
* runtime/JSFunction.h:
(JSC::JSFunction::offsetOfGlobalObject): Deleted.
(JSC::JSFunction::globalObject const): Deleted.
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::JSFunction):

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

7 months ago[Media in GPU process] Get audio playing
eric.carlson@apple.com [Sat, 21 Dec 2019 07:35:44 +0000 (07:35 +0000)]
[Media in GPU process] Get audio playing
https://bugs.webkit.org/show_bug.cgi?id=205511
<rdar://problem/58120354>

Reviewed by Jer Noble.

Source/WebCore:

Tested manually with a modified sandbox because it isn't possible to load media
in the GPU process yet.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::bufferedTimeRangesChanged):
(WebCore::MediaPlayer::seekableTimeRangesChanged):
* platform/graphics/MediaPlayer.h:
* platform/graphics/PlatformTimeRanges.cpp:
(WebCore::PlatformTimeRanges::PlatformTimeRanges):
(WebCore::PlatformTimeRanges::clear):
* platform/graphics/PlatformTimeRanges.h:

Source/WebKit:

* GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::updateCachedState):
(WebKit::MediaPlayerPrivateRemote::maximumDurationToCacheMediaTime const):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/RemoteMediaPlayerManager.h:

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

7 months agoTextManipulationController should respect new token orders
rniwa@webkit.org [Sat, 21 Dec 2019 02:09:50 +0000 (02:09 +0000)]
TextManipulationController should respect new token orders
https://bugs.webkit.org/show_bug.cgi?id=205378

Reviewed by Wenson Hsieh.

Source/WebCore:

Updated TextManipulationController::replace to remove all existing content and insert new tokens in the order they appear.

To do this, we first find the common ancestor of all nodes in the paragraph and then remove all nodes in between.

Then we'd insert the node identified by the token identifier and all its ancestors at where they appear. In the case
the same token is used for the second time, we clone its node. For each leaf node, we find the closest ancestor which
had already been inserted by the previous token, and append the leaf node along with its ancestors to it.

I'm expecting to make a lot of refinements & followups to this algorithm in the future but this seems to get basics done.

Tests: TextManipulation.CompleteTextManipulationReplaceSimpleSingleParagraph
       TextManipulation.CompleteTextManipulationDisgardsTokens
       TextManipulation.CompleteTextManipulationReordersContent
       TextManipulation.CompleteTextManipulationCanSplitContent
       TextManipulation.CompleteTextManipulationCanMergeContent
       TextManipulation.CompleteTextManipulationFailWhenContentIsRemoved
       TextManipulation.CompleteTextManipulationFailWhenExcludedContentAppearsMoreThanOnce
       TextManipulation.CompleteTextManipulationPreservesExcludedContent

* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::didCreateRendererForElement):
(WebCore::TextManipulationController::completeManipulation):
(WebCore::TextManipulationController::replace):

Tools:

Added a bunch of tests for WKTextManipulation.

* TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:
(TextManipulation.CompleteTextManipulationReplaceSimpleSingleParagraph):
(TextManipulation.CompleteTextManipulationDisgardsTokens):
(TextManipulation.CompleteTextManipulationReordersContent):
(TextManipulation.CompleteTextManipulationCanSplitContent):
(TextManipulation.CompleteTextManipulationCanMergeContent):
(TextManipulation.CompleteTextManipulationFailWhenContentIsRemoved):
(TextManipulation.CompleteTextManipulationFailWhenExcludedContentAppearsMoreThanOnce):
(TextManipulation.CompleteTextManipulationPreservesExcludedContent):

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

7 months agoWeb Inspector: Gradient editor: opacity slider is too close to the right edge of...
nvasilyev@apple.com [Sat, 21 Dec 2019 01:52:11 +0000 (01:52 +0000)]
Web Inspector: Gradient editor: opacity slider is too close to the right edge of the popover
https://bugs.webkit.org/show_bug.cgi?id=203643
<rdar://problem/56762879>

Reviewed by Devin Rousso.

Replace absolute positioning in the color picker with static layout.

* UserInterface/Views/ColorPicker.css:
(.color-picker .wrapper):
(.color-picker :matches(.color-square, .slider)):
(.color-picker .slider):
(.color-picker .hue):
(@media (color-gamut: p3) .color-picker.gamut-p3 > .hue):
(.color-picker > .color-inputs):
(.color-picker > .color-inputs > div):
(.color-picker > .color-inputs > div:not([hidden]) + div):
The 1st visible div should have no left margin even if it's preceded by a hidden div.

* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
(WI.ColorPicker.prototype._updateOpacitySlider):
* UserInterface/Views/GradientEditor.css:
(.gradient-editor.editing-color):
(.gradient-editor > .color-picker .slider):
* UserInterface/Views/GradientEditor.js:
(WI.GradientEditor):
* UserInterface/Views/Slider.css:
(.slider):
(.slider > img):
(body[dir=ltr] .slider > img):
(body[dir=rtl] .slider > img):
* UserInterface/Views/Slider.js:
(WI.Slider):
(WI.Slider.prototype.set value):
(WI.Slider.prototype.set knobY):
(WI.Slider.prototype.get maxY):
(WI.Slider.prototype.recalculateKnobY):
(WI.Slider.prototype._handleMousedown):
(WI.Slider.prototype._handleMousemove):
* UserInterface/Views/Variables.css:
(:root):
Convert WI.Slider to be vertical by default. WI.Slider used to define a hozirontal slider.
It is only used by the color picker, where it's vertical. The slider was rotated with CSS
transformation. This made it problematic to use in the static layout.

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

7 months agoREGRESSION (r253807): crash in storage/indexeddb/modern/opendatabase-request-private...
sihui_liu@apple.com [Sat, 21 Dec 2019 01:49:05 +0000 (01:49 +0000)]
REGRESSION (r253807): crash in storage/indexeddb/modern/opendatabase-request-private.html
https://bugs.webkit.org/show_bug.cgi?id=205515

Reviewed by Alex Christensen.

When m_openRequests of IDBTransaction is empty, we expect all requests associated with the transactions should
be completed, but in IDBOpenDBRequest, we removed the request from m_openRequests before
m_currentlyCompletingRequest finished. This is because the order of calling ActiveDOMObject::stop() is random.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::cancelForStop):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::connectionClosedFromServer):

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

7 months agoPaint highlights specified in CSS Highlight API
megan_gardner@apple.com [Sat, 21 Dec 2019 01:33:10 +0000 (01:33 +0000)]
Paint highlights specified in CSS Highlight API
https://bugs.webkit.org/show_bug.cgi?id=205318

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-highlight-api/highlight-text-across-elements-expected.html: Added.
* web-platform-tests/css/css-highlight-api/highlight-text-across-elements.html: Added.
* web-platform-tests/css/css-highlight-api/highlight-text-expected.html: Added.
* web-platform-tests/css/css-highlight-api/highlight-text.html: Added.

Source/WebCore:

Render highlights when present, similar to the way we render selection.

Tests: imported/w3c/web-platform-tests/css/css-highlight-api/highlight-text-across-elements.html
       imported/w3c/web-platform-tests/css/css-highlight-api/highlight-text.html

* Modules/highlight/HighlightMap.h:
(WebCore::HighlightMap::map const):

Add a getter for the internal HashMap.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionState):
(WebCore::InlineTextBox::verifySelectionState const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::clampedStartEndForState const):
(WebCore::InlineTextBox::selectionStartEnd const):
(WebCore::InlineTextBox::highlightStartEnd const):
(WebCore::InlineTextBox::resolveStyleForMarkedText):

Use the highlight name from the HighlightRangeGroup to obtain the style from the renderer.

(WebCore::InlineTextBox::collectMarkedTextsForHighlights const):

Render the highlights when painting text. Determine if a highlight is present in the current RenderObject, and
add additional MarkedText to be rendered when painting

* rendering/InlineTextBox.h:
* rendering/MarkedText.cpp:
(WebCore::subdivide):
* rendering/MarkedText.h:
(WebCore::MarkedText::operator== const):

Expand MarkedText to take a style name.

* rendering/SelectionRangeData.cpp:
(WebCore::SelectionRangeData::setContext):
(WebCore::SelectionRangeData::selectionStateForRenderer):
(WebCore::SelectionRangeData::set):
* rendering/SelectionRangeData.h:

Leverage SelectionRangeData for highlights.

Tools:

Expand MarkedText to take a style name.

* TestWebKitAPI/Tests/WebCore/MarkedText.cpp:
(WebCore::operator<<):

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

7 months ago[iOS Debug] imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html...
cdumez@apple.com [Sat, 21 Dec 2019 01:13:54 +0000 (01:13 +0000)]
[iOS Debug] imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=205506
<rdar://problem/58118091>

Reviewed by Darin Adler.

Source/WebCore:

Drop iOS specific hack in FrameLoader::checkCompleted() that was causing this crash in iOS Debug.
This hack was added a long time ago to fix back/forward navigation after clicking an intra PDF
document hyperlink. I have verified on iOS 13 that the behavior is unchanged without this code:
- Back/forward navigation within a PDF work in UIWebView and do not work in WKWebView

No new tests, unskipped existing test.

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

LayoutTests:

* platform/ios-wk2/TestExpectations:
Remove Crash expectation for this test in iOS Debug.

* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https-expected.txt: Removed.
Drop iOS-specific baseline now that the behavior is consistent across platforms.

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

7 months ago[Bindings] Add @@toStringTag to our iterator prototype object
cdumez@apple.com [Sat, 21 Dec 2019 01:04:28 +0000 (01:04 +0000)]
[Bindings] Add @@toStringTag to our iterator prototype object
https://bugs.webkit.org/show_bug.cgi?id=205516

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

* web-platform-tests/WebIDL/ecmascript-binding/default-iterator-object-expected.txt:
* web-platform-tests/WebIDL/ecmascript-binding/iterator-prototype-object-expected.txt:

Source/WebCore:

Add @@ toStringTag to our iterator prototype object, as per:
- https://heycam.github.io/webidl/#es-iterator-prototype-object

No new tests, rebaselined existing tests.

* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::finishCreation):

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

7 months ago[JSC] Memory usage statistics should be attainable without WebCore
ross.kirsling@sony.com [Sat, 21 Dec 2019 00:05:46 +0000 (00:05 +0000)]
[JSC] Memory usage statistics should be attainable without WebCore
https://bugs.webkit.org/show_bug.cgi?id=205366

Reviewed by Keith Miller.

* API/JSBase.cpp:
(JSGetMemoryUsageStatistics):
* API/JSBasePrivate.h:
Add a private JSC API exposing the same Heap stats as WebCore's PerformanceLogging::memoryUsageStatistics.

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

7 months agoEnable HDR Media Capabilities by default
jer.noble@apple.com [Fri, 20 Dec 2019 23:51:36 +0000 (23:51 +0000)]
Enable HDR Media Capabilities by default
https://bugs.webkit.org/show_bug.cgi?id=205518
<rdar://problem/57674289>

Reviewed by Eric Carlson.

* Shared/WebPreferences.yaml:

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

7 months agoMediaKeySession.load() fails
jer.noble@apple.com [Fri, 20 Dec 2019 23:43:48 +0000 (23:43 +0000)]
MediaKeySession.load() fails
https://bugs.webkit.org/show_bug.cgi?id=205467

Reviewed by Eric Carlson.

Invert the storageURL condition in load().

Drive-by fix: ask the group for it's sessionID, not the session, if it exists.

* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):

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

7 months agoAdd some missing skips in LayoutTests/gpu-process/TestExpectations
commit-queue@webkit.org [Fri, 20 Dec 2019 23:30:42 +0000 (23:30 +0000)]
Add some missing skips in LayoutTests/gpu-process/TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=205523

Patch by Peng Liu <peng.liu6@apple.com> on 2019-12-20
Reviewed by Eric Carlson.

* gpu-process/TestExpectations:

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

7 months agoClean up and generalize some interaction additions
timothy_horton@apple.com [Fri, 20 Dec 2019 23:24:00 +0000 (23:24 +0000)]
Clean up and generalize some interaction additions
https://bugs.webkit.org/show_bug.cgi?id=205430

Reviewed by Wenson Hsieh.

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

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

7 months agoExpose approximate caret extents for the hit line via InteractionInformationAtPosition
timothy_horton@apple.com [Fri, 20 Dec 2019 23:21:30 +0000 (23:21 +0000)]
Expose approximate caret extents for the hit line via InteractionInformationAtPosition
https://bugs.webkit.org/show_bug.cgi?id=205526
<rdar://problem/57983076>

Reviewed by Dean Jackson.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::positionInformation):
Compute and expose the union of first and last caret rects on the line.

* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
* Shared/ios/InteractionInformationRequest.cpp:
(WebKit::InteractionInformationRequest::encode const):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
* Shared/ios/InteractionInformationRequest.h:
Also, add a bit so that we can only fetch this data when needed.

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

7 months agoRemove access to 'com.apple.cfprefsd.agent' from the macOS sandbox
bfulgham@apple.com [Fri, 20 Dec 2019 23:15:00 +0000 (23:15 +0000)]
Remove access to 'com.apple.cfprefsd.agent' from the macOS sandbox
https://bugs.webkit.org/show_bug.cgi?id=205478
<rdar://problem/57915066>

Reviewed by Darin Adler.

Source/WebKit:

Telemetry and thorough testing has confirmed that we do not need access to this
mach service, and so should remove it.

Tested by fast/sandboxing/mac

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

LayoutTests:

* fast/sandbox/mac/sandbox-mach-lookup-expected.txt:
* fast/sandbox/mac/sandbox-mach-lookup.html:

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

7 months agosendBeacon on Safari 13 seeing high failure rates
cdumez@apple.com [Fri, 20 Dec 2019 22:59:44 +0000 (22:59 +0000)]
sendBeacon on Safari 13 seeing high failure rates
https://bugs.webkit.org/show_bug.cgi?id=204665
<rdar://problem/57522622>

Reviewed by Darin Adler.

Revert r245344 to try and reduce our failure rate for Beacon. This is the only change
to our Beacon implementation that I am aware we made in Safari 13. Using a lower priority
for Beacon makes it more likely that the Beacon load is still pending when the network
process exits, which would interrupt the Beacon.

Since we're trying to convince developers to move away from synchronous XHR and to using
the Beacon API intead, it is important that our Beacon API be as reliable as possible.

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

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

7 months agoUpdate TestExpectatipons for media/track/track-in-band-cues-added-once.html
ap@apple.com [Fri, 20 Dec 2019 22:52:27 +0000 (22:52 +0000)]
Update TestExpectatipons for media/track/track-in-band-cues-added-once.html
https://bugs.webkit.org/show_bug.cgi?id=142152

The test no longer times out on bots or in local testing. It is still a flaky failure.

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

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

7 months agolldbwebkittester: Strip CLANG_DEBUG_INFORMATION_LEVEL option while building
jbedard@apple.com [Fri, 20 Dec 2019 22:30:34 +0000 (22:30 +0000)]
lldbwebkittester: Strip CLANG_DEBUG_INFORMATION_LEVEL option while building
https://bugs.webkit.org/show_bug.cgi?id=205513

Reviewed by Alexey Proskuryakov.

* Scripts/webkitdirs.pm:
(buildXCodeProject): Strip CLANG_DEBUG_INFORMATION_LEVEL from lldbWebKitTester.

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

7 months agoUnreviewed, rolling out r253820.
tsavell@apple.com [Fri, 20 Dec 2019 21:51:48 +0000 (21:51 +0000)]
Unreviewed, rolling out r253820.

Broke Mac testing

Reverted changeset:

"Invalidate only affected elements after media query
evaluation changes"
https://bugs.webkit.org/show_bug.cgi?id=205392
https://trac.webkit.org/changeset/253820

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

7 months agoREGRESSION: fast/shadow-dom/link-element-in-shadow-tree.html is flaky
tsavell@apple.com [Fri, 20 Dec 2019 21:44:22 +0000 (21:44 +0000)]
REGRESSION: fast/shadow-dom/link-element-in-shadow-tree.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=171784

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

7 months agoUnreviewed, try to fix the non-unified sources build.
bburg@apple.com [Fri, 20 Dec 2019 21:36:24 +0000 (21:36 +0000)]
Unreviewed, try to fix the non-unified sources build.

* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::filterTransports const):
The current chunking of unified source files seems to provide a
'using namespace WebCore' for these references to AuthenticatorTransport.
Add a namespace qualification so that this file compiles by itself.

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

7 months agoAdd a Custom User Agent menu to MiniBrowser, and related cleanup
simon.fraser@apple.com [Fri, 20 Dec 2019 21:03:26 +0000 (21:03 +0000)]
Add a Custom User Agent menu to MiniBrowser, and related cleanup
https://bugs.webkit.org/show_bug.cgi?id=205507

Reviewed by Wenson Hsieh.

Add a User Agent" submenu to the Settings menu, and construct it with some built-in
UA strings. When changed, it sets the customUserAgent on the WKWebView/WebView and
triggers a reload.

I also rearranged the menus so that "Settings" and "Debug" are no longer to the right
of the "Help" menu, which means getting the Settings menu from the xib. It was then
easier if SettingsController was no longer a singleton, but owned by AppDelegate.
Added a category on NSApplication to make it easier to get to BrowserAppDelegate
and thence to the SettingsController.

* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
(-[NSApplication browserAppDelegate]):
(-[BrowserAppDelegate awakeFromNib]):
(-[BrowserAppDelegate defaultConfiguration]):
(-[BrowserAppDelegate defaultPreferences]):
(-[BrowserAppDelegate createBrowserWindowController:]):
(-[BrowserAppDelegate newWindow:]):
(-[BrowserAppDelegate newPrivateWindow:]):
(-[BrowserAppDelegate applicationDidFinishLaunching:]):
(-[BrowserAppDelegate _updateNewWindowKeyEquivalents]):
(-[BrowserAppDelegate userContentContoller]):
(defaultConfiguration): Deleted.
(defaultPreferences): Deleted.
* MiniBrowser/mac/ExtensionManagerWindowController.m:
(-[ExtensionManagerWindowController init]):
(-[ExtensionManagerWindowController add:]):
(-[ExtensionManagerWindowController remove:]):
* MiniBrowser/mac/MainMenu.xib:
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController initWithMenu:]):
(-[SettingsController dealloc]):
(-[SettingsController _populateMenu]):
(+[SettingsController userAgentData]):
(-[SettingsController buildUserAgentsMenu:]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController _toggleBooleanDefault:]):
(-[SettingsController toggleExperimentalFeature:]):
(-[SettingsController toggleInternalDebugFeature:]):
(-[SettingsController customUserAgent]):
(-[SettingsController changeCutomUserAgent:]):
(+[SettingsController shared]): Deleted.
(-[SettingsController init]): Deleted.
(-[SettingsController menu]): Deleted.
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController awakeFromNib]):
(-[WK1BrowserWindowController userAgentDidChange:]):
(-[WK1BrowserWindowController windowWillClose:]):
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController initWithConfiguration:]):
(-[WK2BrowserWindowController userAgentDidChange:]):
(-[WK2BrowserWindowController windowWillClose:]):
(-[WK2BrowserWindowController didChangeSettings]):

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

7 months agoInclude WKPDFConfiguration, WKFindConfiguration, and WKFindResult in umbrella header
commit-queue@webkit.org [Fri, 20 Dec 2019 20:51:47 +0000 (20:51 +0000)]
Include WKPDFConfiguration, WKFindConfiguration, and WKFindResult in umbrella header
https://bugs.webkit.org/show_bug.cgi?id=205432
<rdar://problem/58067946>

Patch by James Savage <james.savage@apple.com> on 2019-12-20
Reviewed by Wenson Hsieh.

* Shared/API/Cocoa/WebKit.h: Include new headers.

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

7 months agoSWServer can be created without any path to store registrations in non ephemeral...
youenn@apple.com [Fri, 20 Dec 2019 20:43:31 +0000 (20:43 +0000)]
SWServer can be created without any path to store registrations in non ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=205500

Reviewed by Simon Fraser.

No change of behavior in release.
Remove debug assert and log the case of a non ephemeral session without a path.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::SWServer):

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

7 months agoWeb Inspector: convert some InspectorFrontendHost methods to getters
bburg@apple.com [Fri, 20 Dec 2019 20:42:43 +0000 (20:42 +0000)]
Web Inspector: convert some InspectorFrontendHost methods to getters
https://bugs.webkit.org/show_bug.cgi?id=205475

Reviewed by Devin Rousso.

Source/WebCore:

No reason for these to be method calls, so expose as getters / attributes instead.

* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::isRemote const):
(WebCore::debuggableTypeToString):
(WebCore::InspectorFrontendHost::localizedStringsURL): Deleted.
(WebCore::InspectorFrontendHost::backendCommandsURL): Deleted.
(WebCore::InspectorFrontendHost::debuggableType): Deleted.
(WebCore::InspectorFrontendHost::inspectionLevel): Deleted.
(WebCore::InspectorFrontendHost::platform): Deleted.
(WebCore::InspectorFrontendHost::port): Deleted.
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
* testing/Internals.cpp:

Source/WebInspectorUI:

No reason for these to be method calls, so expose as getters / attributes instead.

* UserInterface/Base/LoadLocalizedStrings.js:
* UserInterface/Base/Main.js:
* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore.get _databaseName):
* UserInterface/Base/Platform.js:
* UserInterface/Base/Setting.js:
(WI.Setting._localStorageKey):
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
* UserInterface/Protocol/LoadInspectorBackendCommands.js:

Source/WebKit:

No reason for these to be method calls, so expose as getters / attributes instead.

* WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
(WebKit::WebInspectorUI::localizedStringsURL const):
(WebKit::RemoteWebInspectorUI::localizedStringsURL const):
(WebKit::WebInspectorUI::localizedStringsURL): Deleted.
(WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.
* WebProcess/WebPage/mac/WebInspectorUIMac.mm:
(WebKit::WebInspectorUI::localizedStringsURL const):
(WebKit::RemoteWebInspectorUI::localizedStringsURL const):
(WebKit::WebInspectorUI::localizedStringsURL): Deleted.
(WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.
* WebProcess/WebPage/win/WebInspectorUIWin.cpp:
(WebKit::WebInspectorUI::localizedStringsURL const):
(WebKit::RemoteWebInspectorUI::localizedStringsURL const):
(WebKit::WebInspectorUI::localizedStringsURL): Deleted.
(WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.
* WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp:
(WebKit::WebInspectorUI::localizedStringsURL const):
(WebKit::RemoteWebInspectorUI::localizedStringsURL const):
(WebKit::WebInspectorUI::localizedStringsURL): Deleted.
(WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.

Source/WebKitLegacy/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::localizedStringsURL const):
(WebInspectorFrontendClient::localizedStringsURL): Deleted.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::localizedStringsURL const):
(WebInspectorFrontendClient::localizedStringsURL): Deleted.

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::localizedStringsURL const):
(WebInspectorFrontendClient::localizedStringsURL): Deleted.
* WebCoreSupport/WebInspectorClient.h:

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

7 months agoFlaky crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC on webaudio...
tsavell@apple.com [Fri, 20 Dec 2019 20:40:47 +0000 (20:40 +0000)]
Flaky crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC on webaudio/silent-audio-interrupted-in-background.html
https://bugs.webkit.org/show_bug.cgi?id=202064

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

7 months agoIsolatedObject support for multiple parameterized attributes.
andresg_22@apple.com [Fri, 20 Dec 2019 20:33:20 +0000 (20:33 +0000)]
IsolatedObject support for multiple parameterized attributes.
https://bugs.webkit.org/show_bug.cgi?id=205508

Reviewed by Chris Fleizach.

- AXObjectCache now keeps the PageIdentifier so that it is possible to
retrieve it on the secondary thread without querying the Document.
- isIncrementor is exposed on AXCoreObject for spin button support.
- Several parameterized attributes implementation related to
TextMarkers are now dispatch to the main thread.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::setIsolatedTreeFocusedObject):
(WebCore::AXObjectCache::isolatedTreeRootObject):
(WebCore::AXObjectCache::remove):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilitySpinButton.h:
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedObject::AXIsolatedObject):
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::updateBackingStore):
(WebCore::AXIsolatedObject::findTextRanges const):
(WebCore::AXIsolatedObject::performTextOperation):
(WebCore::AXIsolatedObject::axObjectCache const):
(WebCore::AXIsolatedObject::widget const):
(WebCore::AXIsolatedObject::document const):
(WebCore::AXIsolatedObject::documentFrameView const):
(WebCore::AXIsolatedObject::isLoaded const): Implemented in header.
(WebCore::AXIsolatedObject::supportsPath const): Implemented in header.
* accessibility/isolatedtree/AXIsolatedTreeNode.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

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

7 months agoAllow a managed configuration to re-enable TLS 1.0 and 1.1
commit-queue@webkit.org [Fri, 20 Dec 2019 20:27:17 +0000 (20:27 +0000)]
Allow a managed configuration to re-enable TLS 1.0 and 1.1
https://bugs.webkit.org/show_bug.cgi?id=205479
<rdar://problem/54493516>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-12-20
Reviewed by Geoffrey Garen.

Source/WebCore/PAL:

Manually verified using the managed configuration attached to rdar://problem/56727605

* PAL.xcodeproj/project.pbxproj:
* pal/ios/ManagedConfigurationSoftLink.h: Added.
* pal/ios/ManagedConfigurationSoftLink.mm: Added.
* pal/spi/ios/ManagedConfigurationSPI.h: Copied from Source/WebKit/Platform/spi/ios/ManagedConfigurationSPI.h.

Source/WebKit:

* Platform/spi/ios/ManagedConfigurationSPI.h: Removed.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView _defineForWebView:]):
* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

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

7 months agoShare code for computing the absolute positioned line boxes for a range
dbates@webkit.org [Fri, 20 Dec 2019 19:40:37 +0000 (19:40 +0000)]
Share code for computing the absolute positioned line boxes for a range
https://bugs.webkit.org/show_bug.cgi?id=205510

Reviewed by Wenson Hsieh.

Implement RenderTextLineBoxes::absoluteRectsForRange() in terms of absoluteQuadsForRange()
to remove almost identical code. This makes absoluteRectsForRange() a tiny bit slower. If
it turns out this slowness isn't so tiny then we should use revert this change and implement
again using templates to avoid duplication.

Also moved absoluteQuadsForRange() to be above absoluteRectsForRange() to group these
related functions closer together.

* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::absoluteQuadsForRange const): No change, though I moved it
to be above absoluteRectsForRange().
(WebCore::RenderTextLineBoxes::absoluteRectsForRange const): Implement in terms of absoluteQuadsForRange().
* rendering/RenderTextLineBoxes.h: Group absolute*ForRange() declarations.

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

7 months agoUnreviewed, rolling out r253831.
tsavell@apple.com [Fri, 20 Dec 2019 19:18:46 +0000 (19:18 +0000)]
Unreviewed, rolling out r253831.

Inadvertent rollout of r253829

Reverted changeset:

"Unreviewed, rolling out r253829."
https://bugs.webkit.org/show_bug.cgi?id=205502
https://trac.webkit.org/changeset/253831

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

7 months agoUnreviewed, rolling out r253829.
tsavell@apple.com [Fri, 20 Dec 2019 19:17:02 +0000 (19:17 +0000)]
Unreviewed, rolling out r253829.

This is blocking the rollout of r253705

Reverted changeset:

"Import web-platform-tests/subresource-integrity tests from
usptream"
https://bugs.webkit.org/show_bug.cgi?id=205502
https://trac.webkit.org/changeset/253829

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

7 months agoimported/w3c/web-platform-tests/beacon/beacon-redirect.window.html has been flaky...
cdumez@apple.com [Fri, 20 Dec 2019 19:11:52 +0000 (19:11 +0000)]
imported/w3c/web-platform-tests/beacon/beacon-redirect.window.html has been flaky since it was imported in r253760
https://bugs.webkit.org/show_bug.cgi?id=205504
<rdar://problem/58115444>

Unreviewed, mark test as flaky.

* TestExpectations:

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

7 months agoImport web-platform-tests/subresource-integrity tests from usptream
cdumez@apple.com [Fri, 20 Dec 2019 19:03:21 +0000 (19:03 +0000)]
Import web-platform-tests/subresource-integrity tests from usptream
https://bugs.webkit.org/show_bug.cgi?id=205502

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import web-platform-tests/subresource-integrity tests from usptream 5f8d15ebdcf0495c271c.

* web-platform-tests/subresource-integrity/*: Added.

LayoutTests:

* TestExpectations:

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

7 months ago[iOS Debug] imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html...
cdumez@apple.com [Fri, 20 Dec 2019 18:13:13 +0000 (18:13 +0000)]
[iOS Debug] imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=205506

Unreviewed, mark imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html as crashing
on iOS Debug. The test has been crashing on this platform since it was imported in r253791.

* platform/ios-wk2/TestExpectations:

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

7 months agoRemove the certificate info checks related to getUserMedia
youenn@apple.com [Fri, 20 Dec 2019 17:57:00 +0000 (17:57 +0000)]
Remove the certificate info checks related to getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=205493

Reviewed by Eric Carlson.

Now that navigator.mediaDevices is SecureContext, we do not need to do the same checks in UserMediaController.
UserMediaController was also checking the certificate info which is not necessary for MediaDevices.
Covered by manual tests.

* Modules/mediastream/UserMediaController.cpp:
(WebCore::isSecure):
(WebCore::isAllowedByFeaturePolicy): Deleted.
(WebCore::isAllowedToUse): Deleted.
(WebCore::UserMediaController::canCallGetUserMedia const): Deleted.
(WebCore::UserMediaController::logGetUserMediaDenial): Deleted.

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

7 months agoSet whether to use mock capture devices at GPUProcess creation time.
youenn@apple.com [Fri, 20 Dec 2019 17:40:35 +0000 (17:40 +0000)]
Set whether to use mock capture devices at GPUProcess creation time.
https://bugs.webkit.org/show_bug.cgi?id=205492

Reviewed by Eric Carlson.

This ensures UIProcess remains always in sync with GPUProcess.
Covered by fast/mediastream/captureAudioInGPUProcess.html.

* GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::initializeGPUProcess):
(WebKit::GPUProcess::setMockCaptureDevicesEnabled):
* GPUProcess/GPUProcess.h:
* GPUProcess/GPUProcessCreationParameters.cpp:
(WebKit::GPUProcessCreationParameters::encode const):
(WebKit::GPUProcessCreationParameters::decode):
* GPUProcess/GPUProcessCreationParameters.h:
* UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::singleton):

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

7 months agowebrtc/video-autoplay.html is flaky on iOS simulator
youenn@apple.com [Fri, 20 Dec 2019 17:37:34 +0000 (17:37 +0000)]
webrtc/video-autoplay.html is flaky on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=205495

Reviewed by Eric Carlson.

* webrtc/video-autoplay-expected.txt:
* webrtc/video-autoplay.html:
Do test one video at a time so that one video does not interrupt the other.

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

7 months agoBuild ANGLE as a dynamic library
dino@apple.com [Fri, 20 Dec 2019 17:34:10 +0000 (17:34 +0000)]
Build ANGLE as a dynamic library
https://bugs.webkit.org/show_bug.cgi?id=204708
Source/ThirdParty/ANGLE:

rdar://57349384

Reviewed by Tim Horton.

Take 2 at attempting this. The first time was rolled out
due to failures in Apple's upstream build system.

Modify ANGLE to build as a dynamic library. My (not thorough) testing suggests
this will reduce the in-flight binary size on Apple's build systems by at least
a factor of 10 (it was over 1G). Building release for x86_64-only:
    - Previously: libANGLE.a -- 306 MB
    - Now: libANGLE-shared.dylib -- 6.7 MB

In order to do this, some symbols needed to be exported from the
"sh" namespace (which are used in ANGLEWebKitBridge, but not when
ANGLE's rendering backend is active).

While here, I turned on some more build options, like ARC.

Lastly, I added a build phase that creates a fake libANGLE.a
because Apple's build system thinks that WebCore still needs it.

* ANGLE.xcodeproj/project.pbxproj: Link with IOKit and IOSurface frameworks, and
product a dylib product.
* Configurations/ANGLE.xcconfig: Update the configuration for a dynamic library.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* include/GLSLANG/ShaderLang.h: Add ANGLE_EXPORT to some functions to make
sure they will be visible in the exported library.
* include/GLSLANG/ShaderVars.h:
* src/libANGLE/renderer/gl/cgl/DisplayCGL.mm: Change reinterpret_cast to a normal
C cast so it can be annotated with __bridge.
(rx::DisplayCGL::isValidNativeWindow const):
* src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm: Ditto.
(rx::WindowSurfaceCGL::WindowSurfaceCGL):
(rx::WindowSurfaceCGL::~WindowSurfaceCGL):
* src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm: Ditto.
* src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.mm: Ditto.

Source/WebCore:

Reviewed by Tim Horton.

Weak link against libANGLE-shared.dylib rather than strong link to libANGLE.a.

* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
(WebCore::ANGLEWebKitBridge::cleanupCompilers):
(WebCore::ANGLEWebKitBridge::compileShaderSource):
(WebCore::ANGLEWebKitBridge::angleAvailable):
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):

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

7 months agoUnreviewed, mark imported/w3c/web-platform-tests/2dcontext/wide-gamut-canvas as flaky.
cdumez@apple.com [Fri, 20 Dec 2019 16:46:21 +0000 (16:46 +0000)]
Unreviewed, mark imported/w3c/web-platform-tests/2dcontext/wide-gamut-canvas as flaky.

Those were recently imported from upstream.

* TestExpectations:

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

7 months agoUnreviewed, skip imported/w3c/web-platform-tests/2dcontext/wide-gamut-canvas/canvas...
cdumez@apple.com [Fri, 20 Dec 2019 16:39:50 +0000 (16:39 +0000)]
Unreviewed, skip imported/w3c/web-platform-tests/2dcontext/wide-gamut-canvas/canvas-createImageBitmap-e_srgb.html

This test has been timing out since it was imported and slows down our test runs for no reason.

* TestExpectations:

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

7 months agoRe-skip imported/w3c/web-platform-tests/service-workers/service-worker/client-navigat...
cdumez@apple.com [Fri, 20 Dec 2019 16:34:57 +0000 (16:34 +0000)]
Re-skip imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html

I had unskipped this test in r253704 because it no longer appeared to time out on my machine. However,
it sill appears to time out on the bots (at least flakily).

* TestExpectations:

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

7 months agoInvalidate only affected elements after media query evaluation changes
antti@apple.com [Fri, 20 Dec 2019 16:34:01 +0000 (16:34 +0000)]
Invalidate only affected elements after media query evaluation changes
https://bugs.webkit.org/show_bug.cgi?id=205392

Reviewed by Zalan Bujtas.

Source/WebCore:

We currently invalidate style of the whole tree when a media query evaluation changes.
We can do better by constructing an invalidation RuleSet and invalidating only those
elements that are potentially affected.

* style/RuleSet.cpp:
(WebCore::Style::RuleSet::addRule):
(WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):

Construct and cache an invalidation RuleSet and associate with a set of media query changes.

(WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
(WebCore::Style::RuleSet::MediaQueryCollector::pop):
(WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):

Collect RuleFeatures which we later use to build invalidation RuleSet.

(WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded): Deleted.
* style/RuleSet.h:
(WebCore::Style::DynamicMediaQueryEvaluationChanges::append):
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::evaluateDynamicMediaQueries):
* style/StyleResolver.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::evaluateMediaQueries):

Use the invalidation RuleSet for accurate style invalidation.

* style/StyleScopeRuleSets.cpp:
(WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):

Collect invalidation RuleSets for author/user/user agent style.

* style/StyleScopeRuleSets.h:

Source/WTF:

Fix GCC build error

Error: partial specialization of ‘struct WTF::HashTraits<WTF::Vector<U, otherCapacity, WTF::CrashOnOverflow, 16> >’
       after instantiation of ‘struct WTF::HashTraits<WTF::Vector<WTF::String> >’

* wtf/HashTraits.h:
* wtf/VectorHash.h:

Move to HashTraits to HashTraits.h so it gets specialized before any instantiation.

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

7 months agoUnreviewed, address flakiness of imported/w3c/web-platform-tests/html/semantics/scrip...
cdumez@apple.com [Fri, 20 Dec 2019 16:31:14 +0000 (16:31 +0000)]
Unreviewed, address flakiness of imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/css-module-worker-test.html

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/css-module-worker-test-expected.txt:

LayoutTests:

* TestExpectations:

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

7 months agoUnreviewed, skip http/wpt/html/semantics/text-level-semantics/the-a-element/a-downloa...
cdumez@apple.com [Fri, 20 Dec 2019 16:29:04 +0000 (16:29 +0000)]
Unreviewed, skip http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html on macOS wk1

We do not support the download attribute on this platform.

* platform/mac-wk1/TestExpectations:

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

7 months ago[GTK][WPE] Wrong visualization of Conic gradients in high resolution displays
dpino@igalia.com [Fri, 20 Dec 2019 16:10:09 +0000 (16:10 +0000)]
[GTK][WPE] Wrong visualization of Conic gradients in high resolution displays
https://bugs.webkit.org/show_bug.cgi?id=205444

Reviewed by Carlos Alberto Lopez Perez.

Reduce the size of the separation between sections since a separation of
1 pixel is too wide in high resolution displays.

* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::addConicSector):

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

7 months agoUnreviewed, address review comment missed in the initial commit.
zalan@apple.com [Fri, 20 Dec 2019 13:50:51 +0000 (13:50 +0000)]
Unreviewed, address review comment missed in the initial commit.

* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine):
(WebCore::Layout::LineLayoutContext::commitContent):

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

7 months ago[LFC][IFC] Refactor LineLayoutContext class
zalan@apple.com [Fri, 20 Dec 2019 13:44:01 +0000 (13:44 +0000)]
[LFC][IFC] Refactor LineLayoutContext class
https://bugs.webkit.org/show_bug.cgi?id=205494
<rdar://problem/58109493>

Reviewed by Antti Koivisto.

This patch is in preparation for being able to pre-scan the inline content for soft wrap opportunities.

Currently processing the inline content means pushing the inline items to an uncommitted queue until after
we find a soft wrap opportunity and then we ask the LineBreaker whether this uncommitted, "continuous content" can be placed
on the current line.
while (has unprocessed inline item) {
    get next inline item
    if (inline item is at a soft wrap opportunity)
        sumbit uncommitted queue to line breaking
    else
        add to uncommitted queue
}
This patch omits the uncommitted queue by collecting the inline items first. This removes some code complexity and it also
helps to be able to pre-scan the content for soft wrap opportunities.
while (has unprocessed inline item) {
    get next continuous content
    submit content to line breaking
}

* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::endsWithSoftWrapOpportunity):
(WebCore::Layout::LineBreaker::ContinousContent::ContinousContent):
* layout/inlineformatting/InlineLineBreaker.h:
(WebCore::Layout::LineBreaker::Run::Run):
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::ContinousContent::hasIntrusiveFloats const):
(WebCore::Layout::ContinousContent::runs const):
(WebCore::Layout::ContinousContent::floats const):
(WebCore::Layout::ContinousContent::endsWithLineBreak const):
(WebCore::Layout::ContinousContent::setEndsWithLineBreak):
(WebCore::Layout::ContinousContent::append):
(WebCore::Layout::LineLayoutContext::layoutLine):
(WebCore::Layout::LineLayoutContext::close):
(WebCore::Layout::LineLayoutContext::nextContinousContentForLine):
(WebCore::Layout::LineLayoutContext::addFloatItems):
(WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine):
(WebCore::Layout::LineLayoutContext::commitContent):
(WebCore::Layout::LineLayoutContext::commitPendingContent): Deleted.
(WebCore::Layout::LineLayoutContext::placeInlineItem): Deleted.
(WebCore::Layout::LineLayoutContext::processUncommittedContent): Deleted.
(WebCore::Layout::LineLayoutContext::UncommittedContent::append): Deleted.
(WebCore::Layout::LineLayoutContext::UncommittedContent::reset): Deleted.
(WebCore::Layout::LineLayoutContext::UncommittedContent::shrink): Deleted.
* layout/inlineformatting/LineLayoutContext.h:
(WebCore::Layout::LineLayoutContext::formattingContext const):
(WebCore::Layout::LineLayoutContext::root const):
(WebCore::Layout::LineLayoutContext::UncommittedContent::width const): Deleted.
(WebCore::Layout::LineLayoutContext::UncommittedContent::size): Deleted.
(WebCore::Layout::LineLayoutContext::UncommittedContent::isEmpty): Deleted.
(WebCore::Layout::LineLayoutContext::UncommittedContent::runs const): Deleted.

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

7 months agoFetch: handle emtpy Location value
commit-queue@webkit.org [Fri, 20 Dec 2019 13:35:19 +0000 (13:35 +0000)]
Fetch: handle emtpy Location value
https://bugs.webkit.org/show_bug.cgi?id=205462

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

LayoutTests/imported/w3c:

Update improved test results.

* web-platform-tests/fetch/api/redirect/redirect-empty-location.any-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-empty-location.any.worker-expected.txt:

Source/WebCore:

Handle empty Location value on redirect as specified here:
https://fetch.spec.whatwg.org/#concept-http-redirect-fetch step 3

Tests: web-platform-tests/fetch/api/redirect/redirect-empty-location.any.html
       web-platform-tests/fetch/api/redirect/redirect-empty-location.any.worker.html

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):

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

7 months agoDOMPromise::whenPromiseIsSettled is asserting in service worker
youenn@apple.com [Fri, 20 Dec 2019 13:15:24 +0000 (13:15 +0000)]
DOMPromise::whenPromiseIsSettled is asserting in service worker
https://bugs.webkit.org/show_bug.cgi?id=205440

Reviewed by Chris Dumez.

The promise.get(@then) is sometimes throwing an exception probably due to service worker being stopped.
We need to catch the JS exception and exit early if the getter fails.
Covered by existing service worker tests in debug mode.

* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):

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

7 months agoMake ServiceWorker::postMessage use the exec state from the JS binding layer
youenn@apple.com [Fri, 20 Dec 2019 11:52:09 +0000 (11:52 +0000)]
Make ServiceWorker::postMessage use the exec state from the JS binding layer
https://bugs.webkit.org/show_bug.cgi?id=205395

Reviewed by Chris Dumez.

Instead of using ScriptExecutionContext::execState, we can ask the JS binding layer to pass the exec state and use it.
Since ServiceWorker is an ActiveDOMObject, we use its scriptExecutionContext() to compute the ServiceWorker source identifier.
We do the same for ServiceWorkerClient which is a context destruction observer and which only lives in Service Worker scope so calling ScriptExecutionContext::execState is suboptimal.

No change of behavior.

* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorker.idl:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h:
* workers/service/ServiceWorkerClient.idl:

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

7 months ago[WebAuthn] Implement coders for CTAP ClientPIN requests and responses
jiewen_tan@apple.com [Fri, 20 Dec 2019 10:31:03 +0000 (10:31 +0000)]
[WebAuthn] Implement coders for CTAP ClientPIN requests and responses
https://bugs.webkit.org/show_bug.cgi?id=205376
<rdar://problem/58034395>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch implements coders for authenticatorClientPIN requests and responses
following the spec:
https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN

Specifically, it
i) implements authenticatorClientPIN subCommand: getRetries, getKeyAgreement and getPINToken;
ii) adds pinAuth/pinProtocol to authenticatorMakeCredential/authenticatorGetAssertion.

The authenticatorClientPIN subCommands are based on a Chromium patch:
https://chromium-review.googlesource.com/c/chromium/src/+/1457004 Specifically, it adopts the
interfaces from that patch, but rewrites the BoringSSL-based crypto features using WebCore's
WebCrypto implementation. This allows us to focus on high level crypto interfaces, and lets
WebCrypto handle the underlying crypto library. Also, the original Chromium patch lacks tests.
We introduce a large set of API tests to confirm proper function.

This patch also makes the AES CBC, EDCH, and HMAC platform* implementations public, so that
these implementations can be shared by WebAuthentication and test infrastructure.

Covered by API tests.

* Modules/webauthn/WebAuthenticationConstants.h:
* Modules/webauthn/cbor/CBORReader.cpp:
(cbor::CBORReader::readCBORMap):
Let CBORReader recognize negative map keys.
* Modules/webauthn/fido/DeviceRequestConverter.cpp:
(fido::encodeMakeCredenitalRequestAsCBOR):
(fido::encodeGetAssertionRequestAsCBOR):
* Modules/webauthn/fido/DeviceRequestConverter.h:
* Modules/webauthn/fido/Pin.cpp: Added.
(fido::pin::hasAtLeastFourCodepoints):
(fido::pin::makePinAuth):
(fido::pin::encodeRawPublicKey):
(fido::pin::validateAndConvertToUTF8):
(fido::pin::encodePinCommand):
(fido::pin::RetriesResponse::parse):
(fido::pin::KeyAgreementResponse::KeyAgreementResponse):
(fido::pin::KeyAgreementResponse::parse):
(fido::pin::KeyAgreementResponse::parseFromCOSE):
(fido::pin::encodeCOSEPublicKey):
(fido::pin::TokenResponse::TokenResponse):
(fido::pin::TokenResponse::parse):
(fido::pin::TokenResponse::pinAuth const):
(fido::pin::TokenResponse::token const):
(fido::pin::encodeAsCBOR):
(fido::pin::TokenRequest::tryCreate):
(fido::pin::TokenRequest::TokenRequest):
(fido::pin::TokenRequest::sharedKey const):
* Modules/webauthn/fido/Pin.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* crypto/CryptoAlgorithm.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/keys/CryptoKeyAES.cpp:
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyEC.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::algorithm const):

Tools:

Adds API tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/CtapRequestTest.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/FidoTestData.h:

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

7 months agoDon't cache self customs on dictionaries
sbarati@apple.com [Fri, 20 Dec 2019 03:32:37 +0000 (03:32 +0000)]
Don't cache self customs on dictionaries
https://bugs.webkit.org/show_bug.cgi?id=205466
<rdar://problem/58075545>

Reviewed by Mark Lam.

Source/JavaScriptCore:

We had a bug where we would cache a custom value/accessor on a self property
of a cacheable dictionary object. This turns out to be wrong because the
inline cache won't fail (because we won't transition structures) if that
property is replaced with something else. We would do the right thing when
the custom was on the prototype chain, but when it was a self property, we
didn't. The reason customs are different from values/normal accessors is that
we dynamically load values/getters/setters from the object itself. For
customs, we cache the actual pointer value of the C function. This patch makes
it so we don't cache customs on dictionaries.

* bytecode/ObjectPropertyConditionSet.cpp:
(JSC::prepareChainForCaching):
(JSC::preparePrototypeChainForCaching): Deleted.
* bytecode/ObjectPropertyConditionSet.h:
* jit/Repatch.cpp:
(JSC::tryCacheGetBy):
(JSC::tryCachePutByID):
(JSC::tryCacheInByID):
(JSC::tryCacheInstanceOf):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setupGetByIdPrototypeCache):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::setObjectToStringValue):

LayoutTests:

* js/dom/custom-function-should-not-cache-as-dictionary-expected.txt: Added.
* js/dom/custom-function-should-not-cache-as-dictionary.html: Added.

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

7 months agoUpdate TrackBase to store m_mediaElement as a WeakPtr
rniwa@webkit.org [Fri, 20 Dec 2019 02:24:59 +0000 (02:24 +0000)]
Update TrackBase to store m_mediaElement as a WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=205460

Patch by Doug Kelly <dougk@apple.com> on 2019-12-19
Reviewed by Eric Carlson.

Store the HTMLMediaElement in TrackBase and related classes as a WeakPtr to give some proper idea of pointer lifetime, since while the
HTMLMediaElement is optional, if set, it should be a valid HTMLMediaElement.

No new tests since no functionality changed.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::videoTracks):
(WebCore::SourceBuffer::audioTracks):
(WebCore::SourceBuffer::textTracks):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::textTrackModeChanged):
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
(WebCore::HTMLMediaElement::ensureAudioTracks):
(WebCore::HTMLMediaElement::ensureTextTracks):
(WebCore::HTMLMediaElement::ensureVideoTracks):
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::willRemove):
(WebCore::AudioTrack::setMediaElement):
* html/track/AudioTrack.h:
* html/track/AudioTrackList.cpp:
(WebCore::AudioTrackList::AudioTrackList):
* html/track/AudioTrackList.h:
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::willRemove):
(WebCore::InbandTextTrack::setMediaElement):
* html/track/InbandTextTrack.h:
* html/track/TextTrackList.cpp:
(WebCore::TextTrackList::TextTrackList):
* html/track/TextTrackList.h:
* html/track/TrackBase.cpp:
(WebCore::TrackBase::element):
(WebCore::TrackBase::setMediaElement):
* html/track/TrackBase.h:
(WebCore::TrackBase::mediaElement):
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::TrackListBase):
(WebCore::TrackListBase::element const):
* html/track/TrackListBase.h:
(WebCore::TrackListBase::mediaElement const):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::willRemove):
(WebCore::VideoTrack::setMediaElement):
* html/track/VideoTrack.h:
* html/track/VideoTrackList.cpp:
(WebCore::VideoTrackList::VideoTrackList):
* html/track/VideoTrackList.h:

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

7 months agoInvalid assert with tracks not associated to media element
rniwa@webkit.org [Fri, 20 Dec 2019 02:11:18 +0000 (02:11 +0000)]
Invalid assert with tracks not associated to media element
https://bugs.webkit.org/show_bug.cgi?id=205360

Patch by Doug Kelly <dougk@apple.com> on 2019-12-19
Reviewed by Eric Carlson.

Remove asserts around TextTrack when not attached to a media element and instead return a zero index.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::trackIndex):
(WebCore::TextTrack::trackIndexRelativeToRenderedTracks):

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

7 months agoIndexedDB: remove timer for pending operations in IDBTransaction
sihui_liu@apple.com [Fri, 20 Dec 2019 02:04:53 +0000 (02:04 +0000)]
IndexedDB: remove timer for pending operations in IDBTransaction
https://bugs.webkit.org/show_bug.cgi?id=205312

Reviewed by Brady Eidson.

When pendingOperationTimer fired, IDBTransasction would try processing pending operations or commiting
automatically.
pendingOperationTimer was scheduled when some conditions changed and IDBTransaction could start processing
pending operations or start commiting, for example, when new pending operations was created.

For better performance, we may start processing right away after the condition change, without using a Timer.
This patch gives us about 10% speed up on test: PerformanceTests/IndexedDB/basic/objectstore-cursor.html.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::dispatchEvent):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::abortInProgressOperations):
(WebCore::IDBTransaction::removeRequest):
(WebCore::IDBTransaction::scheduleOperation):
(WebCore::IDBTransaction::finishedDispatchEventForRequest):
(WebCore::IDBTransaction::didStart):
(WebCore::IDBTransaction::operationCompletedOnClient):
(WebCore::IDBTransaction::deactivate):
(WebCore::IDBTransaction::connectionClosedFromServer):
(WebCore::IDBTransaction::handlePendingOperations):
(WebCore::IDBTransaction::autoCommit):
(WebCore::IDBTransaction::trySchedulePendingOperationTimer): Deleted.
(WebCore::IDBTransaction::pendingOperationTimerFired): Deleted.
* Modules/indexeddb/IDBTransaction.h:

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

7 months agoNullptr crash in WebCore::RenderTreeBuilder::attach
rniwa@webkit.org [Fri, 20 Dec 2019 02:03:51 +0000 (02:03 +0000)]
Nullptr crash in WebCore::RenderTreeBuilder::attach
https://bugs.webkit.org/show_bug.cgi?id=205476

Patch by Jack Lee <shihchieh_lee@apple.com> on 2019-12-19
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/ruby/crash-insert-duplicate-rt-element.html

* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::attach):

LayoutTests:

* fast/ruby/crash-insert-duplicate-rt-element-expected.txt: Added.
* fast/ruby/crash-insert-duplicate-rt-element.html: Added.

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

7 months agoNullptr crash in WebCore::findPlaceForCounter with display: contents parent
rniwa@webkit.org [Fri, 20 Dec 2019 02:00:56 +0000 (02:00 +0000)]
Nullptr crash in WebCore::findPlaceForCounter with display: contents parent
https://bugs.webkit.org/show_bug.cgi?id=205290

Patch by Jack Lee <shihchieh_lee@apple.com> on 2019-12-19
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/css/counters/findPlaceForCounter-crash.html

* rendering/RenderCounter.cpp:
(WebCore::parentOrPseudoHostElement):

LayoutTests:

* fast/css/counters/findPlaceForCounter-crash-expected.txt: Added.
* fast/css/counters/findPlaceForCounter-crash.html: Added.

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

7 months agoPython 3: Add support to run-webkit-tests
jbedard@apple.com [Fri, 20 Dec 2019 01:06:22 +0000 (01:06 +0000)]
Python 3: Add support to run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=205291

Reviewed by Stephanie Lewis.

* Scripts/test-webkitpy-python3: Add webkitpy.layout_tests.
* Scripts/webkitpy/common/message_pool.py:
(_MessagePool._loop): Move exception inside of loop.
(_Message.__repr__): Use .format strings.
(_Worker.__init__): Ditto.
* Scripts/webkitpy/common/wavediff.py:
(WaveDiff.__init__): Use Python 3 compatible BytesIO and StringIO.
* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
(LayoutTestFinder._read_test_names_from_file): Use .format string.
(LayoutTestFinder.split_into_chunks): Explicitly use integer division.
* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._get_test_inputs): Use range over xrange.
* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner._handle_error): Use .format strings.
* Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
(JSONLayoutResultsGenerator._insert_failure_summaries): Use Python 3 compatible itervalues.
* Scripts/webkitpy/layout_tests/models/test_results.py:
(TestResult.__init__): Sort type list.
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(RunTest.setUp): Multiple processes are buggy in test-webkitpy.
(RunTest.test_basic): replace buflist with getvalue().
(RunTest.test_child_processes_2): Ditto.
(RunTest.test_child_processes_min): Ditto.
(RunTest.test_keyboard_interrupt): Ditto.
(RunTest.test_missing_and_unexpected_results): Compare dictionaries instead of json strings.
(RunTest.test_crash_with_stderr): Ditto.
(RunTest.test_reftest_should_not_use_naming_convention_if_not_listed_in_reftestlist): Ditto.
(EndToEndTest.test_reftest_with_two_notrefs): Ditto.
* Scripts/webkitpy/layout_tests/views/metered_stream.py:
(MeteredStream.write): Flush stream after writing.
(MeteredStream._erase_last_partial_line): Ditto.
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer._print_directory_timings): Can't compare string to integer.
(Printer._print_statistics_for_test_timings): Use integer division.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort._merge_crash_logs): Use items over iteritems.
* Scripts/webkitpy/port/device.py:
(Device.__hash__): Allow hashing of devices.
* Scripts/webkitpy/port/device_port.py:
(DevicePort._install): Use range over xrange.
(DevicePort.setup_test_run): Ditto.
(DevicePort.clean_up_test_run): Ditto.
* Scripts/webkitpy/port/driver.py:
(DriverOutput.__init__): Text should be decoded, audio encoded.
(Driver.__init__):
(Driver.run_test):
(Driver._parse_child_processes_output): Output is byte array.
(Driver._check_for_driver_timeout): Ditto.
(Driver._check_for_address_sanitizer_violation): Error lines are byte arrays.
(Driver._check_for_driver_crash_or_unresponsiveness): Ditto.
(Driver._read_optional_image_block): If a block is base64 encoded, we want the decoded
content, otherwise, we want the encoded content.
(Driver._read_header): Lines are byte arrays, decode them before processing.
(Driver._process_stdout_line): Blocks are byte arrays.
(Driver._strip_eof): Lines should be byte arrays, not strings.
(Driver._read_block): Standardize encoding in blocks.
(ContentBlock.__init__): Content should be a byte array.
(ContentBlock.decode_content): Attempt to decode content.
* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_read_binary_block): Content should be encoded.
(DriverTest.test_read_base64_block): Ditto.
(DriverTest.test_check_for_driver_crash): ServerProcess output should be a byte array.
* Scripts/webkitpy/port/image_diff.py:
(ImageDiffer.diff_image): ImageDiff output is in byte arrays.
(ImageDiffer._read): Ditto.
* Scripts/webkitpy/port/server_process.py:
(ServerProcess.write): Encode data before writing it.
* Scripts/webkitpy/port/server_process_mock.py:
(MockServerProcess.__init__): Convert string mock output to bytes.
(MockServerProcess.read_stdout_line): Stdout lines are byte arrays.
(MockServerProcess.read_stdout): Ditto.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.NonBlockingFileFromSocket.close): Don't double close socket in Python 3.
(SimulatorProcess._start): Stdin should be a binary stream.
* Scripts/webkitpy/port/test.py:
(unit_test_list): Convert audio streams to byte arrays.
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.is_usable): Decode xcrun output.
(SimulatedDevice.install_app): Use xrange over range.

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

7 months ago[GTK] http/tests/media/clearkey/collect-webkit-media-session.html is timing out since...
cturner@igalia.com [Fri, 20 Dec 2019 01:02:45 +0000 (01:02 +0000)]
[GTK] http/tests/media/clearkey/collect-webkit-media-session.html is timing out since added in r235429 "WebKitMediaSession should be GC collectable when its document is being stopped"
https://bugs.webkit.org/show_bug.cgi?id=189345

Unreviewed gardening.

* platform/gtk/TestExpectations: This test is for legacy encrypted media, which we have deprecated, and further uses an EXT-X-KEY URI scheme that will be unsupported by GStreamer (the "clearkey" scheme is not spec'd anywhere I could find).

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

7 months agoWeb Inspector: Enable p3 color picker by default
nvasilyev@apple.com [Fri, 20 Dec 2019 00:50:32 +0000 (00:50 +0000)]
Web Inspector: Enable p3 color picker by default
https://bugs.webkit.org/show_bug.cgi?id=203931
<rdar://problem/56965236>

Reviewed by Devin Rousso.

* UserInterface/Base/Setting.js:
* UserInterface/Views/InlineSwatch.js:

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

7 months agoWeb Inspector: TypeError: InjectedScriptHost.isPromiseRejectedWithNativeGetterTypeErr...
drousso@apple.com [Fri, 20 Dec 2019 00:46:59 +0000 (00:46 +0000)]
Web Inspector: TypeError: InjectedScriptHost.isPromiseRejectedWithNativeGetterTypeError first argument must be a Promise
https://bugs.webkit.org/show_bug.cgi?id=205439

Reviewed by Brian Burg.

Before r244312, we noticed that when Web Inspector would preview native getters that return
a `Promise`, Web Inspector would prevent `rejectionhandled` events from being fired since it
would always add a `.catch(() => {}` to any `Promise` that it was about to instrument in the
Console to avoid errors being added to the Console while expanding/collapsing value previews.
In order to prevent this, logic was added so that the `.catch(() => {})` was only added if
the `Promise` was returned from a native getter, such as from a `PromiseRejectionEvent`.

In r244312, we made it such that this logic _required_ the `Promise` to already be rejected,
which is unnecessarily restrictive and not always the case nowadays. Instead, just check to
see if the result of the `Promise` is a native getter type error.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::isPromiseRejectedWithNativeGetterTypeError):

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

7 months agoWeb Inspector: Console: the clear console button is hidden at smaller widths
drousso@apple.com [Fri, 20 Dec 2019 00:32:43 +0000 (00:32 +0000)]
Web Inspector: Console: the clear console button is hidden at smaller widths
https://bugs.webkit.org/show_bug.cgi?id=205438

Reviewed by Brian Burg.

Ever since r242604, we no longer "need" to show the text filter bar or message type scope
bar since new messages will show a warning banner that there's an active filter. Instead, we
should prefer showing the navigation items that control functionality that cannot be reached
anywhere else (visually), such as clearing the console or evaluating as a user gesture.

* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
Make the text find banner and type scope bar both low priority, the preserve log and
evaluate as user gesture toggles normal priority, and the clear log high priority.

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

7 months agoREGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submi...
cdumez@apple.com [Fri, 20 Dec 2019 00:28:57 +0000 (00:28 +0000)]
REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=205164
<rdar://problem/57879042>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline tests that are now passing.

* web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-expected.txt:

Source/WebCore:

Submitting a form should cancel any pending navigation scheduled by a previous submission of this form:
- https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 22.3)

No new tests, rebaselined existing tests.

Test: fast/forms/form-double-submission.html

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit):
* html/HTMLFormElement.h:
* loader/FormSubmission.h:
(WebCore::FormSubmission::cancel):
(WebCore::FormSubmission::wasCancelled const):

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):
Drop previous non-standard compliant logic to avoid double-form submission.

* loader/NavigationScheduler.cpp:

LayoutTests:

* fast/forms/form-double-submission-expected.txt: Added.
* fast/forms/form-double-submission.html: Added.
* fast/forms/resources/form-double-submission-frame.html: Added.
Add layout test for the regression that was introduced the first time this patch landed.

* http/tests/misc/multiple-submit-expected.txt:
Rebaseline test due to behavior change. I have verified that our new behavior on this test is
aligned with Firefox 71 and Chrome 79.

* platform/mac/TestExpectations:
Unskip tests that are no longer flaky.

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

7 months agoLog telemetry for IOUserClient lookups
bfulgham@apple.com [Fri, 20 Dec 2019 00:03:59 +0000 (00:03 +0000)]
Log telemetry for IOUserClient lookups
https://bugs.webkit.org/show_bug.cgi?id=205463
<rdar://problem/57987372>

Reviewed by Per Arne Vollan.

This patch adds some telemetry for IOKit classes.

No new tests. No change in behavior.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

7 months ago2019-12-19 Jonathan Bedard <jbedard@apple.com>
jbedard@apple.com [Thu, 19 Dec 2019 23:54:30 +0000 (23:54 +0000)]
2019-12-19  Jonathan Bedard  <jbedard@apple.com>

        Resync web-platform-tests/WebIDL tests from upstream
        https://bugs.webkit.org/show_bug.cgi?id=205418 (Follow-up fix)

        Unreviewed follow-up fix.

        * web-platform-tests/interfaces/WebIDL.idl: Added.

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

7 months agoUnreviewed, land missing iOS baselines from r253791.
cdumez@apple.com [Thu, 19 Dec 2019 23:51:52 +0000 (23:51 +0000)]
Unreviewed, land missing iOS baselines from r253791.

* platform/ios-wk2/imported/w3c/web-platform-tests/html/browsers/sandboxing/sandbox-parse-noscript-expected.txt: Added.
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https-expected.txt: Added.

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

7 months agoUse a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackg...
cdumez@apple.com [Thu, 19 Dec 2019 23:49:54 +0000 (23:49 +0000)]
Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask
https://bugs.webkit.org/show_bug.cgi?id=205471

Reviewed by Ryosuke Niwa.

Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask, instead
of a HashSet of raw pointers, for extra safety.

* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]):
(-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):

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

7 months agoUnreviewed, land iOS baselines missing from r253791.
cdumez@apple.com [Thu, 19 Dec 2019 23:47:47 +0000 (23:47 +0000)]
Unreviewed, land iOS baselines missing from r253791.

* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt:

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

7 months agoUnblock iokit-get-property needed for frame buffer initialization
bfulgham@apple.com [Thu, 19 Dec 2019 23:38:28 +0000 (23:38 +0000)]
Unblock iokit-get-property needed for frame buffer initialization
https://bugs.webkit.org/show_bug.cgi?id=205468
<rdar://problem/57897684>

Reviewed by Per Arne Vollan.

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

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

7 months agoResync web-platform-tests/html tests from upstream
cdumez@apple.com [Thu, 19 Dec 2019 22:54:52 +0000 (22:54 +0000)]
Resync web-platform-tests/html tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=205424

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Resync web-platform-tests/html tests from upstream b5b7813e9ce247495b0df.

* resources/resource-files.json:
* web-platform-tests/html/*: Updated.

LayoutTests:

* TestExpectations:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
* tests-options.json:

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

7 months agoMake ShadowRoot.delegateFocus work in iOS
rniwa@webkit.org [Thu, 19 Dec 2019 22:48:54 +0000 (22:48 +0000)]
Make ShadowRoot.delegateFocus work in iOS
https://bugs.webkit.org/show_bug.cgi?id=202875

Reviewed by Wenson Hsieh.

Source/WebCore:

This patch fixes the bug that a shadow tree doesn't recieve focus delegation even if the shadow host
had delegateFocus flag set unless the shadow host itself is focusable beacuse Frame's
nodeRespondingToClickEvents and friends would return false on the shadow host.

Test: fast/shadow-dom/delegates-focus-by-activation.html

* page/ios/FrameIOS.mm:
(WebCore::nodeIsMouseFocusable): Added the logic to handle shadow hosts whose shadow root has
delegates focus flag set.
(WebCore::nodeWillRespondToMouseEvents): Extracted out of approximateNodeAtViewportLocationLegacy.
(WebCore::Frame::approximateNodeAtViewportLocationLegacy):
(WebCore::ancestorRespondingToClickEventsNodeQualifier):

LayoutTests:

Added a regression test.

* fast/shadow-dom/delegates-focus-by-activation-expected.txt: Added.
* fast/shadow-dom/delegates-focus-by-activation.html: Added.

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

7 months agoActivate the SQLite database as an on-by-default feature
katherine_cheney@apple.com [Thu, 19 Dec 2019 22:10:35 +0000 (22:10 +0000)]
Activate the SQLite database as an on-by-default feature
https://bugs.webkit.org/show_bug.cgi?id=204774
<rdar://problem/57592141>

Reviewed by Brent Fulgham.

The ITP SQLite database should be on by default.

* page/RuntimeEnabledFeatures.h:

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