WebKit-https.git
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

8 months agoMark DisplayLink as fast allocated
cdumez@apple.com [Thu, 7 Feb 2019 18:57:41 +0000 (18:57 +0000)]
Mark DisplayLink as fast allocated
https://bugs.webkit.org/show_bug.cgi?id=194400

Reviewed by Geoffrey Garen.

* UIProcess/mac/DisplayLink.h:

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

8 months ago[macOS] API test times out after r241026
pvollan@apple.com [Thu, 7 Feb 2019 18:53:21 +0000 (18:53 +0000)]
[macOS] API test times out after r241026
https://bugs.webkit.org/show_bug.cgi?id=194372

Reviewed by Alex Christensen.

The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
for clients to decide which milestones they would like to listen for.

* WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(layoutMilestones):
(setUpPageLoaderClient):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:

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

8 months agoDeprecate WKBundlePageSetDefersLoading
achristensen@apple.com [Thu, 7 Feb 2019 18:52:54 +0000 (18:52 +0000)]
Deprecate WKBundlePageSetDefersLoading
https://bugs.webkit.org/show_bug.cgi?id=191394

Reviewed by Dean Jackson.

Source/WebKit:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetDefersLoading):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _defersLoading]):
(-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:

Tools:

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

LayoutTests:

* platform/wk2/TestExpectations:

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

8 months agoB3ReduceStrength: missing peephole optimizations for Neg and Sub
rmorisset@apple.com [Thu, 7 Feb 2019 18:36:36 +0000 (18:36 +0000)]
B3ReduceStrength: missing peephole optimizations for Neg and Sub
https://bugs.webkit.org/show_bug.cgi?id=194250

Reviewed by Saam Barati.

Adds the following optimizations for integers:
- Sub(x, x) => 0
    Already covered by the test testSubArg
- Sub(x1, Neg(x2)) => Add (x1, x2)
    Added test: testSubNeg
- Neg(Sub(x1, x2)) => Sub(x2, x1)
    Added test: testNegSub
- Add(Neg(x1), x2) => Sub(x2, x1)
    Added test: testAddNeg1
- Add(x1, Neg(x2)) => Sub(x1, x2)
    Added test: testAddNeg2
Adds the following optimization for floating point values:
- Abs(Neg(x)) => Abs(x)
    Added test: testAbsNegArg
    Adds the following optimization:

Also did some trivial refactoring, using m_value->isInteger() everywhere instead of isInt(m_value->type()), and using replaceWithNew<Value> instead of replaceWithNewValue(m_proc.add<Value(..))

* b3/B3ReduceStrength.cpp:
* b3/testb3.cpp:
(JSC::B3::testAddNeg1):
(JSC::B3::testAddNeg2):
(JSC::B3::testSubNeg):
(JSC::B3::testNegSub):
(JSC::B3::testAbsAbsArg):
(JSC::B3::testAbsNegArg):
(JSC::B3::run):

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

8 months agoDigital crown should scroll safe browsing warning on watchOS
achristensen@apple.com [Thu, 7 Feb 2019 18:24:42 +0000 (18:24 +0000)]
Digital crown should scroll safe browsing warning on watchOS
https://bugs.webkit.org/show_bug.cgi?id=194363
<rdar://problem/47348124>

Reviewed by Wenson Hsieh.

* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
(-[WKSafeBrowsingWarning addContent]):

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

8 months agoShrink and hyphenate safe browsing warning text on watchOS
achristensen@apple.com [Thu, 7 Feb 2019 18:22:12 +0000 (18:22 +0000)]
Shrink and hyphenate safe browsing warning text on watchOS
https://bugs.webkit.org/show_bug.cgi?id=194361
<rdar://problem/47466549>

Reviewed by Geoffrey Garen.

Some internationalizations use long words that didn't fit on small watches.

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontOfSize):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):

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

8 months ago[LFC][Out-of-flow] Use the containing block's padding width when computing min/max...
zalan@apple.com [Thu, 7 Feb 2019 16:45:38 +0000 (16:45 +0000)]
[LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
https://bugs.webkit.org/show_bug.cgi?id=194391

Reviewed by Antti Koivisto.

Source/WebCore:

The spec is not clear about this but that's what matches the current behaviour.

Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):

Tools:

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

LayoutTests:

* fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding-expected.html: Added.
* fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html: Added.

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

8 months ago[LFC] Use dedicated data structures for optional used values (input to geometry funct...
zalan@apple.com [Thu, 7 Feb 2019 16:33:07 +0000 (16:33 +0000)]
[LFC] Use dedicated data structures for optional used values (input to geometry functions)
https://bugs.webkit.org/show_bug.cgi?id=194376

Reviewed by Antti Koivisto.

This is in preparation for being able to pass in the containing block's width as an optional used value.
During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
(): Deleted.
(WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/LayoutUnits.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

8 months agoInfinite recursion via CachedResource::~CachedResource
antti@apple.com [Thu, 7 Feb 2019 16:07:03 +0000 (16:07 +0000)]
Infinite recursion via CachedResource::~CachedResource
https://bugs.webkit.org/show_bug.cgi?id=194378
<rdar://problem/42023295>

Reviewed by Daniel Bates.

I don't know the exact steps to trigger this but the mechanism seems clear.

1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map.
2) This decrements the handle count of resource and causes it be deleted.
3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with
   resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled).
4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created.
   This increments the handle count of the resource from 0 back to 1.
5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3).

The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource.
It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles.

Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource
has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything
other than bail out is going to crash.

CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to
support this erranous call so they are removed as well.

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::~CachedResource):

This is the substantive change. The rest just removes now-dead code.

* loader/cache/CachedResource.h:
(WebCore::CachedResource::setOwningCachedResourceLoader): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::~CachedResourceLoader):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::garbageCollectDocumentResources):
(WebCore::CachedResourceLoader::removeCachedResource): Deleted.
* loader/cache/CachedResourceLoader.h:

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

8 months ago[WPE] Implement GStreamer based holepunch
magomez@igalia.com [Thu, 7 Feb 2019 14:42:32 +0000 (14:42 +0000)]
[WPE] Implement GStreamer based holepunch
https://bugs.webkit.org/show_bug.cgi?id=193715

Reviewed by Xabier Rodriguez-Calvar.

.:

Add GSTREAMER_HOLEPUNCH option to the WPE port with a manual test to
check the feature.

* ManualTests/wpe/video-player-holepunch.html: Added.
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
video sink and drawing then, the player just draws a transparent rectangle on the position where
the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
sink which will be in charge of displaying the video frames in some way (usually on a plane below
the browser), and will push empty frames to the compositor indicating that the rectangle to draw
should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
to tell the video sink where to position the video so it's set below the browser transparent hole.

Added ManualTest wpe/video-player-holepunch.html to test the feature.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
(WebCore::setRectangleToVideoSink):
(WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
(WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
(WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawSolidColor):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::videoBox const):

Source/WebKit:

Add a new parameter to the calls of TextureMapper::drawSolidColor().

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):

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

8 months agoUnreviewed GTK+ gardening after r241117.
magomez@igalia.com [Thu, 7 Feb 2019 11:28:10 +0000 (11:28 +0000)]
Unreviewed GTK+ gardening after r241117.

* platform/gtk/TestExpectations:
* platform/gtk/compositing/iframes/invisible-nested-iframe-show-expected.txt:
* platform/gtk/compositing/iframes/resizer-expected.txt:
* platform/gtk/compositing/rtl/rtl-iframe-absolute-expected.txt:
* platform/gtk/compositing/rtl/rtl-iframe-relative-expected.txt:

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

8 months agoRemove Info.plist from MobileMiniBrowser.framework's Copy Bundle Resources phase
krollin@apple.com [Thu, 7 Feb 2019 07:04:24 +0000 (07:04 +0000)]
Remove Info.plist from MobileMiniBrowser.framework's Copy Bundle Resources phase
https://bugs.webkit.org/show_bug.cgi?id=193975
<rdar://problem/47643306>

Reviewed by Tim Horton.

The MobileMiniBrowser.framework's Copy Bundle Resources phase copies
the Info.plist file into the bundle. This step is not necessary as the
implicit "bundle up all the build products into a framework" build
phase does this already. Having the Copy Bundle Resources phase do
this causes a conflict under XCBuild, which objects to two build
phases producing the same file (Info.plist). Address this by removing
Info.plist from the Copy Bundle Resources phase.

* MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj:

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

8 months ago[JSC] Use BufferInternal single character StringImpl for SmallStrings
ysuzuki@apple.com [Thu, 7 Feb 2019 05:51:46 +0000 (05:51 +0000)]
[JSC] Use BufferInternal single character StringImpl for SmallStrings
https://bugs.webkit.org/show_bug.cgi?id=194374

Reviewed by Geoffrey Garen.

Currently, we first create a large StringImpl, and create bunch of substrings with length = 1.
But pointer is larger than single character. BufferInternal StringImpl with single character
is more memory efficient.

* runtime/SmallStrings.cpp:
(JSC::SmallStringsStorage::SmallStringsStorage):
(JSC::SmallStrings::SmallStrings):
* runtime/SmallStrings.h:

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

8 months ago[JSC] InitializeEntrypointArguments should produce SpecCellCheck if FlushFormat is...
ysuzuki@apple.com [Thu, 7 Feb 2019 04:26:25 +0000 (04:26 +0000)]
[JSC] InitializeEntrypointArguments should produce SpecCellCheck if FlushFormat is FlushedCell
https://bugs.webkit.org/show_bug.cgi?id=194369
<rdar://problem/47813087>

Reviewed by Saam Barati.

JSTests:

* stress/initialize-entrypoint-arguments-with-tdz.js: Added.
(A):

Source/JavaScriptCore:

InitializeEntrypointArguments says SpecCell if the FlushFormat is FlushedCell. But this actually has
JSEmpty if it is TDZ. This incorrectly proved type information removes necessary CheckNotEmpty in
constant folding phase.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

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

8 months agoUnreviewed, rolling out r240759 and r240944.
benjamin@webkit.org [Thu, 7 Feb 2019 03:13:11 +0000 (03:13 +0000)]
Unreviewed, rolling out r240759 and r240944.

Some timer uses are done off the main thread, WebCore::Timer
cannot be used

Reverted changesets:

"<rdar://problem/47570443> Responsiveness timers are too
expensive for frequent events"
https://bugs.webkit.org/show_bug.cgi?id=194003
https://trac.webkit.org/changeset/240759

"Use deferrable timer to restart the Responsiveness Timer on
each wheel event"
https://bugs.webkit.org/show_bug.cgi?id=194135
https://trac.webkit.org/changeset/240944

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

8 months agoAX: com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObje...
cfleizach@apple.com [Thu, 7 Feb 2019 02:53:16 +0000 (02:53 +0000)]
AX:  com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache]
https://bugs.webkit.org/show_bug.cgi?id=194306
<rdar://problem/47764549>

Reviewed by Zalan Bujtas.

Check the page reference is still valid.
Modernize code in this area.

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:

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

8 months agoUpdate .xcfilelist files
krollin@apple.com [Thu, 7 Feb 2019 00:42:18 +0000 (00:42 +0000)]
Update .xcfilelist files

Unreviewed build fix.

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:

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

8 months agoWeb Inspector: DOM: don't send the entire function string with each event listener
drousso@apple.com [Thu, 7 Feb 2019 00:31:56 +0000 (00:31 +0000)]
Web Inspector: DOM: don't send the entire function string with each event listener
https://bugs.webkit.org/show_bug.cgi?id=194293
<rdar://problem/47822809>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:

* runtime/JSFunction.h:
Export `calculatedDisplayName`.

Source/WebCore:

Test: inspector/dom/getEventListenersForNode.html

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):

Source/WebInspectorUI:

* UserInterface/Views/EventListenerSectionGroup.js:
(WI.EventListenerSectionGroup.prototype._functionTextOrLink):

LayoutTests:

* inspector/dom/getEventListenersForNode.html:
* inspector/dom/getEventListenersForNode-expected.txt:

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

8 months agoMove toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
dbates@webkit.org [Thu, 7 Feb 2019 00:23:21 +0000 (00:23 +0000)]
Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
https://bugs.webkit.org/show_bug.cgi?id=194321

Reviewed by Jer Noble.

Move some code to WebEventFactory so that it can be shared by both WKNavigationAction.mm
and UIDelegate.mm among other benefits.

* Shared/mac/WebEventFactory.h:
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::toNSEventModifierFlags):
(WebKit::WebEventFactory::toNSButtonNumber):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]):
(-[WKNavigationAction buttonNumber]):
(toNSEventModifierFlags): Deleted.
(toNSButtonNumber): Deleted.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
(WebKit::toNSEventModifierFlags): Deleted.

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

8 months ago[Payment Request] It should be possible to require a phonetic name for shipping contacts
aestes@apple.com [Wed, 6 Feb 2019 23:18:07 +0000 (23:18 +0000)]
[Payment Request] It should be possible to require a phonetic name for shipping contacts
https://bugs.webkit.org/show_bug.cgi?id=194311
<rdar://46733045>

Reviewed by Alex Christensen.

Source/WebCore:

It should be possible to require that a shipping contact has a phonetic name in Payment Request.
To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.

Since required shipping contact fields can now be specified both in
requiredShippingContactFields and PaymentOptions, we merge the required fields from these
two sources such that, e.g., email is required if it is specified in either place.

So that clients can detect this new feature, the API version number is bumped from 5 to 6.

Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.

* DerivedSources.make:
* Modules/applepay/ApplePayPaymentRequest.h:
* Modules/applepay/ApplePayPaymentRequest.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePayRequestBase.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/PaymentCoordinatorClient.cpp: Added.
(WebCore::PaymentCoordinatorClient::supportsVersion):
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::mergePaymentOptions):
(WebCore::ApplePayPaymentHandler::show):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
* testing/MockPaymentContactFields.h: Added.
(WebCore::MockPaymentContactFields::MockPaymentContactFields):
* testing/MockPaymentContactFields.idl: Added.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:

Source/WebKit:

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::supportsVersion): Deleted.
* WebProcess/ApplePay/WebPaymentCoordinator.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::supportsVersion): Deleted.

LayoutTests:

* http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt:
* http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html:
* http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt:
* http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html:
* http/tests/ssl/applepay/PaymentRequest.https-expected.txt:
* http/tests/ssl/applepay/PaymentRequest.https.html:

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

8 months ago[JSC] PrivateName to PublicName hash table is wasteful
ysuzuki@apple.com [Wed, 6 Feb 2019 22:58:00 +0000 (22:58 +0000)]
[JSC] PrivateName to PublicName hash table is wasteful
https://bugs.webkit.org/show_bug.cgi?id=194277

Reviewed by Michael Saboff.

JSTests:

This test depends on the order of JSSegmentedVariableObjects' variables, which is not guaranteed in JSC. Skipped.

* ChakraCore.yaml:

Source/JavaScriptCore:

PrivateNames account for a lot of memory in the initial JSC footprint. BuiltinNames have Identifier fields corresponding to these PrivateNames
which makes the sizeof(BuiltinNames) about 6KB. It also maintains hash tables for "PublicName to PrivateName" and "PrivateName to PublicName",
each of which takes 16KB memory. While "PublicName to PrivateName" functionality is used in builtin JS (parsing "@xxx" and get a private
name for "xxx"), "PrivateName to PublicName" is rarely used. Holding 16KB hash table for rarely used feature is costly.

In this patch, we add some rules to remove "PrivateName to PublicName" hash table.

1. PrivateName's content should be the same to PublicName.
2. If PrivateName is not actually a private name (we introduced hacky mapping like "@iteratorSymbol" => Symbol.iterator),
   the public name should be easily crafted from the given PrivateName.

We modify the content of private names to ensure (1). And for (2), we can meet this requirement by ensuring that the "@xxxSymbol"
is converted to "Symbol.xxx". (1) and (2) allow us to convert a private name to a public name without a large hash table.

We also remove unused identifiers in CommonIdentifiers. And we also move some of them to WebCore's WebCoreBuiltinNames if it is only used in
WebCore.

* builtins/BuiltinNames.cpp:
(JSC::BuiltinNames::BuiltinNames):
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::lookUpPrivateName const):
(JSC::BuiltinNames::getPublicName const):
(JSC::BuiltinNames::checkPublicToPrivateMapConsistency):
(JSC::BuiltinNames::appendExternalName):
(JSC::BuiltinNames::lookUpPublicName const): Deleted.
* builtins/BuiltinUtils.h:
* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpIdentifiers):
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_getByIdDirectPrivate):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_putByIdDirectPrivate):
* parser/Lexer.cpp:
(JSC::Lexer<LChar>::parseIdentifier):
(JSC::Lexer<UChar>::parseIdentifier):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::createGeneratorParameters):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseAsyncFunctionDeclaration):
(JSC::Parser<LexerType>::parseClassDeclaration):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/ParserArena.h:
(JSC::IdentifierArena::makeIdentifier):
* runtime/CachedTypes.cpp:
(JSC::CachedUniquedStringImpl::encode):
(JSC::CachedUniquedStringImpl::decode const):
* runtime/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::CommonIdentifiers):
(JSC::CommonIdentifiers::lookUpPrivateName const):
(JSC::CommonIdentifiers::getPublicName const):
(JSC::CommonIdentifiers::lookUpPublicName const): Deleted.
* runtime/CommonIdentifiers.h:
* runtime/ExceptionHelpers.cpp:
(JSC::createUndefinedVariableError):
* runtime/Identifier.cpp:
(JSC::Identifier::dump const):
* runtime/Identifier.h:
* runtime/IdentifierInlines.h:
(JSC::Identifier::fromUid):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::JSTypedArrayViewPrototype::finishCreation):
* tools/JSDollarVM.cpp:
(JSC::functionGetPrivateProperty):

Source/WebCore:

Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::addCrossOriginPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::putCommon):
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

* streams/readable-byte-stream-controller-expected.txt:

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

8 months agoReally enable the automatic checking and regenerations of .xcfilelists during builds
krollin@apple.com [Wed, 6 Feb 2019 22:54:54 +0000 (22:54 +0000)]
Really enable the automatic checking and regenerations of .xcfilelists during builds
https://bugs.webkit.org/show_bug.cgi?id=194357
<rdar://problem/47861231>

Reviewed by Chris Dumez.

Bug 194124 was supposed to enable the automatic checking and
regenerating of .xcfilelist files during the build. While related
changes were included in that patch, the change to actually enable the
operation somehow was omitted. This patch actually enables the
operation. The check-xcfilelist.sh scripts now check
WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
from the checking.

Source/JavaScriptCore:

* Scripts/check-xcfilelists.sh:

Source/WebCore:

No new tests since there should be no observable behavior difference.

* Scripts/check-xcfilelists.sh:

Source/WebKit:

* Scripts/check-xcfilelists.sh:

Tools:

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

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

8 months agoForward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit...
wilander@apple.com [Wed, 6 Feb 2019 22:02:15 +0000 (22:02 +0000)]
Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
https://bugs.webkit.org/show_bug.cgi?id=194325
<rdar://problem/47840283>

Reviewed by Chris Dumez.

Source/WebCore:

No new tests. This is just data forwarding. Once the data is stored, I will create
test infrastructure to query it.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::encode const):
(WebCore::AdClickAttribution::decode):
(WebCore::AdClickAttribution::Conversion::encode const):
(WebCore::AdClickAttribution::Conversion::decode):
    Infrastructure for IPC.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
    These functions forward the optional WebCore::AdClickAttribution object
    FrameLoader::loadURL() creates the NavigationAction object and sets the
    WebCore::AdClickAttribution object on there.
* loader/FrameLoader.h:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::adClickAttribution):
(WebCore::NavigationAction::setAdClickAttribution):

Source/WebKit:

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
    Now holds an optional WebCore::AdClickAttribution object.

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

8 months ago[Web GPU] Implement supporting dictionaries for GPUTexture
justin_fan@apple.com [Wed, 6 Feb 2019 21:52:57 +0000 (21:52 +0000)]
[Web GPU] Implement supporting dictionaries for GPUTexture
https://bugs.webkit.org/show_bug.cgi?id=194354

Reviewed by Dean Jackson.

Source/WebCore:

Add dictionaries needed to create a GPUTextureDescriptor.

No new tests; no change in behavior.

New interface and dictionaries added:
* Modules/webgpu/GPUExtent3D.idl:
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/GPUTextureDimension.idl:
* Modules/webgpu/GPUTextureUsage.idl:
* platform/graphics/gpu/GPUExtent3D.h:
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/gpu/GPUTextureDimension.h:
* platform/graphics/gpu/GPUTextureUsage.h:

Update WebGPUTextureFormatEnum to GPUTextureFormat:
* Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
* Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
* platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
* Modules/webgpu/WebGPUSwapChain.cpp:
* Modules/webgpu/WebGPUSwapChain.h:
* Modules/webgpu/WebGPUSwapChain.idl:
* platform/graphics/gpu/GPUSwapChain.h:
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::platformTextureFormatForGPUTextureFormat):
(WebCore::GPUSwapChain::setFormat):

Update project files with new symbols:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

Update test files to use hyphen-case for GPUTextureFormat.

* webgpu/js/basic-webgpu-functions.js:
(async.setUpContexts):
* webgpu/js/webgpu-functions.js:
(createBasicContext):

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

8 months agoFix potential build error in GPUDevice
dino@apple.com [Wed, 6 Feb 2019 21:48:01 +0000 (21:48 +0000)]
Fix potential build error in GPUDevice
https://bugs.webkit.org/show_bug.cgi?id=194359

Reviewed by Joseph Pecoraro.

Add an UNUSED_PARAM for non-macOS platforms.

* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create):

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

8 months agoFix the Apple Internal build. See <rdar://problem/47860943> for more details.
dbates@webkit.org [Wed, 6 Feb 2019 21:44:17 +0000 (21:44 +0000)]
Fix the Apple Internal build. See <rdar://problem/47860943> for more details.

* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
(-[WKFullscreenStackView init]):

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

8 months agoStandardize on ControlKey instead of CtrlKey
dbates@webkit.org [Wed, 6 Feb 2019 21:26:50 +0000 (21:26 +0000)]
Standardize on ControlKey instead of CtrlKey
https://bugs.webkit.org/show_bug.cgi?id=194317

Reviewed by Tim Horton.

Source/WebCore:

* dom/UIEventWithKeyState.cpp:
(WebCore::UIEventWithKeyState::modifiersFromInitializer):
(WebCore::UIEventWithKeyState::setModifierKeys):
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::ctrlKey const):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::accessKeyModifiers):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::accessKeyModifiers):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::controlKey const):
(WebCore::PlatformEvent::PlatformEvent):
(WebCore::PlatformEvent::ctrlKey const): Deleted.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::modifiersForGdkKeyEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent):
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::modifiersForEvent):
* testing/Internals.cpp:
(WebCore::Internals::accessKeyModifiers const):

Source/WebKit:

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
(WebKit::handleKeyPress):

Source/WebKitLegacy/win:

* AccessibleBase.cpp:
(AccessibleBase::get_accKeyboardShortcut):
* WebView.cpp:
(WebView::keyDown):

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

8 months agoFix WatchOS build
achristensen@apple.com [Wed, 6 Feb 2019 20:13:15 +0000 (20:13 +0000)]
Fix WatchOS build
https://bugs.webkit.org/show_bug.cgi?id=194353

Rubber stamped by Tim Horton and Wenson Hsieh.

* rendering/RenderThemeIOS.mm:
(WebCore::iconForAttachment):

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

8 months agoWeb Inspector: "Worker not found" uncaught protocol errors
commit-queue@webkit.org [Wed, 6 Feb 2019 19:57:38 +0000 (19:57 +0000)]
Web Inspector: "Worker not found" uncaught protocol errors
https://bugs.webkit.org/show_bug.cgi?id=194319

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-06
Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WI.terminatePageTarget):
Remove Worker targets associated with the Page on navigation.
Eventually we will have to associate Workers with their parent
frame, but for now a transition can only happen at the Page
level, so we can eliminate all workers on the page.

* UserInterface/Controllers/WorkerManager.js:
(WI.WorkerManager.prototype.workerCreated):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.sendMessageToBackend):
Allow any WorkerAgent domain message to fail silently. This can
happen if a Worker is created and destroyed before the frontend
hears about it and sends messages to the backend for that Worker.

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

8 months ago[JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace
ysuzuki@apple.com [Wed, 6 Feb 2019 19:50:12 +0000 (19:50 +0000)]
[JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace
https://bugs.webkit.org/show_bug.cgi?id=194339

Reviewed by Michael Saboff.

DirectEvalExecutable and IndirectEvalExecutable have completely same memory layout.
They have even the same structure. This patch unifies the subspaces for them.

* runtime/DirectEvalExecutable.h:
* runtime/EvalExecutable.h:
(JSC::EvalExecutable::subspaceFor):
* runtime/IndirectEvalExecutable.h:
* runtime/VM.cpp:
* runtime/VM.h:
(JSC::VM::forEachScriptExecutableSpace):

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

8 months ago[JSC] NativeExecutable should be smaller
ysuzuki@apple.com [Wed, 6 Feb 2019 19:49:04 +0000 (19:49 +0000)]
[JSC] NativeExecutable should be smaller
https://bugs.webkit.org/show_bug.cgi?id=194331

Reviewed by Michael Saboff.

NativeExecutable takes 88 bytes now. Since our GC rounds the size with 16, it actually takes 96 bytes in IsoSubspaces.
Since a lot of NativeExecutable are allocated, we already has two MarkedBlocks even just after JSGlobalObject initialization.
This patch makes sizeof(NativeExecutable) 64 bytes, which is 32 bytes smaller than 96 bytes. Now our JSGlobalObject initialization
only takes one MarkedBlock for NativeExecutable.

To make NativeExecutable smaller,

1. m_numParametersForCall and m_numParametersForConstruct in ExecutableBase are only meaningful in ScriptExecutable subclasses. Since
   they are not touched from JIT, we can remove them from ExecutableBase and move them to ScriptExecutable.

2. DOMJIT::Signature* is rarely used. Rather than having it in NativeExecutable, we should put it in NativeJITCode. Since NativeExecutable
   always has JITCode, we can safely query the value from NativeExecutable. This patch creates NativeDOMJITCode, which is a subclass of
   NativeJITCode, and instantiated only when DOMJIT::Signature* is given.

3. Move Intrinsic to a member of ScriptExecutable or JITCode. Since JITCode has some paddings to put things, we can leverage this to put
   Intrinsic for NativeExecutable.

We also move "clearCode" code from ExecutableBase to ScriptExecutable since it is only valid for ScriptExecutable subclasses.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CallVariant.h:
* interpreter/Interpreter.cpp:
* jit/JITCode.cpp:
(JSC::DirectJITCode::DirectJITCode):
(JSC::NativeJITCode::NativeJITCode):
(JSC::NativeDOMJITCode::NativeDOMJITCode):
* jit/JITCode.h:
(JSC::JITCode::signature const):
(JSC::JITCode::intrinsic):
* jit/JITOperations.cpp:
* jit/JITThunks.cpp:
(JSC::JITThunks::hostFunctionStub):
* jit/Repatch.cpp:
* llint/LLIntSlowPaths.cpp:
* runtime/ExecutableBase.cpp:
(JSC::ExecutableBase::dump const):
(JSC::ExecutableBase::hashFor const):
(JSC::ExecutableBase::hasClearableCode const): Deleted.
(JSC::ExecutableBase::clearCode): Deleted.
* runtime/ExecutableBase.h:
(JSC::ExecutableBase::ExecutableBase):
(JSC::ExecutableBase::isModuleProgramExecutable):
(JSC::ExecutableBase::isHostFunction const):
(JSC::ExecutableBase::generatedJITCodeForCall const):
(JSC::ExecutableBase::generatedJITCodeForConstruct const):
(JSC::ExecutableBase::generatedJITCodeFor const):
(JSC::ExecutableBase::generatedJITCodeForCall): Deleted.
(JSC::ExecutableBase::generatedJITCodeForConstruct): Deleted.
(JSC::ExecutableBase::generatedJITCodeFor): Deleted.
(JSC::ExecutableBase::offsetOfNumParametersFor): Deleted.
(JSC::ExecutableBase::hasJITCodeForCall const): Deleted.
(JSC::ExecutableBase::hasJITCodeForConstruct const): Deleted.
(JSC::ExecutableBase::intrinsic const): Deleted.
* runtime/ExecutableBaseInlines.h: Added.
(JSC::ExecutableBase::intrinsic const):
(JSC::ExecutableBase::hasJITCodeForCall const):
(JSC::ExecutableBase::hasJITCodeForConstruct const):
* runtime/JSBoundFunction.cpp:
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/NativeExecutable.cpp:
(JSC::NativeExecutable::create):
(JSC::NativeExecutable::createStructure):
(JSC::NativeExecutable::NativeExecutable):
(JSC::NativeExecutable::signatureFor const):
(JSC::NativeExecutable::intrinsic const):
* runtime/NativeExecutable.h:
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::ScriptExecutable):
(JSC::ScriptExecutable::clearCode):
(JSC::ScriptExecutable::installCode):
(JSC::ScriptExecutable::hasClearableCode const):
* runtime/ScriptExecutable.h:
(JSC::ScriptExecutable::intrinsic const):
(JSC::ScriptExecutable::hasJITCodeForCall const):
(JSC::ScriptExecutable::hasJITCodeForConstruct const):
* runtime/VM.cpp:
(JSC::VM::getHostFunction):

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

8 months agoWTR::InjectedBundlePage::willSendRequestForFrame() leaks a WKDataRef
ddkilzer@apple.com [Wed, 6 Feb 2019 19:32:31 +0000 (19:32 +0000)]
WTR::InjectedBundlePage::willSendRequestForFrame() leaks a WKDataRef
<https://webkit.org/b/194286>
<rdar://problem/47815558>

Reviewed by Alexey Proskuryakov.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willSendRequestForFrame): Use
WKRetainPtr<> to avoid leaking the WKDataRef.

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

8 months agoRevert part of r241015 that skipped all WebGL tests
ddkilzer@apple.com [Wed, 6 Feb 2019 18:59:01 +0000 (18:59 +0000)]
Revert part of r241015 that skipped all WebGL tests

* TestExpectations: Revert unintended change to skip all WebGL
tests.

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

8 months ago[iPad] Initial test gardening (Part 2)
jbedard@apple.com [Wed, 6 Feb 2019 18:24:32 +0000 (18:24 +0000)]
[iPad] Initial test gardening (Part 2)
https://bugs.webkit.org/show_bug.cgi?id=193767
<rdar://problem/47515175>

Unreviewed test gardening.

* fast/forms/ios/validation-bubble-dismiss-on-tap.html: Change tap location so test is compatible with iPads.
* platform/ipad/TestExpectations: Associate iPad specific failures with bugs.

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

8 months ago[SVG] fix SVGURIReference build by including SVGElement
commit-queue@webkit.org [Wed, 6 Feb 2019 18:22:37 +0000 (18:22 +0000)]
[SVG] fix SVGURIReference build by including SVGElement
https://bugs.webkit.org/show_bug.cgi?id=194292

Patch by Olivier Blin <olivier.blin@softathome.com> on 2019-02-06
Reviewed by Michael Catanzaro.

* svg/SVGURIReference.h:
SVGURIReference is making use of SVGElement in its constructor, but
it was not declared.

The issue was not seen in unified builds because it was grouped with
other files including SVGElement.

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

8 months agoRoll out parts of r238819 since it is a PLT performance regression.
pvollan@apple.com [Wed, 6 Feb 2019 17:58:23 +0000 (17:58 +0000)]
Roll out parts of r238819 since it is a PLT performance regression.
https://bugs.webkit.org/show_bug.cgi?id=194346

Unreviewed performance fix.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didStartProvisionalLoadForFrame):
(didReceiveServerRedirectForProvisionalLoadForFrame):
(didFinishLoadForFrame):
(globalObjectIsAvailableForFrame):
(didRemoveFrameFromHierarchy):
(didCommitLoadForFrame):
(didFinishDocumentLoadForFrame):
(didFailProvisionalLoadWithErrorForFrame):
(didFailLoadWithErrorForFrame):
(didSameDocumentNavigationForFrame):
(didLayoutForFrame):
(didReachLayoutMilestone):
(didFirstVisuallyNonEmptyLayoutForFrame):
(didHandleOnloadEventsForFrame):
(userAgentForURL):
(setUpPageLoaderClient):
(willSendRequestForFrame):
(didInitiateLoadForResource):
(didFinishLoadForResource):
(didFailLoadForResource):
(setUpResourceLoadClient):
(-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
(ResourceLoadClient::ResourceLoadClient): Deleted.
(ResourceLoadClient::loadDelegate const): Deleted.
(ResourceLoadClient::pluginContextController const): Deleted.
(PageLoaderClient::PageLoaderClient): Deleted.
(PageLoaderClient::loadDelegate const): Deleted.
(PageLoaderClient::pluginContextController const): Deleted.
(PageLoaderClient::didStartProvisionalLoadForFrame): Deleted.
(PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
(PageLoaderClient::didFinishLoadForFrame): Deleted.
(PageLoaderClient::globalObjectIsAvailableForFrame): Deleted.
(PageLoaderClient::didRemoveFrameFromHierarchy): Deleted.
(PageLoaderClient::didCommitLoadForFrame): Deleted.
(PageLoaderClient::didFinishDocumentLoadForFrame): Deleted.
(PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted.
(PageLoaderClient::didFailLoadWithErrorForFrame): Deleted.
(PageLoaderClient::didSameDocumentNavigationForFrame): Deleted.
(PageLoaderClient::didLayoutForFrame): Deleted.
(PageLoaderClient::didReachLayoutMilestone): Deleted.
(PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
(PageLoaderClient::layoutMilestones const): Deleted.
(PageLoaderClient::didHandleOnloadEventsForFrame): Deleted.
(PageLoaderClient::userAgentForURL const): Deleted.
(ResourceLoadClient::willSendRequestForFrame): Deleted.
(ResourceLoadClient::didInitiateLoadForResource): Deleted.
(ResourceLoadClient::didFinishLoadForResource): Deleted.
(ResourceLoadClient::didFailLoadForResource): Deleted.

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

8 months agoUnreviewed test gardening, rebaseline some tests for iOS after r240713.
ryanhaddad@apple.com [Wed, 6 Feb 2019 17:57:13 +0000 (17:57 +0000)]
Unreviewed test gardening, rebaseline some tests for iOS after r240713.

* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-block-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-document-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-scrolling-state-expected.txt:
* fast/events/touch/ios/tap-with-active-touch-end-listener-expected.txt:

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

8 months agoUnreviewed, fix a typo
mcatanzaro@igalia.com [Wed, 6 Feb 2019 17:32:18 +0000 (17:32 +0000)]
Unreviewed, fix a typo

* TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp:

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

8 months ago[LFC][IFC] Move line layout code to a dedicated file
zalan@apple.com [Wed, 6 Feb 2019 17:04:44 +0000 (17:04 +0000)]
[LFC][IFC] Move line layout code to a dedicated file
https://bugs.webkit.org/show_bug.cgi?id=194328

Reviewed by Antti Koivisto.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::isTrimmableContent): Deleted.
(WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
(WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
(WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::adjustedLineLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::close): Deleted.

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

8 months agoCoreAudioCaptureSource should not configure its audio unit until it starts producing...
youenn@apple.com [Wed, 6 Feb 2019 16:59:41 +0000 (16:59 +0000)]
CoreAudioCaptureSource should not configure its audio unit until it starts producing data
https://bugs.webkit.org/show_bug.cgi?id=194310

Reviewed by Eric Carlson.

Delay the configuration of the audio unit until the source is instructed to start producing data.
This allows the UIProcess to not start changing the audio unit when
checking for constraints during getUserMedia call before the prompt.
Covered by manual testing.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
(WebCore::CoreAudioCaptureSource::startProducingData):
* platform/mediastream/mac/CoreAudioCaptureSource.h:

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

8 months agoDisable audio ducking at Audio Unit setup time
youenn@apple.com [Wed, 6 Feb 2019 16:58:46 +0000 (16:58 +0000)]
Disable audio ducking at Audio Unit setup time
https://bugs.webkit.org/show_bug.cgi?id=194303

Reviewed by Eric Carlson.

When creating a CoreAudioCaptureSource, the audio unit might be
reconfigured if a past audio capture was done.
This might trigger audio ducking which is undone in startInternal.
In some cases, startInternal will never call start.
In that case, the audio unit will continue ducking the other processing.
To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.

In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
This might affect all applications.
Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
This has noticeable effects in the quality of audio being played on bluetooth devices.

Covered by manual tests.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::unduck):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::captureFailed):
(WebCore::CoreAudioSharedUnit::stopProducingData):

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

8 months agoVersioning.
kocsen_chung@apple.com [Wed, 6 Feb 2019 16:30:43 +0000 (16:30 +0000)]
Versioning.

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

8 months agoVersioning.
kocsen_chung@apple.com [Wed, 6 Feb 2019 15:59:16 +0000 (15:59 +0000)]
Versioning.

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

8 months agoRELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent...
antti@apple.com [Wed, 6 Feb 2019 15:44:28 +0000 (15:44 +0000)]
RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=194333
<rdar://problem/47822929>

Reviewed by Zalan Bujtas.

Source/WebCore:

Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
the legacy animation code triggering a resource load.

Test: http/tests/contentextensions/css-display-none-keyframe.html

* style/StyleScope.cpp:
(WebCore::Style::Scope::scheduleUpdate):

Avoid clearing the style resolver if we are in the middle of a style resolution.
A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.

LayoutTests:

* http/tests/contentextensions/css-display-none-keyframe-expected.txt: Added.
* http/tests/contentextensions/css-display-none-keyframe.html: Added.
* http/tests/contentextensions/css-display-none-keyframe.html.json: Added.

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

8 months agoBuild failure after r240315
commit-queue@webkit.org [Wed, 6 Feb 2019 15:40:30 +0000 (15:40 +0000)]
Build failure after r240315
https://bugs.webkit.org/show_bug.cgi?id=194341

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-02-06
Reviewed by Wenson Hsieh.

* bindings/js/JSUndoItemCustom.cpp:
(WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):

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

8 months ago[GTK][WPE] force libpsl build to use ICU in jhbuild
commit-queue@webkit.org [Wed, 6 Feb 2019 13:47:50 +0000 (13:47 +0000)]
[GTK][WPE] force libpsl build to use ICU in jhbuild
https://bugs.webkit.org/show_bug.cgi?id=194288

Patch by Olivier Blin <olivier.blin@softathome.com> on 2019-02-06
Reviewed by Carlos Garcia Campos.

* gtk/jhbuild.modules:
Require ICU for libpsl build in jhbuild, like done in WPE.

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

8 months agoREGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with...
rniwa@webkit.org [Wed, 6 Feb 2019 09:42:49 +0000 (09:42 +0000)]
REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
https://bugs.webkit.org/show_bug.cgi?id=194329

Reviewed by Geoffrey Garen.

Source/WebCore:

The bug was caused by the code path for when navigating with a specific target frame name that does not exist
never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
navigation, resulting in this release assertion.

Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.

Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html

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

LayoutTests:

Added a regression test.

* fast/loader/navigate-with-new-target-after-back-forward-navigation-expected.txt: Added.
* fast/loader/navigate-with-new-target-after-back-forward-navigation.html: Added.

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

8 months agoBuild failure after r240431
commit-queue@webkit.org [Wed, 6 Feb 2019 09:35:16 +0000 (09:35 +0000)]
Build failure after r240431
https://bugs.webkit.org/show_bug.cgi?id=194330

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-02-06
Reviewed by Žan Doberšek.

* API/glib/JSCOptions.cpp:

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

8 months agoREGRESSION(r240785): [SOUP] Broke cookie persistent storage
mcatanzaro@igalia.com [Wed, 6 Feb 2019 08:05:57 +0000 (08:05 +0000)]
REGRESSION(r240785): [SOUP] Broke cookie persistent storage
https://bugs.webkit.org/show_bug.cgi?id=194209

Reviewed by Carlos Garcia Campos.

Source/WebKit:

I missed a spot when moving the persistent storage parameters from NetworkProcess to
NetworkSession. They have to be initialized separately for the default session.

* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

Tools:

Enhance TestCookieManager to ensure this doesn't happen again.

* TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp:
(testCookieManagerPersistentStorage):
(beforeAll):

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

8 months ago[FreeType] Build fix for Debian stable
csaavedra@igalia.com [Wed, 6 Feb 2019 07:54:43 +0000 (07:54 +0000)]
[FreeType] Build fix for Debian stable

Unreviewed build fix.

Debian stable currently has a version of fontconfig that doesn't
yet have FC_COLOR. #ifdef its use to fix the build.

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters):

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

8 months agoWeb Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are...
nvasilyev@apple.com [Wed, 6 Feb 2019 06:54:43 +0000 (06:54 +0000)]
Web Inspector: Styles: PropertiesChanged shouldn't fire when old and new text are both empty
https://bugs.webkit.org/show_bug.cgi?id=194318

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Previously, WI.CSSStyleDeclaration.Event.PropertiesChanged fired when
old text and new text were empty strings.

* UserInterface/Models/CSSStyleDeclaration.js:

LayoutTests:

Fix the flaky test on Debug.

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

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

8 months ago[iOS] Layout tests editing/pasteboard/smart-paste-007.html and editing/pasteboard...
megan_gardner@apple.com [Wed, 6 Feb 2019 05:52:01 +0000 (05:52 +0000)]
[iOS] Layout tests editing/pasteboard/smart-paste-007.html and editing/pasteboard/smart-paste-008.html are failing
https://bugs.webkit.org/show_bug.cgi?id=194275

Reviewed by Ryosuke Niwa.

Smart paste tests 7 and 8 were outputting more information that was needed
to verify correct functionality. Also cleaned up test 8 to be more similar to
the other smart copy paste tests.

* editing/pasteboard/smart-paste-007.html:
* editing/pasteboard/smart-paste-008.html:
* platform/ios-wk1/editing/pasteboard/smart-paste-007-expected.txt: Removed.
* platform/ios-wk1/editing/pasteboard/smart-paste-008-expected.txt: Removed.
* platform/ios-wk2/editing/pasteboard/smart-paste-008-expected.txt: Removed.
* platform/ios/editing/pasteboard/smart-paste-007-expected.txt: Renamed from LayoutTests/platform/ios-wk2/editing/pasteboard/smart-paste-007-expected.txt.
* platform/ios/editing/pasteboard/smart-paste-008-expected.txt: Added.
* platform/mac/editing/pasteboard/smart-paste-007-expected.txt:
* platform/mac/editing/pasteboard/smart-paste-008-expected.txt:

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

8 months agoRename TestOptions.ignoreSynchronousMessagingTimeoutsForTesting
wenson_hsieh@apple.com [Wed, 6 Feb 2019 04:26:54 +0000 (04:26 +0000)]
Rename TestOptions.ignoreSynchronousMessagingTimeoutsForTesting
https://bugs.webkit.org/show_bug.cgi?id=194324

Reviewed by Andy Estes.

Tools:

Rename ignoreSynchronousMessagingTimeoutsForTesting to just ignoreSynchronousMessagingTimeouts. The -ForTesting
part of the name is already implicit, since this is in testing code in TestOptions.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration const):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

* fast/events/touch/ios/show-modal-alert-during-touch-start.html:

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

8 months agoStop using blobRegistry in NetworkProcess
commit-queue@webkit.org [Wed, 6 Feb 2019 02:10:50 +0000 (02:10 +0000)]
Stop using blobRegistry in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194027

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

Source/WebCore:

Also stop using NetworkBlobRegistry::singleton.
Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
We now have to resolve all blob file references while we still have a
NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
using the singleton after we have passed everything to the loading code, but it works the same
as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
which extensions to revoke.

* platform/network/BlobRegistryImpl.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
(WebCore::FormData::resolveBlobReferences):
* platform/network/FormData.h:
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::createHTTPBodyCFReadStream):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::CurlFormDataStream):

Source/WebKit:

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
(WebKit::NetworkBlobRegistry::filesInBlob):
(WebKit::NetworkBlobRegistry::singleton): Deleted.
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
(WebKit::NetworkBlobRegistry::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::preconnectTo):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::filesInBlob):
(WebKit::NetworkConnectionToWebProcess::blobRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::initialize):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::networkBlobRegistry):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/PreconnectTask.cpp:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

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

8 months agoFix a typo in r241006. Substitute Modifier for Modifiers.
dbates@webkit.org [Wed, 6 Feb 2019 01:44:21 +0000 (01:44 +0000)]
Fix a typo in r241006. Substitute Modifier for Modifiers.

* Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):

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

8 months agoAttempt to fix the build following r241000
dbates@webkit.org [Wed, 6 Feb 2019 01:42:42 +0000 (01:42 +0000)]
Attempt to fix the build following r241000
(https://bugs.webkit.org/show_bug.cgi?id=194241)

Substitute OptionSet<WebEvent::Modifier> for Modifiers.

* Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
* Shared/mac/WebGestureEvent.h:
(WebKit::WebGestureEvent::WebGestureEvent):

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

8 months agoUnreviewed, rolling out r240984.
tsavell@apple.com [Wed, 6 Feb 2019 01:02:44 +0000 (01:02 +0000)]
Unreviewed, rolling out r240984.

Revision casued two API timeouts

Reverted changeset:

"Stop using blobRegistry in NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=194027
https://trac.webkit.org/changeset/240984

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

8 months agoWeb Inspector: Lots of time spent updating related resources in ResourceDetailsSideba...
drousso@apple.com [Wed, 6 Feb 2019 01:01:38 +0000 (01:01 +0000)]
Web Inspector: Lots of time spent updating related resources in ResourceDetailsSidebar when loading a page with lots of resources
https://bugs.webkit.org/show_bug.cgi?id=159577
<rdar://problem/27251461>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype._refreshRelatedResourcesSection):
(WI.ResourceDetailsSidebarPanel.prototype._applyResourceEventListeners):

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

8 months agoWeb Inspector: Elements tab: selection is broken after deleting the selected node
mattbaker@apple.com [Wed, 6 Feb 2019 00:55:28 +0000 (00:55 +0000)]
Web Inspector: Elements tab: selection is broken after deleting the selected node
https://bugs.webkit.org/show_bug.cgi?id=194300
<rdar://problem/47829275>

Reviewed by Devin Rousso.

Deleting a TreeElement can cause an IndexSet including indexes
outside the deleted range to be passed to SelectionController,
corrupting the internal selection state.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._indexesForSubtree.numberOfElementsInSubtree): Added.
(WI.TreeOutline.prototype._indexesForSubtree):
Finding the last (rightmost leaf) TreeElement in the subtree used
TreeElement.prototype.traverseNextElement to do a depth first traversal.
This method did not stay within the subtree rooted at `treeElement`.

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

8 months agoUserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
youenn@apple.com [Wed, 6 Feb 2019 00:49:48 +0000 (00:49 +0000)]
UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
https://bugs.webkit.org/show_bug.cgi?id=194246

Reviewed by Eric Carlson.

With PSON enabled, the manager proxy can be destroyed.
It is thus important for its callbacks to check for 'this' to be valid.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):

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

8 months agoAttempt to fix the build following r241000
dbates@webkit.org [Wed, 6 Feb 2019 00:39:46 +0000 (00:39 +0000)]
Attempt to fix the build following r241000
(https://bugs.webkit.org/show_bug.cgi?id=194241)

Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey.

* Shared/gtk/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::protocolModifierToWebEventModifier):
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::modifiersToEventState):
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::toNSEventModifierFlags):

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

8 months agoMake WebEvent::Modifiers an OptionSet
dbates@webkit.org [Wed, 6 Feb 2019 00:21:21 +0000 (00:21 +0000)]
Make WebEvent::Modifiers an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=194241

Reviewed by Simon Fraser.

Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety
and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for
OptionSet.

While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes
this enum more closely match WebCore::PlatformEvent::Modifier.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* Shared/WebEvent.cpp:
(WebKit::WebEvent::WebEvent):
* Shared/WebEvent.h:
(WebKit::WebEvent::shiftKey const):
(WebKit::WebEvent::controlKey const):
(WebKit::WebEvent::altKey const):
(WebKit::WebEvent::metaKey const):
(WebKit::WebEvent::capsLockKey const):
(WebKit::WebEvent::modifiers const):
(WebKit::WebTouchEvent::WebTouchEvent):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/WebMouseEvent.cpp:
(WebKit::WebMouseEvent::WebMouseEvent):
* Shared/WebTouchEvent.cpp:
(WebKit::WebTouchEvent::WebTouchEvent):
* Shared/WebWheelEvent.cpp:
(WebKit::WebWheelEvent::WebWheelEvent):
* Shared/gtk/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
* Shared/ios/WebIOSEventFactory.mm:
(modifiersForEvent):
(WebIOSEventFactory::createWebKeyboardEvent):
(WebIOSEventFactory::createWebMouseEvent):
* Shared/libwpe/WebEventFactory.cpp:
(WebKit::modifiersForEventModifiers):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* Shared/win/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
(WebKit::modifiersForCurrentKeyState):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::mouseDidMoveOverElement):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/API/glib/WebKitPrivate.cpp:
(toPlatformModifiers):
* UIProcess/API/glib/WebKitPrivate.h:
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewMouseTargetChanged):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::simulateMouseInteraction):
(WebKit::protocolModifierToWebEventModifier):
(WebKit::WebAutomationSession::performMouseInteraction):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::modifiersToEventState):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
(WebKit::modifiersToEventState):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::toNSEventModifierFlags):
(WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
(API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
(WebKit::InjectedBundleNavigationAction::modifiers const):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showContextMenuAtPoint):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createWebEvent const):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mouseDidMoveOverElement):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::simulateMouseDown):
(WebKit::WebPage::simulateMouseUp):
(WebKit::WebPage::simulateMouseMotion):

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

8 months ago[ews-build] Allow * as platform for builders and workers
aakash_jain@apple.com [Tue, 5 Feb 2019 23:43:15 +0000 (23:43 +0000)]
[ews-build] Allow * as platform for builders and workers
https://bugs.webkit.org/show_bug.cgi?id=188533

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
(checkWorkersAndBuildersForConsistency):

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

8 months agoFix DFG's doesGC() for a few more nodes.
mark.lam@apple.com [Tue, 5 Feb 2019 23:34:05 +0000 (23:34 +0000)]
Fix DFG's doesGC() for a few more nodes.
https://bugs.webkit.org/show_bug.cgi?id=194307
<rdar://problem/47832956>

Reviewed by Yusuke Suzuki.

Fix doesGC() for the following nodes:

    NumberToStringWithValidRadixConstant:
        Calls operationInt32ToStringWithValidRadix(), which calls int32ToString(),
        which can allocate a string.
        Calls operationInt52ToStringWithValidRadix(), which calls int52ToString(),
        which can allocate a string.
        Calls operationDoubleToStringWithValidRadix(), which calls numberToString(),
        which can allocate a string.

    RegExpExecNonGlobalOrSticky: calls createRegExpMatchesArray() which allocates
        memory for all kinds of objects.
    RegExpMatchFast: calls operationRegExpMatchFastString(), which calls
        RegExpObject::execInline() and RegExpObject::matchGlobal().  Both of
        these allocates memory for the match result.
    RegExpMatchFastGlobal: calls operationRegExpMatchFastGlobalString(), which
        calls RegExpObject's collectMatches(), which allocates an array amongst
        other objects.

    StringFromCharCode:
        If the uint32 code to convert is greater than maxSingleCharacterString,
        we'll call operationStringFromCharCode(), which calls jsSingleCharacterString(),
        which allocates a new string if the code is greater than maxSingleCharacterString.

Also fix SpeculativeJIT::compileFromCharCode() and FTL's compileStringFromCharCode()
to use maxSingleCharacterString instead of a literal constant.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileFromCharCode):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringFromCharCode):

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