WebKit-https.git
9 months agoUnreviewed test gardening.
zalan@apple.com [Fri, 14 Dec 2018 17:58:21 +0000 (17:58 +0000)]
Unreviewed test gardening.

LFC does not support logical to physical coordinate conversion yet.

* fast/block/block-only/float-avoider-with-margins-expected.txt:
* fast/block/block-only/float-avoider-with-margins.html:

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

9 months agoIDB should store RTCCertificate
youenn@apple.com [Fri, 14 Dec 2018 17:44:47 +0000 (17:44 +0000)]
IDB should store RTCCertificate
https://bugs.webkit.org/show_bug.cgi?id=192599

Reviewed by Brady Eidson.

Source/WebCore:

In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
Instead, create an empty object so that the deserialization can still succeed.
This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.

Test: webrtc/certificates-indexeddb.html

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):

LayoutTests:

* webrtc/certificates-indexeddb-expected.txt: Added.
* webrtc/certificates-indexeddb.html: Added.

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

9 months ago[PSON] WebsitePolicies are lost on process-swap
cdumez@apple.com [Fri, 14 Dec 2018 17:40:53 +0000 (17:40 +0000)]
[PSON] WebsitePolicies are lost on process-swap
https://bugs.webkit.org/show_bug.cgi?id=192694
<rdar://problem/46715748>

Reviewed by Brady Eidson.

Source/WebKit:

In case of process-swap on navigation, instead of sending the websitePolicies to the old
process, send them to the new process as we trigger the navigation. We tell the new process
that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.

* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
(WebKit::WebPage::goToBackForwardItem):
(WebKit::WebPage::createDocumentLoader):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Extend existing API test to reproduce the issue.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

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

9 months ago[GTK] Error writing data to TLS socket in some sites when using the jhbuild
mcatanzaro@igalia.com [Fri, 14 Dec 2018 17:18:55 +0000 (17:18 +0000)]
[GTK] Error writing data to TLS socket in some sites when using the jhbuild
https://bugs.webkit.org/show_bug.cgi?id=192678

Reviewed by Carlos Garcia Campos.

Update our ancient versions of libsoup and glib-networking.

* gtk/install-dependencies:
* gtk/jhbuild.modules:
* gtk/patches/libsoup-auth-Fix-async-authentication-when-flag-SOUP_MESSAGE.patch: Removed.
* gtk/patches/libsoup-auth-do-not-use-cached-credentials-in-lookup-method-.patch: Removed.
* gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch: Removed.
* gtk/patches/libsoup-soup-socket-fix-critical-warning-when-the-peer-certi.patch: Removed.
* wpe/install-dependencies:
* wpe/jhbuild.modules:
* wpe/patches/libsoup-soup-socket-fix-critical-warning-when-the-peer-certi.patch: Removed.

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

9 months ago[LFC][BFC] Transition to logical margin types.
zalan@apple.com [Fri, 14 Dec 2018 16:52:24 +0000 (16:52 +0000)]
[LFC][BFC] Transition to logical margin types.
https://bugs.webkit.org/show_bug.cgi?id=192699

Reviewed by Antti Koivisto.

This is in preparation for moving over to logical types.
(This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/MarginTypes.h:
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginBefore):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
(WebCore::Layout::hasPrecomputedMarginTop): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::hasMarginBeforeQuirkValue):
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
(WebCore::Layout::hasMarginTopQuirkValue): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginBeforeCollapsedWithSibling):
(WebCore::Layout::isMarginAfterCollapsedWithSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
(WebCore::Layout::isMarginAfterCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
(WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
(WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rectWithMargin const):
(WebCore::Display::Box::estimatedMarginBefore const):
(WebCore::Display::Box::setEstimatedMarginBefore):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::marginBefore const):
(WebCore::Display::Box::marginStart const):
(WebCore::Display::Box::marginAfter const):
(WebCore::Display::Box::marginEnd const):
(WebCore::Display::Box::nonCollapsedMarginBefore const):
(WebCore::Display::Box::nonCollapsedMarginAfter const):
(WebCore::Display::Box::nonComputedMarginStart const):
(WebCore::Display::Box::nonComputedMarginEnd const):
(WebCore::Display::Box::estimatedMarginTop const): Deleted.
(WebCore::Display::Box::setEstimatedMarginTop): Deleted.
(WebCore::Display::Box::marginTop const): Deleted.
(WebCore::Display::Box::marginLeft const): Deleted.
(WebCore::Display::Box::marginBottom const): Deleted.
(WebCore::Display::Box::marginRight const): Deleted.
(WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
(WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
(WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
(WebCore::Display::Box::nonComputedMarginRight const): Deleted.
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::setHorizontalConstraints):
(WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
(WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::marginBefore const):
(WebCore::Layout::FloatAvoider::marginAfter const):
(WebCore::Layout::FloatAvoider::marginStart const):
(WebCore::Layout::FloatAvoider::marginEnd const):
(WebCore::Layout::FloatAvoider::marginBoxWidth const):
(WebCore::Layout::FloatAvoider::marginTop const): Deleted.
(WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
(WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
(WebCore::Layout::FloatAvoider::marginRight const): Deleted.
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::rect const):
(WebCore::Layout::FloatBox::horizontalPositionCandidate):
(WebCore::Layout::FloatBox::verticalPositionCandidate):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):

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

9 months ago[LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
zalan@apple.com [Fri, 14 Dec 2018 15:22:02 +0000 (15:22 +0000)]
[LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
https://bugs.webkit.org/show_bug.cgi?id=192692

Reviewed by Antti Koivisto.

This is in preparation for completing block margin collapsing.

* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutUnits.h:
(WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
* layout/MarginTypes.h: Added.
(WebCore::Layout::VerticalMargin::nonCollapsedValues const):
(WebCore::Layout::VerticalMargin::collapsedValues const):
(WebCore::Layout::VerticalMargin::setCollapsedValues):
(WebCore::Layout::VerticalMargin::VerticalMargin):
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setHorizontalNonComputedMargin):
(WebCore::Display::Box::verticalMargin const):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::nonCollapsedMarginTop const):
(WebCore::Display::Box::nonCollapsedMarginBottom const):
(WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):

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

9 months ago[GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
commit-queue@webkit.org [Fri, 14 Dec 2018 14:38:48 +0000 (14:38 +0000)]
[GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
https://bugs.webkit.org/show_bug.cgi?id=192622

Patch by Patrick Griffis <pgriffis@igalia.com> on 2018-12-14
Reviewed by Michael Catanzaro.

This fixes running with the sandbox enabled in Flatpak.

* UIProcess/Launcher/glib/FlatpakLauncher.cpp:
(WebKit::flatpakSpawn):
* UIProcess/Launcher/glib/FlatpakLauncher.h:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):

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

9 months ago[WPE] Use new view state API from libwpe
carlosgc@webkit.org [Fri, 14 Dec 2018 12:57:22 +0000 (12:57 +0000)]
[WPE] Use new view state API from libwpe
https://bugs.webkit.org/show_bug.cgi?id=191906

Reviewed by Žan Doberšek.

Source/WebKit:

Remove WKViewSetViewState from the C API.

* UIProcess/API/C/wpe/WKAPICastWPE.h:
* UIProcess/API/C/wpe/WKView.cpp:
* UIProcess/API/C/wpe/WKView.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View): Add implementation for activity_state_changed vfunc of the view backend client.):
(WKWPE::View::setViewState): Remove the default flags.
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::setViewState const): Make it private.

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(beforeAll): Enable /webkit/WebKitWebView/page-visibility in WPE.
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend): Make the view initially hidden for consistency with GTK+ tests.
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:
* TestWebKitAPI/glib/WebKitGLib/wpe/WebViewTestWPE.cpp:
(WebViewTest::showInWindow): Add wpe_view_activity_state_visible, wpe_view_activity_state_in_window and
wpe_view_activity_state_focused state flags.
(WebViewTest::hideView): Remove wpe_view_activity_state_visible and wpe_view_activity_state_focused state flags.
* wpe/backends/HeadlessViewBackend.cpp:
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend): Assume view is always visible, focused and in window.
* wpe/backends/WindowViewBackend.cpp:
(WPEToolingBackends::WindowViewBackend::WindowViewBackend): Update the view state flags depending on state
received in configure callback.
* wpe/jhbuild.modules: Bump libwpe to 1.1.0

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

9 months ago[GLib] RunLoop::dispatchAfter() GSource requires microsecond precision
zandobersek@gmail.com [Fri, 14 Dec 2018 12:14:40 +0000 (12:14 +0000)]
[GLib] RunLoop::dispatchAfter() GSource requires microsecond precision
https://bugs.webkit.org/show_bug.cgi?id=192696

Reviewed by Michael Catanzaro.

The GSource we set up in GLib's RunLoop::dispatchAfter() implementation
should support microsecond-precision delays. Such delays are common in
JSC's Watchdog implementation and missing support for them has been
causing test failures in the `testapi` program as well as some JSC
tests that depend on the termination determination functionality of the
JSC::Watchdog class.

RunLoop::dispatchAfter() is changed to spawn a raw GSource that uses the
existing GSourceFuncs implementation used elsewhere in GLib's RunLoop.
The GSource's ready time is set manually, now with the necessary
microsecond precision.

* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::dispatchAfter):

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

9 months ago[Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
Hironori.Fujii@sony.com [Fri, 14 Dec 2018 08:09:53 +0000 (08:09 +0000)]
[Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
https://bugs.webkit.org/show_bug.cgi?id=192693

Reviewed by Ross Kirsling.

No new tests, no behavior changes.

* platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
* platform/win/CursorWin.cpp:
(WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
* platform/win/DefWndProcWindowClass.cpp:
(WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
* platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
* platform/win/PasteboardWin.cpp:
(WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
(WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
* platform/win/PlatformMouseEventWin.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
* platform/win/PopupMenuWin.h: Marked override methods with 'override'.
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
(WebCore::signedPublicKeyAndChallengeString): Ditto.
* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
* platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
* platform/win/SystemInfo.cpp:
(WebCore::osVersionForUAString): Added default case.

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

9 months ago[WinCairo][Clang] DLLLauncherMain.cpp: warning: unused function 'prependPath' and...
Hironori.Fujii@sony.com [Fri, 14 Dec 2018 07:54:59 +0000 (07:54 +0000)]
[WinCairo][Clang] DLLLauncherMain.cpp: warning: unused function 'prependPath' and 'appleApplicationSupportDirectory'
https://bugs.webkit.org/show_bug.cgi?id=192688

Reviewed by Ross Kirsling.

Source/JavaScriptCore:

These functions are used only in AppleWin port.

* shell/DLLLauncherMain.cpp:
(copyEnvironmentVariable): Moved.
(getStringValue): Enclosed with #if !defined(WIN_CAIRO).
(applePathFromRegistry): Ditto.
(appleApplicationSupportDirectory): Ditto.
(prependPath): Ditto.

Tools:

* win/DLLLauncher/DLLLauncherMain.cpp:
(copyEnvironmentVariable): Moved.
(getStringValue): Enclosed with #if !defined(WIN_CAIRO).
(applePathFromRegistry): Ditto.
(appleApplicationSupportDirectory): Ditto.
(prependPath): Ditto.

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

9 months agoImprove GDB output for LLInt on Linux
dinfuehr@igalia.com [Fri, 14 Dec 2018 07:17:32 +0000 (07:17 +0000)]
Improve GDB output for LLInt on Linux
https://bugs.webkit.org/show_bug.cgi?id=192660

Reviewed by Yusuke Suzuki.

Annotate assembly code generated for LLInt with the bytecode operation. When debugging
LLInt assembly code GDB is then able to show which bytecode instruction is implemented by
the current assembly code. This also works for linux-perf.

* llint/LowLevelInterpreter.cpp:
* offlineasm/arm.rb:

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

9 months agoAdd a missing exception check.
mark.lam@apple.com [Fri, 14 Dec 2018 05:21:35 +0000 (05:21 +0000)]
Add a missing exception check.
https://bugs.webkit.org/show_bug.cgi?id=192626
<rdar://problem/46662163>

Reviewed by Keith Miller.

JSTests:

* stress/regress-192626.js: Added.

Source/JavaScriptCore:

* runtime/ScopedArguments.h:

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

9 months ago[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIn...
cdumez@apple.com [Fri, 14 Dec 2018 04:39:11 +0000 (04:39 +0000)]
[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
https://bugs.webkit.org/show_bug.cgi?id=192689
<rdar://problem/46323610>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-13
Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
which broadcasts it as a remote inspector target. Terminate this
as soon as the WebPageProxy closes and becomes invalid.

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

9 months ago[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIn...
commit-queue@webkit.org [Fri, 14 Dec 2018 04:09:59 +0000 (04:09 +0000)]
[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
https://bugs.webkit.org/show_bug.cgi?id=192689
<rdar://problem/46323610>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-13
Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
which broadcasts it as a remote inspector target. Terminate this
as soon as the WebPageProxy closes and becomes invalid.

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

9 months agoThe JSC shell should listen for memory pressure events and respond to them
sbarati@apple.com [Fri, 14 Dec 2018 04:05:41 +0000 (04:05 +0000)]
The JSC shell should listen for memory pressure events and respond to them
https://bugs.webkit.org/show_bug.cgi?id=192647

Reviewed by Keith Miller.

Source/JavaScriptCore:

We want the JSC shell to behave more like the WebContent process when
it comes to running performance tests. One way to make the shell
more like this is to have it respond to memory pressure events in
a similar way as the WebContent process. This makes it easier to run
benchmarks like JetStream2 on the CLI on iOS.

* jsc.cpp:
(jscmain):
* runtime/VM.cpp:
(JSC::VM::drainMicrotasks):
* runtime/VM.h:
(JSC::VM::setOnEachMicrotaskTick):

Source/WTF:

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::MemoryPressureHandler):
(WTF::MemoryPressureHandler::setDispatchQueue):
Make it so that we can customize which dispatch queue memory pressure
events get handled on.

* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setShouldLogMemoryMemoryPressureEvents):
Make it so that we can disable logging that happens on each memory
pressure event.

* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
(WTF::MemoryPressureHandler::uninstall):
(WTF::MemoryPressureHandler::holdOff):

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

9 months agoUnreviewed build fix for tvOS.
cdumez@apple.com [Fri, 14 Dec 2018 03:48:34 +0000 (03:48 +0000)]
Unreviewed build fix for tvOS.

* Platform/cocoa/WKCrashReporter.mm:

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

10 months agoUnreviewed. Changed my status to a reviewer.
Hironori.Fujii@sony.com [Fri, 14 Dec 2018 02:47:15 +0000 (02:47 +0000)]
Unreviewed. Changed my status to a reviewer.

Patch by Don Olmstead <don.olmstead@sony.com> on 2018-12-13

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

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

10 months agoRTCRtpTransceiver.stopped should be true when applying a remote description with...
youenn@apple.com [Fri, 14 Dec 2018 02:19:20 +0000 (02:19 +0000)]
RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
https://bugs.webkit.org/show_bug.cgi?id=192685

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html:

Source/WebCore:

In case the remote description contains a rejected m section,
the corresponding transceiver should be marked as stopped.
Libwebrtc backend has that information so pipe it up to JS.

Covered by updated WPT test.

* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::stopped const):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::stopped const): Deleted.
* Modules/mediastream/RTCRtpTransceiverBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:

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

10 months agoEnsure that StructureFlags initialization always starts with Base::StructureFlags.
mark.lam@apple.com [Fri, 14 Dec 2018 02:14:28 +0000 (02:14 +0000)]
Ensure that StructureFlags initialization always starts with Base::StructureFlags.
https://bugs.webkit.org/show_bug.cgi?id=192686

Reviewed by Keith Miller.

Source/JavaScriptCore:

This is purely a refactoring effort to make the code consistently start all
StructureFlags initialization with Base::StructureFlags.  Previously, sometimes
Base::StructureFlags is appended at the end, and sometimes, it is expressed using
the name of the superclass.  This patch makes the code all consistent and easier
to do a quick eye scan audit on to verify that no StructureFlags are forgetting
to inherit Base::StructureFlags.

Also added a static_assert in JSCallbackObject.h and JSBoundFunction.h.  Both of
these implement a customHasInstance() method, and rely on ImplementsHasInstance
being included in the StructureFlags, and conversely, ImplementsDefaultHasInstance
has to be excluded.

JSBoundFunction.h is the only case where a bit (ImplementsDefaultHasInstance)
needs to be masked out of the inherited Base::StructureFlags.

* API/JSCallbackObject.h:
* runtime/ArrayConstructor.h:
* runtime/ArrayIteratorPrototype.h:
* runtime/Exception.h:
* runtime/FunctionRareData.h:
* runtime/InferredType.h:
* runtime/InferredTypeTable.h:
* runtime/InferredValue.h:
* runtime/JSBoundFunction.h:
* runtime/MapPrototype.h:
* runtime/SetPrototype.h:
* runtime/StringPrototype.h:
* runtime/SymbolConstructor.h:

Source/WebCore:

No new tests needed because there's no new functionality.  Just refactoring.

* bindings/js/JSDOMWindowProperties.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePrototypeDeclaration):
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestEnabledBySetting.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.h:

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

10 months agoMake HTMLConverter work across shadow boundaries
rniwa@webkit.org [Fri, 14 Dec 2018 01:45:24 +0000 (01:45 +0000)]
Make HTMLConverter work across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=192640

Reviewed by Wenson Hsieh.

Source/WebCore:

Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.

Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html

* dom/Position.cpp:
(WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
and serializePreservingVisualAppearanceInternal.
* dom/Position.h:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::convert):
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverterCaches::floatPropertyValueForNode):
(HTMLConverter::_blockLevelElementForNode):
(HTMLConverterCaches::colorPropertyValueForNode):
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
(HTMLConverter::_processElement):
(HTMLConverter::_traverseNode):
(HTMLConverter::_traverseFooterNode):
(HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
(WebCore::attributedStringFromSelection):
* editing/markup.cpp:
(WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.

LayoutTests:

Added tests for generating attributed string out across shadow boundaries based on the tests
of respective names in editing/pasteboard.

* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html: Added.
* editing/mac/attributed-string/resources/dump-attributed-string.js:
(window.dumpAttributedString): Now takes start and end containers and offsets.
(serializeSubtreeWithShadow): Added. This function serializes the content of shadow roots along with
start and end markers.
(serializeSubtreeWithShadow.serializeCharacterData): Added.
(serializeSubtreeWithShadow.serializeNode): Added.
(serializeSubtreeWithShadow.serializeChildNodes): Added.
(serializeSubtreeWithShadow.serializeShadowRootAndChildNodes): Added.
(dumpAttributedString): Deleted.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2-expected.txt: Added.

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

10 months agoTrying to play a media element synchronously after setting srcObject should succeed...
youenn@apple.com [Fri, 14 Dec 2018 01:17:57 +0000 (01:17 +0000)]
Trying to play a media element synchronously after setting srcObject should succeed without user gesture
https://bugs.webkit.org/show_bug.cgi?id=192679

Reviewed by Eric Carlson.

Source/WebCore:

Check the srcObject mediaProvider value which is set synchronously.
Covered by updated fast/mediastream/local-audio-playing-event.html.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):

LayoutTests:

* fast/mediastream/local-audio-playing-event-expected.txt:
* fast/mediastream/local-audio-playing-event.html:

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

10 months agoAdd the JSC_traceBaselineJITExecution option for tracing baseline JIT execution.
mark.lam@apple.com [Fri, 14 Dec 2018 00:53:11 +0000 (00:53 +0000)]
Add the JSC_traceBaselineJITExecution option for tracing baseline JIT execution.
https://bugs.webkit.org/show_bug.cgi?id=192684

Reviewed by Saam Barati.

This dataLogs the bytecode execution order of baseline JIT code when the
JSC_traceBaselineJITExecution option is true.

* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* runtime/Options.h:

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

10 months agoclang-tidy: Fix unnecessary object copies in JavaScriptCore
ddkilzer@apple.com [Fri, 14 Dec 2018 00:19:23 +0000 (00:19 +0000)]
clang-tidy: Fix unnecessary object copies in JavaScriptCore
<https://webkit.org/b/192680>
<rdar://problem/46708767>

Reviewed by Mark Lam.

* assembler/testmasm.cpp:
(JSC::invoke):
- Make MacroAssemblerCodeRef<JSEntryPtrTag> argument a const
  reference.

* b3/testb3.cpp:
(JSC::B3::checkDisassembly):
- Make CString argument a const reference.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringEquality):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
- Make JITCompiler::JumpList arguments a const reference.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::checkStructure):
- Make RegisteredStructureSet argument a const reference.

* jsc.cpp:
(GlobalObject::moduleLoaderImportModule): Make local auto
variables const references.
(Workers::report): Make String argument a const reference.
(addOption): Make Identifier argument a const reference.
(runJSC): Make CString loop variable a const reference.

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

10 months agoVersioning.
kocsen_chung@apple.com [Fri, 14 Dec 2018 00:18:54 +0000 (00:18 +0000)]
Versioning.

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

10 months agoVerify that tryLargeZeroedMemalignVirtual()'s aligned size and alignment values are...
mark.lam@apple.com [Fri, 14 Dec 2018 00:13:21 +0000 (00:13 +0000)]
Verify that tryLargeZeroedMemalignVirtual()'s aligned size and alignment values are valid.
https://bugs.webkit.org/show_bug.cgi?id=192682
<rdar://problem/37751522>

Reviewed by Saam Barati.

* bmalloc/bmalloc.cpp:
(bmalloc::api::tryLargeZeroedMemalignVirtual):

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

10 months ago[iOS] Support dropping contact card data (public.vcard) in editable content
wenson_hsieh@apple.com [Thu, 13 Dec 2018 23:25:20 +0000 (23:25 +0000)]
[iOS] Support dropping contact card data (public.vcard) in editable content
https://bugs.webkit.org/show_bug.cgi?id=192570
<rdar://problem/35626913>

Reviewed by Tim Horton.

Source/WebCore:

Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.

Tests:  DragAndDropTests.ExternalSourceContactIntoEditableAreas
        DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
        DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
        WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
        WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment

* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attachmentForFilePath):

Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
as well as `readVirtualContactFile`.

(WebCore::WebContentReader::readFilePaths):
(WebCore::WebContentReader::readVirtualContactFile):

Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
contact, there is no associated URL, so we only have an attachment.

* platform/Pasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readPasteboardWebContentDataForType):

Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
"public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
`ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
"public.vcard" conforms to "public.text").

(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
* platform/ios/WebItemProviderPasteboard.mm:
(-[NSItemProvider web_fileUploadContentTypes]):

Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
suitable for deserialization into an `MKMapItem`.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:

Add API tests to verify that registering `MKMapItem`s and `CNContact`s to item providers and dropping them in
attachment-enabled rich text editable areas inserts attachment elements (and in the case of `MKMapItem`,
additionally inserts a link).

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::createMapItemForTesting):
(TestWebKitAPI::createContactItemForTesting):

Add API tests to verify that dropping map items and contact items into rich and plain editable areas behaves as
expected (in the case where a URL is present, e.g. dropping a map item, we insert the URL as an anchor, and when
there is no other suitable representation in the item provider, we do nothing at all, which is the case for the
dropped `CNContact`). Also, add a test to verify that drag and drop can be used to upload these items as .vcf
files.

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

10 months agoWeb Inspector: remove DOM.BackendNodeId and associated commands/events
drousso@apple.com [Thu, 13 Dec 2018 23:20:35 +0000 (23:20 +0000)]
Web Inspector: remove DOM.BackendNodeId and associated commands/events
https://bugs.webkit.org/show_bug.cgi?id=192478

Reviewed by Matt Baker.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:

Source/WebCore:

Removing unused code, so no change in functionality.

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
(WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
(WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted.

Source/WebInspectorUI:

* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
* Versions/Inspector-iOS-9.3.json:
* Versions/Inspector-iOS-10.0.json:
* Versions/Inspector-iOS-10.3.json:
* Versions/Inspector-iOS-11.0.json:
* Versions/Inspector-iOS-11.3.json:
* Versions/Inspector-iOS-12.0.json:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:

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

10 months ago[PSON] We should not need to navigate to 'about:blank' to suspend pages
cdumez@apple.com [Thu, 13 Dec 2018 23:17:44 +0000 (23:17 +0000)]
[PSON] We should not need to navigate to 'about:blank' to suspend pages
https://bugs.webkit.org/show_bug.cgi?id=192668
<rdar://problem/46701466>

Reviewed by Alex Christensen.

Source/WebCore:

* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable):
* history/PageCache.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::setDocumentLoader):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
* loader/FrameLoaderTypes.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:

Source/WebKit:

To support PageCache when process-swap on cross-site navigation is enabled,
we've been navigating the previous process to 'about:blank' when swapping.
This would trigger PageCaching of the page in the old process. While
convenient, this design has led to a lot of bugs because we did not really
want a navigation to happen in the old process.

To address the issue, when a WebPage is asked to suspend (for process-swap),
we now attempt to add it to PageCache and save it on the current HistoryItem,
*without* triggering any navigation. Any pending navigation gets cancelled
and we just suspend in place.

Later on, when we want to go back to this HistoryItem, we simply leverage the
existing WebPage::goToBackForwardItem() code path. The only subtlety is that
we're actually asking the WebPage to load a HistoryItem that is the current
one in the History. I had to tweak a some logic / assertions to support this
as this is not something we usually do. However, it actually works with very
little changes and successfully restores the PageCache entry on the current
HistoryItem.

There is no expected overall behavior change and ProcessSwap API tests (which
cover PageCache) still pass. This is merely a simpler design because it avoids
navigating to about:blank.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didSuspend):
(WebKit::SuspendedPageProxy::didReceiveMessage):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didSuspendAfterProcessSwap):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebPage/WebDocumentLoader.cpp:
(WebKit::WebDocumentLoader::setNavigationID):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::origin):

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

10 months ago[macOS] Inline WebVTT styles should override styles from Captions settings in System...
pvollan@apple.com [Thu, 13 Dec 2018 23:06:49 +0000 (23:06 +0000)]
[macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences
https://bugs.webkit.org/show_bug.cgi?id=192638

Reviewed by Eric Carlson.

Source/WebCore:

It is currently not possible to override caption styles generated from System Preferences with inline
WebVTT styles without adding !important. The reason for this is that the generated styles from
System preferences are author styles which have higher priority than the inline WebVTT styles, which
are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated
styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since
they are added after the generated styles. This patch also fixes a problem where inline styles could be
added twice to the video user agent shadow root.

Test: media/track/track-cue-css.html

* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getDisplayTree):
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
* page/Page.cpp:
(WebCore::Page::setCaptionUserPreferencesStyleSheet):

LayoutTests:

* media/track/captions-webvtt/css-styling.vtt:
* media/track/captions-webvtt/no-css-styling.vtt:
* media/track/track-css-user-override-expected.txt:
* media/track/track-css-user-override.html:
* media/track/track-cue-css-expected.html:

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

10 months agoFix leak of AVPlayer boundaryTimeObserver object.
jer.noble@apple.com [Thu, 13 Dec 2018 22:32:29 +0000 (22:32 +0000)]
Fix leak of AVPlayer boundaryTimeObserver object.
https://bugs.webkit.org/show_bug.cgi?id=192674

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):

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

10 months agoWeb Inspector: experimental settings reload button disappears after changing more...
drousso@apple.com [Thu, 13 Dec 2018 22:31:25 +0000 (22:31 +0000)]
Web Inspector: experimental settings reload button disappears after changing more than one setting
https://bugs.webkit.org/show_bug.cgi?id=192645
<rdar://problem/46626204>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView.listenForChange):
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

10 months agoWeb Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't...
mattbaker@apple.com [Thu, 13 Dec 2018 22:29:07 +0000 (22:29 +0000)]
Web Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't select the nearest node after deletion
https://bugs.webkit.org/show_bug.cgi?id=192116
<rdar://problem/46344339>

Reviewed by Devin Rousso.

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.removeSelectedItems):
Finding a new index to select should go through the delegate instead of
naively advancing the index.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._populateNodeContextMenu):
(WI.DOMTreeElement.prototype.ondelete): Deleted.
The menu item for removing the DOM node is now managed by the parent
DOMTreeOutline, since its UI and behavior now depend on whether there
are multiple elements selected.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
(WI.DOMTreeOutline.prototype.ondelete.level):
(WI.DOMTreeOutline.prototype.ondelete):
Implement `ondelete` to remove selected DOM nodes using the delete and
backspace keys. Also used by the DOMTreeOutline's context menu handler.

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

10 months agoclang-tidy: Fix unnecessary parameter copies in ParallelHelperPool.cpp
ddkilzer@apple.com [Thu, 13 Dec 2018 20:49:10 +0000 (20:49 +0000)]
clang-tidy: Fix unnecessary parameter copies in ParallelHelperPool.cpp
<https://webkit.org/b/192666>
<rdar://problem/46697952>

Reviewed by Alex Christensen.

* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient): Use rvalue
reference and WTFMove().
(WTF::ParallelHelperClient::setTask): Ditto.
(WTF::ParallelHelperClient::runTaskInParallel): Ditto.
(WTF::ParallelHelperClient::runTask): Use const reference.
* wtf/ParallelHelperPool.h: Update declarations to match
implementations.

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

10 months agoWeb Inspector: Table selection becomes corrupted when deleting selected cookies
mattbaker@apple.com [Thu, 13 Dec 2018 20:46:59 +0000 (20:46 +0000)]
Web Inspector: Table selection becomes corrupted when deleting selected cookies
https://bugs.webkit.org/show_bug.cgi?id=192388
<rdar://problem/46472364>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController):
(WI.SelectionController.prototype.didRemoveItems):
(WI.SelectionController.prototype._updateSelectedItems):
(WI.SelectionController.prototype.didRemoveItem): Deleted.
Replace `didRemoveItem` with a method taking an IndexSet. Calling the
single-index version while iterating over multiple rows in ascending
order is unsafe, a detail best left to the SelectionController.

* UserInterface/Views/Table.js:
(WI.Table.prototype.removeRow):
(WI.Table.prototype._removeRows):
Notify SelectionController of removed rows.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.insertChild):
(WI.TreeOutline.prototype.removeChildAtIndex):
Remove the child from the element's `children` after calling `_forgetTreeElement`,
which needs to calculate the child's index to pass to the SelectionController.

(WI.TreeOutline.prototype.removeChildren):
Remove child items during iteration so that `children` doesn't contain
detached TreeElements while calling `_forgetTreeElement`.

(WI.TreeOutline.prototype._rememberTreeElement):
(WI.TreeOutline.prototype._forgetTreeElement):

LayoutTests:

* inspector/table/table-remove-rows-expected.txt:
* inspector/table/table-remove-rows.html:

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

10 months agoDon't attempt to animate invalid CSS properties
bfulgham@apple.com [Thu, 13 Dec 2018 20:30:01 +0000 (20:30 +0000)]
Don't attempt to animate invalid CSS properties
https://bugs.webkit.org/show_bug.cgi?id=192630
<rdar://problem/46664433>

Reviewed by Antoine Quint.

Source/WebCore:

Inherited animation properties can cause child elements to think they need to animate CSS properties
that they do not support, leading to nullptr crashes.

Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it
cleanly.

Tests: animations/invalid-property-animation.html

* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):

LayoutTests:

* animations/invalid-property-animation-expected.txt: Added.
* animations/invalid-property-animation.html: Added.

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

10 months agoREGRESSION (r230064): Focus rings on webpages are fainter than in native UI.
timothy@apple.com [Thu, 13 Dec 2018 19:56:44 +0000 (19:56 +0000)]
REGRESSION (r230064): Focus rings on webpages are fainter than in native UI.
https://bugs.webkit.org/show_bug.cgi?id=192639
rdar://problem/42669297

Reviewed by Tim Horton.

The focus ring color passed to CoreGraphics is expected to be opaque, since they
will apply opacity when drawing (because opacity is normally animated).
We were getting this by accident before when the old `RenderThemeMac::systemColor()`
used the old `convertNSColorToColor()`, which ignored alpha on NSColor.
Existing tests use fixed test focus ring color.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto.
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`.
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`.
* rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color.
(WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here.

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

10 months agoUnreviewed -- update my status to "reviewer".
ross.kirsling@sony.com [Thu, 13 Dec 2018 19:07:52 +0000 (19:07 +0000)]
Unreviewed -- update my status to "reviewer".

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

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

10 months ago[macOS] Remove with-report from 3 services that are currently needed on macOS
pvollan@apple.com [Thu, 13 Dec 2018 18:08:54 +0000 (18:08 +0000)]
[macOS] Remove with-report from 3 services that are currently needed on macOS
https://bugs.webkit.org/show_bug.cgi?id=192593
<rdar://problem/46604752>

Reviewed by Brent Fulgham.

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

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

10 months ago[MediaStream] Calculate width or height when constraints contain only the other
eric.carlson@apple.com [Thu, 13 Dec 2018 17:22:06 +0000 (17:22 +0000)]
[MediaStream] Calculate width or height when constraints contain only the other
https://bugs.webkit.org/show_bug.cgi?id=192632
<rdar://problem/46665734>

Unreviewed, remove an unneeded assert.

* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers):

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

10 months agoUpdate Credit Card AutoFill button icon
commit-queue@webkit.org [Thu, 13 Dec 2018 17:04:16 +0000 (17:04 +0000)]
Update Credit Card AutoFill button icon
https://bugs.webkit.org/show_bug.cgi?id=192637
rdar://problem/46545006

Patch by Zach Li <zachli@apple.com> on 2018-12-13
Reviewed by Chris Dumez.

* css/html.css:
(input::-webkit-credit-card-auto-fill-button):

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

10 months agoOn page close, WebPage::m_userMediaPermissionRequestManager is nullified too early
youenn@apple.com [Thu, 13 Dec 2018 16:59:15 +0000 (16:59 +0000)]
On page close, WebPage::m_userMediaPermissionRequestManager is nullified too early
https://bugs.webkit.org/show_bug.cgi?id=192657

Reviewed by Eric Carlson.

Source/WebKit:

Instead of nullifying the manager, make it a UniqueRef and clear it on closing the page.
This ensures we revoke the sandbox extensions as early as possible and keep the manager lifetime simple.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager):
(WebKit::UserMediaPermissionRequestManager::clear):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userMediaPermissionRequestManager):

Tools:

Add a test that loads a page registering ondevicechange,
load another page in the same process, closes the first page.
Ensure that the process does not crash in that case.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI::didCrashCallback):
* TestWebKitAPI/Tests/WebKit/ondevicechange.html: Added.

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

10 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Thu, 13 Dec 2018 16:09:36 +0000 (16:09 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 6: Files in plugin process and UI process.

* PluginProcess/PluginControllerProxy.cpp:
* PluginProcess/PluginProcess.cpp:
* PluginProcess/WebProcessConnection.cpp:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/mac/WebPageProxyMac.mm:

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

10 months ago[MediaStream] Calculate width or height when constraints contain only the other
eric.carlson@apple.com [Thu, 13 Dec 2018 15:34:15 +0000 (15:34 +0000)]
[MediaStream] Calculate width or height when constraints contain only the other
https://bugs.webkit.org/show_bug.cgi?id=192632
<rdar://problem/46665734>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: fast/mediastream/constraint-intrinsic-size.html

* platform/graphics/RemoteVideoSample.cpp:
(WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR.

* platform/graphics/cv/ImageTransferSessionVT.h:
(WebCore::ImageTransferSessionVT::pixelFormat const): New.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size.
(WebCore::RealtimeMediaSource::setSize): Don't notify about width and height.
(WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary.
(WebCore::RealtimeMediaSource::setIntrinsicSize): New.
(WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable.

* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly.
(WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize().
(WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable.
(WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
(WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size.
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup.
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset):  Report intrinsic size.
(WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source.
* platform/mock/MockRealtimeVideoSource.h:

Source/WebKit:

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable): Deleted,
replaced with videoSampleAvailable.

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Use original frame
size if necessary when calculating new frame size.

LayoutTests:

* fast/mediastream/constraint-intrinsic-size-expected.txt: Added.
* fast/mediastream/constraint-intrinsic-size.html: Added.

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

10 months agoclang-tidy: loop variable is copied but only used as const reference in Document...
ddkilzer@apple.com [Thu, 13 Dec 2018 14:44:29 +0000 (14:44 +0000)]
clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
<https://webkit.org/b/192661>
<rdar://problem/46694035>

Reviewed by Daniel Bates.

* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::notifyIntersectionObserversTimerFired):
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::disconnectFromIntersectionObservers):
- Change loop variables from `auto` to `const auto&` to prevent
  unnecessary copies of WeakPtr<IntersectionObserver> or
  struct IntersectionObserverRegistration objects.

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

10 months ago[GStreamer][JHBuild] update-webkit{gtk,wpe}-libs fails with libfdk-2.0.0
commit-queue@webkit.org [Thu, 13 Dec 2018 12:35:17 +0000 (12:35 +0000)]
[GStreamer][JHBuild] update-webkit{gtk,wpe}-libs fails with libfdk-2.0.0
https://bugs.webkit.org/show_bug.cgi?id=192643

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-12-13
Reviewed by Philippe Normand.

This problem happens with Arch Linux users which have libfdk-2.0.0
installed (which is anybody with gst-plugins-bad 1.14.4 installed).

The problem has already been solved upstream at
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/77.

Adding patches while this problem is not in a release yet.

* gstreamer/jhbuild.modules: Add patches to fix build of gst-plugins-bad with libfdk-2.0.0.
* gstreamer/patches/gst-plugins-bad-0003-fdkaacenc-Remove-MODE_2_1.patch: Added.
* gstreamer/patches/gst-plugins-bad-0004-fdkaacdec-Use-WAV-channel-mapping-instead-of-interleave-setting.patch: Added.

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

10 months ago[BigInt] Add ValueDiv into DFG
ticaiolima@gmail.com [Thu, 13 Dec 2018 12:26:01 +0000 (12:26 +0000)]
[BigInt] Add ValueDiv into DFG
https://bugs.webkit.org/show_bug.cgi?id=186178

Reviewed by Yusuke Suzuki.

JSTests:

* stress/big-int-div-jit-osr.js: Added.
* stress/big-int-div-jit-untyped.js: Added.
* stress/value-div-fixup-int32-big-int.js: Added.

PerformanceTests:

* BigIntBench/big-int-simple-div.js: Added.
* BigIntBench/value-div-type-propagation.js: Added.

Source/JavaScriptCore:

This patch is introducing a new node type called ValueDiv. This node
is responsible to handle Untyped and Bigint specialization of division
operator, while the ArithDiv variant handles Number/Boolean cases.

BigInt specialization generates following speedup into simple
benchmark:

                          noSpec                 changes

big-int-simple-div    10.6013+-0.4682    ^    8.4518+-0.0943   ^ definitely 1.2543x faster

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeDivSafe):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupArithDiv):
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::arithNodeFlags):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileValueDiv):
(JSC::DFG::SpeculativeJIT::compileArithDiv):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileValueDiv):
(JSC::FTL::DFG::LowerDFGToB3::compileArithDiv):
(JSC::FTL::DFG::LowerDFGToB3::compileArithBitNot):

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

10 months ago[FreeType] Remove HarfBuzzFace
carlosgc@webkit.org [Thu, 13 Dec 2018 09:43:46 +0000 (09:43 +0000)]
[FreeType] Remove HarfBuzzFace
https://bugs.webkit.org/show_bug.cgi?id=192589

Reviewed by Michael Catanzaro.

Source/WebCore:

This was used to share the common implementation with the chromium port, but now that only freetype based ports
use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
since we are already caching glyphs in Font.

* platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
* platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
(WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
OpenType math.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::doubleToHarfBuzzPosition): Ditto.
(WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
(WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
* platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
* platform/graphics/harfbuzz/HbUniquePtr.h:
(WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().

LayoutTests:

Rebaseline test that now matches the firefox output.

* platform/gtk/mathml/opentype/opentype-stretchy-expected.png:
* platform/gtk/mathml/opentype/opentype-stretchy-expected.txt:

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

10 months ago[FreeType] Add initial implementation of variation fonts
carlosgc@webkit.org [Thu, 13 Dec 2018 09:17:31 +0000 (09:17 +0000)]
[FreeType] Add initial implementation of variation fonts
https://bugs.webkit.org/show_bug.cgi?id=192151

Reviewed by Michael Catanzaro.

.:

Enable variation fonts in GTK+ port when required dependencies are available.

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isFixedWidth const):
* platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
pattern.
(WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
(WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::defaultVariationValues): Parse font variations table.
(WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
* platform/graphics/freetype/FontCacheFreeType.h: Added.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
(WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
(WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
FC_FONT_VARIATIONS value from the pattern.
(WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
pattern.
(WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
(WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
(WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:

Tools:

Add cairo patch to avoid crashes.

* gtk/jhbuild.modules:
* gtk/patches/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch: Added.

LayoutTests:

Unskip variation fonts tests that are now passing in GTK+ port.

* platform/gtk/TestExpectations:

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

10 months agoUnreviewed, build fix after r239153, part 2
yusukesuzuki@slowstart.org [Thu, 13 Dec 2018 08:37:35 +0000 (08:37 +0000)]
Unreviewed, build fix after r239153, part 2
https://bugs.webkit.org/show_bug.cgi?id=190047

* runtime/StructureRareDataInlines.h:
(JSC::StructureRareData::cachedOwnKeys const):

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

10 months agoUnreviewed, build fix after r239153
yusukesuzuki@slowstart.org [Thu, 13 Dec 2018 08:06:30 +0000 (08:06 +0000)]
Unreviewed, build fix after r239153
https://bugs.webkit.org/show_bug.cgi?id=190047

* runtime/StructureRareDataInlines.h:
(JSC::StructureRareData::cachedOwnKeys const):

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

10 months ago[JSC] Optimize Object.keys by caching own keys results in StructureRareData
yusukesuzuki@slowstart.org [Thu, 13 Dec 2018 07:13:38 +0000 (07:13 +0000)]
[JSC] Optimize Object.keys by caching own keys results in StructureRareData
https://bugs.webkit.org/show_bug.cgi?id=190047

Reviewed by Keith Miller.

JSTests:

* stress/object-keys-cached-zero.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed-attribute.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed-index.js: Added.
(shouldBe):
(test):
* stress/object-keys-changed.js: Added.
(shouldBe):
(test):
* stress/object-keys-indexed-non-cache.js: Added.
(shouldBe):
(test):
* stress/object-keys-overrides-get-property-names.js: Added.
(shouldBe):
(test):
(noInline):

Source/JavaScriptCore:

Object.keys is one of the most frequently used function in web-tooling-benchmarks (WTB).
Object.keys is dominant in lebab of WTB, and frequently called in babel and others.
Since our Structure knows the shape of JSObject, we can cache the result of Object.keys
in Structure (StructureRareData) as we cache JSPropertyNameEnumerator in StructureRareData.

This patch caches the result of Object.keys in StructureRareData. The cached array is created
as JSImmutableButterfly. And Object.keys creates CoW from this data. Currently, the lifetime
strategy of this JSImmutableButterfly is the same to cached JSPropertyNameEnumerator. It is
referenced from Structure, and collected when Structure is collected.

This improves several benchmarks in SixSpeed.

                                baseline                  patched

    object-assign.es5      350.1710+-3.6303     ^    226.0368+-4.7558        ^ definitely 1.5492x faster
    for-of-object.es6      269.1941+-3.3430     ^    127.9317+-2.3875        ^ definitely 2.1042x faster

And it improves WTB lebab by 11.8%.

    Before: lebab:  6.10 runs/s
    After:  lebab:  6.82 runs/s

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToNewArrayBuffer):
* dfg/DFGNode.h:
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectKeys):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileObjectKeys):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/JSImmutableButterfly.h:
(JSC::JSImmutableButterfly::createSentinel):
* runtime/ObjectConstructor.cpp:
(JSC::ownPropertyKeys):
* runtime/Structure.cpp:
(JSC::Structure::canCachePropertyNameEnumerator const):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::setCachedOwnKeys):
(JSC::Structure::cachedOwnKeys const):
(JSC::Structure::canCacheOwnKeys const):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::visitChildren):
(JSC::StructureRareData::cachedPropertyNameEnumerator const): Deleted.
(JSC::StructureRareData::setCachedPropertyNameEnumerator): Deleted.
* runtime/StructureRareData.h:
* runtime/StructureRareDataInlines.h:
(JSC::StructureRareData::cachedPropertyNameEnumerator const):
(JSC::StructureRareData::setCachedPropertyNameEnumerator):
(JSC::StructureRareData::cachedOwnKeys const):
(JSC::StructureRareData::cachedOwnKeysConcurrently const):
(JSC::StructureRareData::setCachedOwnKeys):
(JSC::StructureRareData::previousID const): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

10 months ago[Win][Clang][WebKitLegacy] warning: expected a qualified name after 'typename' of...
Hironori.Fujii@sony.com [Thu, 13 Dec 2018 06:51:06 +0000 (06:51 +0000)]
[Win][Clang][WebKitLegacy] warning: expected a qualified name after 'typename' of COMEnumVariant and COMPropertyBag
https://bugs.webkit.org/show_bug.cgi?id=192617

Reviewed by Alex Christensen.

* COMEnumVariant.h:
(COMEnumVariant<ContainerType>::adopt): Removed 'typename' from non dependent names.
(COMEnumVariant<ContainerType>::createInstance): Ditto.
(COMEnumVariant<ContainerType>::Next): Prepend 'typename' for dependent names.
* COMPropertyBag.h:
(HashType>::createInstance): Removed 'typename' from non dependent names.
(HashType>::adopt): Ditto.
(HashType>::Read): Replaced dependent name 'HashMapType::const_iterator' with 'auto'.
(HashType>::GetPropertyInfo): Ditto.

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

10 months ago[Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFram...
Hironori.Fujii@sony.com [Thu, 13 Dec 2018 06:44:39 +0000 (06:44 +0000)]
[Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
https://bugs.webkit.org/show_bug.cgi?id=192618

Reviewed by Alex Christensen.

Source/WebCore:

No new tests, no behavior changes.

* platform/win/PopupMenuWin.h:
* platform/win/WCDataObject.cpp:
* platform/win/WCDataObject.h:

Source/WebKitLegacy/win:

Classes which implement COM interface usually doesn't need the
virtual destructor because it has Release() virtual method to
destruct itself.

Marked 'final' such classes to suppress clang-cl's compilation
warnings.

* COMEnumVariant.h:
* COMPropertyBag.h:
* DefaultDownloadDelegate.h:
* DefaultPolicyDelegate.h:
* MemoryStream.h:
* WebActionPropertyBag.h:
* WebApplicationCache.h:
* WebArchive.h:
* WebBackForwardList.h:
* WebCache.h:
* WebCoreStatistics.h:
* WebCoreSupport/WebEditorClient.cpp:
* WebCoreSupport/WebInspectorDelegate.h:
* WebDataSource.h:
* WebDatabaseManager.cpp:
* WebDatabaseManager.h:
* WebDownload.h:
* WebDropSource.h:
* WebElementPropertyBag.h:
* WebError.h:
* WebFrame.cpp:
* WebFrame.h:
* WebFramePolicyListener.h:
* WebGeolocationPolicyListener.h:
* WebGeolocationPosition.h:
* WebHTMLRepresentation.h:
* WebHistory.h:
* WebHistoryItem.h:
* WebInspector.h:
* WebJavaScriptCollector.h:
* WebKitClassFactory.h:
* WebKitMessageLoop.h:
* WebKitStatistics.h:
* WebMutableURLRequest.h:
* WebNavigationData.h:
* WebNotification.h:
* WebNotificationCenter.h:
* WebPreferences.h:
* WebResource.h:
* WebScriptWorld.h:
* WebSecurityOrigin.h:
* WebSerializedJSValue.h:
* WebTextRenderer.h:
* WebURLAuthenticationChallenge.h:
* WebURLAuthenticationChallengeSender.h:
* WebURLCredential.h:
* WebURLProtectionSpace.h:
* WebURLResponse.h:
* WebUserContentURLPattern.h:
* WebView.cpp:
* WebView.h:
* WebWorkersPrivate.h:

Tools:

* DumpRenderTree/win/DRTDataObject.cpp:
* DumpRenderTree/win/DRTDataObject.h:
* DumpRenderTree/win/DRTDesktopNotificationPresenter.h:
* DumpRenderTree/win/DRTDropSource.h:
* DumpRenderTree/win/EditingDelegate.h:
* DumpRenderTree/win/PolicyDelegate.h:
* DumpRenderTree/win/UIDelegate.h:

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

10 months agoREGRESSION (r238090): CAPCHA UI jumps to the wrong location
simon.fraser@apple.com [Thu, 13 Dec 2018 04:46:25 +0000 (04:46 +0000)]
REGRESSION (r238090): CAPCHA UI jumps to the wrong location
https://bugs.webkit.org/show_bug.cgi?id=192651
rdar://problem/46531919

Reviewed by Zalan Bujtas.

Source/WebCore:

When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
bit to say that descendants need their geometry updated (because they now have to
compute their positions relative to a different ancestor). This wasn't happening
in the layerStyleChanged() code path.

In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
we can address a FIXME and only dirty direct children, not all descendants (that code was
written before the child-only dirty bit existed).

Test: compositing/geometry/update-child-geometry-on-compositing-change.html

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

LayoutTests:

Testcase that makes an intermediate layer non-composited (but still a RenderLayer).

* compositing/geometry/update-child-geometry-on-compositing-change-expected.html: Added.
* compositing/geometry/update-child-geometry-on-compositing-change.html: Added.

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

10 months agoMake TextInputController.legacyAttributedString take DOM nodes and offsets
rniwa@webkit.org [Thu, 13 Dec 2018 03:54:13 +0000 (03:54 +0000)]
Make TextInputController.legacyAttributedString take DOM nodes and offsets
https://bugs.webkit.org/show_bug.cgi?id=192653

Reviewed by Wenson Hsieh.

Source/WebCore:

No new tests since there should be no observable behavioral change other than
TextInputController API in DumpRenderTree.

* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(WebCore::attributedStringFromSelection):
(WebCore::attributedStringBetweenStartAndEnd): Added.

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView _legacyAttributedStringFrom:offset:to:offset:]):

Tools:

Updated TextInputController.legacyAttributedString to take DOM nodes and offsets instead of
a DOM Range object in preparation to add layout tests for HTMLConverter which crosses
shadow boundaries.

* DumpRenderTree/mac/TextInputControllerMac.m:
(+[TextInputController isSelectorExcludedFromWebScript:]): Updated the selector signature.
(+[TextInputController webScriptNameForSelector:]): Ditto.
(-[TextInputController legacyAttributedString:offset:to:offset:]): Made this function take
start node and offset then end node and offset pairs.

LayoutTests:

Updated the tests per API change.

* editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html:
* editing/mac/attributed-string/resources/dump-attributed-string.js:
(dumpAttributedString):

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

10 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Thu, 13 Dec 2018 03:21:51 +0000 (03:21 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 5: Files in WebProcess folder.

* WebProcess/Cache/WebCacheStorageConnection.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

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

10 months agoFix macOS builds after r239145.
rniwa@webkit.org [Thu, 13 Dec 2018 03:15:13 +0000 (03:15 +0000)]
Fix macOS builds after r239145.

* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:

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

10 months agoREGRESSION (r238357): Pins on Yelp map disappear
simon.fraser@apple.com [Thu, 13 Dec 2018 02:35:10 +0000 (02:35 +0000)]
REGRESSION (r238357): Pins on Yelp map disappear
https://bugs.webkit.org/show_bug.cgi?id=192597
rdar://problem/46578285

Reviewed by Zalan Bujtas.
Source/WebCore:

RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained
a negative z-order child (triggering creation of a foreground layer), we'd fail to
call the "setChildren()" with the vector containing that foreground layer.

When updateBackingAndHierarchy() stops visiting descendants because none are composited,
it may still have to update the child list with the foreground layer, so make sure
the code handles this case.

Tests: compositing/z-order/add-negative-z-child.html
       compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html

* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):

LayoutTests:

Add tests that toggle negative z-index on a child, with and without sibling compositing layers.

* compositing/z-order/add-negative-z-child-expected.html: Added.
* compositing/z-order/add-negative-z-child.html: Added.
* compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer-expected.html: Added.
* compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html: Added.

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

10 months agoImplement non-timeslice mode encoding for MediaRecorder
commit-queue@webkit.org [Thu, 13 Dec 2018 02:34:19 +0000 (02:34 +0000)]
Implement non-timeslice mode encoding for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=192069
<rdar://problem/46443290>

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-12-12
Reviewed by Eric Carlson.

Source/WebCore:

Implement the encoding for non-timeslice mode of MediaRecorder.
It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
Add a API in internals to allow testings to turn on the mock source.

Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
(WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
(WebCore::MediaRecorder::getPrivateImpl):
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::stopRecordingInternal):
(WebCore::MediaRecorder::createRecordingDataBlob):
(WebCore::MediaRecorder::scheduleDeferredTask):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediarecorder/MediaRecorderPrivate.h:
(WebCore::MediaRecorderPrivate::stopRecording):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
(WebCore::MediaRecorderPrivateAVFImpl::create):
(WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
(WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
(WebCore::MediaRecorderPrivateAVFImpl::fetchData):
(WebCore::MediaRecorderPrivateAVFImpl::mimeType):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
* platform/mediarecorder/MediaRecorderPrivateMock.cpp:
(WebCore::MediaRecorderPrivateMock::fetchData):
(WebCore::MediaRecorderPrivateMock::mimeType):
* platform/mediarecorder/MediaRecorderPrivateMock.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added.
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
(WebCore::MediaRecorderPrivateWriter::clear):
(WebCore::MediaRecorderPrivateWriter::setupWriter):
(WebCore::MediaRecorderPrivateWriter::setVideoInput):
(WebCore::MediaRecorderPrivateWriter::setAudioInput):
(WebCore::copySampleBufferWithCurrentTimeStamp):
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::stopRecording):
* testing/Internals.cpp:
(WebCore::createRecorderMockSource):
(WebCore::Internals::setCustomPrivateRecorderCreator):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Create new tests for encoding of MediaRecorder. Check if the produced video and audio are correct.
Add code to turn on the mock source of MediaRecorder for the two old tests because the real source is enabled by default.

* http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-expected.txt: Added.
* http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html: Added.
* http/wpt/mediarecorder/MediaRecorder-dataavailable.html:
* http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html:

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

10 months ago[MSVC] Unreviewed build fix for r239080.
ross.kirsling@sony.com [Thu, 13 Dec 2018 02:28:52 +0000 (02:28 +0000)]
[MSVC] Unreviewed build fix for r239080.

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

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

10 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Thu, 13 Dec 2018 02:19:24 +0000 (02:19 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 4: Handling NetworkProcess folder.

* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:

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

10 months ago[DFG][FTL] Add NewSymbol
yusukesuzuki@slowstart.org [Thu, 13 Dec 2018 02:09:28 +0000 (02:09 +0000)]
[DFG][FTL] Add NewSymbol
https://bugs.webkit.org/show_bug.cgi?id=192620

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/symbol-creation.js: Added.
(test):
* stress/symbol-description-identity.js: Added.
(shouldBe):
(test):
* stress/symbol-identity.js: Added.
(shouldBe):
(test):
* stress/symbol-with-description-throw-error.js: Added.
(shouldBe):
(shouldThrow):
(test):
(object.toString):

Source/JavaScriptCore:

This patch introduces NewSymbol DFG node into DFG and FTL tiers. The main goal of this patch is not optimize
NewSymbol code faster. Rather than that, this patch intends to offer SpecSymbol type information into DFG's
data flow to optimize generated code in FTL backend.

We add NewSymbol DFG node, which may take an argument. If an argument is not given, NewSymbol is for `Symbol()`.
If an argument is given, ToString is emitted to this argument before passing it to NewSymbol. So NewSymbol node
itself does not perform any type checks. ToString performs effects, but NewSymbol doesn't have any side observable
effects. So we can decouple Symbol(description) call into NewSymbol(ToString(description)).

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGClobbersExitState.cpp:
(JSC::DFG::clobbersExitState):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGMayExit.cpp:
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewSymbol):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileNewSymbol):

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

10 months ago[BigInt] Implement DFG/FTL typeof for BigInt
yusukesuzuki@slowstart.org [Thu, 13 Dec 2018 02:01:37 +0000 (02:01 +0000)]
[BigInt] Implement DFG/FTL typeof for BigInt
https://bugs.webkit.org/show_bug.cgi?id=192619

Reviewed by Keith Miller.

JSTests:

* stress/big-int-boolean-proven-type.js: Added.
(assert):
(bool):
* stress/big-int-type-of-proven-type-non-constant-including-symbol.js: Added.
(assert):
(typeOf):
(i.switch):
* stress/big-int-type-of-proven-type-non-constant.js: Added.
(assert):
(typeOf):
* stress/big-int-type-of.js:
(typeOf):
(func):

Source/JavaScriptCore:

This patch implements typeof for BigInt in DFG and FTL. Our DFG and FTL tiers now correctly consider about BigInt
in the code generated for typeof.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::boolify): We add (SpecCell - SpecString) type filter for proven type since isString
check is already performed here.
(JSC::FTL::DFG::LowerDFGToB3::buildTypeOf): We use (SpecCell - SpecObject - SpecString) type filter for proven type
since String and Object are already checked here. If we know the proven type does not include Symbol type here, we
can omit the code for Symbol type.
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitTypeOf):

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

10 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Thu, 13 Dec 2018 01:32:58 +0000 (01:32 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Tim Horton.

Fix iosmac build.

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

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

10 months ago[WebGPU] Vertex buffers and WebGPUInputState
justin_fan@apple.com [Thu, 13 Dec 2018 01:26:32 +0000 (01:26 +0000)]
[WebGPU] Vertex buffers and WebGPUInputState
https://bugs.webkit.org/show_bug.cgi?id=192611

Reviewed by Dean Jackson.

Source/WebCore:

Test: webgpu/vertex-buffer-triangle-strip.html

Basic implementation of vertex buffers with Metal shading language in WebGPU. In
WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add
WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers.

Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode,
WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

Add and implement interfaces and dictionaries for WebGPUInputState:
* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::WebGPUBuffer):
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer.
* Modules/webgpu/WebGPUBufferDescriptor.h:
* Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUIndexFormat.h: Added.
* Modules/webgpu/WebGPUIndexFormat.idl: Added.
* Modules/webgpu/WebGPUInputStateDescriptor.h: Added.
* Modules/webgpu/WebGPUInputStateDescriptor.idl: Added.
* Modules/webgpu/WebGPUInputStepMode.h: Added.
* Modules/webgpu/WebGPUInputStepMode.idl: Added.
* Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added.
* Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added.
* Modules/webgpu/WebGPUVertexFormat.h: Added.
* Modules/webgpu/WebGPUVertexFormat.idl: Added.
* Modules/webgpu/WebGPUVertexInputDescriptor.h: Added.
* Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added.
* platform/graphics/gpu/GPUInputStateDescriptor.h: Added.
* platform/graphics/gpu/GPURenderPassEncoder.h: Added.
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added.
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added.
* platform/graphics/gpu/GPUVertexInputDescriptor.h: Added.

Refactor to support updated structure of pipeline descriptor in sketch IDL:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::validateAndConvertPipelineStage):
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUPipelineDescriptorBase.h:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
* Modules/webgpu/WebGPUPipelineStageDescriptor.h:
* Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Modules/webgpu/WebGPUShaderStage.*: Removed.

Add and implement setVertexBuffers:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added.
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):

LayoutTests:

Added variation of simple-triangle-strip to use a vertex buffer. Refactored aforementioned
test to share code with new test.

* webgpu/js/basic-webgpu-functions.js:
(setUpPipelineDescriptor):
* webgpu/js/webgpu-functions.js: Added.
(async.getBasicDevice):
(createBasicContext):
(createBasicPipeline):
(beginBasicRenderPass):
* webgpu/render-pipelines-expected.txt:
* webgpu/render-pipelines.html:
* webgpu/simple-triangle-strip.html:
* webgpu/vertex-buffer-triangle-strip-expected.html: Added.
* webgpu/vertex-buffer-triangle-strip.html: Added.

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

10 months agoREGRESSION: [ MacOS iOS ] Layout Test http/wpt/resource-timing/rt-revalidate-requests...
commit-queue@webkit.org [Thu, 13 Dec 2018 01:23:04 +0000 (01:23 +0000)]
REGRESSION: [ MacOS iOS ] Layout Test http/wpt/resource-timing/rt-revalidate-requests.html is flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=191207
<rdar://problem/45818891>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-12
Reviewed by Devin Rousso.

Splitting this test up into separate tests eliminated flakiness
and timeouts for my system that would occasionally encounter them.

* TestExpectations:
Remove expectation for the test now that splitting up eliminated flakiness so far.

* http/wpt/resource-timing/resources/rt-revalidate-utilities.sub.js
Common code for the split out tests.

* http/wpt/resource-timing/rt-revalidate-requests-1-expected.txt: Added.
* http/wpt/resource-timing/rt-revalidate-requests-1.html: Added.
* http/wpt/resource-timing/rt-revalidate-requests-2-expected.txt: Added.
* http/wpt/resource-timing/rt-revalidate-requests-2.html: Added.
* http/wpt/resource-timing/rt-revalidate-requests-3-expected.txt: Added.
* http/wpt/resource-timing/rt-revalidate-requests-3.html: Added.
* http/wpt/resource-timing/rt-revalidate-requests.html: Removed.
* http/wpt/resource-timing/rt-revalidate-requests-expected.txt: Removed.
Split out into separate tests.

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

10 months ago[Mojave Release Wk2] Layout Test http/tests/cache/disk-cache/disk-cache-validation...
cdumez@apple.com [Thu, 13 Dec 2018 01:19:22 +0000 (01:19 +0000)]
[Mojave Release Wk2] Layout Test http/tests/cache/disk-cache/disk-cache-validation-attachment.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=190323
<rdar://problem/45056253>

Reviewed by Youenn Fablet.

* http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-attachment.html:
Simplify test a bit to only test the header combinations it cares about.

* http/tests/cache/disk-cache/resources/cache-test.js:
(runTestsNow):
(runTests):
The flakiness was due to logic in CachedResourceLoader::determineRevalidationPolicy() which more aggressively
reuses cached resources (bypassing freshness checks) until the load event has fired. This means that the
test would give different results depending on whether or not the load event had a chance to fire before
we do the checks. To address the issue, update runTests() to wait for the load event if it has not yet
fired. This will likely address flakiness in other disk-cache tests as well.

* platform/mac-wk2/TestExpectations:
Unskip test that is no longer flaky.

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

10 months agoRecycling the m section should work if it was rejected remotely
youenn@apple.com [Thu, 13 Dec 2018 01:13:29 +0000 (01:13 +0000)]
Recycling the m section should work if it was rejected remotely
https://bugs.webkit.org/show_bug.cgi?id=192636

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Changes merged from https://webrtc.googlesource.com/src.git/+/5c72e71e14cfa76a2d1b0979d6b918abe187c208

* Source/webrtc/pc/mediasession.cc:
* Source/webrtc/pc/mediasession.h:
* Source/webrtc/pc/mediasession_unittest.cc:
* Source/webrtc/pc/peerconnection.cc:
* Source/webrtc/pc/peerconnection_jsep_unittest.cc:

LayoutTests:

* webrtc/msection-recycling-expected.txt: Added.
* webrtc/msection-recycling.html: Added.

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

10 months agoREGRESSION (r237565): >20 Find in Page highlights in one tile results in a single...
timothy_horton@apple.com [Thu, 13 Dec 2018 00:48:56 +0000 (00:48 +0000)]
REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight
https://bugs.webkit.org/show_bug.cgi?id=192642
<rdar://problem/46498246>

Reviewed by Geoffrey Garen.

Source/WebCore:

No new tests; adjusted an existing test instead.

* platform/graphics/PathUtilities.cpp:
(WebCore::PathUtilities::pathsWithShrinkWrappedRects):
Instead of uniting when we fail to shrink-wrap, just return the original rects.
This seems like a more reasonable default in most cases.

LayoutTests:

* fast/shrink-wrap/rect-shrink-wrap-expected.html:
* fast/shrink-wrap/rect-shrink-wrap.html:
Add a test case with >20 tiny rects.

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

10 months agoImplement safe browsing in WebKit on WatchOS
achristensen@apple.com [Thu, 13 Dec 2018 00:41:21 +0000 (00:41 +0000)]
Implement safe browsing in WebKit on WatchOS
https://bugs.webkit.org/show_bug.cgi?id=192641
<rdar://problem/46376188>

Reviewed by Geoff Garen.

Source/WebKit:

WatchOS has a few special requirements:
1. The margin size needs to be smaller and the title font smaller to fit on the screen.
2. The exclamation point cannot be beside the title or it won't fit on the screen.  I put it above the title.
3. The application must be told when the safe browsing warning has been shown.  I added a new delegate callback.
4. The UIScrollView's contentSize must be set even before the details are shown to be able to scroll down to the buttons.
   This was already an issue on small WKWebViews on iOS, so this fixes both operating systems.

* Configurations/WebKit.xcconfig:
* UIProcess/API/APIUIClient.h:
(API::UIClient::didShowSafeBrowsingWarning):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didShowSafeBrowsingWarning):
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontOfSize):
(buttonSize):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):
(-[WKSafeBrowsingWarning updateContentSize]):
(buttonWidth): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Source/WTF:

* wtf/Platform.h:
WatchOS has safe browsing, too!

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(-[SafeBrowsingNavigationDelegate _webViewDidShowSafeBrowsingWarning:]):
(safeBrowsingView):
Add a test that the new delegate callback is called.

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

10 months agoUnreviewed, rolling out r239129 and r239131.
commit-queue@webkit.org [Thu, 13 Dec 2018 00:30:13 +0000 (00:30 +0000)]
Unreviewed, rolling out r239129 and r239131.
https://bugs.webkit.org/show_bug.cgi?id=192646

Casued macOS and iOS Debug testing to fail early (Requested by
Truitt on #webkit).

Reverted changesets:

"Unreviewed build fix for WinCairo Debug after r239080(?)."
https://trac.webkit.org/changeset/239129

"Unreviewed fix for Cocoa Debug test instability following
r239129."
https://trac.webkit.org/changeset/239131

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

10 months agoHTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
commit-queue@webkit.org [Wed, 12 Dec 2018 23:57:10 +0000 (23:57 +0000)]
HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
https://bugs.webkit.org/show_bug.cgi?id=192375
<rdar://problem/45851159>

Patch by Vivek Seth <v_seth@apple.com> on 2018-12-12
Reviewed by Chris Dumez.

Use simulated redirect to tell clients that HTTPS Upgrade happened.

Source/WebCore:

* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::syntheticRedirectResponse):
* platform/network/ResourceResponseBase.h:
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):

Source/WebKit:

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler):
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
(WebKit::NetworkLoadChecker::checkRequest):
(WebKit::NetworkLoadChecker::continueCheckingRequestOrDoSyntheticRedirect):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded): Deleted.
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
* NetworkProcess/PingLoad.cpp:

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

10 months agoUnreviewed fix for Cocoa Debug test instability following r239129.
ross.kirsling@sony.com [Wed, 12 Dec 2018 23:42:24 +0000 (23:42 +0000)]
Unreviewed fix for Cocoa Debug test instability following r239129.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
Move the whole assertion to the declaration site.

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

10 months agoAdd a preference to enable / disable devicemotion and deviceorientation events
cdumez@apple.com [Wed, 12 Dec 2018 22:04:02 +0000 (22:04 +0000)]
Add a preference to enable / disable devicemotion and deviceorientation events
https://bugs.webkit.org/show_bug.cgi?id=192631
<rdar://problem/46646244>

Reviewed by Geoffrey Garen.

Add setting to toggle support for the deviceorientation / devicemotion events:
- https://w3c.github.io/deviceorientation/

Source/WebCore:

* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
* page/Settings.yaml:

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setDeviceOrientationEventEnabled:]):
(-[WKPreferences _deviceOrientationEventEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

10 months agoUnreviewed build fix for WinCairo Debug after r239080(?).
ross.kirsling@sony.com [Wed, 12 Dec 2018 21:44:07 +0000 (21:44 +0000)]
Unreviewed build fix for WinCairo Debug after r239080(?).

MSVC gives a redefinition error if noreturn is specified on the definition instead of the declaration.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
* UIProcess/WebPageProxy.h:
Move NO_RETURN_DUE_TO_ASSERT to the declaration site.

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

10 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Wed, 12 Dec 2018 21:21:55 +0000 (21:21 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 2: UIProcess/Cocoa and UIProcess/ios folders.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView dealloc]):
(-[WKContentView page]):
(-[WKContentView updateFixedClippingView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _updateForScreen:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _createDrawingAreaProxy]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
(hasAssistedNode):
(-[WKContentView setupInteraction]):
(-[WKContentView positionInformation]):
(-[WKContentView _webTouchEventsRecognized:]):
(inflateQuad):
(-[WKContentView _updateTapHighlight]):
(-[WKContentView _showTapHighlight]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView inputView]):
(-[WKContentView _actionForLongPressFromPositionInformation:]):
(-[WKContentView currentPositionInformation]):
(-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
(-[WKContentView _currentPositionInformationIsValidForRequest:]):
(-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
(-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _stylusSingleTapRecognized:]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _positionInformationDidChange:]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView supportedPasteboardTypesForCurrentSelection]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView selectForWebView:]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
(toGestureType):
(toUIWKGestureType):
(toSelectionTouch):
(toUIWKSelectionTouch):
(toGestureRecognizerState):
(toUIGestureRecognizerState):
(toUIWKSelectionFlags):
(toWKTextGranularity):
(toWKSelectionDirection):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView autocorrectionData]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView _updateAccessory]):
(-[WKContentView selectedTextRange]):
(-[WKContentView setMarkedText:selectedRange:]):
(coreWritingDirection):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView insertText:]):
(-[WKContentView textInputTraits]):
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
(-[WKContentView assistedNodeInformation]):
(-[WKContentView assistedNodeSelectOptions]):
(isAssistableInputType):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView updateCurrentAssistedNodeInformation:]):
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView selectWordForReplacement]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
(-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
(-[WKContentView _showRunOpenPanel:resultListener:]):
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView _startDrag:item:]):
(-[WKContentView _didHandleAdditionalDragItemsRequest:]):
(-[WKContentView _didHandleStartDataInteractionRequest:]):
(dropOperationForWebCoreDragOperation):
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView _prepareToDragPromisedAttachment:]):
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView _autofillContext]):
(-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKContentView _simulateLongPressActionAtLocation:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentationRectsForPreviewItemController:]):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _manager]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
(-[WKFullScreenWindowController isFullScreen]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController _completedExitFullScreen]):
(-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
(-[WKFullScreenWindowController _exitFullscreenImmediately]):
(-[WKFullScreenWindowController _manager]):

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

10 months agoMake HTMLConverter take two Positions in preparation to make it work with shadow DOM
rniwa@webkit.org [Wed, 12 Dec 2018 21:20:10 +0000 (21:20 +0000)]
Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=192613

Reviewed by Darin Adler.

This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
a selection which spans across shadow boundaries in the future.

No new tests since there should be no observable behavioral change.

* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
(WebCore::Editor::writeSelection): Ditto.
* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::HTMLConverter): Now takes two Position's.
(HTMLConverter::convert): Updated to work with Position's.
(HTMLConverter::_processText): Ditto.
(HTMLConverter::_traverseNode): Ditto.
(HTMLConverter::_traverseFooterNode): Ditto.
(HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
(WebCore::attributedStringFromRange): Ditto.
(WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
in order to preserve the exact behavior.

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

10 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Wed, 12 Dec 2018 19:15:58 +0000 (19:15 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 1: Files in Shared folder.

* Shared/API/c/WKRenderLayer.cpp:
(WKRenderLayerGetFrameContentsLayer):
* Shared/API/c/cf/WKErrorCF.cpp:
(WKErrorCreateWithCFError):
(WKErrorCopyCFError):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
(WKImageCreateFromCGImage):
* Shared/API/c/mac/WKWebArchive.cpp:
(WKWebArchiveGetTypeID):
(WKWebArchiveCreate):
(WKWebArchiveCreateWithData):
(WKWebArchiveCreateFromRange):
(WKWebArchiveCopyMainResource):
(WKWebArchiveCopySubresources):
(WKWebArchiveCopySubframeArchives):
(WKWebArchiveCopyData):
* Shared/API/c/mac/WKWebArchiveResource.cpp:
(WKWebArchiveResourceGetTypeID):
(WKWebArchiveResourceCreate):
(WKWebArchiveResourceCopyData):
(WKWebArchiveResourceCopyURL):
(WKWebArchiveResourceCopyMIMEType):
(WKWebArchiveResourceCopyTextEncoding):
* Shared/ChildProcess.cpp:
* Shared/ContextMenuContextData.cpp:
* Shared/EditorState.cpp:
* Shared/Plugins/NPIdentifierData.cpp:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
* Shared/SessionState.cpp:
* Shared/SessionTracker.cpp:
* Shared/ShareableBitmap.cpp:
* Shared/ShareableResource.cpp:
* Shared/VisibleContentRectUpdateInfo.cpp:
* Shared/WebBackForwardListItem.cpp:
* Shared/WebContextMenuItemData.cpp:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebHitTestResultData.cpp:
* Shared/WebImage.cpp:
* Shared/WebMediaSessionMetadata.cpp:
* Shared/WebMemorySampler.cpp:
* Shared/WebMouseEvent.cpp:
* Shared/WebRenderObject.cpp:
* Shared/WebSQLiteDatabaseTracker.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
* Shared/ios/WebPlatformTouchPointIOS.cpp:

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

10 months agoUnreviewed, fix changelog entries for previous commit
mcatanzaro@igalia.com [Wed, 12 Dec 2018 19:10:43 +0000 (19:10 +0000)]
Unreviewed, fix changelog entries for previous commit

I did not roll out r239114. I rolled out r239116.

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

10 months agoUnreviewed manual rollout of r239100-r239102 and r239114
mcatanzaro@igalia.com [Wed, 12 Dec 2018 19:02:53 +0000 (19:02 +0000)]
Unreviewed manual rollout of r239100-r239102 and r239114
https://bugs.webkit.org/show_bug.cgi?id=192151
<rdar://problem/46655586>

.:

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::platformDataFromCustomData):
* platform/FreeType.cmake:
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isFixedWidth const): Deleted.
* platform/graphics/cairo/FontCustomPlatformData.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::createFontPlatformData):
(WebCore::getFontPropertiesFromPattern): Deleted.
(WebCore::defaultVariationValues): Deleted.
(WebCore::buildVariationSettings): Deleted.
* platform/graphics/freetype/FontCacheFreeType.h: Removed.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):
(WebCore::FontCustomPlatformData::~FontCustomPlatformData):
(WebCore::FontCustomPlatformData::fontPlatformData):
(WebCore::FontCustomPlatformData::supportsFormat):
(WebCore::defaultFontconfigOptions): Deleted.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern):
(WebCore::getDefaultFontconfigOptions):
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::operator=):
(WebCore::FontPlatformData::harfBuzzFace const):
(WebCore::FontPlatformData::platformIsEqual const):
(WebCore::FontPlatformData::buildScaledFont):
(WebCore::FontPlatformData::fcPattern const): Deleted.
(WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont const):
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::fontFeatures):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
(WebCore::floatToHarfBuzzPosition): Deleted.
(WebCore::doubleToHarfBuzzPosition): Deleted.
(WebCore::harfBuzzFontFunctions): Deleted.
(WebCore::findScriptForVerticalGlyphSubstitution): Deleted.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added.
(WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
(WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
(WebCore::HarfBuzzFace::cache):
(WebCore::HarfBuzzFace::HarfBuzzFace):
(WebCore::HarfBuzzFace::~HarfBuzzFace):
(WebCore::findScriptForVerticalGlyphSubstitution):
(WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
* platform/graphics/harfbuzz/HarfBuzzFace.h: Added.
(WebCore::HarfBuzzFace::CacheEntry::create):
(WebCore::HarfBuzzFace::CacheEntry::face):
(WebCore::HarfBuzzFace::CacheEntry::glyphCache):
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added.
(WebCore::floatToHarfBuzzPosition):
(WebCore::doubleToHarfBuzzPosition):
(WebCore::CairoGetGlyphWidthAndExtents):
(WebCore::harfBuzzGetGlyph):
(WebCore::harfBuzzGetGlyphHorizontalAdvance):
(WebCore::harfBuzzGetGlyphHorizontalOrigin):
(WebCore::harfBuzzGetGlyphExtents):
(WebCore::harfBuzzCairoTextGetFontFuncs):
(WebCore::harfBuzzCairoGetTable):
(WebCore::HarfBuzzFace::createFace):
(WebCore::HarfBuzzFace::createFont):
* platform/graphics/harfbuzz/HbUniquePtr.h:
(WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted.
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData):
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

Tools:

* gtk/jhbuild.modules:
* gtk/patches/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch: Removed.

LayoutTests:

* platform/gtk/TestExpectations:
* platform/gtk/mathml/opentype/opentype-stretchy-expected.png:
* platform/gtk/mathml/opentype/opentype-stretchy-expected.txt:

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

10 months agoUnreviewed attempt to fix Windows Cairo build after r239100.
cdumez@apple.com [Wed, 12 Dec 2018 18:48:55 +0000 (18:48 +0000)]
Unreviewed attempt to fix Windows Cairo build after r239100.

* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

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

10 months agoUnreviewed build with with recent macOS SDKs.
cdumez@apple.com [Wed, 12 Dec 2018 18:44:27 +0000 (18:44 +0000)]
Unreviewed build with with recent macOS SDKs.

* Platform/cocoa/WKCrashReporter.mm:

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

10 months agoUnreviewed attempt to fix GTK build after r239104.
cdumez@apple.com [Wed, 12 Dec 2018 18:37:16 +0000 (18:37 +0000)]
Unreviewed attempt to fix GTK build after r239104.

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

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

10 months agoUnreviewed attempt to fix build with older SDKs after r239110.
cdumez@apple.com [Wed, 12 Dec 2018 18:23:50 +0000 (18:23 +0000)]
Unreviewed attempt to fix build with older SDKs after r239110.

* Platform/cocoa/WKCrashReporter.mm:

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

10 months agoUnreviewed, fix build with recent SDKs.
cdumez@apple.com [Wed, 12 Dec 2018 18:08:49 +0000 (18:08 +0000)]
Unreviewed, fix build with recent SDKs.

* Platform/cocoa/WKCrashReporter.mm:

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

10 months ago[iOS] A few API tests are failing after r239086
wenson_hsieh@apple.com [Wed, 12 Dec 2018 17:06:49 +0000 (17:06 +0000)]
[iOS] A few API tests are failing after r239086
https://bugs.webkit.org/show_bug.cgi?id=192608

Reviewed by Zalan Bujtas.

These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
the highest fidelity path using Vector::first().

While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.

* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readRespectingUTIFidelities):
(WebCore::Pasteboard::readFilePaths):

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

10 months ago[iOS] Zero memory containing the password for PDF documents when a WKPDFView is deall...
darin@apple.com [Wed, 12 Dec 2018 17:05:41 +0000 (17:05 +0000)]
[iOS] Zero memory containing the password for PDF documents when a WKPDFView is deallocated
https://bugs.webkit.org/show_bug.cgi?id=192536
rdar://problem/41174451

Reviewed by Tim Horton.

* UIProcess/ios/WKPDFView.mm: Took out PLATFORM(IOSMAC) since
this class is not compiled on that platform at this time. Can always
add it back later.
(-[WKPDFView dealloc]): Zero out characters of _passwordForPrinting.
(-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
Initialize _passwordForPrinting; use a CString instead of retaining
an NSString since we can zero that out easily.
(-[WKPDFView _ensureDocumentForPrinting]): Use _passwordForPrinting.

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

10 months agoUnreviewed, rolling out r239103.
commit-queue@webkit.org [Wed, 12 Dec 2018 16:28:51 +0000 (16:28 +0000)]
Unreviewed, rolling out r239103.
https://bugs.webkit.org/show_bug.cgi?id=192627

It broke the built because it depends on another patch that
didn't land yet (Requested by KaL on #webkit).

Reverted changeset:

"[WPE] Add API to notify about frame displayed view backend
callback"
https://bugs.webkit.org/show_bug.cgi?id=192224
https://trac.webkit.org/changeset/239103

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

10 months agoRestore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
cdumez@apple.com [Wed, 12 Dec 2018 16:01:00 +0000 (16:01 +0000)]
Restore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
https://bugs.webkit.org/show_bug.cgi?id=191982
<rdar://problem/46258054>

Reviewed by Alex Christensen.

Have the WebPageProxy remember the local paths it previously visited so that the
MESSAGE_CHECK_URL() checks still work when process-swap on navigation is enabled.

Add back MESSAGE_CHECK_URL() on sourceURL in didPerformClientRedirect().

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createFrontendPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
(WebKit::WebPageProxy::addPreviouslyVisitedPath):
(WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
* UIProcess/WebProcessProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:

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

10 months ago[WPE] Add API to notify about frame displayed view backend callback
carlosgc@webkit.org [Wed, 12 Dec 2018 10:59:03 +0000 (10:59 +0000)]
[WPE] Add API to notify about frame displayed view backend callback
https://bugs.webkit.org/show_bug.cgi?id=192224

Reviewed by Michael Catanzaro.

Source/WebKit:

Add API to add a callback to the view to be called when the view backend notifies that a frame has been
displayed.

* UIProcess/API/glib/WebKitWebView.cpp:
(FrameDisplayedCallback::FrameDisplayedCallback):
(FrameDisplayedCallback::~FrameDisplayedCallback):
(webkit_web_view_add_frame_displayed_callback):
(webkit_web_view_remove_frame_displayed_callback):
* UIProcess/API/wpe/WebKitWebView.h:

Tools:

Add a test case to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewFrameDisplayed):
(beforeAll):

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

10 months agoUnreviewed. Fix WPE build after r239101.
carlosgc@webkit.org [Wed, 12 Dec 2018 09:54:30 +0000 (09:54 +0000)]
Unreviewed. Fix WPE build after r239101.

* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>

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

10 months ago[FreeType] Remove HarfBuzzFace
carlosgc@webkit.org [Wed, 12 Dec 2018 09:19:48 +0000 (09:19 +0000)]
[FreeType] Remove HarfBuzzFace
https://bugs.webkit.org/show_bug.cgi?id=192589

Reviewed by Michael Catanzaro.

Source/WebCore:

This was used to share the common implementation with the chromium port, but now that only freetype based ports
use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
since we are already caching glyphs in Font.

* platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
* platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
(WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
OpenType math.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::doubleToHarfBuzzPosition): Ditto.
(WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
(WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
* platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
* platform/graphics/harfbuzz/HbUniquePtr.h:
(WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().

LayoutTests:

Rebaseline test that now matches the firefox output.

* platform/gtk/mathml/opentype/opentype-stretchy-expected.png:
* platform/gtk/mathml/opentype/opentype-stretchy-expected.txt:

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

10 months ago[FreeType] Add initial implementation of variation fonts
carlosgc@webkit.org [Wed, 12 Dec 2018 09:07:19 +0000 (09:07 +0000)]
[FreeType] Add initial implementation of variation fonts
https://bugs.webkit.org/show_bug.cgi?id=192151

Reviewed by Michael Catanzaro.

.:

Enable variation fonts in GTK+ port when required dependencies are available.

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isFixedWidth const):
* platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
pattern.
(WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
(WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::defaultVariationValues): Parse font variations table.
(WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
* platform/graphics/freetype/FontCacheFreeType.h: Added.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
(WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
(WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
FC_FONT_VARIATIONS value from the pattern.
(WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
pattern.
(WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
(WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
(WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:

Tools:

Add cairo patch to avoid crashes.

* gtk/jhbuild.modules:
* gtk/patches/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch: Added.

LayoutTests:

Unskip variation fonts tests that are now passing in GTK+ port.

* platform/gtk/TestExpectations:

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

10 months ago[BigInt] Simplify boolean context evaluation by leveraging JSString::offsetOfLength...
yusukesuzuki@slowstart.org [Wed, 12 Dec 2018 08:38:45 +0000 (08:38 +0000)]
[BigInt] Simplify boolean context evaluation by leveraging JSString::offsetOfLength() == JSBigInt::offsetOfLength()
https://bugs.webkit.org/show_bug.cgi?id=192615

Reviewed by Saam Barati.

JSString and JSBigInt have similar concept in terms of the implementation.
Both are immutable, JSCells, and have length information. m_length is located
just after JSCell header part, we can ensure `JSString::offsetOfLength() == JSBigInt::offsetOfLength()`,
and it allows us to optimize the boolean context evaluation.

This patch leverages the above information to reduce the code size for the boolean context evaluation.

* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::boolify):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitConvertValueToBoolean):
(JSC::AssemblyHelpers::branchIfValue):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::JSBigInt):
(JSC::JSBigInt::offsetOfLength): Deleted.
* runtime/JSBigInt.h:

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

10 months agoImplement feature flag for CSS Typed OM
justin_michaud@apple.com [Wed, 12 Dec 2018 05:54:17 +0000 (05:54 +0000)]
Implement feature flag for CSS Typed OM
https://bugs.webkit.org/show_bug.cgi?id=192610

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
* css/typedom/StylePropertyMapReadOnly.h:
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h:
* css/typedom/TypedOMCSSImageValue.idl:
* css/typedom/TypedOMCSSNumericValue.h:
* css/typedom/TypedOMCSSNumericValue.idl:
* css/typedom/TypedOMCSSStyleValue.h:
* css/typedom/TypedOMCSSStyleValue.idl:
* css/typedom/TypedOMCSSUnitValue.h:
* css/typedom/TypedOMCSSUnitValue.idl:
* css/typedom/TypedOMCSSUnparsedValue.h:
* css/typedom/TypedOMCSSUnparsedValue.idl:
* features.json:
* html/ImageBitmap.cpp:
* html/ImageBitmap.h:
* html/canvas/CanvasDrawImage.idl:
* html/canvas/CanvasFillStrokeStyles.idl:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* html/canvas/CanvasRenderingContext2DBase.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildAction):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
(WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
* page/WindowOrWorkerGlobalScope.idl:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

10 months ago[Win][WebKitLegacy][Clang] WebKit.h warning: 'IWebEditingDelegate2::shouldInsertNode...
Hironori.Fujii@sony.com [Wed, 12 Dec 2018 05:18:42 +0000 (05:18 +0000)]
[Win][WebKitLegacy][Clang] WebKit.h warning: 'IWebEditingDelegate2::shouldInsertNode' hides overloaded virtual function [-Woverloaded-virtual]
https://bugs.webkit.org/show_bug.cgi?id=192581

Reviewed by Alex Christensen.

Conventionally, WebKit COM interface adds a new interface with
same name methods with the old interface. For example, both
IWebEditingDelegate and IWebEditingDelegate2 interfaces has
shouldInsertNode method.

This is a part of public API, can't be renamed.

* PlatformWin.cmake: Added -Wno-overloaded-virtual compiler option
for WebKitLegacy

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

10 months agoconnectedCallback is invoked during the removal of the element inside another element...
rniwa@webkit.org [Wed, 12 Dec 2018 03:58:41 +0000 (03:58 +0000)]
connectedCallback is invoked during the removal of the element inside another element's connectedCallback
https://bugs.webkit.org/show_bug.cgi?id=183586
<rdar://problem/38403504>

Reviewed by Frédéric Wang.

Source/WebCore:

Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760

After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.

Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
    1. Let definition be element's custom element definition.
    2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
    3. If callback is null, then return
    4. If callbackName is "attributeChangedCallback", then:
        1. Let attributeName be the first element of args.
        2. If definition's observed attributes does not contain attributeName, then return.
    5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
       and arguments args.
    6. Enqueue an element on the appropriate element queue given element.

Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
(WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
* dom/CustomElementReactionQueue.h:

LayoutTests:

Added a W3C style testharness test.

* fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback-expected.txt: Added.
* fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html: Added.

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

10 months agoUnreviewed, fix bad check in API test added in r239080.
cdumez@apple.com [Wed, 12 Dec 2018 02:54:17 +0000 (02:54 +0000)]
Unreviewed, fix bad check in API test added in r239080.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

10 months agoSource/WebCore:
justin_fan@apple.com [Wed, 12 Dec 2018 01:40:06 +0000 (01:40 +0000)]
Source/WebCore:
[WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
https://bugs.webkit.org/show_bug.cgi?id=192516

Reviewed by Dean Jackson.

Test: webgpu/buffers.html

Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.

Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

* Modules/webgpu/WebGPUBuffer.cpp: Added.
(WebCore::WebGPUBuffer::create):
(WebCore::WebGPUBuffer::WebGPUBuffer):
* Modules/webgpu/WebGPUBuffer.h: Added.
(WebCore::WebGPUBuffer::mapping const):
(WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
(WebCore::WebGPUBuffer::destroy): Unimplemented stub.
* Modules/webgpu/WebGPUBuffer.idl: Added.
* Modules/webgpu/WebGPUBufferDescriptor.h: Added.
* Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const): Added.
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::platformBuffer const):
(WebCore::GPUBuffer::mapping const):
* platform/graphics/gpu/GPUBufferDescriptor.h: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createBuffer const): Added.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
(WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.

Small benign edits, most to make nullability more consistent in WebGPU classes:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline const):
(WebCore::WebGPUDevice::createCommandBuffer const):
* Modules/webgpu/WebGPUDevice.h:
(WebCore::WebGPUDevice::device const):
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::create):
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::create):
(WebCore::WebGPUShaderModule::WebGPUShaderModule):
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::create):
(WebCore::WebGPUTexture::createDefaultTextureView):
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::create):
* Modules/webgpu/WebGPUTextureView.h:
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::create):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::create):
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::setDevice):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):

LayoutTests:
[WebGPU] Implement WebGPUBuffer
https://bugs.webkit.org/show_bug.cgi?id=192516

Reviewed by Dean Jackson.

Basic test to create a WebGPUBuffer and ensure that its memory is valid.

* webgpu/buffers-expected.txt: Added.
* webgpu/buffers.html: Added.

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