da8d03702e7495288688f66dfe3c4071e4a8fddb
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-08  Eric Liang  <ericliang@apple.com>
2
3         When performing AXPress, check to see if the menu list is disabled.
4         https://bugs.webkit.org/show_bug.cgi?id=193878
5
6         Reviewed by Chris Fleizach.
7
8         Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
9
10         * accessibility/AXObjectCache.h:
11         * accessibility/AccessibilityMenuList.cpp:
12         (WebCore::AccessibilityMenuList::press):
13         * accessibility/mac/AXObjectCacheMac.mm:
14         (WebCore::AXObjectCache::postPlatformNotification):
15
16 2019-02-07  Devin Rousso  <drousso@apple.com>
17
18         PseudoElement created for any ::before/::after selector regardless of whether a content property exists
19         https://bugs.webkit.org/show_bug.cgi?id=194423
20         <rdar://problem/46787260>
21
22         Reviewed by Antti Koivisto.
23
24         Test: inspector/css/pseudo-creation.html
25
26         * style/StyleTreeResolver.cpp:
27         (WebCore::Style::TreeResolver::resolvePseudoStyle):
28         We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
29         `PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
30         that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.
31
32 2019-02-07  Chris Dumez  <cdumez@apple.com>
33
34         Mark more heap-allocated classes as fast allocated
35         https://bugs.webkit.org/show_bug.cgi?id=194422
36
37         Reviewed by Ryosuke Niwa.
38
39         * Modules/applepay/PaymentCoordinator.h:
40         * Modules/beacon/NavigatorBeacon.h:
41         * Modules/cache/DOMWindowCaches.h:
42         * Modules/cache/WorkerGlobalScopeCaches.h:
43         * Modules/credentialmanagement/NavigatorCredentials.h:
44         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
45         * Modules/gamepad/NavigatorGamepad.h:
46         * Modules/indexeddb/IDBGetAllResult.h:
47         * Modules/indexeddb/IDBGetResult.h:
48         * Modules/indexeddb/IDBKeyData.h:
49         * Modules/indexeddb/IDBValue.h:
50         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
51         * Modules/indexeddb/server/IndexValueEntry.h:
52         * Modules/indexeddb/server/IndexValueStore.h:
53         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
54         * Modules/indexeddb/server/MemoryCursor.h:
55         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
56         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
57         * Modules/indexeddb/server/SQLiteIDBCursor.h:
58         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
59         * Modules/indexeddb/server/UniqueIDBDatabase.h:
60         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
61         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
62         * Modules/indexeddb/shared/IDBTransactionInfo.h:
63         * Modules/mediacapabilities/NavigatorMediaCapabilities.h:
64         * Modules/mediasession/WebMediaSessionManager.cpp:
65         * Modules/mediastream/NavigatorMediaDevices.h:
66         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
67         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
68         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
69         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
70         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
71         * Modules/quota/DOMWindowQuota.h:
72         * Modules/quota/NavigatorStorageQuota.h:
73         * Modules/quota/WorkerNavigatorStorageQuota.h:
74         * Modules/speech/DOMWindowSpeechSynthesis.h:
75         * Modules/webaudio/BiquadProcessor.h:
76         * Modules/webaudio/DelayProcessor.h:
77         * Modules/webauthn/fido/FidoHidPacket.h:
78         * Modules/webdriver/NavigatorWebDriver.h:
79         * Modules/webgpu/DOMWindowWebGPU.h:
80         * Modules/websockets/WebSocketChannel.h:
81         * Modules/webvr/NavigatorWebVR.h:
82         * accessibility/AXObjectCache.h:
83         * bindings/js/DOMGCOutputConstraint.h:
84         * bindings/js/DOMPromiseProxy.h:
85         * bridge/c/c_runtime.h:
86         * contentextensions/CombinedURLFilters.cpp:
87         * crypto/CryptoAlgorithmParameters.h:
88         * css/CSSComputedStyleDeclaration.h:
89         * css/CSSRegisteredCustomProperty.h:
90         * css/DOMCSSPaintWorklet.h:
91         * css/DOMCSSRegisterCustomProperty.h:
92         * css/StyleRule.h:
93         * dom/ConstantPropertyMap.h:
94         * dom/CustomElementReactionQueue.h:
95         * dom/Document.h:
96         * dom/GenericEventQueue.h:
97         * dom/RejectedPromiseTracker.h:
98         * dom/UserGestureIndicator.h:
99         * editing/ReplaceSelectionCommand.cpp:
100         * editing/SelectionRectGatherer.h:
101         * editing/TextIterator.h:
102         * editing/cocoa/HTMLConverter.mm:
103         * fileapi/AsyncFileStream.cpp:
104         * fileapi/AsyncFileStream.h:
105         * html/forms/FileIconLoader.h:
106         * html/parser/HTMLTreeBuilder.h:
107         * html/track/WebVTTParser.h:
108         * inspector/DOMPatchSupport.cpp:
109         * loader/FrameLoaderClient.h:
110         * loader/WorkerThreadableLoader.cpp:
111         * page/IntersectionObserver.h:
112         * page/PerformanceMonitor.h:
113         * page/PerformanceUserTiming.h:
114         * page/PrintContext.h:
115         * page/ValidationMessageClient.h:
116         * platform/ColorChooser.h:
117         * platform/ControlStates.h:
118         * platform/DataListSuggestionPicker.h:
119         * platform/FileStream.h:
120         * platform/KeyedCoding.h:
121         * platform/LowPowerModeNotifier.h:
122         * platform/PlatformSpeechSynthesizer.h:
123         * platform/WebGLStateTracker.h:
124         * platform/audio/AudioArray.h:
125         * platform/audio/AudioDestination.h:
126         * platform/audio/DownSampler.h:
127         * platform/audio/DynamicsCompressor.h:
128         * platform/audio/FFTFrame.h:
129         * platform/audio/HRTFDatabase.h:
130         * platform/audio/MultiChannelResampler.h:
131         * platform/audio/Panner.h:
132         * platform/audio/Reverb.h:
133         * platform/audio/ReverbConvolver.h:
134         * platform/audio/ReverbConvolverStage.h:
135         * platform/audio/UpSampler.h:
136         * platform/audio/mac/AudioSessionMac.cpp:
137         * platform/audio/mac/CAAudioStreamDescription.h:
138         * platform/audio/mac/CARingBuffer.h:
139         * platform/cocoa/ScrollSnapAnimatorState.h:
140         * platform/gamepad/PlatformGamepad.h:
141         * platform/graphics/GraphicsLayer.cpp:
142         * platform/graphics/GraphicsLayerFactory.h:
143         * platform/graphics/PlatformTimeRanges.h:
144         * platform/graphics/TextTrackRepresentation.h:
145         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
146         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
147         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
148         * platform/graphics/displaylists/DisplayListRecorder.h:
149         * platform/network/cocoa/WebCoreNSURLSession.mm:
150         * platform/sql/SQLiteDatabase.h:
151         * platform/text/TextCodecICU.h:
152         * rendering/GridBaselineAlignment.h:
153         * rendering/GridTrackSizingAlgorithm.h:
154         * rendering/RenderObject.h:
155         * rendering/style/GridArea.h:
156         * workers/service/context/SWContextManager.h:
157
158 2019-02-07  Justin Fan  <justin_fan@apple.com>
159
160         [Web GPU] GPUDevice::createTexture implementation prototype
161         https://bugs.webkit.org/show_bug.cgi?id=194409
162         <rdar://problem/47894312>
163
164         Reviewed by Myles C. Maxfield.
165
166         Test: textures-textureviews.html updated to test new functionality.
167
168         Implement GPUDevice::createTexture():
169         * Modules/webgpu/WebGPUDevice.cpp:
170         (WebCore::WebGPUDevice::createTexture const):
171         * Modules/webgpu/WebGPUDevice.h:
172         * Modules/webgpu/WebGPUDevice.idl:
173         * Modules/webgpu/WebGPUTexture.cpp:
174         (WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
175         (WebCore::WebGPUTexture::WebGPUTexture):
176         * Modules/webgpu/WebGPUTexture.h:
177
178         Metal backend MTLTextureDescriptor and MTLTexture creation:
179         * platform/graphics/gpu/GPUDevice.cpp:
180         (WebCore::GPUDevice::tryCreateTexture const):
181         * platform/graphics/gpu/GPUDevice.h:
182         * platform/graphics/gpu/GPUTexture.h:
183         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
184         (WebCore::mtlTextureTypeForGPUTextureDescriptor):
185         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
186         (WebCore::storageModeForPixelFormatAndSampleCount):
187         (WebCore::tryCreateMtlTextureDescriptor):
188         (WebCore::GPUTexture::tryCreate):
189         (WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.
190
191         Add GPUUtils.h/cpp for shared utility functions:
192         * SourcesCocoa.txt:
193         * WebCore.xcodeproj/project.pbxproj:
194         * platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
195         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
196         (WebCore::GPUSwapChain::setFormat):
197         (WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
198         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
199         (WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.
200
201 2019-02-07  Sihui Liu  <sihui_liu@apple.com>
202
203         REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
204         https://bugs.webkit.org/show_bug.cgi?id=194402
205         <rdar://problem/47858241>
206
207         Reviewed by Geoffrey Garen.
208
209         r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
210         around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
211         is valid during access.
212
213         * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
214         (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
215         (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
216         * Modules/indexeddb/server/ServerOpenDBRequest.h:
217
218 2019-02-07  Timothy Hatcher  <timothy@apple.com>
219
220         Overflow element scrollbar is light for dark mode content.
221         https://bugs.webkit.org/show_bug.cgi?id=194407
222         rdar://problem/45991585
223
224         Reviewed by Beth Dakin.
225
226         Tested by css-dark-mode/supported-color-schemes-scrollbar.html.
227
228         * page/ChromeClient.h:
229         (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
230         short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
231         that do not implement preferredScrollbarOverlayStyle().
232         * page/FrameView.cpp:
233         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
234         to auto detect overlay style when page() is null.
235         * rendering/RenderLayer.cpp:
236         (WebCore::RenderLayer::useDarkAppearance const): Added.
237         * rendering/RenderLayer.h:
238         * testing/Internals.cpp:
239         (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
240         (WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
241         * testing/Internals.h:
242         * testing/Internals.idl:
243
244 2019-02-07  Eric Carlson  <eric.carlson@apple.com>
245
246         [MSE] Convert debug-only logging to runtime logging
247         https://bugs.webkit.org/show_bug.cgi?id=194348
248         <rdar://problem/47566449>
249
250         Reviewed by Jer Noble.
251
252         No new tests, this just changes existing logging.
253
254         * Modules/mediasource/MediaSource.cpp:
255         (WebCore::convertEnumerationToString):
256         (WebCore::MediaSource::MediaSource):
257         (WebCore::MediaSource::~MediaSource):
258         (WebCore::MediaSource::setPrivateAndOpen):
259         (WebCore::MediaSource::addedToRegistry):
260         (WebCore::MediaSource::removedFromRegistry):
261         (WebCore::MediaSource::durationChanged):
262         (WebCore::MediaSource::seekToTime):
263         (WebCore::MediaSource::completeSeek):
264         (WebCore::MediaSource::setLiveSeekableRange):
265         (WebCore::MediaSource::clearLiveSeekableRange):
266         (WebCore::MediaSource::setDuration):
267         (WebCore::MediaSource::setDurationInternal):
268         (WebCore::MediaSource::setReadyState):
269         (WebCore::MediaSource::endOfStream):
270         (WebCore::MediaSource::streamEndedWithError):
271         (WebCore::MediaSource::addSourceBuffer):
272         (WebCore::MediaSource::removeSourceBuffer):
273         (WebCore::MediaSource::isTypeSupported):
274         (WebCore::MediaSource::detachFromElement):
275         (WebCore::MediaSource::attachToElement):
276         (WebCore::MediaSource::openIfInEndedState):
277         (WebCore::MediaSource::suspend):
278         (WebCore::MediaSource::resume):
279         (WebCore::MediaSource::stop):
280         (WebCore::MediaSource::onReadyStateChange):
281         (WebCore::MediaSource::scheduleEvent):
282         (WebCore::MediaSource::logChannel const):
283         (WebCore::MediaSourceInternal::toString): Deleted.
284         * Modules/mediasource/MediaSource.h:
285         (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
286         (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
287         * Modules/mediasource/SourceBuffer.cpp:
288         (WebCore::SourceBuffer::SourceBuffer):
289         (WebCore::SourceBuffer::~SourceBuffer):
290         (WebCore::SourceBuffer::remove):
291         (WebCore::SourceBuffer::seekToTime):
292         (WebCore::SourceBuffer::appendBufferInternal):
293         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
294         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
295         (WebCore::removeSamplesFromTrackBuffer):
296         (WebCore::SourceBuffer::removeCodedFrames):
297         (WebCore::SourceBuffer::evictCodedFrames):
298         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
299         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
300         (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
301         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
302         (WebCore::SourceBuffer::provideMediaData):
303         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
304         (WebCore::SourceBuffer::monitorBufferingRate):
305         (WebCore::SourceBuffer::logChannel const):
306         * Modules/mediasource/SourceBuffer.h:
307         * dom/Document.cpp:
308         (WebCore::messageSourceForWTFLogChannel):
309         (WebCore::Document::didLogMessage):
310         * html/HTMLMediaElement.cpp:
311         (WebCore::convertEnumerationToString):
312         (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
313         (WebCore::HTMLMediaElement::selectMediaResource):
314         (WebCore::HTMLMediaElement::loadResource):
315         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
316         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
317         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
318         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
319         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
320         * platform/ContentType.cpp:
321         (WebCore::ContentType::toJSONString const):
322         * platform/ContentType.h:
323         (WTF::LogArgument<WebCore::ContentType>::toString):
324         * platform/MediaSample.h:
325         (WebCore::MediaSample::toJSONString const):
326         (WTF::LogArgument<WebCore::MediaSample>::toString):
327         * platform/graphics/FloatSize.cpp:
328         (WebCore::FloatSize::toJSONObject const):
329         (WebCore::FloatSize::toJSONString const):
330         * platform/graphics/FloatSize.h:
331         (WTF::LogArgument<WebCore::FloatSize>::toString):
332         * platform/graphics/MediaSourcePrivate.h:
333         (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
334         (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
335         (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
336         * platform/graphics/SourceBufferPrivate.h:
337         (WebCore::SourceBufferPrivate::sourceBufferLogger const):
338         (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
339         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
340         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
341         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
342         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
343         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
344         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
345         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
346         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
347         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
348         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
349         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
350         (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
351         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
352         (WebCore::convertEnumerationToString):
353         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
354         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
355         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
356         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
357         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
358         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
359         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
360         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
361         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
362         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
363         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
364         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
365         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
366         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
367         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
368         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
369         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
370         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
371         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
372         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
373         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
374         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
375         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
376         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
377         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
378         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
379         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
380         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
381         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
382         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
383         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
384         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
385         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
386         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
387         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
388         (WebCore::MediaSampleAVFObjC::toJSONString const):
389         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
390         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
391         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
392         (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
393         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
394         (WebCore::MediaSourcePrivateAVFObjC::logChannel const):
395         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
396         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
397         (WebCore::bufferWasConsumedCallback):
398         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
399         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
400         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
401         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
402         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
403         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
404         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
405         (WebCore::SourceBufferPrivateAVFObjC::append):
406         (WebCore::SourceBufferPrivateAVFObjC::abort):
407         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
408         (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
409         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
410         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
411         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
412         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
413         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
414         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
415         (WebCore::SourceBufferPrivateAVFObjC::flush):
416         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
417         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
418         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
419         (WebCore::SourceBufferPrivateAVFObjC::setActive):
420         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
421         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
422         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
423         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
424         (WebCore::SourceBufferPrivateAVFObjC::logChannel const):
425
426 2019-02-07  Youenn Fablet  <youenn@apple.com>
427
428         Simplify applyConstraints callbacks
429         https://bugs.webkit.org/show_bug.cgi?id=194297
430
431         Reviewed by Eric Carlson.
432
433         Make use of one callback for both success and failure cases.
434         No changed of behavior.
435
436         * Modules/mediastream/MediaStreamTrack.cpp:
437         (WebCore::MediaStreamTrack::applyConstraints):
438         * platform/mediastream/MediaStreamTrackPrivate.cpp:
439         (WebCore::MediaStreamTrackPrivate::applyConstraints):
440         * platform/mediastream/MediaStreamTrackPrivate.h:
441         * platform/mediastream/RealtimeMediaSource.cpp:
442         (WebCore::RealtimeMediaSource::applyConstraints):
443         * platform/mediastream/RealtimeMediaSource.h:
444         * platform/mediastream/mac/AVVideoCaptureSource.mm:
445         (WebCore::AVVideoCaptureSource::create):
446         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
447         (WebCore::CoreAudioCaptureSource::create):
448         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
449         (WebCore::MockGStreamerAudioCaptureSource::applyConstraints):
450         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
451         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
452         (WebCore::MockGStreamerVideoCaptureSource::applyConstraints):
453         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
454
455 2019-02-07  Youenn Fablet  <youenn@apple.com>
456
457         Unable to sign in leetcode.
458         https://bugs.webkit.org/show_bug.cgi?id=194366
459         rdar://problem/47259025.
460
461         Reviewed by Chris Dumez.
462
463         In case a signal is passed as part of a FetchRequestInit,
464         the IDL binding code is throwing an exception in case signal is not an AbortSignal object.
465         This breaks an AbortSignal shim used in some web sites.
466         Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest.
467
468         Test: http/wpt/fetch/request-abort.html
469         Also covered by manually signing in to leetcode.
470
471         * Modules/fetch/FetchRequest.cpp:
472         (WebCore::FetchRequest::initializeWith):
473         * Modules/fetch/FetchRequestInit.h:
474         (WebCore::FetchRequestInit::hasMembers const):
475         * Modules/fetch/FetchRequestInit.idl:
476
477 2019-02-07  Youenn Fablet  <youenn@apple.com>
478
479         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
480         https://bugs.webkit.org/show_bug.cgi?id=194312
481
482         Reviewed by Eric Carlson.
483
484         Add a way for sources to know when they are ended, i.e. that they will never be started again.
485         No observable change of behavior.
486
487         * platform/mediastream/RealtimeMediaSource.cpp:
488         (WebCore::RealtimeMediaSource::requestStop):
489         * platform/mediastream/RealtimeMediaSource.h:
490
491 2019-02-07  Jer Noble  <jer.noble@apple.com>
492
493         HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class
494         https://bugs.webkit.org/show_bug.cgi?id=194360
495
496         HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should
497         really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement,
498         make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor
499         taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases.
500
501         Reviewed by Geoffrey Garen.
502
503         * Modules/applepay/ApplePaySession.cpp:
504         (WebCore::ApplePaySession::ApplePaySession):
505         * Modules/mediarecorder/MediaRecorder.cpp:
506         (WebCore::MediaRecorder::MediaRecorder):
507         * Modules/mediastream/MediaDevices.cpp:
508         (WebCore::MediaDevices::MediaDevices):
509         * Modules/mediastream/UserMediaRequest.cpp:
510         (WebCore::UserMediaRequest::UserMediaRequest):
511         * Modules/notifications/Notification.cpp:
512         (WebCore::Notification::Notification):
513         * Modules/paymentrequest/PaymentRequest.cpp:
514         (WebCore::PaymentRequest::PaymentRequest):
515         * Modules/webaudio/AudioContext.cpp:
516         (WebCore::AudioContext::AudioContext):
517         * animation/WebAnimation.cpp:
518         (WebCore::WebAnimation::WebAnimation):
519         * css/FontFaceSet.cpp:
520         (WebCore::FontFaceSet::FontFaceSet):
521         * dom/ActiveDOMObject.cpp:
522         (WebCore::ActiveDOMObject::ActiveDOMObject):
523         * dom/ActiveDOMObject.h:
524         * dom/Document.h:
525         (WebCore::ActiveDOMObject::ActiveDOMObject):
526         * html/HTMLMarqueeElement.cpp:
527         (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
528         * html/HTMLMediaElement.cpp:
529         (WebCore::HTMLMediaElement::HTMLMediaElement):
530         * html/HTMLSourceElement.cpp:
531         (WebCore::HTMLSourceElement::HTMLSourceElement):
532         * page/IntersectionObserver.cpp:
533         (WebCore::IntersectionObserver::IntersectionObserver):
534
535 2019-02-07  Zalan Bujtas  <zalan@apple.com>
536
537         [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
538         https://bugs.webkit.org/show_bug.cgi?id=194391
539
540         Reviewed by Antti Koivisto.
541
542         The spec is not clear about this but that's what matches the current behaviour.
543
544         Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
545
546         * layout/FormattingContext.cpp:
547         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
548
549 2019-02-07  Zalan Bujtas  <zalan@apple.com>
550
551         [LFC] Use dedicated data structures for optional used values (input to geometry functions)
552         https://bugs.webkit.org/show_bug.cgi?id=194376
553
554         Reviewed by Antti Koivisto.
555
556         This is in preparation for being able to pass in the containing block's width as an optional used value.
557         During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.
558
559         * layout/FormattingContext.cpp:
560         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
561         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
562         * layout/FormattingContext.h:
563         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
564         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
565         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
566         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
567         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
568         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
569         (): Deleted.
570         (WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
571         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
572         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
573         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
574         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
575         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
576         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
577         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
578         * layout/FormattingContextGeometry.cpp:
579         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
580         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
581         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
582         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
583         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
584         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
585         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
586         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
587         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
588         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
589         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
590         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
591         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
592         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
593         * layout/LayoutUnits.h:
594         * layout/blockformatting/BlockFormattingContext.cpp:
595         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
596         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
597         * layout/blockformatting/BlockFormattingContext.h:
598         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
599         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
600         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
601         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
602         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
603         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
604         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
605         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
606         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
607         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
608         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
609         * layout/inlineformatting/InlineFormattingContext.cpp:
610         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
611         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
612         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
613         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
614         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
615         * page/FrameViewLayoutContext.cpp:
616         (WebCore::layoutUsingFormattingContext):
617
618 2019-02-07  Antti Koivisto  <antti@apple.com>
619
620         Infinite recursion via CachedResource::~CachedResource
621         https://bugs.webkit.org/show_bug.cgi?id=194378
622         <rdar://problem/42023295>
623
624         Reviewed by Daniel Bates.
625
626         I don't know the exact steps to trigger this but the mechanism seems clear.
627
628         1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map.
629         2) This decrements the handle count of resource and causes it be deleted.
630         3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with
631            resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled).
632         4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created.
633            This increments the handle count of the resource from 0 back to 1.
634         5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3).
635
636         The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource.
637         It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles.
638
639         Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource
640         has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything
641         other than bail out is going to crash.
642
643         CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to
644         support this erranous call so they are removed as well.
645
646         * loader/ImageLoader.cpp:
647         (WebCore::ImageLoader::updateFromElement):
648         * loader/cache/CachedResource.cpp:
649         (WebCore::CachedResource::~CachedResource):
650
651         This is the substantive change. The rest just removes now-dead code.
652
653         * loader/cache/CachedResource.h:
654         (WebCore::CachedResource::setOwningCachedResourceLoader): Deleted.
655         * loader/cache/CachedResourceLoader.cpp:
656         (WebCore::CachedResourceLoader::~CachedResourceLoader):
657         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
658         (WebCore::CachedResourceLoader::requestResource):
659         (WebCore::CachedResourceLoader::loadResource):
660         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
661         (WebCore::CachedResourceLoader::removeCachedResource): Deleted.
662         * loader/cache/CachedResourceLoader.h:
663
664 2019-02-07  Miguel Gomez  <magomez@igalia.com>
665
666         [WPE] Implement GStreamer based holepunch
667         https://bugs.webkit.org/show_bug.cgi?id=193715
668
669         Reviewed by Xabier Rodriguez-Calvar.
670
671         Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
672         video sink and drawing then, the player just draws a transparent rectangle on the position where
673         the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
674         sink which will be in charge of displaying the video frames in some way (usually on a plane below
675         the browser), and will push empty frames to the compositor indicating that the rectangle to draw
676         should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
677         to tell the video sink where to position the video so it's set below the browser transparent hole.
678
679         Added ManualTest wpe/video-player-holepunch.html to test the feature.
680
681         * platform/graphics/MediaPlayer.cpp:
682         (WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
683         * platform/graphics/MediaPlayer.h:
684         * platform/graphics/MediaPlayerPrivate.h:
685         (WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
686         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
687         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
688         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
689         (WebCore::setRectangleToVideoSink):
690         (WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
691         (WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
692         (WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
693         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
694         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
695         * platform/graphics/texmap/TextureMapper.h:
696         * platform/graphics/texmap/TextureMapperGL.cpp:
697         (WebCore::TextureMapperGL::drawSolidColor):
698         * platform/graphics/texmap/TextureMapperGL.h:
699         * platform/graphics/texmap/TextureMapperLayer.cpp:
700         (WebCore::TextureMapperLayer::paintSelf):
701         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
702         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
703         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
704         (WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
705         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
706         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
707         * rendering/RenderVideo.cpp:
708         (WebCore::RenderVideo::videoBox const):
709
710 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
711
712         Unreviewed, rolling out r240759 and r240944.
713
714         Some timer uses are done off the main thread, WebCore::Timer
715         cannot be used
716
717         Reverted changesets:
718
719         "<rdar://problem/47570443> Responsiveness timers are too
720         expensive for frequent events"
721         https://bugs.webkit.org/show_bug.cgi?id=194003
722         https://trac.webkit.org/changeset/240759
723
724         "Use deferrable timer to restart the Responsiveness Timer on
725         each wheel event"
726         https://bugs.webkit.org/show_bug.cgi?id=194135
727         https://trac.webkit.org/changeset/240944
728
729 2019-02-06  Keith Rollin  <krollin@apple.com>
730
731         Update .xcfilelist files
732
733         Unreviewed build fix.
734
735         * DerivedSources-input.xcfilelist:
736         * DerivedSources-output.xcfilelist:
737
738 2019-02-06  Devin Rousso  <drousso@apple.com>
739
740         Web Inspector: DOM: don't send the entire function string with each event listener
741         https://bugs.webkit.org/show_bug.cgi?id=194293
742         <rdar://problem/47822809>
743
744         Reviewed by Joseph Pecoraro.
745
746         Test: inspector/dom/getEventListenersForNode.html
747
748         * inspector/agents/InspectorDOMAgent.cpp:
749         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
750
751 2019-02-06  Andy Estes  <aestes@apple.com>
752
753         [Payment Request] It should be possible to require a phonetic name for shipping contacts
754         https://bugs.webkit.org/show_bug.cgi?id=194311
755         <rdar://46733045>
756
757         Reviewed by Alex Christensen.
758
759         It should be possible to require that a shipping contact has a phonetic name in Payment Request.
760         To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
761         ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.
762
763         Since required shipping contact fields can now be specified both in
764         requiredShippingContactFields and PaymentOptions, we merge the required fields from these
765         two sources such that, e.g., email is required if it is specified in either place.
766
767         So that clients can detect this new feature, the API version number is bumped from 5 to 6.
768
769         Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.
770
771         * DerivedSources.make:
772         * Modules/applepay/ApplePayPaymentRequest.h:
773         * Modules/applepay/ApplePayPaymentRequest.idl:
774         * Modules/applepay/ApplePayRequestBase.cpp:
775         (WebCore::convertAndValidate):
776         * Modules/applepay/ApplePayRequestBase.h:
777         * Modules/applepay/ApplePayRequestBase.idl:
778         * Modules/applepay/ApplePaySession.cpp:
779         (WebCore::convertAndValidate):
780         * Modules/applepay/PaymentCoordinatorClient.cpp: Added.
781         (WebCore::PaymentCoordinatorClient::supportsVersion):
782         * Modules/applepay/PaymentCoordinatorClient.h:
783         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
784         (WebCore::mergePaymentOptions):
785         (WebCore::ApplePayPaymentHandler::show):
786         * SourcesCocoa.txt:
787         * WebCore.xcodeproj/project.pbxproj:
788         * loader/EmptyClients.cpp:
789         * testing/MockPaymentContactFields.h: Added.
790         (WebCore::MockPaymentContactFields::MockPaymentContactFields):
791         * testing/MockPaymentContactFields.idl: Added.
792         * testing/MockPaymentCoordinator.cpp:
793         (WebCore::MockPaymentCoordinator::showPaymentUI):
794         (WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
795         * testing/MockPaymentCoordinator.h:
796         * testing/MockPaymentCoordinator.idl:
797
798 2019-02-06  Yusuke Suzuki  <ysuzuki@apple.com>
799
800         [JSC] PrivateName to PublicName hash table is wasteful
801         https://bugs.webkit.org/show_bug.cgi?id=194277
802
803         Reviewed by Michael Saboff.
804
805         Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.
806
807         * bindings/js/JSDOMWindowCustom.cpp:
808         (WebCore::addCrossOriginPropertyNames):
809         * bindings/js/JSLocationCustom.cpp:
810         (WebCore::getOwnPropertySlotCommon):
811         (WebCore::putCommon):
812         * bindings/js/WebCoreBuiltinNames.h:
813
814 2019-02-06  Keith Rollin  <krollin@apple.com>
815
816         Really enable the automatic checking and regenerations of .xcfilelists during builds
817         https://bugs.webkit.org/show_bug.cgi?id=194357
818         <rdar://problem/47861231>
819
820         Reviewed by Chris Dumez.
821
822         Bug 194124 was supposed to enable the automatic checking and
823         regenerating of .xcfilelist files during the build. While related
824         changes were included in that patch, the change to actually enable the
825         operation somehow was omitted. This patch actually enables the
826         operation. The check-xcfilelist.sh scripts now check
827         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
828         from the checking.
829
830         No new tests since there should be no observable behavior difference.
831
832         * Scripts/check-xcfilelists.sh:
833
834 2019-02-06  John Wilander  <wilander@apple.com>
835
836         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
837         https://bugs.webkit.org/show_bug.cgi?id=194325
838         <rdar://problem/47840283>
839
840         Reviewed by Chris Dumez.
841
842         No new tests. This is just data forwarding. Once the data is stored, I will create
843         test infrastructure to query it.
844
845         * html/HTMLAnchorElement.cpp:
846         (WebCore::HTMLAnchorElement::handleClick):
847         * loader/AdClickAttribution.h:
848         (WebCore::AdClickAttribution::encode const):
849         (WebCore::AdClickAttribution::decode):
850         (WebCore::AdClickAttribution::Conversion::encode const):
851         (WebCore::AdClickAttribution::Conversion::decode):
852             Infrastructure for IPC.
853         * loader/FrameLoader.cpp:
854         (WebCore::FrameLoader::urlSelected):
855         (WebCore::FrameLoader::loadURLIntoChildFrame):
856         (WebCore::FrameLoader::loadFrameRequest):
857         (WebCore::FrameLoader::loadURL):
858             These functions forward the optional WebCore::AdClickAttribution object
859             FrameLoader::loadURL() creates the NavigationAction object and sets the
860             WebCore::AdClickAttribution object on there.
861         * loader/FrameLoader.h:
862         (WebCore::FrameLoader::urlSelected):
863         (WebCore::FrameLoader::loadURL):
864         * loader/NavigationAction.h:
865         (WebCore::NavigationAction::adClickAttribution):
866         (WebCore::NavigationAction::setAdClickAttribution):
867
868 2019-02-06  Justin Fan  <justin_fan@apple.com>
869
870         [Web GPU] Implement supporting dictionaries for GPUTexture
871         https://bugs.webkit.org/show_bug.cgi?id=194354
872
873         Reviewed by Dean Jackson.
874
875         Add dictionaries needed to create a GPUTextureDescriptor.
876
877         No new tests; no change in behavior. 
878
879         New interface and dictionaries added:
880         * Modules/webgpu/GPUExtent3D.idl:
881         * Modules/webgpu/GPUTextureDescriptor.idl:
882         * Modules/webgpu/GPUTextureDimension.idl:
883         * Modules/webgpu/GPUTextureUsage.idl:
884         * platform/graphics/gpu/GPUExtent3D.h:
885         * platform/graphics/gpu/GPUTextureDescriptor.h:
886         * platform/graphics/gpu/GPUTextureDimension.h:
887         * platform/graphics/gpu/GPUTextureUsage.h:
888
889         Update WebGPUTextureFormatEnum to GPUTextureFormat:
890         * Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
891         * Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
892         * platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
893         * Modules/webgpu/WebGPUSwapChain.cpp:
894         * Modules/webgpu/WebGPUSwapChain.h:
895         * Modules/webgpu/WebGPUSwapChain.idl:
896         * platform/graphics/gpu/GPUSwapChain.h:
897         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
898         (WebCore::platformTextureFormatForGPUTextureFormat):
899         (WebCore::GPUSwapChain::setFormat):
900
901         Update project files with new symbols:
902         * CMakeLists.txt:
903         * DerivedSources.make:
904         * Sources.txt:
905         * WebCore.xcodeproj/project.pbxproj:
906         * bindings/js/WebCoreBuiltinNames.h:
907
908 2019-02-06  Dean Jackson  <dino@apple.com>
909
910         Fix potential build error in GPUDevice
911         https://bugs.webkit.org/show_bug.cgi?id=194359
912
913         Reviewed by Joseph Pecoraro.
914
915         Add an UNUSED_PARAM for non-macOS platforms.
916
917         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
918         (WebCore::GPUDevice::create):
919
920 2019-02-06  Daniel Bates  <dabates@apple.com>
921
922         Standardize on ControlKey instead of CtrlKey
923         https://bugs.webkit.org/show_bug.cgi?id=194317
924
925         Reviewed by Tim Horton.
926
927         * dom/UIEventWithKeyState.cpp:
928         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
929         (WebCore::UIEventWithKeyState::setModifierKeys):
930         * dom/UIEventWithKeyState.h:
931         (WebCore::UIEventWithKeyState::ctrlKey const):
932         * page/ios/EventHandlerIOS.mm:
933         (WebCore::EventHandler::accessKeyModifiers):
934         * page/mac/EventHandlerMac.mm:
935         (WebCore::EventHandler::accessKeyModifiers):
936         * platform/PlatformEvent.h:
937         (WebCore::PlatformEvent::controlKey const):
938         (WebCore::PlatformEvent::PlatformEvent):
939         (WebCore::PlatformEvent::ctrlKey const): Deleted.
940         * platform/cocoa/KeyEventCocoa.mm:
941         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
942         * platform/gtk/PlatformKeyboardEventGtk.cpp:
943         (WebCore::modifiersForGdkKeyEvent):
944         * platform/gtk/PlatformMouseEventGtk.cpp:
945         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
946         * platform/gtk/PlatformWheelEventGtk.cpp:
947         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
948         * platform/ios/KeyEventIOS.mm:
949         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
950         * platform/ios/PlatformEventFactoryIOS.mm:
951         (WebCore::modifiersForEvent):
952         * platform/mac/KeyEventMac.mm:
953         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
954         * platform/mac/PlatformEventFactoryMac.mm:
955         (WebCore::modifiersForEvent):
956         * testing/Internals.cpp:
957         (WebCore::Internals::accessKeyModifiers const):
958
959 2019-02-06  Alex Christensen  <achristensen@webkit.org>
960
961         Fix WatchOS build
962         https://bugs.webkit.org/show_bug.cgi?id=194353
963
964         Rubber stamped by Tim Horton and Wenson Hsieh.
965
966         * rendering/RenderThemeIOS.mm:
967         (WebCore::iconForAttachment):
968
969 2019-02-06  Olivier Blin  <olivier.blin@softathome.com>
970
971         [SVG] fix SVGURIReference build by including SVGElement
972         https://bugs.webkit.org/show_bug.cgi?id=194292
973
974         Reviewed by Michael Catanzaro.
975
976         * svg/SVGURIReference.h:
977         SVGURIReference is making use of SVGElement in its constructor, but
978         it was not declared.
979
980         The issue was not seen in unified builds because it was grouped with
981         other files including SVGElement.
982
983 2019-02-06  Zalan Bujtas  <zalan@apple.com>
984
985         [LFC][IFC] Move line layout code to a dedicated file
986         https://bugs.webkit.org/show_bug.cgi?id=194328
987
988         Reviewed by Antti Koivisto.
989
990         * Sources.txt:
991         * WebCore.xcodeproj/project.pbxproj:
992         * layout/inlineformatting/InlineFormattingContext.cpp:
993         (WebCore::Layout::InlineFormattingContext::layout const):
994         (WebCore::Layout::isTrimmableContent): Deleted.
995         (WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
996         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
997         (WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
998         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
999         (WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
1000         (WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
1001         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
1002         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
1003         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
1004         * layout/inlineformatting/InlineFormattingContext.h:
1005         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
1006         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
1007         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
1008         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
1009         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
1010         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
1011         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
1012         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
1013         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
1014         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
1015         (WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
1016         (WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
1017         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
1018         (WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
1019         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
1020         (WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
1021         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
1022         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
1023         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
1024         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
1025         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1026         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
1027         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
1028         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
1029         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
1030         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
1031         * layout/inlineformatting/Line.cpp:
1032         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
1033         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
1034         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
1035         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
1036         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
1037         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
1038         (WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
1039         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
1040         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
1041         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
1042         (WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
1043         (WebCore::Layout::InlineFormattingContext::Line::close): Deleted.
1044
1045 2019-02-06  Youenn Fablet  <youenn@apple.com>
1046
1047         CoreAudioCaptureSource should not configure its audio unit until it starts producing data
1048         https://bugs.webkit.org/show_bug.cgi?id=194310
1049
1050         Reviewed by Eric Carlson.
1051
1052         Delay the configuration of the audio unit until the source is instructed to start producing data.
1053         This allows the UIProcess to not start changing the audio unit when
1054         checking for constraints during getUserMedia call before the prompt.
1055         Covered by manual testing.
1056
1057         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1058         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1059         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
1060         (WebCore::CoreAudioCaptureSource::startProducingData):
1061         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1062
1063 2019-02-06  Youenn Fablet  <youenn@apple.com>
1064
1065         Disable audio ducking at Audio Unit setup time
1066         https://bugs.webkit.org/show_bug.cgi?id=194303
1067
1068         Reviewed by Eric Carlson.
1069
1070         When creating a CoreAudioCaptureSource, the audio unit might be
1071         reconfigured if a past audio capture was done.
1072         This might trigger audio ducking which is undone in startInternal.
1073         In some cases, startInternal will never call start.
1074         In that case, the audio unit will continue ducking the other processing.
1075         To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.
1076
1077         In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
1078         This might affect all applications.
1079         Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
1080         This has noticeable effects in the quality of audio being played on bluetooth devices.
1081
1082         Covered by manual tests.
1083
1084         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1085         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
1086         (WebCore::CoreAudioSharedUnit::unduck):
1087         (WebCore::CoreAudioSharedUnit::startInternal):
1088         (WebCore::CoreAudioSharedUnit::captureFailed):
1089         (WebCore::CoreAudioSharedUnit::stopProducingData):
1090
1091 2019-02-06  Antti Koivisto  <antti@apple.com>
1092
1093         RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
1094         https://bugs.webkit.org/show_bug.cgi?id=194333
1095         <rdar://problem/47822929>
1096
1097         Reviewed by Zalan Bujtas.
1098
1099         Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
1100         the legacy animation code triggering a resource load.
1101
1102         Test: http/tests/contentextensions/css-display-none-keyframe.html
1103
1104         * style/StyleScope.cpp:
1105         (WebCore::Style::Scope::scheduleUpdate):
1106
1107         Avoid clearing the style resolver if we are in the middle of a style resolution.
1108         A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
1109
1110 2019-02-06  Pablo Saavedra  <psaavedra@igalia.com>
1111
1112         Build failure after r240315
1113         https://bugs.webkit.org/show_bug.cgi?id=194341
1114
1115         Reviewed by Wenson Hsieh.
1116
1117         * bindings/js/JSUndoItemCustom.cpp:
1118         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
1119
1120 2019-02-05  Ryosuke Niwa  <rniwa@webkit.org>
1121
1122         REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
1123         https://bugs.webkit.org/show_bug.cgi?id=194329
1124
1125         Reviewed by Geoffrey Garen.
1126
1127         The bug was caused by the code path for when navigating with a specific target frame name that does not exist
1128         never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
1129         navigation, resulting in this release assertion.
1130
1131         Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.
1132
1133         Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html
1134
1135         * loader/FrameLoader.cpp:
1136         (WebCore::FrameLoader::loadURL):
1137
1138 2019-02-05  Claudio Saavedra  <csaavedra@igalia.com>
1139
1140         [FreeType] Build fix for Debian stable
1141
1142         Unreviewed build fix.
1143
1144         Debian stable currently has a version of fontconfig that doesn't
1145         yet have FC_COLOR. #ifdef its use to fix the build.
1146
1147         * platform/graphics/freetype/FontCacheFreeType.cpp:
1148         (WebCore::FontCache::systemFallbackForCharacters):
1149
1150 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1151
1152         Stop using blobRegistry in NetworkProcess
1153         https://bugs.webkit.org/show_bug.cgi?id=194027
1154
1155         Reviewed by Youenn Fablet.
1156
1157         Also stop using NetworkBlobRegistry::singleton.
1158         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
1159         We now have to resolve all blob file references while we still have a
1160         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
1161         using the singleton after we have passed everything to the loading code, but it works the same
1162         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
1163         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
1164         which extensions to revoke.
1165
1166         * platform/network/BlobRegistryImpl.h:
1167         * platform/network/FormData.cpp:
1168         (WebCore::appendBlobResolved):
1169         (WebCore::FormData::resolveBlobReferences):
1170         * platform/network/FormData.h:
1171         * platform/network/cf/FormDataStreamCFNet.cpp:
1172         (WebCore::createHTTPBodyCFReadStream):
1173         * platform/network/curl/CurlFormDataStream.cpp:
1174         (WebCore::CurlFormDataStream::CurlFormDataStream):
1175
1176 2019-02-05  Truitt Savell  <tsavell@apple.com>
1177
1178         Unreviewed, rolling out r240984.
1179
1180         Revision casued two API timeouts
1181
1182         Reverted changeset:
1183
1184         "Stop using blobRegistry in NetworkProcess"
1185         https://bugs.webkit.org/show_bug.cgi?id=194027
1186         https://trac.webkit.org/changeset/240984
1187
1188 2019-02-05  Keith Rollin  <krollin@apple.com>
1189
1190         Enable the automatic checking and regenerations of .xcfilelists during builds
1191         https://bugs.webkit.org/show_bug.cgi?id=194124
1192         <rdar://problem/47721277>
1193
1194         Reviewed by Tim Horton.
1195
1196         Bug 193790 add a facility for checking -- during build time -- that
1197         any needed .xcfilelist files are up-to-date and for updating them if
1198         they are not. This facility was initially opt-in by setting
1199         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
1200         the process seemed robust. Its now time to enable this facility and
1201         make it opt-out. If there is a need to disable this facility, set and
1202         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
1203         running `make` or `build-webkit`, or before running Xcode from the
1204         command line.
1205
1206         Additionally, remove the step that generates a list of source files
1207         going into the UnifiedSources build step. It's only necessarily to
1208         specify Sources.txt and SourcesCocoa.txt as inputs.
1209
1210         No new tests since there should be no observable behavior difference.
1211
1212         * UnifiedSources-input.xcfilelist: Removed.
1213         * WebCore.xcodeproj/project.pbxproj:
1214
1215 2019-02-05  Keith Rollin  <krollin@apple.com>
1216
1217         Update .xcfilelist files
1218         https://bugs.webkit.org/show_bug.cgi?id=194121
1219         <rdar://problem/47720863>
1220
1221         Reviewed by Tim Horton.
1222
1223         Preparatory to enabling the facility for automatically updating the
1224         .xcfilelist files, check in a freshly-updated set so that not everyone
1225         runs up against having to regenerate them themselves.
1226
1227         No new tests since there should be no observable behavior difference.
1228
1229         * DerivedSources-input.xcfilelist:
1230         * DerivedSources-output.xcfilelist:
1231
1232 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1233
1234         Stop using blobRegistry in NetworkProcess
1235         https://bugs.webkit.org/show_bug.cgi?id=194027
1236
1237         Reviewed by Youenn Fablet.
1238
1239         Also stop using NetworkBlobRegistry::singleton.
1240         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
1241         We now have to resolve all blob file references while we still have a
1242         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
1243         using the singleton after we have passed everything to the loading code, but it works the same
1244         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
1245         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
1246         which extensions to revoke.
1247
1248         * platform/network/BlobRegistryImpl.h:
1249         * platform/network/FormData.cpp:
1250         (WebCore::appendBlobResolved):
1251         (WebCore::FormData::resolveBlobReferences):
1252         * platform/network/FormData.h:
1253         * platform/network/cf/FormDataStreamCFNet.cpp:
1254         (WebCore::createHTTPBodyCFReadStream):
1255         * platform/network/curl/CurlFormDataStream.cpp:
1256         (WebCore::CurlFormDataStream::CurlFormDataStream):
1257
1258 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
1259
1260         Unreviewed, rolling out r240742.
1261
1262         Causes crashes on iOS simulator.
1263
1264         Reverted changeset:
1265
1266         "[iOS] Keyups for non-modifier keys identified as "Dead" when
1267         not focused in a content-editable element"
1268         https://bugs.webkit.org/show_bug.cgi?id=192824
1269         https://trac.webkit.org/changeset/240742
1270
1271 2019-02-05  Zalan Bujtas  <zalan@apple.com>
1272
1273         [LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
1274         https://bugs.webkit.org/show_bug.cgi?id=194269
1275
1276         Reviewed by Antti Koivisto.
1277
1278         In this patch we pre-compute the margins padding and borders for formatting context roots, replaced boxes and non-replaced containers.
1279         These property values are input to collectInlineContent's inline item detaching logic.
1280
1281         * layout/inlineformatting/InlineFormattingContext.cpp:
1282         (WebCore::Layout::nextInPreOrder):
1283         (WebCore::Layout::InlineFormattingContext::layout const):
1284         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
1285         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
1286         * layout/inlineformatting/InlineFormattingContext.h:
1287         * layout/layouttree/LayoutBox.h: ran out bits. 
1288
1289 2019-02-05  Antoine Quint  <graouts@apple.com>
1290
1291         REGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document::absoluteEventRegionForNode
1292         https://bugs.webkit.org/show_bug.cgi?id=194284
1293         <rdar://problem/47774298>
1294
1295         Reviewed by Antti Koivisto.
1296
1297         The m_touchActionElements list needs to be HashSet<RefPtr<Element>> instead of HashSet<Element*>. It was initially storing raw pointers based on m_touchEventTargets
1298         which is an EventTargetSet (typedef’d to HashCountedSet<Node*>), but that's because these nodes have an event listener registered for them and as such are kept alive,
1299         whereas elements with a touch-action property aren’t. Elements are removed from this list from Document::nodeWillBeRemoved() and from Document::updateTouchActionElements(),
1300         the latter being called from Style::TreeResolver::resolveElement().
1301
1302         * dom/Document.cpp:
1303         (WebCore::Document::updateTouchActionElements):
1304         * dom/Document.h:
1305         (WebCore::Document::touchActionElements const):
1306
1307 2019-02-05  Benjamin Poulain  <benjamin@webkit.org>
1308
1309         Hit testing functions optimizations
1310         https://bugs.webkit.org/show_bug.cgi?id=194073
1311         <rdar://problem/47692312>
1312
1313         Reviewed by Zalan Bujtas.
1314
1315         This patch implements some easy optimizations that speed up
1316         hit testing without changing the algorithms.
1317
1318         * page/FrameViewLayoutContext.h:
1319         The code for:
1320             view().frameView().layoutContext().isPaintOffsetCacheEnabled()
1321         followed by:
1322             view().frameView().layoutContext().layoutState()
1323         was loading all the intermediate values twice and calling layoutState()
1324         twice.
1325
1326         By marking the function as pure, Clang can CSE the whole thing and
1327         remove the duplicated code.
1328
1329         * platform/graphics/LayoutRect.h:
1330         (WebCore::LayoutRect::isInfinite const):
1331         That one is pretty funny.
1332
1333         Since LayoutRect::isInfinite() was implemented before operator==() is
1334         declared, the compiler was falling back to the implicit convertion to FloatRect()
1335         before doing any comparison.
1336
1337         This explains a bunch of the convertions to float when using LayoutRect.
1338
1339         * rendering/RenderBox.cpp:
1340         (WebCore::RenderBox::mapLocalToContainer const):
1341         Just reoder to make the register nice and clean for the optimization described above.
1342
1343 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
1344
1345         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
1346         https://bugs.webkit.org/show_bug.cgi?id=193993
1347
1348         Reviewed by Keith Miller.
1349
1350         * bindings/scripts/CodeGeneratorJS.pm:
1351         (GenerateHeader):
1352         * bridge/runtime_method.h:
1353
1354 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1355
1356         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
1357         https://bugs.webkit.org/show_bug.cgi?id=194245
1358
1359         Reviewed by Zalan Bujtas.
1360
1361         ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa
1362         directory.
1363
1364         Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC).
1365
1366         Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build.
1367
1368         * SourcesCocoa.txt:
1369         * WebCore.xcodeproj/project.pbxproj:
1370         * page/scrolling/ScrollingThread.cpp:
1371         (WebCore::ScrollingThread::initializeRunLoop):
1372         (WebCore::ScrollingThread::wakeUpRunLoop):
1373         (WebCore::ScrollingThread::threadRunLoopSourceCallback):
1374         * page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h.
1375         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm.
1376         * page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h.
1377         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm.
1378         * page/scrolling/mac/ScrollingThreadMac.mm:
1379         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
1380         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1381
1382 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
1383
1384         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
1385         https://bugs.webkit.org/show_bug.cgi?id=174816
1386
1387         Reviewed by Michael Catanzaro.
1388
1389         Tests: enabled fast/url/user-visible/.
1390
1391         * testing/Internals.cpp:
1392         (WebCore::Internals::userVisibleString): Enable method on all platforms.
1393
1394 2019-02-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1395
1396         [curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
1397         https://bugs.webkit.org/show_bug.cgi?id=190895
1398
1399         Reviewed by Ross Kirsling.
1400
1401         An assertion was failing in CurlRequest::invokeDidReceiveResponse
1402         because DidReceiveResponse was already dispatched. This condition
1403         was met if CurlRequestScheduler::completeTransfer is called while
1404         waiting for the reply for the first DidReceiveResponse.
1405
1406         No new tests, covered by existing tests.
1407
1408         * platform/network/curl/CurlRequest.h:
1409         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
1410         Return true if m_didNotifyResponse is false disregard to
1411         m_didReturnFromNotify.
1412
1413 2019-02-04  Said Abou-Hallawa  <said@apple.com>
1414
1415         [CG] Enable setAdditionalSupportedImageTypes for WK1
1416         https://bugs.webkit.org/show_bug.cgi?id=194190
1417
1418         Reviewed by Tim Horton.
1419
1420         Move the function webCoreStringVectorFromNSStringArray from WebKit to
1421         WebCore so it can be used by both WebKit and WebKitLegacy.
1422
1423         * platform/mac/StringUtilities.h:
1424         * platform/mac/StringUtilities.mm:
1425         (WebCore::webCoreStringVectorFromNSStringArray):
1426
1427 2019-02-04  Justin Fan  <justin_fan@apple.com>
1428
1429         [Web GPU] Code clean-up for RenderPipeline backend
1430         https://bugs.webkit.org/show_bug.cgi?id=194238
1431
1432         Reviewed by Dean Jackson.
1433
1434         Replace dot syntax setters with calls to setter methods, and remove unnecessary setter calls for 
1435         the input state's descriptor arrays.
1436
1437         Covered by existing tests; no change in behavior.
1438
1439         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1440         (WebCore::tryCreateMtlDepthStencilState): Refactor to use implicit setters rather than dot syntax.
1441         (WebCore::setInputStateForPipelineDescriptor): Ditto, and remove unnecessary setter calls on array objects.
1442
1443 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
1444
1445         Use deferrable timer to restart the Responsiveness Timer on each wheel event
1446         https://bugs.webkit.org/show_bug.cgi?id=194135
1447         <rdar://problem/47724099>
1448
1449         Reviewed by Simon Fraser.
1450
1451         The original DeferrableOneShotTimer was not really deferrable.
1452         What it allows is to restart the count down from scratch after
1453         firing.
1454
1455         For this optimization, I want to keep the correct timing but avoid
1456         starting a real timer every time.
1457
1458         I renamed DeferrableOneShotTimer to ResettableOneShotTimer and
1459         created a real DeferrableOneShotTimer that support deadlines.
1460
1461         * css/CSSImageGeneratorValue.cpp:
1462         * html/HTMLPlugInImageElement.h:
1463         * loader/cache/CachedResource.h:
1464         * platform/Timer.cpp:
1465         (WebCore::DeferrableOneShotTimer::startOneShot):
1466         (WebCore::DeferrableOneShotTimer::fired):
1467         * platform/Timer.h:
1468         (WebCore::TimerBase::nextFireTime const):
1469         (WebCore::ResettableOneShotTimer::ResettableOneShotTimer):
1470         (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
1471         (WebCore::DeferrableOneShotTimer::stop):
1472         (WebCore::DeferrableOneShotTimer::restart): Deleted.
1473         * platform/graphics/ca/TileController.h:
1474         * platform/graphics/cg/SubimageCacheWithTimer.h:
1475
1476 2019-02-04  Antoine Quint  <graouts@apple.com>
1477
1478         Use constants for pointer types
1479         https://bugs.webkit.org/show_bug.cgi?id=194232
1480
1481         Reviewed by Dean Jackson.
1482
1483         We cannot use an enum for the pointer type since a custom pointer type can be created by developers when creating a
1484         pointer event using JavaScript, but we can at least used string constants for the ones created internally.
1485
1486         * dom/PointerEvent.cpp:
1487         (WebCore::PointerEvent::mousePointerType):
1488         (WebCore::PointerEvent::penPointerType):
1489         (WebCore::PointerEvent::touchPointerType):
1490         * dom/PointerEvent.h:
1491         * dom/ios/PointerEventIOS.cpp:
1492
1493 2019-02-04  Zalan Bujtas  <zalan@apple.com>
1494
1495         [First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account.
1496         https://bugs.webkit.org/show_bug.cgi?id=194168
1497
1498         Reviewed by Simon Fraser.
1499
1500         First paint should not be blocked by async or deferred scripts.
1501
1502         * page/FrameView.cpp:
1503         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
1504
1505 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1506
1507         Async overflow scroll with border-radius renders incorrectly
1508         https://bugs.webkit.org/show_bug.cgi?id=194205
1509         <rdar://problem/47771668>
1510
1511         Reviewed by Zalan Bujtas.
1512
1513         When an element has composited overflow:scroll and border-radius, we need to make a layer
1514         to clip to the inside of the border radius if necessary.
1515
1516         Existing code simply turned off needsDescendantsClippingLayer for composited scrolling
1517         layers, but now we check to see if the inner border is rounded. If we have both a m_childContainmentLayer
1518         and scrolling layers, we need to adjust the location of the scrolling layers (which are parented
1519         in m_childContainmentLayer).
1520
1521         Also fix offsetFromRenderer for these layers; it's positive for layers inset from the top left
1522         of the border box.
1523
1524         Tests: compositing/clipping/border-radius-async-overflow-clipping-layer.html
1525                compositing/clipping/border-radius-async-overflow-non-stacking.html
1526                compositing/clipping/border-radius-async-overflow-stacking.html
1527
1528         * rendering/RenderLayerBacking.cpp:
1529         (WebCore::RenderLayerBacking::updateConfiguration):
1530         (WebCore::RenderLayerBacking::updateGeometry):
1531         (WebCore::RenderLayerBacking::updateChildClippingStrategy): Layout is always up-to-date now, so remove the comment.
1532
1533 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1534
1535         PageOverlayController's layers should be created lazily
1536         https://bugs.webkit.org/show_bug.cgi?id=194199
1537
1538         Reviewed by Tim Horton.
1539
1540         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
1541         and use them to only parent the overlay-hosting layers when necessary.
1542
1543         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
1544         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
1545         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
1546         compositing updates that parents the layerWithDocumentOverlays().
1547
1548         View overlays are added to the layer tree via the DrawingArea. When we go between having
1549         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
1550         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
1551         compositing flush (this has to be done manually because view overlay layers are outside the
1552         subtree managed by RenderLayerCompositor).
1553         
1554         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
1555         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
1556         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
1557         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
1558
1559         * loader/EmptyClients.h:
1560         * page/ChromeClient.h:
1561         * page/FrameView.cpp:
1562         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
1563         because there may be nothing else that does.
1564         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
1565         * page/Page.cpp:
1566         (WebCore::Page::installedPageOverlaysChanged):
1567         * page/Page.h:
1568         * page/PageOverlayController.cpp:
1569         (WebCore::PageOverlayController::hasDocumentOverlays const):
1570         (WebCore::PageOverlayController::hasViewOverlays const):
1571         (WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
1572         might as well be the one to call through the ChromeClient.
1573         (WebCore::PageOverlayController::detachViewOverlayLayers):
1574         (WebCore::PageOverlayController::installPageOverlay):
1575         (WebCore::PageOverlayController::uninstallPageOverlay):
1576         * page/PageOverlayController.h:
1577         * rendering/RenderLayerCompositor.cpp:
1578         (WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
1579         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1580         (WebCore::RenderLayerCompositor::attachRootLayer):
1581         (WebCore::RenderLayerCompositor::detachRootLayer):
1582
1583 2019-02-04  Eric Liang  <ericliang@apple.com>
1584
1585         When performing Increment or Decrement on sliders, check to see if the slider is disabled.
1586         https://bugs.webkit.org/show_bug.cgi?id=173497
1587
1588         Reviewed by Chris Fleizach.
1589
1590         Test: accessibility/set-value-not-work-for-disabled-sliders.html
1591
1592         * accessibility/AccessibilityNodeObject.cpp:
1593         (WebCore::AccessibilityNodeObject::alterSliderValue):
1594
1595 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
1596
1597         IndexedDB: leak WebIDBConnectionToServer in layout tests
1598         https://bugs.webkit.org/show_bug.cgi?id=193688
1599         <rdar://problem/47353263>
1600
1601         Reviewed by Geoffrey Garen.
1602
1603         Let IDBConnectionToServer keep a WeakPtr of IDBConnectionToServerDelegate.
1604
1605         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1606         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
1607         * Modules/indexeddb/client/IDBConnectionToServer.h:
1608         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1609
1610 2019-02-04  Youenn Fablet  <youenn@apple.com>
1611
1612         Make sure to remove the device observer in AVVideoCaptureSource
1613         https://bugs.webkit.org/show_bug.cgi?id=194181
1614         <rdar://problem/47739247>
1615
1616         Reviewed by Eric Carlson.
1617
1618         Make sure to remove the device observer when the observer is destroyed.
1619         To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor.
1620
1621         Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource.
1622
1623         Covered by manual test.
1624
1625        * platform/mediastream/mac/AVVideoCaptureSource.h:
1626         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1627         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
1628         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
1629         (WebCore::AVVideoCaptureSource::initializeSession):
1630         (WebCore::AVVideoCaptureSource::clearSession):
1631         (WebCore::AVVideoCaptureSource::stopProducingData):
1632         (WebCore::AVVideoCaptureSource::setupSession):
1633
1634 2019-02-04  Antoine Quint  <graouts@apple.com>
1635
1636         Use a dedicated type instead of int32_t for pointer identifiers
1637         https://bugs.webkit.org/show_bug.cgi?id=194217
1638
1639         Reviewed by Antti Koivisto.
1640
1641         * WebCore.xcodeproj/project.pbxproj:
1642         * dom/PointerEvent.h:
1643         * dom/PointerID.h: Added.
1644         * page/PointerCaptureController.cpp:
1645         (WebCore::PointerCaptureController::setPointerCapture):
1646         (WebCore::PointerCaptureController::releasePointerCapture):
1647         (WebCore::PointerCaptureController::hasPointerCapture):
1648         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
1649         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier):
1650         (WebCore::PointerCaptureController::cancelPointer):
1651         * page/PointerCaptureController.h:
1652
1653 2019-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1654
1655         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
1656         Followup to https://bugs.webkit.org/show_bug.cgi?id=193758
1657
1658         Reviewed by Daniel Bates.
1659
1660         Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in
1661         behavior.
1662
1663         * editing/EditingBehavior.h:
1664         (WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const):
1665         * html/HTMLInputElement.cpp:
1666         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
1667
1668 2019-02-04  Zalan Bujtas  <zalan@apple.com>
1669
1670         [LFC][IFC] Make InlineFormattingContext::collectInlineContent non-recursive.
1671         https://bugs.webkit.org/show_bug.cgi?id=194210
1672
1673         Reviewed by Antti Koivisto.
1674
1675         Use iterative algorithm to collect inline content (and add breaking rules).
1676         This is in preparation for fixing the inline preferred width computation.  
1677
1678         * layout/Verification.cpp:
1679         (WebCore::Layout::resolveForRelativePositionIfNeeded):
1680         * layout/inlineformatting/InlineFormattingContext.cpp:
1681         (WebCore::Layout::addDetachingRules):
1682         (WebCore::Layout::createAndAppendInlineItem):
1683         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
1684         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): Deleted.
1685         * layout/inlineformatting/InlineFormattingContext.h:
1686
1687 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1688
1689         Unreviewed, fix unused variable warnings introduced in r240912
1690         https://bugs.webkit.org/show_bug.cgi?id=194198
1691         <rdar://problem/47776051>
1692
1693         * page/FrameView.cpp:
1694         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
1695         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
1696
1697 2019-02-04  Frederic Wang  <fwang@igalia.com>
1698
1699         [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow
1700         https://bugs.webkit.org/show_bug.cgi?id=191816
1701
1702         Reviewed by Wenson Hsieh.
1703
1704         This patch fixes a bug that prevents children of a scroll container to create snap positions
1705         when they have non-visible overflow. This happens because for such a child, the function
1706         RenderBox::findEnclosingScrollableContainer() will return the child itself rather than the
1707         scroll container. To address that issue, we introduce a new
1708         RenderObject::enclosingScrollableContainerForSnapping() helper function that ensures that
1709         a real RenderBox ancestor is returned.
1710
1711         Test: css3/scroll-snap/scroll-snap-children-with-overflow.html
1712
1713         * page/scrolling/AxisScrollSnapOffsets.cpp:
1714         (WebCore::updateSnapOffsetsForScrollableArea): Use enclosingScrollableContainerForSnapping()
1715         so that we don't skip children with non-visible overflow.
1716         * rendering/RenderLayerModelObject.cpp:
1717         (WebCore::RenderLayerModelObject::styleDidChange): Ditto. The new function calls
1718         enclosingBox().
1719         * rendering/RenderObject.cpp:
1720         (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Return
1721         the scrollable container of the enclosing box. If it is actually the render object itself
1722         then start the search from the parent box instead.
1723         * rendering/RenderObject.h: Declare enclosingScrollableContainerForSnapping(). 
1724
1725 2019-02-04  Antti Koivisto  <antti@apple.com>
1726
1727         Rename GraphicsLayer and PlatformCALayer scrolling layer type enum values to be less ambiguous
1728         https://bugs.webkit.org/show_bug.cgi?id=194215
1729
1730         Reviewed by Frédéric Wang.
1731
1732         GraphicsLayer::Type::Scrolling -> GraphicsLayer::Type::ScrollContainer
1733         PlatformCALayer::LayerTypeScrollingLayer -> PlatformCALayer::LayerTypeScrollContainerLayer
1734
1735         * platform/graphics/GraphicsLayer.cpp:
1736         (WebCore::GraphicsLayer::supportsLayerType):
1737         * platform/graphics/GraphicsLayer.h:
1738         * platform/graphics/ca/GraphicsLayerCA.cpp:
1739         (WebCore::GraphicsLayer::supportsLayerType):
1740         (WebCore::GraphicsLayerCA::initialize):
1741         * platform/graphics/ca/PlatformCALayer.cpp:
1742         (WebCore::operator<<):
1743         * platform/graphics/ca/PlatformCALayer.h:
1744         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1745         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1746         (WebCore::PlatformCALayerCocoa::commonInit):
1747         * rendering/RenderLayerBacking.cpp:
1748         (WebCore::RenderLayerBacking::updateScrollingLayers):
1749         * rendering/RenderLayerCompositor.cpp:
1750         (WebCore::RenderLayerCompositor::ensureRootLayer):
1751
1752 2019-02-03  Antti Koivisto  <antti@apple.com>
1753
1754         [iOS] Tiles not created in large scrollable iframes
1755         https://bugs.webkit.org/show_bug.cgi?id=193665
1756
1757         Reviewed by Simon Fraser.
1758
1759         We are not syncing scroll position back to the graphics layer tree correctly.
1760
1761         Test by Frédéric Wang.
1762
1763         * page/scrolling/AsyncScrollingCoordinator.cpp:
1764         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1765         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1766         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
1767
1768         Factor setting and syncing scrolling layer positions into a function.
1769         Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
1770
1771         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
1772         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1773         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
1774         * page/scrolling/AsyncScrollingCoordinator.h:
1775         * page/scrolling/ScrollingCoordinator.cpp:
1776         (WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
1777         (WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
1778         (WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
1779         * page/scrolling/ScrollingCoordinator.h:
1780         * rendering/RenderLayerCompositor.cpp:
1781
1782         Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
1783         Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
1784
1785         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
1786         (WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
1787         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
1788         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1789         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1790         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
1791         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1792         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
1793         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
1794         (WebCore::RenderLayerCompositor::updateLayerForHeader):
1795         (WebCore::RenderLayerCompositor::updateLayerForFooter):
1796         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1797         (WebCore::RenderLayerCompositor::ensureRootLayer):
1798         (WebCore::RenderLayerCompositor::destroyRootLayer):
1799         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1800         * rendering/RenderLayerCompositor.h:
1801
1802 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
1803
1804         Make setNeedsLayout on the root more explicitly about triggering its side-effects
1805         https://bugs.webkit.org/show_bug.cgi?id=194198
1806
1807         Reviewed by Antti Koivisto.
1808
1809         Calling setNeedsLayout() on the FrameView or RenderView is an odd concept; the render tree
1810         generally manages its own dirty state.
1811
1812         Most callers of setNeedsLayout() on the root are really trying to trigger the side-effects
1813         of layout, like compositing updates, which are required when view configuration state, like
1814         headers, footers and transparency, change. These dependencies are currently implicit and
1815         poorly defined.
1816
1817         Renaming "setNeedsLayout" on FrameView is a step towards being more explicit about pure
1818         rendering updates, vs updates of downstream data strutures like compositing. It's now called
1819         setNeedsLayoutAfterViewConfigurationChange(). In addition, expose
1820         setNeedsCompositingConfigurationUpdate() and setNeedsCompositingGeometryUpdate() so callers
1821         can trigger the appropriate types of compositing updates on the root layer.
1822
1823         In addition, FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange() schedules a
1824         layout. Withtout this, some callers would dirty the RenderView's layout but rely on some
1825         other trigger to make the layout happen.
1826
1827         This cleanup was prompted by noticing that FrameView::setHeaderHeight() dirtied layout
1828         but never scheduled it, making banner insertion in MiniBrowser unreliable.
1829
1830         This patch also removes the aliasing of headerHeight/footerHeight between Page and
1831         FrameView. Banners are a property of Page, so FrameView fetches the banner heights
1832         from Page.
1833
1834         * page/FrameView.cpp:
1835         (WebCore::FrameView::headerHeight const):
1836         (WebCore::FrameView::footerHeight const):
1837         (WebCore::FrameView::availableContentSizeChanged):
1838         (WebCore::FrameView::setNeedsLayoutAfterViewConfigurationChange):
1839         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
1840         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
1841         (WebCore::FrameView::scheduleSelectionUpdate):
1842         (WebCore::FrameView::setTransparent):
1843         (WebCore::FrameView::setBaseBackgroundColor):
1844         (WebCore::FrameView::setAutoSizeFixedMinimumHeight):
1845         (WebCore::FrameView::enableAutoSizeMode):
1846         (WebCore::FrameView::setHeaderHeight): Deleted.
1847         (WebCore::FrameView::setFooterHeight): Deleted.
1848         (WebCore::FrameView::setNeedsLayout): Deleted.
1849         * page/FrameView.h:
1850         * page/FrameViewLayoutContext.cpp:
1851         (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
1852         (WebCore::FrameViewLayoutContext::setNeedsLayout): Deleted.
1853         * page/FrameViewLayoutContext.h:
1854         * page/Page.cpp:
1855         (WebCore::Page::setPageScaleFactor):
1856         (WebCore::Page::setHeaderHeight):
1857         (WebCore::Page::setFooterHeight):
1858         (WebCore::Page::addHeaderWithHeight): Deleted.
1859         (WebCore::Page::addFooterWithHeight): Deleted.
1860         * page/Page.h:
1861         * rendering/RenderLayerCompositor.cpp:
1862         (WebCore::RenderLayerCompositor::updateBacking):
1863         * testing/Internals.cpp:
1864         (WebCore::Internals::resetToConsistentState):
1865         (WebCore::Internals::setHeaderHeight):
1866         (WebCore::Internals::setFooterHeight):
1867
1868 2019-02-03  John Wilander  <wilander@apple.com>
1869
1870         Parse and handle Ad Click Attribution attributes in HTMLAnchorElement::handleClick()
1871         https://bugs.webkit.org/show_bug.cgi?id=194104
1872         <rdar://problem/47649991>
1873
1874         Reviewed by Chris Dumez, Daniel Bates, and Darin Adler.
1875
1876         Test: http/tests/adClickAttribution/anchor-tag-attributes-validation.html
1877
1878         This patch adds parsing and validation of the two new Ad Click Attribution
1879         attributes in anchor elements: adcampaignid and addestination. The data is
1880         not yet forwarded into the loader.
1881
1882         * html/HTMLAnchorElement.cpp:
1883         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1884         (WebCore::HTMLAnchorElement::handleClick):
1885             Now calls HTMLAnchorElement::parseAdClickAttribution().
1886         * html/HTMLAnchorElement.h:
1887         * loader/AdClickAttribution.h:
1888             Made WebCore::AdClickAttribution copyable since it's needed to have it be
1889             WTF::Optional. Also made AdClickAttribution::MaxEntropy public. Changed
1890             numeric types from unsigned short to uint32_t.
1891         (WebCore::AdClickAttribution::Campaign::isValid const):
1892         (WebCore::AdClickAttribution::Conversion::isValid const):
1893
1894 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
1895
1896         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
1897         https://bugs.webkit.org/show_bug.cgi?id=194189
1898
1899         Reviewed by Geoffrey Garen.
1900
1901         Introduced PolicyCheckIdentifier to pair each navigation policy check request with a decision,
1902         and deployed it in PolicyChecker. The identifier is passed from WebContent process to UI process
1903         in WebKit2, and passed it back with the policy decision.
1904
1905         Because PolicyCheckIdentifier embeds the process identifier from which a navigation policy is checked,
1906         we would be able to detect when UI process had sent the decision to a wrong WebContent process.
1907
1908         This patch also adds release assertions to make sure history().provisionalItem() is set whenever
1909         we're requesting a navigation policy check.
1910
1911         These code changes should either:
1912         1. Fix crashes in FrameLoader::continueLoadAfterNavigationPolicy where isBackForwardLoadType would
1913            return true yet history().provisionalItem() is null.
1914         2. Detect a bug that UI process can send a navigation policy decision to a wrong WebContent process.
1915         3. Rule out the possibility that (2) exists.
1916
1917         * loader/DocumentLoader.cpp:
1918         (WebCore::DocumentLoader::willSendRequest):
1919         (WebCore::DocumentLoader::responseReceived):
1920         * loader/EmptyClients.cpp:
1921         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1922         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1923         * loader/EmptyFrameLoaderClient.h:
1924         * loader/FrameLoader.cpp:
1925         (WebCore::FrameLoader::checkContentPolicy):
1926         (WebCore::FrameLoader::loadURL):
1927         (WebCore::FrameLoader::load):
1928         (WebCore::FrameLoader::loadWithDocumentLoader):
1929         (WebCore::FrameLoader::loadPostRequest):
1930         * loader/FrameLoader.h:
1931         * loader/FrameLoaderClient.h:
1932         * loader/FrameLoaderTypes.h:
1933         (WebCore::PolicyCheckIdentifier): Added.
1934         (WebCore::PolicyCheckIdentifier::operator== const): Added.
1935         (WebCore::PolicyCheckIdentifier::PolicyCheckIdentifier): Added.
1936         (WebCore::PolicyCheckIdentifier::encode const): Added.
1937         (WebCore::PolicyCheckIdentifier::decode): Added.
1938         * loader/PolicyChecker.cpp:
1939         (WebCore::PolicyCheckIdentifier::generate):
1940         (WebCore::PolicyCheckIdentifier::isValidFor): Returns true if the identifer matches. Also release asserts
1941         that the process ID is same, and that m_check is always not zero (meaning it's a generated value).
1942         The failure of these release assertions would indicate that there is a bug in UI process, which results in
1943         a policy decision response being sent to a wrong Web process.
1944         (WebCore::PolicyChecker::checkNavigationPolicy): Exit early if isValidFor fails.
1945         (WebCore::PolicyChecker::checkNewWindowPolicy):
1946
1947 2019-02-03  Antti Koivisto  <antti@apple.com>
1948
1949         Don't include ScrollCoordinator.h from Element.h
1950         https://bugs.webkit.org/show_bug.cgi?id=194206
1951
1952         Reviewed by Daniel Bates.
1953
1954         * dom/Element.h:
1955
1956 2019-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1957
1958         Unable to move selection into editable roots with 0 height
1959         https://bugs.webkit.org/show_bug.cgi?id=194143
1960         <rdar://problem/47767284>
1961
1962         Reviewed by Ryosuke Niwa.
1963
1964         Currently, positions inside editable elements of height 0 are not considered to be candidates when
1965         canonicalizing a position to its visible counterpart. This prevents us from moving the selection into these
1966         editable roots at all. To fix this, we relax this constraint by allowing positions anchored by root editable
1967         elements to be candidates.
1968
1969         Test: editing/selection/insert-text-in-empty-content-editable.html
1970
1971         * dom/Position.cpp:
1972         (WebCore::Position::isCandidate const):
1973
1974 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
1975
1976         Tidyup of Pagination and FrameView m_mediaType initialization
1977         https://bugs.webkit.org/show_bug.cgi?id=194203
1978
1979         Reviewed by Darin Adler.
1980
1981         Fix post-commit feedback on lines around code changed in r240901.
1982
1983         * page/FrameView.cpp:
1984         (WebCore::FrameView::FrameView):
1985         * page/FrameView.h:
1986         * rendering/Pagination.h:
1987         (WebCore::Pagination::operator!= const):
1988
1989 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
1990
1991         Turn on Smart Paste
1992         https://bugs.webkit.org/show_bug.cgi?id=193786
1993
1994         Reviewed by Ryosuke Niwa.
1995
1996         Turned on a modified tests:
1997         LayoutTests/editing/pasteboard/smart-paste-001.html
1998         LayoutTests/editing/pasteboard/smart-paste-002.html
1999         LayoutTests/editing/pasteboard/smart-paste-003.html
2000         LayoutTests/editing/pasteboard/smart-paste-004.html
2001         LayoutTests/editing/pasteboard/smart-paste-005.html
2002         LayoutTests/editing/pasteboard/smart-paste-006.html
2003         LayoutTests/editing/pasteboard/smart-paste-007.html
2004         LayoutTests/editing/pasteboard/smart-paste-008.html
2005
2006         * platform/ios/PasteboardIOS.mm:
2007         (WebCore::Pasteboard::canSmartReplace):
2008         Turn on smart replace.
2009
2010 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
2011
2012         Tidy up data memebers of FrameView and related classes to shrink class sizes
2013         https://bugs.webkit.org/show_bug.cgi?id=194197
2014
2015         Reviewed by Zalan Bujtas.
2016
2017         Make various enums 8-bit. Re-order data members of FrameView, FrameViewLayoutContext, Widget
2018         and ScrollView to optimize padding.
2019
2020         Use more data member initializers.
2021
2022         This shrinks FrameView from 1168 (144 padding bytes) to 1096 (96 padding bytes).
2023
2024         * dom/Element.h:
2025         * page/FrameView.cpp:
2026         (WebCore::FrameView::FrameView):
2027         * page/FrameView.h:
2028         * page/FrameViewLayoutContext.h:
2029         * platform/ScrollTypes.h:
2030         * platform/ScrollView.h: Data members should come after member functions.
2031         * platform/Widget.h:
2032         * rendering/Pagination.h:
2033         (WebCore::Pagination::Pagination): Deleted.
2034
2035 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
2036
2037         Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity
2038         https://bugs.webkit.org/show_bug.cgi?id=194194
2039
2040         Rubber-stampted by Antti Koivisto.
2041
2042         Our desired terminology is "scrollContainerLayer" for the outer, clipping layer
2043         for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll.
2044
2045         * rendering/RenderLayerBacking.cpp:
2046         (WebCore::RenderLayerBacking::updateDebugIndicators):
2047         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
2048         (WebCore::RenderLayerBacking::updateGeometry):
2049         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
2050         (WebCore::RenderLayerBacking::updateAfterDescendants):
2051         (WebCore::RenderLayerBacking::updateInternalHierarchy):
2052         (WebCore::RenderLayerBacking::updateDrawsContent):
2053         (WebCore::RenderLayerBacking::updateScrollingLayers):
2054         * rendering/RenderLayerBacking.h:
2055         * rendering/RenderLayerCompositor.cpp:
2056         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2057         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2058         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
2059         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
2060         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
2061         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
2062
2063 2019-02-02  Justin Fan  <justin_fan@apple.com>
2064
2065         [Web GPU] Fix GPURenderPassEncoder::setVertexBuffers and allow overlapping indices with GPUBindGroups
2066         https://bugs.webkit.org/show_bug.cgi?id=194125
2067
2068         Reviewed by Myles C. Maxfield.
2069
2070         GPURenderPassEncoder::setVertexBuffers is now actually written to set all buffers provided. In addition,
2071         shift vertex input buffer indices so that any resource bindings can bind vertex buffer resources to the same indices. 
2072
2073         Existing tests cover setVertexBuffers. Updated buffer-resource-triangles to assign bind groups and vertex buffers to the same index.
2074
2075         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: Added.
2076         (WebCore::WHLSL::Metal::calculateVertexBufferIndex): Simple shifting function for vertex input buffer indices.
2077         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: Added.
2078         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2079         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Limit maximum bind group indices to 0 to 3.
2080         * Modules/webgpu/WebGPURenderPassEncoder.cpp: 
2081         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Limit vertex input indices to 0 to 15.
2082         * Modules/webgpu/WebGPURenderPassEncoder.h: Move IDL/bindings bug note to IDL file.
2083         * Modules/webgpu/WebGPURenderPassEncoder.idl: Ditto.
2084         * platform/graphics/gpu/GPULimits.h: Added. Home for Web GPU limits constants shared between files.
2085         * platform/graphics/gpu/GPURenderPassEncoder.h: Change IDL/bindings bug workaround to unsigned long long to prevent narrowing compared to spec.
2086         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2087         (WebCore::GPURenderPassEncoder::setVertexBuffers): Now properly calls Metal's setVertexBuffers. 
2088         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2089         (WebCore::setInputStateForPipelineDescriptor): Fix validation checks for vertex attribute numbers and vertex buffer indices. 
2090
2091         Add symbols to project:
2092         * Sources.txt:
2093         * WebCore.xcodeproj/project.pbxproj:
2094
2095 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2096
2097         Async overflow scroll is jumpy on macOS if the main thread is busy
2098         https://bugs.webkit.org/show_bug.cgi?id=194184
2099         <rdar://problem/47758655>
2100
2101         Reviewed by Antti Koivisto.
2102
2103         This change extends to macOS some existing overflow-scroll functionality for iOS.
2104         When an async scroll is in process in the scroll thread (or UI process), we periodically
2105         message back to the web process main thread with scroll position updates. These
2106         can trigger post-scroll compositing updates, but we need to ensure that this update
2107         doesn't clobber the scroll position of the native layers, which would trigger
2108         stutters.
2109
2110         To do this we have the notion of a scroll position "sync" (ScrollingLayerPositionAction::Sync) which
2111         pokes the new value into the GraphicsLayer (hence making visible rect computations work), but doesn't
2112         propagate it to the platform layer. This patch wires up syncs for macOS during async overflow scrolling,
2113         coming out of AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll().
2114
2115         In RenderLayerBacking, m_scrollingContentsLayer is renamed to m_scrolledContentsLayer, and I added
2116         updateScrollOffset() and setLocationOfScrolledContents() to handle the set vs. sync, and to keep
2117         the iOS vs macOS differences in one function. This allows for more code sharing in RenderLayerBacking::updateGeometry().
2118
2119         There's a confusing bit in the m_childClippingMaskLayer code (trac.webkit.org/178029) where the setOffsetFromRenderer()
2120         just looks wrong; it should match m_scrollingLayer. This code is never hit for Cocoa, which never has m_childClippingMaskLayer.
2121
2122         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2123         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Logging
2124         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Logging
2125         * rendering/RenderLayer.cpp:
2126         (WebCore::RenderLayer::RenderLayer):
2127         (WebCore::RenderLayer::scrollTo):
2128         * rendering/RenderLayer.h: Rename m_requiresScrollBoundsOriginUpdate to m_requiresScrollPositionReconciliation
2129         and make it available on all platforms. Just reorder m_adjustForIOSCaretWhenScrolling to reduce #ifdef nesting confusion.
2130         * rendering/RenderLayerBacking.cpp:
2131         (WebCore::RenderLayerBacking::updateDebugIndicators):
2132         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
2133         (WebCore::RenderLayerBacking::updateGeometry):
2134         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
2135         (WebCore::RenderLayerBacking::updateScrollOffset):
2136         (WebCore::RenderLayerBacking::updateDrawsContent):
2137         (WebCore::RenderLayerBacking::updateScrollingLayers):
2138         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const):
2139         (WebCore::RenderLayerBacking::parentForSublayers const):
2140         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2141         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2142         (WebCore::RenderLayerBacking::paintContents):
2143         (WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
2144         * rendering/RenderLayerBacking.h:
2145
2146 2019-02-02  Zalan Bujtas  <zalan@apple.com>
2147
2148         [LFC] Initialize ICB's style with fixed width/height.
2149         https://bugs.webkit.org/show_bug.cgi?id=194188
2150
2151         Reviewed by Antti Koivisto.
2152
2153         Let's set ICB's logical width/height to Fixed so that it's available when we try to resolve a box's height
2154         in FormattingContext::Geometry::computedHeightValue() by using the containing block's height (ICB in this case).
2155
2156         * layout/LayoutState.cpp:
2157         (WebCore::Layout::LayoutState::LayoutState):
2158         * layout/LayoutState.h:
2159         * layout/layouttree/LayoutTreeBuilder.cpp:
2160         (WebCore::Layout::TreeBuilder::createLayoutTree):
2161
2162 2019-02-02  Zalan Bujtas  <zalan@apple.com>
2163
2164         [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
2165         https://bugs.webkit.org/show_bug.cgi?id=194185
2166
2167         Reviewed by Antti Koivisto.
2168
2169         If none of horizontal values (left, right, width, margin-left/right) are auto, then usedHorizontalMarginValues = computedHorizontalMarginValues.
2170
2171         Test: fast/block/block-only/absolute-position-left-right-margin.html
2172
2173         * layout/FormattingContextGeometry.cpp:
2174         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2175
2176 2018-12-16  Darin Adler  <darin@apple.com>
2177
2178         Convert additional String::format clients to alternative approaches
2179         https://bugs.webkit.org/show_bug.cgi?id=192746
2180
2181         Reviewed by Alexey Proskuryakov.
2182
2183         This round of conversions covers less-trivial cases such as floating
2184         point numerals and hexadecimal. Not yet taking on pointer serialization
2185         ("%p") or padding with spaces of zero digits, so call sites using those
2186         have been left untouched.
2187
2188         In some cases these new idioms are a bit clumsy, and we could follow up
2189         with additional convenience functions to make them more elegant.
2190
2191         * Modules/indexeddb/IDBKeyData.cpp:
2192         (WebCore::IDBKeyData::loggingString const): Use more ASCIILiteral and
2193         more appendLiteral for efficiency. Use upperNibbleToLowercaseASCIIHexDigit,
2194         lowerNibbleToLowercaseASCIIHexDigit, and also makeString and FormattedNumber.
2195
2196         * css/MediaQueryEvaluator.cpp:
2197         (WebCore::aspectRatioValueAsString): Use makeString and FormattedNumber.
2198         Doing it this way makes it a little clearer that we have an unpleasant
2199         use of fixed 6-digit precision here.
2200
2201         * html/FTPDirectoryDocument.cpp:
2202         (WebCore::processFilesizeString): Use makeString and FormattedNumber.
2203         * html/track/VTTCue.cpp:
2204         (WebCore::VTTCueBox::applyCSSProperties): Ditto.
2205         * page/CaptionUserPreferencesMediaAF.cpp:
2206         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const): Ditto.
2207         * page/History.cpp:
2208         (WebCore::History::stateObjectAdded): Ditto.
2209         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2210         (WebCore::formatByteNumber): Ditto.
2211         (WebCore::gcTimerString): Use String::number.
2212         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and FormattedNumber.
2213
2214         * page/scrolling/AxisScrollSnapOffsets.cpp:
2215         (WebCore::snapOffsetsToString): Removed some unnecessary copying in the for loop,
2216         use appendLiteral, and use appendFixedWidthNumber.
2217         (WebCore::snapOffsetRangesToString): Ditto.
2218         (WebCore::snapPortOrAreaToString): Use makeString and FormattedNumber.
2219
2220         * platform/animation/TimingFunction.cpp:
2221         (WebCore::TimingFunction::cssText const): Use makeString.
2222
2223         * platform/cocoa/KeyEventCocoa.mm:
2224         (WebCore::keyIdentifierForCharCode): Use makeString and the ASCIIHexDigit
2225         functions.
2226         * platform/graphics/Color.cpp:
2227         (WebCore::Color::nameForRenderTreeAsText const): Ditto.
2228
2229         * platform/mock/MockRealtimeVideoSource.cpp:
2230         (WebCore::MockRealtimeVideoSource::drawText): Use makeString and FormattedNumber.
2231
2232         * platform/text/PlatformLocale.cpp:
2233         (WebCore::DateTimeStringBuilder::visitField): Use String::numberToStringFixedWidth.
2234
2235 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2236
2237         Remove the unused layerForScrolling()
2238         https://bugs.webkit.org/show_bug.cgi?id=194180
2239
2240         Reviewed by Zalan Bujtas.
2241
2242         Remove ScrollableArea::layerForScrolling() and derivations. This was unused.
2243
2244         * page/FrameView.cpp:
2245         (WebCore::FrameView::layerForScrolling const): Deleted.
2246         * page/FrameView.h:
2247         * page/scrolling/ScrollingCoordinator.cpp:
2248         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea): Deleted.
2249         * page/scrolling/ScrollingCoordinator.h:
2250         * platform/ScrollableArea.h:
2251         (WebCore::ScrollableArea::layerForScrolling const): Deleted.
2252         * rendering/RenderLayer.cpp:
2253         (WebCore::RenderLayer::calculateClipRects const):
2254         * rendering/RenderLayer.h:
2255
2256 2019-02-01  Zalan Bujtas  <zalan@apple.com>
2257
2258         [LFC] Fix statically positioned replaced out-of-flow horizontal geometry
2259         https://bugs.webkit.org/show_bug.cgi?id=194163
2260
2261         Reviewed by Simon Fraser.
2262
2263         Fix a typo.
2264
2265         * layout/FormattingContextGeometry.cpp:
2266         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2267
2268 2019-02-01  Chris Dumez  <cdumez@apple.com>
2269
2270         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
2271         https://bugs.webkit.org/show_bug.cgi?id=193740
2272         <rdar://problem/47527267>
2273
2274         Reviewed by Alex Christensen.
2275
2276         * loader/DocumentLoader.cpp:
2277         (WebCore::DocumentLoader::willSendRequest):
2278         (WebCore::DocumentLoader::continueAfterContentPolicy):
2279         * loader/FrameLoader.cpp:
2280         (WebCore::FrameLoader::loadURL):
2281         (WebCore::FrameLoader::loadWithDocumentLoader):
2282         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2283         * loader/FrameLoader.h:
2284         * loader/FrameLoaderTypes.h:
2285         * loader/PolicyChecker.cpp:
2286         (WebCore::PolicyChecker::checkNavigationPolicy):
2287         (WebCore::PolicyChecker::checkNewWindowPolicy):
2288         * loader/PolicyChecker.h:
2289
2290 2019-02-01  Antoine Quint  <graouts@apple.com>
2291
2292         Dispatch pointercancel events when content is panned or zoomed on iOS
2293         https://bugs.webkit.org/show_bug.cgi?id=193962
2294         <rdar://problem/47629134>
2295
2296         Reviewed by Dean Jackson.
2297
2298         Expose two new methods on PointerCaptureController so that, given a pointer id, it can be established whether this pointer
2299         has been cancelled, which is important because a cancelled pointer should no longer dispatch any further pointer events, and
2300         to cancel a pointer.
2301
2302         Tests: pointerevents/ios/touch-action-pointercancel-pan-x.html
2303                pointerevents/ios/touch-action-pointercancel-pan-y.html
2304                pointerevents/ios/touch-action-pointercancel-pinch-zoom.html
2305
2306         * WebCore.xcodeproj/project.pbxproj: Make PointerCaptureController.h Private so that it can be imported from WebKit.
2307         * dom/PointerEvent.h: Remove an unnecessary #if ENABLE(POINTER_EVENTS) since the entire file is already contained in one.
2308         Then we add a new create() method that takes an event type, a pointer id and a pointer type (touch vs. pen) that we use
2309         to create pointercancel events in PointerCaptureController::cancelPointer().
2310         * page/Page.cpp:
2311         (WebCore::Page::Page): Pass the Page as a parameter when creating the PointerCaptureController.
2312         * page/PointerCaptureController.cpp:
2313         (WebCore::PointerCaptureController::PointerCaptureController): Add a Page reference to the constructor since we'll need
2314         the page to access its main frame's EventHandler to perform hit testing in case we do not have a capture target override
2315         in cancelPointer().
2316         (WebCore::PointerCaptureController::releasePointerCapture): Drive-by, remove the the implicit parameter since on iOS we
2317         don't need to differentiate. We'll bring this back for the macOS work.
2318         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): New method we'll use when dispatching pointer
2319         events to identify whether a pointer id has already been cancelled which will allow for _not_ dispatching any further
2320         pointer events for this pointer id.
2321         (WebCore::PointerCaptureController::pointerEventWillBeDispatched): Keep track of the pointer type so we can preserve it
2322         when dispatching pointercancel events for a given pointer id.
2323         (WebCore::PointerCaptureController::cancelPointer): Dispatch a pointercancel for the provided pointer id, using the capture
2324         target override as the event's target, if there is one, and otherwise hit-testing at the provided location to figure out
2325         what the target should be.
2326         * page/PointerCaptureController.h: Switch the target overrides from Element* to RefPtr<Element> to ensure it may not be
2327         deleted while we still need them. Existing code already ensures these get set to nullptr.
2328
2329 2019-02-01  Jer Noble  <jer.noble@apple.com>
2330
2331         Make the WebKit default for media source based on the WebCore default.
2332         https://bugs.webkit.org/show_bug.cgi?id=194172
2333
2334         Reviewed by Eric Carlson.
2335
2336         * page/SettingsBase.h:
2337
2338 2019-02-01  Joseph Pecoraro  <pecoraro@apple.com>
2339
2340         Web Inspector: Memory timeline starts from zero when both CPU and Memory timeline are enabled
2341         https://bugs.webkit.org/show_bug.cgi?id=194111
2342         <rdar://problem/47714555>
2343
2344         Rubber-stamped by Devin Rousso.
2345
2346         * page/ResourceUsageThread.cpp:
2347         (WebCore::ResourceUsageThread::waitUntilObservers):
2348         (WebCore::ResourceUsageThread::threadBody):
2349         Wait a short period of time before the first listener registers
2350         and we start sampling. This will allow multiple listeners to
2351         register, each that wants different data.
2352
2353 2019-02-01  Antti Koivisto  <antti@apple.com>
2354
2355         Don't use base layer() as the scroll layer in scrolling tree.
2356         https://bugs.webkit.org/show_bug.cgi?id=194160
2357
2358         Reviewed by Simon Fraser.
2359
2360         Maintain scrollContainerLayer() and scrolledContentsLayer() separately in ScrollingTreeScrollingNode.
2361
2362         * page/scrolling/AsyncScrollingCoordinator.cpp:
2363         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2364         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
2365         * page/scrolling/AsyncScrollingCoordinator.h:
2366         * page/scrolling/ScrollingCoordinator.h:
2367         (WebCore::ScrollingCoordinator::setNodeLayers):
2368
2369         Turn the long layer parameter list into a struct.
2370
2371         * page/scrolling/ScrollingStateNode.cpp:
2372         (WebCore::ScrollingStateNode::ScrollingStateNode):
2373         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
2374         (WebCore::ScrollingStateNode::setLayer):
2375         * page/scrolling/ScrollingStateNode.h:
2376         * page/scrolling/ScrollingStateScrollingNode.cpp:
2377         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2378         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
2379         (WebCore::ScrollingStateScrollingNode::setScrollContainerLayer):
2380         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
2381         * page/scrolling/ScrollingStateScrollingNode.h:
2382         (WebCore::ScrollingStateScrollingNode::scrollContainerLayer const):
2383         * page/scrolling/ScrollingTree.cpp:
2384         (WebCore::ScrollingTree::commitTreeState):
2385         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2386         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2387         * page/scrolling/ScrollingTreeScrollingNode.h:
2388         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const):
2389         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const):
2390         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2391         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2392         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
2393         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition const):
2394         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
2395         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
2396         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2397         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2398         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2399         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2400         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2401         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2402         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const):
2403         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2404         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
2405         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2406         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2407         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
2408         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
2409         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2410         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2411         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2412         * rendering/RenderLayerCompositor.cpp:
2413         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2414         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
2415         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2416         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2417
2418 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2419
2420         REGRESSION (r240698): fast/scrolling/sticky-to-fixed.html can cause a crash
2421         https://bugs.webkit.org/show_bug.cgi?id=194134
2422         rdar://problem/47721210
2423
2424         Reviewed by Daniel Bates.
2425
2426         fast/scrolling/sticky-to-fixed.html changes the scrolling node type, which causes
2427         scrollingCoordinator->insertNode() to return a different ScrollingNodeID to the one
2428         passed in. We have to handle this, removing the node for the nodeID and unregistering
2429         the layer with the old nodeID.
2430
2431         * rendering/RenderLayerCompositor.cpp:
2432         (WebCore::RenderLayerCompositor::attachScrollingNode):
2433
2434 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2435
2436         REGRESSION(r239915): css3/font-feature-font-face-local.html failing on WPE
2437         https://bugs.webkit.org/show_bug.cgi?id=194008
2438
2439         Reviewed by Žan Doberšek.
2440
2441         We need to replace control characters with zero width space too.
2442
2443         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2444         (WebCore::GlyphPage::fill):
2445         * platform/text/CharacterProperties.h:
2446         (WebCore::isControlCharacter):
2447
2448 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2449
2450         ComplexText: Test fast/text/word-space-nbsp.html fails when using complex text path
2451         https://bugs.webkit.org/show_bug.cgi?id=193279
2452
2453         Reviewed by Michael Catanzaro.
2454
2455         The fix applied in r135884 to WidthIterator should also be applied to ComplexTextController.
2456
2457         * platform/graphics/ComplexTextController.cpp:
2458         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2459
2460 2019-02-01  Zalan Bujtas  <zalan@apple.com>
2461
2462         [LFC] Adjust replaced element's intrinsic ratio
2463         https://bugs.webkit.org/show_bug.cgi?id=194154
2464
2465         Reviewed by Antti Koivisto.
2466
2467         Decouple image and iframe replaced types and set intrinsic ratio accordingly.
2468
2469         * layout/layouttree/LayoutBox.cpp:
2470         (WebCore::Layout::Box::Box):
2471         * layout/layouttree/LayoutBox.h:
2472         (WebCore::Layout::Box::isReplaced const):
2473         (WebCore::Layout::Box::isIFrame const):
2474         (WebCore::Layout::Box::isImage const):
2475         * layout/layouttree/LayoutReplaced.cpp:
2476         (WebCore::Layout::Replaced::hasIntrinsicRatio const):
2477         (WebCore::Layout::Replaced::intrinsicRatio const):
2478         (WebCore::Layout::Replaced::hasAspectRatio const):
2479         * layout/layouttree/LayoutReplaced.h:
2480         * layout/layouttree/LayoutTreeBuilder.cpp:
2481         (WebCore::Layout::TreeBuilder::createSubTree):
2482
2483 2019-02-01  Zalan Bujtas  <zalan@apple.com>
2484
2485         [LFC] Set intrinsic size on Layout::Replaced
2486         https://bugs.webkit.org/show_bug.cgi?id=194139
2487
2488         Reviewed by Antti Koivisto.
2489
2490         Eventually Layout::Replaced will track intrinsic size internally until then let's query the RenderReplaced. 
2491
2492         * layout/layouttree/LayoutBox.h:
2493         (WebCore::Layout::Box::replaced):
2494         * layout/layouttree/LayoutReplaced.cpp:
2495         (WebCore::Layout::Replaced::hasIntrinsicWidth const):
2496         (WebCore::Layout::Replaced::hasIntrinsicHeight const):
2497         (WebCore::Layout::Replaced::intrinsicWidth const):
2498         (WebCore::Layout::Replaced::intrinsicHeight const):
2499         * layout/layouttree/LayoutReplaced.h:
2500         (WebCore::Layout::Replaced::setIntrinsicSize):
2501         (WebCore::Layout::Replaced::setIntrinsicRatio):
2502         * layout/layouttree/LayoutTreeBuilder.cpp:
2503         (WebCore::Layout::TreeBuilder::createSubTree):
2504         * rendering/RenderReplaced.h:
2505
2506 2019-02-01  Claudio Saavedra  <csaavedra@igalia.com>
2507
2508         Race-condition during scrolling thread creation
2509         https://bugs.webkit.org/show_bug.cgi?id=194016
2510
2511         Reviewed by Saam Barati.
2512
2513         There is a threading issue during the initialization
2514         of the scrolling thread caused by createThreadIfNeeded
2515         locking only on the creation of the thread but not on
2516         the initialization of the main loop, making it possible
2517         for a thread to try to spin the main loop before it's
2518         created.
2519
2520         Fix this by unconditionally waiting on the main loop
2521         being created. This makes it necessary to always hold
2522         the lock, even when the thread is already created.
2523
2524         * page/scrolling/ScrollingThread.cpp:
2525         (WebCore::ScrollingThread::createThreadIfNeeded):
2526
2527 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2528
2529         Use ScrollingNodeID in more places, and improve the name of a ScrollableArea function that returns a ScrollingNodeID
2530         https://bugs.webkit.org/show_bug.cgi?id=194126
2531
2532         Reviewed by Frédéric Wang.
2533         
2534         Change uint64_t ScrollableArea::scrollLayerID() to ScrollingNodeID ScrollableArea::scrollingNodeID()
2535         and fix callers.
2536
2537         * page/FrameView.cpp:
2538         (WebCore::FrameView::scrollingNodeID const):
2539         (WebCore::FrameView::scrollLayerID const): Deleted.
2540         * page/FrameView.h:
2541         * page/scrolling/AsyncScrollingCoordinator.cpp:
2542         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2543         (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
2544         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2545         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2546         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
2547         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2548         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2549         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
2550         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2551         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
2552         (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
2553         (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
2554         * page/scrolling/ScrollingCoordinatorTypes.h:
2555         * platform/ScrollTypes.h:
2556         * platform/ScrollableArea.h:
2557         (WebCore::ScrollableArea::scrollingNodeID const):
2558         (WebCore::ScrollableArea::scrollLayerID const): Deleted.
2559         * rendering/RenderLayerCompositor.cpp:
2560         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2561         (WebCore::RenderLayerCompositor::detachRootLayer):
2562
2563 2019-01-31  Myles C. Maxfield  <mmaxfield@apple.com>
2564
2565         [WHLSL] Expressions can't be copyable
2566         https://bugs.webkit.org/show_bug.cgi?id=194116
2567
2568         Reviewed by Keith Rollin.
2569
2570         Expressions have UniqueRef members, which can't be copied. Describe this constraint explicitly rather than implicitly.
2571
2572         No new tests because there is no behavior change.
2573
2574         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2575         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2576
2577 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
2578
2579         [Curl] Remove unnecessary member from NetworkStorageSession.
2580         https://bugs.webkit.org/show_bug.cgi?id=194137
2581
2582         Reviewed by Don Olmstead.
2583
2584         No new tests since there is no behavior change.
2585
2586         * platform/network/NetworkStorageSession.h:
2587         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2588         (WebCore::NetworkStorageSession::NetworkStorageSession):
2589         (WebCore::NetworkStorageSession::context const): Deleted.
2590
2591 2019-01-31  Jer Noble  <jer.noble@apple.com>
2592
2593         NSInvalidArgumentException in [WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]
2594         https://bugs.webkit.org/show_bug.cgi?id=194123
2595         <rdar://problem/47721094>
2596
2597         Reviewed by Eric Carlson.
2598
2599         According to crash logs, AVSampleBufferDisplayLayer.error can go from an NSError* to nil; when such a change is KVO'd,
2600         the NSKeyValueChangeNewKey is a NSNull. Detect this state and bail out early.
2601
2602         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2603         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2604
2605 2019-01-31  Jer Noble  <jer.noble@apple.com>
2606
2607         [Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt
2608         https://bugs.webkit.org/show_bug.cgi?id=194114
2609
2610         Reviewed by Eric Carlson.
2611
2612         The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key
2613         requests to the AVContentKeySession.
2614
2615         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2616         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2617
2618 2019-01-31  Megan Gardner  <megan_gardner@apple.com>
2619
2620         Don't insert spaces at the beginning of a newline when using smart-copy-paste
2621         https://bugs.webkit.org/show_bug.cgi?id=194070
2622
2623         Reviewed by Tim Horton.
2624
2625         If our inserted content end is at the beginning of a paragraph, do not insert a space.
2626         Also, if our inserted content beginning is at the end of a paragraph, do not insert a space.
2627
2628         Test: editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html
2629
2630         * editing/ReplaceSelectionCommand.cpp:
2631         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
2632
2633 2019-01-31  Justin Fan  <justin_fan@apple.com>
2634
2635         [WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
2636         https://bugs.webkit.org/show_bug.cgi?id=194120
2637
2638         Unreviewed build fix. 
2639
2640         No new tests; no change in behavior.
2641
2642         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2643         (WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).
2644
2645 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
2646
2647         Basic scrollability for async overflow scrolling on macOS
2648         https://bugs.webkit.org/show_bug.cgi?id=194093
2649
2650         Reviewed by Antti Koivisto.
2651
2652         Give a ScrollingTreeOverflowScrollingNodeMac a ScrollingTreeScrollingNodeDelegateMac and have it keep track
2653         of its layers so basic scrolling works for async overflow scroll.
2654
2655         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2656         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2657         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
2658         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
2659         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
2660         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
2661         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
2662         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
2663         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
2664         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2665         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2666         * rendering/RenderLayerBacking.cpp:
2667         (WebCore::RenderLayerBacking::updateScrollingLayers):
2668
2669 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
2670
2671         Generalize ScrollingTreeScrollingNodeDelegate for use in macOS too, add a macOS subclass for frame/overflow scrolling
2672         https://bugs.webkit.org/show_bug.cgi?id=194080
2673
2674         Reviewed by Antti Koivisto.
2675
2676         To share code between ScrollingTreeFrameScrollingNodeMac and ScrollingTreeOverflowScrollingNodeMac, build ScrollingTreeScrollingNodeDelegate
2677         for macOS too, and add some helper functions to ScrollingTreeScrollingNodeDelegate.
2678
2679         Add a macOS subclass, ScrollingTreeScrollingNodeDelegateMac, which takes over the basic scrolling, rubber-banding
2680         and scroll snapping functionality from ScrollingTreeFrameScrollingNodeMac. The delegate owns the ScrollController and
2681         implements ScrollControllerClient.
2682
2683         ScrollingTreeFrameScrollingNodeMac now owns a ScrollingTreeScrollingNodeDelegateMac. A future patch
2684         will add one to ScrollingTreeOverflowScrollingNodeMac.
2685
2686         No behavior change.
2687
2688         * SourcesCocoa.txt:
2689         * WebCore.xcodeproj/project.pbxproj:
2690         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2691         (WebCore::ScrollingTreeFrameScrollingNode::scrollBy): Deleted.
2692         (WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
2693         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2694         (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor const):
2695         * page/scrolling/ScrollingTreeNode.cpp:
2696         (WebCore::ScrollingTreeNode::isRootNode const):
2697         * page/scrolling/ScrollingTreeNode.h:
2698         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2699         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2700         (WebCore::ScrollingTreeScrollingNode::scrollBy):
2701         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints):
2702         * page/scrolling/ScrollingTreeScrollingNode.h:
2703         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const):
2704         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
2705         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
2706         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const):
2707         (WebCore::ScrollingTreeScrollingNodeDelegate::minimumScrollPosition const):
2708         (WebCore::ScrollingTreeScrollingNodeDelegate::maximumScrollPosition const):
2709         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollableAreaSize const):
2710         (WebCore::ScrollingTreeScrollingNodeDelegate::totalContentsSize const):
2711         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const):
2712         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const):
2713         (WebCore::ScrollingTreeScrollingNodeDelegate::horizontalScrollElasticity const):
2714         (WebCore::ScrollingTreeScrollingNodeDelegate::verticalScrollElasticity const):
2715         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2716         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2717         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2718         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2719         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2720         (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition const):
2721         (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition const):
2722         (WebCore::newGestureIsStarting): Deleted.
2723         (WebCore::ScrollingTreeFrameScrollingNodeMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
2724         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching): Deleted.
2725         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching): Deleted.
2726         (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount): Deleted.
2727         (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection): Deleted.
2728         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally): Deleted.
2729         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically): Deleted.
2730         (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection): Deleted.
2731         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): Deleted.
2732         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints): Deleted.
2733         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
2734         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary): Deleted.
2735         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset const): Deleted.
2736         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Deleted.
2737         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor const): Deleted.
2738         (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Deleted.
2739         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Deleted.
2740         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtent const): Deleted.
2741         (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize const): Deleted.
2742         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason const): Deleted.
2743         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason const): Deleted.
2744         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h.
2745         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Added.
2746         (WebCore::ScrollingTreeScrollingNodeDelegateMac::ScrollingTreeScrollingNodeDelegateMac):
2747         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollSnapPoints):
2748         (WebCore::ScrollingTreeScrollingNodeDelegateMac::setActiveScrollSnapIndexForAxis):
2749         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexForAxis const):
2750         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexDidChange const):
2751         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
2752         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isScrollSnapInProgress const):
2753         (WebCore::newGestureIsStarting):
2754         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
2755         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching):
2756         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching):
2757         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
2758         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
2759         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally):
2760         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically):
2761         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection):
2762         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy):
2763         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
2764         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer):
2765         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
2766         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
2767         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
2768         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pageScaleFactor const):
2769         (WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer):
2770         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer):
2771         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollExtent const):
2772         (WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const):
2773         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
2774         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
2775
2776 2019-01-31  Jer Noble  <jer.noble@apple.com>
2777
2778         [Mac] Requesting PiP from two different WebViews gets PiP window "stuck"
2779         https://bugs.webkit.org/show_bug.cgi?id=194099
2780         <rdar://problem/47271323>
2781
2782         Reviewed by Eric Carlson.
2783
2784         When a different client requests the PiP window, the PiP framework will call -pipDidClose: without
2785         first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where
2786         the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two
2787         WebViews will constantly try to steal PiP from one another, ad infinitum.
2788
2789         When receiving a notification that the PiP window closed when our internal state tells us that the
2790         close was not requested, notify the client that PiP mode was exited, allowing them to set their
2791         expected state to a correct and sane value.
2792
2793         * platform/mac/VideoFullscreenInterfaceMac.mm:
2794         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2795
2796 2019-01-31  Keith Rollin  <krollin@apple.com>
2797
2798         WebCore::WHLSL::AST::Expression copy constructor needs to be be default, not delete
2799         https://bugs.webkit.org/show_bug.cgi?id=194055
2800         <rdar://problem/47684570>
2801
2802         Reviewed by Myles C. Maxfield.
2803
2804         WebCore::WHLSL::AST::Expression has a deleted copy constructor.
2805         EnumerationMemberLiteral, a subclass, has a default copy constructor.
2806         Some compilers may complain that the latter's c'tor can't access the
2807         former's, because it doesn't exist. Fix this by marking Expression's
2808         c'tor as default.
2809
2810         No new tests since there should be no observable behavior difference.
2811
2812         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2813
2814 2019-01-31  Alex Christensen  <achristensen@webkit.org>
2815
2816         Revert r238819 which is unneeded and caused a performance regression.
2817         https://bugs.webkit.org/show_bug.cgi?id=192272
2818         <rdar://problem/46664625>
2819
2820         * loader/EmptyFrameLoaderClient.h:
2821         * loader/FrameLoader.cpp:
2822         (WebCore::FrameLoader::prepareForLoadStart):
2823         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2824         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
2825         * loader/FrameLoader.h:
2826         * loader/FrameLoaderClient.h:
2827
2828 2019-01-31  Justin Fan  <justin_fan@apple.com>
2829
2830         [WebGPU] WebGPUAdapterDescriptor -> GPURequestAdapterOptions and take powerPreference into account
2831         https://bugs.webkit.org/show_bug.cgi?id=194068
2832         <rdar://problem/47680215>
2833
2834         Reviewed by Dean Jackson.
2835         
2836         Per the Web GPU IDL, WebGPUAdapterDescriptor is now known as GPURequestAdapterOptions and is optional.
2837         In addition, Web GPU now actually attempts to return an integrated GPU when a low-power adapter is requested.
2838
2839         Test: adapter-options.html
2840
2841         * Modules/webgpu/GPURequestAdapterOptions.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.idl.
2842         * Modules/webgpu/WebGPU.cpp:
2843         (WebCore::WebGPU::requestAdapter const):
2844         * Modules/webgpu/WebGPU.h:
2845         * Modules/webgpu/WebGPU.idl:
2846         * Modules/webgpu/WebGPUAdapter.cpp:
2847         (WebCore::WebGPUAdapter::create):
2848         (WebCore::WebGPUAdapter::WebGPUAdapter):
2849         * Modules/webgpu/WebGPUAdapter.h:
2850         (WebCore::WebGPUAdapter::options const):
2851         * Modules/webgpu/WebGPUDevice.cpp:
2852         (WebCore::WebGPUDevice::create):
2853         * platform/graphics/gpu/GPUDevice.h:
2854         * platform/graphics/gpu/GPURequestAdapterOptions.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.h.
2855         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2856         (WebCore::GPUDevice::create):
2857
2858 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
2859
2860         Formalize WebKitAdditions mechanism of LoadOptimizer
2861         https://bugs.webkit.org/show_bug.cgi?id=193886
2862         <rdar://problem/47696809>
2863
2864         Reviewed by Brent Fulgham.
2865
2866         Covered by existing tests.
2867
2868         * platform/network/ResourceRequestBase.h:
2869         Export isolatedCopy().
2870
2871 2019-01-31  Jer Noble  <jer.noble@apple.com>
2872
2873         [Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME
2874         https://bugs.webkit.org/show_bug.cgi?id=193988
2875
2876         Reviewed by Jon Lee.
2877
2878         Modern EME is writing SecureStop data as a file at the same path as the
2879         directory used by Legacy EME; meaning, when Modern EME attempts to write
2880         to that file, it will fail because a directory exists at the same path.
2881
2882         Add a migration step to take care of those instances where Modern EME Secure
2883         Stop data was already written to disk, and move that previously written data
2884         to the correct file path.
2885
2886         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2887         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2888         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
2889         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
2890         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
2891         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
2892         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
2893         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
2894
2895 2019-01-31  Antti Koivisto  <antti@apple.com>
2896
2897         Call the frame main contents layer "rootContentsLayer" consistently.
2898         https://bugs.webkit.org/show_bug.cgi?id=194089
2899
2900         Reviewed by Simon Fraser.
2901
2902         This is currently called "rootContentLayer" in the compositor and "scrolledContentsLayer" in the scrolling tree.
2903         We want to reserve term "scrolledContentsLayer" to mean the direct child layer of the  scroll container layer
2904         without any positioning oddities (which this isn't).
2905
2906         * page/scrolling/AsyncScrollingCoordinator.cpp:
2907         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2908         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2909         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
2910
2911         Set the rootContentsLayer for frame. It is only used by the Mac frame scrolling code.
2912
2913         * page/scrolling/AsyncScrollingCoordinator.h:
2914         * page/scrolling/ScrollingCoordinator.cpp:
2915         (WebCore::ScrollingCoordinator::rootContentsLayerForFrameView):
2916         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView): Deleted.
2917         * page/scrolling/ScrollingCoordinator.h:
2918         (WebCore::ScrollingCoordinator::setNodeLayers):
2919         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2920         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2921         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2922         (WebCore::ScrollingStateFrameScrollingNode::setRootContentsLayer):
2923         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2924         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2925
2926         Introduce rootContentLayer for frames only.
2927
2928         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2929         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2930         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2931         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2932
2933         Switch to using rootContentsLayer.
2934
2935         * rendering/RenderLayerCompositor.cpp:
2936         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2937         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2938         (WebCore::RenderLayerCompositor::updateRootContentLayerClipping):
2939         (WebCore::RenderLayerCompositor::layerTreeAsText):
2940         (WebCore::RenderLayerCompositor::rootGraphicsLayer const):
2941         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2942         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
2943         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
2944         (WebCore::RenderLayerCompositor::updateLayerForHeader):
2945         (WebCore::RenderLayerCompositor::updateLayerForFooter):
2946         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2947         (WebCore::RenderLayerCompositor::ensureRootLayer):
2948         (WebCore::RenderLayerCompositor::destroyRootLayer):
2949         (WebCore::RenderLayerCompositor::attachRootLayer):
2950         (WebCore::RenderLayerCompositor::detachRootLayer):
2951         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
2952         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2953
2954         Pass rootContentsLayer separately for frames only.
2955         Pass null as frame scrolledContentsLayer until these are rearranged (it is not used).
2956
2957         * rendering/RenderLayerCompositor.h:
2958
2959 2019-01-31  Keith Rollin  <krollin@apple.com>
2960
2961         GCGamepad is deprecated
2962         https://bugs.webkit.org/show_bug.cgi?id=194056
2963         <rdar://problem/47685010>
2964
2965         Reviewed by Brady Eidson.
2966
2967         GCGamepad is deprecated, resulting in compiler warnings. Address this
2968         for now by employing ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
2969
2970         No new tests since there should be no observable behavior difference.
2971
2972         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2973         (WebCore::GameControllerGamepad::setupAsGamepad):
2974
2975 2019-01-31  Darin Adler  <darin@apple.com>
2976
2977         Simplify and streamline code that creates an appropriate document based on MIME type
2978         https://bugs.webkit.org/show_bug.cgi?id=193756
2979
2980         Reviewed by Chris Dumez.
2981
2982         * dom/DOMImplementation.cpp:
2983         (WebCore::DOMImplementation::createDocument): Use equalLettersIgnoringASCIICase rather
2984         than == for all the MIME type checks. Use MIMETypeRegistry::isSupportedImageMIMEType
2985         instead of Image::supportsType. Rearranged checks so that all the combinations that
2986         that take precedence over plug-ins are checked first, fixing some unimportant edge
2987         cases where the plug-in database is initialized and doesn't need to be. Straightened
2988         out the logic for various special types so that the checks are more independent from
2989         each other and hence easier to understand.
2990
2991 2019-01-31  Alicia Boya García  <aboya@igalia.com>
2992
2993         [MSE][GStreamer] Unreviewed debug build fix, obsolete assert
2994
2995         Since m_playerPrivate is now a reference, it no longer has a default
2996         cast to bool. But there is also no longer a need to assert it's non
2997         null, so just remove the assert.
2998
2999         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3000         (WebCore::MediaSourceClientGStreamerMSE::append):
3001
3002 2019-01-31  Alicia Boya García  <aboya@igalia.com>
3003
3004         [MSE][GStreamer] Use reference instead of pointer in m_playerPrivate
3005         https://bugs.webkit.org/show_bug.cgi?id=194091
3006
3007         Reviewed by Xabier Rodriguez-Calvar.
3008
3009         Since the pointer is initialized with the class, it's never null and
3010         never changes, it's preferrable to use a reference instead of a
3011         pointer.
3012
3013         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3014         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
3015         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
3016         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
3017         (WebCore::MediaSourceClientGStreamerMSE::abort):
3018         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
3019         (WebCore::MediaSourceClientGStreamerMSE::append):
3020         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
3021         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
3022         (WebCore::MediaSourceClientGStreamerMSE::flush):
3023         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
3024         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
3025         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
3026         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3027
3028 2019-01-31  Alexander Mikhaylenko  <exalm7659@gmail.com>
3029
3030         [GTK] Momentum scrolling stops abruptly before websites end
3031         https://bugs.webkit.org/show_bug.cgi?id=193350
3032
3033         Reviewed by Carlos Garcia Campos.
3034
3035         Don't immediately set velocity to 0 when position reaches upper or bottom limit.
3036         Instead, set it to the overshot distance, so that position exactly matches upper
3037         or lower limit on the next frame, and then clamp velocity to 0 using the existing
3038         mechanism.
3039
3040         * platform/ScrollAnimationKinetic.cpp:
3041         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
3042
3043 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
3044
3045         Unreviewed, fix incorrect string format
3046         https://bugs.webkit.org/show_bug.cgi?id=193907
3047         <rdar://problem/47604080>
3048
3049         * page/scrolling/ScrollingTree.cpp:
3050         (WebCore::ScrollingTree::commitTreeState):
3051
3052 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
3053
3054         [Mac] Implement basic hit testing in the scrolling tree
3055         https://bugs.webkit.org/show_bug.cgi?id=172917
3056         <rdar://problem/34215516>
3057
3058         Reviewed by Antti Koivisto.
3059
3060         First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch
3061         by Frédéric Wang.
3062
3063         First we pipe the "async scrolling enabled" setting through to the ScrollingTree via
3064         the root node (like the other settings; weird, but that's how it's done). For now,
3065         we hit test in the scrolling tree if either async overflow or frame scrolling are enabled
3066         (it's hard to deal with one without the other).
3067
3068         Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing.
3069         Two helper functions exist to simplify coordinate conversion: parentToLocalPoint()
3070         and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes
3071         hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need
3072         to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions
3073         to do these point mappings.
3074
3075         handleWheelEvent() is changed to return a ScrollingEventResult.
3076
3077         Latching is not correct with this change when async frame scrolling is enabled. That needs
3078         to be fixed separately.
3079
3080         No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the
3081         scrolling tree, rather than doing eventSender stuff everywhere.
3082
3083         * page/scrolling/AsyncScrollingCoordinator.cpp:
3084         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3085         (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const):
3086         * page/scrolling/AsyncScrollingCoordinator.h:
3087         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3088         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3089         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
3090         (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled):
3091         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3092         * page/scrolling/ScrollingTree.cpp:
3093         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
3094         (WebCore::ScrollingTree::handleWheelEvent):
3095         (WebCore::ScrollingTree::commitTreeState):
3096         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
3097         * page/scrolling/ScrollingTree.h:
3098         (WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const):
3099         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3100         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const):
3101         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3102         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3103         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const):
3104         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
3105         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3106         * page/scrolling/ScrollingTreeNode.cpp:
3107         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const):
3108         * page/scrolling/ScrollingTreeNode.h:
3109         (WebCore::ScrollingTreeNode::children const):
3110         (WebCore::ScrollingTreeNode::parentToLocalPoint const):
3111         (WebCore::ScrollingTreeNode::localToContentsPoint const):
3112         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3113         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
3114         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const):
3115         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
3116         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const):
3117         * page/scrolling/ScrollingTreeScrollingNode.h:
3118         * page/scrolling/ThreadedScrollingTree.cpp:
3119         (WebCore::ThreadedScrollingTree::handleWheelEvent):
3120         * page/scrolling/ThreadedScrollingTree.h:
3121         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
3122         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3123         (WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent):
3124         * page/scrolling/ios/ScrollingTreeIOS.h:
3125         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3126         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3127         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3128         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3129
3130 2019-01-31  Alicia Boya García  <aboya@igalia.com>
3131
3132         [MSE][GStreamer] Remove unused GstFlowReturn in AppendPipeline methods
3133         https://bugs.webkit.org/show_bug.cgi?id=194067
3134
3135         Reviewed by Xabier Rodriguez-Calvar.
3136
3137         A couple methods in AppendPipeline were returning GstFlowReturn
3138         despite there being no codepath (sans assertions) where values other
3139         than GST_FLOW_OK are returned.
3140
3141         Therefore, it makes sense to just make these methods return void.
3142
3143         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3144         (WebCore::AppendPipeline::pushNewBuffer):
3145         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
3146         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3147         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3148         (WebCore::MediaSourceClientGStreamerMSE::append):
3149         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3150         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
3151         (WebCore::SourceBufferPrivateGStreamer::append):
3152
3153 2019-01-31  Alicia Boya García  <aboya@igalia.com>
3154
3155         [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
3156         https://bugs.webkit.org/show_bug.cgi?id=194069
3157
3158         Reviewed by Xabier Rodriguez-Calvar.
3159
3160         m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
3161         creation well until its destruction.
3162
3163         The only case that could make a NULL m_playerPrivate is
3164         clearPlayerPrivate() but that method is not used anymore.
3165
3166         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3167         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
3168         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
3169         (WebCore::MediaSourceClientGStreamerMSE::abort):
3170         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
3171         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
3172         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
3173         (WebCore::MediaSourceClientGStreamerMSE::flush):
3174         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
3175         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
3176         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
3177         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
3178         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3179
3180 2019-01-31  Thibault Saunier  <tsaunier@igalia.com>
3181
3182         [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
3183         https://bugs.webkit.org/show_bug.cgi?id=194087
3184
3185         Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
3186         meaning that it makes sense that when any of the downstream pad is returning flushing, you should
3187         return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
3188         *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
3189         source element task to PAUSED (because downstream returned flushing) on a branch that was not
3190         flushing!
3191
3192         Reviewed by Philippe Normand.
3193
3194         This is a theorical race we can't really cover with tests.
3195
3196         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
3197         (WebCore::webkitMediaStreamSrcChain):
3198
3199 2019-01-31  Zalan Bujtas  <zalan@apple.com>
3200
3201         [LFC] Margin before/after/start/end initial value is 0 and not auto.
3202         https://bugs.webkit.org/show_bug.cgi?id=194090
3203
3204         Reviewed by Antti Koivisto.
3205
3206         Don't treat it like auto.
3207
3208         * layout/FormattingContextGeometry.cpp:
3209         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3210         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3211
3212 2019-01-31  Zalan Bujtas  <zalan@apple.com>
3213
3214         [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
3215         https://bugs.webkit.org/show_bug.cgi?id=194074
3216
3217         Reviewed by Antti Koivisto.
3218
3219         Check the used margin variables whether we already computed start/end values.
3220
3221         Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
3222
3223         * layout/FormattingContextGeometry.cpp:
3224         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3225
3226 2019-01-31  Zalan Bujtas  <zalan@apple.com>
3227
3228         [LFC][BFC] Add support for block level replaced box.
3229         https://bugs.webkit.org/show_bug.cgi?id=194071
3230
3231         Reviewed by Antti Koivisto.
3232
3233         * layout/layouttree/LayoutBox.cpp:
3234         (WebCore::Layout::Box::Box):
3235         * layout/layouttree/LayoutBox.h:
3236         * layout/layouttree/LayoutTreeBuilder.cpp:
3237         (WebCore::Layout::TreeBuilder::createSubTree):
3238         (WebCore::Layout::outputLayoutBox):
3239
3240 2019-01-31  Chris Fleizach  <cfleizach@apple.com>
3241
3242         ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
3243         https://bugs.webkit.org/show_bug.cgi?id=189094
3244         <rdar://problem/43853526>
3245
3246         Reviewed by Zalan Bujtas.
3247
3248         Protect against access to objects and cache's that can be removed while an object is still in memory.
3249
3250         Unskipped flaky tests on mac-wk2.
3251
3252         * accessibility/mac/AXObjectCacheMac.mm:
3253         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
3254         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3255         (textMarkerForVisiblePosition):
3256         (textMarkerRangeFromVisiblePositions):
3257
3258 2019-01-30  Chris Dumez  <cdumez@apple.com>
3259
3260         Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
3261         https://bugs.webkit.org/show_bug.cgi?id=194023
3262         <rdar://problem/47417981>
3263
3264         Reviewed by Geoffrey Garen.
3265
3266         The issue was caused by the 'isTopSite' flag not getting properly set on the network request
3267         in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
3268         not getting its same-site lax cookies.
3269
3270         The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
3271         bypassing this method entirely when continuing a load in a new process after a swap. This was
3272         intentional as the network request is normally already fully populated by the previous process
3273         and we do not want the new process to modify the request in any way (e.g. we would not want to
3274         add a Origin header back after it was removed by the previous process). However, in case of a
3275         History navigation, we do not actually pass a request along from one process to another. Instead,
3276         we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
3277         In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
3278         we are technically continuing a load in a new process.
3279
3280         We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
3281         continuing a load with a request and not when we're continuing a load with a HistoryItem.
3282
3283         Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
3284
3285         * loader/FrameLoader.cpp:
3286         (WebCore::FrameLoader::load):
3287         (WebCore::FrameLoader::loadWithDocumentLoader):
3288         (WebCore::FrameLoader::addExtraFieldsToRequest):
3289         (WebCore::FrameLoader::loadDifferentDocumentItem):
3290         * loader/FrameLoader.h:
3291         (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
3292
3293 2019-01-30  Justin Fan  <justin_fan@apple.com>
3294
3295         [WebGPU] Support GPUDepthStencilStateDescriptor
3296         https://bugs.webkit.org/show_bug.cgi?id=194048
3297         <rdar://problem/46289645>
3298
3299         Reviewed by Dean Jackson.
3300
3301         Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
3302
3303         Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect 
3304         without a depth texture attached.
3305
3306         New interface files added:
3307         * Modules/webgpu/GPUCompareFunction.idl:
3308         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
3309         * platform/graphics/gpu/GPUCompareFunction.h:
3310         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
3311
3312         Modifications:
3313         * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
3314         (WebCore::WebGPUDevice::createRenderPipeline const):
3315         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
3316         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
3317         * platform/graphics/gpu/GPURenderPipeline.h: Ditto.
3318         (WebCore::GPURenderPipeline::depthStencilState const): Getter.
3319         (WebCore::GPURenderPipeline::platformRenderPipeline const):
3320         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
3321         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
3322         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
3323         (WebCore::GPURenderPassEncoder::setPipeline):
3324         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
3325         (WebCore::validateAndConvertDepthCompareFunctionToMtl):
3326         (WebCore::tryCreateMtlDepthStencilState):
3327         (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
3328         (WebCore::GPURenderPipeline::create):
3329         (WebCore::GPURenderPipeline::GPURenderPipeline):
3330
3331         Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
3332         * CMakeLists.txt:
3333         * DerivedSources.make:
3334         * Sources.txt:
3335         * WebCore.xcodeproj/project.pbxproj:
3336
3337         * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
3338
3339 2019-01-30  Jer Noble  <jer.noble@apple.com>
3340
3341         [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
3342         https://bugs.webkit.org/show_bug.cgi?id=193984
3343
3344         Reviewed by Eric Carlson.
3345
3346         MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
3347         KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
3348         after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
3349         completion handler is called.
3350
3351         Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
3352         changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
3353
3354         * Modules/encryptedmedia/MediaKeySession.cpp:
3355         (WebCore::MediaKeySession::sessionIdChanged):
3356         * Modules/encryptedmedia/MediaKeySession.h:
3357         * platform/encryptedmedia/CDMInstanceSession.h:
3358         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3359         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3360         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
3361
3362 2019-01-30  Keith Rollin  <krollin@apple.com>
3363
3364         FloatWithRect has invalid and inaccessible default constructor
3365         https://bugs.webkit.org/show_bug.cgi?id=194057
3366         <rdar://problem/47685211>
3367
3368         Reviewed by Zalan Bujtas.
3369
3370         FloatWithRect has a default constructor declared as 'default'. This
3371         constructor is invalid because FloatWithRect has a data member that's
3372         a reference that will not get initialized with this constructor. Since
3373         it's invalid, and since it's private and not accessed by anything,
3374         remove this constructor.
3375
3376         No new tests since there should be no observable behavior difference.
3377
3378         * rendering/line/LineLayoutState.h:
3379
3380 2019-01-30  Daniel Bates  <dabates@apple.com>
3381
3382         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
3383         https://bugs.webkit.org/show_bug.cgi?id=192824
3384         <rdar://problem/47100332>
3385
3386         Reviewed by Wenson Hsieh.
3387
3388         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
3389         now that hardware key events to non-editable elements use the same code path as for editable elements. 
3390
3391         * platform/ios/KeyEventIOS.mm:
3392         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
3393         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
3394         (WebCore::isFunctionKey): Ditto.
3395         * platform/ios/WebEvent.mm:
3396         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
3397         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
3398
3399 2019-01-30  Jer Noble  <jer.noble@apple.com>
3400
3401         Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
3402         https://bugs.webkit.org/show_bug.cgi?id=194063
3403
3404         Reviewed by Jon Lee.
3405
3406         * DerivedSources.make:
3407
3408 2019-01-30  Youenn Fablet  <youenn@apple.com>
3409
3410         Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
3411         https://bugs.webkit.org/show_bug.cgi?id=193747
3412         <rdar://problem/47498196>
3413
3414         Reviewed by Chris Dumez.
3415
3416         Make ServiceWorkerJob be no longer ref counted.
3417         Instead its lifetime is fully controlled by ServiceWorkerContainer.
3418
3419         Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
3420         This allows to ensure that these jobs do not stay forever.
3421         Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
3422
3423         Before the patch, unsetPendingActivity was only called for successful jobs finishing.
3424         In case of failing loads, ServiceWorkerContainer would leak.
3425         Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
3426         a pending activity in the job map next to the job.
3427
3428         When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
3429         This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
3430
3431         Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
3432         Update type of exception to be SecurityError when load fails due to AccessControl.
3433
3434         Covered by existing tests.
3435
3436         * workers/service/ServiceWorkerContainer.cpp:
3437         (WebCore::ServiceWorkerContainer::addRegistration):
3438         (WebCore::ServiceWorkerContainer::removeRegistration):
3439         (WebCore::ServiceWorkerContainer::updateRegistration):
3440         (WebCore::ServiceWorkerContainer::scheduleJob):
3441         (WebCore::ServiceWorkerContainer::jobFailedWithException):
3442         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3443         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
3444         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
3445         (WebCore::ServiceWorkerContainer::jobDidFinish):
3446         (WebCore::ServiceWorkerContainer::stop):
3447         (WebCore::ServiceWorkerContainer::job):
3448         * workers/service/ServiceWorkerContainer.h:
3449         * workers/service/ServiceWorkerJob.cpp:
3450         (WebCore::ServiceWorkerJob::failedWithException):
3451         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
3452         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
3453         (WebCore::ServiceWorkerJob::startScriptFetch):
3454         (WebCore::ServiceWorkerJob::didReceiveResponse):
3455         (WebCore::ServiceWorkerJob::notifyFinished):
3456         (WebCore::ServiceWorkerJob::cancelPendingLoad):
3457         * workers/service/ServiceWorkerJob.h:
3458         (WebCore::ServiceWorkerJob::hasPromise const):
3459         (WebCore::ServiceWorkerJob::takePromise):
3460         * workers/service/ServiceWorkerJobClient.h:
3461         * workers/service/server/SWServerJobQueue.cpp:
3462         (WebCore::SWServerJobQueue::scriptFetchFinished):
3463
3464 2019-01-30  Dean Jackson  <dino@apple.com>
3465
3466         PointerEvents - tiltX and tiltY are reversed
3467         https://bugs.webkit.org/show_bug.cgi?id=194032
3468         <rdar://problem/47674184>
3469
3470         Reviewed by Jon Lee.
3471
3472         I got tiltX and tiltY the wrong way around.
3473
3474         * dom/ios/PointerEventIOS.cpp: Flip the values.
3475
3476 2019-01-30  Zalan Bujtas  <zalan@apple.com>
3477
3478         [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
3479         https://bugs.webkit.org/show_bug.cgi?id=194001
3480
3481         Reviewed by Antti Koivisto.
3482
3483         Skip to the next position manually. This is exactly what we do in simple line layout.
3484
3485         * layout/inlineformatting/InlineRunProvider.cpp:
3486         (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
3487
3488 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
3489
3490         Add some basic geometry information to the scrolling tree
3491         https://bugs.webkit.org/show_bug.cgi?id=194002
3492         rdar://problem/47656294
3493
3494         Reviewed by Antti Koivisto.
3495
3496         To allow hit-testing in the scrolling tree, store a parent-relative scrollable
3497         rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
3498         of the scrollable area, and whose origin is relative to the parent scrolling tree node.
3499         
3500         Frame hosting nodes need this rect because they take care of the geometry offset between
3501         an iframe and its scrolling tree ancestor in the parent document.
3502         
3503         Based on a patch by Frédéric Wang in bug 172917.
3504
3505         * page/scrolling/AsyncScrollingCoordinator.cpp:
3506         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
3507         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
3508         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
3509         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
3510         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
3511         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
3512         * page/scrolling/ScrollingStateFrameHostingNode.h:
3513         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3514         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
3515         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
3516         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3517         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
3518         * rendering/RenderLayer.h:
3519         * rendering/RenderLayerBacking.cpp:
3520         (WebCore::RenderLayerBacking::updateScrollingLayers):
3521         * rendering/RenderLayerCompositor.cpp:
3522         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
3523         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
3524         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
3525         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3526         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
3527         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
3528         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
3529         * rendering/RenderLayerCompositor.h:
3530
3531 2019-01-30  Zalan Bujtas  <zalan@apple.com>
3532
3533         [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
3534         https://bugs.webkit.org/show_bug.cgi?id=194020
3535
3536         Reviewed by Antti Koivisto.
3537
3538         Check the used margin variables whether we already computed before/after values.
3539
3540         Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
3541
3542         * layout/FormattingContextGeometry.cpp:
3543         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3544
3545 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
3546
3547         AX: Support color well on iOS
3548         https://bugs.webkit.org/show_bug.cgi?id=194010
3549
3550         Reviewed by Joanmarie Diggs.
3551
3552         Test: accessibility/ios-simulator/color-well.html
3553
3554         Add support for color well on iOS.
3555
3556         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3557         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
3558         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3559         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
3560         (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
3561         * en.lproj/Localizable.strings:
3562         * platform/LocalizedStrings.cpp:
3563         (WebCore::AXColorWellText):
3564         * platform/LocalizedStrings.h:
3565
3566 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
3567
3568         AX: Role=switch not returning correct accessibilityValue
3569         https://bugs.webkit.org/show_bug.cgi?id=194006
3570
3571         Reviewed by Joanmarie Diggs.
3572
3573         Return the toggle state of a role=switch element.        
3574
3575         Test: accessibility/ios-simulator/role-switch.html
3576
3577         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3578         (-[WebAccessibilityObjectWrapper accessibilityValue]):
3579
3580 2019-01-29  Rob Buis  <rbuis@igalia.com>
3581
3582         Align with Fetch on data: URLs
3583         https://bugs.webkit.org/show_bug.cgi?id=182325
3584
3585         Reviewed by Alex Christensen.
3586
3587         Implement most remaining steps for data: URL processing [1].
3588         Serialization is still to be implemented.
3589
3590         To make the code in DataURLDecoder::parseMediaType more efficient,
3591         refactor ParsedContentType so that validation and parsing is done
3592         in one pass.
3593
3594         Test: web-platform-tests/fetch/data-urls/processing.any.js
3595
3596         [1] https://fetch.spec.whatwg.org/#data-urls
3597
3598         * Modules/encryptedmedia/CDM.cpp:
3599         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
3600         * platform/network/DataURLDecoder.cpp:
3601         (WebCore::DataURLDecoder::parseMediaType):
3602         (WebCore::DataURLDecoder::DecodeTask::process):
3603         * platform/network/MIMEHeader.cpp:
3604         (WebCore::MIMEHeader::parseHeader):
3605         * platform/network/ParsedContentType.cpp:
3606         (WebCore::containsNewline):
3607         (WebCore::ParsedContentType::parseContentType):
3608         (WebCore::ParsedContentType::create):
3609         (WebCore::isValidContentType):
3610         (WebCore::ParsedContentType::ParsedContentType):
3611         (WebCore::DummyParsedContentType::setContentType const): Deleted.
3612         (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
3613         (WebCore::parseContentType): Deleted.
3614         * platform/network/ParsedContentType.h:
3615
3616 2019-01-29  Eric Carlson  <eric.carlson@apple.com>
3617
3618         [MSE] add more source buffer logging
3619         https://bugs.webkit.org/show_bug.cgi?id=193995
3620         <rdar://problem/47650399>
3621
3622         Reviewed by Jon Lee.
3623
3624         No new tests, no functional change.
3625
3626         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3627         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
3628         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
3629         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3630         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3631         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
3632         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
3633
3634 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
3635
3636         Add nodes to the scrolling tree in z-index order.
3637         https://bugs.webkit.org/show_bug.cgi?id=192529
3638         <rdar://problem/47402708>
3639
3640         Reviewed by Dean Jackson.
3641
3642         We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
3643         This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
3644         walks to find them.
3645
3646         With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
3647         tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
3648         (which makes it so that the scrolling tree correctly reflects layer z-order).
3649
3650         The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
3651         nodes in their parent document.
3652
3653         There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
3654         was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
3655         to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
3656
3657         updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
3658         and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
3659
3660         Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
3661                scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
3662
3663         * page/scrolling/ScrollingStateTree.cpp:
3664         (WebCore::ScrollingStateTree::insertNode):
3665         * page/scrolling/ScrollingTreeNode.cpp:
3666         (WebCore::ScrollingTreeNode::~ScrollingTreeNode):
3667         * platform/Logging.cpp:
3668         (WebCore::initializeLogChannelsIfNecessary):
3669         * rendering/RenderLayer.cpp:
3670         (WebCore::RenderLayer::setParent):
3671         (WebCore::RenderLayer::calculateClipRects const):
3672         * rendering/RenderLayerBacking.cpp:
3673         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3674         (WebCore::RenderLayerBacking::willBeDestroyed):
3675         (WebCore::RenderLayerBacking::updateGeometry):
3676         (WebCore::RenderLayerBacking::updateBackgroundLayer):
3677         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
3678         * rendering/RenderLayerBacking.h:
3679         * rendering/RenderLayerCompositor.cpp:
3680         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3681         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
3682         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
3683         (WebCore::frameHostingNodeForFrame):
3684         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3685         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
3686         (WebCore::RenderLayerCompositor::updateBacking):
3687         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
3688         (WebCore::RenderLayerCompositor::setIsInWindow):
3689         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
3690         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
3691         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
3692         (WebCore::RenderLayerCompositor::attachScrollingNode):
3693         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
3694         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
3695         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
3696         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3697         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
3698         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
3699         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
3700         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
3701         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
3702         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
3703         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
3704         (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
3705         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
3706         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
3707         (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
3708         (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
3709         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
3710         (WebCore::canCoordinateScrollingForLayer): Deleted.
3711         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
3712         (WebCore::enclosingScrollingNodeID): Deleted.
3713         (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
3714         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
3715         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
3716         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
3717         * rendering/RenderLayerCompositor.h:
3718
3719 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
3720
3721         Make sure we have a frame before trying to access its loader 
3722         https://bugs.webkit.org/show_bug.cgi?id=193985
3723         <rdar://problem/47618239>
3724
3725         Reviewed by Ryosuke Niwa.
3726
3727         * loader/ResourceLoadObserver.cpp:
3728         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3729
3730 2019-01-29  Andy Estes  <aestes@apple.com>
3731
3732         Try to fix the watchOS build.
3733
3734         * dom/Element.cpp:
3735
3736 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
3737
3738         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
3739         https://bugs.webkit.org/show_bug.cgi?id=193907
3740         rdar://problem/47604080
3741
3742         Reviewed by Frédéric Wang.
3743
3744         Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
3745         state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
3746         show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
3747         commit would re-create the tree node, but the state node would only have a subset of the
3748         change flags set, so the new tree node would fail to get all of the state (for example, it
3749         would be missing layers and scrolling geometry).
3750
3751         Fix by ensuring that when we reparent state node subtrees, we set all the change flags
3752         so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
3753         Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
3754         set the right change flags.
3755
3756         This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
3757         information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
3758         as we encounter them in the tree walk.
3759         
3760         Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.
3761
3762         Test: compositing/geometry/composited-frame-contents.html
3763
3764         * page/scrolling/ScrollingStateFixedNode.cpp:
3765         (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
3766         * page/scrolling/ScrollingStateFixedNode.h:
3767         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3768         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
3769         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3770         * page/scrolling/ScrollingStateNode.cpp:
3771         (WebCore::ScrollingStateNode::setPropertyChanged):
3772         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
3773         * page/scrolling/ScrollingStateNode.h:
3774         (WebCore::ScrollingStateNode::setPropertyChangedBit):
3775         * page/scrolling/ScrollingStateScrollingNode.cpp:
3776         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
3777         * page/scrolling/ScrollingStateScrollingNode.h:
3778         * page/scrolling/ScrollingStateStickyNode.cpp:
3779         (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
3780         * page/scrolling/ScrollingStateStickyNode.h:
3781         * page/scrolling/ScrollingStateTree.cpp:
3782         (WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
3783         if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
3784         other nodeID which can result in type confusion later.
3785         (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
3786         (WebCore::ScrollingStateTree::commit):
3787         (WebCore::ScrollingStateTree::willRemoveNode):
3788         (WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
3789         * page/scrolling/ScrollingStateTree.h:
3790         (WebCore::ScrollingStateTree::removedNodes const): Deleted.
3791         * page/scrolling/ScrollingTree.cpp:
3792         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
3793         (WebCore::ScrollingTree::commitTreeState):
3794         (WebCore::ScrollingTree::updateTreeFromStateNode):
3795         (WebCore::ScrollingTree::latchedNode):
3796         (WebCore::ScrollingTree::setLatchedNode):
3797         (WebCore::ScrollingTree::clearLatchedNode):
3798         (WebCore::ScrollingTree::scrollingTreeAsText):
3799         (WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
3800         * page/scrolling/ScrollingTree.h:
3801         (WebCore::ScrollingTree::hasLatchedNode const):
3802         * rendering/RenderLayerCompositor.cpp:
3803         (WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
3804         setting its position doesn't offset it relative to the center.
3805
3806 2019-01-29  Justin Fan  <justin_fan@apple.com>
3807
3808         [WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
3809         https://bugs.webkit.org/show_bug.cgi?id=193926
3810         <rdar://problem/47327648>
3811
3812         Reviewed by Myles C. Maxfield.
3813
3814         Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.
3815
3816         Test: webgpu/vertex-buffer-triangle-strip.html
3817
3818         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: 
3819         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
3820         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3821         (WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
3822         (WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.
3823
3824 2019-01-29  Keith Rollin  <krollin@apple.com>
3825
3826         Add .xcfilelists to Run Script build phases
3827         https://bugs.webkit.org/show_bug.cgi?id=193792
3828         <rdar://problem/47201785>
3829
3830         Reviewed by Alex Christensen.
3831
3832         As part of supporting XCBuild, update the necessary Run Script build
3833         phases in their Xcode projects to refer to their associated
3834         .xcfilelist files.
3835
3836         Note that the addition of these files bumps the Xcode project version
3837         number to something that's Xcode 10 compatible. This change means that
3838         older versions of the Xcode IDE can't read these projects. Nor can it
3839         fully load workspaces that refer to these projects (the updated
3840         projects are shown as non-expandable placeholders). `xcodebuild` can
3841         still build these projects; it's just that the IDE can't open them.
3842
3843         Make special accommodations for incorporating .xcfilelists from
3844         WebKitAdditions.
3845
3846         No new tests since there should be no observable behavior difference.
3847
3848         * Configurations/Base.xcconfig:
3849         * Configurations/DebugRelease.xcconfig:
3850         * WebCore.xcodeproj/project.pbxproj:
3851
3852 2019-01-29  John Wilander  <wilander@apple.com>
3853
3854         Add data abstraction and validation for Ad Click Attribution
3855         https://bugs.webkit.org/show_bug.cgi?id=193916
3856         <rdar://problem/47603481>
3857
3858         Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.
3859
3860         New API tests added.
3861
3862         Ad click attribution has two steps. First, the storage of an ad
3863         campaign ID for a click that takes the user to a destination
3864         site. Second, a conversion on the destination site that can be
3865         attributed to the ad click.
3866
3867         This patch adds a class that represents a request for ad click
3868         attribution. Validation makes sure that the bits of entropy
3869         reported through this mechanism is limited.
3870
3871         This feature is experimental and off by default.
3872
3873         * Sources.txt:
3874             Added loader/AdClickAttribution.cpp.
3875         * WebCore.xcodeproj/project.pbxproj:
3876         * loader/AdClickAttribution.cpp: Added.
3877         (WebCore::AdClickAttribution::isValid const):
3878         (WebCore::AdClickAttribution::setConversion):
3879         (WebCore::AdClickAttribution::url const):
3880         (WebCore::AdClickAttribution::referrer const):
3881         * loader/AdClickAttribution.h: Added.
3882         (WebCore::AdClickAttribution::Campaign::Campaign):
3883         (WebCore::AdClickAttribution::Campaign::isValid const):
3884         (WebCore::AdClickAttribution::Source::Source):
3885         (WebCore::AdClickAttribution::Destination::Destination):
3886         (WebCore::AdClickAttribution::Priority::Priority):
3887         (WebCore::AdClickAttribution::Conversion::Conversion):
3888         (WebCore::AdClickAttribution::Conversion::isValid const):
3889         (WebCore::AdClickAttribution::AdClickAttribution):
3890         (WebCore::AdClickAttribution::earliestTimeToSend const):
3891         * loader/DocumentLoader.cpp:
3892             Added missing #include "RuntimeEnabledFeatures.h".
3893
3894 2019-01-29  Zalan Bujtas  <zalan@apple.com>
3895
3896         [MathML] Move enum class ScriptType to MathMLScriptsElement.
3897         https://bugs.webkit.org/show_bug.cgi?id=193969
3898
3899         Reviewed by Antti Koivisto.
3900
3901         * mathml/MathMLScriptsElement.cpp:
3902         (WebCore::scriptTypeOf):
3903         * mathml/MathMLScriptsElement.h:
3904         * rendering/mathml/RenderMathMLScripts.cpp:
3905         (WebCore::RenderMathMLScripts::scriptType const):
3906         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
3907         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
3908         (WebCore::RenderMathMLScripts::verticalMetrics):
3909         (WebCore::RenderMathMLScripts::layoutBlock):
3910         * rendering/mathml/RenderMathMLScripts.h:
3911         * rendering/mathml/RenderMathMLUnderOver.cpp:
3912         (WebCore::RenderMathMLUnderOver::isValid const):
3913         (WebCore::RenderMathMLUnderOver::under const):
3914         (WebCore::RenderMathMLUnderOver::over const):
3915         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
3916         (WebCore::RenderMathMLUnderOver::hasAccent const):
3917         (WebCore::RenderMathMLUnderOver::layoutBlock):
3918
3919 2019-01-29  Chris Dumez  <cdumez@apple.com>
3920
3921         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
3922         https://bugs.webkit.org/show_bug.cgi?id=193848
3923
3924         Reviewed by Youenn Fablet.
3925
3926         * dom/Document.cpp:
3927         * dom/MessageChannel.cpp:
3928         (WebCore::MessageChannel::MessageChannel):
3929         * dom/ScriptExecutionContext.cpp:
3930         (WebCore::ScriptExecutionContext::contextIdentifier const):
3931         * history/HistoryItem.cpp:
3932         (WebCore::HistoryItem::HistoryItem):
3933         * loader/DocumentLoader.cpp:
3934         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
3935         * page/DOMWindow.cpp:
3936         (WebCore::DOMWindow::DOMWindow):
3937         * platform/Process.cpp:
3938         (WebCore::Process::identifier):
3939         * workers/service/ServiceWorkerJobData.cpp:
3940         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
3941         * workers/service/server/RegistrationDatabase.cpp:
3942         (WebCore::RegistrationDatabase::importRecords):
3943         * workers/service/server/SWServer.cpp:
3944         (WebCore::SWServer::Connection::Connection):
3945         (WebCore::SWServer::updateWorker):
3946         * workers/service/server/SWServerRegistration.cpp:
3947         (WebCore::generateServiceWorkerRegistrationIdentifier):
3948         * workers/service/server/SWServerToContextConnection.cpp:
3949         (WebCore::generateServerToContextConnectionIdentifier):
3950
3951
3952 2019-01-29  Alex Christensen  <achristensen@webkit.org>
3953
3954         Use lambdas instead of member pointer functions for TransactionOperationImpl
3955         https://bugs.webkit.org/show_bug.cg