WebKit-https.git
8 months ago[WPE] Do not use a sync IPC message to send the host FD to the web process
carlosgc@webkit.org [Mon, 11 Feb 2019 08:12:04 +0000 (08:12 +0000)]
[WPE] Do not use a sync IPC message to send the host FD to the web process
https://bugs.webkit.org/show_bug.cgi?id=194216

Reviewed by Darin Adler.

It can be sent as a web page creation parameter instead.

* PlatformWPE.cmake:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* SourcesWPE.txt:
* UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.h: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::hostFileDescriptor):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::create):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::releaseHostFileDescriptor):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
(WebKit::AcceleratedSurfaceWPE::initialize):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
* WebProcess/WebPage/wpe/CompositingManager.cpp: Removed.
* WebProcess/WebPage/wpe/CompositingManager.h: Removed.

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

8 months agoUnreviewed WPE gardening. Adding additional baselines after font variations
zandobersek@gmail.com [Mon, 11 Feb 2019 08:06:48 +0000 (08:06 +0000)]
Unreviewed WPE gardening. Adding additional baselines after font variations
enablement. Additionally rebaselining a couple other WPT and WebGL tests.

* platform/wpe/TestExpectations:
* platform/wpe/fast/css/getComputedStyle: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-expected.txt: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-font-family-expected.txt: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Added.
* platform/wpe/fast/dom/52776-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/wpe/svg/css/getComputedStyle-basic-expected.txt: Added.
* platform/wpe/webgl/2.0.0/conformance/canvas/buffer-offscreen-test-expected.txt:
* platform/wpe/webgl/2.0.0/conformance/canvas/buffer-preserve-test-expected.txt:
* platform/wpe/webgl/2.0.0/conformance/context/context-attribute-preserve-drawing-buffer-expected.txt:

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

8 months ago[GTK][WPE] Add enable-javascript-markup setting
carlosgc@webkit.org [Mon, 11 Feb 2019 06:36:04 +0000 (06:36 +0000)]
[GTK][WPE] Add enable-javascript-markup setting
https://bugs.webkit.org/show_bug.cgi?id=193439

Reviewed by Michael Catanzaro.

Source/WebKit:

Expose JavaScriptMarkupEnabled setting in the GLib API.

* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_javascript_markup):
(webkit_settings_set_enable_javascript_markup):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:

Tools:

Add test cases to check the new setting.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings):
(testWebKitSettingsJavaScriptMarkup):
(beforeAll):

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

8 months ago[LFC] Fix spelling error.
zalan@apple.com [Mon, 11 Feb 2019 06:17:53 +0000 (06:17 +0000)]
[LFC] Fix spelling error.
https://bugs.webkit.org/show_bug.cgi?id=194489

Reviewed by Simon Fraser.

instrinsic -> intrinsic

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
(WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

8 months agoSwitch uses of StringBuilder with String::format for hex numbers to use HexNumber...
darin@apple.com [Mon, 11 Feb 2019 06:02:05 +0000 (06:02 +0000)]
Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
https://bugs.webkit.org/show_bug.cgi?id=194485

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json): Use appendUnsignedAsHex along with
reinterpret_cast<uintptr_t> to replace uses of String::format with "%p".

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::encode): Removed some unneeded casts in StringBuilder code,
including one in a call to appendByteAsHex.
(JSC::globalFuncEscape): Ditto.

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.

* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize const): Fixed style of many return statements
that called a function returning void; doesn't match WebKit's prevailing style.
Also use break instead of return. Used appendLiteral instead of append in many
cases, and append character instead of single-character literal in others.
Use appendUnsignedAsHex instead of String::format.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
Should come back here and use makeString once we make HexNumber.h work with that.

* platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.

* rendering/RenderTreeAsText.cpp:
(WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
to character append. Touched because it was next to a call to appendUnsignedAsHex.

Source/WebKit:

* UIProcess/DeviceIdHashSaltStorage.cpp:
(WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use
appendUnsignedAsHex instead of appendUnsigned64AsHex.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and
reinterpret_cast<uintptr_t> instead of String::format and "%p".

Source/WTF:

* wtf/HexNumber.h: Removed unused functions placeByteAsHexCompressIfPossible and
placeByteAsHex. Can always bring them back if someone needs them. Updated
appendUnsignedAsHex to be a template so we can use it on any integer type,
got rid of unnecessary use of Vector and unnecessary reversing, and got rid of
appendUnsigned64AsHex since callers can now just use appendUnsignedAsHex.
Rewrote appendUnsignedAsHexFixedSize to share mode code rather than replicating.

* wtf/Logger.h: Use appendUnsignedAsHex instead of appendUnsigned64AsHex.

* wtf/URL.cpp: Removed unnecessary include of HexNumber.h.

* wtf/cocoa/NSURLExtras.h: Added missing include of Foundation.h that was
worked around in NSURLExtras.mm.
* wtf/cocoa/NSURLExtras.mm: Removed unnecessary includes of HexNumber.h
and Foundation.h.

Tools:

* WebKitTestRunner/TestController.cpp: Removed unnecessary include of HexNumber.h.

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

8 months agoUnreviewed, rolling out r241230.
commit-queue@webkit.org [Mon, 11 Feb 2019 04:10:08 +0000 (04:10 +0000)]
Unreviewed, rolling out r241230.
https://bugs.webkit.org/show_bug.cgi?id=194488

"It regressed JetStream2 by ~6%" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"We should only make rope strings when concatenating strings
long enough."
https://bugs.webkit.org/show_bug.cgi?id=194465
https://trac.webkit.org/changeset/241230

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

8 months agoBBQ-Air: Emit better code for switch
sbarati@apple.com [Mon, 11 Feb 2019 03:25:52 +0000 (03:25 +0000)]
BBQ-Air: Emit better code for switch
https://bugs.webkit.org/show_bug.cgi?id=194053

Reviewed by Yusuke Suzuki.

Instead of emitting a linear set of jumps for Switch, this patch
makes the BBQ-Air backend emit a binary switch.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::addSwitch):

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

8 months agolibWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
commit-queue@webkit.org [Mon, 11 Feb 2019 00:29:36 +0000 (00:29 +0000)]
libWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
https://bugs.webkit.org/show_bug.cgi?id=194484

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-02-10
Reviewed by Darin Adler.

* bindings/js/JSUndoItemCustom.cpp:

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

8 months agoUnreviewed, rolling out r241167.
commit-queue@webkit.org [Sun, 10 Feb 2019 19:44:33 +0000 (19:44 +0000)]
Unreviewed, rolling out r241167.
https://bugs.webkit.org/show_bug.cgi?id=194482

Broke the GTK mediastream tests (Requested by philn on
#webkit).

Reverted changeset:

"Filter out Overconstrainederror.constraint when getUserMedia
is not granted"
https://bugs.webkit.org/show_bug.cgi?id=194240
https://trac.webkit.org/changeset/241167

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

8 months agoUnreviewed, GTK Debug build fix after r241148.
philn@webkit.org [Sun, 10 Feb 2019 19:34:10 +0000 (19:34 +0000)]
Unreviewed, GTK Debug build fix after r241148.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
SourceBuffer::logClassName and friends are declared for
!RELEASE_LOG_DISABLED builds so adapt calling sites accordingly.

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

8 months ago[LFC][IFC] Add intrinsic width support for inline-block boxes
zalan@apple.com [Sun, 10 Feb 2019 18:03:52 +0000 (18:03 +0000)]
[LFC][IFC] Add intrinsic width support for inline-block boxes
https://bugs.webkit.org/show_bug.cgi?id=194479

Reviewed by Antti Koivisto.

Compute the intrinsic width for the inline-block (formatting context root) and set it as the content box width while
laying out the content for the min/max width.

<div style="position: absolute">before<span id=inline-block style="display: inline-block">inline_block content<span>after</div>

The "inline-block" formatting root returns "inline_block" width for the minimum and "inline_block width" for
the maximum width. These min/max values are used to figure out the intrinsic width for the parent <div>.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
* layout/inlineformatting/InlineFormattingContext.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

8 months ago[LFC][IFC] Add intrinsic width support for replaced boxes
zalan@apple.com [Sun, 10 Feb 2019 16:53:41 +0000 (16:53 +0000)]
[LFC][IFC] Add intrinsic width support for replaced boxes
https://bugs.webkit.org/show_bug.cgi?id=194478

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

8 months ago[MSE][GStreamer] Add missing return type to lambda
aboya@igalia.com [Sun, 10 Feb 2019 14:38:26 +0000 (14:38 +0000)]
[MSE][GStreamer] Add missing return type to lambda
https://bugs.webkit.org/show_bug.cgi?id=194414

Reviewed by Darin Adler.

Since g_signal_connect() is untyped, a compiler error was not
generated when a lambda with a missing GstFlowReturn return type was
provided for a signal that expects it.

This used to work before r240784 because a recent function call had
set GST_FLOW_OK in the return value register and it happened to
survive until the lambda function call ended. Starting on that commit
such return value was removed and it stopped working on debug.

Of course, the actual problem is in the signature of the lambda
function, and this patch fixes that.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):

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

8 months agoAdd more tests for clampTo<>()
benjamin@webkit.org [Sun, 10 Feb 2019 00:41:55 +0000 (00:41 +0000)]
Add more tests for clampTo<>()
https://bugs.webkit.org/show_bug.cgi?id=194462

Reviewed by Geoffrey Garen.

Darin suggested to test the very last floating point number
at the boundaries when truncating to integer.
I added test for max/min and max-1/min-1.

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

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

8 months agoUnreviewed, Lexer should use isLatin1 implementation in WTF
ysuzuki@apple.com [Sat, 9 Feb 2019 23:16:01 +0000 (23:16 +0000)]
Unreviewed, Lexer should use isLatin1 implementation in WTF
https://bugs.webkit.org/show_bug.cgi?id=194466

Follow-up after r241233 pointed by Darin.

* parser/Lexer.cpp:
(JSC::isLatin1): Deleted.

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

8 months agoFix change log dates; I thought webkit-patch land would do it for me
darin@apple.com [Sat, 9 Feb 2019 21:00:10 +0000 (21:00 +0000)]
Fix change log dates; I thought webkit-patch land would do it for me

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

8 months agoEliminate unnecessary String temporaries by using StringConcatenateNumbers
darin@apple.com [Sat, 9 Feb 2019 21:00:05 +0000 (21:00 +0000)]
Eliminate unnecessary String temporaries by using StringConcatenateNumbers
https://bugs.webkit.org/show_bug.cgi?id=194021

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::count): Remove String::number and let
makeString do the conversion without allocating/destroying a String.
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::objectGroupForBreakpointAction): Ditto.
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl): Ditto.
(Inspector::InspectorDebuggerAgent::setBreakpoint): Ditto.
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty): Ditto.
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToFixed): Use String::numberToStringFixedWidth instead
of calling numberToFixedWidthString to do the same thing.
(JSC::numberProtoFuncToPrecision): Use String::number instead of calling
numberToFixedPrecisionString to do the same thing.
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::reportTopFunctions): Ditto.

Source/WebCore:

For floating point numbers, String::number gives a fixed precision result,
stripping trailing zeroes. When possible, I changed the code to instead use the
equivalent of String::numberToStringECMAScript, which is what makeString does by
default for floating point, gives the same results for many cases, and gives
better results in many others. However, for floats, we do not yet have a good
implementation, so instead I used FormattedNumber::fixedPrecision to match
the old behavior.

* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::loggingString const): Remove String::number and let
makeString do the conversion without allocating/destroying a String.
* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create): Ditto.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Ditto. Added a cast to "unsigned" to sidestep the
ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
and sometimes used for UTF-16 code units (UChar) and can be the same type.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didFailSocketStream): Use ASCIILiteral when intializing
a string instead of just a normal C literal. Switched to makeString so we could
remove String::number and do the conversion without allocating/destroying a String.
(WebCore::WebSocketChannel::didFail): Ditto.
(WebCore::WebSocketChannel::processFrame): Ditto.
* Modules/websockets/WebSocketFrame.cpp:
(WebCore::WebSocketFrame::parseFrame): Ditto.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readServerHandshake): Ditto.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Ditto.
* bindings/js/JSDOMConvertNumbers.cpp:
(WebCore::rangeErrorString): Ditto.
* css/CSSAspectRatioValue.cpp:
(WebCore::CSSAspectRatioValue::customCSSText const): Ditto. Used
FormattedNumber::fixedPrecision since these are floats.

* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::toString const): Use
StringBuilder::builder.appendECMAScriptNumber instead of
String::numberToStringECMAScript so we can do it without allocating/destroying
a String.
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::toString const): Ditto.

* dom/MessagePortIdentifier.h:
(WebCore::MessagePortIdentifier::logString const): Remove String::number and let
makeString do the conversion without allocating/destroying a String.

* editing/cocoa/DataDetection.mm:
(WebCore::dataDetectorStringForPath): Remove unnecessary type casts on values
passed to String::number and to StringBuilder::appendNumber. These could do
harm if the values were out of range, and should not be necessary.

* history/BackForwardItemIdentifier.h:
(WebCore::BackForwardItemIdentifier::logString const): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
(WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Ditto.
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didReceiveResponse): Ditto.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFailLoadingManifest): Ditto.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::urlForBlankFrame): Ditto.
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Ditto.
(WebCore::PrintContext::pageSizeAndMarginsInPixels): Ditto.

* page/WheelEventTestTrigger.cpp:
(WebCore::dumpState): Use StringBuilder::appendNumber instead of
String::number so we can do it without allocating/destroying a String.
Also use StringBuilder::appendLiteral on a literal.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Pass explicit
KeepTrailingZeros to FormattedNumber::fixedPrecision to preserve behavior,
since default is now to truncate trailing zeros.

* platform/graphics/Color.cpp:
(WebCore::Color::cssText): Use StringBuilder::appendNumber instead of
calling numberToFixedPrecisionString to do the same thing.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Ditto.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationIdentifier): Remove String::number and let makeString
do the conversion without allocating/destroying a String. Had to add
a typecast to convert the enumeration into an integer.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::setFiltersOnLayer): Ditto.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::description const): Ditto.

* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockMediaSample::MockMediaSample): Use AtomicString::number
instead of String::number to avoid unneccessarily allocating an additional
temporary String when an AtomicString already exists.

* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::reportErrorToClient): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setMaximumSize): Ditto.
(WebCore::SQLiteDatabase::setSynchronous): Ditto. Had to add a typecast to
convert the enumeration into an integer.
* svg/SVGAngleValue.cpp:
(WebCore::SVGAngleValue::valueAsString const): Ditto.
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::valueAsString const): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::configurationForViewport): Ditto. Used
FormattedNumber::fixedPrecision since these are floats.
(WebCore::Internals::getCurrentCursorInfo): Use StringBuilder::appendNumber
instead of calling numberToFixedPrecisionString to do the same thing.
(WebCore::Internals::queueMicroTask): Remove String::number and let makeString
do the conversion without allocating/destroying a String.
(WebCore::appendOffsets): Use StringBuilder::appendNumber instead of
String::number so we can do it without allocating/destroying a String.

* workers/service/ServiceWorkerClientIdentifier.h:
(WebCore::ServiceWorkerClientIdentifier::toString const): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::databaseFilenameFromVersion): Ditto.

Source/WebKit:

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::escapeIDForJSON): Use an ASCIILiteral to create a String.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeVersionedDirectoryPath): Remove String::number and let
makeString do the conversion without allocating/destroying a String.

* NetworkProcess/mac/RemoteNetworkingContext.mm: Removed "using namespace WebCore".
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): Remove String::number
and let makeString do the conversion without allocating/destroying a String.

* NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Removed "using namespace WebCore".
(WebKit::registerMDNSNameCallback): Added explicit WebCore prefix as needed.
(WebKit::NetworkMDNSRegister::registerMDNSName): Ditto. Also remove String::number
and let makeString do the conversion without allocating/destroying a String.

* UIProcess/WebPageGroup.cpp:
(WebKit::pageGroupData): Remove String::number and let makeString do the conversion
without allocating/destroying a String.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createInspectorTargets): Ditto.
* UIProcess/ios/WKLegacyPDFView.mm:
(-[WKLegacyPDFView _URLForLinkAnnotation:]): Ditto.
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
(WebKit::uniqueWorldName): Ditto.
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::identifier const): Ditto.

Source/WTF:

* wtf/URL.cpp:
(WTF::URL::setPort): Remove String::number and let makeString do the conversion
without allocating/destroying a String. Added a cast to "unsigned" to sidestep the
ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
and sometimes used for UTF-16 code units (UChar) and can be the same type.

* wtf/text/StringConcatenateNumbers.h:
Changed FormattedNumber::fixedPrecision to more closely match String::number and
StringBuilder::appendNumber by defaulting to truncating trailing zeros and using
a named enumeration for the truncation policy rather than a boolean.

Tools:

* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST): Change tests to use EXPECT_STREQ so failure messages are easier
to understand. Updated tests for changes to FormattedNumber::fixedPrecision.

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

8 months ago[LFC][IFC] Add intrinsic width support for basic inline containers
zalan@apple.com [Sat, 9 Feb 2019 20:37:03 +0000 (20:37 +0000)]
[LFC][IFC] Add intrinsic width support for basic inline containers
https://bugs.webkit.org/show_bug.cgi?id=194473

Reviewed by Antti Koivisto.

Source/WebCore:

Preferred width computation logic is very similar to normal layout.
One of the main difference is that the preferred width codepath does not provide valid containing block width.
This patch implement basic inline container support by passing nullopt containing block width in UsedHorizontalValues.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
* layout/inlineformatting/InlineFormattingContext.h:

Tools:

Expand tests coverage (11 new tests -> 798)

* LayoutReloaded/misc/LFC-passing-tests.txt: not sure why run-singly keeps producing different ordering.

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

8 months agoUnreviewed, rolling in r241237 again
ysuzuki@apple.com [Sat, 9 Feb 2019 19:44:06 +0000 (19:44 +0000)]
Unreviewed, rolling in r241237 again
https://bugs.webkit.org/show_bug.cgi?id=194469

Source/JavaScriptCore:

* runtime/JSString.h:
(JSC::jsSubstring):

Source/WTF:

After the measurement, this patch was unrelated to recent regression.

* wtf/text/StringImpl.h:
(WTF::StringImpl::isSubString const):
(WTF::StringImpl::createSubstringSharingImpl):

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

8 months agoUnreviewed, rolling out r241237.
commit-queue@webkit.org [Sat, 9 Feb 2019 17:52:38 +0000 (17:52 +0000)]
Unreviewed, rolling out r241237.
https://bugs.webkit.org/show_bug.cgi?id=194474

Shows significant memory increase in WSL (Requested by
yusukesuzuki on #webkit).

Reverted changeset:

"[WTF] Use BufferInternal StringImpl if substring StringImpl
takes more memory"
https://bugs.webkit.org/show_bug.cgi?id=194469
https://trac.webkit.org/changeset/241237

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

8 months ago[GTK] Fix typo in the newly added API
mcatanzaro@igalia.com [Sat, 9 Feb 2019 16:04:09 +0000 (16:04 +0000)]
[GTK] Fix typo in the newly added API
https://bugs.webkit.org/show_bug.cgi?id=194472

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

Fix a typo: enableed -> enabled.

* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_set_enable_back_forward_navigation_gestures):
* UIProcess/API/gtk/WebKitSettings.h:

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

8 months agoWeb Inspector: fix typos in tests
nvasilyev@apple.com [Sat, 9 Feb 2019 09:39:20 +0000 (09:39 +0000)]
Web Inspector: fix typos in tests

Unreviewed test gardening.

* inspector/css/force-page-appearance.html:

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

8 months agoFix MiniBrowser's entitlements
benjamin@webkit.org [Sat, 9 Feb 2019 08:11:04 +0000 (08:11 +0000)]
Fix MiniBrowser's entitlements
https://bugs.webkit.org/show_bug.cgi?id=192431

Reviewed by Joseph Pecoraro.

MiniBrowser's Extensions Manager was broken. The entitlement was missing for opening
files, making it impossible to load any extension.

* MiniBrowser/MiniBrowser.entitlements:

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

8 months ago[WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
ysuzuki@apple.com [Sat, 9 Feb 2019 07:58:01 +0000 (07:58 +0000)]
[WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
https://bugs.webkit.org/show_bug.cgi?id=194469

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/JSString.h:
(JSC::jsSubstring):

Source/WTF:

Because pointer is large and aligned in 64bit in 64bit architecture, BufferSubstring StringImpl
implementation takes more memory than BufferInternal StringImpl implementation for small strings.
And BufferInternal StringImpl does not have a problem like, small substring StringImpl keeps super
large owner StringImpl. This patch calculates the required size of memory and selects the more efficient one.

* wtf/text/StringImpl.h:
(WTF::StringImpl::isSubString const):
(WTF::StringImpl::createSubstringSharingImpl):

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

8 months ago[JSC] CachedTypes should use jsString instead of JSString::create
ysuzuki@apple.com [Sat, 9 Feb 2019 07:43:26 +0000 (07:43 +0000)]
[JSC] CachedTypes should use jsString instead of JSString::create
https://bugs.webkit.org/show_bug.cgi?id=194471

Reviewed by Mark Lam.

Use jsString() here because JSString::create is a bit low-level API and it requires some invariant like "length is not zero".

* runtime/CachedTypes.cpp:
(JSC::CachedJSValue::decode const):

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

8 months agoSpeculative fix for Mojave API test after r241223
achristensen@apple.com [Sat, 9 Feb 2019 07:04:47 +0000 (07:04 +0000)]
Speculative fix for Mojave API test after r241223
https://bugs.webkit.org/show_bug.cgi?id=194427

* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
Set the __APPLEEVENTSSERVICENAME environment variable before handling any xpc messages like we used to.
I'll worry about making things right in the daemon later.

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

8 months ago[JSC] Increase StructureIDTable initial capacity
ysuzuki@apple.com [Sat, 9 Feb 2019 07:01:14 +0000 (07:01 +0000)]
[JSC] Increase StructureIDTable initial capacity
https://bugs.webkit.org/show_bug.cgi?id=194468

Reviewed by Mark Lam.

Currently, # of structures just after initializing JSGlobalObject (precisely, initializing GlobalObject in
JSC shell), 281, already exceeds the current initial value 256. We should increase the capacity since
unnecessary resizing requires more operations, keeps old StructureID array until GC happens, and makes
more memory dirty. We also remove some structures that are no longer used.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::callbackObjectStructure const):
(JSC::JSGlobalObject::propertyNameIteratorStructure const): Deleted.
* runtime/StructureIDTable.h:
* runtime/VM.h:

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

8 months ago[JSC] String.fromCharCode's slow path always generates 16bit string
ysuzuki@apple.com [Sat, 9 Feb 2019 04:40:22 +0000 (04:40 +0000)]
[JSC] String.fromCharCode's slow path always generates 16bit string
https://bugs.webkit.org/show_bug.cgi?id=194466

Reviewed by Keith Miller.

JSTests:

* stress/string-from-char-code-slow-path.js: Added.
(shouldBe):
(testWithLength):

Source/JavaScriptCore:

String.fromCharCode(a1) has a fast path and the most frequently used. And String.fromCharCode(a1, a2, ...)
goes to the slow path. However, in the slow path, we always create 16bit string. 16bit string takes 2x memory,
and even worse, taints ropes 16bit if 16bit string is included in the given rope. We find that acorn-wtb
creates very large strings multiple times with String.fromCharCode, and String.fromCharCode always produces
16bit string. However, only few strings are actually 16bit strings. This patch attempts to make 8bit string
as much as possible.

It improves non JIT acorn-wtb's peak and current memory footprint by 6% and 3% respectively.

* runtime/StringConstructor.cpp:
(JSC::stringFromCharCode):

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

8 months ago[WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
cdumez@apple.com [Sat, 9 Feb 2019 04:36:57 +0000 (04:36 +0000)]
[WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
https://bugs.webkit.org/show_bug.cgi?id=194463

Reviewed by Tim Horton.

Avoid creating new CVDisplayLink objects for each WebProcess. We really only need one per
display, creating such object is expensive and it is even worse in a PSON world where we
swap process on navigation.

This patch moves the DisplayLink storing from WebProcessProxy to WebProcessPool. Also,
a DisplayLink can now be associated to several IPC connections instead of having a 1:1
mapping. When a DisplayLink no longer has any observers, we now merely stop it instead
of destroying it.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::startDisplayLink):
(WebKit::WebProcessPool::stopDisplayLink):
(WebKit::WebProcessPool::stopDisplayLinks):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
(WebKit::WebProcessProxy::processWillShutDown):
(WebKit::WebProcessProxy::shutDown):
* UIProcess/WebProcessProxy.h:
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::addObserver):
(WebKit::DisplayLink::removeObserver):
(WebKit::DisplayLink::removeObservers):
(WebKit::DisplayLink::hasObservers const):
(WebKit::DisplayLink::displayLinkCallback):
* UIProcess/mac/DisplayLink.h:
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::startDisplayLink):
(WebKit::WebProcessProxy::stopDisplayLink):

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

8 months ago[Cocoa] CTLineGetGlyphRuns() might return nullptr
mmaxfield@apple.com [Sat, 9 Feb 2019 04:06:34 +0000 (04:06 +0000)]
[Cocoa] CTLineGetGlyphRuns() might return nullptr
https://bugs.webkit.org/show_bug.cgi?id=194467
<rdar://problem/42423999>

Reviewed by Simon Fraser.

Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.

Covered by find/text/find-backwards.html

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

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

8 months agoWe should only make rope strings when concatenating strings long enough.
keith_miller@apple.com [Sat, 9 Feb 2019 03:56:32 +0000 (03:56 +0000)]
We should only make rope strings when concatenating strings long enough.
https://bugs.webkit.org/show_bug.cgi?id=194465

Reviewed by Saam Barati.

This patch stops us from allocating a rope string if the resulting
rope would be smaller than the size of the JSRopeString object we
would need to allocate.

This patch also adds paths so that we don't unnecessarily allocate
JSString cells for primitives we are going to concatenate with a
string anyway.

* dfg/DFGOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSString.h:
* runtime/Operations.cpp:
(JSC::jsAddSlowCase):
* runtime/Operations.h:
(JSC::jsString):
(JSC::jsAdd):

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

8 months ago[Cocoa] Ask platform for generic font family mappings
mmaxfield@apple.com [Sat, 9 Feb 2019 03:42:23 +0000 (03:42 +0000)]
[Cocoa] Ask platform for generic font family mappings
https://bugs.webkit.org/show_bug.cgi?id=187723
<rdar://problem/41892438>

Reviewed by Brent Fulgham.

Source/WebCore:

WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
When trying to style a character with a generic font family, we first look to see if
we have a mapping for the particular script the character is rendered with, and if we
don't find a match, we then check USCRIPT_COMMON.

In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
the only scripts which won't use the API families) is in
SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
for the CJK scripts.

The mappings inside SettingsBase are incorrect and conflict with our policy regarding
user-installed fonts. Instead, we should be consulting with the platform for some of
these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
API still has to work to set the mappings for untagged content. Therefore, we use the
system mappings for language-tagged content, and the API mappings for non-language-tagged
content. This is a good balance that makes sure we always have a good mapping for every
language, but API clients can still set the mappings, too.

Test: fast/text/ja-sans-serif.html

* css/CSSComputedStyleDeclaration.cpp:
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamily):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
(WebCore::osakaMonoIsInstalled): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::computeSpecializedChineseLocale):
(WebCore::cachedSpecializedChineseLocale):
(WebCore::languageChanged):
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::SystemFontDatabaseCoreText::serifFamily):
(WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
(WebCore::SystemFontDatabaseCoreText::cursiveFamily):
(WebCore::SystemFontDatabaseCoreText::fantasyFamily):
(WebCore::SystemFontDatabaseCoreText::monospaceFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

Tools:

Allow testing infrastructure to use fonts that are returned from CTFontDescriptorCreateForCSSFamily().

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::allowedFontFamilySet):

LayoutTests:

Update the tests to work with this new model.

* fast/text/international/font-fallback-to-common-script-expected.html: Removed.
* fast/text/international/font-fallback-to-common-script.html: Removed. This test is no longer testing
anything relevant.
* fast/text/international/lang-sensitive-fonts-expected.html:
* fast/text/international/lang-sensitive-fonts-xml-expected.html:
* fast/text/international/lang-sensitive-fonts-xml.xhtml:
* fast/text/international/lang-sensitive-fonts.html:
* fast/text/international/locale-sensitive-fonts-expected.html:
* fast/text/international/locale-sensitive-fonts.html:
* fast/text/ja-sans-serif-expected-mismatch.html: Added.
* fast/text/ja-sans-serif.html: Added.

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

8 months agoNodes that rely on being dominated by CheckInBounds should have a child edge to it
sbarati@apple.com [Sat, 9 Feb 2019 03:05:40 +0000 (03:05 +0000)]
Nodes that rely on being dominated by CheckInBounds should have a child edge to it
https://bugs.webkit.org/show_bug.cgi?id=194334
<rdar://problem/47844327>

Reviewed by Mark Lam.

JSTests:

* stress/check-in-bounds-should-be-a-child-use.js: Added.
(func):

Source/JavaScriptCore:

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::convertToHasIndexedProperty):
* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::handleBlock):
* dfg/DFGIntegerRangeOptimizationPhase.cpp:
* dfg/DFGNodeType.h:
* dfg/DFGSSALoweringPhase.cpp:
(JSC::DFG::SSALoweringPhase::lowerBoundsCheck):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileHasIndexedProperty):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCheckInBounds):
(JSC::FTL::DFG::LowerDFGToB3::compileHasIndexedProperty):

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

8 months agoWeb Inspector: Audit: show keyboard shortcut in export tooltip
drousso@apple.com [Sat, 9 Feb 2019 02:31:52 +0000 (02:31 +0000)]
Web Inspector: Audit: show keyboard shortcut in export tooltip
https://bugs.webkit.org/show_bug.cgi?id=194454

Reviewed by Matt Baker.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView):
(WI.AuditTestContentView.prototype.get saveData):
(WI.AuditTestContentView.prototype._exportResult): Added.
(WI.AuditTestContentView.prototype._handleExportButtonNavigationItemClicked):
(WI.AuditTestContentView.prototype._exportAudit): Deleted.

* Localizations/en.lproj/localizedStrings.js:

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

8 months agoWeb Inspector: Styles: easier way to select a single line
nvasilyev@apple.com [Sat, 9 Feb 2019 01:47:08 +0000 (01:47 +0000)]
Web Inspector: Styles: easier way to select a single line
https://bugs.webkit.org/show_bug.cgi?id=193305

Reviewed by Devin Rousso.

Start property selection after mousedown when mouse cursor moves 8px,
which is ~1.5 times the width of a text character in the style editor.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowMouseMove): Added.
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):

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

8 months agoWeb Inspector: Debugger Popover should work with value in template string `${identifier}`
commit-queue@webkit.org [Sat, 9 Feb 2019 01:30:16 +0000 (01:30 +0000)]
Web Inspector: Debugger Popover should work with value in template string `${identifier}`
https://bugs.webkit.org/show_bug.cgi?id=194459
<rdar://problem/47932564>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-08
Reviewed by Devin Rousso.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WI.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
When walking backwards to get the full expression we were walking outside
of the interpolation group `outside ${inside}`. Stop walking backwards once
we cross the boundary.

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

8 months ago[GTK] Implement back/forward touchpad gesture
commit-queue@webkit.org [Sat, 9 Feb 2019 01:29:22 +0000 (01:29 +0000)]
[GTK] Implement back/forward touchpad gesture
https://bugs.webkit.org/show_bug.cgi?id=193919

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

Source/WebKit:

Move ViewSnapshotStore and ViewGestureController from Cocoa/Mac directory
to UIProcess/, also move some parts of mac/ViewGestreControllerMac.mm to
ViewGestureController.cpp, split up Mac- and iOS-specific parts of
ViewSnapshotStore.cpp into mac/ViewSnapshotMac.mm, then implement 2-finger
touchpad swipe back-forward gesture for GTK based on that.

To avoid name conflict, rename existing ViewGestureController class inside
UIProcess/API/gtk/WebKitWebViewBase.cpp into TouchGestureController.

Since GTK gestures can only work with 3 or 4 fingers, treat horizontal
scrolling events as a swipe as long as there's nowhere to scroll in that
direction and web page doesn't handle the scrolling.

This is only allowed for touchpads, even though it can theoretically work
with touch mice and trackpoints.

The gesture requires every item in back-forward list to have a snapshot.
There's already an existing infrastructure for that, so the patch changes
a bunch of #if PLATFORM(COCOA) statements to also check for GTK platform.
The snapshots have to be taken in sync, so the implementation draws webview
widget into a Cairo image surface.

The gesture is disabled by default, and can be enabled by setting the newly
added 'enable-back-forward-navigation-gestures' property in WebKitSettings to
true.

Gesture drawing is implemented via Cairo. When the gesture is active, the
actual page is drawn into a Cairo group, which is then drawn together with
a given snapshot, as well as dimming and a drop shadow over the "lower" layer.

Also add a memory pressure handler that clears snapshot store when low on memory.

* DerivedSources-input.xcfilelist:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Shared/SessionState.h: Add snapshot to back-forward items for GTK.
* Shared/WebBackForwardListItem.h: Add snapshot to back-forward items for GTK.
* SourcesCocoa.txt:
* SourcesGTK.txt:
* UIProcess/API/glib/WebKitSettings.cpp:
Added 'enable-back-forward-navigation-gestures' property for enabling the gesture.
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_back_forward_navigation_gestures): Added, GTK only.
(webkit_settings_set_enable_back_forward_navigation_gestures): Added, GTK only.
* UIProcess/API/glib/WebKitWebView.cpp:
(enableBackForwardNavigationGesturesChanged): Added, GTK only.
(webkitWebViewUpdateSettings):
(webkitWebViewDisconnectSettingsSignalHandlers):
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setViewNeedsDisplay): Redraw the whole screen instead of a region during the gesture.
(WebKit::PageClientImpl::takeViewSnapshot): Added.
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Pass unhandled events to the gesture controller.
(WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): Redraw the widget immediately after removing snapshot.
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Added, send a notification to the gesture controller.
(WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):  Send a notification to the gesture controller.
(WebKit::PageClientImpl::didFinishLoadForMainFrame):  Send a notification to the gesture controller.
(WebKit::PageClientImpl::didFailLoadForMainFrame):  Added, send a notification to the gesture controller.
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):  Send a notification to the gesture controller.
(WebKit::PageClientImpl::didRestoreScrollPosition):  Added, send a notification to the gesture controller.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitSettings.h:
Add webkit_settings_get_enable_back_forward_navigation_gestures() and webkit_settings_get_enable_back_forward_navigation_gestures()
to public API.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDraw): Pass drawing to ViewGestureController during the gesture.
(webkitWebViewBaseScrollEvent): Pass scroll events to ViewGestureController during the gesture.
(webkitWebViewBaseGestureController): Renamed ViewGestureController to TouchGestureController.
(webkitWebViewBaseViewGestureController): Added.
(webkitWebViewBaseCreateWebPage): Create an instance of ViewGestureController.
(webkitWebViewBaseTakeViewSnapshot): Added.
(webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Added.
(webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame): Added.
(webkitWebViewBaseDidFinishLoadForMainFrame): Added.
(webkitWebViewBaseDidFailLoadForMainFrame): Added.
(webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Added.
(webkitWebViewBaseDidRestoreScrollPosition): Added.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Mentioned the added functions in docs.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): Move the check from WebMemoryPressureHandlerCocoa.mm here.
* UIProcess/PageClient.h: Add takeViewSnapshot() for GTK.
* UIProcess/ViewGestureController.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp.
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::disconnectFromProcess):
(WebKit::ViewGestureController::connectToProcess):
(WebKit::ViewGestureController::controllerForGesture):
(WebKit::ViewGestureController::takeNextGestureID):
(WebKit::ViewGestureController::willBeginGesture):
(WebKit::ViewGestureController::didEndGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection const):
(WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
(WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
(WebKit::ViewGestureController::didRepaintAfterNavigation):
(WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
(WebKit::ViewGestureController::didRestoreScrollPosition):
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
(WebKit::ViewGestureController::checkForActiveLoads):
(WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
(WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
(WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::resume):
(WebKit::ViewGestureController::SnapshotRemovalTracker::start):
(WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
(WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
(WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
(WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
(WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
(WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
(WebKit::deltaShouldCancelSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
(WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::reset):
(WebKit::ViewGestureController::startSwipeGesture):
(WebKit::ViewGestureController::isPhysicallySwipingLeft const):
(WebKit::ViewGestureController::shouldUseSnapshotForSize):
(WebKit::ViewGestureController::forceRepaintIfNeeded):
(WebKit::ViewGestureController::willEndSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
* UIProcess/ViewGestureController.h: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.h.
(WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
(WebKit::ViewGestureController::shouldIgnorePinnedState):
(WebKit::ViewGestureController::setShouldIgnorePinnedState):
(WebKit::ViewGestureController::hasActiveMagnificationGesture const):
(WebKit::ViewGestureController::setCustomSwipeViews):
(WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
(WebKit::ViewGestureController::backgroundColorForCurrentSnapshot const):
(WebKit::ViewGestureController::didFinishLoadForMainFrame):
(WebKit::ViewGestureController::didFailLoadForMainFrame):
(WebKit::ViewGestureController::setSwipeGestureEnabled):
(WebKit::ViewGestureController::isSwipeGestureEnabled):
(WebKit::ViewGestureController::SnapshotRemovalTracker::pause):
(WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
(WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState):
(WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState):
(WebKit::ViewGestureController::SwipeProgressTracker::progress const):
(WebKit::ViewGestureController::SwipeProgressTracker::direction const):
* UIProcess/ViewGestureController.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.messages.in.
* UIProcess/ViewSnapshotStore.cpp: Copied from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
(WebKit::ViewSnapshotStore::ViewSnapshotStore):
(WebKit::ViewSnapshotStore::~ViewSnapshotStore):
(WebKit::ViewSnapshotStore::singleton):
(WebKit::ViewSnapshotStore::didAddImageToSnapshot):
(WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
(WebKit::ViewSnapshotStore::pruneSnapshots):
(WebKit::ViewSnapshotStore::recordSnapshot):
(WebKit::ViewSnapshotStore::discardSnapshotImages):
(WebKit::ViewSnapshot::~ViewSnapshot):
* UIProcess/ViewSnapshotStore.h: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.h.
(WebKit::ViewSnapshot::setRenderTreeSize):
(WebKit::ViewSnapshot::renderTreeSize const):
(WebKit::ViewSnapshot::setBackgroundColor):
(WebKit::ViewSnapshot::backgroundColor const):
(WebKit::ViewSnapshot::setViewScrollPosition):
(WebKit::ViewSnapshot::viewScrollPosition const):
(WebKit::ViewSnapshot::setDeviceScaleFactor):
(WebKit::ViewSnapshot::deviceScaleFactor const):
(WebKit::ViewSnapshot::surface const):
(WebKit::ViewSnapshot::imageSizeInBytes const):
(WebKit::ViewSnapshot::size const):
(WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
(WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting const):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::didRemoveItem): Unset snapshot for GTK.
* UIProcess/WebMemoryPressureHandler.cpp: Copied from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
(WebKit::installMemoryPressureHandler):
* UIProcess/WebMemoryPressureHandler.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordNavigationSnapshot): Take snapshots for GTK.
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/ViewGestureControllerGtk.cpp: Added. This is a port of
UIProcess/mac/ViewGestureControllerMac.mm. SwipeProgressTracker class is a
re-implementation of trackSwipeEventWithOptions.
(WebKit::isEventStop):
(WebKit::ViewGestureController::platformTeardown):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::handleScrollWheelEvent):
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::ViewGestureController::SwipeProgressTracker::SwipeProgressTracker):
(WebKit::ViewGestureController::SwipeProgressTracker::startTracking):
(WebKit::ViewGestureController::SwipeProgressTracker::reset):
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
(WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
(WebKit::easeOutCubic):
(WebKit::ViewGestureController::SwipeProgressTracker::onAnimationTick):
(WebKit::ViewGestureController::SwipeProgressTracker::endAnimation):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::handleSwipeGesture):
(WebKit::ViewGestureController::draw):
(WebKit::ViewGestureController::removeSwipeSnapshot):
(WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
(WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
* UIProcess/gtk/ViewSnapshotStoreGtk.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
(WebKit::ViewSnapshot::create):
(WebKit::ViewSnapshot::ViewSnapshot):
(WebKit::ViewSnapshot::hasImage const):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::imageSizeInBytes const):
(WebKit::ViewSnapshot::size const):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::memoryPressureMonitorDisabled): Added.
(WebKit::WebProcessPool::platformInitialize): Install memory pressure handler.
(WebKit::WebProcessPool::platformInitializeWebProcess): Use memoryPressureMonitorDisabled().
* UIProcess/mac/ViewGestureControllerMac.mm:
Moved many functions into UIProcess/ViewGestureController.cpp
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::scrollEventCanInfluenceSwipe): Deleted.
(WebKit::deltaShouldCancelSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::reset): Deleted.
(WebKit::ViewGestureController::willEndSwipeGesture): Deleted.
(WebKit::ViewGestureController::shouldUseSnapshotForSize): Deleted.
(WebKit::ViewGestureController::isPhysicallySwipingLeft const): Deleted.
(WebKit::ViewGestureController::endSwipeGesture): Deleted.
(WebKit::ViewGestureController::forceRepaintIfNeeded): Deleted.
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): Deleted.
* UIProcess/mac/ViewSnapshotStoreMac.mm: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
(WebKit::ViewSnapshotStore::snapshottingContext):
(WebKit::ViewSnapshot::create):
(WebKit::ViewSnapshot::ViewSnapshot):
(WebKit::ViewSnapshot::setSurface):
(WebKit::ViewSnapshot::hasImage const):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::setVolatile):
(WebKit::ViewSnapshot::asLayerContents):
(WebKit::ViewSnapshot::asImageForTesting):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
Make SetRenderTreeSizeNotificationThreshold() cross-platform.
(WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
(WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):
(WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
* WebProcess/WebPage/WebPage.cpp:
Start using ViewGestureGeometryCollector for GTK.
(WebKit::WebPage::mainFrameDidLayout):
* WebProcess/WebPage/WebPage.h:

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings): Add a test for 'enable-back-forward-navigation-gestures' property.

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

8 months agoAdd SPI to use networking daemon instead of XPC service
achristensen@apple.com [Sat, 9 Feb 2019 01:17:41 +0000 (01:17 +0000)]
Add SPI to use networking daemon instead of XPC service
https://bugs.webkit.org/show_bug.cgi?id=194427

Source/WebKit:

Reviewed by Geoffrey Garen.

There is still work to be done, but with the proper plist it starts and loads webpages!

* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
(WebKit::DaemonMain):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCEventHandler):
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
(WebKit::XPCServiceEventHandler): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
(-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::usesNetworkingDaemon const):
* UIProcess/WebProcessPool.h:

Source/WTF:

Reviewed by Geoffrey Garen.

* wtf/spi/darwin/XPCSPI.h:
Instead of using XPC bootstrap SPI, we just send a separate message.
xpc_copy_bootstrap does not seem to work in  daemons.

Tools:

Reviewed by Geoffrey Garen

* MiniBrowser/MiniBrowser.entitlements:

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

8 months ago[JSC] Shrink sizeof(CodeBlock) more
ysuzuki@apple.com [Sat, 9 Feb 2019 00:29:21 +0000 (00:29 +0000)]
[JSC] Shrink sizeof(CodeBlock) more
https://bugs.webkit.org/show_bug.cgi?id=194419

Reviewed by Mark Lam.

Source/JavaScriptCore:

This patch further shrinks the size of CodeBlock, from 352 to 296 (304).

1. CodeBlock copies so many data from ScriptExecutable even if ScriptExecutable
has the same information. These data is not touched in CodeBlock::~CodeBlock,
so we can just use the data in ScriptExecutable instead of holding it in CodeBlock.

2. We remove m_instructions pointer since the ownership is managed by UnlinkedCodeBlock.
And we do not touch it in CodeBlock::~CodeBlock.

3. We move m_calleeSaveRegisters from CodeBlock to CodeBlock::JITData. For baseline and LLInt
cases, this patch offers RegisterAtOffsetList::llintBaselineCalleeSaveRegisters() which returns
singleton to `const RegisterAtOffsetList*` usable for LLInt and Baseline JIT CodeBlocks.

4. Move m_catchProfiles to RareData and materialize only when op_catch's slow path is called.

5. Drop ownerScriptExecutable. ownerExecutable() returns ScriptExecutable*.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::hash const):
(JSC::CodeBlock::sourceCodeForTools const):
(JSC::CodeBlock::dumpAssumingJITType const):
(JSC::CodeBlock::dumpSource):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::setCalleeSaveRegisters):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffset):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow):
(JSC::CodeBlock::lineNumberForBytecodeOffset):
(JSC::CodeBlock::expressionRangeForBytecodeOffset const):
(JSC::CodeBlock::hasOpDebugForLineAndColumn):
(JSC::CodeBlock::newReplacement):
(JSC::CodeBlock::replacement):
(JSC::CodeBlock::computeCapabilityLevel):
(JSC::CodeBlock::jettison):
(JSC::CodeBlock::calleeSaveRegisters const):
(JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):
(JSC::CodeBlock::updateOSRExitCounterAndCheckIfNeedToReoptimize):
(JSC::CodeBlock::getArrayProfile):
(JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
(JSC::CodeBlock::notifyLexicalBindingUpdate):
(JSC::CodeBlock::tryGetValueProfileForBytecodeOffset):
(JSC::CodeBlock::validate):
(JSC::CodeBlock::outOfLineJumpTarget):
(JSC::CodeBlock::arithProfileForBytecodeOffset):
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::specializationKind const):
(JSC::CodeBlock::isStrictMode const):
(JSC::CodeBlock::isConstructor const):
(JSC::CodeBlock::codeType const):
(JSC::CodeBlock::isKnownNotImmediate):
(JSC::CodeBlock::instructions const):
(JSC::CodeBlock::ownerExecutable const):
(JSC::CodeBlock::thisRegister const):
(JSC::CodeBlock::source const):
(JSC::CodeBlock::sourceOffset const):
(JSC::CodeBlock::firstLineColumnOffset const):
(JSC::CodeBlock::createRareDataIfNecessary):
(JSC::CodeBlock::ownerScriptExecutable const): Deleted.
(JSC::CodeBlock::setThisRegister): Deleted.
(JSC::CodeBlock::calleeSaveRegisters const): Deleted.
* bytecode/EvalCodeBlock.h:
* bytecode/FunctionCodeBlock.h:
* bytecode/GlobalCodeBlock.h:
(JSC::GlobalCodeBlock::GlobalCodeBlock):
* bytecode/ModuleProgramCodeBlock.h:
* bytecode/ProgramCodeBlock.h:
* debugger/Debugger.cpp:
(JSC::Debugger::toggleBreakpoint):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::sourceID const):
(JSC::DebuggerCallFrame::sourceIDForCallFrame):
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::location const):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::InlineStackEntry::executable):
(JSC::DFG::ByteCodeParser::inliningCost):
(JSC::DFG::ByteCodeParser::parseCodeBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::isSupportedForInlining):
(JSC::DFG::mightCompileEval):
(JSC::DFG::mightCompileProgram):
(JSC::DFG::mightCompileFunctionForCall):
(JSC::DFG::mightCompileFunctionForConstruct):
(JSC::DFG::canUseOSRExitFuzzing):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::executableFor):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::restoreCalleeSavesFor):
(JSC::DFG::saveCalleeSavesFor):
(JSC::DFG::saveOrCopyCalleeSavesFor):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::handleExitCounts):
* dfg/DFGOperations.cpp:
* dfg/DFGToFTLDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidComplete):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::callerSourceOrigin):
* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::calleeSaveRegisters):
(JSC::StackVisitor::Frame::sourceURL const):
(JSC::StackVisitor::Frame::sourceID):
(JSC::StackVisitor::Frame::computeLineAndColumn const):
* interpreter/StackVisitor.h:
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitSaveCalleeSavesFor):
(JSC::AssemblyHelpers::emitSaveOrCopyCalleeSavesFor):
(JSC::AssemblyHelpers::emitRestoreCalleeSavesFor):
* jit/CallFrameShuffleData.cpp:
(JSC::CallFrameShuffleData::setupCalleeSaveRegisters):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/JITToDFGDeferredCompilationCallback.cpp:
(JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::Plan::finalize):
(JSC::JITWorklist::compileNow):
* jit/RegisterAtOffsetList.cpp:
(JSC::RegisterAtOffsetList::llintBaselineCalleeSaveRegisters):
* jit/RegisterAtOffsetList.h:
(JSC::RegisterAtOffsetList::at const):
* runtime/ErrorInstance.cpp:
(JSC::appendSourceToError):
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
* runtime/StackFrame.cpp:
(JSC::StackFrame::sourceID const):
(JSC::StackFrame::sourceURL const):
(JSC::StackFrame::computeLineAndColumn const):

Source/WebCore:

* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):

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

8 months ago[ews-build] Ensure that every builder in config.json has short name
aakash_jain@apple.com [Sat, 9 Feb 2019 00:28:19 +0000 (00:28 +0000)]
[ews-build] Ensure that every builder in config.json has short name
https://bugs.webkit.org/show_bug.cgi?id=194461

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
* BuildSlaveSupport/ews-build/loadConfig_unittest.py: Updated unit-tests.

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

8 months ago[Cocoa] Optimize ResourceResponse::platformLazyInit()
cdumez@apple.com [Sat, 9 Feb 2019 00:26:40 +0000 (00:26 +0000)]
[Cocoa] Optimize ResourceResponse::platformLazyInit()
https://bugs.webkit.org/show_bug.cgi?id=194438

Reviewed by Alex Christensen.

Optimize ResourceResponse::platformLazyInit(). Most of the CPU time currently goes into getting the
HTTP headers from CFNetwork:
"""
Sample Count, Samples %, CPU %, Symbol
46, 0.0%, 0.0%, WebCore::initializeHTTPHeaders(WebCore::OnlyCommonHeaders, NSHTTPURLResponse*, WebCore::HTTPHeaderMap&) (in WebCore)
34, 0.0%, 0.0%,     HTTPHeaderDict::copyAsOrdinaryDict(__CFAllocator const*) const (in CFNetwork)
11, 0.0%, 0.0%,     CFDictionaryApplyFunction (in CoreFoundation)
"""

We currently have 2 levels of initialization: CommonFieldsOnly & AllFields. With WebKit2, most ResourceResponses get sent over IPC
and thus end up getting initialized twice, once with CommonFieldsOnly and then with AllFields.
This would cause us to call the expensive HTTPHeaderDict::copyAsOrdinaryDict() twice instead of once, simply to initialize the common
HTTP headers first and then the uncommon ones later.

This patch updates ResourceResponse::platformLazyInit() to initialize all HTTP headers at once, as soon as CommonFieldsOnly
initialization is requested, so that we no longer copy all HTTP headers twice.

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::initializeHTTPHeaders):
(WebCore::ResourceResponse::platformLazyInit):

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

8 months agoWeb Inspector: Import / Export Heap Snapshots
commit-queue@webkit.org [Sat, 9 Feb 2019 00:25:46 +0000 (00:25 +0000)]
Web Inspector: Import / Export Heap Snapshots
https://bugs.webkit.org/show_bug.cgi?id=194448
<rdar://problem/47928093>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-08
Reviewed by Devin Rousso.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New strings.

* UserInterface/Proxies/HeapSnapshotProxy.js:
(WI.HeapSnapshotProxy):
(WI.HeapSnapshotProxy.deserialize):
(WI.HeapSnapshotProxy.prototype.get imported):
(WI.HeapSnapshotProxy.prototype.get snapshotStringData):
(WI.HeapSnapshotProxy.prototype.set snapshotStringData):
Include an "imported" state on the HeapSnapshot and allow for
stashing the snapshotStringData on the main thread side.

* UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
(WI.HeapSnapshotWorkerProxy.prototype.createImportedSnapshot):
* UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
(HeapSnapshotWorker.prototype.clearSnapshots):
(HeapSnapshotWorker.prototype.createSnapshot):
Provide a specialized way to create an imported HeapSnapshot.
Track imported snapshots separately since they won't want to
be searched for live/dead objects due to active recording GCs.

* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot):
(HeapSnapshot.updateCategoriesAndMetadata):
(HeapSnapshot.allocationBucketCounts):
(HeapSnapshot.instancesWithClassName):
(HeapSnapshot.prototype.nodeWithIdentifier):
(HeapSnapshot.prototype.dominatedNodes):
(HeapSnapshot.prototype.retainedNodes):
(HeapSnapshot.prototype.retainers):
(HeapSnapshot.prototype.updateDeadNodesAndGatherCollectionData):
(HeapSnapshot.prototype.serialize):
(HeapSnapshot.prototype.serializeNode):
(HeapSnapshot.prototype._buildPostOrderIndexes):
(HeapSnapshot.prototype._buildDominatorIndexes):
(HeapSnapshot.prototype._buildRetainedSizes):
(HeapSnapshot.prototype._gcRootPathes.visitNode):
(HeapSnapshot.prototype._gcRootPathes):
Construct a HeapSnapshot knowinng whether or not it is imported.
Imported snapshots may be the "GCDebugging" snapshot type which
differs from "Inspector" by the number of node fields. So keep
the node field count a member instead of a global constant
in order to work with both snapshot types.

* UserInterface/Models/HeapAllocationsInstrument.js:
(WI.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
* UserInterface/Protocol/ConsoleObserver.js:
(WI.ConsoleObserver.prototype.heapSnapshot):
* UserInterface/Protocol/HeapObserver.js:
(WI.HeapObserver.prototype.trackingStart):
(WI.HeapObserver.prototype.trackingComplete):
Stash the original string JSON data on the main thread side
where we already have the data.

* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
(WI.HeapAllocationsTimelineOverviewGraph.prototype.layout):
Don't show [S] icons for imported snapshots with no timestamp.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView):
(WI.HeapAllocationsTimelineView.prototype.get navigationItems):
(WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
(WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
Import button that just creates a new snapshot.

* UserInterface/Views/HeapSnapshotContentView.js:
(WI.HeapSnapshotContentView):
(WI.HeapSnapshotContentView.prototype.get navigationItems):
(WI.HeapSnapshotContentView.prototype.get supportsSave):
(WI.HeapSnapshotContentView.prototype.get saveData):
(WI.HeapSnapshotContentView.prototype._exportSnapshot):
Export button that saves the original data.

* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.displayNameForRecord):
Specialized display string for imported snapshots.

LayoutTests:

* inspector/heap/imported-snapshot-expected.txt: Added.
* inspector/heap/imported-snapshot.html: Added.
* platform/mac/TestExpectations:

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

8 months ago[ews-build] Add short name to config.json
aakash_jain@apple.com [Sat, 9 Feb 2019 00:24:24 +0000 (00:24 +0000)]
[ews-build] Add short name to config.json
https://bugs.webkit.org/show_bug.cgi?id=194456

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json: Added short name.
* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig): Set the short name as the builder description.

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

8 months agoB3LowerMacros wrongly sets m_changed to true in the case of AtomicWeakCAS on x86
rmorisset@apple.com [Sat, 9 Feb 2019 00:21:56 +0000 (00:21 +0000)]
B3LowerMacros wrongly sets m_changed to true in the case of AtomicWeakCAS on x86
https://bugs.webkit.org/show_bug.cgi?id=194460

Reviewed by Mark Lam.

Trivial fix, should already be covered by testAtomicWeakCAS in testb3.cpp.

* b3/B3LowerMacros.cpp:

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

8 months agoWeb Inspector: Add Debug setting to show Internal Object Classes in Heap Snapshot
commit-queue@webkit.org [Fri, 8 Feb 2019 23:51:52 +0000 (23:51 +0000)]
Web Inspector: Add Debug setting to show Internal Object Classes in Heap Snapshot
https://bugs.webkit.org/show_bug.cgi?id=194445

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-08
Reviewed by Devin Rousso.

* UserInterface/Base/Setting.js:
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):

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

8 months agoUse maxSingleCharacterString in comparisons instead of literal constants.
mark.lam@apple.com [Fri, 8 Feb 2019 23:06:41 +0000 (23:06 +0000)]
Use maxSingleCharacterString in comparisons instead of literal constants.
https://bugs.webkit.org/show_bug.cgi?id=194452

Reviewed by Yusuke Suzuki.

This way, if we ever change maxSingleCharacterString, it won't break all this code
that relies on it being 0xff implicitly.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringSlice):
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToB3::compileStringSlice):
* jit/ThunkGenerators.cpp:
(JSC::stringGetByValGenerator):
(JSC::charToString):

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

8 months agoFix DFG's doesGC() for CheckTierUp*, GetByVal, PutByVal*, and StringCharAt nodes.
mark.lam@apple.com [Fri, 8 Feb 2019 22:32:00 +0000 (22:32 +0000)]
Fix DFG's doesGC() for CheckTierUp*, GetByVal, PutByVal*, and StringCharAt nodes.
https://bugs.webkit.org/show_bug.cgi?id=194446
<rdar://problem/47926792>

Reviewed by Saam Barati.

Fix doesGC() for the following nodes:

    CheckTierUpAtReturn:
        Calls triggerTierUpNow(), which calls triggerFTLReplacementCompile(),
        which calls Worklist::completeAllReadyPlansForVM(), which uses DeferGC.

    CheckTierUpInLoop:
        Calls triggerTierUpNowInLoop(), which calls tierUpCommon(), which calls
        Worklist::completeAllReadyPlansForVM(), which uses DeferGC.

    CheckTierUpAndOSREnter:
        Calls triggerOSREntryNow(), which calls tierUpCommon(), which calls
        Worklist::completeAllReadyPlansForVM(), which uses DeferGC.

    GetByVal:
        case Array::String calls operationSingleCharacterString(), which calls
        jsSingleCharacterString(), which can allocate a string.

    PutByValDirect:
    PutByVal:
    PutByValAlias:
        For the DFG only, the integer TypeArrays calls compilePutByValForIntTypedArray(),
        which may call slow paths operationPutByValDirectStrict(), operationPutByValDirectNonStrict(),
        operationPutByValStrict(), or operationPutByValNonStrict().  All of these
        slow paths call putByValInternal(), which may create exception objects, or
        call the generic JSValue::put() which may execute arbitrary code.

    StringCharAt:
        Can call operationSingleCharacterString(), which calls jsSingleCharacterString(),
        which can allocate a string.

Also fix DFG::SpeculativeJIT::compileGetByValOnString() and FTL's compileStringCharAt()
to use the maxSingleCharacterString constant instead of a literal constant.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):

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

8 months agoWeb Inspector: Styles: close unbalanced quotes and parenthesis when editing values
nvasilyev@apple.com [Fri, 8 Feb 2019 22:17:56 +0000 (22:17 +0000)]
Web Inspector: Styles: close unbalanced quotes and parenthesis when editing values
https://bugs.webkit.org/show_bug.cgi?id=182523
<rdar://problem/37260209>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Close CSS comments, append missing closed quotes and right parenthesis.

* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions.completeUnbalancedValue):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.set rawValue):

LayoutTests:

Test common cases of unmatched quotes, parenthesis, comments, and trailing backslashes.

* inspector/unit-tests/css-completions-expected.txt: Added.
* inspector/unit-tests/css-completions.html: Added.

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

8 months agoLayout Test accessibility/set-value-not-work-for-disabled-sliders.html is failing
pvollan@apple.com [Fri, 8 Feb 2019 22:11:12 +0000 (22:11 +0000)]
Layout Test accessibility/set-value-not-work-for-disabled-sliders.html is failing
https://bugs.webkit.org/show_bug.cgi?id=194451

Unreviewed test gardening.

* platform/win/TestExpectations:

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

8 months ago[Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
ryanhaddad@apple.com [Fri, 8 Feb 2019 21:39:20 +0000 (21:39 +0000)]
[Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=194443

Unreviewed build fix.

For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
if not using MTLStorageModePrivate, must use MTLStorageModeShared.

Behavior unchanged.

Patch by Justin Fan <justin_fan@apple.com> on 2019-02-08

* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::storageModeForPixelFormatAndSampleCount):

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

8 months agoLayout Test media/audio-concurrent-supported.html is a flaky failure
ryanhaddad@apple.com [Fri, 8 Feb 2019 21:21:43 +0000 (21:21 +0000)]
Layout Test media/audio-concurrent-supported.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=188017

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations: The test is not flaky anymore. Remove expectation.

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

8 months agoUnreviewed, rolling out r241197.
tsavell@apple.com [Fri, 8 Feb 2019 21:19:32 +0000 (21:19 +0000)]
Unreviewed, rolling out r241197.

Broke iOS Simulator Debug build and casued 1 API failure on
High Sierra

Reverted changeset:

"Add SPI to use networking daemon instead of XPC service"
https://bugs.webkit.org/show_bug.cgi?id=194427
https://trac.webkit.org/changeset/241197

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

8 months agoAbstract and discussion comments needed for afterScreenUpdates
bdakin@apple.com [Fri, 8 Feb 2019 20:36:07 +0000 (20:36 +0000)]
Abstract and discussion comments needed for afterScreenUpdates
https://bugs.webkit.org/show_bug.cgi?id=194442

Reviewed by Wenson Hsieh.

Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:

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

8 months ago[WebVTT] Inline WebVTT styles should start with '::cue'
pvollan@apple.com [Fri, 8 Feb 2019 19:48:04 +0000 (19:48 +0000)]
[WebVTT] Inline WebVTT styles should start with '::cue'
https://bugs.webkit.org/show_bug.cgi?id=194227
<rdar://problem/47791087>

Reviewed by Eric Carlson.

Source/WebCore:

Check that the CSS string starts with '::cue' and is successfully parsed before adding it
to the CSS stylesheet list. Also, the caption preferences CSS string should start with
'::cue', since it is added inside the video shadow root element.

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

* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):

LayoutTests:

* media/track/captions-webvtt/css-styling.vtt:

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

8 months agowebkitpy: CrashLogs.find_all_logs may return a string or a dictionary
jbedard@apple.com [Fri, 8 Feb 2019 19:46:11 +0000 (19:46 +0000)]
webkitpy: CrashLogs.find_all_logs may return a string or a dictionary
https://bugs.webkit.org/show_bug.cgi?id=194418

Reviewed by Lucas Forschler.

Do not include errors trying when finding crashlogs at the end of
a run-webkit-tests run since we don't process those errors.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort._look_for_all_crash_logs_in_log_dir):
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort._look_for_all_crash_logs_in_log_dir):
* Scripts/webkitpy/port/watch_device.py:
(WatchDevicePort._look_for_all_crash_logs_in_log_dir):

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

8 months ago[JSC] SourceProviderCacheItem should be small
ysuzuki@apple.com [Fri, 8 Feb 2019 19:18:14 +0000 (19:18 +0000)]
[JSC] SourceProviderCacheItem should be small
https://bugs.webkit.org/show_bug.cgi?id=194432

Reviewed by Saam Barati.

Some JetStream2 tests stress the JS parser. At that time, so many SourceProviderCacheItems are created.
While they are removed when full-GC happens, it significantly increases the peak memory usage.
This patch reduces the size of SourceProviderCacheItem from 56 to 32.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):
* parser/ParserModes.h:
* parser/ParserTokens.h:
* parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::endFunctionToken const):
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):

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

8 months agoRunning RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
youenn@apple.com [Fri, 8 Feb 2019 18:49:23 +0000 (18:49 +0000)]
Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
https://bugs.webkit.org/show_bug.cgi?id=194380
<rdar://problem/47916514>

Reviewed by Eric Carlson.

Source/WebCore:

Set whether VP8 is supported at creation of the page.
This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.

Add internal API to enable resetting the factory to enable proper testing.

Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/Page.cpp:
(WebCore::m_applicationManifest):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::clearPeerConnectionFactory):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* webrtc/video-mute-vp8-expected.txt:
* webrtc/video-mute-vp8.html:

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

8 months agoAdd afterScreenUpdates to WKSnapshotConfiguration
bdakin@apple.com [Fri, 8 Feb 2019 18:20:12 +0000 (18:20 +0000)]
Add afterScreenUpdates to WKSnapshotConfiguration
https://bugs.webkit.org/show_bug.cgi?id=194362
-and corresponding-
<rdar://problem/40655528> Please add an "after screen updates" property to
WKSnapshotConfiguration (to solve blank snapshots)

Reviewed by Tim Horton.

Source/WebKit:

This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
This makes our snapshotting API more predictable and reliable on iOS devices,
which is why the new configuration property defaults to YES.

New property that defaults to YES.
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
* UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
(-[WKSnapshotConfiguration init]):
(-[WKSnapshotConfiguration copyWithZone:]):

When afterScreenUpdates is set, invoke the snapshot via
callAfterNextPresentationUpdate.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
(-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]):

Tools:

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

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

8 months ago[WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
aestes@apple.com [Fri, 8 Feb 2019 18:18:28 +0000 (18:18 +0000)]
[WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
https://bugs.webkit.org/show_bug.cgi?id=190997
<rdar://problem/35983035>

Reviewed by Brent Fulgham.

Source/WebCore:

Support serializing sequences and FrozenArrays of types that aren't interfaces. This is
needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings.

We should support serializing sequences of interfaces too, but that's slightly more
complicated since it involves iterating the sequence and serializing each of its items. I
left that as a follow-up task, since I don't see any IDLs that currently need this.

We also don't support serializing sequences with the CachedAttribute or CustomGetter
extended attributes, because WebIDL specifies that a new array should be created when
converting an IDL sequence into an ECMAScript value.

Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to
http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html.

* bindings/scripts/CodeGenerator.pm:
(GetInterfaceForType): Renamed from GetInterfaceForAttribute.
(IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types.
(hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an
attribute has the CachedAttribute or CustomGetter extended attributes.
(IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter
extended attributes before calling IsSerializableType.
(GetInterfaceForAttribute): Renamed to GetInterfaceForType.
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/TestSerialization.idl:

LayoutTests:

* http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html:

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

8 months agoAdd SPI to use networking daemon instead of XPC service
achristensen@apple.com [Fri, 8 Feb 2019 17:18:08 +0000 (17:18 +0000)]
Add SPI to use networking daemon instead of XPC service
https://bugs.webkit.org/show_bug.cgi?id=194427

Reviewed by Geoffrey Garen.

Source/WebKit:

There is still work to be done, but with the proper plist it starts and loads webpages!

* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
(WebKit::DaemonMain):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCEventHandler):
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
(WebKit::XPCServiceEventHandler): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
(-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::usesNetworkingDaemon const):
* UIProcess/WebProcessPool.h:

Source/WTF:

* wtf/spi/darwin/XPCSPI.h:
Instead of using XPC bootstrap SPI, we just send a separate message.
xpc_copy_bootstrap does not seem to work in  daemons.

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

8 months agoIndexedDB tests leak documents
sihui_liu@apple.com [Fri, 8 Feb 2019 17:05:53 +0000 (17:05 +0000)]
IndexedDB tests leak documents
https://bugs.webkit.org/show_bug.cgi?id=189435
<rdar://problem/44240043>

Reviewed by Geoffrey Garen.

Remove use of JSC::Strong in IndexedDatabase.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::continuePrimaryKey):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::key):
(WebCore::IDBCursor::primaryKey):
(WebCore::IDBCursor::value):
(WebCore::IDBCursor::keyWrapper):
(WebCore::IDBCursor::primaryKeyWrapper):
(WebCore::IDBCursor::valueWrapper):
(WebCore::IDBCursor::key const): Deleted.
(WebCore::IDBCursor::primaryKey const): Deleted.
(WebCore::IDBCursor::value const): Deleted.
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putForCursorUpdate):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::~IDBRequest):
(WebCore::IDBRequest::result const):
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
(WebCore::IDBRequest::setResultToUndefined):
(WebCore::IDBRequest::resultCursor):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::didOpenOrIterateCursor):
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::resultWrapper):
* Modules/indexeddb/IDBRequest.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::key const):
(WebCore::JSIDBCursor::primaryKey const):
(WebCore::JSIDBCursor::visitAdditionalChildren):
* bindings/js/JSIDBCursorWithValueCustom.cpp:
(WebCore::JSIDBCursorWithValue::value const):
(WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
* bindings/js/JSIDBRequestCustom.cpp: Added.
(WebCore::JSIDBRequest::result const):
(WebCore::JSIDBRequest::visitAdditionalChildren):
* inspector/agents/InspectorIndexedDBAgent.cpp:

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

8 months ago[LFC] The used containing block width value is optional
zalan@apple.com [Fri, 8 Feb 2019 14:46:36 +0000 (14:46 +0000)]
[LFC] The used containing block width value is optional
https://bugs.webkit.org/show_bug.cgi?id=194428

Reviewed by Antti Koivisto.

The preferred width codepath cannot provide a valid used containing block width value.

"The percentage is calculated with respect to the width of the generated box's containing block.
If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.2."

Let's use 0 as used value for now.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
* page/FrameViewLayoutContext.cpp:

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

8 months ago[LFC] Horizontal geometry compute functions should take the containing block's width...
zalan@apple.com [Fri, 8 Feb 2019 13:57:09 +0000 (13:57 +0000)]
[LFC] Horizontal geometry compute functions should take the containing block's width as a used value
https://bugs.webkit.org/show_bug.cgi?id=194424

Reviewed by Antti Koivisto.

This is in preparation for passing optional containing block width for the preferred with codepath.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):

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

8 months agoUpdate JetStream2 CLI to not print "ms" since we now just print the score values
sbarati@apple.com [Fri, 8 Feb 2019 09:54:50 +0000 (09:54 +0000)]
Update JetStream2 CLI to not print "ms" since we now just print the score values
https://bugs.webkit.org/show_bug.cgi?id=193981

Reviewed by Yusuke Suzuki.

* JetStream2/JetStreamDriver.js:
(DefaultBenchmark.prototype.updateUIAfterRun):
(DefaultBenchmark):
(WSLBenchmark.prototype.updateUIAfterRun):
(WSLBenchmark):
(WasmBenchmark.prototype.updateUIAfterRun):
(WasmBenchmark):

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

8 months agoclampTo(): do not convert the input to double when dealing with integers
benjamin@webkit.org [Fri, 8 Feb 2019 09:46:36 +0000 (09:46 +0000)]
clampTo(): do not convert the input to double when dealing with integers
https://bugs.webkit.org/show_bug.cgi?id=194263
<rdar://problem/47692312>

Reviewed by Darin Adler.

Source/WebCore:

Make the calls to clampTo<float>() unambiguous.

* page/FrameView.cpp:
(WebCore::FrameView::computeUpdatedLayoutViewportRect):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setOpacity):
(WebCore::RenderStyle::setShapeImageThreshold):

Source/WTF:

Previously, every use of clampTo() was converting the input to double,
doing the comparison in double, then casting back to whatever type was needed.

In many case, that was very wasteful. WebKit has many cases of clampTo() with
the same type as input/output, or with integer types of different size/sign.

This patch adds a few versions of clampTo() for the common cases seen in WebKit.
In each case, I tried to minimize the amount of conversion needed at runtime.

* wtf/MathExtras.h:
(clampTo):

Tools:

* TestWebKitAPI/Tests/WTF/MathExtras.cpp:
(TestWebKitAPI::testClampFloatingPointToFloatingPoint):
(TestWebKitAPI::testClampFloatingPointToInteger):
(TestWebKitAPI::testClampSameSignIntegers):
(TestWebKitAPI::testClampUnsignedToSigned):
(TestWebKitAPI::testClampSignedToUnsigned):

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

8 months agoUnreviewed build fix.
krollin@apple.com [Fri, 8 Feb 2019 08:48:35 +0000 (08:48 +0000)]
Unreviewed build fix.

r241135 modified how entitlements were built up for the macOS. Those
changes broke the iOSMac builds. Bring back some deletions in order to
fix iOSMac.

* Configurations/PluginService.64.xcconfig:
* Configurations/PluginService.entitlements: Added.
* WebKit.xcodeproj/project.pbxproj:

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

8 months agoSource/WebCore:
commit-queue@webkit.org [Fri, 8 Feb 2019 08:37:26 +0000 (08:37 +0000)]
Source/WebCore:
When performing AXPress, check to see if the menu list is disabled.
https://bugs.webkit.org/show_bug.cgi?id=193878

Patch by Eric Liang <ericliang@apple.com> on 2019-02-08
Reviewed by Chris Fleizach.

Test: accessibility/mac/press-not-work-for-disabled-menu-list.html

* accessibility/AXObjectCache.h:
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::press):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):

LayoutTests:
Check if receive AXPressDidFail notification when performing AXPress action on disabled MenuList.
https://bugs.webkit.org/show_bug.cgi?id=193878

Patch by Eric Liang <ericliang@apple.com> on 2019-02-08
Reviewed by Chris Fleizach.

* accessibility/mac/press-not-work-for-disabled-menu-list.html: Added.

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

8 months agoPseudoElement created for any ::before/::after selector regardless of whether a conte...
drousso@apple.com [Fri, 8 Feb 2019 06:51:52 +0000 (06:51 +0000)]
PseudoElement created for any ::before/::after selector regardless of whether a content property exists
https://bugs.webkit.org/show_bug.cgi?id=194423
<rdar://problem/46787260>

Reviewed by Antti Koivisto.

Source/WebCore:

Test: inspector/css/pseudo-creation.html

* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle):
We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
`PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.

LayoutTests:

* inspector/css/pseudo-creation.html: Added.
* inspector/css/pseudo-creation-expected.txt: Added.

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

8 months agoMark more heap-allocated classes as fast allocated
cdumez@apple.com [Fri, 8 Feb 2019 02:38:46 +0000 (02:38 +0000)]
Mark more heap-allocated classes as fast allocated
https://bugs.webkit.org/show_bug.cgi?id=194422

Reviewed by Ryosuke Niwa.

Source/WebCore:

* Modules/applepay/PaymentCoordinator.h:
* Modules/beacon/NavigatorBeacon.h:
* Modules/cache/DOMWindowCaches.h:
* Modules/cache/WorkerGlobalScopeCaches.h:
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
* Modules/gamepad/NavigatorGamepad.h:
* Modules/indexeddb/IDBGetAllResult.h:
* Modules/indexeddb/IDBGetResult.h:
* Modules/indexeddb/IDBKeyData.h:
* Modules/indexeddb/IDBValue.h:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
* Modules/indexeddb/server/IndexValueEntry.h:
* Modules/indexeddb/server/IndexValueStore.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryCursor.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
* Modules/indexeddb/shared/IDBTransactionInfo.h:
* Modules/mediacapabilities/NavigatorMediaCapabilities.h:
* Modules/mediasession/WebMediaSessionManager.cpp:
* Modules/mediastream/NavigatorMediaDevices.h:
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
* Modules/navigatorcontentutils/NavigatorContentUtils.h:
* Modules/quota/DOMWindowQuota.h:
* Modules/quota/NavigatorStorageQuota.h:
* Modules/quota/WorkerNavigatorStorageQuota.h:
* Modules/speech/DOMWindowSpeechSynthesis.h:
* Modules/webaudio/BiquadProcessor.h:
* Modules/webaudio/DelayProcessor.h:
* Modules/webauthn/fido/FidoHidPacket.h:
* Modules/webdriver/NavigatorWebDriver.h:
* Modules/webgpu/DOMWindowWebGPU.h:
* Modules/websockets/WebSocketChannel.h:
* Modules/webvr/NavigatorWebVR.h:
* accessibility/AXObjectCache.h:
* bindings/js/DOMGCOutputConstraint.h:
* bindings/js/DOMPromiseProxy.h:
* bridge/c/c_runtime.h:
* contentextensions/CombinedURLFilters.cpp:
* crypto/CryptoAlgorithmParameters.h:
* css/CSSComputedStyleDeclaration.h:
* css/CSSRegisteredCustomProperty.h:
* css/DOMCSSPaintWorklet.h:
* css/DOMCSSRegisterCustomProperty.h:
* css/StyleRule.h:
* dom/ConstantPropertyMap.h:
* dom/CustomElementReactionQueue.h:
* dom/Document.h:
* dom/GenericEventQueue.h:
* dom/RejectedPromiseTracker.h:
* dom/UserGestureIndicator.h:
* editing/ReplaceSelectionCommand.cpp:
* editing/SelectionRectGatherer.h:
* editing/TextIterator.h:
* editing/cocoa/HTMLConverter.mm:
* fileapi/AsyncFileStream.cpp:
* fileapi/AsyncFileStream.h:
* html/forms/FileIconLoader.h:
* html/parser/HTMLTreeBuilder.h:
* html/track/WebVTTParser.h:
* inspector/DOMPatchSupport.cpp:
* loader/FrameLoaderClient.h:
* loader/WorkerThreadableLoader.cpp:
* page/IntersectionObserver.h:
* page/PerformanceMonitor.h:
* page/PerformanceUserTiming.h:
* page/PrintContext.h:
* page/ValidationMessageClient.h:
* platform/ColorChooser.h:
* platform/ControlStates.h:
* platform/DataListSuggestionPicker.h:
* platform/FileStream.h:
* platform/KeyedCoding.h:
* platform/LowPowerModeNotifier.h:
* platform/PlatformSpeechSynthesizer.h:
* platform/WebGLStateTracker.h:
* platform/audio/AudioArray.h:
* platform/audio/AudioDestination.h:
* platform/audio/DownSampler.h:
* platform/audio/DynamicsCompressor.h:
* platform/audio/FFTFrame.h:
* platform/audio/HRTFDatabase.h:
* platform/audio/MultiChannelResampler.h:
* platform/audio/Panner.h:
* platform/audio/Reverb.h:
* platform/audio/ReverbConvolver.h:
* platform/audio/ReverbConvolverStage.h:
* platform/audio/UpSampler.h:
* platform/audio/mac/AudioSessionMac.cpp:
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/audio/mac/CARingBuffer.h:
* platform/cocoa/ScrollSnapAnimatorState.h:
* platform/gamepad/PlatformGamepad.h:
* platform/graphics/GraphicsLayer.cpp:
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/PlatformTimeRanges.h:
* platform/graphics/TextTrackRepresentation.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
* platform/sql/SQLiteDatabase.h:
* platform/text/TextCodecICU.h:
* rendering/GridBaselineAlignment.h:
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderObject.h:
* rendering/style/GridArea.h:
* workers/service/context/SWContextManager.h:

Source/WebCore/PAL:

* pal/crypto/openssl/CryptoDigestOpenSSL.cpp:
* pal/system/Clock.h:

Source/WebKit:

* NetworkProcess/NetworkLoad.cpp:
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ImportanceAssertion.h:
* PluginProcess/PluginCreationParameters.h:
* Shared/API/Cocoa/RemoteObjectRegistry.h:
* Shared/WebEvent.h:
* UIProcess/API/APIHTTPCookieStore.cpp:
* UIProcess/API/APINotificationProvider.h:
* UIProcess/API/Cocoa/PageLoadStateObserver.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/BackingStore.h:
* UIProcess/Cocoa/AutomationClient.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.h:
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/FindClient.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/DeviceIdHashSaltStorage.h:
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Gamepad/UIGamepad.h:
* UIProcess/Notifications/WebNotificationProvider.h:
* UIProcess/ProcessAssertion.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/WebContextInjectedBundleClient.h:
* UIProcess/WebFormClient.h:
* UIProcess/WebGeolocationProvider.h:
* UIProcess/WebPageProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
* WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
* WebProcess/Network/webrtc/LibWebRTCNetwork.h:
* WebProcess/Network/webrtc/LibWebRTCSocket.h:
* WebProcess/Network/webrtc/WebRTCResolver.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebPage/DrawingArea.h:

Source/WTF:

* wtf/Function.h:
(WTF::Function<Out):
* wtf/RefCounter.h:
* wtf/URL.h:
* wtf/text/StringView.cpp:

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

8 months agobmalloc uses more memory on iOS compared to macOS due to physical page size differences
msaboff@apple.com [Fri, 8 Feb 2019 02:30:22 +0000 (02:30 +0000)]
bmalloc uses more memory on iOS compared to macOS due to physical page size differences
https://bugs.webkit.org/show_bug.cgi?id=192389

Reviewed by Geoffrey Garen.

Changed small line allocations to be in smallPageSize "virtual page" multiples instead of physical
page size increments for sizes less that the physical page size.  This required changing the small
page commit / decommit code to work in full physical page increments.  For page classes that are
physical page size and larger, there isn't any functional change.

When scavenging page classes smaller than the physical page size, we need to consider whether or
not the adjacent small pages on the same physical page are also free before decommiting that
containing page.  When we need to commit more memory, we commit the whole page, and add any
adjacent virtual pages that were fully committed as well.

* bmalloc/Chunk.h:
(bmalloc::forEachPage):
* bmalloc/Heap.cpp:
(bmalloc::Heap::initializeLineMetadata):
(bmalloc::Heap::initializePageMetadata):
(bmalloc::Heap::scavenge):
(bmalloc::__attribute__):
(bmalloc::Heap::commitSmallPagesInPhysicalPage):
(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::allocateSmallBumpRangesByMetadata):
* bmalloc/Heap.h:
* bmalloc/SmallPage.h:
(bmalloc::SmallPage::refCount):

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

8 months ago[Web GPU] GPUDevice::createTexture implementation prototype
justin_fan@apple.com [Fri, 8 Feb 2019 02:01:39 +0000 (02:01 +0000)]
[Web GPU] GPUDevice::createTexture implementation prototype
https://bugs.webkit.org/show_bug.cgi?id=194409
<rdar://problem/47894312>

Reviewed by Myles C. Maxfield.

Source/WebCore:

Test: textures-textureviews.html updated to test new functionality.

Implement GPUDevice::createTexture():
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createTexture const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
(WebCore::WebGPUTexture::WebGPUTexture):
* Modules/webgpu/WebGPUTexture.h:

Metal backend MTLTextureDescriptor and MTLTexture creation:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateTexture const):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::mtlTextureTypeForGPUTextureDescriptor):
(WebCore::mtlTextureUsageForGPUTextureUsageFlags):
(WebCore::storageModeForPixelFormatAndSampleCount):
(WebCore::tryCreateMtlTextureDescriptor):
(WebCore::GPUTexture::tryCreate):
(WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.

Add GPUUtils.h/cpp for shared utility functions:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::setFormat):
(WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
* platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
(WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.

LayoutTests:

Update textures-textureviews.html to WPT format and to test creation of textures via the GPUDevice.

* webgpu/textures-textureviews-expected.txt:
* webgpu/textures-textureviews.html:

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

8 months ago[iOS] [WK2] Modernize code for applying autocorrection
wenson_hsieh@apple.com [Fri, 8 Feb 2019 01:45:42 +0000 (01:45 +0000)]
[iOS] [WK2] Modernize code for applying autocorrection
https://bugs.webkit.org/show_bug.cgi?id=194397

Reviewed by Tim Horton.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):

Use BlockPtr instead of temporarily storing the completion handler.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Change a LegacySync to Delayed.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applyAutocorrection):
(WebKit::WebPage::syncApplyAutocorrection):
(WebKit::WebPage::applyAutocorrectionInternal):

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

8 months agofast/hidpi/hidpi-long-page-with-inset-element.html is a flaky image failure
commit-queue@webkit.org [Fri, 8 Feb 2019 01:30:19 +0000 (01:30 +0000)]
fast/hidpi/hidpi-long-page-with-inset-element.html is a flaky image failure
https://bugs.webkit.org/show_bug.cgi?id=172384

Unreviewed test gardening.

Patch by Shawn Roberts <sroberts@apple.com> on 2019-02-07

* platform/mac-wk1/TestExpectations:

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

8 months agoFixed animation positioning when homepage animation completes
jond@apple.com [Fri, 8 Feb 2019 01:21:34 +0000 (01:21 +0000)]
Fixed animation positioning when homepage animation completes
https://bugs.webkit.org/show_bug.cgi?id=194395

Reviewed by Devin Rousso.

* wp-content/themes/webkit/front-header.php:

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

8 months agoFix Abs(Neg(x)) -> Abs(x) optimization in B3ReduceStrength
rmorisset@apple.com [Fri, 8 Feb 2019 01:01:38 +0000 (01:01 +0000)]
Fix Abs(Neg(x)) -> Abs(x) optimization in B3ReduceStrength
https://bugs.webkit.org/show_bug.cgi?id=194420

Reviewed by Saam Barati.

In https://bugs.webkit.org/show_bug.cgi?id=194250, I added an optimization: Abs(Neg(x)) -> Abs(x).
But I introduced two bugs, one is that I actually implemented Abs(Neg(x)) -> x, and the other is that the test is looking at Abs(Abs(x)) instead (both were stupid copy-paste mistakes).
This trivial patch fixes both.

* b3/B3ReduceStrength.cpp:
* b3/testb3.cpp:
(JSC::B3::testAbsNegArg):

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

8 months agoWeb Inspector: Make Timeline markers light gray instead of black in dark mode
commit-queue@webkit.org [Fri, 8 Feb 2019 01:01:15 +0000 (01:01 +0000)]
Web Inspector: Make Timeline markers light gray instead of black in dark mode
https://bugs.webkit.org/show_bug.cgi?id=194417

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-07
Reviewed by Devin Rousso.

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.css:
(.timeline-overview-graph.rendering-frame > .divider):
* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .divider):

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

8 months agoDisable the WP emoji polyfill
jond@apple.com [Fri, 8 Feb 2019 00:55:08 +0000 (00:55 +0000)]
Disable the WP emoji polyfill
https://bugs.webkit.org/show_bug.cgi?id=194394

Reviewed by Devin Rousso.

* wp-content/themes/webkit/functions.php:

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

8 months agoFixed responsive design issues for the Contribute drop-down menu and pagination
jond@apple.com [Fri, 8 Feb 2019 00:52:47 +0000 (00:52 +0000)]
Fixed responsive design issues for the Contribute drop-down menu and pagination
https://bugs.webkit.org/show_bug.cgi?id=194393

Reviewed by Devin Rousso.

The short viewport breakpoint styles should apply for small width
windows as well, and pagination styles need to accommodate wrapped
text labels.

* wp-content/themes/webkit/style.css:
(.pagination .page-numbers,):
(@media only screen and (max-height: 415px) and (max-width: 920px)):
(@media only screen and (max-height: 415px)): Deleted.

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

8 months agoBetter error messages for module loader SPI
keith_miller@apple.com [Fri, 8 Feb 2019 00:49:42 +0000 (00:49 +0000)]
Better error messages for module loader SPI
https://bugs.webkit.org/show_bug.cgi?id=194421

Reviewed by Saam Barati.

* API/JSAPIGlobalObject.mm:
(JSC::JSAPIGlobalObject::moduleLoaderImportModule):

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

8 months ago[iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475
wenson_hsieh@apple.com [Fri, 8 Feb 2019 00:49:14 +0000 (00:49 +0000)]
[iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475
https://bugs.webkit.org/show_bug.cgi?id=194415
<rdar://problem/47550281>

Reviewed by Tim Horton.

Source/WebKit:

Fix the bug by not firing the Apple-pencil-exclusive tap gesture recognizer in the case where editable images
are disabled. This gesture recognizer is only used for inserting editable images, and currently conflicts with
the synthetic click gesture recognizer used to recognize clicks from generic digitizer inputs.

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

LayoutTests:

Add a layout test to verify that a stylus tap dispatches clicks.

* fast/events/touch/ios/pencil-tap-dispatches-click-expected.txt: Added.
* fast/events/touch/ios/pencil-tap-dispatches-click.html: Added.

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

8 months agoREGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore...
sihui_liu@apple.com [Fri, 8 Feb 2019 00:45:34 +0000 (00:45 +0000)]
REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
https://bugs.webkit.org/show_bug.cgi?id=194402
<rdar://problem/47858241>

Reviewed by Geoffrey Garen.

r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
is valid during access.

* Modules/indexeddb/server/ServerOpenDBRequest.cpp:
(WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
(WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
* Modules/indexeddb/server/ServerOpenDBRequest.h:

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

8 months ago[macOS] Block coreservicesd in sandbox.
pvollan@apple.com [Fri, 8 Feb 2019 00:02:49 +0000 (00:02 +0000)]
[macOS] Block coreservicesd in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=192670

Reviewed by Alexey Proskuryakov.

Source/WebKit:

We should block CoreServices in newer versions of macOS. In order to achieve this we need to avoid calling
_RegisterApplication before entering the sandbox, since this call will open up a connection to CoreServices.
The call to _RegisterApplication is moved to ChildProcess::updateProcessName, since it is needed to
successfully update the process name. The call to ChildProcess::updateProcessName is made after entering
the sandbox.

* Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::initialize):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::platformInitializeProcess):
* WebProcess/com.apple.WebProcess.sb.in:

Source/WTF:

Add HAVE_CSCHECKFIXDISABLE define.

* wtf/Platform.h:

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

8 months agoFilter out Overconstrainederror.constraint when getUserMedia is not granted
youenn@apple.com [Thu, 7 Feb 2019 23:49:00 +0000 (23:49 +0000)]
Filter out Overconstrainederror.constraint when getUserMedia is not granted
https://bugs.webkit.org/show_bug.cgi?id=194240

Reviewed by Eric Carlson.

Source/WebKit:

Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.

Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.

Covered by added test.

* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
(WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::isPending const):
(WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
(WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
(WebKit::UserMediaPermissionRequestProxy::userMediaID const):
(WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userRequest const):
(WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
(WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
(WebKit::UserMediaPermissionRequestProxy::audioDevice const):
(WebKit::UserMediaPermissionRequestProxy::videoDevice const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
* UIProcess/WebPageProxy.h:

LayoutTests:

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

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

8 months agoOverflow element scrollbar is light for dark mode content.
timothy@apple.com [Thu, 7 Feb 2019 23:34:26 +0000 (23:34 +0000)]
Overflow element scrollbar is light for dark mode content.
https://bugs.webkit.org/show_bug.cgi?id=194407
rdar://problem/45991585

Reviewed by Beth Dakin.

Source/WebCore:

Tested by css-dark-mode/supported-color-schemes-scrollbar.html.

* page/ChromeClient.h:
(WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
that do not implement preferredScrollbarOverlayStyle().
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
to auto detect overlay style when page() is null.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::useDarkAppearance const): Added.
* rendering/RenderLayer.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
(WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Updated tests to look at overflow elements and if dark apearance
is used by the scrollbar directly.

* css-dark-mode/supported-color-schemes-scrollbar-expected.txt:
* css-dark-mode/supported-color-schemes-scrollbar.html:

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

8 months ago[MSE] Convert debug-only logging to runtime logging
eric.carlson@apple.com [Thu, 7 Feb 2019 22:58:05 +0000 (22:58 +0000)]
[MSE] Convert debug-only logging to runtime logging
https://bugs.webkit.org/show_bug.cgi?id=194348
<rdar://problem/47566449>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, this just changes existing logging.

* Modules/mediasource/MediaSource.cpp:
(WebCore::convertEnumerationToString):
(WebCore::MediaSource::MediaSource):
(WebCore::MediaSource::~MediaSource):
(WebCore::MediaSource::setPrivateAndOpen):
(WebCore::MediaSource::addedToRegistry):
(WebCore::MediaSource::removedFromRegistry):
(WebCore::MediaSource::durationChanged):
(WebCore::MediaSource::seekToTime):
(WebCore::MediaSource::completeSeek):
(WebCore::MediaSource::setLiveSeekableRange):
(WebCore::MediaSource::clearLiveSeekableRange):
(WebCore::MediaSource::setDuration):
(WebCore::MediaSource::setDurationInternal):
(WebCore::MediaSource::setReadyState):
(WebCore::MediaSource::endOfStream):
(WebCore::MediaSource::streamEndedWithError):
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::removeSourceBuffer):
(WebCore::MediaSource::isTypeSupported):
(WebCore::MediaSource::detachFromElement):
(WebCore::MediaSource::attachToElement):
(WebCore::MediaSource::openIfInEndedState):
(WebCore::MediaSource::suspend):
(WebCore::MediaSource::resume):
(WebCore::MediaSource::stop):
(WebCore::MediaSource::onReadyStateChange):
(WebCore::MediaSource::scheduleEvent):
(WebCore::MediaSource::logChannel const):
(WebCore::MediaSourceInternal::toString): Deleted.
* Modules/mediasource/MediaSource.h:
(WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
(WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::~SourceBuffer):
(WebCore::SourceBuffer::remove):
(WebCore::SourceBuffer::seekToTime):
(WebCore::SourceBuffer::appendBufferInternal):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBuffer::removeCodedFrames):
(WebCore::SourceBuffer::evictCodedFrames):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
(WebCore::SourceBuffer::monitorBufferingRate):
(WebCore::SourceBuffer::logChannel const):
* Modules/mediasource/SourceBuffer.h:
* dom/Document.cpp:
(WebCore::messageSourceForWTFLogChannel):
(WebCore::Document::didLogMessage):
* html/HTMLMediaElement.cpp:
(WebCore::convertEnumerationToString):
(WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
(WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
(WebCore::HTMLMediaElement::scheduleUpdatePlayState):
(WebCore::HTMLMediaElement::scheduleUpdateMediaState):
* platform/ContentType.cpp:
(WebCore::ContentType::toJSONString const):
* platform/ContentType.h:
(WTF::LogArgument<WebCore::ContentType>::toString):
* platform/MediaSample.h:
(WebCore::MediaSample::toJSONString const):
(WTF::LogArgument<WebCore::MediaSample>::toString):
* platform/graphics/FloatSize.cpp:
(WebCore::FloatSize::toJSONObject const):
(WebCore::FloatSize::toJSONString const):
* platform/graphics/FloatSize.h:
(WTF::LogArgument<WebCore::FloatSize>::toString):
* platform/graphics/MediaSourcePrivate.h:
(WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
(WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
(WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::sourceBufferLogger const):
(WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
(WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::convertEnumerationToString):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::toJSONString const):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::logChannel const):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::bufferWasConsumedCallback):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
(WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
(WebCore::SourceBufferPrivateAVFObjC::setReadyState):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::SourceBufferPrivateAVFObjC::flush):
(WebCore::SourceBufferPrivateAVFObjC::flushVideo):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
(WebCore::SourceBufferPrivateAVFObjC::setActive):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
(WebCore::SourceBufferPrivateAVFObjC::logChannel const):

Source/WTF:

* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an
object that is associated with another logging object.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toJSONObject const):
(WTF::MediaTime::toJSONString const):
(WTF::MediaTimeRange::toJSONString const):
(WTF::toJSONStringInternal): Deleted.
* wtf/MediaTime.h:

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

8 months agowebkitpy: Respect --dedicated-simulators flag
jbedard@apple.com [Thu, 7 Feb 2019 22:57:56 +0000 (22:57 +0000)]
webkitpy: Respect --dedicated-simulators flag
https://bugs.webkit.org/show_bug.cgi?id=194416
<rdar://problem/47894722>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/port/device_port.py:
(DevicePort.supported_device_types): If --dedicated-simulators is passed, all
available devices can be safely ignored.

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

8 months ago[iOS] [WK2] Modernize autocorrection context code
wenson_hsieh@apple.com [Thu, 7 Feb 2019 22:56:58 +0000 (22:56 +0000)]
[iOS] [WK2] Modernize autocorrection context code
https://bugs.webkit.org/show_bug.cgi?id=194373

Reviewed by Tim Horton.

* Shared/ios/WebAutocorrectionContext.h: Added.
(WebKit::WebAutocorrectionContext::encode const):
(WebKit::WebAutocorrectionContext::decode):

Introduce a WebAutocorrectionContext struct that encapsulates the individual pieces of autocorrection context.
Change to use this instead of a long list of arguments when propagating autocorrection context information over
IPC.

* UIProcess/AutoCorrectionCallback.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
(+[WKAutocorrectionContext autocorrectionContextWithContext:]):
(+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): Deleted.

Change this constructor to take an entire WebAutocorrectionContext.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::autocorrectionContextCallback):
(WebKit::WebPageProxy::requestAutocorrectionContext):
(WebKit::WebPageProxy::autocorrectionContextSync):
(WebKit::WebPageProxy::getAutocorrectionContext): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Use Delayed instead of LegacySync.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::autocorrectionContext):

Renamed from computeAutocorrectionContext. This is now a private method on WebPage that uses the focused or main
frame to compute and return a WebAutocorrectionContext.

(WebKit::WebPage::requestAutocorrectionContext):
(WebKit::WebPage::autocorrectionContextSync):

Renamed getAutocorrectionContext to autocorrectionContextSync.

(WebKit::computeAutocorrectionContext): Deleted.
(WebKit::WebPage::getAutocorrectionContext): Deleted.

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

8 months agoSimplify applyConstraints callbacks
youenn@apple.com [Thu, 7 Feb 2019 22:52:15 +0000 (22:52 +0000)]
Simplify applyConstraints callbacks
https://bugs.webkit.org/show_bug.cgi?id=194297

Reviewed by Eric Carlson.

Source/WebCore:

Make use of one callback for both success and failure cases.
No changed of behavior.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::applyConstraints):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create):
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::MockGStreamerAudioCaptureSource::applyConstraints):
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
(WebCore::MockGStreamerVideoCaptureSource::applyConstraints):
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:

Source/WebKit:

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::applyConstraints):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
(WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
(WebKit::UserMediaCaptureManager::applyConstraintsFailed):
* WebProcess/cocoa/UserMediaCaptureManager.h:

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

8 months agoWeb Inspector: Fix modify-css-property-race.html flakiness
nvasilyev@apple.com [Thu, 7 Feb 2019 22:15:09 +0000 (22:15 +0000)]
Web Inspector: Fix modify-css-property-race.html flakiness
https://bugs.webkit.org/show_bug.cgi?id=194408

Reviewed by Devin Rousso.

Event listener wasn't removed property, sometimes causing it to fire one more time.

* inspector/css/modify-css-property-race.html:

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

8 months agoPermit additional IOKit Properties needed by Media PlugIns on older Mac Hardware
bfulgham@apple.com [Thu, 7 Feb 2019 22:11:57 +0000 (22:11 +0000)]
Permit additional IOKit Properties needed by Media PlugIns on older Mac Hardware
https://bugs.webkit.org/show_bug.cgi?id=194412
<rdar://problem/47820615>

Reviewed by Per Arne Vollan.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:

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

8 months agoPermit additional IOKit Properties needed by older Mac Hardware
bfulgham@apple.com [Thu, 7 Feb 2019 22:04:27 +0000 (22:04 +0000)]
Permit additional IOKit Properties needed by older Mac Hardware
https://bugs.webkit.org/show_bug.cgi?id=194410
<rdar://problem/47820620>

Reviewed by Per Arne Vollan.

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

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

8 months agoRename the TAKE_DOWNLOAD_ASSERTION macro.
beidson@apple.com [Thu, 7 Feb 2019 21:25:18 +0000 (21:25 +0000)]
Rename the TAKE_DOWNLOAD_ASSERTION macro.

Rubberstamped by Andy Estes.

* NetworkProcess/Downloads/DownloadMap.cpp:
* NetworkProcess/Downloads/DownloadMap.h:

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

8 months agoFix more doesGC() for CheckTraps, GetMapBucket, and Switch nodes.
mark.lam@apple.com [Thu, 7 Feb 2019 20:20:23 +0000 (20:20 +0000)]
Fix more doesGC() for CheckTraps, GetMapBucket, and Switch nodes.
https://bugs.webkit.org/show_bug.cgi?id=194399
<rdar://problem/47889777>

Reviewed by Yusuke Suzuki.

Fix doesGC() for the following nodes:

    CheckTraps:
        We normally will not emit this node because Options::usePollingTraps() is
        false by default.  However, as it is implemented now, CheckTraps can GC
        because it can allocate a TerminatedExecutionException.  If we make the
        TerminatedExecutionException a singleton allocated at initialization time,
        doesGC() can return false for CheckTraps.
        https://bugs.webkit.org/show_bug.cgi?id=194323

    GetMapBucket:
        Can call operationJSMapFindBucket() or operationJSSetFindBucket(),
        which calls HashMapImpl::findBucket(), which calls jsMapHash(), which
        can resolve a rope.

    Switch:
        If switchData kind is SwitchChar, can call operationResolveRope() .
        If switchData kind is SwitchString and the child use kind is not StringIdentUse,
            can call operationSwitchString() which resolves ropes.

    DirectTailCall:
    ForceOSRExit:
    Return:
    TailCallForwardVarargs:
    TailCallVarargs:
    Throw:
        These are terminal nodes.  It shouldn't really matter what doesGC() returns
        for them, but following our conservative practice, unless we have a good
        reason for doesGC() to return false, we should just return true.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

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

8 months agoUnable to sign in leetcode.
youenn@apple.com [Thu, 7 Feb 2019 20:14:58 +0000 (20:14 +0000)]
Unable to sign in leetcode.
https://bugs.webkit.org/show_bug.cgi?id=194366
rdar://problem/47259025.

Reviewed by Chris Dumez.

Source/WebCore:

In case a signal is passed as part of a FetchRequestInit,
the IDL binding code is throwing an exception in case signal is not an AbortSignal object.
This breaks an AbortSignal shim used in some web sites.
Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest.

Test: http/wpt/fetch/request-abort.html
Also covered by manually signing in to leetcode.

* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
* Modules/fetch/FetchRequestInit.h:
(WebCore::FetchRequestInit::hasMembers const):
* Modules/fetch/FetchRequestInit.idl:

LayoutTests:

* http/wpt/fetch/request-abort-expected.txt: Added.
* http/wpt/fetch/request-abort.html: Added.

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

8 months agoFix XCBuild issue related to codesigning WebContent process
krollin@apple.com [Thu, 7 Feb 2019 19:26:29 +0000 (19:26 +0000)]
Fix XCBuild issue related to codesigning WebContent process
https://bugs.webkit.org/show_bug.cgi?id=193799
<rdar://problem/47533890>

Reviewed by Brent Fulgham.

Building with XCBuild enabled results in the error message "cannot
read entitlement data" when trying to codesign the macOS XPC
processes. The reason for this error message is that there is a build
step that deletes any previous "stale" generated .xcent file before
building up a new one. With XCBuild enabled, the build steps got
re-ordered, such that the step that deletes this file could get
executed after the steps that build up the file. The built-up set of
entitlements is now gone, and the build process fails when `codesign`
tries to access it.

The apparent quick-fix to this problem -- of tweaking dependencies so
that the build steps execute in the desired order -- wouldn't work
with XCBuild. Establishing these dependencies would require both
having multiple build phases produce the same .xcent file as output,
as well as a build phase that has this file as an input and an output.
XCBuild either forbids or frowns upon these configurations.

Ultimately, the solution that worked was to take over complete control
of the codesigning process. This means (a) not specifying a base
.entitlements file that XCode uses to start with (and which was
subsequently altered via custom build scripts), (b) not letting XCode
automatically and silently inject a 'get-task-all' entitlement used to
facilitate debugging (we now add that entitlement by hand), and (c)
building up all of our entitlements by hand via a single custom
script. Because of the addition of this custom script, many other
scripts and entitlements files could now be removed.

* Configurations/BaseXPCService.xcconfig:
* Configurations/Databases-iOS.entitlements: Removed.
* Configurations/Network-OSX-restricted.entitlements: Removed.
* Configurations/Network-OSX-sandbox.entitlements: Removed.
* Configurations/Network-OSX.entitlements: Removed.
* Configurations/NetworkService.xcconfig:
* Configurations/PluginService.64.xcconfig:
* Configurations/PluginService.entitlements: Removed.
* Configurations/WebContent-OSX-sandbox.entitlements: Removed.
* Configurations/WebContent-OSX.entitlements: Removed.
* Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Removed.
* Configurations/WebContentService.xcconfig:
* Scripts/copy-webcontent-resources-to-private-headers.sh:
* Scripts/process-entitlements.sh: Added.
* Scripts/process-network-sandbox-entitlements.sh: Removed.
* Scripts/process-webcontent-or-plugin-entitlements.sh: Removed.
* Scripts/process-webcontent-sandbox-entitlements.sh: Removed.
* WebKit.xcodeproj/project.pbxproj:

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

8 months agoRemove extra copy of 100x100-red.tga
krollin@apple.com [Thu, 7 Feb 2019 19:24:08 +0000 (19:24 +0000)]
Remove extra copy of 100x100-red.tga
https://bugs.webkit.org/show_bug.cgi?id=194371
<rdar://problem/47873465>

Reviewed by Said Abou-Hallawa.

In order to help it pass its tests, Bug 194190 added a second copy of
the file 100x100-red.tga. However, it turns out that this additional
file wasn't actually needed, and that that sole previous copy was
sufficient. At the same time, this second copy -- which was copied to
the same location in the build output as the first copy -- now caused
XCBuild to complain because there were two production rules for the
same output file. Address this by removing the newly-added extra copy.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/100x100-red.tga: Removed.

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

8 months agoFix internal build after r241127
achristensen@apple.com [Thu, 7 Feb 2019 19:21:15 +0000 (19:21 +0000)]
Fix internal build after r241127
https://bugs.webkit.org/show_bug.cgi?id=191394

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
Add some (un)availability macros.

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

8 months agoMake to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager...
youenn@apple.com [Thu, 7 Feb 2019 19:20:15 +0000 (19:20 +0000)]
Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
https://bugs.webkit.org/show_bug.cgi?id=194312

Reviewed by Eric Carlson.

Source/WebCore:

Add a way for sources to know when they are ended, i.e. that they will never be started again.
No observable change of behavior.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::requestStop):
* platform/mediastream/RealtimeMediaSource.h:

Source/WebKit:

Sources in UserMediaCaptureManager and Proxy are never removed once added to their HashMap.
Use the 'ended' mechanism to do the clean-up on WebProcess side.
As part of this clean-up, send IPC to UIProcess to do clean-up on proxy side.
On WebProcess crash case, clean-up the proxy as well.

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::end):
(WebKit::UserMediaCaptureManagerProxy::clear):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::sourceEnded):
* WebProcess/cocoa/UserMediaCaptureManager.h:

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

8 months agoPrint backgrounds preference should be honored instead of WKWebViewConfiguration...
achristensen@apple.com [Thu, 7 Feb 2019 19:01:23 +0000 (19:01 +0000)]
Print backgrounds preference should be honored instead of WKWebViewConfiguration value
https://bugs.webkit.org/show_bug.cgi?id=194364
<rdar://problem/47627599>

Reviewed by Tim Horton.

Without this patch, changing the preference for printing the background has no effect.
This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
are used when printing.  Actually printing verifies this change fixes the bug.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

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

8 months agoHTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject...
jer.noble@apple.com [Thu, 7 Feb 2019 18:59:50 +0000 (18:59 +0000)]
HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class
https://bugs.webkit.org/show_bug.cgi?id=194360

HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should
really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement,
make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor
taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases.

Reviewed by Geoffrey Garen.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::ApplePaySession):
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::UserMediaRequest):
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::PaymentRequest):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::AudioContext):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::FontFaceSet):
* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::ActiveDOMObject):
* dom/ActiveDOMObject.h:
* dom/Document.h:
(WebCore::ActiveDOMObject::ActiveDOMObject):
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::HTMLSourceElement):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::IntersectionObserver):

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