WebKit-https.git
5 months agoRegression (r254399) [ Mac ] imported/w3c/web-platform-tests/2dcontext/imagebitmap...
tsavell@apple.com [Thu, 6 Feb 2020 16:28:23 +0000 (16:28 +0000)]
Regression (r254399) [ Mac ] imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207333

Unreviewed test gardening.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-06

* platform/mac/TestExpectations:

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

5 months ago[IPC hardening] Update WebPasteboardProxy methods to validate their parameters
cdumez@apple.com [Thu, 6 Feb 2020 16:02:51 +0000 (16:02 +0000)]
[IPC hardening] Update WebPasteboardProxy methods to validate their parameters
https://bugs.webkit.org/show_bug.cgi?id=207308
<rdar://problem/58632938>

Reviewed by Alex Christensen.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardTypes):
(WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
(WebKit::WebPasteboardProxy::getPasteboardStringForType):
(WebKit::WebPasteboardProxy::getPasteboardStringsForType):
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::pasteboardCopy):
(WebKit::WebPasteboardProxy::getPasteboardChangeCount):
(WebKit::WebPasteboardProxy::getPasteboardColor):
(WebKit::WebPasteboardProxy::getPasteboardURL):
(WebKit::WebPasteboardProxy::addPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardURL):
(WebKit::WebPasteboardProxy::setPasteboardColor):
(WebKit::WebPasteboardProxy::setPasteboardStringForType):
(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
(WebKit::WebPasteboardProxy::getNumberOfFiles):
(WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
(WebKit::WebPasteboardProxy::writeCustomData):
(WebKit::WebPasteboardProxy::allPasteboardItemInfo):
(WebKit::WebPasteboardProxy::informationForItemAtIndex):
(WebKit::WebPasteboardProxy::getPasteboardItemsCount):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
(WebKit::WebPasteboardProxy::writeURLToPasteboard):
(WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
(WebKit::WebPasteboardProxy::writeImageToPasteboard):
(WebKit::WebPasteboardProxy::writeStringToPasteboard):
(WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers):

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

5 months ago[IPC Hardening] Protect against bad identifier in WebPageProxy::DidInsertAttachmentWi...
cdumez@apple.com [Thu, 6 Feb 2020 16:00:40 +0000 (16:00 +0000)]
[IPC Hardening] Protect against bad identifier in WebPageProxy::DidInsertAttachmentWithIdentifier()
https://bugs.webkit.org/show_bug.cgi?id=207311
<rdar://problem/58632517>

Reviewed by Alex Christensen.

* UIProcess/WebPageProxy.cpp:

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

5 months ago[Web Animations] Ensure all timelines are detached from their document
commit-queue@webkit.org [Thu, 6 Feb 2020 15:56:02 +0000 (15:56 +0000)]
[Web Animations] Ensure all timelines are detached from their document
https://bugs.webkit.org/show_bug.cgi?id=207331
<rdar://problem/59210306>

Patch by Antoine Quint <graouts@apple.com> on 2020-02-06
Reviewed by Dean Jackson.

We recently added a WeakHashSet<DocumentTimeline> m_timelines member to Document and added code to ~DocumentTimeline
to remove themselves from their Document's m_timelines. However, Document::prepareForDestruction() would call
DocumentTimeline::detachFromDocument() only for the main timeline and neglect to do the same for any additional
timelines that may have been created with the DocumentTimeline constructor.

We now cleanly call DocumentTimeline::detachFromDocument() for all items in a Document's m_timelines, which has the
effect of clearing the Document <> DocumentTimeline relationship since DocumentTimeline::detachFromDocument() now
calls Document::removeTimeline().

Finally, we now call DocumentTimeline::detachFromDocument() from the DocumentTimeline destructor to ensure that timelines
that were created purely in JS but got garbage-collected are no longer referenced from the Document still.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::~DocumentTimeline):
(WebCore::DocumentTimeline::detachFromDocument):
(WebCore::DocumentTimeline::cacheCurrentTime):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):

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

5 months agoUnreviewed. [GTK] Use radio buttons instead of a combo for text direction in theme...
carlosgc@webkit.org [Thu, 6 Feb 2020 11:23:45 +0000 (11:23 +0000)]
Unreviewed. [GTK] Use radio buttons instead of a combo for text direction in theme test

* ManualTests/gtk/theme.html:

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

5 months ago[Cairo] Do not use old-style GNU field initializers
aperez@igalia.com [Thu, 6 Feb 2020 08:47:38 +0000 (08:47 +0000)]
[Cairo] Do not use old-style GNU field initializers
https://bugs.webkit.org/show_bug.cgi?id=207309

Reviewed by Carlos Garcia Campos.

No new tests needed.

* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::addConicSector): Use the standard named field initializer syntax instead.

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

5 months ago[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
youenn@apple.com [Thu, 6 Feb 2020 08:34:49 +0000 (08:34 +0000)]
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Source/WebCore:

<rdar://problem/58985368>

Reviewed by Eric Carlson.

AVAssetWriterDelegate allows to grab recorded data whenever wanted.
This delegate requires passing compressed samples to AVAssetWriter.
Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor.
They support AAC and H264 so far and should be further improved to support more encoding options.

Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere.
The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors.
It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter.
The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data.

Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed.
Therefore data should not be requested too fast to get adequate video compression.

Covered by existing tests.

* Modules/mediarecorder/MediaRecorderProvider.cpp:
(WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
(WebCore::MediaRecorderPrivateAVFImpl::create):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added.
* platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added.
(WebCore::AudioSampleBufferCompressor::create):
(WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
(WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
(WebCore::AudioSampleBufferCompressor::initialize):
(WebCore::AudioSampleBufferCompressor::finish):
(WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
(WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
(WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
(WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
(WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
(WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
(WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
(WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
(WebCore::AudioSampleBufferCompressor::processSampleBuffer):
(WebCore::AudioSampleBufferCompressor::addSampleBuffer):
(WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
(WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(-[WebAVAssetWriterDelegate initWithWriter:]):
(-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]):
(-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]):
(-[WebAVAssetWriterDelegate close]):
(WebCore::MediaRecorderPrivateWriter::create):
(WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback):
(WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback):
(WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::initialize):
(WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::startAssetWriter):
(WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers):
(WebCore::appendEndsPreviousSampleDurationMarker):
(WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded):
(WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::clear):
(WebCore::copySampleBufferWithCurrentTimeStamp):
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
(WebCore::createAudioFormatDescription):
(WebCore::createAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::stopRecording):
(WebCore::MediaRecorderPrivateWriter::appendData):
* platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h.
* platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added.
(WebCore::VideoSampleBufferCompressor::create):
(WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
(WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
(WebCore::VideoSampleBufferCompressor::initialize):
(WebCore::VideoSampleBufferCompressor::finish):
(WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
(WebCore::VideoSampleBufferCompressor::initCompressionSession):
(WebCore::VideoSampleBufferCompressor::processSampleBuffer):
(WebCore::VideoSampleBufferCompressor::addSampleBuffer):
(WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
(WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):

Source/WebCore/PAL:

<rdar://problem/58985368>

Reviewed by Eric Carlson.

Add soft link macros for VideoToolbox and AudioToolbox.

* PAL.xcodeproj/project.pbxproj:
* pal/cf/AudioToolboxSoftLink.cpp: Added.
* pal/cf/AudioToolboxSoftLink.h: Added.
* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:
* pal/cf/VideoToolboxSoftLink.cpp: Added.
* pal/cf/VideoToolboxSoftLink.h: Added.

Source/WebKit:

<rdar://problem/58985368>

Reviewed by Eric Carlson.

Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::didReceiveMessage):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/webrtc/RemoteMediaRecorder.cpp:
* GPUProcess/webrtc/RemoteMediaRecorder.h:
* GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
* GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
* GPUProcess/webrtc/RemoteMediaRecorderManager.h:
* GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
* GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
* WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
* WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
* WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
(WebKit::MediaRecorderProvider::createMediaRecorderPrivate):

Source/WTF:

Reviewed by Eric Carlson.

* wtf/PlatformHave.h:

LayoutTests:

Reviewed by Eric Carlson.

Disable tests on all platforms except the ones supporting AVAssetWriterDelegate.

* TestExpectations:
* http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-gpuprocess.html:
Remove web audio generation since there seems to be some unstability in web audio -> stream -> media recorder.
which should be fixed as follow-up specific patches.
* platform/mac/TestExpectations:
Enable running tests.

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

5 months agoServiceWorkerProvider::registerServiceWorkerClients is no longer needed
youenn@apple.com [Thu, 6 Feb 2020 08:07:06 +0000 (08:07 +0000)]
ServiceWorkerProvider::registerServiceWorkerClients is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=207193

Reviewed by Chris Dumez.

Source/WebCore:

registerServiceWorkerClients is no longer needed since we moved service worker handling to network process.
We no longer have to optimize creating a sw server connection since we piggy back on the webprocess to network process connection.

As can be seen from DocumentLoader, we register service worker clients in DocumentLoader::commitData.
The only documents we do not register are documents for which we exit early due to creatingInitialEmptyDocument check.

registerServiceWorkerClients was used initially when starting the first service worker process.
This is obsolete since now we split service workers according sessionID and registrable domains.

No observable change of behavior if network process does not crash.
Covered by existing service worker tests crashing network process in the middle of processing.

* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::registerServiceWorkerClients):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerProvider.cpp:
* workers/service/ServiceWorkerProvider.h:

Source/WebKit:

Remove the request from WebProcessPool to register all service worker clients at launch of the first service worker process.
This is no longer needed and does not scale since our service workers are launched in different processes nowadays.

In case network process crashes, WebProcess will need to reregister their service worker clients.
This is lazily done when WebProcess tries to reconnect to the Network Process.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

5 months agoCrash when printing at WebCore: WebCore::FrameView::paintContents
ddkilzer@apple.com [Thu, 6 Feb 2020 07:00:37 +0000 (07:00 +0000)]
Crash when printing at WebCore: WebCore::FrameView::paintContents
<https://webkit.org/b/207313>
<rdar://problem/56675778>

Reviewed by Brent Fulgham.

* page/PrintContext.cpp:
(WebCore::PrintContext::spoolPage):
(WebCore::PrintContext::spoolRect):
- Add nullptr check for frame.view().  This matches similar
  checks in other methods.

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

5 months ago[iOS] Provide a way to suppress software keyboards on WKWebView's WKContentView
wenson_hsieh@apple.com [Thu, 6 Feb 2020 06:44:38 +0000 (06:44 +0000)]
[iOS] Provide a way to suppress software keyboards on WKWebView's WKContentView
https://bugs.webkit.org/show_bug.cgi?id=207272
<rdar://problem/59190828>

Reviewed by Tim Horton.

Source/WebKit:

Allow SPI clients to suppress the software keyboard using -_setSuppressSoftwareKeyboard: on WKWebView by
propagating the call to the WKContentView, which is the view that actually becomes first responder when an
element (e.g. a form control) is focused.

Test: KeyboardInputTests.SuppressSoftwareKeyboard

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _setSuppressSoftwareKeyboard:]):

Tools:

Add an API test to verify (through UIKeyboardImpl) that the software keyboard should be suppressed when setting
-_setSuppressSoftwareKeyboard: on the web view. This involves making `-makeKeyWindow` "work" in the API testing
environment on iOS, by swizzling out both `-[NSBundle bundleIdentifier]` and `-[UIApplication keyWindow]`.

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(TestWebKitAPI::overrideBundleIdentifier):
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(setOverriddenApplicationKeyWindow):
(applicationKeyWindowOverride):
(-[TestWKWebViewHostWindow makeKeyWindow]):
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
* TestWebKitAPI/ios/UIKitSPI.h:

Also move the `UIResponder (UIKitSPI)` category from the internal section to the SPI section; this is redundant
when using the internal SDK to build, since these methods are already declared in UIResponder_Private.h.

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

5 months ago[PlayStation] Build a shared JavaScriptCore
don.olmstead@sony.com [Thu, 6 Feb 2020 05:46:56 +0000 (05:46 +0000)]
[PlayStation] Build a shared JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=198446

Reviewed by Fujii Hironori.

.:

Compile bmalloc and WTF as OBJECT libraries that are then linked into a shared
JavaScriptCore. Using OBJECT libraries is a modern CMake way to have the behavior
of --whole-archive.

* Source/cmake/OptionsPlayStation.cmake:

Source/JavaScriptCore:

Add TARGET_OBJECTS for bmalloc and WTF so JavaScriptCore links. Add bmalloc and
WTF compile definitions so exports are exposed.

* PlatformPlayStation.cmake:

Source/WTF:

Add bmalloc definition when compiling WTF. Remove LanguageUnix.cpp since
LanguagePlayStation.cpp is present which results in duplicate symbol definitions.

* wtf/PlatformPlayStation.cmake:

Tools:

Add TARGET_OBJECTS for bmalloc and WTF so TestWTF links.

* TestWebKitAPI/PlatformPlayStation.cmake:

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

5 months agoWeb Inspector: the height of the undocked title area shouldn't change when zoomed
drousso@apple.com [Thu, 6 Feb 2020 05:07:12 +0000 (05:07 +0000)]
Web Inspector: the height of the undocked title area shouldn't change when zoomed
https://bugs.webkit.org/show_bug.cgi?id=207228

Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.contentLoaded.updateZoomFactorCSSVariable): Added.
Save the zoom factor as a number in a CSS variable on the `<body>`.

* UserInterface/Views/Variables.css:
(body.mac-platform:not(.docked)): Added.
(body:not(.docked)): Deleted.
Divide the default `22px` by the current zoom factor so that it cancels out when rendered.
Make it so that the undocked title area is only shown on macOS <https://webkit.org/b/204627#c47>

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

5 months ago[WinCairo] Set up fonts for layout tests for test bot image
stephan.szabo@sony.com [Thu, 6 Feb 2020 04:44:59 +0000 (04:44 +0000)]
[WinCairo] Set up fonts for layout tests for test bot image
https://bugs.webkit.org/show_bug.cgi?id=207223

Reviewed by Fujii Hironori.

* WebKitTestRunner/InjectedBundle/win/ActivateFontsWin.cpp:
  Implement activateFonts to load fonts for test

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

5 months ago[PlayStation] Miscellaneous build fixes February 2020 edition
don.olmstead@sony.com [Thu, 6 Feb 2020 04:29:12 +0000 (04:29 +0000)]
[PlayStation] Miscellaneous build fixes February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=207312

Unreviewed build fix.

Source/WebCore:

* accessibility/AccessibilityObject.h: Add missing definition for !ENABLE(ACCESSIBILITY)
(WebCore::AccessibilityObject::detachPlatformWrapper):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
* platform/graphics/cairo/ImageBufferCairo.cpp: Add missing include

Source/WebKit:

* NetworkProcess/NetworkDataTaskBlob.cpp: Add missing include.
* UIProcess/Downloads/DownloadProxyMap.h: Add missing forward declaration.

Tools:

* TestWebKitAPI/PlatformWebView.h: Remove #elif guard and just use #else

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

5 months agoUnreviewed build fix for Windows ports since r255875
Hironori.Fujii@sony.com [Thu, 6 Feb 2020 04:23:17 +0000 (04:23 +0000)]
Unreviewed build fix for Windows ports since r255875
https://bugs.webkit.org/show_bug.cgi?id=207073
<rdar://problem/59168065>

WEBCORE_TESTSUPPORT_EXPORT should be used only for WebCoreTestSupport, not for WebCore
See also Bug 203876.

* storage/StorageNamespaceProvider.h: Replaced WEBCORE_TESTSUPPORT_EXPORT with WEBCORE_EXPORT.

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

5 months agoDeleting a property should not turn structures into uncacheable dictionaries
justin_michaud@apple.com [Thu, 6 Feb 2020 03:48:34 +0000 (03:48 +0000)]
Deleting a property should not turn structures into uncacheable dictionaries
https://bugs.webkit.org/show_bug.cgi?id=206430

Reviewed by Yusuke Suzuki.

JSTests:

* microbenchmarks/delete-property-from-prototype-chain.js: Added.
(assert):
(noInline.assert.getZ):
(noInline.getZ.C):
(doTest):
(delete.C.prototype.z):
* microbenchmarks/delete-property-keeps-cacheable-structure.js: Added.
(assert):
(C):
(doTest):
* stress/cache-put-by-id-different-attributes.js:
(makePrototypeDict):
(set x):
* stress/cache-put-by-id-different-offset.js:
(makePrototypeDict):
(set x):
* stress/cache-put-by-id-poly-proto.js:
(makePrototypeDict):
(set _):
* stress/delete-property-check-structure-transition.js: Added.
(assert):
(assert_eq):
(assert_neq):
(sd):
(sid):
(testDeleteIsNotUncacheable):
(testCanMaterializeDeletes):
(testCanFlatten):
(testDeleteWithInlineCache.Object.prototype.globalProperty.42.makeFoo):
(testDeleteWithInlineCache.noInline.doTest):
(testDeleteWithInlineCache):
* stress/flatten-object-zero-unused-inline-properties.js:

Source/JavaScriptCore:

Right now, deleteProperty/removePropertyTransition causes a structure transition to uncacheable dictionary. Instead, we should allow it to transition to a new regular structure like adding a property does. This means that we have to:

1) Break the assumption that structure transition offsets increase monotonically

We add a new flag to tell that a structure has deleted its property, and update materializePropertyTable to use it.

2) Add a new transition map and transition kind for deletes

We cache the delete transition. We will not transition back to a previous structure if you add then immediately remove a property.

3) Find some heuristic for when we should actually transition to uncacheable dictionary.

Since deleting properties is expected to be rare, we just walk the structure list and count its size on removal.

This patch also fixes a related bug in addProperty, where we did not use a GCSafeConcurrentJSLocker, and adds an option to trigger the bug. Finally, we add some helper methods to dollarVM to test.

This gives a 24x speedup on delete-property-keeps-cacheable-structure.js, and is neutral on delete-property-from-prototype-chain.js (which was already generating code using the inline cache).

* heap/HeapInlines.h:
(JSC::Heap::decrementDeferralDepthAndGCIfNeeded):
* runtime/JSObject.cpp:
(JSC::JSObject::deleteProperty):
* runtime/OptionsList.h:
* runtime/PropertyMapHashTable.h:
(JSC::PropertyTable::get):
(JSC::PropertyTable::add):
(JSC::PropertyTable::addDeletedOffset):
(JSC::PropertyTable::reinsert):
* runtime/Structure.cpp:
(JSC::StructureTransitionTable::contains const):
(JSC::StructureTransitionTable::get const):
(JSC::StructureTransitionTable::add):
(JSC::Structure::Structure):
(JSC::Structure::materializePropertyTable):
(JSC::Structure::addNewPropertyTransition):
(JSC::Structure::removePropertyTransition):
(JSC::Structure::removePropertyTransitionFromExistingStructure):
(JSC::Structure::removeNewPropertyTransition):
(JSC::Structure::toUncacheableDictionaryTransition):
(JSC::Structure::remove):
(JSC::Structure::visitChildren):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::forEachPropertyConcurrently):
(JSC::Structure::add):
(JSC::Structure::remove):
(JSC::Structure::removePropertyWithoutTransition):
* runtime/StructureTransitionTable.h:
(JSC::StructureTransitionTable::Hash::hash):
* tools/JSDollarVM.cpp:
(JSC::JSDollarVMHelper::functionGetStructureTransitionList):
(JSC::functionGetConcurrently):
(JSC::JSDollarVM::finishCreation):

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

5 months agoWeb Inspector: Some cookie table column headers should not be localizable
nvasilyev@apple.com [Thu, 6 Feb 2020 03:36:04 +0000 (03:36 +0000)]
Web Inspector: Some cookie table column headers should not be localizable
https://bugs.webkit.org/show_bug.cgi?id=206920

Reviewed by Timothy Hatcher.

Keep headers that match cookie directives always in English.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/CookieStorageContentView.js:
(WI.CookieStorageContentView.prototype.initialLayout):

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

5 months agoREGRESSION (r254428): [ macOS wk1 ] inspector/canvas/recording-2d-full.html became...
drousso@apple.com [Thu, 6 Feb 2020 03:28:43 +0000 (03:28 +0000)]
REGRESSION (r254428): [ macOS wk1 ] inspector/canvas/recording-2d-full.html became slower, flakily times out
https://bugs.webkit.org/show_bug.cgi?id=207154
<rdar://problem/59127935>

Reviewed by Zalan Bujtas.

Rather than have a `InspectorTest.log()` for each line of output, collect the content into a
String/Array and do a single log to avoid lots of sequential layouts.

* inspector/canvas/resources/create-context-utilities.js:
(TestPage.registerInitializer.awaitCanvasAdded):

* inspector/canvas/resources/recording-utilities.js:
(TestPage.registerInitializer.log): Deleted.
(TestPage.registerInitializer.logRecording):
(TestPage.registerInitializer.logRecording.log): Added.

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

5 months agoWeb Inspector: slightly increase the horizontal padding around scope bar items
drousso@apple.com [Thu, 6 Feb 2020 03:20:28 +0000 (03:20 +0000)]
Web Inspector: slightly increase the horizontal padding around scope bar items
https://bugs.webkit.org/show_bug.cgi?id=207321

Reviewed by Timothy Hatcher.

* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only):

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

5 months agoWeb Inspector: Tab Bar: move window management items to the left and don't show reloa...
drousso@apple.com [Thu, 6 Feb 2020 03:14:29 +0000 (03:14 +0000)]
Web Inspector: Tab Bar: move window management items to the left and don't show reload/download unless remotely inspecting
https://bugs.webkit.org/show_bug.cgi?id=207318

Reviewed by Timothy Hatcher.

Move the window management buttons to the left side to match the system look/feel.

Hide the reload/download buttons when inspecting locally, as there are other ways of
reloading the inspected page or downloading a Web Archive.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._updateDockNavigationItems):
(WI._updateReloadTabBarButton):
(WI._updateDownloadTabBarButton):
(WI._updateInspectModeTabBarButton):
(WI._updateTabBarDividers): Added.
(WI._updateConsoleTabBarButtons):

* UserInterface/Debug/Bootstrap.js:
(updateDebugUI):
(WI.runBootstrapOperations):

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

5 months agoWeb Inspector: Network: the resource detail view cuts off the bottom statistics bar
drousso@apple.com [Thu, 6 Feb 2020 03:13:19 +0000 (03:13 +0000)]
Web Inspector: Network: the resource detail view cuts off the bottom statistics bar
https://bugs.webkit.org/show_bug.cgi?id=207320

Reviewed by Timothy Hatcher.

* UserInterface/Views/Variables.css:
(:root):
Add a `--network-statistics-height` variable.

* UserInterface/Views/NetworkDetailView.css:
(.network-detail):
* UserInterface/Views/NetworkTableContentView.css:
(.network-table > .statistics):
Use the `--network-statistics-height` variable to make sure the statistics row and the
details view for the selected network entry don't overlap.
Drive-by: center the content of the statistics row to better match the system look/feel.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255892 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoWeb Inspector: increase the height of the tab bar to match other navigation bars
drousso@apple.com [Thu, 6 Feb 2020 02:40:08 +0000 (02:40 +0000)]
Web Inspector: increase the height of the tab bar to match other navigation bars
https://bugs.webkit.org/show_bug.cgi?id=207317

Reviewed by Timothy Hatcher.

* UserInterface/Views/Variables.css:
(:root):
Define `--tab-bar-height` in terms of `--navigation-bar-height` so they share the same value.

* UserInterface/Views/TabBar.css:
(.tab-bar > .tabs > .item):
(.tab-bar > .tabs > .item.pinned):
(.tab-bar > .tabs > .item.pinned.tab-picker): Deleted.
Increase the width to match the `--tab-bar-height` so that pinned tab bar items are square.

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

5 months ago[WTF] Try using 75% load factor for HashTable
ysuzuki@apple.com [Thu, 6 Feb 2020 02:37:32 +0000 (02:37 +0000)]
[WTF] Try using 75% load factor for HashTable
https://bugs.webkit.org/show_bug.cgi?id=207183

Reviewed by Mark Lam.

Source/WTF:

We know that hash-table is one of the most memory consuming part in WebKit.
By analyzing many production hash-table implementations[1], I found that many
of them are using 75% load-factor while our one is 50%.

A/B test shows that 75% load-factor is performance-neutral in Speedometer2 and
JetStream2, while it offers 2~% improvement in Membuster. This means that we are
wasting too much memory for no-performance-improvement.

This patch changes the load-factor from 50% to 75%.

[1]: LLVM DenseMap, Abseil's, rust's, and so on.

* wtf/HashTable.h:
(WTF::HashTable::shouldExpand):
(WTF::HashTable::shouldExpand const):
(WTF::HashTableCapacityForSize::capacityForSize):
(WTF::KeyTraits>::computeBestTableSize):

Tools:

Fix load-factor assumption in existing tests.

* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::testInitialCapacity):

LayoutTests:

It seems that this test is relying on hash-table's order.

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

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

5 months agoWeb Inspector: Dragging handles in the easing popover selects sidebar text
nvasilyev@apple.com [Thu, 6 Feb 2020 02:29:56 +0000 (02:29 +0000)]
Web Inspector: Dragging handles in the easing popover selects sidebar text
https://bugs.webkit.org/show_bug.cgi?id=207316

Reviewed by Timothy Hatcher.

* UserInterface/Views/BezierEditor.js:
(WI.BezierEditor.prototype._handleMousedown):

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

5 months agoWeb Inspector: Sources: add a special breakpoint for controlling whether `debugger...
drousso@apple.com [Thu, 6 Feb 2020 02:19:10 +0000 (02:19 +0000)]
Web Inspector: Sources: add a special breakpoint for controlling whether `debugger` statements pause
https://bugs.webkit.org/show_bug.cgi?id=206818

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Debugger.json:
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::setPauseOnDebuggerStatements): Added.

* bytecompiler/NodesCodegen.cpp:
(JSC::DebuggerStatementNode::emitBytecode):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::dumpLineColumnEntry):
* interpreter/Interpreter.h:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::debug):
(WTF::printInternal):
* debugger/Debugger.h:
(JSC::Debugger::setPauseOnDebuggerStatements): Added.
* debugger/Debugger.cpp:
(JSC::Debugger::didReachDebuggerStatement): Added.
(JSC::Debugger::didReachBreakpoint): Deleted.
Replace `DebugHookType::DidReachBreakpoint` with `DebugHookType::DidReachDebuggerStatement`,
as it is only actually used for `debugger;` statements, not breakpoints.

Source/WebInspectorUI:

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.async initializeTarget):
(WI.DebuggerManager.prototype.get debuggerStatementsBreakpoint): Added.
(WI.DebuggerManager.prototype.isBreakpointRemovable):
(WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):

* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):

* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-debugger-statement-icon .icon): Added.
* UserInterface/Images/DebuggerStatement.svg: Added.

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/debugger/setPauseOnDebuggerStatements.html: Added.
* inspector/debugger/setPauseOnDebuggerStatements-expected.txt: Added.

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

5 months agoWeb Inspector: Bezier editor popover should be strictly LTR
nvasilyev@apple.com [Thu, 6 Feb 2020 02:16:43 +0000 (02:16 +0000)]
Web Inspector: Bezier editor popover should be strictly LTR
https://bugs.webkit.org/show_bug.cgi?id=206968
<rdar://problem/59007065>

Reviewed by Timothy Hatcher.

- Don't mirror the coordinate system.
- Don't reverste the order of the cubic bezier values, e.g. `cubic-bezier(0, 0.5, 1, 0.5)`.

* UserInterface/Views/BezierEditor.css:
(90%):
(to):
(body[dir=ltr] .bezier-editor): Deleted.
(body[dir=rtl] .bezier-editor): Deleted.
(body[dir=rtl] .bezier-editor > .bezier-container): Deleted.
* UserInterface/Views/BezierEditor.js:

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

5 months agoWeb Inspector: ensure that `didClearWindowObjectInWorld` is dispatched for the main...
drousso@apple.com [Thu, 6 Feb 2020 02:13:47 +0000 (02:13 +0000)]
Web Inspector: ensure that `didClearWindowObjectInWorld` is dispatched for the main world first
https://bugs.webkit.org/show_bug.cgi?id=207232

Reviewed by Timothy Hatcher.

It is necessary to order the `DOMWrapperWorld`s because certain callers expect the main
world to be the first item in the list, as they use the main world as an indicator of when
the page is ready to start evaluating JavaScript. For example, Web Inspector waits for the
main world change to clear any injected scripts and debugger/breakpoint state.

* bindings/js/WebCoreJSClientData.cpp:
(WebCore::JSVMClientData::getAllWorlds):

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

5 months agoCheck for null return from AXIsolatedTree::nodeForID.
andresg_22@apple.com [Thu, 6 Feb 2020 01:21:45 +0000 (01:21 +0000)]
Check for null return from AXIsolatedTree::nodeForID.
https://bugs.webkit.org/show_bug.cgi?id=207300

Reviewed by Chris Fleizach.

- As the IsolatedTree is updated, AXIsolatedTree::nodeForID may return
nullptr for objects that have been removed from the tree. Thus,
IsolatedObjects must check the returned value when updating children
and any other operations involving cached IDs.
- Tidying up use of auto on for and if statements.

* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::detachRemoteParts):
(WebCore::AXIsolatedObject::children):
(WebCore::AXIsolatedObject::accessibilityText const):
(WebCore::AXIsolatedObject::insertMathPairs):
(WebCore::AXIsolatedObject::objectAttributeValue const):
(WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
(WebCore::AXIsolatedObject::tree const): Deleted, moved inline to the header.
* accessibility/isolatedtree/AXIsolatedObject.h:

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

5 months agoresulsdbpy: Fix unit tests
jbedard@apple.com [Thu, 6 Feb 2020 01:13:47 +0000 (01:13 +0000)]
resulsdbpy: Fix unit tests
https://bugs.webkit.org/show_bug.cgi?id=207304

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/model/configuration_context_unittest.py:
(ConfigurationContextTest.test_partition_by_configuration): Add branch to testing table.
(ConfigurationContextTest.test_partition_by_partial_configuration): Ditto.
* resultsdbpy/resultsdbpy/model/failure_context_unittest.py:
(FailureContextTest.test_failures): Sort test failures by uuid for a predictable order in testing.
(FailureContextTest.test_unexpected_failures): Ditto.
* resultsdbpy/resultsdbpy/model/mock_model_factory.py:
(MockModelFactory.iterate_all_commits): Do not batch requests since this function has no way
of knowing how expensive the callback may be.

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

5 months agoAdopt MTOverrideShouldPlayHDRVideo()
jer.noble@apple.com [Thu, 6 Feb 2020 01:03:01 +0000 (01:03 +0000)]
Adopt MTOverrideShouldPlayHDRVideo()
https://bugs.webkit.org/show_bug.cgi?id=207275
<rdar://problem/58837093>

Reviewed by Eric Carlson.

Source/WebCore:

* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::setShouldOverrideScreenSupportsHighDynamicRange):

Source/WebCore/PAL:

* pal/cocoa/MediaToolboxSoftLink.cpp:
* pal/cocoa/MediaToolboxSoftLink.h:

Source/WebKit:

The WebProcess sandbox can block access to the services necessary for MediaToolbox to determine whether
the current display is capable of displaying HDR. Rather than opening up the sandbox, provide the information
gathered by the UIProcess by way of MTOverrideShouldPlayHDRVideo().

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::windowScreenDidChange):
(WebKit::WebPage::displayID const):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setScreenProperties): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::setScreenProperties):
(WebKit::WebProcess::updatePageScreenProperties):

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

5 months agoUnreviewed, another build fix after r255846
cdumez@apple.com [Thu, 6 Feb 2020 00:56:29 +0000 (00:56 +0000)]
Unreviewed, another build fix after r255846

* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:

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

5 months ago[macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia
wenson_hsieh@apple.com [Thu, 6 Feb 2020 00:52:00 +0000 (00:52 +0000)]
[macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia
https://bugs.webkit.org/show_bug.cgi?id=207299
<rdar://problem/59200545>

Reviewed by Tim Horton.

After r255827, if EventHandler selects an IBeam cursor at the position information request location, we will
always attempt to show a caret at that location, whose height is the height of the editing caret for that
visible position. However, this means that:

-   It's possible for the caret to be incorrectly sized if the caret is before a large replaced element, such as
    a table. Since the request location is also outside of any line rect, it doesn't make sense to use the caret
    height for the height of the cursor. Instead, fall back to computed line height. This fixes an issue on
    en.wikipedia.org where the line rect would sometimes update to an enormous size when selecting text, since
    the caret would temporarily hover over an editing position that is before a large table.

-   This fallback path completely negates certain cursor behaviors; partially restore this behavior by making it
    so that in the case where the cursor is in editable content and the line caret first line from the top of
    the hit-tested node already contains the request point, don't bother trying to recenter the line rect to be
    right over the request point.

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

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

5 months agoUnreviewed infrastructure fix.
ryanhaddad@apple.com [Thu, 6 Feb 2020 00:24:36 +0000 (00:24 +0000)]
Unreviewed infrastructure fix.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot): Delete entries for queues that have been removed from buildbot.

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

5 months ago[IPC hardening] Fail IPC decoding of invalid ClientOrigin objects
cdumez@apple.com [Thu, 6 Feb 2020 00:23:29 +0000 (00:23 +0000)]
[IPC hardening] Fail IPC decoding of invalid ClientOrigin objects
https://bugs.webkit.org/show_bug.cgi?id=207305
<rdar://problem/58797651>

Reviewed by Brent Fulgham.

Fail IPC decoding of invalid ClientOrigin objects (empty ClientOrigin or deleted value in a HashMap).

* page/ClientOrigin.h:
(WebCore::ClientOrigin::decode):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::decode):

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

5 months agoRegression(r248734) StorageAreaMap objects are getting leaked
cdumez@apple.com [Thu, 6 Feb 2020 00:11:23 +0000 (00:11 +0000)]
Regression(r248734) StorageAreaMap objects are getting leaked
https://bugs.webkit.org/show_bug.cgi?id=207073
<rdar://problem/59168065>

Reviewed by Darin Adler.

Source/WebCore:

Add test infrastructure for testing this change.

Test: http/tests/storage/storage-map-leaking.html

* storage/StorageNamespace.h:
(WebCore::StorageNamespace::storageAreaMapCountForTesting const):
* storage/StorageNamespaceProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::storageAreaMapCount const):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Make sure that StorageAreaMap objects are getting removed from the HashMap
in StorageNamespaceImpl, once they no longer have any users.

* WebProcess/WebStorage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::StorageAreaImpl):
(WebKit::StorageAreaImpl::~StorageAreaImpl):
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::incrementUseCount):
(WebKit::StorageAreaMap::decrementUseCount):
* WebProcess/WebStorage/StorageAreaMap.h:
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::destroyStorageAreaMap):
(WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap): Deleted.
* WebProcess/WebStorage/StorageNamespaceImpl.h:
(WebKit::StorageNamespaceImpl::storageType const): Deleted.
(WebKit::StorageNamespaceImpl::storageNamespaceID const): Deleted.
(WebKit::StorageNamespaceImpl::topLevelOrigin const): Deleted.
(WebKit::StorageNamespaceImpl::quotaInBytes const): Deleted.

LayoutTests:

Add layout test coverage.

* TestExpectations:
* http/tests/storage/resources/storage-map-leaking-iframe.html: Added.
* http/tests/storage/storage-map-leaking-expected.txt: Added.
* http/tests/storage/storage-map-leaking.html: Added.
* platform/wk2/TestExpectations:

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

5 months ago[iOS] Do not create sandbox reports when the UI process cannot issue extensions to...
pvollan@apple.com [Thu, 6 Feb 2020 00:06:20 +0000 (00:06 +0000)]
[iOS] Do not create sandbox reports when the UI process cannot issue extensions to diagnostics service
https://bugs.webkit.org/show_bug.cgi?id=207279
<rdar://problem/59030957>
Source/WebKit:

Reviewed by Brent Fulgham.

Do not create sandbox reports when the UI process cannot issue mach extensions to the diagnostics service.
The majority of clients are capable of doing this.

No new tests, since it is not trivial to test if no sandbox reports are generated for a violation.

* Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::SandboxExtensionImpl::create):
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):
(WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
(WebKit::SandboxExtension::createHandleForMachLookup):
* Shared/SandboxExtension.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):

Source/WTF:

Reviewed by Brent Fulgham.

Add flag which avoids generating sandbox reports.

* wtf/spi/darwin/SandboxSPI.h:

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

5 months ago[ macOS ] inspector/animation/lifecycle-css-animation.html is flaky failing
tsavell@apple.com [Wed, 5 Feb 2020 23:56:30 +0000 (23:56 +0000)]
[ macOS ] inspector/animation/lifecycle-css-animation.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207306

Unreviewed test gardening.

Patch by Jacob Uphoff <jacob_uphoff@apple.com> on 2020-02-05

* platform/mac/TestExpectations:

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

5 months ago[IPC hardening] Protect against bad identifier in CacheStorageEngineConnection::refer...
cdumez@apple.com [Wed, 5 Feb 2020 23:50:54 +0000 (23:50 +0000)]
[IPC hardening] Protect against bad identifier in CacheStorageEngineConnection::reference() / dereference()
https://bugs.webkit.org/show_bug.cgi?id=207302
<rdar://problem/59016099>

Reviewed by Alex Christensen.

* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):

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

5 months ago[IPC hardening] Protect against bad parameters in NetworkRTCProvider::createResolver()
cdumez@apple.com [Wed, 5 Feb 2020 23:49:54 +0000 (23:49 +0000)]
[IPC hardening] Protect against bad parameters in NetworkRTCProvider::createResolver()
https://bugs.webkit.org/show_bug.cgi?id=207301
<rdar://problem/59011449>

Reviewed by Alex Christensen.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createResolver):

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

5 months agoASSERTION FAILED: !needsLayout() [ macOS wk2 ] loader/stateobjects/pushstate-size...
tsavell@apple.com [Wed, 5 Feb 2020 23:43:27 +0000 (23:43 +0000)]
ASSERTION FAILED: !needsLayout() [ macOS wk2 ] loader/stateobjects/pushstate-size-iframe.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=207303

Unreviewed test gardening.

Patch by Jacob Uphoff <jacob_uphoff@apple.com> on 2020-02-05

* platform/mac-wk2/TestExpectations:

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

5 months ago[GTK][WPE] Add more fontconfig paths into the sandbox
pgriffis@igalia.com [Wed, 5 Feb 2020 23:24:26 +0000 (23:24 +0000)]
[GTK][WPE] Add more fontconfig paths into the sandbox
https://bugs.webkit.org/show_bug.cgi?id=207293

Reviewed by Michael Catanzaro.

These paths were reported to be used on Debian.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bindFonts):

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

5 months ago[IPC hardening] Protect against bad originIdentifier String in WebPageProxy::reachedA...
cdumez@apple.com [Wed, 5 Feb 2020 23:05:36 +0000 (23:05 +0000)]
[IPC hardening] Protect against bad originIdentifier String in WebPageProxy::reachedApplicationCacheOriginQuota() / requestGeolocationPermissionForFrame()
https://bugs.webkit.org/show_bug.cgi?id=207292
<rdar://problem/58345601>

Reviewed by David Kilzer.

* UIProcess/WebPageProxy.cpp:

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

5 months agoUnreviewed build fix after r255846.
cdumez@apple.com [Wed, 5 Feb 2020 22:55:48 +0000 (22:55 +0000)]
Unreviewed build fix after r255846.

* TestWebKitAPI/cocoa/HTTPServer.h:

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

5 months agoDefer ending AppSSO sheets til NSWindowDidDeminiaturize or NSApplicationDidUnhide
jiewen_tan@apple.com [Wed, 5 Feb 2020 22:49:43 +0000 (22:49 +0000)]
Defer ending AppSSO sheets til NSWindowDidDeminiaturize or NSApplicationDidUnhide
https://bugs.webkit.org/show_bug.cgi?id=207173
<rdar://problem/55669065>

Reviewed by Brent Fulgham.

Source/WebKit:

AppKit has a bug that [m_sheetWindow sheetParent] is null if the parent is minimized or the host app is hidden.
SheetParent is used to endSheet. Therefore, WebKit cannot dismiss AppSSO UIs in the above two cases if asked
by extensions.

This patch implements a workaround to detect those two cases and defer the endSheet til NSWindowDidDeminiaturize
or NSApplicationDidUnhide is received.

Covered by API tests.

* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::dismissViewController):
* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
(WebKit::SubFrameSOAuthorizationSession::abortInternal):
Treat abort like falling back to the web path for sub frame case given displaying an empty
iframe after aborting seems bad.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView _setUpTestWindow:]):
Make the TestWKWebViewHostWindow miniaturizable to enable the test.

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

5 months ago[IPC Hardening] Protect against targetId String being invalid in WebPageProxy::create...
cdumez@apple.com [Wed, 5 Feb 2020 22:37:59 +0000 (22:37 +0000)]
[IPC Hardening] Protect against targetId String being invalid in WebPageProxy::createInspectorTarget() / destroyInspectorTarget()
https://bugs.webkit.org/show_bug.cgi?id=207288
<rdar://problem/57645953>

Reviewed by Geoffrey Garen.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createInspectorTarget):
(WebKit::WebPageProxy::destroyInspectorTarget):

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

5 months agoresults.webkit.org: Apply ttl to archive shards
jbedard@apple.com [Wed, 5 Feb 2020 22:11:49 +0000 (22:11 +0000)]
results.webkit.org: Apply ttl to archive shards
https://bugs.webkit.org/show_bug.cgi?id=207295

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/model/archive_context.py:
(ArchiveContext.ArchiveMetaDataByCommit): Use new table.
(ArchiveContext.ArchiveChunks): Use new table.
(ArchiveContext.register): Add ttl to archive shards.

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

5 months agoREGRESSION: (r255821) [ Mac wk1 ] imported/w3c/web-platform-tests/web-animations...
tsavell@apple.com [Wed, 5 Feb 2020 22:05:35 +0000 (22:05 +0000)]
REGRESSION: (r255821) [ Mac wk1 ] imported/w3c/web-platform-tests/web-animations/timing-model/animations/finishing-an-animation.html
https://bugs.webkit.org/show_bug.cgi?id=207278

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

5 months ago[IPC hardening] Protect against m_inspectorPage being null inWebInspectorProxy::attach()
cdumez@apple.com [Wed, 5 Feb 2020 22:03:38 +0000 (22:03 +0000)]
[IPC hardening] Protect against m_inspectorPage being null inWebInspectorProxy::attach()
https://bugs.webkit.org/show_bug.cgi?id=207289
<rdar://problem/58419789>

Reviewed by David Kilzer.

* UIProcess/Inspector/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::attach):

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

5 months ago[IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy:...
cdumez@apple.com [Wed, 5 Feb 2020 22:02:19 +0000 (22:02 +0000)]
[IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::detach()
https://bugs.webkit.org/show_bug.cgi?id=207286
<rdar://problem/55422296>

Reviewed by David Kilzer.

* UIProcess/Inspector/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::detach):

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

5 months ago[ macOS wk2 ] webgpu/whlsl/dot-expressions.html is flaky failing
tsavell@apple.com [Wed, 5 Feb 2020 22:00:04 +0000 (22:00 +0000)]
[ macOS wk2 ] webgpu/whlsl/dot-expressions.html  is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207294

Unreviewed test gardening.

Patch by Jacob Uphoff <jacob_uphoff@apple.com> on 2020-02-05

* platform/mac-wk2/TestExpectations:

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

5 months agoUpdate sandbox to allow communication with dnssd service
bfulgham@apple.com [Wed, 5 Feb 2020 21:42:27 +0000 (21:42 +0000)]
Update sandbox to allow communication with dnssd service
https://bugs.webkit.org/show_bug.cgi?id=207276
<rdar://problem/59158405>

Reviewed by Per Arne Vollan.

Testing and telemetry indicates that we need access to the DNSSD mach service in our Network Process

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

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

5 months ago[IPC Hardening] Protect against null String under WebInspectorProxy::save() / WebInsp...
cdumez@apple.com [Wed, 5 Feb 2020 21:37:26 +0000 (21:37 +0000)]
[IPC Hardening] Protect against null String under WebInspectorProxy::save() / WebInspectorProxy::append()
https://bugs.webkit.org/show_bug.cgi?id=207284
<rdar://problem/55271616>

Reviewed by David Kilzer.

* UIProcess/Inspector/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::save):
(WebKit::WebInspectorProxy::append):

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

5 months ago[IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy:...
cdumez@apple.com [Wed, 5 Feb 2020 21:30:11 +0000 (21:30 +0000)]
[IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::setAttachedWindowHeight() / setAttachedWindowWidth()
https://bugs.webkit.org/show_bug.cgi?id=207287
<rdar://problem/55422919>

Reviewed by Geoffrey Garen.

* UIProcess/Inspector/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::setAttachedWindowHeight):
(WebKit::WebInspectorProxy::setAttachedWindowWidth):

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

5 months ago[IPC Hardening] Protect against m_inspectedPage / m_inspectorPage being null in WebIn...
cdumez@apple.com [Wed, 5 Feb 2020 21:28:57 +0000 (21:28 +0000)]
[IPC Hardening] Protect against m_inspectedPage / m_inspectorPage being null in WebInspectorProxy::resetState()
https://bugs.webkit.org/show_bug.cgi?id=207285
<rdar://problem/55420035>

Reviewed by David Kilzer.

* UIProcess/Inspector/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::resetState):

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

5 months ago[IPC Hardening] Protect against bad RegistrableDomain under WebProcessProxy::didColle...
cdumez@apple.com [Wed, 5 Feb 2020 21:27:45 +0000 (21:27 +0000)]
[IPC Hardening] Protect against bad RegistrableDomain under WebProcessProxy::didCollectPrewarmInformation()
https://bugs.webkit.org/show_bug.cgi?id=207281
<rdar://problem/55318108>

Reviewed by Geoffrey Garen.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didCollectPrewarmInformation):

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

5 months ago[IPC Hardening] Protect against bad ClientOrigin under Engine::readCachesFromDisk()
cdumez@apple.com [Wed, 5 Feb 2020 21:26:30 +0000 (21:26 +0000)]
[IPC Hardening] Protect against bad ClientOrigin under Engine::readCachesFromDisk()
https://bugs.webkit.org/show_bug.cgi?id=207280
<rdar://problem/59013832>

Reviewed by Geoffrey Garen.

Protect against bad ClientOrigin under Engine::readCachesFromDisk(), as it is coming from
IPC from the WebContent process.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::readCachesFromDisk):

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

5 months agoMake WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network...
achristensen@apple.com [Wed, 5 Feb 2020 21:07:48 +0000 (21:07 +0000)]
Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache
https://bugs.webkit.org/show_bug.cgi?id=207207

Reviewed by Chris Dumez.

Source/WebCore:

* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::includeCertificateInfo const):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::usedLegacyTLS const):
(WebCore::ResourceResponseBase::encode const):
(WebCore::ResourceResponseBase::decode):

Source/WebKit:

In PageLoadState::didCommitLoad, I was resetting the value of _negotiatedLegacyTLS to false.
That created a race condition when loading the main resource because the NetworkProcess would
message the UIProcess setting _negotiatedLegacyTLS to false, while the NetworkProcess would
message the WebProcess which would message the UIProcess to call PageLoadState::didCommitLoad
which would reset it to false.  Now it resets it to the correct value, whatever it is.

Updating the ResourceResponseBase serialization code has the desirable side effect that the disk
cache will remember whether legacy TLS was used to fetch each resource.  This will make it so
_negotiatedLegacyTLS is true if we read content from the disk cache that was originally fetched
using legacy TLS.

In order to not increase the memory footprint of ResourceResponse, I changed m_httpStatusCode from
an int to a short.  It just needs to be able to cover the values 0-600 or so, which really only needs 10 bits.

Covered by new API tests.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveResponse):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):
(WebKit::NetworkDataTask::negotiatedLegacyTLS const): Deleted.
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): Deleted.
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveResponse):
(WebKit::NetworkLoad::notifyDidReceiveResponse):
(WebKit::NetworkLoad::throttleDelayCompleted):
(WebKit::NetworkLoad::negotiatedLegacyTLS const): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::didReceiveResponse):
* NetworkProcess/PingLoad.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didReceiveResponse):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didCommitLoad):
* UIProcess/PageLoadState.h:
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::commitProvisionalPage):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):

Source/WTF:

* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::decode):
* wtf/persistence/PersistentDecoder.h:
* wtf/persistence/PersistentEncoder.cpp:
(WTF::Persistence::Encoder::encode):
* wtf/persistence/PersistentEncoder.h:

Tools:

HTTPServer now supports HTTPS. Tell your friends!

* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(testCertificate):
(testIdentity):
(credentialWithIdentity):
* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
(TestWebKitAPI::webViewWithNavigationDelegate):
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/HTTPServer.h:
* TestWebKitAPI/cocoa/HTTPServer.mm:
(TestWebKitAPI::HTTPServer::HTTPServer):
(TestWebKitAPI::HTTPServer::request const):

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

5 months ago_WKDownload should expose the originating FrameInfo.
achristensen@apple.com [Wed, 5 Feb 2020 21:05:33 +0000 (21:05 +0000)]
_WKDownload should expose the originating FrameInfo.
<rdar://problem/58022576> and https://bugs.webkit.org/show_bug.cgi?id=207185

Patch by Brady Eidson <beidson@apple.com> on 2020-02-05
Reviewed by Geoff Garen.

Source/WebKit:

Covered by new API test.

For the cases where a navigation is converted into a download, include the relevant
WKFrameInfo on the _WKDownload object.

* UIProcess/API/APIFrameInfo.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKDownload.mm:
(-[_WKDownload originatingFrameInfo]):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::generateDownloadID):
(WebKit::DownloadProxy::DownloadProxy):
(WebKit::DownloadProxy::create): Deleted.
(WebKit::DownloadProxy::setOriginatingPage): Deleted.
* UIProcess/Downloads/DownloadProxy.h:
(WebKit::DownloadProxy::create):
(WebKit::DownloadProxy::frameInfo):
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::createDownloadProxy):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::createDownloadProxy):
* UIProcess/WebProcessPool.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(-[DownloadTestSchemeDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[DownloadSecurityOriginDelegate _downloadDidStart:]):
(loaded):
* TestWebKitAPI/cocoa/HTTPServer.mm:

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

5 months agoRegression: [ Mac Debug wk2 ] http/tests/websocket/tests/hybi/server-close.html is...
tsavell@apple.com [Wed, 5 Feb 2020 20:08:12 +0000 (20:08 +0000)]
Regression: [ Mac Debug wk2 ] http/tests/websocket/tests/hybi/server-close.html is flaky crashing.
https://bugs.webkit.org/show_bug.cgi?id=207269

Unreviewed test gardening.

Updated test expectations.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-05

* platform/mac-wk2/TestExpectations:

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

5 months agoFix MacCatalyst build.
dino@apple.com [Wed, 5 Feb 2020 19:58:07 +0000 (19:58 +0000)]
Fix MacCatalyst build.

* src/libANGLE/validationEGL.cpp:
(egl::ValidateCreatePbufferFromClientBuffer):

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

5 months agoREGRESSION (r228901): Layout Test http/tests/appcache/abort-cache-onprogress.html...
tsavell@apple.com [Wed, 5 Feb 2020 19:53:18 +0000 (19:53 +0000)]
REGRESSION (r228901): Layout Test http/tests/appcache/abort-cache-onprogress.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=183684

Unreviewed test gardening.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-05

* platform/mac-wk2/TestExpectations:

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

5 months agoAX: replaceTextInRange should handle when called on the WebArea element
cfleizach@apple.com [Wed, 5 Feb 2020 19:48:25 +0000 (19:48 +0000)]
AX: replaceTextInRange should handle when called on the WebArea element
https://bugs.webkit.org/show_bug.cgi?id=207242
<rdar://problem/59173196>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: accessibility/mac/replace-text-with-range-on-webarea-element.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::replaceTextInRange):

LayoutTests:

* accessibility/mac/replace-text-with-range-on-webarea-element-expected.txt: Added.
* accessibility/mac/replace-text-with-range-on-webarea-element.html: Added.

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

5 months agoImprove stability of webrtc/video-autoplay.html by splitting tests in multiple files
youenn@apple.com [Wed, 5 Feb 2020 19:14:20 +0000 (19:14 +0000)]
Improve stability of webrtc/video-autoplay.html by splitting tests in multiple files
https://bugs.webkit.org/show_bug.cgi?id=207252

Reviewed by Eric Carlson.

webrtc/video-autplay.html is flaky on bots.
On debug bots, removing the video element from the DOM does not always pause it in a timely manner.
To improve reliability, we split tests in individual files.
Removing flakiness expectation from video-autoplay.html since it no longer contains the flaky tests.

* TestExpectations:
* webrtc/video-autoplay-expected.txt:
* webrtc/video-autoplay.html:
* webrtc/video-autoplay1-expected.txt: Added.
* webrtc/video-autoplay1.html: Added.
* webrtc/video-autoplay2-expected.txt: Added.
* webrtc/video-autoplay2.html: Added.
* webrtc/video-autoplay3-expected.txt: Added.
* webrtc/video-autoplay3.html: Added.
* webrtc/video-autoplay4-expected.txt: Added.
* webrtc/video-autoplay4.html: Added.

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

5 months ago[GTK] Fix dependencies build
calvaris@igalia.com [Wed, 5 Feb 2020 19:10:04 +0000 (19:10 +0000)]
[GTK] Fix dependencies build
https://bugs.webkit.org/show_bug.cgi?id=207273

Reviewed by Carlos Garcia Campos.

* gtk/jhbuild.modules: Bumped wpebackend-fdo version to 1.4.1 and
added mesa as one of its deps. Added the xserver patch as well.
* gtk/patches/xserver-gl-version.patch: Added.

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

5 months ago[GTK] Gardening, new baselines and update TestExpectations
dpino@igalia.com [Wed, 5 Feb 2020 18:38:08 +0000 (18:38 +0000)]
[GTK] Gardening, new baselines and update TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=207259

Unreviewed gardening.

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/css/css-color/animation/opacity-interpolation-expected.txt: Added.
* platform/gtk/inspector/css/shadow-scoped-style-expected.txt: Added.
* platform/gtk/webanimations/opacity-animation-yields-compositing-expected.txt: Added.
* platform/gtk/webanimations/partly-accelerated-transition-by-removing-property-expected.txt: Added.
* platform/gtk/webanimations/width-and-opacity-separate-animation-yields-compositing-expected.txt: Added.

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

5 months ago[bmalloc] Add declspec support for export macros
don.olmstead@sony.com [Wed, 5 Feb 2020 18:37:42 +0000 (18:37 +0000)]
[bmalloc] Add declspec support for export macros
https://bugs.webkit.org/show_bug.cgi?id=207158

Reviewed by Yusuke Suzuki.

Add a check for __has_declspec_attribute which is a Clang extension for Microsoft
style __declspec attributes in BCompiler.h. Then use that check within BPlatform.h
to determine if __declspec or visibility("default") should be used for the export
macros.

The BExport.h file was then expanded to properly implement __declspec definitions
for export and import. Libraries that could be compiled statically in WebKit have
a STATICALLY_LINKED_WITH_${library} definition for when they're compiled statically
and later exposed through a different shared library. In practice though this is
really only needed when __declspec is used since this is the only case where the
import and export declarations differ.

The BEXPORT on StaticPerProcess resulted in undefined symbol errors when WebCore
was linked. Specifically IsoSharedHeap::getFastCase and IsoSharedHeap::getSlowCase
which is a subclass. It appears that Storage was the only one required to be
exported. This only appeared due to how __declspec requires exports and imports
to be defined differently.

Also added support for export macros on PlayStation in the BPlatform.h file and
fixed any exports for that platform when building.

* CMakeLists.txt:
* bmalloc/Allocator.h:
* bmalloc/AvailableMemory.h:
* bmalloc/BCompiler.h:
* bmalloc/BExport.h:
* bmalloc/BPlatform.h:
* bmalloc/Cache.h:
* bmalloc/IsoTLS.h:
* bmalloc/StaticPerProcess.h:

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

5 months ago[ iPadOS wk2 Debug ] compositing/shared-backing/sharing-child-contributes-to-overlap...
tsavell@apple.com [Wed, 5 Feb 2020 18:24:38 +0000 (18:24 +0000)]
[ iPadOS wk2 Debug ] compositing/shared-backing/sharing-child-contributes-to-overlap.html is flaky crashing.
https://bugs.webkit.org/show_bug.cgi?id=207274

Unreviewed test gardening.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-05

* platform/ipad/TestExpectations:

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

5 months ago[macCatalyst] IBeam cursor doesn't show up when hovering over text form controls...
wenson_hsieh@apple.com [Wed, 5 Feb 2020 18:22:02 +0000 (18:22 +0000)]
[macCatalyst] IBeam cursor doesn't show up when hovering over text form controls prior to editing
https://bugs.webkit.org/show_bug.cgi?id=207268
<rdar://problem/59188152>

Reviewed by Tim Horton.

On macCatalyst, when hovering over textareas and input fields that have not been edited yet, the cursor fails to
change to an IBeam and instead falls back to the default style. Even though `EventHandler::selectCursor()`
returns `IBeam`, we end up not actually using an IBeam because the position information's `lineCaretExtent` is
an empty rect, which means the caret height is 0 and, more importantly, the line rect will not contain the
request point.

The line rect is empty in text fields that have not been edited yet because the form control's inner plaintext
contenteditable div (embedded in the shadow root) does not contain any child renderers with a non-zero height.
Even if it did, however, the element may still be much taller than the combined height of the inner div's
children, so the line rect may still not contain the position information request point (this is most easily
noticeable when focusing a textarea, typing a few letters, and then moving the cursor to near the bottom of the
textarea element).

To fix this, add a fallback path for the scenario where we want to show an IBeam, but fail to find line rects
that contain the request point. Instead, we still show an IBeam, but simply fake the lineCaretExtent to be an
element-wide rect that is the height of the caret, and is also vertically centered about the request point.

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

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

5 months agoREGRESSION(r255595): page not closed after beforeunload handler returns true
cdumez@apple.com [Wed, 5 Feb 2020 18:08:54 +0000 (18:08 +0000)]
REGRESSION(r255595): page not closed after beforeunload handler returns true
https://bugs.webkit.org/show_bug.cgi?id=207189
<rdar://problem/59149593>

Reviewed by Youenn Fablet.

Add API test coverage for fix landed in r255677.

* TestWebKitAPI/Tests/WebKitCocoa/ModalAlerts.mm:
(-[SlowBeforeUnloadPromptUIDelegate _webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST):

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

5 months agoREGRESSION: [ iOS wk2 ] fast/scrolling/ios/scroll-events-back-forward.html is flaky...
cdumez@apple.com [Wed, 5 Feb 2020 18:08:03 +0000 (18:08 +0000)]
REGRESSION: [ iOS wk2 ] fast/scrolling/ios/scroll-events-back-forward.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207194
<rdar://problem/59148073>

Reviewed by Wenson Hsieh.

Test was flaky because it relied on a 10ms timer.

* fast/scrolling/ios/scroll-events-back-forward-expected.txt:
* fast/scrolling/ios/scroll-events-back-forward.html:
* platform/ios-wk2/TestExpectations:

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

5 months ago[GTK] Cannot perform most local loads with sandbox enabled
commit-queue@webkit.org [Wed, 5 Feb 2020 18:06:02 +0000 (18:06 +0000)]
[GTK] Cannot perform most local loads with sandbox enabled
https://bugs.webkit.org/show_bug.cgi?id=202071

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-02-05
Reviewed by Carlos Garcia Campos.

SecurityOrigin::canDisplay is improperly checking whether the target file URL points to a
file on the same "volume" (mount point) as the source file. That can't happen here because
this code is running in the web process, but only the network process has access to the
unsandboxed filesystem. This code can only check whether the target file exists within the
sandbox's mount namespace, but that's not what we want to do because we're not going to load
that file, we're going to ask the network process to load the file with the same path
outside the mount namespace.

We can probably live without this check. But if bringing it back is desired, it has to be
done someplace totally different, in network process code rather than web process code.

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay const):

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

5 months ago[iOS wk2 Debug] imported/w3c/web-platform-tests/mathml/presentation-markup/scripts...
tsavell@apple.com [Wed, 5 Feb 2020 17:47:06 +0000 (17:47 +0000)]
[iOS wk2 Debug] imported/w3c/web-platform-tests/mathml/presentation-markup/scripts/cramped-001.html is failing
https://bugs.webkit.org/show_bug.cgi?id=207077

Unreviewed test gardening.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-05

* platform/ios-wk2/TestExpectations:

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

5 months ago[Web Animations] Update snapshot of Web Animations, CSS Animations and CSS Transition...
graouts@webkit.org [Wed, 5 Feb 2020 17:29:14 +0000 (17:29 +0000)]
[Web Animations] Update snapshot of Web Animations, CSS Animations and CSS Transitions WPT tests
https://bugs.webkit.org/show_bug.cgi?id=207263

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/css/css-animations/AnimationEffect-getComputedTiming.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-canceling.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-compositeOrder.tentative-expected.txt: Added.
* web-platform-tests/css/css-animations/CSSAnimation-compositeOrder.tentative.html: Added.
* web-platform-tests/css/css-animations/CSSAnimation-effect.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-finished.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-getCurrentTime.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-id.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-playState.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-ready.tentative.html:
* web-platform-tests/css/css-animations/CSSAnimation-startTime.tentative.html:
* web-platform-tests/css/css-animations/CSSPseudoElement-getAnimations.tentative-expected.txt: Removed.
* web-platform-tests/css/css-animations/CSSPseudoElement-getAnimations.tentative.html: Removed.
* web-platform-tests/css/css-animations/Document-getAnimations.tentative-expected.txt:
* web-platform-tests/css/css-animations/Document-getAnimations.tentative.html:
* web-platform-tests/css/css-animations/Element-getAnimations-dynamic-changes.tentative.html:
* web-platform-tests/css/css-animations/Element-getAnimations.tentative-expected.txt:
* web-platform-tests/css/css-animations/Element-getAnimations.tentative.html:
* web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative.html:
* web-platform-tests/css/css-animations/KeyframeEffect-target.tentative.html:
* web-platform-tests/css/css-animations/animation-before-initial-box-construction-001-expected.txt: Added.
* web-platform-tests/css/css-animations/animation-before-initial-box-construction-001.html: Added.
* web-platform-tests/css/css-animations/animationevent-interface.js:
(test):
* web-platform-tests/css/css-animations/keyframes-remove-documentElement-crash.html:
* web-platform-tests/css/css-animations/support/empty-sheet.css: Added.
* web-platform-tests/css/css-animations/support/w3c-import.log:
* web-platform-tests/css/css-animations/w3c-import.log:
* web-platform-tests/css/css-backgrounds/animations/border-bottom-left-radius-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-bottom-right-radius-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-bottom-width-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-image-outset-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-image-slice-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-image-width-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-left-width-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-right-width-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-top-left-radius-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-top-right-radius-composition-expected.txt:
* web-platform-tests/css/css-backgrounds/animations/border-top-width-composition-expected.txt:
* web-platform-tests/css/css-fonts/animations/font-variation-settings-composition-expected.txt:
* web-platform-tests/css/css-transitions/AnimationEffect-getComputedTiming.tentative.html:
* web-platform-tests/css/css-transitions/CSSPseudoElement-getAnimations.tentative-expected.txt: Removed.
* web-platform-tests/css/css-transitions/CSSPseudoElement-getAnimations.tentative.html: Removed.
* web-platform-tests/css/css-transitions/CSSTransition-canceling.tentative.html:
* web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative.html:
* web-platform-tests/css/css-transitions/CSSTransition-effect.tentative.html:
* web-platform-tests/css/css-transitions/CSSTransition-finished.tentative.html:
* web-platform-tests/css/css-transitions/CSSTransition-ready.tentative.html:
* web-platform-tests/css/css-transitions/CSSTransition-startTime.tentative.html:
* web-platform-tests/css/css-transitions/Document-getAnimations.tentative-expected.txt:
* web-platform-tests/css/css-transitions/Document-getAnimations.tentative.html:
* web-platform-tests/css/css-transitions/Element-getAnimations.tentative.html:
* web-platform-tests/css/css-transitions/KeyframeEffect-getKeyframes.tentative.html:
* web-platform-tests/css/css-transitions/KeyframeEffect-target.tentative.html:
* web-platform-tests/css/css-transitions/README.md:
* web-platform-tests/css/css-transitions/animations/text-shadow-composition-expected.txt: Added.
* web-platform-tests/css/css-transitions/animations/text-shadow-composition.html: Added.
* web-platform-tests/css/css-transitions/animations/text-shadow-interpolation-expected.txt: Added.
* web-platform-tests/css/css-transitions/animations/text-shadow-interpolation.html: Added.
* web-platform-tests/css/css-transitions/animations/vertical-align-composition-expected.txt: Added.
* web-platform-tests/css/css-transitions/animations/vertical-align-composition.html: Added.
* web-platform-tests/css/css-transitions/animations/vertical-align-interpolation-expected.txt: Added.
* web-platform-tests/css/css-transitions/animations/vertical-align-interpolation.html: Added.
* web-platform-tests/css/css-transitions/animations/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/combining-effects/w3c-import.log.
* web-platform-tests/css/css-transitions/animations/z-index-interpolation-expected.txt: Added.
* web-platform-tests/css/css-transitions/animations/z-index-interpolation.html: Added.
* web-platform-tests/css/css-transitions/before-load-001.html:
* web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed.html:
* web-platform-tests/css/css-transitions/properties-value-001.html:
* web-platform-tests/css/css-transitions/properties-value-002.html:
* web-platform-tests/css/css-transitions/properties-value-003.html:
* web-platform-tests/css/css-transitions/properties-value-auto-001.html:
* web-platform-tests/css/css-transitions/properties-value-implicit-001.html:
* web-platform-tests/css/css-transitions/properties-value-inherit-001.html:
* web-platform-tests/css/css-transitions/properties-value-inherit-002.html:
* web-platform-tests/css/css-transitions/properties-value-inherit-003.html:
* web-platform-tests/css/css-transitions/pseudo-elements-001.html:
* web-platform-tests/css/css-transitions/transition-001.html:
* web-platform-tests/css/css-transitions/transition-delay-001.html:
* web-platform-tests/css/css-transitions/transition-duration-001.html:
* web-platform-tests/css/css-transitions/transition-property-001.html:
* web-platform-tests/css/css-transitions/transition-property-002.html:
* web-platform-tests/css/css-transitions/transitionevent-interface.html:
* web-platform-tests/css/css-transitions/w3c-import.log:
* web-platform-tests/css/support/interpolation-testcommon.js:
(cssAnimationsInterpolation.isSupported):
(cssTransitionsInterpolation.isSupported):
(cssTransitionAllInterpolation.isSupported):
(webAnimationsInterpolation.isSupported):
(webAnimationsInterpolation.interpolateComposite):
(createInterpolationTestTargets):
(create_tests):
(test_interpolation):
* web-platform-tests/web-animations/README.md:
* web-platform-tests/web-animations/animation-model/animation-types/property-list.js:
(testAnimationSamplesWithAnyOrder):
* web-platform-tests/web-animations/animation-model/combining-effects/applying-interpolated-transform-expected.txt: Added.
* web-platform-tests/web-animations/animation-model/combining-effects/applying-interpolated-transform.html: Added.
* web-platform-tests/web-animations/animation-model/combining-effects/w3c-import.log:
* web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
* web-platform-tests/web-animations/interfaces/Animatable/animate.html:
* web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/commitStyles.html:
* web-platform-tests/web-animations/interfaces/Animation/onremove-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/Animation/onremove.html: Added.
* web-platform-tests/web-animations/interfaces/Animation/pause.html:
* web-platform-tests/web-animations/interfaces/Animation/play.html:
* web-platform-tests/web-animations/interfaces/Animation/w3c-import.log:
* web-platform-tests/web-animations/interfaces/AnimationEffect/updateTiming.html:
* web-platform-tests/web-animations/interfaces/AnimationPlaybackEvent/w3c-import.log:
* web-platform-tests/web-animations/interfaces/Document/getAnimations-expected.txt: Removed.
* web-platform-tests/web-animations/interfaces/Document/w3c-import.log:
* web-platform-tests/web-animations/interfaces/DocumentOrShadowRoot/getAnimations-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/DocumentOrShadowRoot/getAnimations.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Document/getAnimations.html.
* web-platform-tests/web-animations/interfaces/DocumentOrShadowRoot/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-animations/support/w3c-import.log.
* web-platform-tests/web-animations/interfaces/DocumentTimeline/w3c-import.log:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor.html:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes.html:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/style-change-events.html:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/target-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/target.html:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/w3c-import.log:
* web-platform-tests/web-animations/testcommon.js:
(cubicBezier): Deleted.
* web-platform-tests/web-animations/timing-model/animations/finishing-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/finishing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/pausing-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/pausing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/playing-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/reverse-running-animation-expected.html: Added.
* web-platform-tests/web-animations/timing-model/animations/reverse-running-animation.html: Added.
* web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/setting-the-current-time-of-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/setting-the-current-time-of-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/setting-the-playback-rate-of-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/setting-the-playback-rate-of-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/setting-the-start-time-of-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/setting-the-start-time-of-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/sync-start-times-expected.html: Added.
* web-platform-tests/web-animations/timing-model/animations/sync-start-times.html: Added.
* web-platform-tests/web-animations/timing-model/animations/update-playback-rate-fast-expected.html: Added.
* web-platform-tests/web-animations/timing-model/animations/update-playback-rate-fast.html: Added.
* web-platform-tests/web-animations/timing-model/animations/update-playback-rate-slow-expected.html: Added.
* web-platform-tests/web-animations/timing-model/animations/update-playback-rate-slow.html: Added.
* web-platform-tests/web-animations/timing-model/animations/update-playback-rate-zero-expected.html: Added.
* web-platform-tests/web-animations/timing-model/animations/update-playback-rate-zero.html: Added.
* web-platform-tests/web-animations/timing-model/animations/w3c-import.log:
* web-platform-tests/web-animations/w3c-import.log:

LayoutTests:

* TestExpectations:
* tests-options.json:

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

5 months agoRegression (r252014?) [ Mac wk2 ] http/tests/resourceLoadStatistics/log-cross-site...
tsavell@apple.com [Wed, 5 Feb 2020 17:22:59 +0000 (17:22 +0000)]
Regression (r252014?) [ Mac wk2 ] http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207271

Unreviewed test gardening.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-05

* platform/mac-wk2/TestExpectations:

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

5 months agoUnreviewed, rolling out r255818.
commit-queue@webkit.org [Wed, 5 Feb 2020 17:15:38 +0000 (17:15 +0000)]
Unreviewed, rolling out r255818.
https://bugs.webkit.org/show_bug.cgi?id=207270

It is breaking some Mac builds (Requested by youenn on
#webkit).

Reverted changeset:

"[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=206582
https://trac.webkit.org/changeset/255818

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

5 months ago[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
youenn@apple.com [Wed, 5 Feb 2020 16:53:53 +0000 (16:53 +0000)]
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=206582
Source/WebCore:

<rdar://problem/58985368>

Reviewed by Eric Carlson.

AVAssetWriterDelegate allows to grab recorded data whenever wanted.
This delegate requires passing compressed samples to AVAssetWriter.
Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor.
They support AAC and H264 so far and should be further improved to support more encoding options.

Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere.
The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors.
It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter.
The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data.

Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed.
Therefore data should not be requested too fast to get adequate video compression.

Covered by existing tests.

* Modules/mediarecorder/MediaRecorderProvider.cpp:
(WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
(WebCore::MediaRecorderPrivateAVFImpl::create):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added.
* platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added.
(WebCore::AudioSampleBufferCompressor::create):
(WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
(WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
(WebCore::AudioSampleBufferCompressor::initialize):
(WebCore::AudioSampleBufferCompressor::finish):
(WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
(WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
(WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
(WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
(WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
(WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
(WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
(WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
(WebCore::AudioSampleBufferCompressor::processSampleBuffer):
(WebCore::AudioSampleBufferCompressor::addSampleBuffer):
(WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
(WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(-[WebAVAssetWriterDelegate initWithWriter:]):
(-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]):
(-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]):
(-[WebAVAssetWriterDelegate close]):
(WebCore::MediaRecorderPrivateWriter::create):
(WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback):
(WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback):
(WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::initialize):
(WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::startAssetWriter):
(WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers):
(WebCore::appendEndsPreviousSampleDurationMarker):
(WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded):
(WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::clear):
(WebCore::copySampleBufferWithCurrentTimeStamp):
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
(WebCore::createAudioFormatDescription):
(WebCore::createAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::stopRecording):
(WebCore::MediaRecorderPrivateWriter::appendData):
* platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h.
* platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added.
(WebCore::VideoSampleBufferCompressor::create):
(WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
(WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
(WebCore::VideoSampleBufferCompressor::initialize):
(WebCore::VideoSampleBufferCompressor::finish):
(WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
(WebCore::VideoSampleBufferCompressor::initCompressionSession):
(WebCore::VideoSampleBufferCompressor::processSampleBuffer):
(WebCore::VideoSampleBufferCompressor::addSampleBuffer):
(WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
(WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):

Source/WebCore/PAL:

<rdar://problem/58985368>

Reviewed by Eric Carlson.

Add soft link macros for VideoToolbox and AudioToolbox.

* PAL.xcodeproj/project.pbxproj:
* pal/cf/AudioToolboxSoftLink.cpp: Added.
* pal/cf/AudioToolboxSoftLink.h: Added.
* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:
* pal/cf/VideoToolboxSoftLink.cpp: Added.
* pal/cf/VideoToolboxSoftLink.h: Added.

Source/WebKit:

<rdar://problem/58985368>

Reviewed by Eric Carlson.

Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::didReceiveMessage):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/webrtc/RemoteMediaRecorder.cpp:
* GPUProcess/webrtc/RemoteMediaRecorder.h:
* GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
* GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
* GPUProcess/webrtc/RemoteMediaRecorderManager.h:
* GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
* GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
* WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
* WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
* WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
(WebKit::MediaRecorderProvider::createMediaRecorderPrivate):

Source/WTF:

Reviewed by Eric Carlson.

* wtf/PlatformHave.h:

LayoutTests:

Reviewed by Eric Carlson.

Disable tests on all platforms except the ones supporting AVAssetWriterDelegate.

* TestExpectations:
* http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-gpuprocess.html:
Remove web audio generation since there seems to be some unstability in web audio -> stream -> media recorder.
which should be fixed as follow-up specific patches.
* platform/mac/TestExpectations:

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

5 months agoUnreviewed iOS build fix.
cdumez@apple.com [Wed, 5 Feb 2020 16:51:36 +0000 (16:51 +0000)]
Unreviewed iOS build fix.

* rendering/RenderThemeIOS.h:

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

5 months agoRegression: [ Mac Debug wk2 ] http/tests/websocket/tests/hybi/server-close.html is...
tsavell@apple.com [Wed, 5 Feb 2020 16:49:08 +0000 (16:49 +0000)]
Regression: [ Mac Debug wk2 ] http/tests/websocket/tests/hybi/server-close.html is flaky crashing.
https://bugs.webkit.org/show_bug.cgi?id=207269

Unreviewed test gardening.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-05

* platform/mac-wk2/TestExpectations:

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

5 months agoUnreviewed, rolling out r255706.
cdumez@apple.com [Wed, 5 Feb 2020 16:39:11 +0000 (16:39 +0000)]
Unreviewed, rolling out r255706.

Caused assertions in API tests

Reverted changeset:

"Partial revert of r248734 to fix leak of StorageAreaMaps"
https://bugs.webkit.org/show_bug.cgi?id=207073
https://trac.webkit.org/changeset/255706

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

5 months agoUnreviewed, follow-up assertion fix after r255662.
cdumez@apple.com [Wed, 5 Feb 2020 16:27:50 +0000 (16:27 +0000)]
Unreviewed, follow-up assertion fix after r255662.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):

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

5 months agoresults.webkit.org should disable auto-capitalize over the search field
jbedard@apple.com [Wed, 5 Feb 2020 16:23:13 +0000 (16:23 +0000)]
results.webkit.org should disable auto-capitalize over the search field
https://bugs.webkit.org/show_bug.cgi?id=207240
<rdar://problem/59053042>

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/search.js:

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

5 months ago[ macOS ] imported/w3c/web-platform-tests/hr-time/basic.any.html is flaky failing
tsavell@apple.com [Wed, 5 Feb 2020 15:59:26 +0000 (15:59 +0000)]
[ macOS ] imported/w3c/web-platform-tests/hr-time/basic.any.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=206908

Unreviewed test gardening.

Patch by Jacob Uphoff <jacob_uphoff@apple.com> on 2020-02-05

* platform/mac/TestExpectations:

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

5 months ago[ Mac wk2 ] webgpu/whlsl/ensure-proper-variable-lifetime.html is flaky failing.
tsavell@apple.com [Wed, 5 Feb 2020 15:54:07 +0000 (15:54 +0000)]
[ Mac wk2 ] webgpu/whlsl/ensure-proper-variable-lifetime.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207267

Unreviewed test gardening.

Patch by Jason Lawrence <lawrence.j@apple.com> on 2020-02-05

* platform/mac-wk2/TestExpectations:

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

5 months ago[Web Animations] Canceling an accelerated animation before it was committed does...
graouts@webkit.org [Wed, 5 Feb 2020 11:51:40 +0000 (11:51 +0000)]
[Web Animations] Canceling an accelerated animation before it was committed does not prevent it from playing
https://bugs.webkit.org/show_bug.cgi?id=207253
<rdar://problem/59143624>

Reviewed by Antti Koivisto.

Source/WebCore:

Test: webanimations/accelerated-animation-canceled-before-commit.html

Merely checking whether an accelerated animation is running prior to enqueuing an action to cancel it is not sufficient
since there could be an uncommitted change to start it upon the next animation frame. The same logic would need to apply
in other situations where the playback state changes for a potentially in-flight animation.

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::animationDidSeek):
(WebCore::KeyframeEffect::animationWasCanceled):
(WebCore::KeyframeEffect::willChangeRenderer):
(WebCore::KeyframeEffect::animationSuspensionStateDidChange):

LayoutTests:

Add a new test that checks that an accelerated animation that has been enqueued to start but has
not yet been committed is correctly canceled when the cancel() method is called. This test fails
prior to this source change.

* webanimations/accelerated-animation-canceled-before-commit-expected.html: Added.
* webanimations/accelerated-animation-canceled-before-commit.html: Added.

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

5 months ago[GStreamer] Client-side video rendering doesn't fallback to internal compositing
philn@webkit.org [Wed, 5 Feb 2020 09:59:50 +0000 (09:59 +0000)]
[GStreamer] Client-side video rendering doesn't fallback to internal compositing
https://bugs.webkit.org/show_bug.cgi?id=207208

Patch by Philippe Normand <philn@igalia.com> on 2020-02-05
Reviewed by Xabier Rodriguez-Calvar and Žan Doberšek.

Refactor the default video composition code into a self-contained
closure and invoke it if the video frame holder failed to export
the EGLImage to a valid DMABuf.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::hasDMABuf const):
(WebCore::MediaPlayerPrivateGStreamer::pushTextureToCompositor):

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

5 months ago[WPE] Add support for rendering menu list buttons
carlosgc@webkit.org [Wed, 5 Feb 2020 09:14:17 +0000 (09:14 +0000)]
[WPE] Add support for rendering menu list buttons
https://bugs.webkit.org/show_bug.cgi?id=207196

Reviewed by Žan Doberšek.

* platform/wpe/RenderThemeWPE.cpp:
(WebCore::RenderThemeWPE::supportsFocusRing const):
(WebCore::RenderThemeWPE::adjustTextFieldStyle const):
(WebCore::RenderThemeWPE::paintTextField):
(WebCore::RenderThemeWPE::paintTextArea):
(WebCore::RenderThemeWPE::adjustSearchFieldStyle const):
(WebCore::RenderThemeWPE::paintSearchField):
(WebCore::paintFocus):
(WebCore::paintArrow):
(WebCore::RenderThemeWPE::popupInternalPaddingBox const):
* platform/wpe/RenderThemeWPE.h:

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

6 months ago[JSC] Structure::setMaxOffset and setTransitionOffset are racy
ysuzuki@apple.com [Wed, 5 Feb 2020 07:12:53 +0000 (07:12 +0000)]
[JSC] Structure::setMaxOffset and setTransitionOffset are racy
https://bugs.webkit.org/show_bug.cgi?id=207249

Reviewed by Mark Lam.

We hit crash in JSTests/stress/array-slice-osr-exit-2.js. The situation is following.

    1. The mutator thread (A) is working.
    2. The concurrent collector (B) is working.
    3. A attempts to set m_maxOffset in StructureRareData by allocating it. First, A sets Structure::m_maxOffset to useRareDataFlag.
    3. B is in JSObject::visitButterflyImpl, and executing Structure::maxOffset().
    4. B detects that m_maxOffset is useRareDataFlag.
    5. B attempts to load rareData, but this is not a StructureRareData since A is just now setting up StructureRareData.
    6. B crashes.

Set useRareDataFlag after StructureRareData is set. Ensuring this store-order by using storeStoreFence.

* runtime/Structure.h:

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

6 months ago[GTK] Garden some wpt tests failing with harness timeout
lmoura@igalia.com [Wed, 5 Feb 2020 04:48:35 +0000 (04:48 +0000)]
[GTK] Garden some wpt tests failing with harness timeout
https://bugs.webkit.org/show_bug.cgi?id=207247

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

6 months agoREGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com
wenson_hsieh@apple.com [Wed, 5 Feb 2020 04:32:18 +0000 (04:32 +0000)]
REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com
https://bugs.webkit.org/show_bug.cgi?id=207239
<rdar://problem/58686015>

Reviewed by Tim Horton.

Source/WebKit:

Following r251320, all synthetic mouse events on iOS additionally dispatched corresponding pointer events. This
led to duplicate "pointerdown"/"pointerup" events dispatched with every tap. r253878 fixed this by avoiding
pointer event dispatch for synthetically generated mouse events (and made this determination by consulting
`syntheticClickType()`).

However, in the case where we're synthesizing a mouse event for a "dblclick" event handler (after a double-
tap), we currently pass `NoTap` as the synthetic click event type when creating the mouse event. This causes
additional pointer events to be synthesized and dispatched during a double tap, which creates three pairs of
"pointerdown"/"pointerup" events upon double-tap. This subsequently confuses iCloud Notes' web app when double
tapping to select a word.

Fix this by passing in `OneFingerTap` as the synthetic click type instead (since two-finger double taps should
already be handled by the two-finger double-tap magnification gesture).

Test: pointerevents/ios/pointer-events-for-double-tap.html

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

LayoutTests:

Add a test to verify that performing a double tap on an element with a dblclick handler results in the following
sequence of events: `[ "pointerdown", "pointerup", "pointerdown", "pointerup", "dblclick" ]`.

* pointerevents/ios/pointer-events-for-double-tap-expected.txt: Added.
* pointerevents/ios/pointer-events-for-double-tap.html: Added.
* pointerevents/utils.js:
(const.ui.new.UIController.prototype.doubleTap):

Add a helper method to simulate a double-tap gesture.

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

6 months agoReplace RGBA32 typedef with a class to improve type safety
darin@apple.com [Wed, 5 Feb 2020 03:47:15 +0000 (03:47 +0000)]
Replace RGBA32 typedef with a class to improve type safety
https://bugs.webkit.org/show_bug.cgi?id=206862

Reviewed by Sam Weinig.

Source/WebCore:

* Headers.cmake: Remove RGBColor.h.
* Sources.txt: Remove RBGColor.cpp.
* WebCore.xcodeproj/project.pbxproj: Remove RGBColor.h and RGBColor.cpp.

* css/CSSPrimitiveValue.cpp: Removed include of RGBColor.h.
(WebCore::CSSPrimitiveValue::getCounterValue const): Deleted.
(WebCore::CSSPrimitiveValue::getRectValue const): Deleted.
(WebCore::CSSPrimitiveValue::getRGBColorValue const): Deleted.
* css/CSSPrimitiveValue.h: Updated for the above.

* css/DeprecatedCSSOMPrimitiveValue.cpp:
(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue const): Use
CSSPrimitiveValue::counterValue.
(WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue const): Use
CSSPrimitiveValue::rectValue.
(WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue const): USe
CSSPrimitiveValue::isRGBColor and CSSPrimitiveValue::color.

* css/DeprecatedCSSOMRGBColor.h: Store a Color instead of an RGBA32.
Take a Color argument instead of a RGBColor argument. Refactored to
use a createWrapper template function member to tighten the code.

* css/RGBColor.cpp: Removed.
* css/RGBColor.h: Removed.

* css/StyleColor.cpp:
(WebCore::StyleColor::colorFromKeyword): Explicitly convert to SimpleColor
rather than relying on initializing a Color from an integer ARGB value.

* editing/cocoa/HTMLConverter.mm: Removed include of RGBColor.h.

* inspector/InspectorOverlay.cpp:
(WebCore::drawOutlinedQuadWithClip): Use the Color constructor instead of
Color::createUnchecked.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo): Use
explicit SimpleColor rather than relying on initializing a Color from an
integer ARGB value.

* platform/graphics/Color.cpp: Use constexpr for constant colors.
(WebCore::makeRGB): Implement by calling makeRGBA.
(WebCore::makeRGBA): Use an explicit argument list to call the
SimpleColor constructor.
(WebCore::makeRGBA32FromFloats): Implement by calling makeRGBA.
(WebCore::colorWithOverrideAlpha): Use an explicit argument list to call
the SimpleColor constructor.
(WebCore::parseHexColorInternal): Ditto.
(WebCore::Color::Color): Removed unneeded code to set the color
to invalid, since that's already the default for a new Color object.
Also tweak the logic a bit and add explicit argument list for the
SimpleColor constructor.
(WebCore::SimpleColor::serializationForHTML const): Added. Factored out of
the Color::serialized function.
(WebCore::Color::serialized const): Changed to call serializationForHTML.
(WebCore::fractionDigitsForFractionalAlphaValue): Renamed slightly shorter.
(WebCore::SimpleColor::serializationForCSS const): Added. Factored out of
the Color::cssText function.
(WebCore::Color::cssText const): Changed to call serializationForCSS.
(WebCore::RGBA32::serializationForRenderTreeAsText const): Added.
Factored out of nameForRenderTreeAsText.
(WebCore::Color::nameForRenderTreeAsText const): Changed to call
serializationForRenderTreeAsText.
(WebCore::colorFromPremultipliedARGB): Updated to use the SimpleColor
member functions instead of the red/green/blue/alphaChannel functions.
(WebCore::blend): Use Color::transparent for blending where the old
code used 0 and relied on how that is converted to a Color.

* platform/graphics/Color.h: Replaced the RGBA32 typedef and the
RGBA class with a new class named SimpleColor. Deleted the four
red/green/blue/alphaChannel functions, the Color constructor that
takes and RGBA, and the Color::createUnchecked function. Changed
the color constants to all be constexpr. Moved the inline function
definitions until after everything is delcared.

* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::setSize): Use uint32_t instead of RGBA32.
(WebCore::ImageBackingStore::clear): Ditto.
(WebCore::ImageBackingStore::clearRect): Ditto.
(WebCore::ImageBackingStore::fillRect): Ditto.
(WebCore::ImageBackingStore::repeatFirstRow): Ditto.
(WebCore::ImageBackingStore::pixelAt const): Ditto.
(WebCore::ImageBackingStore::setPixel): Ditto.
(WebCore::ImageBackingStore::blendPixel): Ditto. Convert to and from
SimpleColor so we can use various functions that operate on that type.
Use the isVisible and red/green/blue/alphaComponent member functions.
(WebCore::ImageBackingStore::ImageBackingStore): Ditto.
(WebCore::ImageBackingStore::pixelValue const): Use Color::transparent
instead of returning a 0 and relying on how that is converted to a Color.

* platform/graphics/ImageFrame.h: Removed include of ImageBackingStore.h.
* platform/graphics/ImageSource.h: Added forward delaration of SharedBuffer.

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::platformTransformColorSpace): Call value() to
convert RGBA32, which is now a class, to an 32-bit ARGB integer.

* platform/graphics/cg/ColorCG.cpp:
(WebCore::cachedCGColor): Use constexpr SimpleColor::value function to
switch on a SimpleColor.

* platform/graphics/mac/ColorMac.mm:
(WebCore::oldAquaFocusRingColor): Use an explicit SimpleColor to turn a
hex integer into a Color without relying on implicit conversion.

* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::operator D2D1_COLOR_F const): Use value() to get the color
integer, just to keep this working. Probably needs a better implementation
at some point.

* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::rowAvailable): Don't use makeRGB any more,
write the expression out here instead. More efficient anyway since these
are already single bytes.

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices):  Use an explicit SimpleColor to turn a
hex integer into a Color without relying on implicit conversion.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawBoxes): Ditto. Also use a modern
for loop instead of indexing.
* platform/mock/ScrollbarThemeMock.cpp:
(WebCore::ScrollbarThemeMock::paintTrackBackground): Ditto.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::calculateBorderStyleColor): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::systemColor const): Ditto. Also used named colors.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const): Ditto.

* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject): Added checks against
Color::transparent instead of converting to an integer and checking
against 0. Removed unneeded isValid checks, since invalid color's ARGB
value is Color::transparent.

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Color>::encode): Use uint32_t explicitly to convert
the color value into a SimpleColor.
(IPC::ArgumentCoder<Color>::decode): Same thing, only the other direction.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/PDFSnapshot.mm:
(TestWebKitAPI::TEST): Use the Color constructor instead of Color::createUnchecked.

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

6 months agoRemove NSKeyedArchiverSPI.h now that WebKit only uses API
darin@apple.com [Wed, 5 Feb 2020 03:45:12 +0000 (03:45 +0000)]
Remove NSKeyedArchiverSPI.h now that WebKit only uses API
https://bugs.webkit.org/show_bug.cgi?id=207203

Reviewed by Anders Carlsson.

Source/WebCore:

* editing/cocoa/EditorCocoa.mm:
(WebCore::archivedDataForAttributedString): Removed NSKeyedArchiverSPI.h header and use
NSKeyedArchiver methods directly instead of through WebKit functions.
* loader/archive/cf/LegacyWebArchiveMac.mm:
(WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
(WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Ditto.
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto. Also added
a missing type check when unarchiving a dictionary.
(WebCore::createItemProviderRegistrationList): Ditto. Also added a missing null check.
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Ditto.

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj: Remove NSKeyedArchiverSPI.h.
* pal/PlatformMac.cmake: Ditto.
* pal/spi/cocoa/NSKeyedArchiverSPI.h: Removed.

Source/WebKit:

* Platform/ios/AccessibilityIOS.mm:
(WebKit::newAccessibilityRemoteToken): Removed include of NSKeyedArchiverSPI.h;
use NSKeyedArchiver methods directly.
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::encodeSecureCodingInternal): Ditto.
(IPC::decodeSecureCodingInternal): Ditto.

* Shared/Cocoa/DataDetectionResult.mm: Removed include of NSKeyedArchiverSPI.h.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Ditto.
* Shared/ios/InteractionInformationAtPosition.mm: Ditto.

* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::ContentFilterUnblockHandler>::encode): Removed
include of NSKeyedArchiverSPI.h; use NSKeyedArchiver methods directly.
(IPC::ArgumentCoder<WebCore::ContentFilterUnblockHandler>::decode): Ditto.

* Shared/mac/WebHitTestResultData.mm: Removed include of NSKeyedArchiverSPI.h.

* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::createSerializedRepresentation const): Removed
include of NSKeyedArchiverSPI.h; use NSKeyedArchiver methods directly. Also
refactored so the !CAN_SECURELY_ARCHIVE_FILE_WRAPPER path shares more code
with the modern code path. I think we can remove it entirely once we bump
the minimum version of macOS a bit more.
(API::Attachment::updateFromSerializedRepresentation): Ditto.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
(-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithCoder:]): Ditto.
(-[WKWebView _setInputDelegate:]): Ditto.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration initWithCoder:]): Ditto.
* UIProcess/API/Cocoa/_WKApplicationManifest.mm:
(-[_WKApplicationManifest initWithCoder:]): Ditto.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::elementDidFocus): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: Removed include of NSKeyedArchiverSPI.h
(WebKit::createUnarchiver): Added helper function to make the code below less repetitive.
(WebKit::InjectedBundle::initialize): Use the createUnarchiver function above and the
NSKeyedArchiver methods directly.
(WebKit::InjectedBundle::classesForCoder): Ditto.
(WebKit::InjectedBundle::setBundleParameter): Ditto.
(WebKit::InjectedBundle::setBundleParameters): Ditto.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ApplicationManifest.mm: Removed
include of NSKeyedArchiverSPI.h and call methods of NSKeyedArchiver directly.
* TestWebKitAPI/Tests/WebKitCocoa/Coding.mm: Ditto.
* TestWebKitAPI/Tests/ios/WKWebViewOpaque.mm: Ditto.
* TestWebKitAPI/Tests/mac/EarlyKVOCrash.mm: Ditto.

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

6 months agoREGRESSION [ Mac wk2 ] Tests are jetsamming: Unable to shrink memory footprint of...
ryanhaddad@apple.com [Wed, 5 Feb 2020 02:04:09 +0000 (02:04 +0000)]
REGRESSION [ Mac wk2 ] Tests are jetsamming: Unable to shrink memory footprint of process below the kill thresold [sic]
https://bugs.webkit.org/show_bug.cgi?id=206627

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations: Disable websql tests.
* platform/mac-wk2/TestExpectations: Ditto.

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

6 months agoUpdate ANGLE
dino@apple.com [Wed, 5 Feb 2020 02:02:46 +0000 (02:02 +0000)]
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=206318

Several important changes to fix layout test failures and timeouts in this update.
- Made expensive validation non-default in debug mode to reduce timeouts.
- Optimize disabling ARB_texture_rectangle to make shader compilation much faster.
- Flush before texture deletion to work around Mac Intel driver bug.

Patch by James Darpinian <jdarpinian@chromium.org> on 2020-02-04
Reviewed by Dean Jackson.

* ANGLE.plist: update commit hash
* ANGLE.xcodeproj/project.pbxproj: Add/remove files
* Compiler.cmake: Translated from compiler.gni
* GLESv2.cmake: Translated from libGLESv2.gni
* changes.diff: Now lists all changes from upstream.
* update-angle.sh: Diff command was wrong.
* Plus a whole lot of changes from upstream.

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

6 months agoresults.webkit.org: Support Internal in run-javascriptcore-tests
jbedard@apple.com [Wed, 5 Feb 2020 01:47:51 +0000 (01:47 +0000)]
results.webkit.org: Support Internal in run-javascriptcore-tests
https://bugs.webkit.org/show_bug.cgi?id=204095

Rubber-stamped by Aakash Jain.

* Scripts/VCSUtils.pm:
(gitBisectStartBranchForDirectory): Renamed from gitBisectStartBranch.
(gitBranchForDirectory): Compute branch for directory.
(gitBranch): Compute branch for the current git directory.
(commitForDirectory): Add git support.
(gitBisectStartBranch): Renamed to gitBisectStartBranchForDirectory.
* Scripts/run-javascriptcore-tests:
(uploadResults): Check for Internal repository.

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

6 months agoREGRESSION: (r255611) [ Mac ] 3 lldb tests failing related to HashMap
commit-queue@webkit.org [Wed, 5 Feb 2020 01:46:59 +0000 (01:46 +0000)]
REGRESSION: (r255611) [ Mac ] 3 lldb tests failing related to HashMap
https://bugs.webkit.org/show_bug.cgi?id=207204

Patch by Alex Christensen <achristensen@webkit.org> on 2020-02-04
Reviewed by Simon Fraser.

Remove support for HashSet and HashMap until we are able to do the equivalent of reinterpret_cast<unsigned*>(pointer)[-1]
in LLDB's python API.

* lldb/lldb_webkit_unittest.py:
(TestSummaryProviders.serial_test_WTFHashMap_tablesize_and_size):
(TestSummaryProviders.serial_test_WTFHashMap_of_vectors_tablesize_and_size):
(TestSummaryProviders.serial_test_WTFHashSet_tablesize_and_size):

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

6 months agoFix internal build after r255709
achristensen@apple.com [Wed, 5 Feb 2020 01:30:56 +0000 (01:30 +0000)]
Fix internal build after r255709
https://bugs.webkit.org/show_bug.cgi?id=207231

* platform/ios/WebItemProviderPasteboard.h:
Revert part of the original change.

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

6 months ago[EWS] Stop GTK/WPE build if jhbuild fails.
lmoura@igalia.com [Wed, 5 Feb 2020 01:13:31 +0000 (01:13 +0000)]
[EWS] Stop GTK/WPE build if jhbuild fails.
https://bugs.webkit.org/show_bug.cgi?id=207220

Reviewed by Adrian Perez de Castro.

* BuildSlaveSupport/ews-build/steps.py:
(InstallGtkDependencies): Halt on failure
(InstallWpeDependencies): Ditto

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

6 months agoREGRESSION: [ macOS wk1 ] ASSERTION FAILED: http/tests/notifications/event-listener...
ryanhaddad@apple.com [Wed, 5 Feb 2020 00:39:41 +0000 (00:39 +0000)]
REGRESSION: [ macOS wk1 ] ASSERTION FAILED: http/tests/notifications/event-listener-crash.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=207237

Unreviewed test gardening.

Patch by Jacob Uphoff <jacob_uphoff@apple.com> on 2020-02-04

* platform/mac-wk1/TestExpectations:

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

6 months agoNon-unified build fixes early February 2020 edition
aperez@igalia.com [Wed, 5 Feb 2020 00:09:42 +0000 (00:09 +0000)]
Non-unified build fixes early February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=207227

Reviewed by Don Olmstead.

Source/JavaScriptCore:

* bytecode/PolyProtoAccessChain.h: Add missing inclusions of StructureIDTable.h and VM.h

Source/WebCore:

No new tests needed.

* accessibility/atk/AccessibilityObjectAtk.cpp: Add missing inclusion of WebKitAccessible.h
* inspector/agents/InspectorAnimationAgent.cpp: Add issing inclusions of JSExecState.h and
JavaScriptCore/InjectedScriptManager.h
* style/MatchedDeclarationsCache.cpp: Add missing inclusion of FontCascade.h

Source/WTF:

* wtf/SingleRootGraph.h: Add missing inclusion of wtf/StringPrintStream.h

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

6 months agomacCatalyst: Shouldn't get text cursor on checkboxes
timothy_horton@apple.com [Tue, 4 Feb 2020 23:43:42 +0000 (23:43 +0000)]
macCatalyst: Shouldn't get text cursor on checkboxes
https://bugs.webkit.org/show_bug.cgi?id=207234
<rdar://problem/59155917>

Reviewed by Wenson Hsieh.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::canForceCaretForPosition):
(WebKit::populateCaretContext):
(WebKit::lineCaretExtent): Deleted.
The I-beam forcing code was a bit too aggressive; it should consider
the style of the node that it ends up finding after searching, not just
assume it wants an I-beam because it's "texty".

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