Add media stream release logging
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-15  Eric Carlson  <eric.carlson@apple.com>
2
3         Add media stream release logging
4         https://bugs.webkit.org/show_bug.cgi?id=195823
5         <rdar://problem/48939406>
6
7         Reviewed by Youenn Fablet.
8
9         No new tests, no behavioral change.
10
11         * Modules/mediastream/MediaStream.cpp:
12         (WebCore::MediaStream::MediaStream):
13         (WebCore::MediaStream::clone):
14         (WebCore::MediaStream::addTrack):
15         (WebCore::MediaStream::removeTrack):
16         (WebCore::MediaStream::addTrackFromPlatform):
17         (WebCore::MediaStream::setIsActive):
18         (WebCore::MediaStream::mediaCanStart):
19         (WebCore::MediaStream::startProducingData):
20         (WebCore::MediaStream::stopProducingData):
21         (WebCore::MediaStream::endCaptureTracks):
22         (WebCore::MediaStream::stop):
23         (WebCore::MediaStream::logChannel const):
24         * Modules/mediastream/MediaStream.h:
25         * Modules/mediastream/MediaStreamTrack.cpp:
26         (WebCore::MediaStreamTrack::MediaStreamTrack):
27         (WebCore::MediaStreamTrack::logChannel const):
28         * Modules/mediastream/MediaStreamTrack.h:
29         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
30         (WebCore::LibWebRTCMediaEndpoint::addTrack):
31         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
32         * Modules/webaudio/AudioContext.cpp:
33         (WebCore::AudioContext::AudioContext):
34         (WebCore::nextLogIdentifier): Deleted.
35         * html/HTMLMediaElement.cpp:
36         (WebCore::HTMLMediaElement::HTMLMediaElement):
37         (WebCore::nextLogIdentifier): Deleted.
38         * html/HTMLMediaElement.h:
39         * platform/audio/PlatformMediaSession.cpp:
40         (WebCore::PlatformMediaSession::PlatformMediaSession):
41         (WebCore::nextLogIdentifier): Deleted.
42         * platform/audio/PlatformMediaSession.h:
43         * platform/graphics/IntSize.cpp:
44         (WebCore::IntSize::toJSONObject const):
45         (WebCore::IntSize::toJSONString const):
46         * platform/graphics/IntSize.h:
47         (WTF::LogArgument<WebCore::IntSize>::toString):
48         * platform/mediastream/MediaStreamPrivate.cpp:
49         (WebCore::MediaStreamPrivate::addTrack):
50         (WebCore::MediaStreamPrivate::removeTrack):
51         (WebCore::MediaStreamPrivate::startProducingData):
52         (WebCore::MediaStreamPrivate::stopProducingData):
53         (WebCore::MediaStreamPrivate::setCaptureTracksMuted):
54         (WebCore::MediaStreamPrivate::trackMutedChanged):
55         (WebCore::MediaStreamPrivate::trackEnabledChanged):
56         (WebCore::MediaStreamPrivate::trackStarted):
57         (WebCore::MediaStreamPrivate::trackEnded):
58         (WebCore::MediaStreamPrivate::setLogger):
59         (WebCore::MediaStreamPrivate::logChannel const):
60         * platform/mediastream/MediaStreamPrivate.h:
61         * platform/mediastream/MediaStreamTrackPrivate.cpp:
62         (WebCore::MediaStreamTrackPrivate::setLogger):
63         (WebCore::MediaStreamTrackPrivate::logChannel const):
64         * platform/mediastream/MediaStreamTrackPrivate.h:
65         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
66         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
67         (WebCore::RealtimeIncomingAudioSource::logChannel const): Deleted.
68         (WebCore::RealtimeIncomingAudioSource::logger const): Deleted.
69         * platform/mediastream/RealtimeIncomingAudioSource.h:
70         (WebCore::RealtimeIncomingAudioSource::setLogger): Deleted.
71         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
72         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
73         (WebCore::RealtimeIncomingVideoSource::logChannel const): Deleted.
74         (WebCore::RealtimeIncomingVideoSource::logger const): Deleted.
75         * platform/mediastream/RealtimeIncomingVideoSource.h:
76         (WebCore::RealtimeIncomingVideoSource::setLogger): Deleted.
77         * platform/mediastream/RealtimeMediaSource.cpp:
78         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
79         (WebCore::RealtimeMediaSource::setInterrupted):
80         (WebCore::RealtimeMediaSource::setMuted):
81         (WebCore::RealtimeMediaSource::notifyMutedChange):
82         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
83         (WebCore::RealtimeMediaSource::videoSampleAvailable):
84         (WebCore::RealtimeMediaSource::start):
85         (WebCore::RealtimeMediaSource::stop):
86         (WebCore::RealtimeMediaSource::captureFailed):
87         (WebCore::RealtimeMediaSource::applyConstraint):
88         (WebCore::RealtimeMediaSource::supportsConstraints):
89         (WebCore::RealtimeMediaSource::applyConstraints):
90         (WebCore::RealtimeMediaSource::setSize):
91         (WebCore::RealtimeMediaSource::setIntrinsicSize):
92         (WebCore::RealtimeMediaSource::setFrameRate):
93         (WebCore::RealtimeMediaSource::setAspectRatio):
94         (WebCore::RealtimeMediaSource::setFacingMode):
95         (WebCore::RealtimeMediaSource::setVolume):
96         (WebCore::RealtimeMediaSource::setSampleRate):
97         (WebCore::RealtimeMediaSource::setSampleSize):
98         (WebCore::RealtimeMediaSource::setEchoCancellation):
99         (WebCore::RealtimeMediaSource::setLogger):
100         (WebCore::RealtimeMediaSource::logChannel const):
101         (WebCore::convertEnumerationToString):
102         * platform/mediastream/RealtimeMediaSource.h:
103         (WTF::LogArgument<WebCore::RealtimeMediaSource::Type>::toString):
104         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
105         (WebCore::RealtimeMediaSourceSettings::convertFlagsToString):
106         (WebCore::convertEnumerationToString):
107         * platform/mediastream/RealtimeMediaSourceSettings.h:
108         (WTF::LogArgument<WebCore::RealtimeMediaSourceSettings::VideoFacingMode>::toString):
109         (WTF::LogArgument<OptionSet<WebCore::RealtimeMediaSourceSettings::Flag>>::toString):
110         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
111         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
112         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
113         (WebCore::RealtimeOutgoingAudioSource::logger const): Deleted.
114         * platform/mediastream/RealtimeOutgoingAudioSource.h:
115         (WebCore::RealtimeOutgoingAudioSource::setLogger): Deleted.
116         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
117         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
118         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
119         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
120         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
121         (WebCore::RealtimeOutgoingVideoSource::logger const): Deleted.
122         * platform/mediastream/RealtimeOutgoingVideoSource.h:
123         (WebCore::RealtimeOutgoingVideoSource::setLogger): Deleted.
124         * platform/mediastream/RealtimeVideoSource.cpp:
125         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
126         (WebCore::SizeAndFrameRate::toJSONObject const):
127         (WebCore::SizeAndFrameRate::toJSONString const):
128         * platform/mediastream/RealtimeVideoSource.h:
129         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
130         * platform/mediastream/mac/AVVideoCaptureSource.h:
131         * platform/mediastream/mac/AVVideoCaptureSource.mm:
132         (WebCore::AVVideoCaptureSource::clearSession):
133         (WebCore::AVVideoCaptureSource::startProducingData):
134         (WebCore::AVVideoCaptureSource::stopProducingData):
135         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
136         (WebCore::AVVideoCaptureSource::setupSession):
137         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
138         (WebCore::AVVideoCaptureSource::setupCaptureSession):
139         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
140         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
141         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
142         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
143         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
144         (WebCore::AVVideoCaptureSource::deviceDisconnected):
145         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
146         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
147         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
148         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
149         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
150         (WebCore::AVVideoCaptureSource::initializeSession): Deleted.
151         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
152         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
153         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
154         (WebCore::CoreAudioSharedUnit::captureFailed):
155         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
156         (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
157         (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
158         (WebCore::CoreAudioCaptureSource::startProducingData):
159         (WebCore::CoreAudioCaptureSource::stopProducingData):
160         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
161         (WebCore::CoreAudioCaptureSource::beginInterruption):
162         (WebCore::CoreAudioCaptureSource::endInterruption):
163         * platform/mediastream/mac/CoreAudioCaptureSource.h:
164         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
165         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
166         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
167         (WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
168         (WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
169         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
170
171 2019-03-15  Devin Rousso  <drousso@apple.com>
172
173         Web Inspector: Canvas: remove agent as observer when disabling
174         https://bugs.webkit.org/show_bug.cgi?id=195825
175         <rdar://problem/48940255>
176
177         Reviewed by Joseph Pecoraro.
178
179         No change in functionality.
180
181         * inspector/agents/InspectorCanvasAgent.cpp:
182         (WebCore::InspectorCanvasAgent::disable):
183
184 2019-03-15  Ryosuke Niwa  <rniwa@webkit.org>
185
186         REGRESSION (r239814): Most classes that user Timer have 7 bytes of padding after the Timer
187         https://bugs.webkit.org/show_bug.cgi?id=194196
188
189         Reviewed by Simon Fraser.
190
191         Use std::nan as the value of m_unalignedNextFireTime to indicate the timer had been deleted
192         instead of having a dedicated boolean, which consumes 7 extra bytes for padding.
193
194         Note that some code in WebKit uses +Infinity as a fire time so we can't use that.
195
196         * platform/Timer.cpp:
197         (WebCore::TimerBase::TimerBase):
198         (WebCore::TimerBase::~TimerBase):
199         (WebCore::TimerBase::setNextFireTime):
200         (WebCore::TimerBase::nextUnalignedFireInterval const):
201         * platform/Timer.h:
202
203 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
204
205         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
206         https://bugs.webkit.org/show_bug.cgi?id=190350
207         <rdar://problem/45089503>
208
209         Reviewed by Geoffrey Garen.
210
211         Start to use hash for database file names so that the files can work on any filesystem.
212
213         We created v0 folder in IndexedDB directory to put the legacy databases, and v1 folder to put the upgraded 
214         databases.
215
216         Tests: TestWebKitAPI.IndexedDB.IndexedDBFileName
217                TestWebKitAPI.IndexedDB.IndexedDBFileNameV0
218                TestWebKitAPI.IndexedDB.IndexedDBFileNameV1
219                TestWebKitAPI.IndexedDB.IndexedDBFileNameAPI
220                TestWebKitAPI.IndexedDB.HashCollision
221
222         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
223         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
224         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
225         * Modules/indexeddb/IDBDatabaseIdentifier.h:
226         * Modules/indexeddb/server/IDBServer.cpp:
227         (WebCore::IDBServer::m_quotaManagerGetter):
228         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
229         (WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
230         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
231         (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
232         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
233         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
234         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
235         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
236         (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
237         * Modules/indexeddb/server/IDBServer.h:
238         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
239         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
240         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
241         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath const):
242         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
243         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
244         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
245         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
246         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
247         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
248         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
249         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory const): Deleted.
250         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
251         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const):
252         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
253         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
254         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
255         * platform/sql/SQLiteFileSystem.cpp:
256         (WebCore::SQLiteFileSystem::computeHashForFileName):
257         * platform/sql/SQLiteFileSystem.h:
258
259 2019-03-15  Zalan Bujtas  <zalan@apple.com>
260
261         [ContentChangeObserver] HTMLImageElement::willRespondToMouseClickEvents returns quirk value.
262         https://bugs.webkit.org/show_bug.cgi?id=195657
263         <rdar://problem/48834987>
264
265         Reviewed by Simon Fraser.
266
267         Images should not trigger hover by default (only when they actually respond to mouse events).
268
269         Test: fast/events/touch/ios/content-observation/visibility-change-with-image-content.html
270
271         * page/ios/ContentChangeObserver.cpp:
272         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
273
274 2019-03-15  Jer Noble  <jer.noble@apple.com>
275
276         Add a "supportedConfiguration" dictionary to MediaCapabilitiesDecodingInfo and MediaCapabilitiesEncodingInfo
277         https://bugs.webkit.org/show_bug.cgi?id=195763
278
279         Reviewed by Jon Lee.
280
281         Test: media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html
282
283         Add support for a proposed addition to the Media Capabilities spec that would future-proof additional changes
284         to Media Capabilities by allowing sites to check exactly what properties were queried by the browser when
285         answering a decodeInfo() or enocdeInfo() query.
286
287         * CMakeLists.txt:
288         * DerivedSources-input.xcfilelist:
289         * DerivedSources-output.xcfilelist:
290         * DerivedSources.make:
291         * Modules/mediacapabilities/AudioConfiguration.idl:
292         * Modules/mediacapabilities/MediaCapabilities.cpp:
293         (WebCore::MediaCapabilities::decodingInfo):
294         (WebCore::MediaCapabilities::encodingInfo):
295         * Modules/mediacapabilities/MediaCapabilities.idl:
296         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
297         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
298         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
299         * Modules/mediacapabilities/MediaDecodingConfiguration.idl:
300         * Modules/mediacapabilities/MediaEncodingConfiguration.idl:
301         * Modules/mediacapabilities/VideoConfiguration.idl:
302         * Sources.txt:
303         * WebCore.xcodeproj/project.pbxproj:
304         * platform/MediaCapabilitiesDecodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
305         (WebCore::MediaCapabilitiesDecodingInfo::MediaCapabilitiesDecodingInfo):
306         * platform/MediaCapabilitiesEncodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
307         (WebCore::MediaCapabilitiesEncodingInfo::MediaCapabilitiesEncodingInfo):
308         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
309         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
310         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h:
311         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp:
312         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
313         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h:
314         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
315         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
316         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
317         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
318         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
319         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
320         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
321         * platform/mock/MediaEngineConfigurationFactoryMock.h:
322
323 2019-03-15  Antti Koivisto  <antti@apple.com>
324
325         Use Region for event region even when it is a rectangle
326         https://bugs.webkit.org/show_bug.cgi?id=195803
327
328         Reviewed by Simon Fraser.
329
330         Region type is now optimized for the common single-rectangle case so we can simplify code.
331
332         * platform/graphics/GraphicsLayer.cpp:
333         (WebCore::GraphicsLayer::setEventRegion):
334         * platform/graphics/GraphicsLayer.h:
335         (WebCore::GraphicsLayer::eventRegion const):
336         * platform/graphics/ca/GraphicsLayerCA.cpp:
337         (WebCore::GraphicsLayerCA::setEventRegion):
338         * platform/graphics/ca/GraphicsLayerCA.h:
339         * platform/graphics/ca/PlatformCALayer.h:
340         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
341         * rendering/RenderLayerBacking.cpp:
342         (WebCore::RenderLayerBacking::paintIntoLayer):
343
344 2019-03-15  Jer Noble  <jer.noble@apple.com>
345
346         Unreviewed unified build fix: GPUBindGroup has a default public constructor and destructor, so all its member
347         variables must be fully defined.
348
349         * platform/graphics/gpu/GPUBindGroup.h:
350
351 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
352
353         [macOS] Broker access to Speech Synthesis
354         https://bugs.webkit.org/show_bug.cgi?id=195645
355         <rdar://problem/35369026>
356
357         Reviewed by Brent Fulgham.
358
359         To be able to close the connection to the speech synthesis daemon in the WebContent process,
360         speech synthesis should be performed in the UI process. This patch forwards speech synthesis
361         requests to the UI process by sending messages. On the UI process side, the speech synthesis
362         is performed by simply using the existing platform speech synthesizer. Speech synthesis
363         events are sent back to the WebContent process. All messages are async, except for the
364         message to get the list of available voices.
365
366         No new tests, covered by existing tests.
367
368         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
369         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
370         * Modules/speech/SpeechSynthesis.cpp:
371         (WebCore::SpeechSynthesis::create):
372         (WebCore::SpeechSynthesis::SpeechSynthesis):
373         (WebCore::SpeechSynthesis::setPlatformSynthesizer):
374         (WebCore::SpeechSynthesis::getVoices):
375         (WebCore::SpeechSynthesis::startSpeakingImmediately):
376         (WebCore::SpeechSynthesis::cancel):
377         (WebCore::SpeechSynthesis::pause):
378         (WebCore::SpeechSynthesis::resume):
379         (WebCore::SpeechSynthesis::boundaryEventOccurred):
380         (WebCore::SpeechSynthesis::didStartSpeaking):
381         (WebCore::SpeechSynthesis::didFinishSpeaking):
382         (WebCore::SpeechSynthesis::didPauseSpeaking):
383         (WebCore::SpeechSynthesis::didResumeSpeaking):
384         (WebCore::SpeechSynthesis::speakingErrorOccurred):
385         (WebCore::SpeechSynthesis::voicesChanged):
386         * Modules/speech/SpeechSynthesis.h:
387         * WebCore.xcodeproj/project.pbxproj:
388         * page/Page.cpp:
389         (WebCore::Page::Page):
390         * page/Page.h:
391         (WebCore::Page::speechSynthesisClient const):
392         * page/PageConfiguration.cpp:
393         * page/PageConfiguration.h:
394         * page/SpeechSynthesisClient.h: Added.
395         * platform/PlatformSpeechSynthesisUtterance.h:
396         * platform/PlatformSpeechSynthesizer.h:
397         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
398         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
399         * platform/mac/PlatformSpeechSynthesizerMac.mm:
400         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakWord:ofString:]):
401         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
402         (WebCore::PlatformSpeechSynthesizerMock::speak):
403
404 2019-03-15  Antti Koivisto  <antti@apple.com>
405
406         Try to fix watchOS build.
407
408         * platform/graphics/Region.h:
409         (WebCore::Region::Span::decode):
410
411 2019-03-15  Simon Fraser  <simon.fraser@apple.com>
412
413         [Async overflow Scrolling] Update positioned node layers when overflows are scrolled
414         https://bugs.webkit.org/show_bug.cgi?id=195733
415         rdar://problem/11642295
416
417         Reviewed by Antti Koivisto.
418
419         Make ScrollingTree positioned nodes in the two cases where we need them, as
420         detected by RenderLayerCompositor::computeCoordinatedPositioningForLayer().
421
422         For "Moves" layers we know that the overflow is not in the z-order ancestor chain,
423         so ScrollingTree needs a map of overflow node -> affected positioned nodes which
424         notifyRelatedNodesAfterScrollPositionChange() uses to find nodes to update after
425         a scroll. Computing these dependent nodes in RenderLayerCompositor() would require
426         correct dependency analysis between an overflow layers and "positioned" layers which
427         is hard. It's easier to have "positioned" layers figure out which overflow nodes
428         affect them, then compute the inverse relationship when the scrolling tree is updated
429         which happens in ScrollingTreePositionedNode::commitStateBeforeChildren().
430
431         Tests: scrollingcoordinator/ios/absolute-layer-should-not-move-with-scroll.html
432                scrollingcoordinator/ios/relative-layer-should-move-with-scroll.html
433
434         * page/scrolling/ScrollingTree.cpp:
435         (WebCore::ScrollingTree::commitTreeState):
436         (WebCore::ScrollingTree::applyLayerPositions):
437         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
438         (WebCore::ScrollingTree::scrollingTreeAsText):
439         * page/scrolling/ScrollingTree.h:
440         (WebCore::ScrollingTree::overflowRelatedNodes):
441         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
442         (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
443         * page/scrolling/ScrollingTreeOverflowScrollingNode.h:
444         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
445         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
446         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
447         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
448         * rendering/RenderLayerCompositor.cpp:
449         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary):
450         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
451         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
452         (WebCore::collectRelatedCoordinatedScrollingNodes):
453         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
454
455 2019-03-15  Antti Koivisto  <antti@apple.com>
456
457         Optimize Region for single rectangle case
458         https://bugs.webkit.org/show_bug.cgi?id=195743
459
460         Reviewed by Simon Fraser.
461
462         Instrumentation shows vast majority of Region objects consist of a single rectangle. However it always allocates
463         the large Shape data structure. This makes it unsuitable to use as a member in any popular objects.
464
465         This patch optimizes the single rectangle case by using only the bounds rectangle to describe it.
466         Shape is allocated on demand. This makes it safe to use Region as a data member where a rectangle is the common case.
467
468         The patch also modernizes Region encoding/decoding support.
469
470         * platform/graphics/Region.cpp:
471         (WebCore::Region::Region):
472         (WebCore::Region::~Region):
473         (WebCore::Region::operator=):
474         (WebCore::Region::rects const):
475         (WebCore::Region::contains const):
476         (WebCore::Region::intersects const):
477         (WebCore::Region::Shape::Shape):
478         (WebCore::Region::Shape::appendSpan):
479         (WebCore::Region::dump const):
480         (WebCore::Region::intersect):
481         (WebCore::Region::unite):
482         (WebCore::Region::subtract):
483         (WebCore::Region::translate):
484         (WebCore::Region::setShape):
485         (WebCore::Region::Shape::isValid const): Deleted.
486         (WebCore::Region::Shape::swap): Deleted.
487         (WebCore::Region::updateBoundsFromShape): Deleted.
488
489         Remove some now unused function.
490
491         * platform/graphics/Region.h:
492         (WebCore::Region::isRect const):
493         (WebCore::Region::gridSize const):
494         (WebCore::Region::copyShape const):
495         (WebCore::operator==):
496         (WebCore::Region::Span::encode const):
497         (WebCore::Region::Span::decode):
498         (WebCore::Region::Shape::encode const):
499         (WebCore::Region::Shape::decode):
500         (WebCore::Region::encode const):
501         (WebCore::Region::decode):
502
503         This is now part of type.
504
505         (WebCore::Region::isValid const): Deleted.
506         (WebCore::Region::Span::Span): Deleted.
507         (WebCore::Region::shapeSegments const): Deleted.
508         (WebCore::Region::shapeSpans const): Deleted.
509         (WebCore::Region::setShapeSegments): Deleted.
510         (WebCore::Region::setShapeSpans): Deleted.
511         (WebCore::Region::Shape::segments const): Deleted.
512         (WebCore::Region::Shape::spans const): Deleted.
513         (WebCore::Region::Shape::setSegments): Deleted.
514         (WebCore::Region::Shape::setSpans): Deleted.
515
516         No need to expose these for encoding anymore.
517
518 2019-03-15  Devin Rousso  <drousso@apple.com>
519
520         Web Inspector: provide a way to capture a screenshot of a node from within the page
521         https://bugs.webkit.org/show_bug.cgi?id=194279
522         <rdar://problem/10731573>
523
524         Reviewed by Joseph Pecoraro.
525
526         Test: inspector/console/console-screenshot.html
527
528         Add `console.screenshot` functionality, which displays a screenshot of a given object (if
529         able) within Web Inspector's Console tab. From there, it can be viewed and saved.
530
531         Currently, `console.screenshot` will
532          - capture an image of a `Node` (if provided)
533          - capture an image of the viewport if nothing is provided
534
535         * page/PageConsoleClient.h:
536         * page/PageConsoleClient.cpp:
537         (WebCore::PageConsoleClient::addMessage):
538         (WebCore::PageConsoleClient::screenshot): Added.
539
540         * workers/WorkerConsoleClient.h:
541         * workers/WorkerConsoleClient.cpp:
542         (WebCore::WorkerConsoleClient::screenshot): Added.
543         * worklets/WorkletConsoleClient.h:
544         * worklets/WorkletConsoleClient.cpp:
545         (WebCore::WorkletConsoleClient::screenshot): Added.
546
547         * inspector/CommandLineAPIModuleSource.js:
548         (CommandLineAPIImpl.prototype.screenshot): Added.
549
550         * inspector/InspectorInstrumentation.h:
551
552 2019-03-14  Yusuke Suzuki  <ysuzuki@apple.com>
553
554         [JSC] Retain PrivateName of Symbol before passing it to operations potentially incurring GC
555         https://bugs.webkit.org/show_bug.cgi?id=195791
556         <rdar://problem/48806130>
557
558         Reviewed by Mark Lam.
559
560         * bindings/js/ScriptController.cpp:
561         (WebCore::ScriptController::setupModuleScriptHandlers):
562
563 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
564
565         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
566         https://bugs.webkit.org/show_bug.cgi?id=195754
567         <rdar://problem/48591957>
568
569         Reviewed by Jiewen Tan.
570
571         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
572         Update the const correctness of one function call to match new SDK declaration.
573
574         No tests because there are no changes in behavior.
575
576         * crypto/CommonCryptoUtilities.h:
577         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
578         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
579
580 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
581
582         IndexedDB: re-enable some leak tests
583         https://bugs.webkit.org/show_bug.cgi?id=194806
584
585         Reviewed by Geoffrey Garen.
586
587         Protected JSIDBCursor object when advance/continue request on IDBCursor is not finished, because after the 
588         advance operation completes on success, we need to return the same JSIDBCursor object as before the advance, 
589         and during the wait for advance operation to complete, we need to return error as the result. 
590  
591         Covered by existing tests.
592
593         * Modules/indexeddb/IDBCursor.cpp:
594         (WebCore::IDBCursor::setGetResult):
595         (WebCore::IDBCursor::clearWrappers):
596         * Modules/indexeddb/IDBCursor.h:
597         * Modules/indexeddb/IDBRequest.cpp:
598         (WebCore::IDBRequest::stop):
599         (WebCore::IDBRequest::setResult):
600         (WebCore::IDBRequest::setResultToStructuredClone):
601         (WebCore::IDBRequest::setResultToUndefined):
602         (WebCore::IDBRequest::willIterateCursor):
603         (WebCore::IDBRequest::didOpenOrIterateCursor):
604         (WebCore::IDBRequest::clearWrappers):
605         * Modules/indexeddb/IDBRequest.h:
606         (WebCore::IDBRequest::cursorWrapper):
607         * bindings/js/JSIDBRequestCustom.cpp:
608         (WebCore::JSIDBRequest::visitAdditionalChildren):
609         * bindings/js/JSValueInWrappedObject.h:
610         (WebCore::JSValueInWrappedObject::JSValueInWrappedObject):
611         (WebCore::JSValueInWrappedObject::operator=):
612         (WebCore::JSValueInWrappedObject::clear):
613
614 2019-03-14  Shawn Roberts  <sroberts@apple.com>
615
616         Unreviewed, rolling out r242981.
617
618         Causing internal build failures on watch/tv OS
619
620         Reverted changeset:
621
622         "Move CoreCrypto SPI declarations to an appropriate PAL/spi
623         header"
624         https://bugs.webkit.org/show_bug.cgi?id=195754
625         https://trac.webkit.org/changeset/242981
626
627 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
628
629         Web process is put to suspended when holding locked WebSQL files
630         https://bugs.webkit.org/show_bug.cgi?id=195768
631
632         Reviewed by Geoffrey Garen.
633
634         We need to keep processes active during database close, because SQLite database may run a checkpoint operation
635         and lock database files.
636
637         * platform/sql/SQLiteDatabase.cpp:
638         (WebCore::SQLiteDatabase::useWALJournalMode):
639         (WebCore::SQLiteDatabase::close):
640         * platform/sql/SQLiteDatabase.h:
641
642 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
643
644         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
645         https://bugs.webkit.org/show_bug.cgi?id=195754
646         <rdar://problem/48591957>
647
648         Reviewed by Jiewen Tan.
649
650         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
651         Update the const correctness of one function call to match new SDK declaration.
652
653         No tests because there are no changes in behavior.
654
655         * crypto/CommonCryptoUtilities.h:
656         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
657         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
658
659 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
660
661         Rename SVGProperty to SVGLegacyProperty and rename SVGAnimatedProperty to SVGLegacyAnimatedProperty
662         https://bugs.webkit.org/show_bug.cgi?id=195767
663
664         Reviewed by Tim Horton.
665
666         This is a step towards removing the SVG properties tear off objects.
667
668         * Sources.txt:
669         * WebCore.xcodeproj/project.pbxproj:
670         * svg/SVGAngle.h:
671         (WebCore::SVGAngle::create):
672         (WebCore::SVGAngle::SVGAngle):
673         * svg/SVGAnimateElement.h:
674         * svg/SVGAnimatedTypeAnimator.h:
675         (WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
676         * svg/SVGElement.h:
677         (WebCore::SVGElement::lookupAnimatedProperty const):
678         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
679         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
680         * svg/SVGLength.h:
681         (WebCore::SVGLength::create):
682         (WebCore::SVGLength::SVGLength):
683         * svg/SVGMatrix.h:
684         (WebCore::SVGMatrix::create):
685         (WebCore::SVGMatrix::SVGMatrix):
686         * svg/SVGNumber.h:
687         (WebCore::SVGNumber::create):
688         (WebCore::SVGNumber::SVGNumber):
689         * svg/SVGPathElement.cpp:
690         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
691         * svg/SVGPathElement.h:
692         * svg/SVGPathSegList.cpp:
693         (WebCore::SVGPathSegList::processIncomingListItemValue):
694         * svg/SVGPathSegWithContext.h:
695         (WebCore::SVGPathSegWithContext::animatedProperty const):
696         * svg/SVGPoint.h:
697         (WebCore::SVGPoint::create):
698         (WebCore::SVGPoint::SVGPoint):
699         * svg/SVGPreserveAspectRatio.h:
700         (WebCore::SVGPreserveAspectRatio::create):
701         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
702         * svg/SVGRect.h:
703         (WebCore::SVGRect::create):
704         (WebCore::SVGRect::SVGRect):
705         * svg/SVGTransform.h:
706         (WebCore::SVGTransform::create):
707         (WebCore::SVGTransform::SVGTransform):
708         * svg/properties/SVGAnimatedListPropertyTearOff.h:
709         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
710         (WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff):
711         * svg/properties/SVGAnimatedProperty.cpp: Removed.
712         * svg/properties/SVGAnimatedProperty.h: Removed.
713         * svg/properties/SVGAnimatedPropertyTearOff.h:
714         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
715         (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
716         * svg/properties/SVGAttributeAccessor.h:
717         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
718         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
719         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
720         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
721         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
722         * svg/properties/SVGAttributeOwnerProxy.h:
723         * svg/properties/SVGAttributeOwnerProxyImpl.h:
724         * svg/properties/SVGAttributeRegistry.h:
725         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
726         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
727         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
728         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
729         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
730         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
731         * svg/properties/SVGLegacyAnimatedProperty.cpp: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.cpp.
732         (WebCore::SVGLegacyAnimatedProperty::SVGLegacyAnimatedProperty):
733         (WebCore::SVGLegacyAnimatedProperty::~SVGLegacyAnimatedProperty):
734         (WebCore::SVGLegacyAnimatedProperty::commitChange):
735         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Deleted.
736         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Deleted.
737         (WebCore::SVGAnimatedProperty::commitChange): Deleted.
738         * svg/properties/SVGLegacyAnimatedProperty.h: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.h.
739         (WebCore::SVGLegacyAnimatedProperty::lookupOrCreateAnimatedProperty):
740         (WebCore::SVGLegacyAnimatedProperty::lookupAnimatedProperty):
741         (WebCore::SVGAnimatedProperty::isAnimating const): Deleted.
742         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): Deleted.
743         (WebCore::SVGAnimatedProperty::contextElement const): Deleted.
744         (WebCore::SVGAnimatedProperty::attributeName const): Deleted.
745         (WebCore::SVGAnimatedProperty::animatedPropertyType const): Deleted.
746         (WebCore::SVGAnimatedProperty::isReadOnly const): Deleted.
747         (WebCore::SVGAnimatedProperty::setIsReadOnly): Deleted.
748         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): Deleted.
749         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): Deleted.
750         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
751         * svg/properties/SVGLegacyProperty.h: Copied from Source/WebCore/svg/properties/SVGProperty.h.
752         * svg/properties/SVGListProperty.h:
753         * svg/properties/SVGProperty.h: Removed.
754         * svg/properties/SVGPropertyTearOff.h:
755         (WebCore::SVGPropertyTearOff::create):
756         (WebCore::SVGPropertyTearOff::animatedProperty const):
757         (WebCore::SVGPropertyTearOff::setAnimatedProperty):
758         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
759
760 2019-03-14  Ryan Haddad  <ryanhaddad@apple.com>
761
762         Unreviewed, rolling out r242963.
763
764         Breaks watchOS build.
765
766         Reverted changeset:
767
768         "Move CommonCrypto SPI declarations to an appropriate PAL/spi
769         header"
770         https://bugs.webkit.org/show_bug.cgi?id=195754
771         https://trac.webkit.org/changeset/242963
772
773 2019-03-14  Chris Dumez  <cdumez@apple.com>
774
775         Unreviewed, update xcfilelist files as they are out of sync.
776
777         * DerivedSources-input.xcfilelist:
778         * DerivedSources-output.xcfilelist:
779
780 2019-03-14  Justin Fan  <justin_fan@apple.com>
781
782         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
783         https://bugs.webkit.org/show_bug.cgi?id=195083
784         <rdar://problem/48423591>
785
786         Reviewed by Dean Jackson.
787
788         Fixing build error and re-introducing rolled-out changes.
789         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
790         is now WebGPUCommandEncoder.
791
792         Affected Web GPU tests updated to match new API.
793
794         New files and symbols:
795         * CMakeLists.txt:
796         * DerivedSources.make:
797         * Sources.txt:
798         * WebCore.xcodeproj/project.pbxproj:
799         * bindings/js/WebCoreBuiltinNames.h:
800
801         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
802         * Modules/webgpu/WebGPUCommandBuffer.cpp:
803         (WebCore::WebGPUCommandBuffer::create):
804         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
805         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
806         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
807         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
808         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
809         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
810         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
811         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
812         * Modules/webgpu/WebGPUCommandBuffer.h:
813         (WebCore::WebGPUCommandBuffer::commandBuffer):
814         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
815         * Modules/webgpu/WebGPUCommandBuffer.idl:
816
817         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
818         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
819         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
820         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
821         (WebCore::WebGPUCommandEncoder::create):
822         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
823         (WebCore::WebGPUCommandEncoder::beginRenderPass):
824         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
825         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
826         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
827         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
828         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
829         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
830         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
831         * Modules/webgpu/WebGPUDevice.cpp:
832         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
833         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
834         * Modules/webgpu/WebGPUDevice.h:
835         * Modules/webgpu/WebGPUDevice.idl:
836         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
837         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
838         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
839         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
840         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
841         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
842         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
843         * Modules/webgpu/WebGPUQueue.cpp:
844         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
845         * Modules/webgpu/WebGPUQueue.h:
846         * Modules/webgpu/WebGPUQueue.idl:
847         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
848         (WebCore::WebGPURenderPassEncoder::create):
849         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
850         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
851         (WebCore::WebGPURenderPassEncoder::draw):
852         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
853         * Modules/webgpu/WebGPURenderPassEncoder.h:
854         * Modules/webgpu/WebGPUSwapChain.cpp:
855         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
856         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
857         * platform/graphics/gpu/GPUDevice.cpp:
858         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
859         (WebCore::GPUDevice::createCommandBuffer): Deleted.
860         * platform/graphics/gpu/GPUDevice.h:
861         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
862         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
863         (WebCore::GPUCommandBuffer::create): Deleted.
864
865 2019-03-14  Justin Fan  <justin_fan@apple.com>
866
867         [Web GPU] Enum cleanup
868         https://bugs.webkit.org/show_bug.cgi?id=195766
869
870         Reviewed by Myles C. Maxfield.
871
872         Clean up enum implementations in Web GPU. Enums referenced by only one class now share implementation files with that class to reduce clutter.
873         
874         No change in behavior.
875
876         * DerivedSources.make:
877         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
878         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
879         * Modules/webgpu/GPUInputStateDescriptor.idl:
880         * Modules/webgpu/GPURequestAdapterOptions.idl:
881         * Modules/webgpu/GPUSamplerDescriptor.idl:
882         * Modules/webgpu/GPUTextureDescriptor.idl:
883         * Modules/webgpu/GPUTextureDimension.idl: Removed.
884         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
885         * Modules/webgpu/GPUVertexInputDescriptor.idl:
886         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
887         (WebCore::validateBufferBindingType):
888         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
889         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
890         * Sources.txt:
891         * WebCore.xcodeproj/project.pbxproj:
892         * platform/graphics/gpu/GPUInputStateDescriptor.h:
893         * platform/graphics/gpu/GPURequestAdapterOptions.h:
894         * platform/graphics/gpu/GPUSamplerDescriptor.h:
895         * platform/graphics/gpu/GPUTextureDescriptor.h:
896         * platform/graphics/gpu/GPUTextureDimension.h: Removed.
897         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
898         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
899         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
900         (WebCore::MTLDataTypeForBindingType):
901         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
902         (WebCore::GPUBindGroup::tryCreate):
903         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
904         (WebCore::GPUDevice::create):
905         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
906         (WebCore::mtlAddressModeForAddressMode):
907         (WebCore::mtlMinMagFilterForFilterMode):
908         (WebCore::mtlMipFilterForFilterMode):
909
910 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
911
912         Use enum class for AnimationMode
913         https://bugs.webkit.org/show_bug.cgi?id=195762
914
915         Reviewed by Tim Horton.
916
917         Convert AnimationMode into an enum class.
918
919         * svg/SVGAnimateElementBase.cpp:
920         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
921         (WebCore::SVGAnimateElementBase::isAdditive const):
922         * svg/SVGAnimateMotionElement.cpp:
923         (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
924         (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
925         (WebCore::SVGAnimateMotionElement::updateAnimationMode):
926         * svg/SVGAnimatedAngle.cpp:
927         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
928         * svg/SVGAnimatedBoolean.cpp:
929         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
930         * svg/SVGAnimatedColor.cpp:
931         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
932         * svg/SVGAnimatedEnumeration.cpp:
933         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
934         * svg/SVGAnimatedInteger.cpp:
935         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
936         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
937         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
938         * svg/SVGAnimatedLength.cpp:
939         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
940         * svg/SVGAnimatedLengthList.cpp:
941         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
942         * svg/SVGAnimatedNumber.cpp:
943         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
944         * svg/SVGAnimatedNumberList.cpp:
945         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
946         * svg/SVGAnimatedNumberOptionalNumber.cpp:
947         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
948         * svg/SVGAnimatedPath.cpp:
949         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
950         * svg/SVGAnimatedPointList.cpp:
951         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
952         * svg/SVGAnimatedPreserveAspectRatio.cpp:
953         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
954         * svg/SVGAnimatedRect.cpp:
955         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
956         * svg/SVGAnimatedTransformList.cpp:
957         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
958         * svg/SVGAnimationElement.cpp:
959         (WebCore::SVGAnimationElement::updateAnimationMode):
960         (WebCore::SVGAnimationElement::isAdditive const):
961         (WebCore::SVGAnimationElement::isAccumulated const):
962         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
963         (WebCore::SVGAnimationElement::startedActiveInterval):
964         (WebCore::SVGAnimationElement::updateAnimation):
965         * svg/SVGAnimationElement.h:
966         (WebCore::SVGAnimationElement::adjustFromToListValues):
967         (WebCore::SVGAnimationElement::animateDiscreteType):
968         (WebCore::SVGAnimationElement::animateAdditiveNumber):
969         * svg/SVGSetElement.cpp:
970         (WebCore::SVGSetElement::SVGSetElement):
971         (WebCore::SVGSetElement::updateAnimationMode):
972
973 2019-03-14  Ryosuke Niwa  <rniwa@webkit.org>
974
975         Storing a Node in Ref/RefPtr inside its destructor results in double delete
976         https://bugs.webkit.org/show_bug.cgi?id=195661
977
978         Reviewed by Brent Fulgham.
979
980         Set Node::m_refCount to 1 before calling its virtual destructor.
981
982         This is a security mitigation to prevent any code which ends up storing the node to Ref / RefPtr
983         inside the destructor, which is a programming error caught by debug assertions, from triggering
984         a double-delete on the same Node.
985
986         Such a code would hit the debug assertions in Node::deref() because m_inRemovedLastRefFunction
987         had been set to true by then.
988
989         * dom/Document.cpp:
990         (WebCore::Document::removedLastRef):
991         * dom/Document.h:
992         (WebCore::Document::decrementReferencingNodeCount):
993         * dom/Node.cpp:
994         (WebCore::Node::~Node):
995         (WebCore::Node::removedLastRef):
996
997 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
998
999         Move CommonCrypto SPI declarations to an appropriate PAL/spi header
1000         https://bugs.webkit.org/show_bug.cgi?id=195754
1001         <rdar://problem/48591957>
1002
1003         Reviewed by Jiewen Tan.
1004
1005         Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
1006         Update the const correctness of one function call to match new SDK declaration.
1007
1008         No tests because there are no changes in behavior.
1009
1010         * crypto/CommonCryptoUtilities.h:
1011         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
1012         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
1013
1014 2019-03-14  Chris Dumez  <cdumez@apple.com>
1015
1016         Add WebsitePolicy for the client to specify the device orientation & motion access policy
1017         https://bugs.webkit.org/show_bug.cgi?id=195750
1018
1019         Reviewed by Geoffrey Garen.
1020
1021         Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
1022         the client already knows access to the device motion & orientation API will be granted / denied,
1023         it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
1024         permission is requested by JS.
1025
1026         * dom/DeviceOrientationAndMotionAccessController.cpp:
1027         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
1028         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
1029         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
1030         * dom/DeviceOrientationAndMotionAccessController.h:
1031         * loader/DocumentLoader.h:
1032         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
1033         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
1034         * page/DOMWindow.cpp:
1035         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
1036
1037 2019-03-14  Shawn Roberts  <sroberts@apple.com>
1038
1039         Unreviewed, rolling out r242931.
1040
1041         Causing internal watch/tv OS build failures
1042
1043         Reverted changeset:
1044
1045         "[Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue
1046         concept"
1047         https://bugs.webkit.org/show_bug.cgi?id=195083
1048         https://trac.webkit.org/changeset/242931
1049
1050 2019-03-14  Chris Dumez  <cdumez@apple.com>
1051
1052         Device orientation's permission should only require a user gesture to prompt the user
1053         https://bugs.webkit.org/show_bug.cgi?id=195731
1054
1055         Reviewed by Geoffrey Garen.
1056
1057         Device orientation's permission should only require a user gesture to prompt the user. If the
1058         user already made a decision, we should resolve the promise with this decision, even without
1059         user gesture.
1060
1061         This is useful for JS to figure out if they are access to device orientation or not because
1062         showing UI for the user to give permission.
1063
1064         No new tests, updated existing tests.
1065
1066         * dom/DeviceOrientationAndMotionAccessController.cpp:
1067         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
1068         * dom/DeviceOrientationAndMotionAccessController.h:
1069         * dom/DeviceOrientationOrMotionEvent.cpp:
1070         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
1071
1072 2019-03-14  Youenn Fablet  <youenn@apple.com>
1073
1074         Reset storage quota when clearing IDB/Cache API entries
1075         https://bugs.webkit.org/show_bug.cgi?id=195716
1076
1077         Reviewed by Chris Dumez.
1078
1079         On clearing of databases, reset all quota users.
1080         This will ensure all layout test runs start with a clean state.
1081
1082         * Modules/indexeddb/server/IDBServer.cpp:
1083         (WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases):
1084         * storage/StorageQuotaManager.h:
1085         (WebCore::StorageQuotaManager::resetQuota):
1086
1087 2019-03-14  Jer Noble  <jer.noble@apple.com>
1088
1089         Certain videos are causing a crash when used as WebGL texture
1090         https://bugs.webkit.org/show_bug.cgi?id=195700
1091         <rdar://problem/48869347>
1092
1093         Reviewed by Eric Carlson.
1094
1095         CFEqual is not null-safe, so perform a null and type check before comparing.
1096
1097         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1098         (WebCore::transferFunctionFromString):
1099
1100 2019-03-14  Zalan Bujtas  <zalan@apple.com>
1101
1102         Cleanup inline boxes when list marker gets blockified
1103         https://bugs.webkit.org/show_bug.cgi?id=195746
1104         <rdar://problem/48049175>
1105
1106         Reviewed by Antti Koivisto.
1107
1108         Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
1109         During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
1110         change does not require a new renderer.
1111         This patch takes care of destroying the inline boxtree when the marker gains block display type. 
1112
1113         Test: fast/block/float/list-marker-is-float-crash.html
1114
1115         * rendering/RenderListMarker.cpp:
1116         (WebCore::RenderListMarker::styleDidChange):
1117
1118 2019-03-14  Devin Rousso  <drousso@apple.com>
1119
1120         Web Inspector: Audit: provide a way to get the contents of resources
1121         https://bugs.webkit.org/show_bug.cgi?id=195266
1122         <rdar://problem/48550911>
1123
1124         Reviewed by Joseph Pecoraro.
1125
1126         Test: inspector/audit/run-resources.html
1127
1128         * inspector/InspectorAuditResourcesObject.idl: Added.
1129         * inspector/InspectorAuditResourcesObject.h: Added.
1130         (WebCore::InspectorAuditResourcesObject::create):
1131         (WebCore::InspectorAuditResourcesObject::Resource):
1132         (WebCore::InspectorAuditResourcesObject::ResourceContent):
1133         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient):
1134         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient):
1135         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient):
1136         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient):
1137         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient):
1138         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient):
1139         * inspector/InspectorAuditResourcesObject.cpp: Added.
1140         (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject):
1141         (WebCore::InspectorAuditResourcesObject::getResources):
1142         (WebCore::InspectorAuditResourcesObject::getResourceContent):
1143         (WebCore::InspectorAuditResourcesObject::clientForResource):
1144
1145         * inspector/agents/InspectorPageAgent.h:
1146         * inspector/agents/InspectorPageAgent.cpp:
1147         (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added.
1148         (WebCore::allResourcesURLsForFrame):
1149         Moved a file static function to be a class static function so it can be used elsewhere.
1150
1151         * CMakeLists.txt:
1152         * DerivedSources-input.xcfilelist:
1153         * DerivedSources-output.xcfilelist:
1154         * DerivedSources.make:
1155         * Sources.txt:
1156         * WebCore.xcodeproj/project.pbxproj:
1157
1158 2019-03-14  Devin Rousso  <drousso@apple.com>
1159
1160         Web Inspector: Console: getEventListeners should work for any EventTarget
1161         https://bugs.webkit.org/show_bug.cgi?id=195713
1162
1163         Reviewed by Joseph Pecoraro.
1164
1165         Test: inspector/console/command-line-api-getEventListeners.html
1166
1167         * dom/EventTarget.h:
1168         * dom/EventTarget.cpp:
1169         (WebCore::EventTarget::eventTypes): Added.
1170
1171         * inspector/CommandLineAPIHost.idl:
1172         * inspector/CommandLineAPIHost.h:
1173         (WebCore::CommandLineAPIHost::init):
1174         * inspector/CommandLineAPIHost.cpp:
1175         (WebCore::CommandLineAPIHost::disconnect):
1176         (WebCore::CommandLineAPIHost::getEventListeners):
1177         (WebCore::listenerEntriesFromListenerInfo): Deleted.
1178
1179         * inspector/CommandLineAPIModuleSource.js:
1180         (CommandLineAPIImpl.prototype.getEventListeners):
1181
1182         * inspector/InspectorController.cpp:
1183         (WebCore::InspectorController::InspectorController):
1184         * inspector/WorkerInspectorController.cpp:
1185         (WebCore::WorkerInspectorController::WorkerInspectorController):
1186
1187 2019-03-14  Devin Rousso  <drousso@apple.com>
1188
1189         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
1190         https://bugs.webkit.org/show_bug.cgi?id=195123
1191         <rdar://problem/48450148>
1192
1193         Reviewed by Joseph Pecoraro.
1194
1195         Test: inspector/css/getMatchedStylesForNode.html
1196
1197         * inspector/agents/InspectorCSSAgent.cpp:
1198         (WebCore::protocolValueForPseudoId): Added.
1199         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
1200
1201 2019-03-13  Benjamin Poulain  <benjamin@webkit.org>
1202
1203         Fix the argument type of RenderView::resumePausedImageAnimationsIfNeeded()
1204         https://bugs.webkit.org/show_bug.cgi?id=195659
1205
1206         Reviewed by Saam Barati.
1207
1208         The two callers of resumePausedImageAnimationsIfNeeded() both get the IntRect
1209         as a reference. The rect was going on the stack then used as a reference again.
1210
1211         * rendering/RenderView.cpp:
1212         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
1213         * rendering/RenderView.h:
1214
1215 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1216
1217         [ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
1218         https://bugs.webkit.org/show_bug.cgi?id=195724
1219         <rdar://problem/48873456>
1220
1221         Reviewed by Simon Fraser.
1222
1223         Call willNotProceedWithClick on preventDefault. This is very similar to the long press case.
1224
1225         * page/ios/ContentChangeObserver.cpp:
1226         (WebCore::willNotProceedWithClick):
1227         (WebCore::ContentChangeObserver::didRecognizeLongPress):
1228         (WebCore::ContentChangeObserver::didPreventDefaultForEvent):
1229         * page/ios/ContentChangeObserver.h:
1230
1231 2019-03-13  Justin Fan  <justin_fan@apple.com>
1232
1233         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue concept
1234         https://bugs.webkit.org/show_bug.cgi?id=195083
1235         <rdar://problem/48423591>
1236
1237         Reviewed by Dean Jackson.
1238
1239         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
1240         is now WebGPUCommandEncoder.
1241
1242         Affected Web GPU tests updated to match new API.
1243
1244         New files and symbols:
1245         * CMakeLists.txt:
1246         * DerivedSources.make:
1247         * Sources.txt:
1248         * WebCore.xcodeproj/project.pbxproj:
1249         * bindings/js/WebCoreBuiltinNames.h:
1250
1251         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
1252         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1253         (WebCore::WebGPUCommandBuffer::create):
1254         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
1255         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
1256         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
1257         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
1258         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
1259         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
1260         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
1261         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
1262         * Modules/webgpu/WebGPUCommandBuffer.h:
1263         (WebCore::WebGPUCommandBuffer::commandBuffer):
1264         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
1265         * Modules/webgpu/WebGPUCommandBuffer.idl:
1266
1267         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
1268         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
1269         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
1270         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
1271         (WebCore::WebGPUCommandEncoder::create):
1272         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
1273         (WebCore::WebGPUCommandEncoder::beginRenderPass):
1274         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
1275         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
1276         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
1277         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
1278         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
1279         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
1280         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
1281         * Modules/webgpu/WebGPUDevice.cpp:
1282         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
1283         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
1284         * Modules/webgpu/WebGPUDevice.h:
1285         * Modules/webgpu/WebGPUDevice.idl:
1286         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1287         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
1288         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
1289         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
1290         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
1291         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1292         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1293         * Modules/webgpu/WebGPUQueue.cpp:
1294         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
1295         * Modules/webgpu/WebGPUQueue.h:
1296         * Modules/webgpu/WebGPUQueue.idl:
1297         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1298         (WebCore::WebGPURenderPassEncoder::create):
1299         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
1300         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1301         (WebCore::WebGPURenderPassEncoder::draw):
1302         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
1303         * Modules/webgpu/WebGPURenderPassEncoder.h:
1304         * Modules/webgpu/WebGPUSwapChain.cpp:
1305         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
1306         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
1307         * platform/graphics/gpu/GPUDevice.cpp:
1308         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
1309         (WebCore::GPUDevice::createCommandBuffer): Deleted.
1310         * platform/graphics/gpu/GPUDevice.h:
1311         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1312         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
1313         (WebCore::GPUCommandBuffer::create): Deleted.
1314
1315 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1316
1317         [WeakPtr] RenderListMarker::m_listItem should be a WeakPtr
1318         https://bugs.webkit.org/show_bug.cgi?id=195704
1319         <rdar://problem/48486278>
1320
1321         Reviewed by Simon Fraser.
1322
1323         * rendering/RenderListMarker.cpp:
1324         (WebCore::RenderListMarker::RenderListMarker):
1325         (WebCore::RenderListMarker::paint):
1326         (WebCore::RenderListMarker::layout):
1327         (WebCore::RenderListMarker::updateContent):
1328         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1329         (WebCore::RenderListMarker::lineHeight const):
1330         (WebCore::RenderListMarker::baselinePosition const):
1331         (WebCore::RenderListMarker::suffix const):
1332         (WebCore::RenderListMarker::isInside const):
1333         (WebCore::RenderListMarker::getRelativeMarkerRect):
1334         * rendering/RenderListMarker.h:
1335
1336 2019-03-13  Dean Jackson  <dino@apple.com>
1337
1338         Block all plugins smaller than 5x5px
1339         https://bugs.webkit.org/show_bug.cgi?id=195702
1340         <rdar://problem/28435204>
1341
1342         Reviewed by Sam Weinig.
1343
1344         Block all plugins that are smaller than a threshold, in this case
1345         5px x 5px. Other browsers have implemented this for a while, and now
1346         that we have Intersection Observers, small plugins are no longer
1347         necessary.
1348
1349         Test: plugins/small-plugin-blocked.html
1350
1351         * en.lproj/Localizable.strings: New message for a small plugin.
1352         * platform/LocalizedStrings.cpp:
1353         (WebCore::pluginTooSmallText):
1354         * platform/LocalizedStrings.h:
1355
1356         * html/HTMLPlugInElement.cpp: Helper function for Internals testing.
1357         (WebCore::HTMLPlugInElement::isBelowSizeThreshold const):
1358         * html/HTMLPlugInElement.h:
1359
1360         * loader/EmptyClients.cpp: Removed an unused function.
1361         (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted.
1362         * loader/EmptyFrameLoaderClient.h:
1363         * loader/FrameLoaderClient.h:
1364
1365         * page/Settings.yaml: Add flag for new feature.
1366
1367         * rendering/RenderEmbeddedObject.cpp: New unavailability reason for
1368         embedded objects.
1369         (WebCore::unavailablePluginReplacementText):
1370         * rendering/RenderEmbeddedObject.h:
1371         (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const):
1372
1373         * testing/Internals.cpp: Helper function for testing.
1374         (WebCore::Internals::pluginIsBelowSizeThreshold):
1375         * testing/Internals.h:
1376         * testing/Internals.idl:
1377
1378 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1379
1380         Use RenderBox::previousSiblingBox/nextSiblingBox in RenderMultiColumnFlow
1381         https://bugs.webkit.org/show_bug.cgi?id=195701
1382         <rdar://problem/48448658>
1383
1384         Reviewed by Simon Fraser.
1385
1386         It's safer to use existing RenderBox functions to get sibling boxes.
1387
1388         Test: fast/ruby/crash-when-paginated-ruby.html
1389
1390         * rendering/RenderMultiColumnFlow.cpp:
1391         (WebCore::RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf):
1392         (WebCore::RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf):
1393
1394 2019-03-13  Keith Rollin  <krollin@apple.com>
1395
1396         Add support for new StagedFrameworks layout
1397         https://bugs.webkit.org/show_bug.cgi?id=195543
1398
1399         Reviewed by Alexey Proskuryakov.
1400
1401         When creating the WebKit layout for out-of-band Safari/WebKit updates,
1402         use an optional path prefix when called for.
1403
1404         No new tests since there should be no observable behavior difference.
1405
1406         * Configurations/WebCore.xcconfig:
1407
1408 2019-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1409
1410         Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element
1411         https://bugs.webkit.org/show_bug.cgi?id=195663
1412         <rdar://problem/48576391>
1413
1414         Reviewed by Ryosuke Niwa.
1415
1416         Currently, it's possible for HTMLFormControlElement's destructor to be reentrant. This may happen if the form
1417         control element is ref'd while carrying out its destructor's logic. This may happen in two places in
1418         HTMLFormControlElement (didChangeForm and resetDefaultButton), both of which actually don't require ensuring a
1419         protected reference to the form control element since they should never result in any script execution.
1420
1421         To fix the bug, convert these strong references into raw pointers, and add ScriptDisallowedScope to ensure that
1422         we don't change these codepaths in the future, such that they trigger arbitrary script execution.
1423
1424         Test: fast/forms/remove-associated-element-after-gc.html
1425
1426         * html/HTMLFormControlElement.cpp:
1427         (WebCore::HTMLFormControlElement::didChangeForm):
1428         * html/HTMLFormElement.cpp:
1429         (WebCore::HTMLFormElement::resetDefaultButton):
1430
1431 2019-03-13  Daniel Bates  <dabates@apple.com>
1432
1433         Remove some unnecessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards
1434         https://bugs.webkit.org/show_bug.cgi?id=195703
1435
1436         Reviewed by Tim Horton.
1437
1438         Remove out-of-date comment and unncessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards. Following
1439         r240604 we now make use of WebCore::windowsKeyCodeForCharCode() even for hardware key events
1440         when USE(UIKIT_KEYBOARD_ADDITIONS) is enabled.
1441
1442         No functionality changed. So, no new tests.
1443
1444         * platform/ios/KeyEventIOS.mm:
1445         (WebCore::windowsKeyCodeForCharCode):
1446         * platform/ios/WebEvent.mm:
1447         (normalizedStringWithAppKitCompatibilityMapping):
1448
1449 2019-03-13  Simon Fraser  <simon.fraser@apple.com>
1450
1451         Scrolling tree should reposition non-stacking order descendents of overflow:scroll
1452         https://bugs.webkit.org/show_bug.cgi?id=195608
1453
1454         Reviewed by Zalan Bujtas.
1455         
1456         Step 1: add scrolling tree positioning nodes classes (but don't create them yet).
1457
1458         Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
1459         an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
1460         the values of ScrollPositioningBehavior:
1461
1462         ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
1463             async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
1464             When the overflow scrolls, this layer has to move along with the overflow.
1465
1466         ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
1467             overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
1468             This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.
1469
1470         PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
1471         
1472         This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
1473         is just a stub so the new node types aren't created yet.
1474         
1475         RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
1476         role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
1477         the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.
1478
1479         Test: scrollingcoordinator/scrolling-tree/positioned-nodes.html
1480
1481         * Sources.txt:
1482         * SourcesCocoa.txt:
1483         * WebCore.xcodeproj/project.pbxproj:
1484         * page/scrolling/AsyncScrollingCoordinator.cpp:
1485         (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry):
1486         (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
1487         * page/scrolling/AsyncScrollingCoordinator.h:
1488         * page/scrolling/ScrollingConstraints.cpp:
1489         (WebCore::operator<<):
1490         * page/scrolling/ScrollingConstraints.h:
1491         (WebCore::LayoutConstraints::LayoutConstraints):
1492         (WebCore::LayoutConstraints::operator== const):
1493         (WebCore::LayoutConstraints::operator!= const):
1494         (WebCore::LayoutConstraints::alignmentOffset const):
1495         (WebCore::LayoutConstraints::setAlignmentOffset):
1496         (WebCore::LayoutConstraints::layerPositionAtLastLayout const):
1497         (WebCore::LayoutConstraints::setLayerPositionAtLastLayout):
1498         (WebCore::LayoutConstraints::scrollPositioningBehavior const):
1499         (WebCore::LayoutConstraints::setScrollPositioningBehavior):
1500         * page/scrolling/ScrollingCoordinator.cpp:
1501         (WebCore::operator<<):
1502         * page/scrolling/ScrollingCoordinator.h:
1503         (WebCore::ScrollingCoordinator::setPositionedNodeGeometry):
1504         (WebCore::ScrollingCoordinator::setRelatedOverflowScrollingNodes):
1505         * page/scrolling/ScrollingCoordinatorTypes.h:
1506         * page/scrolling/ScrollingStateNode.h:
1507         (WebCore::ScrollingStateNode::isPositionedNode const):
1508         * page/scrolling/ScrollingStatePositionedNode.cpp: Added.
1509         (WebCore::ScrollingStatePositionedNode::create):
1510         (WebCore::ScrollingStatePositionedNode::ScrollingStatePositionedNode):
1511         (WebCore::ScrollingStatePositionedNode::clone):
1512         (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged):
1513         (WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes):
1514         (WebCore::ScrollingStatePositionedNode::updateConstraints):
1515         (WebCore::ScrollingStatePositionedNode::dumpProperties const):
1516         * page/scrolling/ScrollingStatePositionedNode.h: Added.
1517         * page/scrolling/ScrollingStateTree.cpp:
1518         (WebCore::ScrollingStateTree::createNode):
1519         * page/scrolling/ScrollingTree.cpp:
1520         (WebCore::ScrollingTree::updateTreeFromStateNode):
1521         * page/scrolling/ScrollingTree.h:
1522         * page/scrolling/ScrollingTreeNode.h:
1523         (WebCore::ScrollingTreeNode::isPositionedNode const):
1524         * page/scrolling/cocoa/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h.
1525         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: Added.
1526         (WebCore::ScrollingTreePositionedNode::create):
1527         (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
1528         (WebCore::ScrollingTreePositionedNode::~ScrollingTreePositionedNode):
1529         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
1530         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1531         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
1532         (WebCore::ScrollingTreePositionedNode::dumpProperties const):
1533         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1534         * page/scrolling/mac/ScrollingTreeMac.cpp:
1535         (ScrollingTreeMac::createScrollingTreeNode):
1536         * platform/ScrollTypes.h:
1537         * rendering/RenderLayerBacking.cpp:
1538         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
1539         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1540         * rendering/RenderLayerBacking.h:
1541         * rendering/RenderLayerCompositor.cpp:
1542         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1543         (WebCore::scrollCoordinationRoleForNodeType):
1544         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
1545         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
1546         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1547         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
1548         * rendering/RenderLayerCompositor.h:
1549
1550 2019-03-13  Youenn Fablet  <youenn@apple.com>
1551
1552         Check IDB quota usage through QuotaManager
1553         https://bugs.webkit.org/show_bug.cgi?id=195302
1554
1555         Reviewed by Chris Dumez.
1556
1557         For every write operation, compute an estimate size and check for quota before proceeding.
1558         When proceeding, store the estimate size in a map.
1559         If size of the database is to be computed when the task is not done,
1560         the estimate size will be added to the current size of the databases.
1561         At the end of the task, the estimate size is removed from the map,
1562         and the databases size is refreshed.
1563
1564         This patch implements size estimation for write tasks.
1565         Put/add operations might overestimate the size
1566         when an old value will be replaced by a new value.
1567         In that case, we do not substract the old value size since we do not know it.
1568
1569         This patch implements database opening by adding a fixed small cost,
1570         as we do not know whether the database is new or not.
1571
1572         For the first IDB request, we have not computed the size of the database.
1573         To do so, we need to go to a background thread and do that file size computation.
1574         For that purpose, we add support for being-initialized quota user.
1575         Quota manager is calling whenInitialized on its quota user and will
1576         delay any quota check requests until its quota user is answering this callback.
1577
1578         For in process IDB, use the default storage quota per origin and do not increase it.
1579         Future work should move it to NetworkProcess and implement some quota checking.
1580
1581         Cache API and IDB quota management are not yet fully unified.
1582         If IDB is used on start-up, we should check for Cache API storage size.
1583         Conversely, on Cache API first wite task, even if IDB is not being used,
1584         we should compute the size of the IDB data for the given origin.
1585
1586         Test: http/tests/IndexedDB/storage-limit.https.html
1587
1588         * Modules/indexeddb/server/IDBBackingStore.h:
1589         * Modules/indexeddb/server/IDBServer.cpp:
1590         (WebCore::IDBServer::IDBServer::create):
1591         (WebCore::IDBServer::IDBServer::IDBServer):
1592         (WebCore::IDBServer::m_quotaManagerGetter):
1593         (WebCore::IDBServer::IDBServer::QuotaUser::QuotaUser):
1594         (WebCore::IDBServer::IDBServer::QuotaUser::~QuotaUser):
1595         (WebCore::IDBServer::IDBServer::QuotaUser::clearSpaceUsed):
1596         (WebCore::IDBServer::IDBServer::QuotaUser::whenInitialized):
1597         (WebCore::IDBServer::IDBServer::QuotaUser::initializeSpaceUsed):
1598         (WebCore::IDBServer::IDBServer::quotaUser):
1599         (WebCore::IDBServer::IDBServer::startComputingSpaceUsedForOrigin):
1600         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
1601         (WebCore::IDBServer::IDBServer::finishComputingSpaceUsedForOrigin):
1602         (WebCore::IDBServer::IDBServer::requestSpace):
1603         (WebCore::IDBServer::IDBServer::clearSpaceUsed):
1604         (WebCore::IDBServer::IDBServer::setSpaceUsed):
1605         (WebCore::IDBServer::IDBServer::increasePotentialSpaceUsed):
1606         (WebCore::IDBServer::IDBServer::decreasePotentialSpaceUsed):
1607         * Modules/indexeddb/server/IDBServer.h:
1608         (WebCore::IDBServer::IDBServer::create):
1609         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1610         (WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const):
1611         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1612         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1613         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder):
1614         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
1615         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
1616         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1617         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1618         (WebCore::IDBServer::estimateSize):
1619         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1620         (WebCore::IDBServer::quotaErrorMessageName):
1621         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
1622         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1623         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
1624         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
1625         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
1626         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
1627         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
1628         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
1629         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
1630         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
1631         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
1632         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
1633         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
1634         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
1635         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1636         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
1637         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
1638         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
1639         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1640         (WebCore::IDBServer::UniqueIDBDatabase::server):
1641         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1642         (WebCore::InProcessIDBServer::create):
1643         (WebCore::InProcessIDBServer::quotaManager):
1644         (WebCore::storageQuotaManagerGetter):
1645         (WebCore::InProcessIDBServer::InProcessIDBServer):
1646         * Modules/indexeddb/shared/InProcessIDBServer.h:
1647         * loader/EmptyClients.cpp:
1648         * storage/StorageQuotaManager.cpp:
1649         (WebCore::StorageQuotaManager::addUser):
1650         (WebCore::StorageQuotaManager::requestSpace):
1651         * storage/StorageQuotaManager.h:
1652         (WebCore::StorageQuotaManager::defaultQuota):
1653         (WebCore::StorageQuotaManager::removeUser):
1654         * storage/StorageQuotaUser.h:
1655         (WebCore::StorageQuotaUser::whenInitialized):
1656
1657 2019-03-13  Chris Dumez  <cdumez@apple.com>
1658
1659         Better build fix after r242901.
1660
1661         Reviewed by Jer Noble.
1662
1663         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1664         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
1665         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1666
1667 2019-03-13  Timothy Hatcher  <timothy@apple.com>
1668
1669         Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
1670         https://bugs.webkit.org/show_bug.cgi?id=195636
1671         rdar://problem/45055697
1672
1673         Reviewed by Ryosuke Niwa.
1674
1675         * editing/DictionaryPopupInfo.h:
1676         (WebCore::DictionaryPopupInfo::encodingRequiresPlatformData const): Added.
1677         * editing/FontAttributes.h:
1678         (WebCore::FontAttributes::encodingRequiresPlatformData const): Added.
1679
1680 2019-03-13  Chris Dumez  <cdumez@apple.com>
1681
1682         Unreviewed build fix after r242901.
1683
1684         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1685         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1686
1687 2019-03-13  Chris Dumez  <cdumez@apple.com>
1688
1689         Use a ServiceWorker process per registrable domain
1690         https://bugs.webkit.org/show_bug.cgi?id=195649
1691
1692         Reviewed by Youenn Fablet.
1693
1694         Use a ServiceWorker process per registrable domain instead of one per security origin. This is
1695         more in line with PSON and avoids launching too many processes.
1696
1697         * page/ClientOrigin.h:
1698         (WebCore::ClientOrigin::clientRegistrableDomain const):
1699         * workers/service/server/SWServer.cpp:
1700         (WebCore::SWServer::tryInstallContextData):
1701         (WebCore::SWServer::serverToContextConnectionCreated):
1702         (WebCore::SWServer::runServiceWorkerIfNecessary):
1703         (WebCore::SWServer::markAllWorkersForRegistrableDomainAsTerminated):
1704         (WebCore::SWServer::registerServiceWorkerClient):
1705         (WebCore::SWServer::unregisterServiceWorkerClient):
1706         (WebCore::SWServer::needsServerToContextConnectionForRegistrableDomain const):
1707         * workers/service/server/SWServer.h:
1708         * workers/service/server/SWServerToContextConnection.cpp:
1709         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1710         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1711         (WebCore::SWServerToContextConnection::connectionForRegistrableDomain):
1712         * workers/service/server/SWServerToContextConnection.h:
1713         (WebCore::SWServerToContextConnection::registrableDomain const):
1714         * workers/service/server/SWServerWorker.cpp:
1715         (WebCore::SWServerWorker::contextConnection):
1716         * workers/service/server/SWServerWorker.h:
1717         (WebCore::SWServerWorker::registrableDomain const):
1718
1719 2019-03-13  Chris Dumez  <cdumez@apple.com>
1720
1721         REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
1722         https://bugs.webkit.org/show_bug.cgi?id=195684
1723         <rdar://problem/48294714>
1724
1725         Reviewed by Antti Koivisto.
1726
1727         The issue was caused by us failing to suspend the current page on navigation because the source and
1728         target WebBackForwardListItem are identical. The source WebBackForwardListItem was wrong.
1729
1730         When a navigation is triggered by the WebContent process (and not the UIProcess), we create the Navigation
1731         object in WebPageProxy::decidePolicyForNavigationAction(). For the navigation's targetItem, we use the
1732         target item identifier provided by the WebContent process via the NavigationActionData. However,
1733         for the source item, we would use the WebBackForwardList's currentItem in the UIProcess. The issue
1734         is that the WebBackForwardList's currentItem usually has already been updated to be the target
1735         item via a WebPageProxy::BackForwardGoToItem() synchronous IPC.
1736
1737         To avoid raciness and given that the current history management is fragile (as it is managed by
1738         both the UIProcess and the WebProcess), I am now passing the source item identifier in
1739         addition to the target item identifier in the NavigationActionData that is sent by the WebProcess.
1740         This is a lot less error prone, the WebProcess knows more accurately which history items it is going
1741         from and to.
1742
1743         * loader/FrameLoader.cpp:
1744         (WebCore::FrameLoader::loadURLIntoChildFrame):
1745         (WebCore::FrameLoader::loadDifferentDocumentItem):
1746         (WebCore::FrameLoader::loadItem):
1747         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
1748         * loader/FrameLoader.h:
1749         * loader/HistoryController.cpp:
1750         (WebCore::HistoryController::recursiveGoToItem):
1751         * loader/NavigationAction.cpp:
1752         (WebCore::NavigationAction::setSourceBackForwardItem):
1753         * loader/NavigationAction.h:
1754         (WebCore::NavigationAction::sourceBackForwardItemIdentifier const):
1755
1756 2019-03-13  Jer Noble  <jer.noble@apple.com>
1757
1758         Add AggregateLogger, a Logger specialization for singleton classes.
1759         https://bugs.webkit.org/show_bug.cgi?id=195644
1760
1761         Reviewed by Eric Carlson.
1762
1763         Convert debug logging over to release logging through the use of AggregateLogger.
1764
1765         * platform/audio/PlatformMediaSession.h:
1766         (WebCore::PlatformMediaSession::client const):
1767         * platform/audio/PlatformMediaSessionManager.cpp:
1768         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
1769         (WebCore::PlatformMediaSessionManager::beginInterruption):
1770         (WebCore::PlatformMediaSessionManager::endInterruption):
1771         (WebCore::PlatformMediaSessionManager::addSession):
1772         (WebCore::PlatformMediaSessionManager::removeSession):
1773         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1774         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
1775         (WebCore::PlatformMediaSessionManager::setCurrentSession):
1776         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
1777         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
1778         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
1779         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
1780         (WebCore::PlatformMediaSessionManager::logChannel const):
1781         * platform/audio/PlatformMediaSessionManager.h:
1782         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1783         (MediaSessionManagerCocoa::updateSessionState):
1784         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
1785         (MediaSessionManagerCocoa::removeSession):
1786         (MediaSessionManagerCocoa::sessionWillEndPlayback):
1787         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
1788         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1789         * platform/audio/ios/MediaSessionManagerIOS.mm:
1790         (WebCore::MediaSessionManageriOS::resetRestrictions):
1791         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1792
1793 2019-03-13  Chris Dumez  <cdumez@apple.com>
1794
1795         Drop legacy WebCore::toRegistrableDomain() utility function
1796         https://bugs.webkit.org/show_bug.cgi?id=195637
1797
1798         Reviewed by Geoffrey Garen.
1799
1800         Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
1801         Update call sites to use modern RegistrableDomain type instead.
1802
1803         * loader/CrossOriginAccessControl.cpp:
1804         (WebCore::shouldCrossOriginResourcePolicyCancelLoad):
1805         * loader/FrameLoader.cpp:
1806         (WebCore::FrameLoader::setFirstPartyForCookies):
1807         * page/DOMWindow.cpp:
1808         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
1809         * platform/RegistrableDomain.h:
1810         (WebCore::registrableDomainsAreEqual):
1811         * platform/network/ResourceRequestBase.h:
1812         * platform/network/cf/ResourceRequestCFNet.cpp:
1813         * platform/network/cocoa/ResourceRequestCocoa.mm:
1814
1815 2019-03-13  Alex Christensen  <achristensen@webkit.org>
1816
1817         Prevent checked_cf_cast crashes in ResourceResponse::platformCertificateInfo
1818         https://bugs.webkit.org/show_bug.cgi?id=195686
1819
1820         Reviewed by Tim Horton.
1821
1822         This covers up a type confusion bug on some OSes until rdar://problem/48853137 is resolved.
1823
1824         * SourcesCocoa.txt:
1825         * WebCore.xcodeproj/project.pbxproj:
1826         * platform/network/cocoa/ResourceResponseCocoa.mm:
1827
1828 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
1829
1830         [GStreamer][WebRTC] Add support for omxh264enc encoder
1831         https://bugs.webkit.org/show_bug.cgi?id=195676
1832
1833         Reviewed by Philippe Normand.
1834
1835         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
1836         (setup_omxh264enc):
1837         (set_bitrate_bit_per_sec):
1838         (gst_webrtc_video_encoder_class_init):
1839
1840 2019-03-13  Antoine Quint  <graouts@apple.com>
1841
1842         REGRESSION(r240634): Element::hasPointerCapture() passes a JS-controlled value directly into a HashMap as a key
1843         https://bugs.webkit.org/show_bug.cgi?id=195683
1844         <rdar://problem/48659950>
1845
1846         Reviewed by Alex Christensen.
1847
1848         While PointerID is defined as int32_t, we now use int64_t as the key of the HashMap mapping PointerID to CapturingData so that we use
1849         a value outside of the int32_t range as a safe empty and removed values, allowing any int32_t to be provided through the API for
1850         lookup in this HashMap.
1851
1852         Test: pointerevents/pointer-id-crash.html
1853
1854         * page/PointerCaptureController.h:
1855
1856 2019-03-12  Brady Eidson  <beidson@apple.com>
1857
1858         Take UnboundedNetworking assertion when a file upload is in progress.
1859         https://bugs.webkit.org/show_bug.cgi?id=195497
1860
1861         Reviewed by Geoff Garen.
1862
1863         * platform/network/ResourceRequestBase.cpp:
1864         (WebCore::ResourceRequestBase::hasUpload const):
1865         * platform/network/ResourceRequestBase.h:
1866
1867 2019-03-13  Youenn Fablet  <youenn@apple.com>
1868
1869         Enable libwebrtc logging control through WebCore
1870         https://bugs.webkit.org/show_bug.cgi?id=195658
1871
1872         Reviewed by Eric Carlson.
1873
1874         Add support for WebCore logging of libwebrtc messages.
1875         This is controlled by WebRTC log channel state and level.
1876         In case of private browsing mode, any logging is disabled.
1877         This will stay for the lifetime of the process.
1878         No change of behavior.
1879
1880         * Modules/mediastream/RTCPeerConnection.cpp:
1881         (WebCore::RTCPeerConnection::create):
1882         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1883         (WebCore::doReleaseLogging):
1884         (WebCore::setLogging):
1885         (WebCore::computeLogLevel):
1886         (WebCore::initializePeerConnectionFactoryAndThreads):
1887         (WebCore::LibWebRTCProvider::setEnableLogging):
1888         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1889
1890 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
1891
1892         [GStreamer][WebRTC] Do not sync encoder on the clock
1893         https://bugs.webkit.org/show_bug.cgi?id=195673
1894
1895         we should encode as fast as possible and totally ignore timestamp while
1896         doing so.
1897
1898         Reviewed by Philippe Normand.
1899
1900         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1901         (WebCore::GStreamerVideoEncoder::InitEncode):
1902
1903 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
1904
1905         [GStreamer][WebRTC]: Use codec setting video height/width as fallback
1906         https://bugs.webkit.org/show_bug.cgi?id=195675
1907
1908         Reviewed by Philippe Normand.
1909
1910         In some cases the frame height and width is not set (not sure why/ in
1911         what conditions but it happens) so make sure to get the information from
1912         the VideoCodec when configuring the encoder.
1913
1914         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
1915         (WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
1916         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
1917
1918 2019-03-13  Miguel Gomez  <magomez@igalia.com>
1919
1920         [CoordinatedGraphics] Null dereference in CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded
1921         https://bugs.webkit.org/show_bug.cgi?id=195615
1922
1923         Reviewed by Carlos Garcia Campos.
1924
1925         Exit early if we don't receive a valid coordinator.
1926
1927         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1928         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
1929
1930 2019-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>
1931
1932         [Win][PlayStation] Remove WebCore::standardUserAgentForURL
1933         https://bugs.webkit.org/show_bug.cgi?id=195662
1934
1935         Reviewed by Ryosuke Niwa.
1936
1937         WebCore::standardUserAgentForURL is just a stub in Windows port.
1938
1939         No new tests because there is no behavior change.
1940
1941         * platform/win/UserAgentWin.cpp:
1942         (WebCore::standardUserAgentForURL): Deleted.
1943         * platform/playstation/UserAgentPlayStation.cpp:
1944         (WebCore::standardUserAgentForURL): Deleted.
1945
1946 2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
1947
1948         [Win] Fix a slew of simple clang-cl warnings.
1949         https://bugs.webkit.org/show_bug.cgi?id=195652
1950
1951         Reviewed by Don Olmstead.
1952
1953         * page/AutoscrollController.cpp:
1954         (WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
1955         * platform/network/curl/CurlContext.cpp:
1956         (WebCore::CurlHandle::willSetupSslCtx):
1957         (WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
1958         * platform/network/curl/CurlFormDataStream.cpp:
1959         (WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
1960         * platform/network/curl/CurlRequest.cpp:
1961         (WebCore::CurlRequest::CurlRequest): -Wreorder
1962         (WebCore::CurlRequest::setupTransfer): -Wunused-variable
1963         * platform/network/curl/CurlSSLVerifier.cpp:
1964         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
1965         * platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
1966         * platform/win/LoggingWin.cpp:
1967         (WebCore::logLevelString): -Wwritable-strings
1968         * rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
1969         (WebCore::RenderThemeWin::getThemeData): -Wswitch
1970
1971 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
1972
1973         Move the code for determining the need for touch bar quirks to Quirks class
1974         https://bugs.webkit.org/show_bug.cgi?id=195654
1975
1976         Reviewed by Brent Fulgham.
1977
1978         Moved the code to determine whether the touch bar quirks are needed or not from WebKit2.
1979
1980         * WebCore.xcodeproj/project.pbxproj:
1981         * page/Quirks.cpp:
1982         (WebCore::Quirks::isTouchBarUpdateSupressedForHiddenContentEditable const):
1983         (WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
1984         * page/Quirks.h:
1985
1986 2019-03-12  Justin Fan  <justin_fan@apple.com>
1987
1988         [Web GPU] Update GPURenderPipelineDescriptor and add GPUColorStateDescriptor.format
1989         https://bugs.webkit.org/show_bug.cgi?id=195518
1990         <rdar://problem/46322356>
1991
1992         Reviewed by Myles C. Maxfield.
1993
1994         Upgrade the implementation of GPURenderPipelineDescriptor and GPURenderPipeline and match the updated Web GPU API.
1995         Add stubs for GPUColorStateDescriptor so attachment format can be provided by GPURenderPipelineDescriptor.
1996
1997         All affected Web GPU tests updated to cover existing behavior.
1998
1999         Update file names and symbols:
2000         * CMakeLists.txt:
2001         * DerivedSources-input.xcfilelist:
2002         * DerivedSources-output.xcfilelist:
2003         * DerivedSources.make:
2004         * Sources.txt:
2005         * WebCore.xcodeproj/project.pbxproj:
2006         * bindings/js/WebCoreBuiltinNames.h:
2007
2008         Updates to GPURenderPipeline, GPURenderPipelineDescriptor, and its components:
2009         * Modules/webgpu/GPUColorStateDescriptor.idl: Added. Provide the expected texture format of the render pipeline's color attachments.
2010         * Modules/webgpu/GPUInputStateDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUInputStateDescriptor.idl.
2011         * Modules/webgpu/GPUTextureFormat.idl: Update the existing values to match the new style.
2012         * Modules/webgpu/GPUVertexAttributeDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexAttributeDescriptor.idl.
2013         * Modules/webgpu/GPUVertexInputDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexInputDescriptor.idl.
2014         * Modules/webgpu/WebGPUDevice.cpp:
2015         (WebCore::WebGPUDevice::createPipelineLayout const): Remove unnecessary comment.
2016         (WebCore::WebGPUDevice::createRenderPipeline const): Descriptor validation and conversion moved into WebGPURenderPipelineDescriptor.
2017         (WebCore::validateAndConvertPipelineStage): Deleted.
2018         * Modules/webgpu/WebGPUDevice.h: create* functions should not return nullable.
2019         * Modules/webgpu/WebGPUIndexFormat.h: Removed. Moved into GPUInputStateDescriptor.idl.
2020         * Modules/webgpu/WebGPUInputStateDescriptor.h: Removed.
2021         * Modules/webgpu/WebGPUInputStepMode.idl: Removed. Moved into GPUVertexInputDescriptor.idl.
2022         * Modules/webgpu/WebGPUPipelineLayout.h:
2023         (WebCore::WebGPUPipelineLayout::pipelineLayout): Getters should return raw references.
2024         * Modules/webgpu/WebGPUPipelineStageDescriptor.h: Now shares a common base with GPUPipelineStageDescriptor.
2025         * Modules/webgpu/WebGPURenderPipeline.cpp:
2026         (WebCore::WebGPURenderPipeline::create):
2027         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
2028         * Modules/webgpu/WebGPURenderPipeline.h:  Now internally nullable.
2029         (WebCore::WebGPURenderPipeline::renderPipeline const):
2030         (WebCore::WebGPURenderPipeline::renderPipeline): Deleted.
2031         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
2032         (WebCore::WebGPUPipelineStageDescriptor::asGPUPipelineStageDescriptor const): Validate and convert a WebGPUPipelineStageDescriptor to GPU version.
2033         (WebCore::WebGPURenderPipelineDescriptor::asGPURenderPipelineDescriptor const): Ditto for WebGPURenderPipelineDescriptor.
2034         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Now shares a base class and some instance variables with GPURenderPipelineDescriptor.
2035         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Update GPUPrimitiveTopology for new style and add colorStates.
2036         * Modules/webgpu/WebGPUShaderModule.idl: Small pilot to test using InterfaceName to easily rename DOM-facing interfaces.
2037         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Removed.
2038         * Modules/webgpu/WebGPUVertexFormat.idl: Removed. Moved and updated in GPUVertexAttributeDescriptor.idl.
2039         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Removed.
2040         * platform/graphics/gpu/GPUInputStateDescriptor.h:
2041         * platform/graphics/gpu/GPUPipelineStageDescriptor.h:
2042         (WebCore::GPUPipelineStageDescriptor::GPUPipelineStageDescriptor):
2043         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Add shared base class for Web/GPURenderPipelineDescriptor.
2044         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
2045         * platform/graphics/gpu/GPUTextureFormat.h:
2046         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
2047         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
2048         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2049         (WebCore::setFunctionsForPipelineDescriptor): Make fragment required since descriptor validation fails if fragment function is not found right now.
2050         (WebCore::mtlVertexFormatForGPUVertexFormat): Renamed from validateAndConvertVertexFormatToMTLVertexFormat.
2051         (WebCore::mtlStepFunctionForGPUInputStepMode): Renamed from validateAndConvertStepModeToMTLStepFunction
2052         (WebCore::trySetInputStateForPipelineDescriptor):
2053         (WebCore::trySetColorStatesForColorAttachmentArray):
2054         (WebCore::tryCreateMtlRenderPipelineState):
2055         (WebCore::GPURenderPipeline::create):
2056         (WebCore::validateAndConvertVertexFormatToMTLVertexFormat): Deleted.
2057         (WebCore::validateAndConvertStepModeToMTLStepFunction): Deleted.
2058         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
2059         (WebCore::platformTextureFormatForGPUTextureFormat):
2060         * platform/graphics/gpu/GPUColorStateDescriptor.h: Added.
2061
2062         Misc:
2063         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2064         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
2065         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2066         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2067         * platform/graphics/gpu/GPURenderPassEncoder.h:
2068         * platform/graphics/gpu/GPURenderPipeline.h:
2069         (WebCore::GPURenderPipeline::primitiveTopology const):
2070         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2071         (WebCore::GPURenderPassEncoder::setPipeline):
2072         (WebCore::primitiveTypeForGPUPrimitiveTopology):
2073        
2074 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2075
2076         [ContentChangeObserver] Reset state when touchStart does not turn into click.
2077         https://bugs.webkit.org/show_bug.cgi?id=195603
2078         <rdar://problem/48796582>
2079
2080         Reviewed by Simon Fraser.
2081
2082         Add reset() function to assert and reset the current state.
2083
2084         * page/ios/ContentChangeObserver.cpp:
2085         (WebCore::ContentChangeObserver::willNotProceedWithClick):
2086         (WebCore::ContentChangeObserver::adjustObservedState):
2087         * page/ios/ContentChangeObserver.h:
2088
2089 2019-03-12  Timothy Hatcher  <timothy@apple.com>
2090
2091         Expose document attributes and body background color through HTMLConverter.
2092         https://bugs.webkit.org/show_bug.cgi?id=195636
2093         rdar://problem/45055697
2094
2095         Reviewed by Tim Horton.
2096
2097         * editing/cocoa/HTMLConverter.h:
2098         * editing/cocoa/HTMLConverter.mm:
2099         (HTMLConverter::convert):
2100         (WebCore::attributedStringFromRange):
2101         (WebCore::attributedStringFromSelection):
2102         (WebCore::attributedStringBetweenStartAndEnd):
2103
2104 2019-03-12  Antti Koivisto  <antti@apple.com>
2105
2106         Compositing layer that renders two positioned elements should not hit test
2107         https://bugs.webkit.org/show_bug.cgi?id=195371
2108         <rdar://problem/48649586>
2109
2110         Reviewed by Simon Fraser.
2111
2112         Followup to fix the test case (fast/scrolling/ios/overflow-scroll-overlap-2.html)
2113
2114         * platform/graphics/ca/GraphicsLayerCA.cpp:
2115         (WebCore::GraphicsLayerCA::setEventRegion):
2116
2117         Revert a last minute change (that was done to fix a Mac displaylist test).
2118
2119         * rendering/RenderLayerBacking.cpp:
2120         (WebCore::RenderLayerBacking::paintIntoLayer):
2121
2122         Compute the region on iOS only for now (it is not used on other platforms).
2123
2124 2019-03-12  Dean Jackson  <dino@apple.com>
2125
2126         [WebGL] WebGLBuffer can be too large
2127         https://bugs.webkit.org/show_bug.cgi?id=195068
2128         <rdar://problem/48414289>
2129
2130         Reviewed by Antoine Quint.
2131
2132         When creating an element array buffer, make sure to
2133         test against the maximum size of an ArrayBuffer, rather
2134         than just assume it can be created.
2135
2136         Test: fast/canvas/webgl/largeBuffer.html
2137
2138         * html/canvas/WebGLBuffer.cpp:
2139         (WebCore::WebGLBuffer::associateBufferDataImpl):
2140
2141 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
2142
2143         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-*-event-exception.html are failing
2144         https://bugs.webkit.org/show_bug.cgi?id=195581
2145
2146         Reviewed by Brady Eidson.
2147
2148         Uncaught exceptions should be handled after IDBRequest dispatches events so that IDBTransaction would stay 
2149         active during event dispatch.
2150
2151         * Modules/indexeddb/IDBRequest.cpp:
2152         (WebCore::IDBRequest::dispatchEvent):
2153         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
2154         * Modules/indexeddb/IDBRequest.h:
2155
2156 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
2157
2158         Layout Test imported/w3c/web-platform-tests/IndexedDB/transaction-abort-request-error.html is failing
2159         https://bugs.webkit.org/show_bug.cgi?id=195570
2160
2161         Reviewed by Brady Eidson.
2162
2163         IDBRequest result should be undefined if it is never set.
2164
2165         * Modules/indexeddb/IDBRequest.cpp:
2166         (WebCore::IDBRequest::IDBRequest):
2167
2168 2019-03-12  Youenn Fablet  <youenn@apple.com>
2169
2170         Rename originsMatch in originSerializationsMatch
2171         https://bugs.webkit.org/show_bug.cgi?id=195572
2172
2173         Reviewed by Jiewen Tan.
2174
2175         In addition to renaming, make use of SecurityOrigin::isSameOriginAs
2176         where it makes more sense than to compare origin serialization.
2177         The main difference is that isSameOriginAs will return false for two different unique origins
2178         while originsSerializationsMatch will not.
2179
2180         * Modules/credentialmanagement/CredentialsContainer.cpp:
2181         (WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
2182         * Modules/mediastream/RTCController.cpp:
2183         (WebCore::matchDocumentOrigin):
2184         * Modules/mediastream/RTCPeerConnection.cpp:
2185         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
2186         * loader/DocumentLoader.cpp:
2187         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const):
2188         * loader/cache/CachedResourceLoader.cpp:
2189         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2190         * page/SecurityOrigin.cpp:
2191         (WebCore::serializedOriginsMatch):
2192         (WebCore::originsMatch): Deleted.
2193         * page/SecurityOrigin.h:
2194
2195 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2196
2197         [Synthetic Click] Dispatch mouseout soon after mouseup
2198         https://bugs.webkit.org/show_bug.cgi?id=195575
2199         <rdar://problem/47093049>
2200
2201         Reviewed by Simon Fraser.
2202
2203         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
2204
2205         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
2206
2207         * page/EventHandler.h:
2208         * page/ios/EventHandlerIOS.mm:
2209         (WebCore::EventHandler::dispatchFakeMouseOut):
2210
2211 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2212
2213         In CachedFrame's constructor, release-assert that DOMWindow still has a frame after page-caching subframes
2214         https://bugs.webkit.org/show_bug.cgi?id=195609
2215
2216         Reviewed by Chris Dumez.
2217
2218         r242677 added release assertions to DOMWindow::suspendForPageCache. But when the first release assert in
2219         that function is hit, we still can't tell whether active DOM objects are detaching frames, or if creating
2220         CachedFrame's on one of subframes is causing the frame to go way.
2221
2222         Add a release assertion immediately after creating CachedFrame on subframes to detect this case.
2223
2224         * history/CachedFrame.cpp:
2225         (WebCore::CachedFrame::CachedFrame):
2226
2227 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2228
2229         [ContentChangeObserver] Stop content change observation when the touch event turns into long press
2230         https://bugs.webkit.org/show_bug.cgi?id=195601
2231         <rdar://problem/48796324>
2232
2233         Reviewed by Wenson Hsieh.
2234
2235         Cancel the ongoing content observation (started at touchStart) when the touch event does not turn into a tap gesture.
2236
2237         Not testable because any subsequent tap would reset the state anyway (though it might be measurable through some code triggering heavy content change).
2238
2239         * page/ios/ContentChangeObserver.cpp:
2240         (WebCore::ContentChangeObserver::didRecognizeLongPress):
2241         (WebCore::ContentChangeObserver::willNotProceedWithClick):
2242         * page/ios/ContentChangeObserver.h:
2243
2244 2019-03-12  Antti Koivisto  <antti@apple.com>
2245
2246         Compositing layer that renders two positioned elements should not hit test
2247         https://bugs.webkit.org/show_bug.cgi?id=195371
2248         <rdar://problem/48649586>
2249
2250         Reviewed by Simon Fraser.
2251
2252         Compute and pass an event region for layers if it differs from layer bounds.
2253
2254         This patch fixes various block overflow and layer expansion cases. It does not handle
2255         overflowing line boxes yet (it adds tests for those too).
2256
2257         Test: fast/scrolling/ios/overflow-scroll-overlap-2.html
2258
2259         * platform/graphics/GraphicsLayer.cpp:
2260         (WebCore::GraphicsLayer::setEventRegion):
2261         * platform/graphics/GraphicsLayer.h:
2262         (WebCore::GraphicsLayer::eventRegion):
2263         * platform/graphics/Region.h:
2264         * platform/graphics/ca/GraphicsLayerCA.cpp:
2265         (WebCore::GraphicsLayerCA::setEventRegion):
2266         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2267         (WebCore::GraphicsLayerCA::updateEventRegion):
2268
2269         Pass the region via the main platform layer of the graphics layer.
2270
2271         * platform/graphics/ca/GraphicsLayerCA.h:
2272         * platform/graphics/ca/PlatformCALayer.h:
2273         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2274         * rendering/PaintInfo.h:
2275         * rendering/PaintPhase.h:
2276
2277         Add EventRegion paint phase that computes the region instead of painting anything.
2278
2279         * rendering/RenderBlock.cpp:
2280         (WebCore::RenderBlock::paintObject):
2281         * rendering/RenderLayer.cpp:
2282         (WebCore::RenderLayer::paintForegroundForFragments):
2283         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2284
2285         Invoke EventRegion paint phase.
2286
2287         * rendering/RenderLayer.h:
2288         * rendering/RenderLayerBacking.cpp:
2289         (WebCore::RenderLayerBacking::paintIntoLayer):
2290
2291         Request event region when pointing a layer.
2292
2293 2019-03-12  Philippe Normand  <pnormand@igalia.com>
2294
2295         [GStreamer][v4l2] Synchronous video texture flushing support
2296         https://bugs.webkit.org/show_bug.cgi?id=195453
2297
2298         Reviewed by Xabier Rodriguez-Calvar.
2299
2300         The v4l2 video decoder currently requires that downstream users of
2301         the graphics resources complete any pending draw call and release
2302         resources before returning from the DRAIN query.
2303
2304         To accomplish this the player monitors the pipeline and whenever a
2305         v4l2 decoder is added, synchronous video texture flushing support
2306         is enabled. Additionally and for all decoder configurations, a
2307         flush is performed before disposing of the player.
2308
2309         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2310         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
2311         Monitor elements added to the decodebin bin.
2312         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
2313         a flag if a v4l2 decoder was added in decodebin.
2314         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
2315         to the deep-element-added signal so as to monitor pipeline
2316         topology updates.
2317         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2318         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2319         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2320         Flush video texture before disposing of the player.
2321         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2322         Synchronously flush if the pipeline contains a v4l2 decoder.
2323         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
2324         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2325         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2326         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
2327         boolean flag used mostly to trigger synchronous flush conditions.
2328         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2329         Optionally drop the current buffer in a synchronous manner. By
2330         default the method keeps operating asynchronously.
2331         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2332
2333 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2334
2335         Move the remaining code to decide whether site specific quirks are needed to Quirks class
2336         https://bugs.webkit.org/show_bug.cgi?id=195610
2337
2338         Reviewed by Antti Koivisto.
2339
2340         Moved the remaining code scattered across WebCore to decide whether a site specific quirk
2341         is needed or not to Quirks class introduced in r236818.
2342
2343         * Modules/fetch/FetchRequest.cpp:
2344         (WebCore::needsSignalQuirk): Deleted.
2345         (WebCore::processInvalidSignal):
2346         * html/HTMLFormControlElement.cpp:
2347         (WebCore::HTMLFormControlElement::needsMouseFocusableQuirk const):
2348         * html/HTMLMediaElement.cpp:
2349         (WebCore::needsAutoplayPlayPauseEventsQuirk): Deleted.
2350         (WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
2351         (WebCore::needsSeekingSupportQuirk): Deleted.
2352         (WebCore::HTMLMediaElement::supportsSeeking const):
2353         * html/MediaElementSession.cpp:
2354         (WebCore::needsArbitraryUserGestureAutoplayQuirk): Deleted.
2355         (WebCore::needsPerDocumentAutoplayBehaviorQuirk): Deleted.
2356         (WebCore::MediaElementSession::playbackPermitted const):
2357         * page/Quirks.cpp:
2358         (WebCore::allowedAutoplayQuirks): Added.
2359         (WebCore::Quirks::needsQuirks const): Added.
2360         (WebCore::Quirks::shouldIgnoreInvalidSignal const): Added.
2361         (WebCore::Quirks::needsFormControlToBeMouseFocusable const): Added.
2362         (WebCore::Quirks::needsAutoplayPlayPauseEvents const): Added.
2363         (WebCore::Quirks::needsSeekingSupportDisabled const): Addd.
2364         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const): Added.
2365         (WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const): Added.
2366         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): Added.
2367         (WebCore::Quirks::hasWebSQLSupportQuirk const): Fixed the coding style.
2368         * page/Quirks.h:
2369
2370 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
2371
2372         [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed
2373         https://bugs.webkit.org/show_bug.cgi?id=195454
2374
2375         Reviewed by Jer Noble.
2376
2377         This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy"
2378         and "27. HFRPausedAccuracy".
2379
2380         The first timeUpdate event after play() is omitted, because currentTime
2381         doesn't actually change in that scenario.
2382
2383         Tests 26 and 27 measure the time drift (real time vs. media time) on playback
2384         and start counting since the first timeUpdate event. In WebKit, that event
2385         happens at play(), before the pipeline has completed the transition to playing.
2386         Therefore, the real time inherits this startup delay and the test thinks that
2387         the player has drifted.
2388
2389         * html/HTMLMediaElement.cpp:
2390         (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed.
2391
2392 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
2393
2394         [EME][GStreamer] Speculative build fix
2395         https://bugs.webkit.org/show_bug.cgi?id=195614
2396
2397         Unreviewed speculative WPE build fix after r242776.
2398
2399         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added missing include.
2400
2401 2019-03-12  Philippe Normand  <pnormand@igalia.com>
2402
2403         [GStreamer] remove legacy GStreamer version checks
2404         https://bugs.webkit.org/show_bug.cgi?id=195552
2405
2406         Reviewed by Xabier Rodriguez-Calvar.
2407
2408         We require GStreamer 1.8.x so version checks below that make
2409         little sense. Also checks for odd minor version numbers make sense
2410         only for the latest GStreamer git development version.
2411
2412         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2413         (WebCore::initializeGStreamerAndRegisterWebKitElements):
2414         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2415         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
2416         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2417         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2418         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2419
2420 2019-03-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2421
2422         [EME] generateRequest was not using the sanitized init data
2423         https://bugs.webkit.org/show_bug.cgi?id=195555
2424
2425         Reviewed by Jer Noble.
2426
2427         * Modules/encryptedmedia/MediaKeySession.cpp:
2428         (WebCore::MediaKeySession::generateRequest): Use sanitized init
2429         data instead of the original one.
2430
2431 2019-03-12  Rob Buis  <rbuis@igalia.com>
2432
2433         Implement further CORS restrictions
2434         https://bugs.webkit.org/show_bug.cgi?id=188644
2435
2436         Reviewed by Darin Adler.
2437
2438         Verify that header value length is not greater than 128 [1]. Also implement
2439         Step 5 of [2] to append values to existing header value when calling
2440         Headers.append.
2441
2442         Tests: fetch/api/cors/cors-preflight-not-cors-safelisted.any.html
2443                fetch/api/cors/cors-preflight-not-cors-safelisted.any.worker.html
2444                fetch/api/headers/headers-no-cors.window.html
2445
2446         [1] https://fetch.spec.whatwg.org/#cors-safelisted-request-header
2447         [2] https://fetch.spec.whatwg.org/#concept-headers-append
2448
2449         * Modules/fetch/FetchHeaders.cpp:
2450         (WebCore::canWriteHeader):
2451         (WebCore::appendToHeaderMap):
2452         (WebCore::FetchHeaders::remove):
2453         (WebCore::FetchHeaders::set):
2454         (WebCore::FetchHeaders::filterAndFill):
2455         * platform/network/HTTPParsers.cpp:
2456         (WebCore::isCrossOriginSafeRequestHeader): verify that header length is not greater than 128
2457
2458 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2459
2460         Remove OS X Server QuickTime plugin quirks
2461         https://bugs.webkit.org/show_bug.cgi?id=195607
2462
2463         Reviewed by Brent Fulgham.
2464
2465         r87244 added a site specific quirk for Mac OS X Sever wiki pages.
2466         However, the issue has since been resolved as of OS X Mountain Lion,
2467         of which Apple has ended the support in September 2015.
2468
2469         Because the latest versions of Safari no longer supports non-Flash plugins,
2470         the only scenario in which this quirk comes into play is when a third party app
2471         which embeds WKWebView or WebKitLegacy loaded web pages on a OS X Server
2472         running OS X Mountain Lion or earlier.
2473
2474         Given these observations, it's probably safe to remove this quirk from WebKit.
2475
2476         * html/HTMLObjectElement.cpp:
2477         (WebCore::HTMLObjectElement::hasFallbackContent const):
2478         (WebCore::HTMLObjectElement::hasValidClassId):
2479         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Deleted.
2480         * html/HTMLObjectElement.h:
2481
2482 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
2483
2484         Unreviewed speculative WPE build fix after r195586.
2485
2486         * platform/encryptedmedia/CDMInstance.h:
2487
2488 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2489
2490         Remove MediaWiki site specific quirks
2491         https://bugs.webkit.org/show_bug.cgi?id=195597
2492
2493         Reviewed by Simon Fraser.
2494
2495         r47383 added a site specific quirk for the KHTML workaround in MediaWiki.
2496
2497         Blink since removed this workaround:
2498         https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0
2499
2500         Given Chrome has been shipping without this quirk for six years, it's safe to assume
2501         this site specific quirk is no longer neeed for Web compatibility.
2502
2503         * css/StyleSheetContents.cpp:
2504         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2505         * css/parser/CSSParserContext.cpp:
2506         (WebCore::CSSParserContext::CSSParserContext):
2507         (WebCore::operator==):
2508         * css/parser/CSSParserContext.h:
2509         (WebCore::CSSParserContextHash::hash):
2510
2511 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2512
2513         Remove OpenCube QuickMenu quirks from navigator.appVersion
2514         https://bugs.webkit.org/show_bug.cgi?id=195600
2515
2516         Reviewed by Simon Fraser.
2517
2518         Remove the site specific quirk added in r35050 for OpenCube QuickMenu library for nwa.com
2519
2520         Blink removed this code back in 2013. The fact Chrome has been shipping successfully without
2521         this quirk for six years is a good evidence that it's no longer needed for the Web compatibility.
2522
2523         * page/Navigator.cpp:
2524         (WebCore::Navigator::appVersion const):
2525         (WebCore::shouldHideFourDot): Deleted.
2526
2527 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
2528
2529         Unreviewed, rolling out r242763.
2530
2531         Causes layout test crashes on iOS simulator
2532
2533         Reverted changeset:
2534
2535         "[Synthetic Click] Dispatch mouseout soon after mouseup"
2536         https://bugs.webkit.org/show_bug.cgi?id=195575
2537         https://trac.webkit.org/changeset/242763
2538
2539 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
2540
2541         Add Optional to Forward.h.
2542         https://bugs.webkit.org/show_bug.cgi?id=195586
2543
2544         Reviewed by Darin Adler.
2545
2546         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
2547         * Modules/encryptedmedia/MediaKeyStatusMap.h:
2548         * Modules/webauthn/apdu/ApduCommand.cpp:
2549         * Modules/webauthn/apdu/ApduCommand.h:
2550         * Modules/webauthn/apdu/ApduResponse.cpp:
2551         * Modules/webauthn/apdu/ApduResponse.h:
2552         * Modules/webauthn/fido/FidoHidMessage.cpp:
2553         * Modules/webauthn/fido/FidoHidMessage.h:
2554         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2555         * Modules/webauthn/fido/U2fCommandConstructor.h:
2556         * Modules/webdatabase/SQLTransaction.cpp:
2557         * Modules/webdatabase/SQLTransaction.h:
2558         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2559         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2560         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
2561         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2562         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
2563         * Modules/webgpu/WebGPU.cpp:
2564         * Modules/webgpu/WebGPU.h:
2565         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2566         * Modules/webgpu/WebGPUCommandBuffer.h:
2567         * animation/WebAnimation.cpp:
2568         * animation/WebAnimation.h:
2569         * crypto/gcrypt/GCryptUtilities.cpp:
2570         * crypto/gcrypt/GCryptUtilities.h:
2571         * css/CSSStyleDeclaration.cpp:
2572         * css/CSSStyleDeclaration.h:
2573         * dom/TextDecoder.cpp:
2574         * dom/TextDecoder.h:
2575         * dom/UserGestureIndicator.cpp:
2576         * dom/UserGestureIndicator.h:
2577         * editing/ChangeListTypeCommand.cpp:
2578         * editing/ChangeListTypeCommand.h:
2579         * editing/EditingStyle.cpp:
2580         * editing/EditingStyle.h:
2581         * html/DOMFormData.cpp:
2582         * html/DOMFormData.h:
2583         * html/HTMLAllCollection.cpp:
2584         * html/HTMLAllCollection.h:
2585         * html/HTMLAnchorElement.cpp:
2586         * html/HTMLAnchorElement.h:
2587         * html/ImageBitmap.cpp:
2588         * html/ImageBitmap.h:
2589         * html/canvas/Path2D.h:
2590         * html/canvas/WebMetalEnums.cpp:
2591         * html/canvas/WebMetalEnums.h:
2592         * html/parser/HTMLParserIdioms.cpp:
2593         * html/parser/HTMLParserIdioms.h:
2594         * loader/ResourceCryptographicDigest.cpp:
2595         * loader/ResourceCryptographicDigest.h:
2596         * mathml/MathMLOperatorDictionary.cpp:
2597         * mathml/MathMLOperatorDictionary.h:
2598         * page/PerformanceEntry.cpp:
2599         * page/PerformanceEntry.h:
2600         * page/ResourceUsageData.h:
2601         * platform/ReferrerPolicy.cpp:
2602         * platform/ReferrerPolicy.h:
2603         * platform/Theme.cpp:
2604         * platform/Theme.h:
2605         * platform/encryptedmedia/CDMInstance.h:
2606         * platform/graphics/gpu/GPUDevice.cpp:
2607         * platform/graphics/gpu/GPUDevice.h:
2608         * platform/graphics/transforms/AffineTransform.cpp:
2609         * platform/graphics/transforms/AffineTransform.h:
2610         * platform/graphics/transforms/TransformState.cpp:
2611         * platform/graphics/transforms/TransformState.h:
2612         * platform/graphics/transforms/TransformationMatrix.cpp:
2613         * platform/graphics/transforms/TransformationMatrix.h:
2614         * platform/graphics/win/ImageDecoderDirect2D.cpp:
2615         * platform/graphics/win/ImageDecoderDirect2D.h:
2616         * platform/mediacapabilities/AudioConfiguration.h:
2617         * platform/network/CacheValidation.cpp:
2618         * platform/network/CacheValidation.h:
2619         * platform/network/DataURLDecoder.cpp:
2620         * platform/network/DataURLDecoder.h:
2621         * platform/network/HTTPParsers.cpp:
2622         * platform/network/HTTPParsers.h:
2623         * platform/network/curl/CookieJarDB.cpp:
2624         * platform/network/curl/CookieJarDB.h:
2625         * platform/win/SearchPopupMenuDB.cpp:
2626         * platform/win/SearchPopupMenuDB.h:
2627         * rendering/ImageQualityController.cpp:
2628         * rendering/ImageQualityController.h:
2629         * svg/SVGToOTFFontConversion.cpp:
2630         * svg/SVGToOTFFontConversion.h:
2631         Remove unnecessary includes from headers.
2632
2633 2019-03-11  Jer Noble  <jer.noble@apple.com>
2634
2635         REGRESSION(r236281): YouTube Movies fail with "video format" error
2636         https://bugs.webkit.org/show_bug.cgi?id=195598
2637         <rdar://problem/48782842>
2638
2639         Reviewed by Jon Lee.
2640
2641         Partially revert r236281 for YouTube.com.
2642
2643         * page/Quirks.cpp:
2644         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
2645
2646 2019-03-11  Justin Fan  <justin_fan@apple.com>
2647
2648         [Web GPU] BindGroups/Argument buffers: Move MTLBuffer creation from and GPUBindGroup validation to GPUDevice.createBindGroup
2649         https://bugs.webkit.org/show_bug.cgi?id=195519
2650         <rdar://problem/48781297>
2651
2652         Reviewed by Myles C. Maxfield.
2653
2654         Metal's Argument Buffers should not be tied directly to GPUBindGroupLayout; rather, create the MTLBuffer 
2655         in GPUBindGroup creation process.
2656         Move GPUBindGroup validation out of setBindGroup and to GPUBindGroup creation for performance.
2657
2658         Covered by existing tests. No behavior change.
2659
2660         * Modules/webgpu/WebGPUDevice.cpp:
2661         (WebCore::WebGPUDevice::createBindGroup const):
2662         * Sources.txt:
2663         * SourcesCocoa.txt:
2664         * WebCore.xcodeproj/project.pbxproj:
2665         * platform/graphics/gpu/GPUBindGroup.cpp: Removed.
2666         * platform/graphics/gpu/GPUBindGroup.h:
2667         (WebCore::GPUBindGroup::vertexArgsBuffer): A buffer that arguments will be encoded into during setBindGroup.
2668         (WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
2669         (WebCore::GPUBindGroup::boundBuffers const): A list of resources that are bound by this GPUBindGroup.
2670         (WebCore::GPUBindGroup::boundTextures const): Ditto.
2671         (WebCore::GPUBindGroup::layout const): Deleted.
2672         (WebCore::GPUBindGroup::bindings const): Deleted.
2673         * platform/graphics/gpu/GPUBindGroupLayout.h: No longer creating and retaining MTLBuffers.
2674         (WebCore::GPUBindGroupLayout::vertexEncoder const):
2675         (WebCore::GPUBindGroupLayout::fragmentEncoder const):
2676         (WebCore::GPUBindGroupLayout::computeEncoder const):
2677         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::isValid const): Deleted.
2678         (WebCore::GPUBindGroupLayout::vertexArguments const): Deleted.
2679         (WebCore::GPUBindGroupLayout::fragmentArguments const): Deleted.
2680         (WebCore::GPUBindGroupLayout::computeArguments const): Deleted.
2681         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2682         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2683         (WebCore::tryCreateMtlArgumentEncoder):
2684         (WebCore::GPUBindGroupLayout::tryCreate):
2685         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2686         (WebCore::tryCreateArgumentEncoderAndBuffer): Deleted.
2687         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Added.
2688         (WebCore::tryCreateArgumentBuffer): Create and associate the MTLBuffer that backs the MTLArgumentEncoder.
2689         (WebCore::tryGetResourceAsBufferBinding): Validate a GPUBindingResource.
2690         (WebCore::trySetBufferOnEncoder): Encodes a GPUBufferBinding's MTLBuffer on a MTLArgumentEncoder.
2691         (WebCore::tryGetResourceAsSampler): Ditto, for GPUSamplers.
2692         (WebCore::trySetSamplerOnEncoder):
2693         (WebCore::tryGetResourceAsTexture): Ditto, for GPUTextures.
2694         (WebCore::trySetTextureOnEncoder):
2695         (WebCore::GPUBindGroup::tryCreate): Most setBindGroup validation moved here.
2696         (WebCore::GPUBindGroup::GPUBindGroup): Retains the resource references needed for setBindGroup. 
2697         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2698         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Most validation moved to GPUBindGroup::tryCreate().
2699         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Deleted.
2700         (WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Deleted.
2701         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder): Deleted.
2702         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2703         (WebCore::GPURenderPassEncoder::useResource):
2704         (WebCore::GPURenderPassEncoder::setVertexBuffer):
2705         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
2706
2707         Misc:
2708         * platform/graphics/gpu/GPUCommandBuffer.cpp/h: Move missing includes to header.
2709
2710 2019-03-11  Zalan Bujtas  <zalan@apple.com>
2711
2712         [Synthetic Click] Dispatch mouseout soon after mouseup
2713         https://bugs.webkit.org/show_bug.cgi?id=195575
2714         <rdar://problem/47093049>
2715
2716         Reviewed by Simon Fraser.
2717
2718         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
2719
2720         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
2721
2722         * page/EventHandler.h:
2723         * page/ios/EventHandlerIOS.mm:
2724         (WebCore::EventHandler::dispatchFakeMouseOut):
2725
2726 2019-03-11  Youenn Fablet  <youenn@apple.com>
2727
2728         REGRESSION: (r242181) API test DragAndDropTests.ExternalSourcePlainTextToIFrame is Timing out
2729         https://bugs.webkit.org/show_bug.cgi?id=195362
2730
2731         Reviewed by Alexey Proskuryakov.
2732
2733         Covered by API test no longer crashing.
2734
2735         * page/SecurityOrigin.cpp:
2736         (WebCore::originsMatch):
2737         String representation should only match if originsMatch returns true.
2738
2739 2019-03-11  Justin Fan  <justin_fan@apple.com>
2740
2741         [Web GPU] Update GPUSwapChainDescriptor, GPUSwapChain and implement GPUCanvasContext
2742         https://bugs.webkit.org/show_bug.cgi?id=194406
2743         <rdar://problem/47892466>
2744
2745         Reviewed by Myles C. Maxfield.
2746
2747         GPUSwapChain no longer inherits from GPUBasedRenderingContext, and is now created from a GPUDevice. 
2748         WebGPURenderingContext is now GPUCanvasContext and delegates functionality to the GPUSwapChain, if it exists. 
2749         GPUQueue now implicitly presents the GPUSwapChain's current drawable at the task boundary, if one exists.
2750         Creating a new GPUSwapChain with the same GPUCanvasContext invalidates the previous one and its drawable and pipeline attachments.
2751         Calling GPUSwapChain::getCurrentTexture returns the same drawable within one task cycle. 
2752         Some mentions of "WebGPU" have been renamed to "Web GPU" and "gpu".
2753
2754         All Web GPU tests updated to match.
2755
2756         Add new files and symbols.
2757         * CMakeLists.txt:
2758         * DerivedSources-input.xcfilelist:
2759         * DerivedSources-output.xcfilelist:
2760         * DerivedSources.make:
2761         * Sources.txt:
2762         * WebCore.xcodeproj/project.pbxproj:
2763         * bindings/js/WebCoreBuiltinNames.h:
2764
2765         Rename some mentions of "webgpu" to "gpu".
2766         * Modules/webgpu/DOMWindowWebGPU.cpp:
2767         (WebCore::DOMWindowWebGPU::gpu):
2768         (WebCore::DOMWindowWebGPU::gpu const):
2769         * Modules/webgpu/DOMWindowWebGPU.h:
2770         * Modules/webgpu/DOMWindowWebGPU.idl:
2771
2772         Replace WebGPURenderingContext with GPUCanvasContext.
2773         * Modules/webgpu/GPUCanvasContext.cpp: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.cpp.
2774         (WebCore::GPUCanvasContext::create):
2775         (WebCore::GPUCanvasContext::GPUCanvasContext):
2776         (WebCore::GPUCanvasContext::replaceSwapChain):
2777         (WebCore::GPUCanvasContext::platformLayer const):
2778         (WebCore::GPUCanvasContext::reshape):
2779         (WebCore::GPUCanvasContext::markLayerComposited):
2780         * Modules/webgpu/GPUCanvasContext.h: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.h.
2781         * Modules/webgpu/GPUCanvasContext.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.idl.
2782         * dom/Document.cpp:
2783         (WebCore::Document::getCSSCanvasContext):
2784         * dom/Document.h:
2785         * dom/Document.idl:
2786         * html/HTMLCanvasElement.cpp:
2787         (WebCore::HTMLCanvasElement::getContext):
2788         (WebCore::HTMLCanvasElement::isWebGPUType):
2789         (WebCore::HTMLCanvasElement::createContextWebGPU):
2790         (WebCore::HTMLCanvasElement::getContextWebGPU):
2791         * html/HTMLCanvasElement.h:
2792         * html/HTMLCanvasElement.idl:
2793         * inspector/InspectorCanvas.cpp:
2794         (WebCore::InspectorCanvas::buildObjectForCanvas):
2795         * inspector/agents/InspectorCanvasAgent.cpp:
2796         (WebCore::contextAsScriptValue):
2797
2798         Update WebGPUSwapChain.
2799         * Modules/webgpu/GPUTextureDescriptor.idl:
2800         * Modules/webgpu/GPUTextureFormat.idl: Add the other two texture formats supported by CAMetalLayer.
2801         * Modules/webgpu/WebGPUDevice.cpp: Implement createSwapChain.
2802         (WebCore::WebGPUDevice::createSwapChain const):
2803         (WebCore::WebGPUDevice::getQueue const):
2804         (WebCore::WebGPUDevice::getQueue): Deleted.
2805         * Modules/webgpu/WebGPUDevice.h:
2806         * Modules/webgpu/WebGPUDevice.idl:
2807         * Modules/webgpu/WebGPUSwapChain.cpp:
2808         (WebCore::WebGPUSwapChain::create):
2809         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
2810         (WebCore::WebGPUSwapChain::getCurrentTexture): Renamed from getNextTexture. Only returns the next drawable if the last was presented.
2811         (WebCore::WebGPUSwapChain::destroy): Invalidate this GPUSwapChain and its textures and views.
2812         (WebCore::WebGPUSwapChain::configure): Deleted.
2813         (WebCore::WebGPUSwapChain::getNextTexture): Deleted.
2814         (WebCore::WebGPUSwapChain::present): Deleted.
2815         (WebCore::WebGPUSwapChain::reshape): Deleted.
2816         (WebCore::WebGPUSwapChain::markLayerComposited): Deleted.
2817         * Modules/webgpu/WebGPUSwapChain.h: Now a device-based object rather than a rendering context.
2818         (WebCore::WebGPUSwapChain::swapChain const):
2819         (WebCore::WebGPUSwapChain::WebGPUSwapChain): Deleted.
2820         * Modules/webgpu/WebGPUSwapChain.idl:
2821         * Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
2822         * platform/graphics/gpu/GPUDevice.cpp: Implement tryCreateSwapChain.
2823         (WebCore::GPUDevice::tryCreateSwapChain const):
2824         (WebCore::GPUDevice::getQueue const):
2825         (WebCore::GPUDevice::getQueue): Deleted.
2826         * platform/graphics/gpu/GPUDevice.h: Retain a reference to the current GPUSwapChain, if one exists.
2827         (WebCore::GPUDevice::swapChain const):
2828         * platform/graphics/gpu/GPUQueue.h:
2829         * platform/graphics/gpu/GPUSwapChain.h:
2830         (WebCore::GPUSwapChain::destroy):
2831         * platform/graphics/gpu/GPUSwapChainDescriptor.h: Added.
2832         * platform/graphics/gpu/GPUTextureFormat.h: Add the other two texture formats supported by CAMetalLayer.
2833         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2834         (WebCore::GPUBuffer::commandBufferCommitted):
2835         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2836         (WebCore::GPUQueue::tryCreate): Renamed from create to better fit functionality. Now retain a reference to the GPUDevice.
2837         (WebCore::GPUQueue::GPUQueue):
2838         (WebCore::GPUQueue::submit): Now checks state of all resources before marking them as committed or committing any resource.
2839                 In addition, schedules the current drawable to be presented after all commands have been submitted during this task cycle.
2840         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2841         (WebCore::useAttachments): Ensure that the command buffer is aware of any texture resources used as attachments.
2842         (WebCore::GPURenderPassEncoder::tryCreate):
2843         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2844         (WebCore::tryGetSupportedPixelFormat): Supported texture formats are the intersection of Web GPU's texture formats and CAMetalLayer's.
2845         (WebCore::setLayerShape):
2846         (WebCore::tryCreateSwapLayer): Create and configure the CAMetalLayer backing the swap chain.
2847         (WebCore::GPUSwapChain::tryCreate):
2848         (WebCore::GPUSwapChain::GPUSwapChain):
2849         (WebCore::GPUSwapChain::tryGetCurrentTexture): Renamed from getNextTexture. Only returns a texture if the last one was presented.
2850         (WebCore::GPUSwapChain::present):
2851         (WebCore::GPUSwapChain::reshape):
2852         (WebCore::GPUSwapChain::takeDrawable): Swaps out the current drawable so that it can be presented. The GPUSwapChain thus releases its reference to it.
2853         (WebCore::GPUSwapChain::create): Deleted.
2854         (WebCore::GPUSwapChain::setDevice): Deleted.
2855         (WebCore::GPUSwapChain::setFormat): Deleted.
2856         (WebCore::GPUSwapChain::getNextTexture): Deleted.
2857         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
2858         (WebCore::platformTextureFormatForGPUTextureFormat):
2859
2860         Misc:
2861         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Missing include.
2862
2863 2019-03-11  Chris Dumez  <cdumez@apple.com>
2864
2865         Update device orientation & motion permission native SPI as per latest proposal
2866         https://bugs.webkit.org/show_bug.cgi?id=195567
2867
2868         Reviewed by Youenn Fablet.
2869
2870         * dom/DeviceOrientationAndMotionAccessController.cpp:
2871         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
2872         * page/ChromeClient.h:
2873
2874 2019-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2875
2876         [macOS] Dispatching reentrant "contextmenu" events may cause crashes
2877         https://bugs.webkit.org/show_bug.cgi?id=195571
2878         <rdar://problem/48086046>
2879
2880         Reviewed by Andy Estes.
2881
2882         Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag.
2883         As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a
2884         synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as
2885         a result of handling a context menu event.
2886
2887         Test: fast/events/contextmenu-reentrancy-crash.html
2888
2889         * page/ContextMenuController.cpp:
2890         (WebCore::ContextMenuController::handleContextMenuEvent):
2891         * page/ContextMenuController.h:
2892
2893 2019-03-11  Andy Estes  <aestes@apple.com>
2894
2895         [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
2896         https://bugs.webkit.org/show_bug.cgi?id=195530
2897         <rdar://problem/48747164>
2898
2899         Reviewed by Alex Christensen.
2900
2901         * Modules/applepay/PaymentCoordinatorClient.h: Defined isWebPaymentCoordinator.
2902         * page/Settings.yaml: Defined the applePayRemoteUIEnabled setting and reordered the other
2903         Apple Pay settings.
2904
2905 2019-03-11  Alex Christensen  <achristensen@webkit.org>
2906
2907         Soft linking to Reveal framework should be optional
2908         https://bugs.webkit.org/show_bug.cgi?id=195576
2909         <rdar://problem/46822452>
2910
2911         Reviewed by Megan Gardner.
2912
2913         Systems exist with ENABLE(REVEAL) true and the Reveal framework does not exist.
2914
2915         * editing/cocoa/DictionaryLookup.mm:
2916         (WebCore::showPopupOrCreateAnimationController):
2917
2918 2019-03-11  Yusuke Suzuki  <ysuzuki@apple.com>
2919
2920         [JSC] Reduce # of structures in JSGlobalObject initialization
2921         https://bugs.webkit.org/show_bug.cgi?id=195498
2922
2923         Reviewed by Darin Adler.
2924
2925         * bindings/js/SerializedScriptValue.cpp:
2926         (WebCore::CloneSerializer::serialize):
2927
2928 2019-03-11  Brent Fulgham  <bfulgham@apple.com>
2929
2930         Remove obsolete runtime flag for StorageAccess API Prompt
2931         https://bugs.webkit.org/show_bug.cgi?id=195564
2932         <rdar://problem/37279014>
2933
2934         Reviewed by Chris Dumez.
2935
2936         This bug tracks the work of removing the obsolete flag that had been used to optionally
2937         prevent display of the StorageAccess API prompt. We have since shipped the final version
2938         of this feature with an always-on prompt, and should have removed this runtime flag.
2939
2940         No test changes because this has no change in behavior. Tests already assume the prompt
2941         behavior, and did not test turning the flag off.
2942
2943         * page/RuntimeEnabledFeatures.h:
2944         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled): Deleted.
2945         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const): Deleted.
2946         * testing/InternalSettings.cpp:
2947         (WebCore::InternalSettings::Backup::Backup):
2948         (WebCore::InternalSettings::Backup::restoreTo):
2949         (WebCore::InternalSettings::setStorageAccessPromptsEnabled): Deleted.
2950         * testing/InternalSettings.h:
2951         (): Deleted.
2952         * testing/InternalSettings.idl:
2953
2954 2019-03-11  Eric Carlson  <eric.carlson@apple.com>
2955
2956         Add web audio release logging
2957         https://bugs.webkit.org/show_bug.cgi?id=195554
2958         <rdar://problem/48767211>
2959
2960         Reviewed by Jer Noble.
2961
2962         No new tests, no functional change.
2963
2964         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2965         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
2966         * Modules/webaudio/AudioBufferSourceNode.cpp:
2967         (WebCore::AudioBufferSourceNode::setBuffer):
2968         (WebCore::AudioBufferSourceNode::startPlaying):
2969         * Modules/webaudio/AudioContext.cpp:
2970         (WebCore::nextLogIdentifier):
2971         (WebCore::AudioContext::AudioContext):
2972         (WebCore::AudioContext::uninitialize):
2973         (WebCore::AudioContext::stop):
2974         (WebCore::AudioContext::createBufferSource):
2975         (WebCore::AudioContext::createMediaElementSource):
2976         (WebCore::AudioContext::createMediaStreamSource):
2977         (WebCore::AudioContext::createScriptProcessor):
2978         (WebCore::AudioContext::createBiquadFilter):
2979         (WebCore::AudioContext::createWaveShaper):
2980         (WebCore::AudioContext::createPanner):
2981         (WebCore::AudioContext::createConvolver):
2982         (WebCore::AudioContext::createDynamicsCompressor):
2983         (WebCore::AudioContext::createAnalyser):
2984         (WebCore::AudioContext::createGain):
2985         (WebCore::AudioContext::createDelay):
2986         (WebCore::AudioContext::createChannelSplitter):
2987         (WebCore::AudioContext::createChannelMerger):
2988         (WebCore::AudioContext::createOscillator):
2989         (WebCore::AudioContext::createPeriodicWave):
2990         (WebCore::AudioContext::willBeginPlayback):
2991         (WebCore::AudioContext::startRendering):
2992         (WebCore::AudioContext::fireCompletionEvent):
2993         (WebCore::AudioContext::logChannel const):
2994         * Modules/webaudio/AudioContext.h:
2995         (WebCore::AudioContext::nextAudioNodeLogIdentifier):
2996         (WebCore::AudioContext::nextAudioParameterLogIdentifier):
2997         * Modules/webaudio/AudioDestinationNode.cpp:
2998         (WebCore::AudioDestinationNode::AudioDestinationNode):
2999         * Modules/webaudio/AudioNode.cpp:
3000         (WebCore::convertEnumerationToString):
3001         (WebCore::AudioNode::AudioNode):
3002         (WebCore::AudioNode::~AudioNode):
3003         (WebCore::AudioNode::setNodeType):
3004         (WebCore::AudioNode::addInput):
3005         (WebCore::AudioNode::addOutput):
3006         (WebCore::AudioNode::connect):
3007         (WebCore::AudioNode::disconnect):
3008         (WebCore::AudioNode::setChannelCount):
3009         (WebCore::AudioNode::setChannelCountMode):
3010         (WebCore::AudioNode::setChannelInterpretation):
3011         (WebCore::AudioNode::logChannel const):
3012         * Modules/webaudio/AudioNode.h:
3013         (WTF::LogArgument<WebCore::AudioNode::NodeType>::toString):
3014         * Modules/webaudio/AudioParam.cpp:
3015         (WebCore::AudioParam::AudioParam):
3016         (WebCore::AudioParam::setValue):
3017         (WebCore::AudioParam::connect):
3018         (WebCore::AudioParam::disconnect):
3019         (WebCore::AudioParam::logChannel const):
3020         * Modules/webaudio/AudioParam.h:
3021         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3022         (WebCore::AudioScheduledSourceNode::start):
3023         (WebCore::AudioScheduledSourceNode::stop):
3024         * Modules/webaudio/BiquadFilterNode.cpp:
3025         (WebCore::BiquadFilterNode::BiquadFilterNode):
3026         * Modules/webaudio/ChannelMergerNode.cpp:
3027         (WebCore::ChannelMergerNode::ChannelMergerNode):
3028         * Modules/webaudio/ChannelSplitterNode.cpp:
3029         (WebCore::ChannelSplitterNode::ChannelSplitterNode):
3030         * Modules/webaudio/ConvolverNode.cpp:
3031         (WebCore::ConvolverNode::ConvolverNode):
3032         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
3033         (WebCore::DefaultAudioDestinationNode::initialize):
3034         (WebCore::DefaultAudioDestinationNode::uninitialize):
3035         (WebCore::DefaultAudioDestinationNode::enableInput):
3036         (WebCore::DefaultAudioDestinationNode::setChannelCount):
3037         * Modules/webaudio/DelayNode.cpp:
3038         (WebCore::DelayNode::DelayNode):
3039         * Modules/webaudio/DynamicsCompressorNode.cpp:
3040         (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
3041         * Modules/webaudio/GainNode.cpp:
3042         (WebCore::GainNode::GainNode):
3043         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3044         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
3045         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
3046         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
3047         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
3048         (WebCore::OfflineAudioDestinationNode::startRendering):
3049         * Modules/webaudio/OscillatorNode.cpp:
3050         (WebCore::OscillatorNode::setType):
3051         (WebCore::OscillatorNode::setPeriodicWave):
3052         * Modules/webaudio/OscillatorNode.h:
3053         (WTF::LogArgument<WebCore::OscillatorNode::Type>::toString):
3054         * Modules/webaudio/PannerNode.cpp:
3055         (WebCore::PannerNode::PannerNode):
3056         * Modules/webaudio/ScriptProcessorNode.cpp:
3057         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
3058         * Modules/webaudio/WaveShaperNode.cpp:
3059         (WebCore::WaveShaperNode::WaveShaperNode):
3060         (WebCore::WaveShaperNode::setCurve):
3061         (WebCore::WaveShaperNode::setOversample):
3062         * Modules/webaudio/WaveShaperNode.h:
3063         (WTF::LogArgument<WebCore::WaveShaperNode::OverSampleType>::toString):
3064
3065 2019-03-11  Youenn Fablet  <youenn@apple.com>
3066
3067         Make IDBDatabaseIdentifier take a ClientOrigin as member
3068         https://bugs.webkit.org/show_bug.cgi?id=195544
3069
3070         Reviewed by Geoffrey Garen.
3071
3072         Instead of taking a top and a frame origin, make
3073         make IDBDatabaseIdentifier take a ClientOrigin.
3074
3075         This allows reusing some ClientOrigin code
3076         and will ease implementation of storage quota checking in
3077         NetworkProcess, as quota managers are keyed by client origins.
3078
3079         No change of behavior.
3080
3081         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
3082         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
3083         (WebCore::IDBDatabaseIdentifier::isolatedCopy const):
3084         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
3085         (WebCore::IDBDatabaseIdentifier::debugString const):
3086         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3087         (WebCore::IDBDatabaseIdentifier::hash const):
3088         (WebCore::IDBDatabaseIdentifier::operator== const):
3089         (WebCore::IDBDatabaseIdentifier::origin const):
3090         (WebCore::IDBDatabaseIdentifier::isRelatedToOrigin const):
3091         (WebCore::IDBDatabaseIdentifier::encode const):
3092         (WebCore::IDBDatabaseIdentifier::decode):
3093         * page/ClientOrigin.h:
3094         (WebCore::ClientOrigin::isRelated const):
3095
3096 2019-03-11  Zan Dobersek  <zdobersek@igalia.com>
3097
3098         Unreviewed. Manually rolling out r242701 and r242703 since the changes
3099         are causing test timeouts and crashes on GTK and WPE.
3100
3101         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3102         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3103         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3104         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3105         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
3106         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
3107         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3108         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3109         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer):
3110         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
3111         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
3112         (): Deleted.
3113
3114 2019-03-11  Jer Noble  <jer.noble@apple.com>
3115
3116         Use AVContentKeySession for "com.apple.fps.2_0" CDM version when AVStreamSession is absent
3117         https://bugs.webkit.org/show_bug.cgi?id=195462
3118         <rdar://problem/48712306>
3119
3120         Reviewed by Eric Carlson.
3121
3122         The difference between "com.apple.fps.2_0" and "3_0" is a protocol difference more than an
3123         implementation difference. In "2_0", the "EME nitialization" data comes in the form of a "content
3124         identifier", while the true initialization data is retrieved through a side channel directly from
3125         the attached element. In "3_0", the "EME initialization data" is the exact initialization data
3126         given by the parser, with no "content identifier" at all.
3127
3128         In the original implementation, the "2_0" used AVStreamSession, and "3_0" used AVContentKeySession,
3129         but in the absense of AVStreamSession, those protocol differences are minor and can be implemented
3130         using AVContentKeySession.
3131
3132         Changes:
3133
3134         - Add a new helper struct in CDMPrivateMediaSourceAVFObjC that represents the parsed parameters
3135           of the CDM string.
3136         - Add an "initData()" accessor to SourceBufferPrivateAVFObjC so that the "2_0" path can implement
3137           the side channel access to the necessary initialization data.
3138         - Refactor some of the SPI code to not re-declare unnecessary APIs.
3139         - In CDMSessionAVContentKeySession::generateKeyRequest(), this function can never be called twice
3140           so it is a logical impossibility to have a certificate at this point. Remove all this if() code.
3141
3142         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
3143         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
3144         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
3145         (WebCore::CDMPrivateMediaSourceAVFObjC::parseKeySystem):
3146         (WebCore::queryDecoderAvailability):
3147         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
3148         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
3149         (WebCore::validKeySystemRE): Deleted.
3150         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
3151         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3152         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
3153         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
3154         (WebCore::CDMSessionAVContentKeySession::update):
3155         (WebCore::CDMSessionAVContentKeySession::addParser):
3156         (WebCore::CDMSessionAVContentKeySession::removeParser):
3157         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3158         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
3159         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3160         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
3161         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3162         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3163         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
3164         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3165         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3166         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3167
3168 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
3169
3170         Unreviewed, rolling out r242688, r242643, r242624.
3171
3172         Caused multiple layout test failures and crashes on iOS and macOS.
3173
3174         Reverted changeset:
3175
3176         "requestAnimationFrame should execute before the next frame"
3177         https://bugs.webkit.org/show_bug.cgi?id=177484
3178         https://trac.webkit.org/changeset/242624/webkit
3179
3180         * Sources.txt:
3181         * WebCore.xcodeproj/project.pbxproj:
3182         * accessibility/mac/AXObjectCacheMac.mm:
3183         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
3184         * animation/DocumentAnimationScheduler.cpp: Added.
3185         (WebCore::DocumentAnimationScheduler::create):
3186         (WebCore::DocumentAnimationScheduler::DocumentAnimationScheduler):
3187         (WebCore::DocumentAnimationScheduler::detachFromDocument):
3188         (WebCore::DocumentAnimationScheduler::scheduleWebAnimationsResolution):
3189         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution):
3190         (WebCore::DocumentAnimationScheduler::scheduleScriptedAnimationResolution):
3191         (WebCore::DocumentAnimationScheduler::displayRefreshFired):
3192         (WebCore::DocumentAnimationScheduler::windowScreenDidChange):
3193         (WebCore::DocumentAnimationScheduler::createDisplayRefreshMonitor const):
3194         * animation/DocumentAnimationScheduler.h: Renamed from Source/WebCore/page/RenderingUpdateScheduler.h.
3195         (WebCore::DocumentAnimationScheduler::lastTimestamp):
3196         (WebCore::DocumentAnimationScheduler::isFiring const):
3197         * animation/DocumentTimeline.cpp:
3198         (WebCore::DocumentTimeline::DocumentTimeline):
3199         (WebCore::DocumentTimeline::updateThrottlingState):
3200         (WebCore::DocumentTimeline::suspendAnimations):
3201         (WebCore::DocumentTimeline::resumeAnimations):
3202         (WebCore::DocumentTimeline::liveCurrentTime const):
3203         (WebCore::DocumentTimeline::currentTime):
3204         (WebCore::DocumentTimeline::cacheCurrentTime):
3205         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded):
3206         (WebCore::DocumentTimeline::animationTimingDidChange):
3207         (WebCore::DocumentTimeline::scheduleAnimationResolution):
3208         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
3209         (WebCore::DocumentTimeline::animationResolutionTimerFired):
3210         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
3211         (WebCore::DocumentTimeline::scheduleNextTick):
3212         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
3213         (WebCore::DocumentTimeline::resolveAnimationsForElement):
3214         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Deleted.
3215         * animation/DocumentTimeline.h:
3216         * dom/Document.cpp:
3217         (WebCore::Document::resolveStyle):
3218         (WebCore::Document::prepareForDestruction):
3219         (WebCore::Document::windowScreenDidChange):
3220         (WebCore::Document::updateIntersectionObservations):
3221         (WebCore::Document::scheduleForcedIntersectionObservationUpdate):
3222         (WebCore::Document::animationScheduler):
3223         (WebCore::Document::updateAnimationsAndSendEvents): Deleted.
3224         (WebCore::Document::serviceRequestAnimationFrameCallbacks): Deleted.
3225         * dom/Document.h:
3226         * dom/ScriptedAnimationController.cpp:
3227         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3228         (WebCore::ScriptedAnimationController::scheduleAnimation):
3229         (WebCore::ScriptedAnimationController::animationTimerFired):
3230         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):
3231         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): Deleted.
3232         * dom/ScriptedAnimationController.h:
3233         * page/FrameView.cpp:
3234         (WebCore::FrameView::viewportContentsChanged):
3235         * page/IntersectionObserver.cpp:
3236         (WebCore::IntersectionObserver::observe):
3237         * page/Page.cpp:
3238         (WebCore::Page::Page):
3239         (WebCore::Page::willDisplayPage):
3240         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate):
3241         (WebCore::Page::updateIntersectionObservations):
3242         (WebCore::Page::scheduleForcedIntersectionObservationUpdate):
3243         (WebCore::Page::layoutIfNeeded): Deleted.
3244         (WebCore::Page::renderingUpdate): Deleted.
3245         (WebCore::Page::renderingUpdateScheduler): Deleted.
3246         * page/Page.h:
3247         * page/PageOverlayController.cpp:
3248         (WebCore::PageOverlayController::didChangeViewExposedRect):
3249         (WebCore::PageOverlayController::notifyFlushRequired):
3250         * page/RenderingUpdateScheduler.cpp: Removed.
3251         * page/ios/ContentChangeObserver.h:
3252         * page/mac/ServicesOverlayController.mm:
3253         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
3254         * rendering/RenderLayerCompositor.cpp:
3255         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
3256
3257 2019-03-11  Darin Adler  <darin@apple.com>
3258
3259         Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
3260         https://bugs.webkit.org/show_bug.cgi?id=195533
3261
3262         Reviewed by Brent Fulgham.
3263
3264         * accessibility/AccessibilityNodeObject.cpp:
3265         (WebCore::AccessibilityNodeObject::changeValueByStep): Use numberToStringFixedPrecision.
3266         (WebCore::AccessibilityNodeObject::changeValueByPercent): Ditto.
3267         * accessibility/AccessibilityScrollbar.cpp:
3268         (WebCore::AccessibilityScrollbar::setValue): Ditto.
3269         * css/CSSFontVariationValue.cpp:
3270         (WebCore::CSSFontVariationValue::customCSSText const): Use appendFixedPrecisionNumber.
3271         * css/CSSGradientValue.cpp:
3272         (WebCore::CSSLinearGradientValue::customCSSText const): Ditto.
3273         (WebCore::CSSRadialGradientValue::customCSSText const): Ditto.
3274         * css/CSSKeyframeRule.cpp:
3275         (WebCore::StyleRuleKeyframe::keyText const): Ditto.
3276         * css/CSSTimingFunctionValue.cpp:
3277         (WebCore::CSSCubicBezierTimingFunctionValue::customCSSText const): Ditto.
3278         (WebCore::CSSSpringTimingFunctionValue::customCSSText const): Ditto.
3279         * css/parser/CSSParserToken.cpp:
3280         (WebCore::CSSParserToken::serialize const): Ditto.
3281         * html/HTMLImageElement.cpp:
3282         (WebCore::HTMLImageElement::completeURLsInAttributeValue const): Ditto.
3283         * inspector/InspectorOverlay.cpp:
3284         (WebCore::InspectorOverlay::drawRulers): Use numberToStringFixedPrecision.
3285         * loader/ResourceLoadStatistics.cpp:
3286         (WebCore::ResourceLoadStatistics::toString const): Use appendFixedPrecisionNumber.
3287         * page/PrintContext.cpp:
3288         (WebCore::PrintContext::pageProperty): Use numberToStringFixedPrecision.
3289         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3290         (WebCore::gcTimerString): Use numberToStringFixedPrecision.
3291         * platform/LayoutUnit.h:
3292         (WTF::ValueToString<WebCore::LayoutUnit>::string): Ditto.
3293         * platform/graphics/Color.cpp:
3294         (WebCore::Color::cssText const): Use appendFixedPrecisionNumber.
3295         * platform/graphics/ExtendedColor.cpp:
3296         (WebCore::ExtendedColor::cssText const): Ditto.
3297         * svg/SVGAngleValue.cpp:
3298         (WebCore::SVGAngleValue::valueAsString const): Use numberToStringFixedPrecision.
3299         * svg/SVGNumberListValues.cpp:
3300         (WebCore::SVGNumberListValues::valueAsString const): Use appendFixedPrecisionNumber.
3301         * svg/SVGPathStringBuilder.cpp:
3302         (WebCore::appendNumber): Ditto.
3303         (WebCore::appendPoint): Ditto.
3304         * svg/SVGPointListValues.cpp:
3305         (WebCore::SVGPointListValues::valueAsString const): Ditto.
3306         * svg/SVGTransformValue.cpp:
3307         (WebCore::SVGTransformValue::valueAsString const): Ditto.
3308         * svg/properties/SVGPropertyTraits.h:
3309         (WebCore::SVGPropertyTraits<float>::toString): Use numberToStringFixedPrecision.
3310         (WebCore::SVGPropertyTraits<FloatPoint>::toString): Use appendFixedPrecisionNumber.
3311         (WebCore::SVGPropertyTraits<FloatRect>::toString): Ditto.
3312         * testing/Internals.cpp:
3313         (WebCore::Internals::dumpMarkerRects): Use appendFixedPrecisionNumber.
3314         (WebCore::Internals::getCurrentCursorInfo): Ditto.
3315         * xml/XPathValue.cpp:
3316         (WebCore::XPath::Value::toString const): Use numberToStringFixedPrecision.
3317
3318 2019-03-11  Philippe Normand  <pnormand@igalia.com>
3319
3320         Unreviewed, Non-GStreamer-GL build fix after r242701.
3321
3322         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3323         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3324
3325 2019-03-11  Philippe Normand  <pnormand@igalia.com>
3326
3327         [GStreamer][v4l2] Synchronous video texture flushing support
3328         https://bugs.webkit.org/show_bug.cgi?id=195453
3329
3330         Reviewed by Xabier Rodriguez-Calvar.
3331
3332         The v4l2 video decoder currently requires that downstream users of
3333         the graphics resources complete any pending draw call and release
3334         resources before returning from the DRAIN query.
3335
3336         To accomplish this the player monitors the pipeline and whenever a
3337         v4l2 decoder is added, synchronous video texture flushing support
3338         is enabled. Additionally and for all decoder configurations, a
3339         flush is performed before disposing of the player.
3340
3341         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3342         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
3343         Monitor elements added to the decodebin bin.
3344         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
3345         a flag if a v4l2 decoder was added in decodebin.
3346         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
3347         to the deep-element-added signal so as to monitor pipeline
3348         topology updates.
3349         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3350         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3351         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3352         Flush video texture before disposing of the player.
3353         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
3354         Synchronously flush if the pipeline contains a v4l2 decoder.
3355         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
3356         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3357         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3358         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
3359         boolean flag used mostly to trigger synchronous flush conditions.
3360         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
3361         Optionally drop the current buffer in a synchronous manner. By
3362         default the method keeps operating asynchronously.
3363         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
3364
3365 2019-03-11  Antti Koivisto  <antti@apple.com>
3366
3367         Rename contentOffsetInCompostingLayer to contentOffsetInCompositingLayer
3368         https://bugs.webkit.org/show_bug.cgi?id=195553
3369
3370         Reviewed by Simon Fraser.
3371
3372         Less composting, more compositing.
3373
3374         * rendering/RenderLayerBacking.cpp:
3375         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
3376         (WebCore::RenderLayerBacking::resetContentsRect):
3377         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
3378         (WebCore::RenderLayerBacking::updateImageContents):
3379         (WebCore::RenderLayerBacking::contentOffsetInCompositingLayer const):
3380         (WebCore::RenderLayerBacking::contentsBox const):
3381         (WebCore::RenderLayerBacking::backgroundBoxForSimpleContainerPainting const):
3382         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer const): Deleted.
3383         * rendering/RenderLayerBacking.h:
3384
3385 2019-03-10  Ross Kirsling  <ross.kirsling@sony.com>
3386
3387         Invalid flags in a RegExp literal should be an early SyntaxError
3388         https://bugs.webkit.org/show_bug.cgi?id=195514
3389
3390         Reviewed by Darin Adler.
3391
3392         * bindings/js/SerializedScriptValue.cpp:
3393         (WebCore::CloneDeserializer::readTerminal):
3394         Consume YarrFlags.
3395
3396 2019-03-10  Tim Horton  <timothy_horton@apple.com>
3397
3398         Add SPI to retrieve the set of text inputs in a given rect, and later focus one
3399         https://bugs.webkit.org/show_bug.cgi?id=195499
3400
3401         Reviewed by Darin Adler.
3402
3403         New API tests: WebKit.RequestTextInputContext and WebKit.FocusTextInputContext
3404
3405         * WebCore.xcodeproj/project.pbxproj: