WebKit-https.git
4 months agoWeb Inspector: remove .legacy-mac/.latest-mac CSS classes, standardize on .latest...
mattbaker@apple.com [Fri, 21 Jun 2019 17:53:33 +0000 (17:53 +0000)]
Web Inspector: remove .legacy-mac/.latest-mac CSS classes, standardize on .latest-mac UI
https://bugs.webkit.org/show_bug.cgi?id=199109
<rdar://problem/51991129>

Reviewed by Timothy Hatcher.

Drop legacy macOS version support from Web Inspector UI.

* UserInterface/Base/Main.js:

* UserInterface/Views/DefaultDashboardView.css:
(@media (prefers-color-scheme: dark)):
(body.latest-mac .toolbar .dashboard .item.button): Deleted.

* UserInterface/Views/Toolbar.css:
(.toolbar):
(.toolbar .item.button,):
(.toolbar .search-bar > input[type="search"]):
(.toolbar .search-bar > input[type="search"]:focus):
(@media (-webkit-min-device-pixel-ratio: 2)):
(.toolbar .item.button:active):
(body.window-inactive .toolbar .item.button,):
(@media (prefers-color-scheme: dark)):
(.toolbar .search-bar > input[type="search"]::placeholder):
(body.window-inactive .toolbar .search-bar > input[type="search"]::placeholder):
(body.window-inactive .toolbar .search-bar > input[type="search"]::-webkit-search-results-button):
(.toolbar .dashboard-container):
(body .toolbar): Deleted.
(body.legacy-mac .toolbar .item.button,): Deleted.
(body.legacy-mac .toolbar .search-bar > input[type="search"]): Deleted.
(body.legacy-mac .toolbar .search-bar > input[type="search"]:focus): Deleted.
(body.legacy-mac .toolbar .item.button:active): Deleted.
(body.window-inactive.legacy-mac .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]:focus): Deleted.
(body.latest-mac .toolbar .item.button:active): Deleted.
(body.latest-mac.window-inactive .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]::placeholder): Deleted.
(body.latest-mac.window-inactive .toolbar .search-bar > input[type="search"]::placeholder): Deleted.
(body.latest-mac.window-inactive .toolbar .search-bar > input[type="search"]::-webkit-search-results-button): Deleted.
(body.latest-mac .toolbar .dashboard-container): Deleted.

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

4 months agoUnreviewed, rolling out r246655.
tsavell@apple.com [Fri, 21 Jun 2019 17:45:01 +0000 (17:45 +0000)]
Unreviewed, rolling out r246655.

Introduced a failing test

Reverted changeset:

"Web Inspector: AXI: Audit: image label test is throwing
spurious errors on elements with existing alt attr, but no
value: <img alt>"
https://bugs.webkit.org/show_bug.cgi?id=194754
https://trac.webkit.org/changeset/246655

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

4 months agoMake sure to check for file descriptor value before using FD_CLR
youenn@apple.com [Fri, 21 Jun 2019 17:12:36 +0000 (17:12 +0000)]
Make sure to check for file descriptor value before using FD_CLR
https://bugs.webkit.org/show_bug.cgi?id=199097
<rdar://problem/51479074>

Reviewed by Eric Carlson.

* Source/webrtc/rtc_base/physicalsocketserver.cc:
* WebKit/0001-fix-fd-clr.patch: Added.

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

4 months ago[WHLSL] read modify write expressions do no work as expected
mmaxfield@apple.com [Fri, 21 Jun 2019 16:59:15 +0000 (16:59 +0000)]
[WHLSL] read modify write expressions do no work as expected
https://bugs.webkit.org/show_bug.cgi?id=195864

Reviewed by Saam Barati.

Source/WebCore:

Turns out https://bugs.webkit.org/show_bug.cgi?id=199037 already fixed everything.
This patch just adds a test.

Test: webgpu/whlsl-read-modify-write.html

* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:

LayoutTests:

* webgpu/whlsl-read-modify-write.html: Added.

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

4 months ago[LFC][IFC] Adjust baseline top when the baseline moves.
zalan@apple.com [Fri, 21 Jun 2019 15:49:21 +0000 (15:49 +0000)]
[LFC][IFC] Adjust baseline top when the baseline moves.
https://bugs.webkit.org/show_bug.cgi?id=199091
<rdar://problem/51966257>

Reviewed by Antti Koivisto.

Currently only "text-align: bottom" adjusts the baseline top. This patch fixes the "text-align: baseline" case when
the growing ascent pushes the baseline top closer to the line top.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::adjustBaselineAndLineHeight):

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

4 months ago[LFC][IFC] Rename Line::m_contentLogicalHeight to m_lineLogicalHeight
zalan@apple.com [Fri, 21 Jun 2019 15:43:17 +0000 (15:43 +0000)]
[LFC][IFC] Rename Line::m_contentLogicalHeight to m_lineLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=199100
<rdar://problem/51973614>

Reviewed by Antti Koivisto.

m_logicalLineHeight name seems more appropriate at this point (though the line heigh is driven by the content height).

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::logicalHeight const):

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

4 months ago[LFC][IFC] LineBox::Baseline should have a height getter.
zalan@apple.com [Fri, 21 Jun 2019 15:31:02 +0000 (15:31 +0000)]
[LFC][IFC] LineBox::Baseline should have a height getter.
https://bugs.webkit.org/show_bug.cgi?id=199092
<rdar://problem/51966958>

Reviewed by Antti Koivisto.

The baseline height does not need to be a getter on the Line (no one calls it).

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::contentLogicalWidth const):
(WebCore::Layout::Line::baselineAlignedContentHeight const): Deleted.
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::Baseline::height const):

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

4 months ago[WPE][GTK] Bump minimum versions of GLib, GTK, libsoup, ATK, GStreamer, and Cairo
mcatanzaro@igalia.com [Fri, 21 Jun 2019 14:20:00 +0000 (14:20 +0000)]
[WPE][GTK] Bump minimum versions of GLib, GTK, libsoup, ATK, GStreamer, and Cairo
https://bugs.webkit.org/show_bug.cgi?id=199094

Reviewed by Carlos Garcia Campos.

.:

We can remove a lot of preprocessor guards in our code if we bump the minimum required
versions of certain dependencies:

GStreamer 1.8 -> 1.10
GTK 3.6 -> 3.22
ATK 2.16
libsoup 2.42 -> 2.54
glib 2.40 -> 2.44
cairo 1.14

I'm being extremely conservative with all these dependency bumps. All of these versions are
already available in Debian Stretch, which we will soon no longer support building on anyway
due to the impending GCC 7 requirement. Dependencies are also bumped no further than we
actually have guards for. For example, ATK 2.22 is available in Stretch, but the highest
ATK_CHECK_VERSION guards we use below 2.22 are for 2.16, so I set the min version to 2.16.

We still have a few preprocessor guards remaining for everything here except glib and cairo,
but this removes the vast majority of them. Deleting code is fun!

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

Source/WebCore:

* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/atk/WebKitAccessible.cpp:
(atkRole):
(setAtkStateSetFromCoreObject):
(interfaceMaskFromObject):
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
* accessibility/atk/WebKitAccessibleInterfaceTableCell.h:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(webkitAccessibleTextGetStringAtOffset):
(webkitAccessibleTextInterfaceInit):
* accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
(webkitAccessibleValueInterfaceInit):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::derefGPtr<GstStreamCollection>):
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitElements):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
(WebCore::InbandTextTrackPrivateGStreamer::create):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
(WebCore::TrackPrivateBaseGStreamer::disconnect):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
(WebCore::TrackPrivateBaseGStreamer::stream):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::eventTypeForGdkKeyEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenHasTouchDevice):
(WebCore::screenIsTouchPrimaryInputDevice):
(): Deleted.
(WebCore::isTouchDevice): Deleted.
(WebCore::deviceAddedCallback): Deleted.
(WebCore::deviceRemovedCallback): Deleted.
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/gtk/RenderThemeGadget.cpp:
* platform/gtk/RenderThemeGadget.h:
* platform/gtk/RenderThemeWidget.cpp:
* platform/gtk/RenderThemeWidget.h:
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
(WebCore::ScrollbarThemeGtk::themeChanged):
(WebCore::ScrollbarThemeGtk::updateThemeProperties):
(WebCore::ScrollbarThemeGtk::trackRect):
(WebCore::ScrollbarThemeGtk::forwardButtonRect):
(WebCore::ScrollbarThemeGtk::paint):
(WebCore::ScrollbarThemeGtk::scrollbarThickness):
(WebCore::createStyleContext): Deleted.
(WebCore::createChildStyleContext): Deleted.
(WebCore::paintStepper): Deleted.
(WebCore::adjustRectAccordingToMargin): Deleted.
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/network/soup/ResourceRequest.h:
(WebCore::toSoupMessagePriority):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):
* rendering/RenderThemeGtk.cpp:
(WebCore::themePartStateFlags):
(WebCore::paintToggle):
(WebCore::RenderThemeGtk::paintButton):
(WebCore::menuListColor):
(WebCore::RenderThemeGtk::paintMenuList):
(WebCore::RenderThemeGtk::paintTextField):
(WebCore::adjustSearchFieldIconStyle):
(WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
(WebCore::RenderThemeGtk::paintSliderThumb):
(WebCore::RenderThemeGtk::paintProgressBar):
(WebCore::RenderThemeGtk::paintInnerSpinButton):
(WebCore::styleColor):
(WebCore::RenderThemeGtk::systemColor const):
(WebCore::RenderThemeGtk::paintMediaButton):
(WebCore::createStyleContext): Deleted.
(WebCore::loadThemedIcon): Deleted.
(WebCore::gtkTextDirection): Deleted.
(WebCore::gtkIconStateFlags): Deleted.
(WebCore::adjustRectForFocus): Deleted.
(WebCore::renderButton): Deleted.
(WebCore::getIconSizeForPixelSize): Deleted.
(WebCore::paintIcon): Deleted.
(WebCore::paintEntryIcon): Deleted.
(WebCore::centerRectVerticallyInParentInputElement): Deleted.
(WebCore::spinButtonArrowSize): Deleted.
(WebCore::paintSpinArrowButton): Deleted.

Source/WebKit:

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest):
(WebKit::NetworkDataTaskSoup::writeDownloadCallback):
(WebKit::NetworkDataTaskSoup::writeDownload):
(WebKit::NetworkDataTaskSoup::startingCallback):
(WebKit::NetworkDataTaskSoup::requestStartedCallback): Deleted.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::buttonForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithTouchEvent):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(ClickCounter::currentClickCountForGdkButtonEvent):
(webkitWebViewBaseRealize):
(webkitWebViewBaseHandleMouseEvent):
(webkitWebViewBaseGetTouchPointsForEvent):
(webkitWebViewBaseTouchEvent):
(webkitWebViewBaseGestureController):
(webkitWebViewBaseEvent):
(deviceScaleFactorChanged):
(webkitWebViewBaseCreateWebPage):
(webkitWebViewBaseTakeViewSnapshot):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/WebKitWebViewDialog.cpp:
(webkitWebViewDialogDraw):
(webkitWebViewDialogConstructed):
(webkit_web_view_dialog_class_init):
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(fileChooserDialogResponseCallback):
(webkitWebViewRunFileChooser):
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::doMouseEvent):
(WebKit::doMotionEvent):
(WebKit::doKeyStrokeEvent):
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
(WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext):
(WebKit::AcceleratedBackingStoreWayland::makeContextCurrent):
(WebKit::AcceleratedBackingStoreWayland::paint):
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::startDrag):
(WebKit::DragAndDropHandler::fillDragData):
(WebKit::DragAndDropHandler::finishDrag):
* UIProcess/gtk/DragAndDropHandler.h:
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::handleEvent):
* UIProcess/gtk/GestureController.h:
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::filterKeyEvent):
(WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
(WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::isEventStop):
(WebKit::createScrollEvent):
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
* UIProcess/gtk/WebKitInspectorWindow.cpp:
(webkit_inspector_window_init):
(webkitInspectorWindowSetSubtitle):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::getCenterForZoomGesture):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::showPopupMenu):
(WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::getCenterForZoomGesture):

Tools:

* MiniBrowser/gtk/BrowserTab.c:
(runColorChooserCallback):
(browserTabConstructed):
* TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp:
(testWebViewSyncRequestOnMaxConns):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:
(testWebSocketTLSErrors):
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
(WebKitTestServer::~WebKitTestServer):
(WebKitTestServer::getWebSocketURIForPath const):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::rowHeaders const):
(WTR::AccessibilityUIElement::columnHeaders const):
(WTR::AccessibilityUIElement::isAttributeSettable):
(WTR::AccessibilityUIElement::x):
(WTR::AccessibilityUIElement::y):
(WTR::AccessibilityUIElement::width):
(WTR::AccessibilityUIElement::height):
(WTR::AccessibilityUIElement::clickPointX):
(WTR::AccessibilityUIElement::clickPointY):
(WTR::AccessibilityUIElement::intValue const):
(WTR::AccessibilityUIElement::minValue):
(WTR::AccessibilityUIElement::maxValue):
(WTR::stringAtOffset):

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

4 months agoUnreviewed GTK gardening. Rebaseline css-dark-mode/default-colors.html.
carlosgc@webkit.org [Fri, 21 Jun 2019 10:32:17 +0000 (10:32 +0000)]
Unreviewed GTK gardening. Rebaseline css-dark-mode/default-colors.html.

* platform/gtk/TestExpectations:
* platform/gtk/css-dark-mode/default-colors-expected.txt:

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

4 months agoUnreviewed GTK gardening. Skip touch event tests.
carlosgc@webkit.org [Fri, 21 Jun 2019 10:22:42 +0000 (10:22 +0000)]
Unreviewed GTK gardening. Skip touch event tests.

Since r245788 touch events support is enabled at runtime depending on whether there's an actual touch device
attached or not. We need to skip the tests in the bots since they don't have a touch screen.

* platform/gtk/TestExpectations:
* platform/gtk/fast/events/event-attribute-expected.txt: Removed.
* platform/gtk/fast/events/touch/document-create-touch-list-expected.txt: Removed.

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

4 months ago[Pointer Events] Respect pointer capture when dispatching mouse boundary events and...
graouts@webkit.org [Fri, 21 Jun 2019 08:47:26 +0000 (08:47 +0000)]
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Record progressions in two WPT tests and mark updated failures in two other WPT tests.

* web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt:
* web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt:
* web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

Source/WebCore:

Up until now, we would not account for pointer capture (see https://w3c.github.io/pointerevents/#pointer-capture) when dispatching
mouse boundary events (mouseover, mouseout, mouseenter, mouseleave) and their counterpart pointer events. We would also not account
for it when updating :hover styles.

Now, when pointer capture changes for an element, we call setCapturingMouseEventsElement() on the EventHandler such that the element
that would naturally hit-test is overridden by the pointer capture element when identifying which target to use for the dispatch of
boundary mouse events. Additionally, when calling EventHandler::prepareMouseEvent(), we also use the pointer capture element to
eventually pass down to Document::updateHoverActiveState() such that :hover styles are applied to the correct element.

This also means that we need to re-run EventHandler::prepareMouseEvent() during mouse state changes to ensure that the :hover styles
are applied correctly should the pointer capture element change during dispatch of boundary mouse events.

* dom/Document.cpp:
(WebCore::Document::prepareMouseEvent): If there is one, use the pointer capture element instead of the hit-test target.
(WebCore::Document::updateHoverActiveState): Relax the mustBeInActiveChain condition in case the pointer capture element changed when
updating the :hover/:active chains.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent): Re-process the mouse event if the pointer capture element changed during event dispatch.
(WebCore::EventHandler::handleMouseMoveEvent): Re-process the mouse event if the pointer capture element changed during event dispatch.
(WebCore::EventHandler::handleMouseReleaseEvent): As we know the pointer capture element will be reset as part of the mouse being
released, we reset the pointer capture element and EventHandler's capture element prior to invalidating hover styles and boundary events.
(WebCore::EventHandler::setCapturingMouseEventsElement): Dispatch boundary events when a new element is set.
(WebCore::EventHandler::dispatchMouseEvent): New dispatchMouseEvent() variant that re-processes the provided MouseEventWithHitTestResults
in case the pointer capture element changes during event dispatch, as called by handleMousePressEvent() and handleMouseMoveEvent().
* page/EventHandler.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::pointerCaptureElement): We now need to query whay the pointer capture element might be from EventHandler,
so expose a new method to access it.
(WebCore::PointerCaptureController::releasePointerCapture): Since we may not call processPendingPointerCapture() until the dispatch of the
next event, we must reset EventHandler's capturing mouse element right now so that the next event processed does not use it as an overriding target.
(WebCore::PointerCaptureController::hasPointerCapture): We would mistakenly return true if the provided element was null, which could be the
case of EventHandler's capturing element. Rather than changing call sites to check that the provided value exists, we change the method to
return false when the provided element is null. Note that this does not affect the API since it's exposed on Element itself.
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Call dispatchEvent() instead of calling pointerEventWillBeDispatched() and
pointerEventWasDispatched().
(WebCore::PointerCaptureController::dispatchEvent): Remove all code specific to pointer capture since now the events will be dispatched on the
pointer capture element by EventHandler.
(WebCore::PointerCaptureController::processPendingPointerCapture): Make sure this method is not re-entrant since it dispatches events.
* page/PointerCaptureController.h:
* rendering/HitTestRequest.h:
(WebCore::HitTestRequest::pointerCaptureElementChanged const): Add a new HitTestRequestType bit such that we can indicate to Document::updateHoverActiveState()
that it must be update the :hover/:active chains when the pointer capture element has just changed.

LayoutTests:

Record progressions in two WPT tests and mark updated failures in two other WPT tests.

* platform/mac-highsierra-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
* platform/mac-highsierra/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt: Removed.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

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

4 months agofast/events/ios/click-event-and-display-contents.html times out on iPad
graouts@webkit.org [Fri, 21 Jun 2019 07:05:10 +0000 (07:05 +0000)]
fast/events/ios/click-event-and-display-contents.html times out on iPad
https://bugs.webkit.org/show_bug.cgi?id=199068
<rdar://problem/51899547>

Reviewed by Dean Jackson.

Querying the bounds of a "display: contents" element will always return 0 width and height. So let's position the element at 0,0
so that we can send a tap at that location and reliably tap on that element.

* fast/events/ios/click-event-and-display-contents.html:

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

4 months agoWeb Inspector: rename shadowRootPushed parameter to match protocol
mattbaker@apple.com [Fri, 21 Jun 2019 05:44:02 +0000 (05:44 +0000)]
Web Inspector: rename shadowRootPushed parameter to match protocol
https://bugs.webkit.org/show_bug.cgi?id=199098

Reviewed by Devin Rousso.

* UserInterface/Protocol/DOMObserver.js:
(WI.DOMObserver.prototype.shadowRootPushed):

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

4 months ago[GTK][WPE] Implement a basic DNS cache
commit-queue@webkit.org [Fri, 21 Jun 2019 05:37:04 +0000 (05:37 +0000)]
[GTK][WPE] Implement a basic DNS cache
https://bugs.webkit.org/show_bug.cgi?id=196094

Patch by Patrick Griffis  <pgriffis@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com> on 2019-06-20
Reviewed by Michael Catanzaro.

This adds a simple cache to all DNS operations in the network process.

* NetworkProcess/glib/DNSCache.cpp: Added.
(WebKit::DNSCache::DNSCache):
(WebKit::DNSCache::mapForType):
(WebKit::DNSCache::lookup):
(WebKit::DNSCache::update):
(WebKit::DNSCache::removeExpiredResponsesInMap):
(WebKit::DNSCache::pruneResponsesInMap):
(WebKit::DNSCache::removeExpiredResponsesFired):
(WebKit::DNSCache::clear):
* NetworkProcess/glib/DNSCache.h: Added.
* NetworkProcess/glib/WebKitCachedResolver.cpp: Added.
(addressListVectorToGList):
(addressListGListToVector):
(webkitCachedResolverLookupByName):
(webkitCachedResolverLookupByNameAsync):
(webkitCachedResolverLookupByNameFinish):
(dnsCacheType):
(webkitCachedResolverLookupByNameWithFlags):
(webkitCachedResolverLookupByNameWithFlagsAsync):
(webkitCachedResolverLookupByNameWithFlagsFinish):
(webkitCachedResolverLookupByAddress):
(webkitCachedResolverLookupByAddressAsync):
(webkitCachedResolverLookupByAddressFinish):
(webkitCachedResolverLookupRecords):
(webkitCachedResolverLookupRecordsAsync):
(webkitCachedResolverLookupRecordsFinish):
(webkitCachedResolverReload):
(webkit_cached_resolver_class_init):
(webkitCachedResolverNew):
* NetworkProcess/glib/WebKitCachedResolver.h: Added.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:

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

4 months agoTry to use C++14 std::enable_if_t in CheckedArithmetic.h again
Hironori.Fujii@sony.com [Fri, 21 Jun 2019 05:19:27 +0000 (05:19 +0000)]
Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
https://bugs.webkit.org/show_bug.cgi?id=199099

Reviewed by Ross Kirsling.

r242235 changed CheckedArithmetic to not use C++14. Let's try
C++14 again.

* wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.

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

4 months ago[GTK] Stop pretending WebCore::Widget can have a platform widget
carlosgc@webkit.org [Fri, 21 Jun 2019 05:15:06 +0000 (05:15 +0000)]
[GTK] Stop pretending WebCore::Widget can have a platform widget
https://bugs.webkit.org/show_bug.cgi?id=199066

Reviewed by Michael Catanzaro.

Source/WebCore:

That was only possible in legacy WebKit that we no longer support. The code can be simplified a bit.

* platform/Widget.cpp:
(WebCore::Widget::init):
* platform/Widget.h:
(WebCore::Widget::setPlatformWidget):
(WebCore::Widget::releasePlatformWidget): Deleted.
(WebCore::Widget::retainPlatformWidget): Deleted.
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::systemVisual):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::getToplevel): Deleted.
(WebCore::getVisual): Deleted.
(WebCore::getScreen): Deleted.
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::~Widget):
(WebCore::Widget::show):
(WebCore::Widget::hide):
(WebCore::Widget::setIsSelected):
(WebCore::Widget::setFrameRect):
(WebCore::Widget::releasePlatformWidget): Deleted.
(WebCore::Widget::retainPlatformWidget): Deleted.
* platform/ios/WidgetIOS.mm:
(WebCore::Widget::~Widget):

Source/WebKit:

Rename PlatformWidget as PlatformViewWidget to avoid conflict with PlatformWidget defined in WebCore.

* UIProcess/WebPageProxy.h:
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::viewWidget):

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

4 months agoMake it possible to include clipping in GraphicsLayer tree dumps
simon.fraser@apple.com [Fri, 21 Jun 2019 02:30:35 +0000 (02:30 +0000)]
Make it possible to include clipping in GraphicsLayer tree dumps
https://bugs.webkit.org/show_bug.cgi?id=199096

Reviewed by Zalan Bujtas.

Source/WebCore:

Add LAYER_TREE_INCLUDES_CLIPPING and plumb it down to GraphicsLayers, turning
it on for a couple of tests.

* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsLayerClient.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* compositing/clipping/border-radius-async-overflow-clipping-layer-expected.txt:
* compositing/clipping/border-radius-async-overflow-clipping-layer.html:
* compositing/clipping/border-radius-overflow-hidden-stacking-context-expected.txt:
* compositing/clipping/border-radius-overflow-hidden-stacking-context.html:
* platform/mac-wk1/compositing/clipping/border-radius-async-overflow-clipping-layer-expected.txt:

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

4 months agoWeb Inspector: Error "null is not an object (evaluating 'syntaxTree.containersOfPosit...
drousso@apple.com [Fri, 21 Jun 2019 01:21:08 +0000 (01:21 +0000)]
Web Inspector: Error "null is not an object (evaluating 'syntaxTree.containersOfPosition')" when setting a breakpoint
https://bugs.webkit.org/show_bug.cgi?id=199082

Reviewed by Matt Baker.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
The script syntax tree may be fetched even if the resource hasn't finished parsing (or had
a syntax error), so it's possible for it to be `null`.

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

4 months agoWeb Inspector: Dark Mode: inactive tab bar item should get darker on hover
drousso@apple.com [Fri, 21 Jun 2019 00:54:10 +0000 (00:54 +0000)]
Web Inspector: Dark Mode: inactive tab bar item should get darker on hover
https://bugs.webkit.org/show_bug.cgi?id=199022

Reviewed by Darin Adler.

* UserInterface/Views/TabBar.css:
(.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover):
(@media not (prefers-color-scheme: dark) .tab-bar:not(.animating) > .item:not(.selected, .disabled):hover > .icon):
(@media (prefers-color-scheme: dark) .tab-bar):
(@media (prefers-color-scheme: dark) .tab-bar > .item):
(@media (prefers-color-scheme: dark) .tab-bar > .item:not(.disabled).selected):
(@media (prefers-color-scheme: dark) .tab-bar:not(.animating) > .item:not(.selected):hover):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar > .item):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar > .item.selected):

* UserInterface/Views/Toolbar.css:
(@media (prefers-color-scheme: dark) body .toolbar):

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

4 months agoRemove change that was causing hangs
megan_gardner@apple.com [Fri, 21 Jun 2019 00:50:07 +0000 (00:50 +0000)]
Remove change that was causing hangs
https://bugs.webkit.org/show_bug.cgi?id=199055
<rdar://problem/51820516>

Reviewed by Darin Adler.

This fix can sometimes cause deadlocks in the UIProcess.
We have a different fix that will go into UIKit <rdar://problem/51927701>.

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

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

4 months ago[iOS] Evernote crashes when creating a note
dbates@webkit.org [Fri, 21 Jun 2019 00:49:14 +0000 (00:49 +0000)]
[iOS] Evernote crashes when creating a note
https://bugs.webkit.org/show_bug.cgi?id=199083
<rdar://problem/51759247>

Reviewed by Brent Fulgham.

Source/WebCore:

Add runtime check whether WebKit is being used in Evernote. Evernote's bundle ID
references iPhone, but they use the same ID for their iPad app as well.

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isEvernote): Added.

Source/WebKit:

Add a hack just for Evernote linked before iOS 13 that dynamically adds a placeholder -[WKContentView keyCommands]
method (it just calls super). Evernote swizzles the IPI -[WKContentView keyCommands], but this
method may not always be present in the WebKit binary following r240514. So, Evernote may end
up swizzling -[UIResponder keyCommands], but their implementation doesn't account for this
scenario and they end up crashing because they call an unrecognized selector.

* UIProcess/Cocoa/VersionChecks.h: Add version check.
* UIProcess/ios/WKContentView.mm:
(keyCommandsPlaceholderHackForEvernote): Added.
(-[WKContentView _commonInitializationWithProcessPool:configuration:]): Install the hack.

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

4 months agoFix a bug that 'test_metrics' and 'tests' tables are not joined correctly in CommitLo...
dewei_zhu@apple.com [Thu, 20 Jun 2019 23:53:22 +0000 (23:53 +0000)]
Fix a bug that 'test_metrics' and 'tests' tables are not joined correctly in CommitLogFetcher.fetch_latest_for_platform
https://bugs.webkit.org/show_bug.cgi?id=199062

Reviewed by Ryosuke Niwa.

'test_metrics' and 'tests' should be joined based on 'metric_test' and 'test_id'.

* public/include/commit-log-fetcher.php: Fix the typo in the query.
* server-tests/api-commits-tests.js: Added a unit test for this change.

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

4 months agotest-webkitpy is broken on macOS Catalina
dean_johnson@apple.com [Thu, 20 Jun 2019 23:13:00 +0000 (23:13 +0000)]
test-webkitpy is broken on macOS Catalina
https://bugs.webkit.org/show_bug.cgi?id=199078

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/test/main.py: Check if lldb tests are supported before adding them
to the runner.
(main):
(_supports_building_and_running_lldb_tests): Check if you are running macOS Catalina.

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

4 months agoChange status to "committer" in contributors.json
dean_johnson@apple.com [Thu, 20 Jun 2019 22:58:30 +0000 (22:58 +0000)]
Change status to "committer" in contributors.json

Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

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

4 months agoWebURLSchemeHandlerProxy::loadSynchronously crash with sync request.
beidson@apple.com [Thu, 20 Jun 2019 22:52:06 +0000 (22:52 +0000)]
WebURLSchemeHandlerProxy::loadSynchronously crash with sync request.
<rdar://problem/51862206> and https://bugs.webkit.org/show_bug.cgi?id=199063

Reviewed by Geoffrey Garen.

Don't use a DataReference for the sync reply type.

* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebURLSchemeHandler.h:

* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::didComplete):
* UIProcess/WebURLSchemeTask.h:

* WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
(WebKit::WebURLSchemeHandlerProxy::loadSynchronously):

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

4 months agoWeb Inspector: Debugger: setting a breakpoint on a non-JavaScript line should immedia...
drousso@apple.com [Thu, 20 Jun 2019 22:52:03 +0000 (22:52 +0000)]
Web Inspector: Debugger: setting a breakpoint on a non-JavaScript line should immediately show as unresolved
https://bugs.webkit.org/show_bug.cgi?id=199033

Reviewed by Matt Baker.

Remove the `shouldSpeculativelyResolve` parameter, as it was resolving breakpoints even in
the case that there were no resolved locations for the given breakpoint.

In the case that there are resolved locations, the breakpoint would've already been resolved
by the time that `shouldSpeculativelyResolve` would've taken effect, so it's unnecessary.

This parameter was only used when setting a breakpoint from a `SourceCodeTextEditor` gutter.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.addBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):

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

4 months agoWeb Inspector: Edit -> Tag doesn't do anything for html, head, and body elements
drousso@apple.com [Thu, 20 Jun 2019 22:45:17 +0000 (22:45 +0000)]
Web Inspector: Edit -> Tag doesn't do anything for html, head, and body elements
https://bugs.webkit.org/show_bug.cgi?id=199052
<rdar://problem/51923906>

Reviewed by Matt Baker.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
 - Don't show an "Edit > Tag" for <html>, <head>, and <body> nodes
 - Disable any "Edit" submenu item if it's target is already being edited
 - Prevent "Add" submenu items from being shown for text nodes

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

4 months agoAdd unit test for UIContextMenuConfiguration API
achristensen@apple.com [Thu, 20 Jun 2019 22:28:47 +0000 (22:28 +0000)]
Add unit test for UIContextMenuConfiguration API
https://bugs.webkit.org/show_bug.cgi?id=199043

Reviewed by Wenson Hsieh.

Source/WebKit:

* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy const):
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::clickInteractionDriverForTesting const):
(API::PageConfiguration::setClickInteractionDriverForTesting):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _setClickInteractionDriverForTesting:]):
(-[WKWebViewConfiguration _clickInteractionDriverForTesting]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _registerPreview]):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm: Added.
(-[TestContextMenuUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]):
(-[TestContextMenuUIDelegate webView:contextMenuWillPresentForElement:]):
(-[TestContextMenuUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]):
(-[TestContextMenuUIDelegate webView:contextMenuDidEndForElement:]):
(TEST):
* TestWebKitAPI/cocoa/TestContextMenuDriver.h: Added.
* TestWebKitAPI/cocoa/TestContextMenuDriver.mm: Added.
(-[TestContextMenuDriver delegate]):
(-[TestContextMenuDriver setDelegate:]):
(-[TestContextMenuDriver view]):
(-[TestContextMenuDriver setView:]):
(-[TestContextMenuDriver allowableMovement]):
(-[TestContextMenuDriver setAllowableMovement:]):
(-[TestContextMenuDriver primaryGestureRecognizer]):
(-[TestContextMenuDriver setPrimaryGestureRecognizer:]):
(-[TestContextMenuDriver touchDuration]):
(-[TestContextMenuDriver setTouchDuration:]):
(-[TestContextMenuDriver locationInCoordinateSpace:]):
(-[TestContextMenuDriver cancelInteraction]):
(-[TestContextMenuDriver begin:]):
(-[TestContextMenuDriver clickDown]):
(-[TestContextMenuDriver clickUp]):
(-[TestContextMenuDriver end]):
* TestWebKitAPI/ios/UIKitSPI.h:

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

4 months ago[ews-app] Status bubble should not turn orange when any build step is skipped
aakash_jain@apple.com [Thu, 20 Jun 2019 22:25:12 +0000 (22:25 +0000)]
[ews-app] Status bubble should not turn orange when any build step is skipped
https://bugs.webkit.org/show_bug.cgi?id=199079

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:

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

4 months agoWeb Inspector: AXI: Audit: image label test is throwing spurious errors on elements...
commit-queue@webkit.org [Thu, 20 Jun 2019 22:06:51 +0000 (22:06 +0000)]
Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
https://bugs.webkit.org/show_bug.cgi?id=194754

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

Source/WebCore:

Test: accessibility/img-alt-attribute-unassigned-value.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::computedRoleString const):

LayoutTests:

* accessibility/img-alt-attribute-unassigned-value-expected.txt: Added.
* accessibility/img-alt-attribute-unassigned-value.html: Added.
* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:

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

4 months agoFix an internal engineering build after r246605
achristensen@apple.com [Thu, 20 Jun 2019 22:00:02 +0000 (22:00 +0000)]
Fix an internal engineering build after r246605
       ​https://bugs.webkit.org/show_bug.cgi?id=197800

* TestWebKitAPI/TCPServer.cpp:

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

4 months agoREGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCha...
rniwa@webkit.org [Thu, 20 Jun 2019 21:42:50 +0000 (21:42 +0000)]
REGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCharacterIterator
https://bugs.webkit.org/show_bug.cgi?id=199061

Reviewed by Wenson Hsieh.

Avoid calling CharacterIterator::range when it's at the end. Otherwise, we'd crash with null pointer dereferencing.

Unfortunately no new tests since we don't have any reproducible test case.

* editing/Editing.cpp:
(WebCore::visiblePositionForIndexUsingCharacterIterator):

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

4 months agoResolve frequent crashes in topPrivatelyControlledDomain
bfulgham@apple.com [Thu, 20 Jun 2019 20:39:29 +0000 (20:39 +0000)]
Resolve frequent crashes in topPrivatelyControlledDomain
https://bugs.webkit.org/show_bug.cgi?id=199072
<rdar://problem/51428162>

Reviewed by Youenn Fablet.

Crash data indicates that we are frequently crashing when multiple threads call
WebCore::topPrivatelyControlledDomain.

Code review showed the potential for a thread contention issue, since WebKit builds
with '--fno-threadsafe-statics'.

This patch corrects the thread safety issue in WebCore::topPrivatelyControlledDomain.

* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain): Only instantiate the static cache after the
current thread has achieved its lock.

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

4 months ago[ews-build] Triggered builds should use same revision as parent build
aakash_jain@apple.com [Thu, 20 Jun 2019 20:35:57 +0000 (20:35 +0000)]
[ews-build] Triggered builds should use same revision as parent build
https://bugs.webkit.org/show_bug.cgi?id=198289

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(CheckOutSpecificRevision): Build step to checkout specific revision.
(CheckOutSpecificRevision.doStepIf): Run this step only if ews_revision property is set.
(CheckOutSpecificRevision.hideStepIf): Hide this step when it is skipped.
(CheckOutSpecificRevision.start): Run appropriate git command.
(Trigger.propertiesToPassToTriggers): Pass ews_revision property to triggered builds, so that triggered
builds use same revision as parent build.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/factories.py:
(Factory.__init__): Added CheckOutSpecificRevision step.

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

4 months ago[ews-build] Add unit tests for AnalyzeCompileWebKitResults
aakash_jain@apple.com [Thu, 20 Jun 2019 20:24:30 +0000 (20:24 +0000)]
[ews-build] Add unit tests for AnalyzeCompileWebKitResults
https://bugs.webkit.org/show_bug.cgi?id=199073

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests for AnalyzeCompileWebKitResults.

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

4 months ago[WHLSL] Property resolver needs to recurse on newValueExpression for RMW operations
sbarati@apple.com [Thu, 20 Jun 2019 20:10:06 +0000 (20:10 +0000)]
[WHLSL] Property resolver needs to recurse on newValueExpression for RMW operations
https://bugs.webkit.org/show_bug.cgi?id=199037

Reviewed by Myles C. Maxfield.

Source/WebCore:

When we had an expression like `<e1> += <e2>`, we weren't running the property
resolver on <e2>. If <e2> was something like `mat[1][2]`, we wouldn't end up
simplifying that into the needed getter calls. This patch fixes this by having
the property resolver recurse on <e2>.

This patch also fixes a bug in the property resolver where we weren't marking some
dereference expressions as LValues. This was causing bugs in the metal code generator.

This patch also adds a way to dump the AST between passes that are
guaranteed to not fail.

Test: webgpu/whlsl-read-modify-write-high-zombies.html

* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::PropertyResolver::visit):
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:

LayoutTests:

* webgpu/whlsl-read-modify-write-high-zombies-expected.txt: Added.
* webgpu/whlsl-read-modify-write-high-zombies.html: Added.

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

4 months agoStorage Access API: Cap the number of times an iframe document can request access
wilander@apple.com [Thu, 20 Jun 2019 20:03:58 +0000 (20:03 +0000)]
Storage Access API: Cap the number of times an iframe document can request access
https://bugs.webkit.org/show_bug.cgi?id=199074
<rdar://problem/51857195>

Reviewed by Brent Fulgham.

Tested manually.

This change just adds a counter to the number of times the user explicitly
denies storage access and returns early if the counter has reached the limit
of 2.

We hoped that iframes that request storage access would count the number
of times the user has been asked and not repeat the request over and over.
However, we're seeing pretty aggressive use of the API and users are
complaining. Therefore, we need a cap on how many times an iframed
document can ask if it is explicitly denied access by the user.

This is a first measure. If we see continued aggressive use of the API,
we'll have to consider more drastic measures.

* dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::requestStorageAccess):
* dom/DocumentStorageAccess.h:

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

4 months ago[WebGPU] High Sierra/Intel HD Graphics 4000: whlsl-harness-test.html crashes during...
justin_fan@apple.com [Thu, 20 Jun 2019 19:57:03 +0000 (19:57 +0000)]
[WebGPU] High Sierra/Intel HD Graphics 4000: whlsl-harness-test.html crashes during dispatch call.
https://bugs.webkit.org/show_bug.cgi?id=199076

Unreviewed test gardening.

* platform/mac/TestExpectations: Skip the test on High Sierra.

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

4 months ago[WASM-References] Add extra tests for Wasm references + fix element parsing and subty...
justin_michaud@apple.com [Thu, 20 Jun 2019 19:42:48 +0000 (19:42 +0000)]
[WASM-References] Add extra tests for Wasm references + fix element parsing and subtyping bugs
https://bugs.webkit.org/show_bug.cgi?id=199044

Reviewed by Saam Barati.

JSTests:

Add wasm references spec tests as well as a worker test.

* wasm.yaml:
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Element):
* wasm/js-api/element.js:
(assert.throws.new.WebAssembly.Module.builder.WebAssembly):
* wasm/references-spec-tests/ref_is_null.js: Added.
(hostref):
(is_hostref):
(is_funcref):
(eq_ref):
(let.handler.get target):
(register):
(module):
(instance):
(call):
(get instance):
(exports):
(run):
(assert_malformed):
(assert_invalid):
(assert_unlinkable):
(assert_uninstantiable):
(assert_trap):
(try.f):
(catch):
(assert_exhaustion):
(assert_return):
(assert_return_canonical_nan):
(assert_return_arithmetic_nan):
(assert_return_ref):
(assert_return_func):
* wasm/references-spec-tests/ref_null.js: Added.
(hostref):
(is_hostref):
(is_funcref):
(eq_ref):
(let.handler.get target):
(register):
(module):
(instance):
(call):
(get instance):
(exports):
(run):
(assert_malformed):
(assert_invalid):
(assert_unlinkable):
(assert_uninstantiable):
(assert_trap):
(try.f):
(catch):
(assert_exhaustion):
(assert_return):
(assert_return_canonical_nan):
(assert_return_arithmetic_nan):
(assert_return_ref):
(assert_return_func):
* wasm/references/element_parsing.js: Added.
(module):
* wasm/references/func_ref.js:
* wasm/references/multitable.js:
* wasm/references/table_misc.js:
(TableSize.0.End.End.WebAssembly):
* wasm/references/validation.js:
(assert.throws):

Source/JavaScriptCore:

Fix parsing table indices from the element section. The byte that we previously read as the table index actually tells us how to parse the table index.
Fix some areas where we got the isSubtype check wrong, causing funcrefs to not be considred anyrefs.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::unify):
* wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseElement):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::unify):

LayoutTests:

Add wasm references spec tests as well as a worker test.

* workers/wasm-references.html: Added.
* workers/wasm-references/test.js: Added.
(const._fail):
(const.isNotA.assert.isNotA):
(const):
(switch.typeof):
(Builder):
(Builder.prototype.setChecked):
(Builder.prototype.setPreamble):
(Builder.prototype._functionIndexSpaceKeyHash):
(Builder.prototype._registerFunctionToIndexSpace):
(Builder.prototype._getFunctionFromIndexSpace):
(Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
(Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.const.codeBuilder.End.switch.case.string_appeared_here.e):
(Builder.prototype._registerSectionBuilders.this.Unknown):
(done):
(runTest.worker.onmessage):
(runTest):
(doGC):
* workers/wasm-references/worker.js: Added.
(const._fail):
(const.isNotA.assert.isNotA):

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

4 months agoChanging settings of a MediaStreamTrack clone should not alter the settings of the...
youenn@apple.com [Thu, 20 Jun 2019 18:55:32 +0000 (18:55 +0000)]
Changing settings of a MediaStreamTrack clone should not alter the settings of the original track
https://bugs.webkit.org/show_bug.cgi?id=198840

Reviewed by Eric Carlson.

Source/WebCore:

Rename RealtimeVideoSource in RealtimeVideoCaptureSource.
Introduce RealtimeVideoSource as a class wrapping RealtimeVideoCaptureSource.
Its goal is to be able to have independent settings from its underlying RealtimeVideoCaptureSource.
It can also adapt size based on its settings if different than its RealtimeVideoCaptureSource.
Apply this wrapping for AV video sources as well as mock video sources.
Test: fast/mediastream/mediastreamtrack-video-clone.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::clone):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoCaptureSource.cpp: Added.
(WebCore::RealtimeVideoCaptureSource::RealtimeVideoCaptureSource):
(WebCore::RealtimeVideoCaptureSource::~RealtimeVideoCaptureSource):
(WebCore::RealtimeVideoCaptureSource::prepareToProduceData):
(WebCore::RealtimeVideoCaptureSource::presets):
(WebCore::RealtimeVideoCaptureSource::setSupportedPresets):
(WebCore::RealtimeVideoCaptureSource::standardVideoSizes):
(WebCore::updateMinMax):
(WebCore::RealtimeVideoCaptureSource::updateCapabilities):
(WebCore::RealtimeVideoCaptureSource::supportsSizeAndFrameRate):
(WebCore::RealtimeVideoCaptureSource::frameRateRangeIncludesRate):
(WebCore::RealtimeVideoCaptureSource::presetSupportsFrameRate):
(WebCore::RealtimeVideoCaptureSource::supportsCaptureSize):
(WebCore::RealtimeVideoCaptureSource::shouldUsePreset):
(WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate):
(WebCore::RealtimeVideoCaptureSource::setSizeAndFrameRate):
(WebCore::RealtimeVideoCaptureSource::adaptVideoSample):
(WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
(WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
(WebCore::SizeAndFrameRate::toJSONObject const):
(WebCore::SizeAndFrameRate::toJSONString const):
* platform/mediastream/RealtimeVideoCaptureSource.h: Added.
(WebCore::RealtimeVideoCaptureSource::sampleRotation const):
(WebCore::RealtimeVideoCaptureSource::prefersPreset):
(WebCore::RealtimeVideoCaptureSource::setFrameRateWithPreset):
(WebCore::RealtimeVideoCaptureSource::canResizeVideoFrames const):
(WebCore::RealtimeVideoCaptureSource::setDefaultSize):
(WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
(WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource):
(WebCore::m_source):
(WebCore::RealtimeVideoSource::~RealtimeVideoSource):
(WebCore::RealtimeVideoSource::startProducingData):
(WebCore::RealtimeVideoSource::stopProducingData):
(WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
(WebCore::RealtimeVideoSource::setSizeAndFrameRate):
(WebCore::RealtimeVideoSource::sourceMutedChanged):
(WebCore::RealtimeVideoSource::sourceSettingsChanged):
(WebCore::RealtimeVideoSource::preventSourceFromStopping):
(WebCore::RealtimeVideoSource::sourceStopped):
(WebCore::RealtimeVideoSource::videoSampleAvailable):
(WebCore::RealtimeVideoSource::clone):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create):
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate):
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRate):
* platform/mock/MockRealtimeVideoSource.h:

LayoutTests:

* fast/mediastream/mediastreamtrack-video-clone-expected.txt: Added.
* fast/mediastream/mediastreamtrack-video-clone.html: Added.

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

4 months agoUnreviewed. More speculative build fixing for watchOS after r246631.
sbarati@apple.com [Thu, 20 Jun 2019 18:28:22 +0000 (18:28 +0000)]
Unreviewed. More speculative build fixing for watchOS after r246631.

* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:

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

4 months agoLayout Test imported/blink/fast/css/user-select-none.html is flaky.
tsavell@apple.com [Thu, 20 Jun 2019 18:03:51 +0000 (18:03 +0000)]
Layout Test imported/blink/fast/css/user-select-none.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=199071

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-20

* platform/ios-wk2/TestExpectations:

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

4 months agoMoving expectations files
sroberts@apple.com [Thu, 20 Jun 2019 17:58:16 +0000 (17:58 +0000)]
Moving expectations files
https://bugs.webkit.org/show_bug.cgi?id=196495

Unreviewed test gardening.

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

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

4 months agoUnreviewed. Speculative build fix for watchOS after r246631.
sbarati@apple.com [Thu, 20 Jun 2019 17:35:43 +0000 (17:35 +0000)]
Unreviewed. Speculative build fix for watchOS after r246631.

* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:

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

4 months ago[GTK] Enable navigation swipe layout tests
commit-queue@webkit.org [Thu, 20 Jun 2019 17:05:19 +0000 (17:05 +0000)]
[GTK] Enable navigation swipe layout tests
https://bugs.webkit.org/show_bug.cgi?id=198995

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-06-20
Reviewed by Michael Catanzaro.

Source/WebKit:

Implement API for enabling and controlling swipes from WebKitTestRunner.

Implement beginSimulatedSwipeInDirectionForTesting() and completeSimulatedSwipeInDirectionForTesting()
in ViewGestureController for controlling the test swipes. Add functions in WebKitWebViewBase for calling
them.

Simulate the gesture by generating two scroll events: one to begin the gesture and one to complete it.

Since there's no reliable way to set source device type of the generated events to touchpad, don't check
source device type for simulated swipes.

* UIProcess/API/C/gtk/WKView.cpp:
(WKViewSetEnableBackForwardNavigationGesture): Added.
(WKViewBeginBackSwipeForTesting): Added.
(WKViewCompleteBackSwipeForTesting): Added.
* UIProcess/API/C/gtk/WKViewPrivate.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseBeginBackSwipeForTesting): Added.
(webkitWebViewBaseCompleteBackSwipeForTesting): Added.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/ViewGestureController.h:
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
Skip source device type check for simulated swipes. Also, remove an incorrect FIXME.
(WebKit::createScrollEvent): Added.
(WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting): Implemented.
(WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting): Implemented.

Tools:

Add a way for tests to enable and then control swipe gesture on GTK.

* TestRunnerShared/UIScriptContext/UIScriptController.cpp: Hide
empty implementations of beginBackSwipe() and completeBackSwipe() for GTK.
* WebKitTestRunner/PlatformGTK.cmake:
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::setNavigationGesturesEnabled): Implemented.
* WebKitTestRunner/gtk/UIScriptControllerGtk.cpp: Added.
(WTR::UIScriptController::beginBackSwipe):
(WTR::UIScriptController::completeBackSwipe):

LayoutTests:

Enable the existing tests for the swipe gesture.

swipe/pushState-programmatic-back-while-swiping-crash.html is not applicable because
it deals with NSEvents directly, skip it.

swipe/main-frame-pinning-requirement.html is flaky, same as on Mac.

swipe/pushstate-with-manual-scrollrestoration.html passes, don't mark it as failure.

* platform/gtk/TestExpectations:

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

4 months ago[GTK] Make startup pause available in DEVELOPER_MODE rather than DEBUG.
cturner@igalia.com [Thu, 20 Jun 2019 17:04:43 +0000 (17:04 +0000)]
[GTK] Make startup pause available in DEVELOPER_MODE rather than DEBUG.
https://bugs.webkit.org/show_bug.cgi?id=199069

Reviewed by Michael Catanzaro.

* WebProcess/gtk/WebProcessMainGtk.cpp: Allow developers to pause
the web process in DEVELOPER_MODE rather than only DEBUG, matching
the WPE behaviour and also the purpose of DEVELOPER_MODE.

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

4 months ago[GTK] HTTP layout tests don't run in flatpak
commit-queue@webkit.org [Thu, 20 Jun 2019 17:04:19 +0000 (17:04 +0000)]
[GTK] HTTP layout tests don't run in flatpak
https://bugs.webkit.org/show_bug.cgi?id=199067

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-06-20
Reviewed by Michael Catanzaro.

Tools:

Stop bind mounting /app/lib/perl to /etc/perl because Perl doesn't actually
check that path. Instead, add /app/lib/perl to Apache config directly.

/usr/manifest.json file is not guaranteed to exist in sandbox, check for
/.flatpak-info instead.

* Scripts/webkitpy/port/base.py:
(Port._is_flatpak):
(Port._in_flatpak_sandbox):
* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):
(is_sandboxed):

LayoutTests:

Set PERL5LIB environment variable in Apache config.

* http/conf/flatpak-httpd.conf:

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

4 months agoTidy up the remaining bits of the AtomicString to AtomString rename
darin@apple.com [Thu, 20 Jun 2019 16:21:50 +0000 (16:21 +0000)]
Tidy up the remaining bits of the AtomicString to AtomString rename
https://bugs.webkit.org/show_bug.cgi?id=198990

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::speculateStringIdentAndLoadStorage): Use flagIsAtom.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Ditto.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Ditto.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileHasOwnProperty): Ditto.
(JSC::FTL::DFG::LowerDFGToB3::speculateStringIdent): Ditto.

Source/WebCore:

* bindings/scripts/test/JS/JSTestObj.cpp: Updated names.
* bindings/scripts/test/TestObj.idl: Ditto.

* css/makeprop.pl: Updated comment.
* css/makevalues.pl: Ditto.
* html/FormController.cpp:
(WebCore::FormKeyGenerator::formKey): Ditto.

Source/WTF:

* wtf/text/AtomString.cpp: Fix a comment.
* wtf/text/AtomString.h: Tweak formatting a bit. Use nullptr instead of 0.
Removed "using AtomicString = AtomString".
* wtf/text/AtomStringImpl.cpp:
(WTF::CStringTranslator::translate): Use setIsAtom instead of setIsAtomic.
(WTF::UCharBufferTranslator::translate): Ditto.
(WTF::HashAndUTF8CharactersTranslator::translate): Ditto.
(WTF::SubstringTranslator::translate): Ditto.
(WTF::LCharBufferTranslator::translate): Ditto.
(WTF::BufferFromStaticDataTranslator::translate): Ditto.
(WTF::AtomStringImpl::addSlowCase): Ditto.
(WTF::AtomStringImpl::lookUpSlowCase): Updated assertion message.

* wtf/text/AtomStringImpl.h: Tweaked the implementation of add.
Updated comments to say AtomString.

* wtf/text/AtomStringTable.cpp:
(WTF::AtomStringTable::~AtomStringTable): Use setIsAtom.

* wtf/text/StringImpl.h: Updated name of StringAtomic and
s_hashFlagStringKindIsAtom. Renamed to flagIsAtom and setIsAtom.

* wtf/text/WTFString.cpp:
(WTF::String::isSafeToSendToAnotherThread const): Updated comment.

Tools:

* Scripts/do-webcore-rename: Removed already-done renames.
* TestWebKitAPI/Tests/WTF/StringImpl.cpp: Rename one use of "atomic".

LayoutTests:

* js/dopey-rope-with-16-bit-propertyname-expected.txt: Rename to AtomString.
* js/dopey-rope-with-16-bit-propertyname.html: Ditto.

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

4 months ago[GTK] The Previous/Next gesture should handle RTL
commit-queue@webkit.org [Thu, 20 Jun 2019 15:55:52 +0000 (15:55 +0000)]
[GTK] The Previous/Next gesture should handle RTL
https://bugs.webkit.org/show_bug.cgi?id=198707

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-06-20
Reviewed by Michael Catanzaro.

The gesture uses PageClientImpl::userInterfaceLayoutDirection() to determine the text
direction. Implement that method, then adjust drawing so that the pages move from/to
the left instead of right side for RTL locales.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::): Implemented.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::draw):

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

4 months ago[LFC][IFC] Make the initial strut explicit
zalan@apple.com [Thu, 20 Jun 2019 15:18:27 +0000 (15:18 +0000)]
[LFC][IFC] Make the initial strut explicit
https://bugs.webkit.org/show_bug.cgi?id=199057
<rdar://problem/51927864>

Reviewed by Antti Koivisto.

The strut always sets the initial vertical constraints on the new line in strict mode. However in quirks mode
we can ignore it as long as there's no baseline type content on the line.

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/inlineformatting/InlineLine.h:

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

4 months ago[LFC][IFC] Introduce Line::InitialConstraints
zalan@apple.com [Thu, 20 Jun 2019 13:59:12 +0000 (13:59 +0000)]
[LFC][IFC] Introduce Line::InitialConstraints
https://bugs.webkit.org/show_bug.cgi?id=199056
<rdar://problem/51927597>

Reviewed by Antti Koivisto.

Line::InitialConstraints, as the name suggests, holds the initial constraint values for the new line.

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
(WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
(WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Line):
(WebCore::Layout::m_skipVerticalAligment):
(WebCore::Layout::m_lineLogicalWidth): Deleted.
* layout/inlineformatting/InlineLine.h:

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

4 months ago[GTK] Remove support for GTK2 plugins
carlosgc@webkit.org [Thu, 20 Jun 2019 11:08:29 +0000 (11:08 +0000)]
[GTK] Remove support for GTK2 plugins
https://bugs.webkit.org/show_bug.cgi?id=199065

Reviewed by Sergio Villar Senin.

.:

* Source/cmake/FindGDK2.cmake: Removed.
* Source/cmake/FindGTK2.cmake: Removed.
* Source/cmake/OptionsGTK.cmake:

PerformanceTests:

* StitchMarker/wtf/Platform.h:

Source/WebCore:

* PlatformGTK.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* platform/FreeType.cmake:
* platform/SourcesGLib.txt:
* platform/graphics/Color.h:
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA const):
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
(WebCore::onFrameClockUpdate):
(WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
* platform/graphics/gtk/DisplayRefreshMonitorGtk.h:
(WebCore::DisplayRefreshMonitorGtk::create):
* platform/graphics/gtk/GdkCairoUtilities.cpp:
* platform/gtk/GRefPtrGtk.cpp:
* platform/gtk/GRefPtrGtk.h:
* platform/gtk/GtkVersioning.c: Removed.
* platform/gtk/GtkVersioning.h: Removed.
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::getClipboardContents):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::modifiersForGdkKeyEvent):
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenIsTouchPrimaryInputDevice):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/gtk/ScrollbarThemeGtk.cpp:
* platform/gtk/ScrollbarThemeGtk.h:
* platform/gtk/WidgetGtk.cpp:
* rendering/RenderThemeGtk.cpp:
* rendering/RenderThemeGtk.h:

Source/WebKit:

* PlatformGTK.cmake:
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::moduleMixesGtkSymbols):
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
(WebKit::NetscapePluginModule::getPluginInfo):
* Shared/Plugins/PluginModuleInfo.h:
* Shared/gtk/WebEventFactory.cpp:
(WebKit::isGdkKeyCodeFromKeyPad):
(WebKit::buttonForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* SourcesGTK.txt:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::getPluginInfo):
(WebKit::PluginInfoCache::updatePluginInfo):
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
(WebKit::PluginInfoStore::getPluginInfo):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
(WebKit::PluginProcessProxy::scanPlugin):
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:

Source/WTF:

* wtf/Platform.h:
* wtf/glib/GTypedefs.h:

Tools:

* EWSTools/ubuntu-ews-packages:
* TestWebKitAPI/PlatformGTK.cmake:
* WebKitTestRunner/PlatformGTK.cmake:
* flatpak/org.webkit.GTK.yaml:
* gtk/install-dependencies:

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

4 months ago[WHLSL] Hook up common texture functions
mmaxfield@apple.com [Thu, 20 Jun 2019 09:40:41 +0000 (09:40 +0000)]
[WHLSL] Hook up common texture functions
https://bugs.webkit.org/show_bug.cgi?id=198704
<rdar://problem/51668841>

Reviewed by Saam Barati.

Source/WebCore:

This patch adds the Metal implementation of the Sample(), Load(), and GetDimensions()
texture functions. The implementation simply performs string concatenation to produce the
correct results, and adds many new native functions to the standard library.

We can't zero-fill texture types or sampler types, so this patch forbids default
constructors for those types. It also forbids those types to exist within arrays, array
references, or pointers, becuase an out-of-bounds access may cause us to try to zero-fill
them.

Tests: webgpu/whlsl-textures-getdimensions.html
       webgpu/whlsl-textures-load.html
       webgpu/whlsl-textures-sample.html

* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Add some more introspection functions
so we can generate the necessary Metal functions for the appropriate texture types.
(WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isTextureArray const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isDepthTexture const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isWritableTexture const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::textureDimension const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTextureArray):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsDepthTexture):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsWritableTexture):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setTextureDimension):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isAtom const): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Native types can be passed into
entry points, too.
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Entry points that return void don't need a
semantic.
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Implement the functions.
(WebCore::WHLSL::Metal::vectorLength):
(WebCore::WHLSL::Metal::vectorInnerType):
(WebCore::WHLSL::Metal::vectorSuffix):
(WebCore::WHLSL::Metal::writeNativeFunction):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp: Textures come in two flavors: sample-able
and read/write-able. Make sure we produce the correct Metal types for them.
(WebCore::WHLSL::Metal::writeNativeType):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp: We can't auto-initialize textures and
samplers. Therefore, this function needs to be able to fail.
(WebCore::WHLSL::AutoInitialize::visit):
(WebCore::WHLSL::autoInitializeVariables):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h:
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: We can't auto-initialize textures, so users
shouldn't be able to either.
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp: Added. Make sure textures and samplers can't
exist inside arrays, array references, or pointers. This is because out-of-bounds accesses may cause
us to attempt to zero-fill the inner type, but we can't zero-fill textures and samplers.
(WebCore::WHLSL::TextureReferencesChecker::TextureReferencesChecker):
(WebCore::WHLSL::Searcher::Searcher):
(WebCore::WHLSL::Searcher::found const):
(WebCore::WHLSL::Searcher::visit):
(WebCore::WHLSL::TextureReferencesChecker::containsTextureOrSampler):
(WebCore::WHLSL::TextureReferencesChecker::visit):
(WebCore::WHLSL::checkTextureReferences):
* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h.
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Record more detailed information about texture types,
so we can emit correct Metal code.
(WebCore::WHLSL::Intrinsics::addFullTexture):
(WebCore::WHLSL::Intrinsics::addDepthTexture):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
(WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Nested NameResolvers need to propagate their error. Also,
native functions with named arguments shouldn't be adding their arguments to the global scope.
(WebCore::WHLSL::NameResolver::visit):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::intrinsics const):
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Metal doesn't have writable depth textures.
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Don't generate default constructors for textures
or samplers.
(WebCore::WHLSL::synthesizeConstructors):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUTexture.h: Make texture usages more clear.
(WebCore::GPUTexture::isSampled const):
(WebCore::GPUTexture::isStorage const):
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Ditto.
(WebCore::GPUBindGroup::tryCreate):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Ditto.
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Ditto.
(WebCore::mtlTextureUsageForGPUTextureUsageFlags):

LayoutTests:

Make the text tests play better with js-test-pre.js.

* webgpu/whlsl-buffer-length.html:
* webgpu/whlsl-compute-expected.txt:
* webgpu/whlsl-compute.html:
* webgpu/whlsl-duplicate-types-should-not-produce-duplicate-ctors.html:
* webgpu/whlsl-null-dereference-expected.txt:
* webgpu/whlsl-null-dereference.html:
* webgpu/whlsl-oob-access-expected.txt:
* webgpu/whlsl-oob-access.html:
* webgpu/whlsl-textures-getdimensions-expected.txt: Added.
* webgpu/whlsl-textures-getdimensions.html: Copied from LayoutTests/webgpu/whlsl-buffer-length.html.
* webgpu/whlsl-textures-load-expected.html: Added.
* webgpu/whlsl-textures-load.html: Added.
* webgpu/whlsl-textures-sample-expected.html: Added.
* webgpu/whlsl-textures-sample.html: Added.

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

4 months ago[bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized
ysuzuki@apple.com [Thu, 20 Jun 2019 04:41:54 +0000 (04:41 +0000)]
[bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized
https://bugs.webkit.org/show_bug.cgi?id=199053

Reviewed by Saam Barati.

Source/bmalloc:

IsoHeap's initialization code is racy. Let's see the `isInitialized` and the initialization code.

isInitialized:

    template<typename Type>
    bool IsoHeap<Type>::isInitialized()
    {
        std::atomic<unsigned>* atomic =
            reinterpret_cast<std::atomic<unsigned>*>(&m_allocatorOffsetPlusOne);
        return !!atomic->load(std::memory_order_acquire);
    }

initialization:

    if (!handle.isInitialized()) {
        std::lock_guard<Mutex> locker(handle.m_initializationLock);
        if (!handle.isInitialized()) {
            auto* heap = new IsoHeapImpl<typename api::IsoHeap<Type>::Config>();
            std::atomic_thread_fence(std::memory_order_seq_cst);
            handle.setAllocatorOffset(heap->allocatorOffset());                  // <================= (1)
            handle.setDeallocatorOffset(heap->deallocatorOffset());              // (2)
            handle.m_impl = heap;
        }
    }

IsoHeap::isInitialized is loading m_allocatorOffsetPlusOne with acquire fence. On the other hand, the initialization
code configures m_allocatorOffsetPlusOne (1) before configuring m_deallocatorOffsetPlusOne (2). Let's consider the following
case.

    1. Thread A is at (1)
    2. Thread B calls handle.isInitialized(). Then B think that handle is already initialized while it lacks m_deallocatorOffsetPlusOne and m_impl pointer.
    3. Thread B uses this handle, and does `std::max(handle.allocatorOffset(), handle.deallocatorOffset())`. But m_deallocatorOffsetPlusOne is not configured
       yet. As a result, deallocatorOffset() returns 0xffffffff (b/c it calculates m_deallocatorOffsetPlusOne - 1, and m_deallocatorOffsetPlusOne is first
       zero-initialized before IsoHeap initialization happens).
    4. std::max returns 0xffffffff as an offset. Of course, this is wrong, and leading to the release assertion.

This patch fixes the above issue by,

    1. Add IsoHeap::initialize() function instead of initializing it in IsoTLS
    2. Change `isInitialized()` function to load m_impl pointer instead of m_allocatorOffsetPlusOne with acquire fence.
    3. In initialize() function, we store m_heap with release fence at last.

* bmalloc/IsoHeap.h:
* bmalloc/IsoHeapInlines.h:
(bmalloc::api::IsoHeap<Type>::isInitialized):
(bmalloc::api::IsoHeap<Type>::initialize):
* bmalloc/IsoTLSInlines.h:
(bmalloc::IsoTLS::ensureHeap):

Source/WTF:

Add constexpr static functions to generate pseudo random numbers from __LINE__.

* wtf/WeakRandom.h:
(WTF::WeakRandom::nextState):
(WTF::WeakRandom::generate):
(WTF::WeakRandom::advance):

Tools:

Added a test stressing IsoHeap with multiple threads.

* TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:
(assertHasObjects):
(assertHasOnlyObjects):
(assertClean):
(TEST):

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

4 months agoMake preload/link-header-preload-imagesrcset.html work on DPR != 1
commit-queue@webkit.org [Thu, 20 Jun 2019 04:36:12 +0000 (04:36 +0000)]
Make preload/link-header-preload-imagesrcset.html work on DPR != 1
https://bugs.webkit.org/show_bug.cgi?id=198533

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

LayoutTests/imported/w3c:

Make the test take DPR into account.

* web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html:
* web-platform-tests/preload/link-header-preload-imagesrcset.html:

LayoutTests:

Remove unneeded iOS test expectations.

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

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

4 months ago[WHLSL] Create a shading language test harness
justin_fan@apple.com [Thu, 20 Jun 2019 03:18:37 +0000 (03:18 +0000)]
[WHLSL] Create a shading language test harness
https://bugs.webkit.org/show_bug.cgi?id=198978

Reviewed by Myles C. Maxfield.

Source/WebCore:

When creating MTLArgumentEncoders for argument buffers, the user's arguments
must match the order that they are declared in the shader. Move back-end information
such as buffer lengths to the end of the argument arrays.

Test: webgpu/whlsl-harness-test.html

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::GPUBindGroupLayout::tryCreate):

LayoutTests:

Introduce a test harness that can be used to test WebGPU shader compilation and functionality.
Currently using MSL.
Will be replaced with WHLSL as it gains the minimum features needed to support.

* webgpu/js/whlsl-test-harness.js: Added.
(isVectorType):
(convertTypeToArrayType):
(convertTypeToWHLSLType):
(Data):
(Data.prototype.async.getArrayBuffer):
(Data.prototype.get type):
(Data.prototype.get isPointer):
(Data.prototype.get buffer):
(Data.prototype.get byteLength):
(Harness.prototype._initialize):
(Harness.prototype.async.callTypedFunction):
(Harness.prototype.async.callVoidFunction):
(Harness.prototype._setUpArguments):
(Harness.prototype._callFunction):
(Harness):
(harness._initialize.async):
(makeBool):
(makeInt):
(makeUchar):
(makeUint):
(makeFloat):
(makeFloat4):
(async.callBoolFunction):
(async.callIntFunction):
(async.callUcharFunction):
(async.callUintFunction):
(async.callFloatFunction):
(async.callFloat4Function):
(callVoidFunction):
* webgpu/whlsl-harness-test-expected.txt: Added.
* webgpu/whlsl-harness-test.html: Added.

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

4 months ago[LFC] Expand tests coverage (1126 new tests -> 2324).
zalan@apple.com [Thu, 20 Jun 2019 02:18:21 +0000 (02:18 +0000)]
[LFC] Expand tests coverage (1126 new tests -> 2324).

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

4 months agoNo menu pop-up when long pressing on a link in Firefox app
dino@apple.com [Thu, 20 Jun 2019 02:17:53 +0000 (02:17 +0000)]
No menu pop-up when long pressing on a link in Firefox app
https://bugs.webkit.org/show_bug.cgi?id=199045
<rdar://problem/51422407>

Reviewed by Tim Horton.

Add a version check for linking on-or-after iOS 13. When
that isn't true, we don't use UIContextMenuInteraction
and instead fall back on the legacy UIPreviewItem API.

* UIProcess/Cocoa/VersionChecks.h: Add FirstThatHasUIContextMenuInteraction.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _shouldUseContextMenus]): New method to decide if we should
use context menus or preview items.
(-[WKContentView setupInteraction]): Make the decision at runtime rather than
compile time.
(-[WKContentView _contentsOfUserInterfaceItem:]): Ditto.
(-[WKContentView _registerPreview]): Ditto.
(-[WKContentView _unregisterPreview]): Ditto.

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

4 months ago[WHLSL] The checker needs to resolve types for the anonymous variables in ReadModifyW...
sbarati@apple.com [Thu, 20 Jun 2019 02:05:28 +0000 (02:05 +0000)]
[WHLSL] The checker needs to resolve types for the anonymous variables in ReadModifyWrite expressions
https://bugs.webkit.org/show_bug.cgi?id=198988

Reviewed by Dean Jackson and Myles C. Maxfield.

Source/WebCore:

This patch makes it so that the Checker assigns types to the internal variables
in a read modify write expression. These were the only variables that didn't have
types ascribed to them.

This patch also does a fly by fix where we kept pointers to value types
in a HashMap in the checker. This is wrong precisely when the HashMap gets
resized. Instead, we now just store the value itself since we're just
dealing with a simple Variant that wraps either an empty struct or an
enum.

Test: webgpu/whlsl-checker-should-set-type-of-read-modify-write-variables.html

* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
(WebCore::WHLSL::AST::VariableDeclaration::setType):
(WebCore::WHLSL::AST::VariableDeclaration::type const):
* Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Make it obvious that read
modify write expressions are such by prefixing them with "RMW".
(WebCore::WHLSL::ASTDumper::visit):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::Checker::visit):

LayoutTests:

* webgpu/whlsl-checker-should-set-type-of-read-modify-write-variables-expected.txt: Added.
* webgpu/whlsl-checker-should-set-type-of-read-modify-write-variables.html: Added.

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

4 months agoWeb Inspector: REGRESSION: Debugger: current call frame indicator isn't vertically...
drousso@apple.com [Thu, 20 Jun 2019 01:47:22 +0000 (01:47 +0000)]
Web Inspector: REGRESSION: Debugger: current call frame indicator isn't vertically centered
https://bugs.webkit.org/show_bug.cgi?id=199015

Reviewed by Matt Baker.

* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame .status):

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

4 months agoAdd WTF::crossThreadCopy(T&&) to utilize String::isolatedCopy() &&
Hironori.Fujii@sony.com [Thu, 20 Jun 2019 00:51:30 +0000 (00:51 +0000)]
Add WTF::crossThreadCopy(T&&) to utilize String::isolatedCopy() &&
https://bugs.webkit.org/show_bug.cgi?id=198957

Reviewed by Alex Christensen.

Source/WTF:

&&-qualified String::isolatedCopy() has a optimization path which
does just WTFMove if it isSafeToSendToAnotherThread which means
the object hasOneRef.

However, WTF::crossThreadCopy was using only &-qualified
isolatedCopy. To use the optimization, added
WTF::crossThreadCopy(T&&) overloading.

* wtf/CrossThreadCopier.h:
(WTF::crossThreadCopy): Added a overload of (T&&).
* wtf/CrossThreadTask.h:
(WTF::createCrossThreadTask): Removed explicit template arguments of crossThreadCopy.

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/CrossThreadCopier.cpp: Added.

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

4 months ago[iOS] Fall back to taking a UIView snapshohot for UITargetedPreviews if InteractionIn...
aestes@apple.com [Thu, 20 Jun 2019 00:50:30 +0000 (00:50 +0000)]
[iOS] Fall back to taking a UIView snapshohot for UITargetedPreviews if InteractionInformationAtPosition does not have an image
https://bugs.webkit.org/show_bug.cgi?id=199038
<rdar://problem/50555810>

Reviewed by Tim Horton.

In -contextMenuInteraction:previewForHighlightingMenuWithConfiguration: and friend, we
should always return a non-nil UITargetedPreview. When we do return nil, UIKit uses the web
view itself as the snapshot view, creating an unsightly animation.

For cases where we fail to create a UITargetedPreview from the information in
InteractionInformationAtPosition, this patch falls back to creating a UITargetedPreview with
a snapshot view obtained from
-[UIView resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:].

Also renamed -targetedPreview to -_ensureTargetedPreview and cached the UITargetedPreview
for reuse in -contextMenuInteraction:previewForDismissingMenuWithConfiguration:.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(createFallbackTargetedPreview):
(-[WKContentView _ensureTargetedPreview]):
(-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
(-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
(-[WKContentView contextMenuInteractionDidEnd:]):
(-[WKContentView _targetedPreview]): Renamed to _ensureTargetedPreview.

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

4 months agoREGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
nvasilyev@apple.com [Thu, 20 Jun 2019 00:40:27 +0000 (00:40 +0000)]
REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
https://bugs.webkit.org/show_bug.cgi?id=198505
<rdar://problem/51374780>

Reviewed by Matt Baker.

Source/WebInspectorUI:

Since r240946, setting WI.CSSStyleDeclaration.prototype.text updates the text immediately.
When WI.CSSStyleDeclaration.prototype.update gets called after setting text, it exits early
without firing WI.CSSStyleDeclaration.Event.PropertiesChanged.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.set text):

LayoutTests:

* inspector/css/modify-css-property.html:
Listen for PropertiesChanged on the specific inline style declaration.
In Debug, PropertiesChanged may fire on a computed style declaration first,
causing the test to fail.

* inspector/css/pseudo-element-matches-for-pseudo-element-node.html:
Drive-by: fix trailing white space.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246621 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoOptimize `resolve` method lookup in Promise static methods
commit-queue@webkit.org [Thu, 20 Jun 2019 00:38:20 +0000 (00:38 +0000)]
Optimize `resolve` method lookup in Promise static methods
https://bugs.webkit.org/show_bug.cgi?id=198864

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-06-19
Reviewed by Yusuke Suzuki.

JSTests:

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

Source/JavaScriptCore:

Lookup `resolve` method only once in Promise.{all,allSettled,race}.
(https://github.com/tc39/ecma262/pull/1506)

Already implemented in V8.

* builtins/PromiseConstructor.js:

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

4 months agoREGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer...
ryanhaddad@apple.com [Thu, 20 Jun 2019 00:18:22 +0000 (00:18 +0000)]
REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
https://bugs.webkit.org/show_bug.cgi?id=199012

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Limit the failure expectation to High Sierra.

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

4 months agoWeb Inspector: Remove unused _pendingFilter from NetworkTableContentView
mattbaker@apple.com [Thu, 20 Jun 2019 00:15:55 +0000 (00:15 +0000)]
Web Inspector: Remove unused _pendingFilter from NetworkTableContentView
https://bugs.webkit.org/show_bug.cgi?id=199026

Reviewed by Devin Rousso.

This flag is no longer set as of https://trac.webkit.org/changeset/225895.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype._processPendingEntries):

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

4 months agoRelocate some test tools in non-mac builds
krollin@apple.com [Thu, 20 Jun 2019 00:14:11 +0000 (00:14 +0000)]
Relocate some test tools in non-mac builds
https://bugs.webkit.org/show_bug.cgi?id=198984
<rdar://problem/51873261>

Reviewed by Andy Estes.

The tools DumpRenderTree, WebKitTestRunner, LayoutTestHelper, and
TestNetscapePlugin get created in
WebKit.framework/Versions/A/Resources on non-mac builds. This is
incorrect, as those bundles are shallow bundles that don't use the
Versions hierarchy. Instead, store these files directly in
WebKit.framework.

Note that getting rid of just the "Versions/A" path components and
putting the files in WebKit.framework/Resources doesn't work as
`codesign` treats the result as an invalid layout.

The work in this patch involves changing the definition of the custom
build variable WEBKIT_FRAMEWORK_RESOURCES_PATH. The standard build
variable INSTALL_PATH is defined in terms of this variable. In order
to increase visiblity into this relationship, move both of these
variables into .xcconfig files if they weren't already. This
refactoring was done in a way to be the least disruptive and most
compatible with the previous definitions, even at the cost of being
repetitive.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
* DumpRenderTree/mac/Configurations/LayoutTestHelper.xcconfig:
* DumpRenderTree/mac/Configurations/TestNetscapePlugIn.xcconfig:
* WebKitTestRunner/Configurations/BaseTarget.xcconfig:

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

4 months agoWeb Inspector: Network: replace CFNetwork SPI with new API where able
drousso@apple.com [Thu, 20 Jun 2019 00:13:59 +0000 (00:13 +0000)]
Web Inspector: Network: replace CFNetwork SPI with new API where able
https://bugs.webkit.org/show_bug.cgi?id=198762

Reviewed by Timothy Hatcher.

Source/WebCore:

* platform/network/NetworkLoadMetrics.h:

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

Source/WTF:

* wtf/Platform.h:

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

4 months agoDownloadMonitor::measuredThroughputRate should approach zero with no throughput
commit-queue@webkit.org [Wed, 19 Jun 2019 23:36:35 +0000 (23:36 +0000)]
DownloadMonitor::measuredThroughputRate should approach zero with no throughput
https://bugs.webkit.org/show_bug.cgi?id=198981
<rdar://problem/51456914>

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

When the timer fires to approximate the download rate, add a new timestamp with 0 bytes received since the last time we received bytes.
Then, if there's only one timestamp, assume the throughput rate is 0 instead of infinite.
This will prevent false positives estimating large download rates based on old data when the throughput drops to 0.

* NetworkProcess/Downloads/DownloadMonitor.cpp:
(WebKit::DownloadMonitor::measuredThroughputRate const):
(WebKit::DownloadMonitor::timerFired):

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

4 months agoLayout Tests in imported/w3c/web-platform-tests/websockets/ are flakey failures after...
tsavell@apple.com [Wed, 19 Jun 2019 23:30:04 +0000 (23:30 +0000)]
Layout Tests in imported/w3c/web-platform-tests/websockets/ are flakey failures after r246406.
https://bugs.webkit.org/show_bug.cgi?id=199013

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-19

* TestExpectations:

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

4 months ago[ews-build] Patch link should open the pretty patch
aakash_jain@apple.com [Wed, 19 Jun 2019 22:45:52 +0000 (22:45 +0000)]
[ews-build] Patch link should open the pretty patch
https://bugs.webkit.org/show_bug.cgi?id=199031

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ConfigureBuild.getPatchURL): Use the prettypatch url for patch.

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

4 months agoSource/WebCore:
simon.fraser@apple.com [Wed, 19 Jun 2019 21:47:07 +0000 (21:47 +0000)]
Source/WebCore:
REGRESSION (246538): Newyorker.com header scrolls on page

Revert parts of r246538 so that frame scrolling is reverted to using layer positions.
Overflow scroll will still scroll by changing boundsOrigin.

The bug was caused by confusion about insetClipLayer and scrollContainerLayer; macOS
positions the clip layer using FrameView::yPositionForInsetClipLayer(), so it's not just
a simple scroll container, and this change broke positioning for fixed position layers.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::~RenderLayerCompositor):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateScrollLayerPosition):
(WebCore::RenderLayerCompositor::updateScrollLayerClipping):
(WebCore::RenderLayerCompositor::frameViewDidScroll):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::destroyRootLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
(WebCore::RenderLayerCompositor::updateLayersForScrollPosition): Deleted.
(WebCore::RenderLayerCompositor::updateScrollContainerGeometry): Deleted.
* rendering/RenderLayerCompositor.h:

LayoutTests:
Revert parts of r246538 so that frame scrolling is reverted to using layer positions.
Overflow scroll will still scroll by changing boundsOrigin.

The bug was caused by confusion about insetClipLayer and scrollContainerLayer; macOS
positions the clip layer using FrameView::yPositionForInsetClipLayer(), so it's not just
a simple scroll container, and this change broke positioning for fixed position layers.

* compositing/iframes/scrolling-iframe-expected.txt:
* compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt:
* compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt:
* platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt:
* platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt:
* platform/mac-sierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt:
* platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt:
* platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:

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

4 months agoiOS 12.2 Drawing portrait video to canvas is sideways
jer.noble@apple.com [Wed, 19 Jun 2019 21:33:35 +0000 (21:33 +0000)]
iOS 12.2 Drawing portrait video to canvas is sideways
https://bugs.webkit.org/show_bug.cgi?id=196772
<rdar://problem/49781802>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-orientation-canvas.html

Move rotation code into its own ImageRotationSessionVT class for re-use across
all existing classes with rotation operations. Should slightly increase performance
for painting rotated media files, as the rotation only occurs once per frame, rather
than once per drawing operation.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
(WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const): Deleted.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::readTrackMetadata):
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
(WebCore::ImageDecoderAVFObjC::setTrack):
(WebCore::transformToRotationProperties): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/cv/ImageRotationSessionVT.h: Added.
(WebCore::ImageRotationSessionVT::RotationProperties::isIdentity const):
(WebCore::ImageRotationSessionVT::rotationProperties const):
(WebCore::ImageRotationSessionVT::rotatedSize):
* platform/graphics/cv/ImageRotationSessionVT.mm: Added.
(WebCore::transformToRotationProperties):
(WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
(WebCore::ImageRotationSessionVT::rotate):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::rotationToAngle):
(WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
(WebCore::computeRotatedWidthAndHeight): Deleted.

LayoutTests:

* media/content/no-rotation.mp4:
* media/media-source/only-bcp47-language-tags-accepted-as-valid-expected.txt:
* media/video-orientation-canvas-expected.html: Added.
* media/video-orientation-canvas.html: Added.
* media/video-test.js:
(waitFor):

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

4 months agoSome of the ASSERTs in CachedTypes.cpp should be RELEASE_ASSERTs
tzagallo@apple.com [Wed, 19 Jun 2019 21:29:48 +0000 (21:29 +0000)]
Some of the ASSERTs in CachedTypes.cpp should be RELEASE_ASSERTs
https://bugs.webkit.org/show_bug.cgi?id=199030

Reviewed by Mark Lam.

These assertions represent strong assumptions that the cache makes so
it's not safe to keep executing if they fail.

* runtime/CachedTypes.cpp:
(JSC::Encoder::malloc):
(JSC::Encoder::Page::alignEnd):
(JSC::Decoder::ptrForOffsetFromBase):
(JSC::Decoder::handleForEnvironment const):
(JSC::Decoder::setHandleForEnvironment):
(JSC::CachedPtr::get const):
(JSC::CachedOptional::encode):
(JSC::CachedOptional::decodeAsPtr const): Deleted.

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

4 months ago[ews-build] Add step to analyze Compile WebKit failures
aakash_jain@apple.com [Wed, 19 Jun 2019 20:49:07 +0000 (20:49 +0000)]
[ews-build] Add step to analyze Compile WebKit failures
https://bugs.webkit.org/show_bug.cgi?id=199025

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(CompileWebKit.evaluateCommand): Add AnalyzeCompileWebKitResults step.
(CompileWebKitToT): set haltOnFailure to False since we need to run AnalyzeCompileWebKitResults step.
(AnalyzeCompileWebKitResults): Class to analyze compile webkit steps results.
(AnalyzeCompileWebKitResults.start): If ToT fails to build, retry the build, else marked the build as failed. Note that
this step is run only when compile-webkit failed.

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

4 months agoRemove unused originsWithCredentials from WebsiteData
sihui_liu@apple.com [Wed, 19 Jun 2019 20:34:30 +0000 (20:34 +0000)]
Remove unused originsWithCredentials from WebsiteData
https://bugs.webkit.org/show_bug.cgi?id=199020

Reviewed by Geoffrey Garen.

* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::encode const):
(WebKit::WebsiteData::decode):
* Shared/WebsiteData/WebsiteData.h:

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

4 months ago[ews-build] Send email notifications for failures
aakash_jain@apple.com [Wed, 19 Jun 2019 20:28:22 +0000 (20:28 +0000)]
[ews-build] Send email notifications for failures
https://bugs.webkit.org/show_bug.cgi?id=198919

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/master.cfg:

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

4 months agoCrash at com.apple.WebKit: WebKit::WebsiteDataStore::processPools const
sihui_liu@apple.com [Wed, 19 Jun 2019 19:44:10 +0000 (19:44 +0000)]
Crash at com.apple.WebKit: WebKit::WebsiteDataStore::processPools const
https://bugs.webkit.org/show_bug.cgi?id=198935
<rdar://problem/51549308>

Reviewed by Geoffrey Garen.

When WebProcessProxy is in WebProcessCache or is pre-warmed, it does not hold a strong reference of
WebProcessPool. In this case, we should not store the raw pointer of WebProcessPool and perform websiteDataStore
operations with it.
This patch should fix the crash at dereferencing null pointer of WebProcessPool in
WebsiteDataStore::processPools, but it is unclear why websiteDataStore comes to observe cached or prewarmed web
process that should not have web page. The release log may help us find the cause.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processPoolIfExists const):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPools const):

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

4 months agoAdd a unit test for client certificate authentication
achristensen@apple.com [Wed, 19 Jun 2019 19:28:56 +0000 (19:28 +0000)]
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800

Reviewed by Youenn Fablet.

Source/WebKit:

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

Source/WTF:

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

Tools:

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

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

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

4 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Wed, 19 Jun 2019 19:21:42 +0000 (19:21 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=199021

* platform/gtk/TestExpectations:

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

4 months agoWeb Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating...
drousso@apple.com [Wed, 19 Jun 2019 18:59:00 +0000 (18:59 +0000)]
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'sourceCodePosition.lineNumber')
https://bugs.webkit.org/show_bug.cgi?id=199019

Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WI.linkifyLocation):

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

4 months agoCorrect the error object link color in dark mode.
commit-queue@webkit.org [Wed, 19 Jun 2019 18:45:22 +0000 (18:45 +0000)]
Correct the error object link color in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=198033

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-06-19
Reviewed by Devin Rousso.

* UserInterface/Views/ErrorObjectView.css:
(@media (prefers-dark-interface)):
(.error-object-link-container):

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

4 months agoVersioning.
kocsen_chung@apple.com [Wed, 19 Jun 2019 18:33:16 +0000 (18:33 +0000)]
Versioning.

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

4 months agoUpdate preview API deprecation message.
achristensen@apple.com [Wed, 19 Jun 2019 18:01:46 +0000 (18:01 +0000)]
Update preview API deprecation message.
https://bugs.webkit.org/show_bug.cgi?id=198974

* UIProcess/API/Cocoa/WKUIDelegate.h:

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

4 months ago[GTK] Fix compilation errors for the GTK2 plugin process
aperez@igalia.com [Wed, 19 Jun 2019 17:42:51 +0000 (17:42 +0000)]
[GTK] Fix compilation errors for the GTK2 plugin process
https://bugs.webkit.org/show_bug.cgi?id=199000

Reviewed by Michael Catanzaro.

* Shared/gtk/WebEventFactory.cpp: Use the GdkEvent union fields
when directly accessing event struct fields.
(WebKit::buttonForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):

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

4 months ago[WPE][GTK] Fix build with unified sources disabled
aperez@igalia.com [Wed, 19 Jun 2019 17:42:05 +0000 (17:42 +0000)]
[WPE][GTK] Fix build with unified sources disabled
https://bugs.webkit.org/show_bug.cgi?id=198752

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* runtime/WeakObjectRefConstructor.h: Add missing inclusion of InternalFunction.h
and forward declaration of WeakObjectRefPrototype.
* wasm/js/WebAssemblyFunction.cpp: Add missing inclusion of JSWebAssemblyHelpers.h

Source/WebCore:

No new tests needed.

* Modules/indexeddb/server/UniqueIDBDatabase.h: Add missing forward declaration for IDBGetRecordData,
replace inclusion of UniqueIDBDatabaseConnection.h with a forward declaration.
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: Remove unneeded inclusion of
UniqueIDBDatabaseTransaction.h, add missing inclusion of UniqueIDBDatabase.h
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: Remove unneeded inclusion of
UniqueIDBDatabaseConnection.h inclusion.
* bridge/c/c_class.cpp: Add inclusion of JSCJSValueInlines.h to avoid linker errors due
to missing JSValue inline functions.
* dom/DocumentParser.h: Replace forward declaration of Document with inclusion of Document.h,
to avoid error due to usage of incomplete type in template expansion.
* dom/Microtasks.h: Add missing forward declaration of JSC::VM
* editing/markup.cpp: Add missing inclusion of PasteboardItemInfo.h
* page/Quirks.h: Add missing forward declaration of WebCore::EventTarget
* page/RuntimeEnabledFeatures.h: Add missing inclusion of wtf/Optional.h to avoid error due to
expansion of undefined template.
* page/SocketProvider.h: Add missing forward declaration for Document.
* platform/graphics/GraphicsLayerClient.h: Add missing inclusion of wtf/OptionSet.h to avoid
error due to expansion of undefined template.
* rendering/RenderMultiColumnSpannerPlaceholder.h: Replace forward declaration of RenderMultiColumnFlow
with inclusion of RenderMultiColumnFlow.h to avoid error due to usage of undefined class.

Source/WebKit:

* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker): Qualify SQLiteDatabase
with its namespace.
* UIProcess/WebFrameProxy.h: Replace forward declaration of WebPageProxy with inclusion
of WebPageProxy.h to avoid build error due to usage of undefined class. Moved DataCallback
definition from WebPageProxy.h to avoid code using the type before its declaration.
* UIProcess/WebPageProxy.h: Remove definition of DataCallback.
* UIProcess/wpe/WebInspectorProxyWPE.cpp: Add missing forward declaration of
WebCore::FloatRect.
(WebKit::WebInspectorProxy::platformSetSheetRect): Qualify FloatRect with its namespace.
* WebProcess/Automation/WebAutomationSessionProxy.cpp: Qualify all occurrences of
PageIdentifier with its namespace.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
(WebKit::WebAutomationSessionProxy::resolveParentFrame):
(WebKit::WebAutomationSessionProxy::focusFrame):
(WebKit::WebAutomationSessionProxy::computeElementLayout):
(WebKit::WebAutomationSessionProxy::selectOptionElement):
(WebKit::WebAutomationSessionProxy::takeScreenshot):
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Cache/WebCacheStorageConnection.cpp: Ditto.
(WebKit::WebCacheStorageConnection::open):
(WebKit::WebCacheStorageConnection::remove):
(WebKit::WebCacheStorageConnection::retrieveCaches):
(WebKit::WebCacheStorageConnection::retrieveRecords):
(WebKit::WebCacheStorageConnection::batchDeleteOperation):
(WebKit::WebCacheStorageConnection::batchPutOperation):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: Add missing inclusion of WebPage.h
* WebProcess/WebPage/gtk/WebPageGtk.cpp: Add missing inclusion of gtk/gtk.h
* WebProcess/WebPage/wpe/WebPageWPE.cpp: Add missing inclusion of WebPageProxy.h

Source/WTF:

* wtf/text/StringBuilder.h: Add missing include of StringConcatenateNumbers.h

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

4 months agowebgpu/blend-color-triangle-strip.html is a flakey failure since introduction.
tsavell@apple.com [Wed, 19 Jun 2019 17:38:43 +0000 (17:38 +0000)]
webgpu/blend-color-triangle-strip.html is a flakey failure since introduction.
https://bugs.webkit.org/show_bug.cgi?id=198921

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-19

* platform/mac-wk2/TestExpectations:

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

4 months agoLayout Test imported/w3c/web-platform-tests/websockets/Create-Secure-verify-url-set...
tsavell@apple.com [Wed, 19 Jun 2019 17:29:45 +0000 (17:29 +0000)]
Layout Test imported/w3c/web-platform-tests/websockets/Create-Secure-verify-url-set-non-default-port.any.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=199013

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-19

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

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

4 months agoRequestedScrollPosition shouldn't be applied after node reattach
antti@apple.com [Wed, 19 Jun 2019 17:21:11 +0000 (17:21 +0000)]
RequestedScrollPosition shouldn't be applied after node reattach
https://bugs.webkit.org/show_bug.cgi?id=198994
<rdar://problem/51439685>

Reviewed by Simon Fraser.

Source/WebCore:

Test: scrollingcoordinator/ios/scroll-position-after-reattach.html

If a scrolling node gets reattached, its scroll position resets to (0,0) or whatever the previous
requestedScrollPosition was, and the current position is lost.

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFixedNode::setAllPropertiesChanged): Deleted.

Rename to better reflect what this is for.

* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameHostingNode.cpp:
(WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateFrameHostingNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStatePositionedNode.cpp:
(WebCore::ScrollingStatePositionedNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStatePositionedNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):

Don't set RequestedScrollPosition. It is a special property that is applied only once on request
and shouldn't get reapplied. Nodes should keep their existing scroll position on reattach.

(WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateStickyNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeWasReattachedRecursive):

LayoutTests:

* scrollingcoordinator/ios/scroll-position-after-reattach-expected.html: Added.
* scrollingcoordinator/ios/scroll-position-after-reattach.html: Added.

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

4 months ago[GTK] Page blinks after navigation swipe if it triggered PSON
commit-queue@webkit.org [Wed, 19 Jun 2019 17:13:25 +0000 (17:13 +0000)]
[GTK] Page blinks after navigation swipe if it triggered PSON
https://bugs.webkit.org/show_bug.cgi?id=198996

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-06-19
Reviewed by Michael Catanzaro.

Disconnect and then reconnect ViewGestureController during process swap
instead of destroying and re-creating it.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::PageClientImpl::processWillSwap): Added.
(WebKit::PageClientImpl::PageClientImpl::processDidExit): Implemented.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseWillSwapWebProcess): Added.
Disconnect ViewGestureController if it exists.
(webkitWebViewBaseDidExitWebProcess): Added.
Destroy ViewGestureController.
(webkitWebViewBaseDidRelaunchWebProcess):
Reconnect the ViewGestureController if it exists.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

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

4 months agoREGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer...
tsavell@apple.com [Wed, 19 Jun 2019 16:59:20 +0000 (16:59 +0000)]
REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
https://bugs.webkit.org/show_bug.cgi?id=199012

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 months agoUnreviewed, fix build warnings in TestWebKitAPIInjectedBundle
mcatanzaro@igalia.com [Wed, 19 Jun 2019 15:41:25 +0000 (15:41 +0000)]
Unreviewed, fix build warnings in TestWebKitAPIInjectedBundle

System headers are being included without SYSTEM again here.

* TestWebKitAPI/PlatformGTK.cmake:

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

4 months ago[WASM-References] Rename anyfunc to funcref
justin_michaud@apple.com [Wed, 19 Jun 2019 15:36:46 +0000 (15:36 +0000)]
[WASM-References] Rename anyfunc to funcref
https://bugs.webkit.org/show_bug.cgi?id=198983

Reviewed by Yusuke Suzuki.

JSTests:

* wasm/function-tests/basic-element.js:
* wasm/function-tests/context-switch.js:
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
(makeInstance):
(assert.eq.makeInstance):
* wasm/function-tests/exceptions.js:
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
* wasm/function-tests/grow-memory-2.js:
(assert.eq.instance.exports.foo):
* wasm/function-tests/nameSection.js:
(const.compile):
* wasm/function-tests/stack-overflow.js:
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
(assertOverflows.makeInstance):
* wasm/function-tests/table-basic-2.js:
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
* wasm/function-tests/table-basic.js:
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
* wasm/function-tests/trap-from-start-async.js:
* wasm/function-tests/trap-from-start.js:
* wasm/js-api/Module.exports.js:
(assert.truthy):
* wasm/js-api/Module.imports.js:
(assert.truthy):
* wasm/js-api/call-indirect.js:
(const.oneTable):
(const.multiTable):
(multiTable.const.makeTable):
(multiTable):
(multiTable.Polyphic2Import):
(multiTable.VirtualImport):
* wasm/js-api/element-data.js:
* wasm/js-api/element.js:
(assert.throws.new.WebAssembly.Module.builder.WebAssembly):
(assert.throws):
(badInstantiation.makeModule):
(badInstantiation.test):
(badInstantiation):
* wasm/js-api/extension-MemoryMode.js:
* wasm/js-api/table.js:
(new.WebAssembly.Module):
(assert.throws):
(assertBadTableImport):
(assert.throws.WebAssembly.Table.prototype.grow):
(new.WebAssembly.Table):
(assertBadTable):
(assert.truthy):
* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties.switch):
* wasm/js-api/unique-signature.js:
(CallIndirectWithDuplicateSignatures):
* wasm/js-api/wrapper-function.js:
* wasm/modules/table.wat:
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat:
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat:
* wasm/modules/wasm-imports-wasm-exports/imports.wat:
* wasm/modules/wasm-imports-wasm-exports/sum.wat:
* wasm/references/anyref_table.js:
* wasm/references/anyref_table_import.js:
(doSet):
(assert.throws):
* wasm/references/func_ref.js:
(makeFuncrefIdent):
(assert.eq.instance.exports.fix):
(GetLocal.0.I32Const.0.TableSet.0.End.End.WebAssembly.assert.throws):
(GetLocal.0.I32Const.0.TableSet.0.End.End.WebAssembly):
(let.importedFun.of):
(makeAnyfuncIdent): Deleted.
(makeAnyfuncIdent.fun): Deleted.
* wasm/references/multitable.js:
(assert.eq):
(assert.throws):
* wasm/references/table_misc.js:
(GetLocal.0.TableFill.0.End.End.WebAssembly):
* wasm/references/validation.js:
(assert.throws.new.WebAssembly.Module.bin):
(assert.throws):
* wasm/spec-harness/index.js:
* wasm/spec-harness/wasm-constants.js:
* wasm/spec-harness/wasm-module-builder.js:
(WasmModuleBuilder.prototype.toArray):
* wasm/spec-harness/wast.js:
(elem_type):
(string_of_elem_type):
(string_of_table_type):
* wasm/spec-tests/jsapi.js:
* wasm/stress/wasm-table-grow-initialize.js:
* wasm/wasm.json:

Source/JavaScriptCore:

Anyfunc should become funcref since it was renamed in the spec. We should also support the string 'anyfunc' in the table constructor since this is
the only non-binary-format place where it is exposed to users.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::gFuncref):
(JSC::Wasm::AirIRGenerator::tmpForType):
(JSC::Wasm::AirIRGenerator::emitCCall):
(JSC::Wasm::AirIRGenerator::moveOpForValueType):
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::AirIRGenerator::addLocal):
(JSC::Wasm::AirIRGenerator::addConstant):
(JSC::Wasm::AirIRGenerator::addRefFunc):
(JSC::Wasm::AirIRGenerator::addReturn):
(JSC::Wasm::AirIRGenerator::gAnyfunc): Deleted.
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConventionAir::marshallArgument const):
(JSC::Wasm::CallingConventionAir::setupCall const):
* wasm/WasmExceptionType.h:
* wasm/WasmFormat.h:
(JSC::Wasm::isValueType):
(JSC::Wasm::isSubtype):
(JSC::Wasm::TableInformation::wasmType const):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseTableHelper):
(JSC::Wasm::SectionParser::parseElement):
(JSC::Wasm::SectionParser::parseInitExpr):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::addRefFunc):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
* wasm/wasm.json:

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

4 months ago[Curl] CurlRequestScheduler doesn't terminate worker thread in a certain situation.
commit-queue@webkit.org [Wed, 19 Jun 2019 15:11:30 +0000 (15:11 +0000)]
[Curl] CurlRequestScheduler doesn't terminate worker thread in a certain situation.
https://bugs.webkit.org/show_bug.cgi?id=198993

Cancel CurlRequest before invalidation to remove tasks from CurlRequestScheduler certainly in ~NetworkDataTaskCurl.

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-06-19
Reviewed by Fujii Hironori.

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::~NetworkDataTaskCurl):

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

4 months ago[CMake][Win] CombinedDomains.json is generated twice in JavaScriptCore_CopyPrivateHea...
Hironori.Fujii@sony.com [Wed, 19 Jun 2019 15:07:31 +0000 (15:07 +0000)]
[CMake][Win] CombinedDomains.json is generated twice in JavaScriptCore_CopyPrivateHeaders and JavaScriptCore projects
https://bugs.webkit.org/show_bug.cgi?id=198853

Reviewed by Don Olmstead.

JavaScriptCore_CopyPrivateHeaders target needs to have a direct or
indirect dependency of JavaScriptCore target for CMake Visual
Studio generator to eliminate duplicated custom commands.

* CMakeLists.txt: Added JavaScriptCore as a dependency of JavaScriptCore_CopyPrivateHeaders.

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

4 months agoUSE_ANGLE macro can be evaluated without being defined
zandobersek@gmail.com [Wed, 19 Jun 2019 12:03:15 +0000 (12:03 +0000)]
USE_ANGLE macro can be evaluated without being defined
https://bugs.webkit.org/show_bug.cgi?id=198991

Reviewed by Carlos Garcia Campos.

* wtf/Platform.h: On platforms not yet defining USE_ANGLE, the
incompatibility check with some other flags leads to the macro being
evaluated even when it was not defined, producing compiler warnings.
To avoid this, the macro should be defined to 0 before the check in
case it was not defined already.

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

4 months ago[Nicosia] Invalidate SceneIntegration in LayerTreeHost::invalidate()
zandobersek@gmail.com [Wed, 19 Jun 2019 12:02:09 +0000 (12:02 +0000)]
[Nicosia] Invalidate SceneIntegration in LayerTreeHost::invalidate()
https://bugs.webkit.org/show_bug.cgi?id=198992

Reviewed by Carlos Garcia Campos.

* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::invalidate): Invalidate the
Nicosia::SceneIntegration object. This should properly disassociate
the now-invalited LayerTreeHost (a SceneIntegration client) from the
SceneIntegration object that can still be shared with platform layers
originating from this LayerTreeHost.

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

4 months agoresize-observer/element-leak.html is a flaky failure
commit-queue@webkit.org [Wed, 19 Jun 2019 10:54:13 +0000 (10:54 +0000)]
resize-observer/element-leak.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=198666

Patch by Cathie Chen <cathiechen@igalia.com> on 2019-06-19
Reviewed by Frédéric Wang.

It takes a very long time to construct iframes which create and remove 1000 elements. This would cause timeout sometimes.
In order to make it more effective, reduce the number of elements to 200 and put them into a container first,
then attach the container to DOM tree.

* resize-observer/resources/element-leak-frame.html:

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

4 months agoUIContextMenuInteraction implementation for WKContentView
dino@apple.com [Wed, 19 Jun 2019 09:43:57 +0000 (09:43 +0000)]
UIContextMenuInteraction implementation for WKContentView
https://bugs.webkit.org/show_bug.cgi?id=198986
<rdar://problem/51875189>

Reviewed by Andy Estes.

Source/WebCore/PAL:

Include + soft link DDContextMenuAction.

* pal/spi/ios/DataDetectorsUISPI.h:

Source/WebKit:

Implement UIContextMenuInteraction and its delegate as a
replacement for UIPreviewItemController in iOS 13.

In order to preserve existing behaviour as much as possible,
we check for the implementation of new WebKit API to configure
the menu. If that is not present, we attempt to convert
the results of the existing WebKit WKPreviewAction delegates
into something that works with UIContextMenus.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _contentsOfUserInterfaceItem:]):
(-[WKContentView _registerPreview]):
(-[WKContentView _unregisterPreview]):
(-[WKContentView _showLinkPreviewsPreferenceChanged:]):
(needsDeprecatedPreviewAPI):
(uiActionForPreviewAction):
(menuFromPreviewOrDefaults):
(titleForMenu):
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView contextMenuInteraction:configurationForMenuAtLocation:]):
(-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
(-[WKContentView continueContextMenuInteraction:]):
(uiImageForImage):
(createTargetedPreview):
(-[WKContentView _targetedPreview]):
(-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
(-[WKContentView contextMenuInteractionWillPresent:]):
(-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
(-[WKContentView contextMenuInteraction:willCommitWithAnimator:]):
(-[WKContentView contextMenuInteractionDidEnd:]):
(-[WKContentView shouldUsePreviewForLongPress]): Deleted.

Source/WTF:

Add USE_UICONTEXTMENU for iOS 13+.

* wtf/Platform.h:

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

4 months agoText Selection gesture has changed behavior, change test to match new behavior
megan_gardner@apple.com [Wed, 19 Jun 2019 06:55:13 +0000 (06:55 +0000)]
Text Selection gesture has changed behavior, change test to match new behavior
https://bugs.webkit.org/show_bug.cgi?id=198980
<rdar://problem/51713918>

Reviewed by Wenson Hsieh.

Long press and drag now starts a selection and entends the range, rather than changing
the start of the text selection. Update the test to match the new behavior.

* fast/events/touch/ios/long-press-then-drag-to-select-text.html:

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