Multiple File Input Icon Set Regardless of File List
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-23  Guy Lewin  <guy@lewin.co.il>
2
3         Multiple File Input Icon Set Regardless of File List
4         https://bugs.webkit.org/show_bug.cgi?id=195537
5
6         Reviewed by Alexey Proskuryakov.
7
8         File input elements display icon with an empty file list after
9         resetting the file list in 'change' event handler - on iOS
10
11         Test: fast/forms/file/file-reset-in-change-using-open-panel-with-icon.html
12
13         * html/FileInputType.cpp:
14         (WebCore::FileInputType::filesChosen):
15
16 2019-04-23  Eric Carlson  <eric.carlson@apple.com>
17
18         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
19         https://bugs.webkit.org/show_bug.cgi?id=197171
20         <rdar://problem/47454979>
21
22         Reviewed by Youenn Fablet.
23
24         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
25
26         * Modules/plugins/QuickTimePluginReplacement.mm:
27         (WebCore::jsValueWithValueInContext):
28         (WebCore::jsValueWithAVMetadataItemInContext):
29         * WebCore.xcodeproj/project.pbxproj:
30         * platform/audio/ios/AudioSessionIOS.mm:
31         (WebCore::AudioSession::setCategory):
32         (WebCore::AudioSession::category const):
33         (WebCore::AudioSession::routeSharingPolicy const):
34         (WebCore::AudioSession::routingContextUID const):
35         (WebCore::AudioSession::sampleRate const):
36         (WebCore::AudioSession::bufferSize const):
37         (WebCore::AudioSession::numberOfOutputChannels const):
38         (WebCore::AudioSession::tryToSetActiveInternal):
39         (WebCore::AudioSession::preferredBufferSize const):
40         (WebCore::AudioSession::setPreferredBufferSize):
41         * platform/audio/ios/MediaSessionManagerIOS.mm:
42         (-[WebMediaSessionHelper initWithCallback:]):
43         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
44         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
45         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
46         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
47         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
48         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
49         (WebCore::AudioSourceProviderAVFObjC::createMix):
50         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
51         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
52         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
53         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
54         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
55         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
56         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
57         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
58         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
59         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
60         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
61         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
62         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
63         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
64         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
65         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
66         (WebCore::CDMSessionAVContentKeySession::isAvailable):
67         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
68         (WebCore::CDMSessionAVContentKeySession::update):
69         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
70         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
71         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
72         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
73         (WebCore::CDMSessionAVStreamSession::releaseKeys):
74         (WebCore::CDMSessionAVStreamSession::update):
75         (WebCore::CDMSessionAVStreamSession::setStreamSession):
76         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
77         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
78         (WebCore::imageDecoderAssetOptions):
79         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
80         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
81         (WebCore::ImageDecoderAVFObjC::readSamples):
82         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
83         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
84         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
85         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
86         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
87         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
88         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
89         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
90         (WebCore::assetCacheForPath):
91         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
92         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
93         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
94         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
95         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
96         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
97         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
98         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
99         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
100         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
101         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
102         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
103         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
104         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
105         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
106         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
107         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
108         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
109         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
110         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
111         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
112         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
113         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
114         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
115         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
116         (WebCore::exernalDeviceDisplayNameForPlayer):
117         (WebCore::metadataType):
118         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
119         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
120         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
121         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
122         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
123         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
124         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
125         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
126         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
127         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
128         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
129         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
130         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
131         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
132         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
133         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
134         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
135         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
136         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
137         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
138         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
139         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
140         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
141         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
142         (WebCore::PlatformCALayerCocoa::clone const):
143         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
144         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
145         (WebCore::validateHEVCParameters):
146         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
147         (getAVSpeechUtteranceDefaultSpeechRate):
148         (getAVSpeechUtteranceMaximumSpeechRate):
149         (-[WebSpeechSynthesisWrapper speakUtterance:]):
150         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
151         (SOFT_LINK_CONSTANT): Deleted.
152         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
153         (-[WebAVPlayerLayer init]):
154         (-[WebAVPlayerLayer layoutSublayers]):
155         (-[WebAVPlayerLayer setVideoGravity:]):
156         (-[WebAVPlayerLayer videoRect]):
157         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
158         * platform/mac/SerializedPlatformRepresentationMac.mm:
159         (WebCore::jsValueWithValueInContext):
160         (WebCore::jsValueWithAVMetadataItemInContext):
161         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
162         (WebCore::getAVFormatIDKeyWithFallback):
163         (WebCore::getAVNumberOfChannelsKeyWithFallback):
164         (WebCore::getAVSampleRateKeyWithFallback):
165         (WebCore::getAVEncoderBitRateKeyWithFallback):
166         (WebCore::MediaRecorderPrivateWriter::create):
167         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
168         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
169         * platform/mediastream/RealtimeVideoSource.h:
170         * platform/mediastream/VideoPreset.h:
171         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
172         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
173         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
174         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
175         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
176         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
177         (WebCore::deviceIsAvailable):
178         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
179         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
180         (WebCore::AVCaptureDeviceManager::isAvailable):
181         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
182         * platform/mediastream/mac/AVVideoCaptureSource.mm:
183         (WebCore::AVVideoPreset::create):
184         (WebCore::AVVideoPreset::AVVideoPreset):
185         (WebCore::AVVideoCaptureSource::create):
186         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
187         (WebCore::AVVideoCaptureSource::capabilities):
188         (WebCore::sensorOrientationFromVideoOutput):
189         (WebCore::AVVideoCaptureSource::setupSession):
190         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
191         (WebCore::AVVideoCaptureSource::setupCaptureSession):
192         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
193         (WebCore::AVVideoCaptureSource::generatePresets):
194         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
195         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
196
197 2019-04-23  Timothy Hatcher  <timothy@apple.com>
198
199         Speed up RenderTheme::systemColor on Speedometer2.
200         https://bugs.webkit.org/show_bug.cgi?id=197203
201         rdar://problem/50056756
202
203         Reviewed by Tim Horton.
204
205         * rendering/RenderThemeIOS.mm:
206         (WebCore::RenderThemeIOS::systemColor const): Remove some unused code. And fetch the cache after an early return.
207         * rendering/RenderThemeMac.mm:
208         (WebCore::RenderThemeMac::systemColor const): Avoid some allocations in LocalDefaultSystemAppearance
209         when a CSS color is in the system color cache.
210
211 2019-04-23  Ryosuke Niwa  <rniwa@webkit.org>
212
213         [iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
214         https://bugs.webkit.org/show_bug.cgi?id=197188
215
216         Reviewed by Wenson Hsieh.
217
218         The bug was caused by the scroll-to-reveal code triggered by Element::updateFocusAppearance updating
219         the scroll position via scrolling tree update in a layer tree commit which happens after
220         _zoomToRevealFocusedElement in WKContentView had already scrolled the frame view.
221
222         To fix this problem, we need to defer the editor state update until the layer commit (see r244494),
223         and update the scrolling tree before invoking WebPageProxy::editorStateChanged which brings up
224         the keyboard and scroll-to-reveal the caret in the UI process side.
225
226         We also avoid revealing the focus for the second time via Document::scheduleScrollToFocusedElement
227         in Element::updateFocusAppearance as this timer based scrolling also happens after we had already
228         revealed the caret in _zoomToRevealFocusedElement. This is a bit hacky but works for most cases since
229         we wouldn't bring up a keyboard if the focused element was not editable anyway.
230
231         Test: editing/selection/ios/scrolling-to-focused-element-inside-iframe.html
232
233         * dom/Element.cpp:
234         (WebCore::Element::updateFocusAppearance): Avoid scheduling a timer based reavel of the focused element
235         when we're already revealing the element via selection change.
236
237 2019-04-23  Remy Demarest  <rdemarest@apple.com>
238
239         Fix layout issues occuring when entering full screen mode.
240         https://bugs.webkit.org/show_bug.cgi?id=197086
241         <rdar://problem/47733671>.
242
243         Reviewed by Darin Adler.
244
245         This issue is the result of changing the style mask of the window after entering
246         full screen mode. Safari adds an invisible toolbar to display the URL of the page
247         which ends up breaking the layout. Having that window use a style that includes a
248         titlebar fixes the bug.
249
250         * platform/mac/WebCoreFullScreenWindow.mm:
251         (-[WebCoreFullScreenWindow constrainFrameRect:toScreen:]): Ensure that the window
252         can fill the entire screen including the underlapping the menu bar, so that the
253         window does not resize when the animation is done.
254         (-[WebCoreFullScreenWindow canBecomeMainWindow]): Borderless windows cannot become
255         main by default, adding the titlebar allows it to become main, prevent this from
256         happening at all to preserve the existing behavior.
257
258 2019-04-23  Chris Dumez  <cdumez@apple.com>
259
260         [Process-Swap-On-Navigation] WebKit hangs when going back to a form submission's page due to Process-Swap-On-Navigation on iOS 12.2 and higher
261         https://bugs.webkit.org/show_bug.cgi?id=197097
262         <rdar://problem/50048318>
263
264         Reviewed by Alex Christensen.
265
266         * loader/EmptyFrameLoaderClient.h:
267         * loader/FrameLoader.cpp:
268         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
269         If we still have a provisional item (new load has been started or we did not clear it because we're about to retry),
270         then let the client know the load will continue by passing an extra flag with the didFailProvisionalLoad.
271
272         * loader/FrameLoaderClient.h:
273         * loader/FrameLoaderTypes.h:
274
275 2019-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
276
277         [ATK] Implement AtkComponentIface scroll_to methods
278         https://bugs.webkit.org/show_bug.cgi?id=196856
279
280         Reviewed by Michael Catanzaro.
281
282         Implement scroll_to and scroll_to_point when ATK >= 2.30.
283
284         Fixes: accessibility/scroll-to-global-point-iframe-nested.html
285                accessibility/scroll-to-global-point-iframe.html
286                accessibility/scroll-to-global-point-main-window.html
287                accessibility/scroll-to-global-point-nested.html
288                accessibility/scroll-to-make-visible-div-overflow.html
289                accessibility/scroll-to-make-visible-iframe.html
290                accessibility/scroll-to-make-visible-nested-2.html
291                accessibility/scroll-to-make-visible-nested.html
292
293         * accessibility/AccessibilityObject.cpp:
294         (WebCore::AccessibilityObject::scrollToMakeVisible const): Add new method receiving the
295         ScrollRectToVisibleOptions since ATK interface has a parameter to decide how to scroll.
296         * accessibility/AccessibilityObject.h:
297         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
298         (atkToContents):
299         (webkitAccessibleComponentRefAccessibleAtPoint):
300         (webkitAccessibleComponentGetExtents):
301         (webkitAccessibleComponentGrabFocus):
302         (webkitAccessibleComponentScrollTo):
303         (webkitAccessibleComponentScrollToPoint):
304         (webkitAccessibleComponentInterfaceInit):
305         (core): Deleted.
306
307 2019-04-22  Youenn Fablet  <youenn@apple.com>
308
309         Update libwebrtc logging when WebCore WebRTC logging is updated
310         https://bugs.webkit.org/show_bug.cgi?id=197166
311         <rdar://problem/50107696>
312
313         Unreviewed.
314
315         Build fix after https://trac.webkit.org/changeset/244511.
316
317         * page/Page.cpp:
318         (WebCore::Page::configureLoggingChannel):
319
320 2019-04-22  Youenn Fablet  <youenn@apple.com>
321
322         Cache API should return Abort error in case of putting an aborted fetch
323         https://bugs.webkit.org/show_bug.cgi?id=196757
324
325         Reviewed by Darin Adler.
326
327         In case of an aborted fetch, call consume callback with an AbortError.
328         Update the code that handles load cancelling as the loader callback is called.
329         Covered by rebased tests.
330
331         * Modules/fetch/FetchResponse.cpp:
332         (WebCore::FetchResponse::addAbortSteps):
333         (WebCore::FetchResponse::BodyLoader::didFail):
334         (WebCore::FetchResponse::BodyLoader::BodyLoader):
335         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
336         (WebCore::FetchResponse::stop):
337         * Modules/fetch/FetchResponse.h:
338
339 2019-04-22  Youenn Fablet  <youenn@apple.com>
340
341         Update libwebrtc logging when WebCore WebRTC logging is updated
342         https://bugs.webkit.org/show_bug.cgi?id=197166
343
344         Reviewed by Eric Carlson.
345
346         When updating WebRTC logging from Web Inspector, update libwebrtc logging so that no page reload is required.
347         Manually tested.
348
349         * page/Page.cpp:
350         (WebCore::Page::configureLoggingChannel):
351
352 2019-04-22  Simon Fraser  <simon.fraser@apple.com>
353
354         Introduce the concept of "opportunistic" stacking contexts
355         https://bugs.webkit.org/show_bug.cgi?id=197077
356
357         Reviewed by Zalan Bujtas.
358
359         Bring back a variant of some code removed in r236424, which allows a RenderLayer
360         to be stacking context for painting, without actually being on in terms of CSS.
361         
362         Internally, RenderLayer will call setIsOpportunisticStackingContext() to make a layer
363         into a stacking context for painting. External callers deal with isStackingContext()
364         or isCSSStackingContext().
365
366         Sadly we can't make m_forcedStackingContext (set on media element layers) trigger a
367         non-CSS stacking context; media controls use mix-blend-mode, and rely on the fake-stacking
368         media layer to be the "isolateBlending" ancestor.
369
370         No code uses this yet.
371
372         * rendering/RenderLayer.cpp:
373         (WebCore::RenderLayer::RenderLayer):
374         (WebCore::RenderLayer::shouldBeCSSStackingContext const):
375         (WebCore::RenderLayer::isStackingContextChanged):
376         (WebCore::RenderLayer::setIsOpportunisticStackingContext):
377         (WebCore::RenderLayer::setIsCSSStackingContext):
378         (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
379         (WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
380         (WebCore::RenderLayer::beginTransparencyLayers):
381         (WebCore::RenderLayer::calculateClipRects const):
382         (WebCore::outputPaintOrderTreeLegend):
383         (WebCore::outputPaintOrderTreeRecursive):
384         (WebCore::RenderLayer::shouldBeStackingContext const): Deleted.
385         (WebCore::RenderLayer::setIsStackingContext): Deleted.
386         * rendering/RenderLayer.h:
387         * rendering/RenderLayerBacking.cpp:
388         (WebCore::RenderLayerBacking::compositingOpacity const):
389
390 2019-04-22  Justin Fan  <justin_fan@apple.com>
391
392         [WebGPU] Move swap chain methods from GPUDevice to GPUCanvasContext
393         https://bugs.webkit.org/show_bug.cgi?id=197126
394
395         Reviewed by Dean Jackson.
396
397         GPUSwapChains are now configured via GPUCanvasContext instead of GPUDevice. Covers WebGPU API 
398         pull request #262.
399
400         Existing WebGPU tests updated to match.
401
402         * Modules/webgpu/GPUCanvasContext.cpp:
403         (WebCore::GPUCanvasContext::configureSwapChain):
404         (WebCore::GPUCanvasContext::replaceSwapChain): Deleted.
405         * Modules/webgpu/GPUCanvasContext.h:
406         * Modules/webgpu/GPUCanvasContext.idl:
407         * Modules/webgpu/WebGPUDevice.cpp:
408         (WebCore::WebGPUDevice::createSwapChain const): Deleted.
409         * Modules/webgpu/WebGPUDevice.h:
410         (WebCore::WebGPUDevice::device):
411         * Modules/webgpu/WebGPUDevice.idl:
412         * Modules/webgpu/WebGPUSwapChainDescriptor.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUSwapChainDescriptor.h.
413         (WebCore::WebGPUSwapChainDescriptor::asGPUSwapChainDescriptor const):
414         * Modules/webgpu/WebGPUSwapChainDescriptor.h:
415         * Sources.txt:
416         * WebCore.xcodeproj/project.pbxproj:
417         * platform/graphics/gpu/GPUDevice.cpp:
418         (WebCore::GPUDevice::setSwapChain):
419         (WebCore::GPUDevice::tryCreateSwapChain const): Deleted.
420         * platform/graphics/gpu/GPUDevice.h:
421         * platform/graphics/gpu/GPUSwapChain.h:
422         * platform/graphics/gpu/GPUSwapChainDescriptor.h:
423         (WebCore::GPUSwapChainDescriptor::GPUSwapChainDescriptor):
424         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
425         (WebCore::GPUSwapChain::tryCreate):
426
427 2019-04-22  Said Abou-Hallawa  <said@apple.com>
428
429         Mark SVGStringList properties '[SameObject]' in the IDL files
430         Followup to https://bugs.webkit.org/show_bug.cgi?id=197137
431
432         Reviewed by Darin Adler.
433
434         The SVG elements do not create tear-off wrappers for SVGStrigList DOM
435         objects anymore. Instead they return Ref pointers to the same RefCounted
436         objects. So they should be marked '[SameObject]' in their IDL files.
437
438         * svg/SVGTests.idl:
439         * svg/SVGViewElement.idl:
440
441 2019-04-22  Commit Queue  <commit-queue@webkit.org>
442
443         Unreviewed, rolling out r244495.
444         https://bugs.webkit.org/show_bug.cgi?id=197159
445
446         Causing build failures on OpenSource and Internal bots
447         (Requested by ShawnRoberts on #webkit).
448
449         Reverted changeset:
450
451         "WHLSLPrepare.cpp always recompiles, even if nothing was
452         changed"
453         https://bugs.webkit.org/show_bug.cgi?id=197151
454         https://trac.webkit.org/changeset/244495
455
456 2019-04-22  Carlos Garcia Campos  <cgarcia@igalia.com>
457
458         REGRESSION(r241289): [GTK] accessibility/removed-continuation-element-causes-crash.html and accessibility/removed-anonymous-block-child-causes-crash.html crashes
459         https://bugs.webkit.org/show_bug.cgi?id=194630
460
461         Reviewed by Michael Catanzaro.
462
463         Do not assume core object always has a wrapper in webkitAccessibleRefChild().
464
465         Fixes: accessibility/removed-continuation-element-causes-crash.html
466                accessibility/removed-anonymous-block-child-causes-crash.html
467
468         * accessibility/atk/WebKitAccessible.cpp:
469         (webkitAccessibleRefChild): Return early if wrapper is nullptr.
470
471 2019-04-21  Darin Adler  <darin@apple.com>
472
473         WHLSLPrepare.cpp always recompiles, even if nothing was changed
474         https://bugs.webkit.org/show_bug.cgi?id=197151
475
476         Reviewed by Dan Bernstein.
477
478         * DerivedSources-input.xcfilelist: Script updated this automatically after
479         DerivedSources.make was corrected.
480         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
481         one bogus leftover reference to WHLSLStandardLibrary.cpp.
482
483         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
484         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
485         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
486         was running on every build, instead of only when one of the dependencies changed.
487
488 2019-04-20  Said Abou-Hallawa  <said@apple.com>
489
490         REGRESSION (r243137): SVGViewElement.viewTarget should not return a new object
491         https://bugs.webkit.org/show_bug.cgi?id=197137
492
493         Reviewed by Darin Adler.
494
495         All the DOM objects accessing the viewTarget of the same SVGViewElement 
496         should hold a Ref pointer to the same SVGStringList property.
497
498         Test: svg/dom/SVGViewElement-viewTarget.html
499
500         * svg/SVGViewElement.idl:
501
502 2019-04-20  Jer Noble  <jer.noble@apple.com>
503
504         REGRESSION(r243958): Unnecessary deactivation of AudioSession (PLT Regression)
505         https://bugs.webkit.org/show_bug.cgi?id=197123
506         <rdar://problem/49783264>
507
508         Reviewed by Per Arne Vollan.
509
510         Only set m_becameActive if we actually activated the AudioSession before starting playback. This
511         avoids unnecessarily deactivating the AudioSession in processWillSuspend().
512
513         * platform/audio/PlatformMediaSessionManager.cpp:
514         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
515
516 2019-04-19  Devin Rousso  <drousso@apple.com>
517
518         Web Inspector: Timelines: CPU: ensure that tracking stops when disconnecting Web Inspector
519         https://bugs.webkit.org/show_bug.cgi?id=197115
520         <rdar://problem/49877875>
521
522         Reviewed by Joseph Pecoraro.
523
524         * inspector/agents/InspectorCPUProfilerAgent.cpp:
525         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
526
527 2019-04-19  Devin Rousso  <drousso@apple.com>
528
529         Web Inspector: REGRESSION: Elements: "Inspect Element" context menu often doesn't select that element
530         https://bugs.webkit.org/show_bug.cgi?id=197091
531         <rdar://problem/49953728>
532
533         Reviewed by Joseph Pecoraro.
534
535         Delay the `inspect` event fron firing with the focued node until the frontend has had a
536         chance to request the document. Otherwise, requesting the document clears the mapping of
537         node-to-id, so the focused node's id would no longer be valid.
538
539         * inspector/agents/InspectorDOMAgent.cpp:
540         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
541         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
542         (WebCore::InspectorDOMAgent::getDocument):
543         (WebCore::InspectorDOMAgent::focusNode):
544         (WebCore::InspectorDOMAgent::didCommitLoad):
545
546 2019-04-19  John Wilander  <wilander@apple.com>
547
548         Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
549         https://bugs.webkit.org/show_bug.cgi?id=197108
550         <rdar://problem/49918702>
551
552         Reviewed by Alex Christensen.
553
554         Tests: http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html
555                http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html
556
557         * html/HTMLAnchorElement.cpp:
558         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
559             Early return for ephemeral sessions.
560         * loader/ResourceLoader.cpp:
561         (WebCore::ResourceLoader::shouldUseCredentialStorage):
562             Now returns false for StoredCredentialsPolicy:EphemeralStatelessCookieless.
563         * platform/network/StoredCredentialsPolicy.h:
564             Added enum value EphemeralStatelessCookieless.
565
566 2019-04-19  Timothy Hatcher  <timothy@apple.com>
567
568         Standardize the <meta name="color-scheme"> separator.
569         https://bugs.webkit.org/show_bug.cgi?id=193931
570         rdar://problem/49995929
571
572         Reviewed by Darin Adler.
573
574         Tests: css-dark-mode/color-scheme-meta.html
575
576         * dom/Document.cpp:
577         (WebCore::processColorSchemeString): Use isHTMLSpace insead of isColorSchemeSeparator and isASCIISpace.
578         (WebCore::isColorSchemeSeparator): Deleted.
579
580 2019-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
581
582         [iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
583         https://bugs.webkit.org/show_bug.cgi?id=197102
584         <rdar://problem/49864669>
585
586         Reviewed by Ryosuke Niwa.
587
588         Add a quirk to disable autocorrection and autocapitalization in hidden editable areas.
589
590         * page/Quirks.cpp:
591         (WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
592         (WebCore::Quirks::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas const):
593         * page/Quirks.h:
594
595 2019-04-18  Fujii Hironori  <Hironori.Fujii@sony.com>
596
597         Implement KeyedDecoderGeneric and KeyedEncoderGeneric
598         https://bugs.webkit.org/show_bug.cgi?id=186410
599
600         Reviewed by Don Olmstead.
601
602         Implemented KeyedDecoderGeneric and KeyedEncoderGeneric by using
603         WTF::Persistence::Decoder and WTF::Persistence::Encoder.
604
605         No new tests. Covered by existing tests.
606
607         * PlatformWin.cmake: Added KeyedDecoderGeneric.cpp and
608         KeyedEncoderGeneric.cpp, and removed KeyedDecoderCF.cpp and
609         KeyedEncoderCF.cpp for WinCairo port.
610         * platform/generic/KeyedDecoderGeneric.cpp:
611         * platform/generic/KeyedDecoderGeneric.h:
612         * platform/generic/KeyedEncoderGeneric.cpp:
613         * platform/generic/KeyedEncoderGeneric.h:
614
615 2019-04-18  Ross Kirsling  <ross.kirsling@sony.com>
616
617         [WinCairo] Non-unified build fails to link Tools
618         https://bugs.webkit.org/show_bug.cgi?id=196866
619
620         Reviewed by Fujii Hironori.
621
622         * CMakeLists.txt:
623         Drive-by fix -- don't disable string pooling when building WebCoreTestSupport.
624         (This should have been part of r235203.)
625
626 2019-04-18  Commit Queue  <commit-queue@webkit.org>
627
628         Unreviewed, rolling out r244434.
629         https://bugs.webkit.org/show_bug.cgi?id=197089
630
631         caused 1 API test failure (Requested by zalan on #webkit).
632
633         Reverted changeset:
634
635         "Regression (r244291): Broken API Test
636         AutoLayoutRenderingProgressRelativeOrdering"
637         https://bugs.webkit.org/show_bug.cgi?id=196948
638         https://trac.webkit.org/changeset/244434
639
640 2019-04-18  Don Olmstead  <don.olmstead@sony.com>
641
642         [CMake] Make WebCore headers copies
643         https://bugs.webkit.org/show_bug.cgi?id=182512
644         <rdar://problem/37510435>
645
646         Unreviewed build fix.
647
648         Add new header from r244440.
649
650         * Headers.cmake:
651
652 2019-04-18  Don Olmstead  <don.olmstead@sony.com>
653
654         [CMake] Make WebCore headers copies
655         https://bugs.webkit.org/show_bug.cgi?id=182512
656         <rdar://problem/37510435>
657
658         Reviewed by Alex Christensen.
659
660         The header copying is moved to a target WebCorePrivateFrameworkHeaders. This target was
661         originally Windows only but now this is enabled for all CMake based ports.
662
663         Enumerated all headers within WebCore that are used for WebKit(Legacy), tools and
664         tests. Shared headers are within Headers.cmake while port and platform specific headers
665         are in their respective CMake files. Listing out all headers is preferred because globbing
666         will break the build whenever a file is added.
667
668         All include directories within the WebCore source tree are now PRIVATE. They were
669         modified to use WebCore_PRIVATE_INCLUDE_DIRECTORIES. They will not propagate to other targets
670         which will prevent erroneous includes in targets dependent on WebCore.
671
672         * CMakeLists.txt:
673         * Headers.cmake: Added.
674         * PlatformAppleWin.cmake:
675         * PlatformGTK.cmake:
676         * PlatformMac.cmake:
677         * PlatformPlayStation.cmake:
678         * PlatformWPE.cmake:
679         * PlatformWin.cmake:
680         * PlatformWinCairo.cmake:
681         * platform/Cairo.cmake:
682         * platform/Curl.cmake:
683         * platform/FreeType.cmake:
684         * platform/GStreamer.cmake:
685         * platform/HolePunch.cmake:
686         * platform/ImageDecoders.cmake:
687         * platform/Soup.cmake: Added.
688         * platform/TextureMapper.cmake:
689
690 2019-04-18  Justin Fan  <justin_fan@apple.com>
691
692         [Web GPU] Implement API default values
693         https://bugs.webkit.org/show_bug.cgi?id=197032
694
695         Reviewed by Myles C. Maxfield.
696
697         Add default values and 'required' qualifiers recently merged to the WebGPU API.
698
699         WebGPU tests specifying these default values have been updated to rely on them for functionality.
700
701         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
702         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
703         * Modules/webgpu/GPUBlendDescriptor.idl:
704         * Modules/webgpu/GPUBufferDescriptor.idl:
705         * Modules/webgpu/GPUColor.idl:
706         * Modules/webgpu/GPUColorStateDescriptor.idl:
707         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
708         * Modules/webgpu/GPUExtent3D.idl:
709         * Modules/webgpu/GPUInputStateDescriptor.idl:
710         * Modules/webgpu/GPUOrigin3D.h:
711         * Modules/webgpu/GPUOrigin3D.idl:
712         * Modules/webgpu/GPURequestAdapterOptions.idl:
713         * Modules/webgpu/GPUTextureDescriptor.idl:
714         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
715         * Modules/webgpu/GPUVertexInputDescriptor.idl:
716         * Modules/webgpu/WebGPUBindGroupBinding.idl:
717         * Modules/webgpu/WebGPUBindGroupDescriptor.idl:
718         * Modules/webgpu/WebGPUBufferBinding.h:
719         * Modules/webgpu/WebGPUBufferBinding.idl:
720         * Modules/webgpu/WebGPUCommandEncoder.idl:
721         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
722         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
723         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
724         * Modules/webgpu/WebGPURenderPassDescriptor.idl:
725         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
726         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
727         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
728         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
729         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
730         * platform/graphics/gpu/GPUBlendDescriptor.h:
731         * platform/graphics/gpu/GPUColorStateDescriptor.h:
732         * platform/graphics/gpu/GPUCommandBuffer.h:
733         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
734         * platform/graphics/gpu/GPURenderPassDescriptor.h:
735         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
736         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
737         * platform/graphics/gpu/GPURequestAdapterOptions.h:
738         * platform/graphics/gpu/GPUTextureDescriptor.h:
739         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
740         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
741         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
742         (WebCore::convertRenderPipelineDescriptor):
743         (WebCore::trySetFunctionsForPipelineDescriptor):
744
745 2019-04-18  Jer Noble  <jer.noble@apple.com>
746
747         Refactoring: Pull all fullscreen code out of Document and into its own helper class
748         https://bugs.webkit.org/show_bug.cgi?id=197017
749
750         Reviewed by Eric Carlson.
751
752         * CMakeLists.txt:
753         * DerivedSources-input.xcfilelist:
754         * DerivedSources-output.xcfilelist:
755         * DerivedSources.make:
756         * Sources.txt:
757         * WebCore.xcodeproj/project.pbxproj:
758         * css/CSSDefaultStyleSheets.cpp:
759         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
760         * css/SelectorCheckerTestFunctions.h:
761         (WebCore::matchesFullScreenPseudoClass):
762         (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
763         (WebCore::matchesFullScreenDocumentPseudoClass):
764         (WebCore::matchesFullScreenControlsHiddenPseudoClass):
765         * dom/Document.cpp:
766         (WebCore::Document::removedLastRef):
767         (WebCore::Document::prepareForDestruction):
768         (WebCore::Document::nodeChildrenWillBeRemoved):
769         (WebCore::Document::nodeWillBeRemoved):
770         (WebCore::isAttributeOnAllOwners): Deleted.
771         (WebCore::Document::fullScreenIsAllowedForElement const): Deleted.
772         (WebCore::Document::requestFullScreenForElement): Deleted.
773         (WebCore::Document::webkitCancelFullScreen): Deleted.
774         (WebCore::Document::webkitExitFullscreen): Deleted.
775         (WebCore::Document::webkitFullscreenEnabled const): Deleted.
776         (WebCore::unwrapFullScreenRenderer): Deleted.
777         (WebCore::Document::webkitWillEnterFullScreen): Deleted.
778         (WebCore::Document::webkitDidEnterFullScreen): Deleted.
779         (WebCore::Document::webkitWillExitFullScreen): Deleted.
780         (WebCore::Document::webkitDidExitFullScreen): Deleted.
781         (WebCore::Document::setFullScreenRenderer): Deleted.
782         (WebCore::Document::dispatchFullScreenChangeEvents): Deleted.
783         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent): Deleted.
784         (WebCore::Document::fullScreenElementRemoved): Deleted.
785         (WebCore::Document::adjustFullScreenElementOnNodeRemoval): Deleted.
786         (WebCore::Document::isAnimatingFullScreen const): Deleted.
787         (WebCore::Document::setAnimatingFullScreen): Deleted.
788         (WebCore::Document::areFullscreenControlsHidden const): Deleted.
789         (WebCore::Document::setFullscreenControlsHidden): Deleted.
790         (WebCore::Document::clearFullscreenElementStack): Deleted.
791         (WebCore::Document::popFullscreenElementStack): Deleted.
792         (WebCore::Document::pushFullscreenElementStack): Deleted.
793         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Deleted.
794         * dom/Document.h:
795         (WebCore::Document::fullscreenManager):
796         (WebCore::Document::webkitIsFullScreen const): Deleted.
797         (WebCore::Document::webkitFullScreenKeyboardInputAllowed const): Deleted.
798         (WebCore::Document::webkitCurrentFullScreenElement const): Deleted.
799         (WebCore::Document::webkitCurrentFullScreenElementForBindings const): Deleted.
800         (WebCore::Document::fullScreenRenderer const): Deleted.
801         (WebCore::Document::webkitFullscreenElement const): Deleted.
802         (WebCore::Document::webkitFullscreenElementForBindings const): Deleted.
803         * dom/Document.idl:
804         * dom/DocumentFullscreen.h:
805         (WebCore::DocumentFullscreen::webkitFullscreenEnabled):
806         (WebCore::DocumentFullscreen::webkitFullscreenElement):
807         (WebCore::DocumentFullscreen::webkitExitFullscreen):
808         (WebCore::DocumentFullscreen::webkitIsFullScreen):
809         (WebCore::DocumentFullscreen::webkitFullScreenKeyboardInputAllowed):
810         (WebCore::DocumentFullscreen::webkitCurrentFullScreenElement):
811         (WebCore::DocumentFullscreen::webkitCancelFullScreen):
812         * dom/DocumentFullscreen.idl:
813         * dom/Element.cpp:
814         (WebCore::Element::webkitRequestFullscreen):
815         * dom/EventPath.cpp:
816         (WebCore::shouldEventCrossShadowBoundary):
817         * dom/FullscreenManager.cpp: Added.
818         (WebCore::isAttributeOnAllOwners):
819         (WebCore::FullscreenManager::FullscreenManager):
820         (WebCore::FullscreenManager::fullscreenIsAllowedForElement const):
821         (WebCore::FullscreenManager::requestFullscreenForElement):
822         (WebCore::FullscreenManager::cancelFullscreen):
823         (WebCore::FullscreenManager::requestExitFullscreen):
824         (WebCore::FullscreenManager::exitFullscreen):
825         (WebCore::FullscreenManager::isFullscreenEnabled const):
826         (WebCore::unwrapFullscreenRenderer):
827         (WebCore::FullscreenManager::willEnterFullscreen):
828         (WebCore::FullscreenManager::didEnterFullscreen):
829         (WebCore::FullscreenManager::willExitFullscreen):
830         (WebCore::FullscreenManager::didExitFullscreen):
831         (WebCore::FullscreenManager::setFullscreenRenderer):
832         (WebCore::FullscreenManager::dispatchFullscreenChangeEvents):
833         (WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent):
834         (WebCore::FullscreenManager::fullscreenElementRemoved):
835         (WebCore::FullscreenManager::adjustFullscreenElementOnNodeRemoval):
836         (WebCore::FullscreenManager::isAnimatingFullscreen const):
837         (WebCore::FullscreenManager::setAnimatingFullscreen):
838         (WebCore::FullscreenManager::areFullscreenControlsHidden const):
839         (WebCore::FullscreenManager::setFullscreenControlsHidden):
840         (WebCore::FullscreenManager::clear):
841         (WebCore::FullscreenManager::emptyEventQueue):
842         (WebCore::FullscreenManager::clearFullscreenElementStack):
843         (WebCore::FullscreenManager::popFullscreenElementStack):
844         (WebCore::FullscreenManager::pushFullscreenElementStack):
845         (WebCore::FullscreenManager::addDocumentToFullscreenChangeEventQueue):
846         * dom/FullscreenManager.h: Added.
847         (WebCore::FullscreenManager::document):
848         (WebCore::FullscreenManager::document const):
849         (WebCore::FullscreenManager::topDocument const):
850         (WebCore::FullscreenManager::page const):
851         (WebCore::FullscreenManager::frame const):
852         (WebCore::FullscreenManager::documentElement const):
853         (WebCore::FullscreenManager::hasLivingRenderTree const):
854         (WebCore::FullscreenManager::pageCacheState const):
855         (WebCore::FullscreenManager::scheduleFullStyleRebuild):
856         (WebCore::FullscreenManager::fullscreenElement const):
857         (WebCore::FullscreenManager::isFullscreen const):
858         (WebCore::FullscreenManager::isFullscreenKeyboardInputAllowed const):
859         (WebCore::FullscreenManager::currentFullscreenElement const):
860         (WebCore::FullscreenManager::fullscreenRenderer const):
861         * html/HTMLMediaElement.cpp:
862         (WebCore::HTMLMediaElement::isFullscreen const):
863         (WebCore::HTMLMediaElement::isStandardFullscreen const):
864         (WebCore::HTMLMediaElement::enterFullscreen):
865         (WebCore::HTMLMediaElement::exitFullscreen):
866         * html/MediaElementSession.cpp:
867         (WebCore::MediaElementSession::canShowControlsManager const):
868         * html/shadow/MediaControlElements.cpp:
869         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
870         * inspector/agents/InspectorDOMAgent.cpp:
871         * page/EventHandler.cpp:
872         (WebCore::EventHandler::isKeyEventAllowedInFullScreen const):
873         (WebCore::EventHandler::internalKeyEvent):
874         * page/Page.cpp:
875         (WebCore::Page::setFullscreenControlsHidden):
876         * rendering/RenderFullScreen.cpp:
877         (WebCore::RenderFullScreen::wrapNewRenderer):
878         (WebCore::RenderFullScreen::wrapExistingRenderer):
879         * rendering/RenderLayerCompositor.cpp:
880         (WebCore::isDescendantOfFullScreenLayer):
881         * rendering/updating/RenderTreeBuilder.h:
882         * rendering/updating/RenderTreeBuilderInline.cpp:
883         (WebCore::RenderTreeBuilder::Inline::splitInlines):
884         * rendering/updating/RenderTreeUpdater.cpp:
885         (WebCore::RenderTreeUpdater::createRenderer):
886         * style/StyleSharingResolver.cpp:
887         (WebCore::Style::SharingResolver::canShareStyleWithElement const):
888         * testing/Internals.cpp:
889         (WebCore::Internals::webkitWillEnterFullScreenForElement):
890         (WebCore::Internals::webkitDidEnterFullScreenForElement):
891         (WebCore::Internals::webkitWillExitFullScreenForElement):
892         (WebCore::Internals::webkitDidExitFullScreenForElement):
893         (WebCore::Internals::isAnimatingFullScreen const):
894
895 2019-04-18  Jer Noble  <jer.noble@apple.com>
896
897         Add support for parsing FairPlayStreaming PSSH boxes.
898         https://bugs.webkit.org/show_bug.cgi?id=197064
899
900         Reviewed by Eric Carlson.
901
902         API Tests: ISO.ISOFairPlayStreamingPsshBox
903
904         Add a new set of ISOBox classes for parsing the contents of a FairPlayStreaming PSSH box,
905         and add support for this new box to CDMFairPlayStreaming.
906
907         Drive-by fix: add an explicit include for MainThread.h to LibWebRTCProviderCocoa.cpp.
908
909         * SourcesCocoa.txt:
910         * WebCore.xcodeproj/project.pbxproj:
911         * platform/graphics/FourCC.h:
912         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
913         (WebCore::CDMPrivateFairPlayStreaming::cencName):
914         (WebCore::fairPlaySystemID):
915         (WebCore::extractSchemeAndKeyIdFromCenc):
916         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc):
917         (WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc):
918         (WebCore::validInitDataTypes):
919         (WebCore::CDMFactory::platformRegisterFactories):
920         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
921         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp: Added.
922         (WebCore::ISOFairPlayStreamingPsshBox::fairPlaySystemID):
923         (WebCore::ISOFairPlayStreamingInfoBox::parse):
924         (WebCore::ISOFairPlayStreamingKeyRequestInfoBox::parse):
925         (WebCore::ISOFairPlayStreamingKeyAssetIdBox::parse):
926         (WebCore::ISOFairPlayStreamingKeyContextBox::parse):
927         (WebCore::ISOFairPlayStreamingKeyVersionListBox::parse):
928         (WebCore::ISOFairPlayStreamingKeyRequestBox::parse):
929         (WebCore::ISOFairPlayStreamingInitDataBox::parse):
930         (WebCore::ISOFairPlayStreamingPsshBox::parse):
931         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h: Added.
932         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
933
934 2019-04-18  Sihui Liu  <sihui_liu@apple.com>
935
936         Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
937         https://bugs.webkit.org/show_bug.cgi?id=196128
938         <rdar://problem/49562115>
939
940         Reviewed by Geoffrey Garen.
941
942         If a key is auto-generated, it should become a property of the value object. Network process would perform the 
943         key injection by deserializing IDBValue into script value, setting the property, serializing the result and 
944         storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to 
945         deserialize types including Blob and File.
946
947         To solve this issue, we move the key injection to web process and let network process store the original value 
948         it gets. In this case, when web process asks for some value, network process should return key, value and key 
949         path so that web process can decide whether it should perform a key injection before returning the result. Note
950         that the auto-generated key would always be stored as the key in a ObjectStore record.
951
952         Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
953
954         * Modules/indexeddb/IDBCursor.cpp:
955         (WebCore::IDBCursor::setGetResult):
956         * Modules/indexeddb/IDBCursor.h:
957         (WebCore::IDBCursor::primaryKeyPath):
958         * Modules/indexeddb/IDBGetAllResult.cpp:
959         (WebCore::IDBGetAllResult::isolatedCopy):
960         (WebCore::IDBGetAllResult::addKey):
961         (WebCore::IDBGetAllResult::addValue):
962         (WebCore::IDBGetAllResult::keys const):
963         (WebCore::IDBGetAllResult::values const):
964         (WebCore::IDBGetAllResult::allBlobFilePaths const):
965         (WebCore::isolatedCopyOfVariant): Deleted.
966
967         * Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
968         because we only needed to store either key or value before, and now the stored value could be incomplete.
969         (WebCore::IDBGetAllResult::IDBGetAllResult):
970         (WebCore::IDBGetAllResult::keyPath const):
971         (WebCore::IDBGetAllResult::encode const):
972         (WebCore::IDBGetAllResult::decode):
973
974         * Modules/indexeddb/IDBGetResult.cpp:
975         (WebCore::IDBGetResult::setValue):
976         * Modules/indexeddb/IDBGetResult.h:
977         (WebCore::IDBGetResult::IDBGetResult):
978         (WebCore::IDBGetResult::keyPath const):
979         * Modules/indexeddb/IDBRequest.cpp:
980         (WebCore::IDBRequest::setResult):
981         (WebCore::IDBRequest::setResultToStructuredClone):
982         * Modules/indexeddb/IDBRequest.h:
983         * Modules/indexeddb/IDBTransaction.cpp:
984         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
985         (WebCore::IDBTransaction::didGetRecordOnServer):
986         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
987         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
988         * Modules/indexeddb/server/MemoryIndex.cpp:
989         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
990         (WebCore::IDBServer::MemoryIndex::getAllRecords const):
991         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
992         (WebCore::IDBServer::MemoryIndexCursor::currentData):
993         * Modules/indexeddb/server/MemoryObjectStore.cpp:
994         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
995         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
996         (WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
997         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
998         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
999         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1000         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
1001         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
1002         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1003         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
1004         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
1005         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
1006         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1007         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
1008         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
1009         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1010         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1011         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
1012         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1013         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1014
1015         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process. 
1016         UniqueIDBDatabase stores any value it gets from IDBClient.
1017
1018         * Modules/indexeddb/shared/IDBResultData.cpp:
1019         (WebCore::IDBResultData::getResultRef):
1020         * Modules/indexeddb/shared/IDBResultData.h:
1021
1022         * bindings/js/IDBBindingUtilities.cpp:
1023         (WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
1024         return null, but we expect it to return result as long as the property value is the same as target. Therefore, 
1025         we can add an early return here.
1026
1027         (WebCore::createKeyPathArray):
1028         (WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
1029         value gets stored does not include auto-generated key, as we remove the key injection from network process. In 
1030         this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
1031         for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in 
1032         database record, we could use value of that key when we find a match in key path.
1033
1034         (WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is 
1035         probably auto-generated, so we could inject the result key into the result value unconditionally.
1036
1037         * bindings/js/IDBBindingUtilities.h:
1038         * bindings/js/JSIDBCursorWithValueCustom.cpp:
1039         (WebCore::JSIDBCursorWithValue::value const):
1040         * bindings/js/JSIDBRequestCustom.cpp:
1041         (WebCore::JSIDBRequest::result const):
1042
1043 2019-04-18  Zalan Bujtas  <zalan@apple.com>
1044
1045         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
1046         https://bugs.webkit.org/show_bug.cgi?id=196948
1047         <rdar://problem/49927131>
1048
1049         Reviewed by Tim Horton.
1050
1051         * page/FrameView.cpp:
1052         (WebCore::FrameView::setContentsSize):
1053         (WebCore::FrameView::autoSizeIfEnabled):
1054         * page/FrameView.h:
1055
1056 2019-04-18  Shawn Roberts  <sroberts@apple.com>
1057
1058         Unreviewed manual rollout of r244248 and r244409
1059         Causing assertion failures on Mac WK2 Debug builds
1060         https://bugs.webkit.org/show_bug.cgi?id=195623
1061
1062         * loader/LinkLoader.cpp:
1063         (WebCore::LinkLoader::prefetchIfNeeded):
1064         * loader/ResourceLoadInfo.cpp:
1065         (WebCore::toResourceType):
1066         * loader/ResourceLoadInfo.h:
1067         * loader/ResourceLoader.cpp:
1068         (WebCore::ResourceLoader::willSendRequestInternal):
1069         * loader/cache/CachedResourceLoader.cpp:
1070         (WebCore::CachedResourceLoader::requestResource):
1071
1072 2019-04-18  Antti Koivisto  <antti@apple.com>
1073
1074         Tile update problems in iframe after scrolling page too soon after load
1075         https://bugs.webkit.org/show_bug.cgi?id=197057
1076         <rdar://problem/49913663>
1077
1078         Reviewed by Simon Fraser.
1079
1080         We end up destroying FrameHosting scrolling node when we shouldn't.
1081
1082         No test, despite attempts I couldn't get this state to stick. The problem is that in
1083         most cases the destroying scrolling node gets immediately recreated and connected again.
1084         Getting into testably buggy state requires some very specific layer tree configuration update.
1085
1086         * rendering/RenderLayerBacking.cpp:
1087         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1088
1089         Test the right thing.
1090
1091 2019-04-18  Antoine Quint  <graouts@apple.com>
1092
1093         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
1094         https://bugs.webkit.org/show_bug.cgi?id=197004
1095
1096         Reviewed by Antti Koivisto.
1097
1098         We need to release pointer capture when an element that has pointer capture is disconnected from the DOM.
1099
1100         * dom/Element.cpp:
1101         (WebCore::Element::removedFromAncestor): Notify the PointerCaptureController that an element was disconnected.
1102         * dom/PointerEvent.cpp:
1103         (WebCore::PointerEvent::create): Broaden createPointerCancelEvent() to take in an event type so that we may use it to create a
1104         lostpointercapture event as well.
1105         (WebCore::PointerEvent::createPointerCancelEvent): Deleted.
1106         * dom/PointerEvent.h:
1107         * page/PointerCaptureController.cpp:
1108         (WebCore::PointerCaptureController::elementWasRemoved): Check whether the provided element matches one of the target overrides recorded
1109         in the map of captured pointer IDs.
1110         (WebCore::PointerCaptureController::pointerEventWasDispatched): This block of code was actually useless in this location, the new code
1111         added in elementWasRemoved() performs the actions that the spec text mandates.
1112         (WebCore::PointerCaptureController::cancelPointer): Replace the call to createPointerCancelEvent() with one to create().
1113         * page/PointerCaptureController.h:
1114
1115 2019-04-17  Antoine Quint  <graouts@apple.com>
1116
1117         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
1118         https://bugs.webkit.org/show_bug.cgi?id=197006
1119
1120         Reviewed by Antti Koivisto.
1121
1122         Add support for on* HTML attributes and JS properties for pointer events.
1123
1124         * dom/GlobalEventHandlers.idl:
1125         * html/HTMLAttributeNames.in:
1126         * html/HTMLElement.cpp:
1127         (WebCore::HTMLElement::createEventHandlerNameMap):
1128
1129 2019-04-17  Timothy Hatcher  <timothy@apple.com>
1130
1131         Standardize the `<meta name="color-scheme">` separator.
1132         https://bugs.webkit.org/show_bug.cgi?id=193931
1133
1134         Reviewed by Simon Fraser.
1135
1136         Drop support for comma as a valid seperator in <meta name="color-scheme"> to
1137         match the proposal being tracked by: https://github.com/whatwg/html/issues/4504
1138
1139         Tests: css-dark-mode/color-scheme-meta.html
1140                css-dark-mode/older-syntax/supported-color-schemes-meta.html
1141
1142         * dom/Document.cpp:
1143         (WebCore::isColorSchemeSeparator): Drop support for comma.
1144
1145 2019-04-17  Timothy Hatcher  <timothy@apple.com>
1146
1147         Rename `supported-color-schemes` to `color-scheme`.
1148         https://bugs.webkit.org/show_bug.cgi?id=197016
1149         rdar://problem/49980259
1150
1151         Reviewed by Simon Fraser.
1152
1153         Changed `supported-color-schemes` to `color-scheme` to follow the spec changes
1154         being tracked by: https://github.com/w3c/csswg-drafts/issues/3807
1155
1156         The old `supported-color-schemes` is now an alias of `color-scheme` for compatibility.
1157
1158         Tests: css-dark-mode/color-scheme-css-parse.html
1159                css-dark-mode/color-scheme-css.html
1160                css-dark-mode/color-scheme-meta.html
1161                css-dark-mode/color-scheme-priority.html
1162                css-dark-mode/color-scheme-scrollbar.html
1163                css-dark-mode/older-syntax/supported-color-schemes-css.html
1164                css-dark-mode/older-syntax/supported-color-schemes-meta.html
1165                css-dark-mode/older-systems/color-scheme-css.html
1166                css-dark-mode/older-systems/color-scheme-meta.html
1167
1168         * WebCore.xcodeproj/project.pbxproj:
1169         * css/CSSComputedStyleDeclaration.cpp:
1170         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1171         * css/CSSProperties.json:
1172         * css/CSSValueKeywords.in:
1173         * css/StyleBuilderConverter.h:
1174         (WebCore::StyleBuilderConverter::updateColorScheme):
1175         (WebCore::StyleBuilderConverter::convertColorScheme):
1176         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes): Deleted.
1177         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes): Deleted.
1178         * css/StyleBuilderCustom.h:
1179         (WebCore::StyleBuilderCustom::applyValueColorScheme):
1180         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes): Deleted.
1181         * css/StyleResolver.cpp:
1182         (WebCore::StyleResolver::applyMatchedProperties):
1183         * css/parser/CSSPropertyParser.cpp:
1184         (WebCore::consumeColorScheme):
1185         (WebCore::CSSPropertyParser::parseSingleValue):
1186         (WebCore::consumeSupportedColorSchemes): Deleted.
1187         * dom/Document.cpp:
1188         (WebCore::processColorSchemeString):
1189         (WebCore::Document::processColorScheme):
1190         (WebCore::Document::useDarkAppearance const):
1191         (WebCore::processColorSchemes): Deleted.
1192         (WebCore::Document::processSupportedColorSchemes): Deleted.
1193         * dom/Document.h:
1194         * html/HTMLMetaElement.cpp:
1195         (WebCore::HTMLMetaElement::process):
1196         * page/FrameView.cpp:
1197         (WebCore::FrameView::rendererForColorScheme const):
1198         (WebCore::FrameView::useDarkAppearance const):
1199         (WebCore::FrameView::styleColorOptions const):
1200         (WebCore::FrameView::rendererForSupportedColorSchemes const): Deleted.
1201         * page/FrameView.h:
1202         * rendering/style/RenderStyle.cpp:
1203         (WebCore::rareInheritedDataChangeRequiresRepaint):
1204         * rendering/style/RenderStyle.h:
1205         (WebCore::RenderStyle::colorScheme const):
1206         (WebCore::RenderStyle::setHasExplicitlySetColorScheme):
1207         (WebCore::RenderStyle::hasExplicitlySetColorScheme const):
1208         (WebCore::RenderStyle::setColorScheme):
1209         (WebCore::RenderStyle::initialColorScheme):
1210         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
1211         (WebCore::RenderStyle::supportedColorSchemes const): Deleted.
1212         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Deleted.
1213         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Deleted.
1214         (WebCore::RenderStyle::setSupportedColorSchemes): Deleted.
1215         (WebCore::RenderStyle::initialSupportedColorSchemes): Deleted.
1216         * rendering/style/RenderStyleConstants.h:
1217         * rendering/style/StyleColorScheme.h: Renamed from Source/WebCore/rendering/style/StyleSupportedColorSchemes.h.
1218         (WebCore::StyleColorScheme::StyleColorScheme):
1219         (WebCore::StyleColorScheme::operator== const):
1220         (WebCore::StyleColorScheme::operator!= const):
1221         (WebCore::StyleColorScheme::isAuto const):
1222         (WebCore::StyleColorScheme::isOnly const):
1223         (WebCore::StyleColorScheme::colorScheme const):
1224         (WebCore::StyleColorScheme::add):
1225         (WebCore::StyleColorScheme::contains const):
1226         (WebCore::StyleColorScheme::setAllowsTransformations):
1227         (WebCore::StyleColorScheme::allowsTransformations const):
1228         * rendering/style/StyleRareInheritedData.cpp:
1229         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1230         (WebCore::StyleRareInheritedData::operator== const):
1231         * rendering/style/StyleRareInheritedData.h:
1232
1233 2019-04-17  Justin Fan  <justin_fan@apple.com>
1234
1235         [Web GPU] GPUComputePassEncoder::dispatch number of thread groups, not grid size
1236         https://bugs.webkit.org/show_bug.cgi?id=196984
1237
1238         Reviewed by Myles C. Maxfield.
1239
1240         Test: Updated compute-squares.html.
1241
1242         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
1243         (WebCore::GPUComputePassEncoder::dispatch):
1244
1245 2019-04-17  Andy Estes  <aestes@apple.com>
1246
1247         [iOS] Support multiple file selection in UIDocumentPickerViewController
1248         https://bugs.webkit.org/show_bug.cgi?id=197014
1249         <rdar://problem/49963514>
1250
1251         Reviewed by Tim Horton.
1252
1253         * platform/LocalizedStrings.h:
1254         Exported multipleFileUploadText().
1255
1256 2019-04-17  John Wilander  <wilander@apple.com>
1257
1258         Add prioritization of ad click conversions and cleaning of sent ad click conversions
1259         https://bugs.webkit.org/show_bug.cgi?id=196934
1260         <rdar://problem/49917773>
1261
1262         Reviewed by Chris Dumez.
1263
1264         Tests: http/tests/adClickAttribution/second-attribution-converted-with-higher-priority.html
1265                http/tests/adClickAttribution/second-attribution-converted-with-lower-priority.html
1266                http/tests/adClickAttribution/second-conversion-with-higher-priority.html
1267                http/tests/adClickAttribution/second-conversion-with-lower-priority.html
1268
1269         * loader/AdClickAttribution.cpp:
1270         (WebCore::AdClickAttribution::hasHigherPriorityThan const):
1271             Added to facilitate priority comparison between two attributions.
1272         * loader/AdClickAttribution.h:
1273         (WebCore::AdClickAttribution::Destination::Destination):
1274             Added a WTF::HashTableDeletedValueType constructor and changed the copy constructor to
1275             a move constructor.
1276         (WebCore::AdClickAttribution::isEmpty const):
1277
1278 2019-04-17  Devin Rousso  <drousso@apple.com>
1279
1280         AX: AccessibilityObject::parentObject() doesn't need to be pure virtual
1281         https://bugs.webkit.org/show_bug.cgi?id=197026
1282         <rdar://problem/49448209>
1283
1284         Reviewed by Timothy Hatcher.
1285
1286         * accessibility/AccessibilityObject.h:
1287         (WebCore::AccessibilityObject::parentObject const):
1288
1289 2019-04-17  Zalan Bujtas  <zalan@apple.com>
1290
1291         [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
1292         https://bugs.webkit.org/show_bug.cgi?id=196988
1293         <rdar://problem/49955328>
1294
1295         Reviewed by Simon Fraser.
1296
1297         Test: fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html
1298
1299         * accessibility/AccessibilityObject.h:
1300
1301 2019-04-17  Alex Christensen  <achristensen@webkit.org>
1302
1303         WebSocketHandshake should not know about a Document
1304         https://bugs.webkit.org/show_bug.cgi?id=196468
1305
1306         Reviewed by Tim Horton.
1307
1308         I'll need to move WebSocketHandshake to the NetworkProcess for rdar://problem/46287028
1309         It currently uses the Document pointer for 3 things:
1310         1. To get the user agent, which we can pass in as a creation parameter.
1311         2. To get the origin, which we can also pass in as a creation parameter.
1312         3. To get cookies for the web inspector.  We can pass in a functor instead and have the inspector provide cookies itself.
1313
1314         * Modules/websockets/WebSocketChannel.cpp:
1315         (WebCore::WebSocketChannel::connect):
1316         (WebCore::WebSocketChannel::disconnect):
1317         (WebCore::WebSocketChannel::didOpenSocketStream):
1318         (WebCore::WebSocketChannel::clientHandshakeRequest):
1319         * Modules/websockets/WebSocketChannel.h:
1320         (WebCore::WebSocketChannel::document):
1321         * Modules/websockets/WebSocketHandshake.cpp:
1322         (WebCore::WebSocketHandshake::WebSocketHandshake):
1323         (WebCore::WebSocketHandshake::clientHandshakeMessage const):
1324         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
1325         (WebCore::WebSocketHandshake::clientOrigin const): Deleted.
1326         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const): Deleted.
1327         (WebCore::WebSocketHandshake::clearDocument): Deleted.
1328         * Modules/websockets/WebSocketHandshake.h:
1329         * inspector/agents/InspectorNetworkAgent.cpp:
1330         (WebCore::InspectorNetworkAgent::enable):
1331
1332 2019-04-17  Timothy Hatcher  <timothy@apple.com>
1333
1334         Unreviewed build fix for iOSMac after r244223.
1335
1336         * platform/audio/ios/AudioSessionIOS.mm:
1337         (WebCore::AudioSession::routeSharingPolicy const): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
1338         around AVAudioSessionRouteSharingPolicyLongForm use.
1339
1340 2019-04-17  Chris Dumez  <cdumez@apple.com>
1341
1342         Remember device orientation permission for the duration of the browsing session
1343         https://bugs.webkit.org/show_bug.cgi?id=196992
1344         <rdar://problem/49946067>
1345
1346         Reviewed by Alex Christensen.
1347
1348         Use DeviceOrientationOrMotionPermissionState type more consistently in the code base
1349         instead of bool or Optional<bool>. Added "Prompt" value to this enumeration which is the
1350         default state and which indicates we should ask the client.
1351
1352         * WebCore.xcodeproj/project.pbxproj:
1353         * dom/DeviceOrientationAndMotionAccessController.cpp:
1354         (WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
1355         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
1356         * dom/DeviceOrientationAndMotionAccessController.h:
1357         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
1358         * dom/DeviceOrientationOrMotionEvent.cpp:
1359         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
1360         * dom/DeviceOrientationOrMotionPermissionState.h:
1361         * loader/DocumentLoader.h:
1362         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
1363         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
1364         * page/ChromeClient.h:
1365         * page/DOMWindow.cpp:
1366         (WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
1367
1368 2019-04-17  Rob Buis  <rbuis@igalia.com>
1369
1370         XMLHttpRequest has the wrong fallback encoding
1371         https://bugs.webkit.org/show_bug.cgi?id=191741
1372
1373         Reviewed by Alex Christensen.
1374
1375         Allow overriding the response charset as specified here:
1376         https://xhr.spec.whatwg.org/#final-charset
1377
1378         Behavior matches Firefox and Chrome.
1379
1380         Tests: imported/w3c/web-platform-tests/encoding/replacement-encodings.any.html
1381                imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker.html
1382                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.html
1383                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.worker.html
1384
1385         * xml/XMLHttpRequest.cpp:
1386         (WebCore::XMLHttpRequest::finalResponseCharset const):
1387         (WebCore::XMLHttpRequest::createDecoder const):
1388         * xml/XMLHttpRequest.h:
1389
1390 2019-04-16  Antoine Quint  <graouts@apple.com>
1391
1392         Opt Google Maps into simulated mouse events dispatch quirk
1393         https://bugs.webkit.org/show_bug.cgi?id=196965
1394         <rdar://problem/49934766>
1395
1396         Reviewed by Dean Jackson.
1397
1398         Use the correct Google Maps path.
1399
1400         * page/Quirks.cpp:
1401         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1402
1403 2019-04-16  Antoine Quint  <graouts@apple.com>
1404
1405         Opt flipkart.com into simulated mouse events dispatch quirk
1406         https://bugs.webkit.org/show_bug.cgi?id=196961
1407         <rdar://problem/49648520>
1408
1409         Reviewed by Dean Jackson.
1410
1411         * page/Quirks.cpp:
1412         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1413
1414 2019-04-16  Antoine Quint  <graouts@apple.com>
1415
1416         Opt MSN.com into simulated mouse events dispatch quirk
1417         https://bugs.webkit.org/show_bug.cgi?id=196960
1418         <rdar://problem/49403260>
1419
1420         Reviewed by Dean Jackson.
1421
1422         * page/Quirks.cpp:
1423         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1424
1425 2019-04-16  Zan Dobersek  <zdobersek@igalia.com>
1426
1427         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
1428         https://bugs.webkit.org/show_bug.cgi?id=191354
1429         <rdar://problem/46123406>
1430
1431         Reviewed by Michael Catanzaro.
1432
1433         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
1434         index validity and, if the index is valid, check for completeness of the
1435         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
1436         also only retrieve duration for already-complete frames, or expand the
1437         default 0-second value according to the flashing-protection rule when
1438         the target frame is not yet complete.
1439
1440         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
1441         as that method goes on and decodes image data to determine specific
1442         information. The ImageSource class that's querying this information
1443         doesn't anticipate this, and doesn't handle the increased memory
1444         consumption of the decoded data, leaving MemoryCache in the blind about
1445         the image resource's actual amount of consumed memory. ImageSource can
1446         instead gracefully handle any incomplete frame by marking the decoding
1447         status for this frame as only partial.
1448
1449         * platform/image-decoders/ScalableImageDecoder.cpp:
1450         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
1451         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
1452         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
1453
1454 2019-04-16  Ross Kirsling  <ross.kirsling@sony.com>
1455
1456         Unreviewed non-unified build fix after r244307.
1457
1458         * page/DiagnosticLoggingClient.h:
1459
1460 2019-04-16  Chris Dumez  <cdumez@apple.com>
1461
1462         URL set by document.open() is not communicated to the UIProcess
1463         https://bugs.webkit.org/show_bug.cgi?id=196941
1464         <rdar://problem/49237544>
1465
1466         Reviewed by Geoff Garen.
1467
1468         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
1469         the latest document URL.
1470
1471         * loader/FrameLoader.cpp:
1472         (WebCore::FrameLoader::didExplicitOpen):
1473         * loader/FrameLoaderClient.h:
1474
1475 2019-04-16  Timothy Hatcher  <timothy@apple.com>
1476
1477         FrameView base background color always starts white.
1478         https://bugs.webkit.org/show_bug.cgi?id=196976
1479
1480         Reviewed by Beth Dakin.
1481
1482         * page/FrameView.cpp:
1483         (WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
1484         color did not change.
1485
1486 2019-04-16  Devin Rousso  <drousso@apple.com>
1487
1488         Unprefix -webkit-sticky
1489         https://bugs.webkit.org/show_bug.cgi?id=196962
1490         <rdar://problem/40903458>
1491
1492         Reviewed by Simon Fraser.
1493
1494         Updated existing tests.
1495
1496         This change doesn't modify functionality, only exposing a new unprefixed CSS value.
1497
1498         * css/CSSProperties.json:
1499         * css/CSSValueKeywords.in:
1500
1501         * css/CSSPrimitiveValueMappings.h:
1502         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1503         (WebCore::CSSPrimitiveValue::operator PositionType const):
1504
1505         * css/parser/CSSParserFastPaths.cpp:
1506         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1507
1508         * editing/EditingStyle.cpp:
1509         (WebCore::EditingStyle::convertPositionStyle):
1510
1511 2019-04-16  Commit Queue  <commit-queue@webkit.org>
1512
1513         Unreviewed, rolling out r244321.
1514         https://bugs.webkit.org/show_bug.cgi?id=196968
1515
1516         Causing all WK2 Debug builds to exit early after Assertion
1517         failures. (Requested by ShawnRoberts on #webkit).
1518
1519         Reverted changeset:
1520
1521         "URL set by document.open() is not communicated to the
1522         UIProcess"
1523         https://bugs.webkit.org/show_bug.cgi?id=196941
1524         https://trac.webkit.org/changeset/244321
1525
1526 2019-04-16  Caitlin Potter  <caitp@igalia.com>
1527
1528         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
1529         https://bugs.webkit.org/show_bug.cgi?id=176810
1530
1531         Reviewed by Saam Barati.
1532
1533         Previously, there was a comment here indicating uncertainty of whether it
1534         was necessary to filter DontEnum properties explicitly or not. It turns
1535         out that it was necessary in the case of JSC ProxyObjects.
1536
1537         This patch adds DontEnum filtering for ProxyObjects, however we continue
1538         to explicitly filter them in JSDOMConvertRecord, which needs to use the
1539         property descriptor after filtering. This change prevents observably
1540         fetching the property descriptor twice per property.
1541
1542         * bindings/js/JSDOMConvertRecord.h:
1543
1544 2019-04-15  Antoine Quint  <graouts@apple.com>
1545
1546         [iOS] Redundant pointer events causes material design buttons to flush twice
1547         https://bugs.webkit.org/show_bug.cgi?id=196914
1548         <rdar://problem/49571860>
1549
1550         Reviewed by Dean Jackson.
1551
1552         Test: pointerevents/ios/pointer-event-order.html
1553
1554         Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.
1555
1556         * dom/Element.cpp:
1557         (WebCore::Element::dispatchMouseEvent):
1558
1559 2019-04-15  John Wilander  <wilander@apple.com>
1560
1561         Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness
1562         https://bugs.webkit.org/show_bug.cgi?id=196955
1563
1564         Unreviewed test gardening. The WebCore change is only in a dedicated
1565         test function.
1566
1567         No new tests. Existing test updated.
1568
1569         * loader/AdClickAttribution.cpp:
1570         (WebCore::AdClickAttribution::urlForTesting const):
1571             Now preserves the query string in the test URL.
1572
1573 2019-04-15  Chris Dumez  <cdumez@apple.com>
1574
1575         URL set by document.open() is not communicated to the UIProcess
1576         https://bugs.webkit.org/show_bug.cgi?id=196941
1577         <rdar://problem/49237544>
1578
1579         Reviewed by Geoffrey Garen.
1580
1581         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
1582         the latest document URL.
1583
1584         * loader/FrameLoader.cpp:
1585         (WebCore::FrameLoader::didExplicitOpen):
1586         * loader/FrameLoaderClient.h:
1587
1588 2019-04-15  Eike Rathke  <erack@redhat.com>
1589
1590         Fix logic flow for error log
1591         https://bugs.webkit.org/show_bug.cgi?id=196933
1592
1593         Reviewed by Alexey Proskuryakov.
1594
1595         Missing block braces logged an error always, not just
1596         if (actionIfInvalid == Complain).
1597
1598         * html/HTMLMediaElement.cpp:
1599         (WebCore::HTMLMediaElement::isSafeToLoadURL):
1600
1601 2019-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
1602
1603         [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
1604         https://bugs.webkit.org/show_bug.cgi?id=196846
1605         <rdar://problem/49499971>
1606
1607         Reviewed by Simon Fraser and Darin Adler.
1608
1609         When adding the special codepath for system-ui to behave as an entire list of fonts rather than a single item,
1610         I never added a cache for the FontPlatformData objects that codepath creates. The non-system-ui codepath already
1611         has a cache in fontPlatformDataCache() in FontCache.cpp.
1612
1613         This patch causes a 16.8x performance improvement on the attached benchmark.
1614
1615         Test: PerformanceTests/Layout/system-ui-rebuild-emoji.html
1616
1617         * page/cocoa/MemoryReleaseCocoa.mm:
1618         (WebCore::platformReleaseMemory):
1619         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1620         (WebCore::invalidateFontCache):
1621         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1622         (WebCore::FontFamilySpecificationKey::FontFamilySpecificationKey):
1623         (WebCore::FontFamilySpecificationKey::operator== const):
1624         (WebCore::FontFamilySpecificationKey::operator!= const):
1625         (WebCore::FontFamilySpecificationKey::isHashTableDeletedValue const):
1626         (WebCore::FontFamilySpecificationKey::computeHash const):
1627         (WebCore::FontFamilySpecificationKeyHash::hash):
1628         (WebCore::FontFamilySpecificationKeyHash::equal):
1629         (WebCore::fontMap):
1630         (WebCore::clearFontFamilySpecificationCoreTextCache):
1631         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
1632         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
1633         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1634         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1635         (WebCore::safeCFEqual): Deleted.
1636
1637 2019-04-15  Devin Rousso  <drousso@apple.com>
1638
1639         Web Inspector: fake value descriptors for promises add a catch handler, preventing "rejectionhandled" events from being fired
1640         https://bugs.webkit.org/show_bug.cgi?id=196484
1641         <rdar://problem/49114725>
1642
1643         Reviewed by Joseph Pecoraro.
1644
1645         Test: inspector/runtime/promise-native-getter.html
1646
1647         Mark errors created from getters as being `isNativeGetterTypeError`.
1648
1649         * bindings/js/JSDOMExceptionHandling.cpp:
1650         (WebCore::throwGetterTypeError):
1651         (WebCore::rejectPromiseWithGetterTypeError):
1652         (WebCore::rejectPromiseWithThisTypeError):
1653
1654         * bindings/js/JSDOMGlobalObject.cpp:
1655         (WebCore::makeGetterTypeErrorForBuiltins):
1656
1657         * bindings/js/JSDOMPromiseDeferred.h:
1658         * bindings/js/JSDOMPromiseDeferred.cpp:
1659         (WebCore::createRejectedPromiseWithTypeError):
1660
1661         * Modules/streams/WritableStream.js:
1662         (getter.closed):
1663         (getter.ready):
1664
1665 2019-04-15  Jer Noble  <jer.noble@apple.com>
1666
1667         Add a DiagnosticLogging method taking an arbitrary dictionary of values.
1668         https://bugs.webkit.org/show_bug.cgi?id=196773
1669
1670         Reviewed by Alex Christensen.
1671
1672         * page/DiagnosticLoggingClient.h:
1673
1674 2019-04-15  Justin Fan  <justin_fan@apple.com>
1675
1676         Let WTF::convertSafely deduce types from arguments.
1677
1678         Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.
1679
1680         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1681         (WebCore::GPUBuffer::tryCreate):
1682         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1683         (WebCore::GPUCommandBuffer::copyBufferToTexture):
1684         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
1685         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1686         (WebCore::trySetInputStateForPipelineDescriptor):
1687
1688 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
1689
1690         Throw TypeError when custom element constructor returns a wrong element or tries to create itself
1691         https://bugs.webkit.org/show_bug.cgi?id=196892
1692
1693         Reviewed by Dean Jackson.
1694
1695         Throw TypeError instead of InvalidStateError for consistency. This updates WebKit's custom elements
1696         implementation for https://github.com/whatwg/html/pull/4525.
1697
1698         Tests: imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
1699                imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html
1700
1701         * bindings/js/JSCustomElementInterface.cpp:
1702         (WebCore::JSCustomElementInterface::upgradeElement):
1703         * bindings/js/JSHTMLElementCustom.cpp:
1704         (WebCore::constructJSHTMLElement):
1705
1706 2019-04-15  Don Olmstead  <don.olmstead@sony.com>
1707
1708         [CMake] WebCore derived sources should only be referenced inside WebCore
1709         https://bugs.webkit.org/show_bug.cgi?id=196904
1710
1711         Reviewed by Konstantin Tokarev.
1712
1713         Use WebCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_WEBCORE_DIR.
1714
1715         * CMakeLists.txt:
1716         * PlatformGTK.cmake:
1717         * PlatformWin.cmake:
1718         * WebCoreMacros.cmake:
1719
1720 2019-04-15  John Wilander  <wilander@apple.com>
1721
1722         Send delayed Ad Click Attribution conversion requests to the click source
1723         https://bugs.webkit.org/show_bug.cgi?id=196838
1724         <rdar://problem/47650157>
1725
1726         Reviewed by Chris Dumez and Youenn Fablet.
1727
1728         WebCore::AdClickAttribution now:
1729         - Sets m_earliestTimeToSend correctly based on WallTime::now().
1730         - Allows for a test override of the base URL for conversions.
1731         - Holds state for whether or not a conversion request has been sent.
1732         - Outputs m_earliestTimeToSend and m_conversion->hasBeenSent in toString().
1733         - Returns m_earliestTimeToSend as a result of a call to
1734         convertAndGetEarliestTimeToSend() which used to be called setConversion().
1735
1736         Test: http/tests/adClickAttribution/send-attribution-conversion-request.html
1737
1738         * loader/AdClickAttribution.cpp:
1739         (WebCore::AdClickAttribution::convertAndGetEarliestTimeToSend):
1740         (WebCore::AdClickAttribution::url const):
1741         (WebCore::AdClickAttribution::urlForTesting const):
1742         (WebCore::AdClickAttribution::markConversionAsSent):
1743         (WebCore::AdClickAttribution::wasConversionSent const):
1744         (WebCore::AdClickAttribution::toString const):
1745         (WebCore::AdClickAttribution::setConversion): Deleted.
1746             Renamed convertAndGetEarliestTimeToSend().
1747         * loader/AdClickAttribution.h:
1748         (WebCore::AdClickAttribution::Conversion::Conversion):
1749         (WebCore::AdClickAttribution::Conversion::encode const):
1750         (WebCore::AdClickAttribution::Conversion::decode):
1751         * platform/Timer.h:
1752             Now exports nextFireInterval.
1753
1754 2019-04-15  Chris Dumez  <cdumez@apple.com>
1755
1756         Regression(r237903) Speedometer 2 is 1-2% regressed on iOS
1757         https://bugs.webkit.org/show_bug.cgi?id=196841
1758         <rdar://problem/45957016>
1759
1760         Reviewed by Myles C. Maxfield.
1761
1762         Speedometer 2 content does not use the text-underline-offset and text-decoration-thickness
1763         features that were added in r237903 so I looked for behavior changes in the context of
1764         Speedometer from r237903. I found that RenderStyle::changeAffectsVisualOverflow() started
1765         returning true a lot more often after r237903. The reason is that r237903 dropped the
1766         visualOverflowForDecorations() checks in this method and started returning true a lot
1767         more as a result.
1768
1769         To restore previous behavior, this patch adds back the visualOverflowForDecorations() checks
1770         that were dropped in r237903. I have verified that with this patch,
1771         RenderStyle::changeAffectsVisualOverflow() returns true as many times as it used to before
1772         r237903.
1773
1774         * rendering/style/RenderStyle.cpp:
1775         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
1776
1777 2019-04-15  Said Abou-Hallawa  <said@apple.com>
1778
1779         ASSERT fires when removing a disallowed clone from the shadow tree without reseting its corresponding element
1780         https://bugs.webkit.org/show_bug.cgi?id=196895
1781
1782         Reviewed by Darin Adler.
1783
1784         When cloning elements to the shadow tree of an SVGUseElement, the
1785         corresponding element links are set from the clones to the originals.
1786         Later some of the elements may be disallowed to exist in the shadow tree.
1787         For example the SVGPatternElement is disallowed and has to be removed 
1788         even after cloning. The problem is the corresponding elements are not
1789         reset to null. Usually this is not a problem because the removed elements
1790         will be deleted and the destructor of SVGElement will reset the corresponding
1791         element links. However in some cases, the cloned element is referenced
1792         from another SVGElement, for example the target of a SVGTRefElement. In
1793         this case the clone won't be deleted but it will be linked to the original
1794         and the event listeners won't be copied from the original. When the
1795         original is deleted, its event listeners have to be removed. The event
1796         listeners of the clones also ave to be removed. But because the event
1797         listeners of the original were not copied when cloning, the assertion in
1798         SVGElement::removeEventListener() fires.
1799
1800         Test: svg/custom/use-disallowed-element-clear-corresponding-element.html
1801
1802         * svg/SVGUseElement.cpp:
1803         (WebCore::disassociateAndRemoveClones):
1804
1805 2019-04-15  Devin Rousso  <drousso@apple.com>
1806
1807         Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute
1808         https://bugs.webkit.org/show_bug.cgi?id=196556
1809         <rdar://problem/49570681>
1810
1811         Reviewed by Timothy Hatcher.
1812
1813         Test: inspector/dom-debugger/attribute-modified-style.html
1814
1815         * css/PropertySetCSSStyleDeclaration.h:
1816         * css/PropertySetCSSStyleDeclaration.cpp:
1817         (WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope):
1818         (WebCore::InlineCSSStyleDeclaration::willMutate): Added.
1819
1820         * dom/StyledElement.cpp:
1821         (WebCore::StyledElement::styleAttributeChanged):
1822         (WebCore::StyledElement::inlineStyleChanged):
1823
1824         * inspector/InspectorInstrumentation.h:
1825         (WebCore::InspectorInstrumentation::willInvalidateStyleAttr): Added.
1826         (WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
1827         * inspector/InspectorInstrumentation.cpp:
1828         (WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl): Added.
1829         (WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl):
1830
1831         * inspector/agents/InspectorDOMAgent.h:
1832         * inspector/agents/InspectorDOMAgent.cpp:
1833         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
1834
1835         * inspector/agents/InspectorDOMDebuggerAgent.h:
1836         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1837         (WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Added.
1838         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): Deleted.
1839
1840 2019-04-15  Devin Rousso  <drousso@apple.com>
1841
1842         Web Inspector: Elements: event listener change events should only be fired for the selected node and it's ancestors
1843         https://bugs.webkit.org/show_bug.cgi?id=196887
1844         <rdar://problem/49870627>
1845
1846         Reviewed by Timothy Hatcher.
1847
1848         Test: inspector/dom/event-listener-add-remove.html
1849               inspector/dom/event-listener-inspected-node.html
1850
1851         * inspector/agents/InspectorDOMAgent.h:
1852         * inspector/agents/InspectorDOMAgent.cpp:
1853         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1854         (WebCore::InspectorDOMAgent::setInspectedNode):
1855         (WebCore::InspectorDOMAgent::didAddEventListener):
1856         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1857
1858 2019-04-15  Antoine Quint  <graouts@apple.com>
1859
1860         Ensure iOS layout traits are used for media controls in modern compatibility mode
1861         https://bugs.webkit.org/show_bug.cgi?id=196812
1862         <rdar://problem/47460637>
1863
1864         Unreviewed. Speculative fix for test regressions on open-source bots.
1865
1866         * Modules/modern-media-controls/media/media-controller.js:
1867         (MediaController.prototype.get layoutTraits):
1868
1869 2019-04-11  Antoine Quint  <graouts@apple.com>
1870
1871         Ensure iOS layout traits are used for media controls in modern compatibility mode
1872         https://bugs.webkit.org/show_bug.cgi?id=196812
1873         <rdar://problem/47460637>
1874
1875         Reviewed by Dean Jackson.
1876
1877         Test: media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode.html
1878
1879         Instead of looking at the UA string, check whether we support touches which is the correct indicator of whether we should
1880         be using the iOS layout traits for media controls.
1881
1882         * Modules/modern-media-controls/media/media-controller.js:
1883         (MediaController.prototype.get layoutTraits):
1884
1885 2019-04-14  Rob Buis  <rbuis@igalia.com>
1886
1887         Link prefetch not useful for top-level navigation
1888         https://bugs.webkit.org/show_bug.cgi?id=195623
1889
1890         Reviewed by Youenn Fablet.
1891
1892         Cache cross-domain top-level prefetches in a dedicated cache and not in the
1893         memory cache. Ignore prefetches for content extension checks.
1894
1895         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
1896                http/tests/cache/link-prefetch-main-resource.html
1897
1898         * loader/LinkLoader.cpp:
1899         (WebCore::LinkLoader::prefetchIfNeeded):
1900         * loader/ResourceLoadInfo.cpp:
1901         (WebCore::toResourceType):
1902         * loader/ResourceLoadInfo.h:
1903         * loader/ResourceLoader.cpp:
1904         (WebCore::ResourceLoader::willSendRequestInternal):
1905         * loader/cache/CachedResourceLoader.cpp:
1906         (WebCore::CachedResourceLoader::requestResource):
1907
1908 2019-04-14  Dean Jackson  <dino@apple.com>
1909
1910         Extract UTI mapping and allow for additions
1911         https://bugs.webkit.org/show_bug.cgi?id=196822
1912         <rdar://problem/49822339>
1913
1914         Reviewed by Darin Adler
1915
1916         Post landing feedback on minimizing String constructors.
1917
1918         * platform/network/mac/UTIUtilities.mm:
1919         (WebCore::MIMETypeFromUTITree):
1920         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
1921
1922 2019-04-14  Don Olmstead  <don.olmstead@sony.com>
1923
1924         [CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
1925         https://bugs.webkit.org/show_bug.cgi?id=196742
1926
1927         Reviewed by Konstantin Tokarev.
1928
1929         Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.
1930
1931         * CMakeLists.txt:
1932
1933 2019-04-12  Antoine Quint  <graouts@apple.com>
1934
1935         Provide a quirk to disable Pointer Events
1936         https://bugs.webkit.org/show_bug.cgi?id=196877
1937         <rdar://problem/49863470>
1938
1939         Reviewed by Dean Jackson.
1940
1941         Add a quirk to disable Pointer Events. We also opt a website that has compatibility issues with Pointer Events into this new quirk.
1942
1943         * dom/PointerEvent.idl:
1944         * page/Quirks.cpp:
1945         (WebCore::Quirks::shouldDisablePointerEventsQuirk const):
1946         * page/Quirks.h:
1947         * page/scrolling/ScrollingCoordinator.cpp:
1948         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
1949         * style/StyleTreeResolver.cpp:
1950         (WebCore::Style::TreeResolver::resolveElement):
1951
1952 2019-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1953
1954         Enable modern compatibility mode by default in WKWebView on some devices
1955         https://bugs.webkit.org/show_bug.cgi?id=196883
1956         <rdar://problem/49864527>
1957
1958         Reviewed by Tim Horton.
1959
1960         Add a new helper function to determine whether an app is pre-installed on iOS, for the purposes of ensuring
1961         compatibility with existing Apple apps that are not affected by linked-on-or-after. This involves all apps with
1962         a bundle ID that begins with "com.apple.".
1963
1964         * platform/RuntimeApplicationChecks.h:
1965         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1966         (WebCore::setApplicationBundleIdentifier):
1967         (WebCore::applicationBundleStartsWith):
1968         (WebCore::IOSApplication::isAppleApplication):
1969
1970 2019-04-12  Justin Fan  <justin_fan@apple.com>
1971
1972         [Web GPU] Prevent narrowing conversions during Metal function calls on 32-bit platforms
1973         https://bugs.webkit.org/show_bug.cgi?id=196793
1974
1975         Reviewed by Darin Adler.
1976
1977         On 32-bit platforms, NSUInteger is 32-bit, which limits certain Web GPU parameters. 
1978         Ensure that valid parameters are properly converted to NSUInteger for Metal calls, regardless of platform.
1979
1980         * platform/graphics/gpu/GPUBuffer.h:
1981         (WebCore::GPUBuffer::byteLength const):
1982         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1983         (WebCore::tryGetResourceAsBufferBinding):
1984         (WebCore::setBufferOnEncoder):
1985         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1986         (WebCore::GPUBuffer::validateBufferUsage):
1987         (WebCore::GPUBuffer::tryCreate):
1988         (WebCore::GPUBuffer::GPUBuffer):
1989         (WebCore::GPUBuffer::setSubData):
1990         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1991         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
1992         (WebCore::GPUCommandBuffer::copyBufferToTexture):
1993         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
1994         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1995         (WebCore::GPURenderPassEncoder::drawIndexed):
1996         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1997         (WebCore::trySetInputStateForPipelineDescriptor):
1998
1999 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
2000
2001         Unreviewed fix for non-unified build.
2002
2003         * dom/ScriptedAnimationController.h:
2004         Add missing include from r244182.
2005
2006 2019-04-11  Ryosuke Niwa  <rniwa@webkit.org>
2007
2008         WebThread should run at a higher priority than user initiated
2009         https://bugs.webkit.org/show_bug.cgi?id=196849
2010         <rdar://problem/46851062>
2011
2012         Reviewed by Geoffrey Garen.
2013
2014         Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
2015         won't wait for other threads with priority 30-37 but does not content with the main thread.
2016
2017         Also removed the call to pthread_attr_setschedparam which disables QoS.
2018
2019         This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
2020         iBooks to an opened book.
2021
2022         * platform/ios/wak/WebCoreThread.mm:
2023         (StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.
2024
2025 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
2026
2027         Add CSS Shadow Parts as a feature under consideration
2028         https://bugs.webkit.org/show_bug.cgi?id=196835
2029
2030         Reviewed by Antti Koivisto.
2031
2032         This feature is under consideration.
2033
2034         * features.json:
2035
2036 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
2037
2038         WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
2039         https://bugs.webkit.org/show_bug.cgi?id=196845
2040
2041         Reviewed by Ryosuke Niwa.
2042
2043         * html/canvas/CanvasRenderingContext2DBase.cpp:
2044         (WebCore::CanvasRenderingContext2DBase::FontProxy::initialize):
2045         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const):
2046         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontDescription const):
2047         (WebCore::CanvasRenderingContext2DBase::FontProxy::width const):
2048         (WebCore::CanvasRenderingContext2DBase::FontProxy::drawBidiText const):
2049         (WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
2050         (WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
2051         Remove inline specifier to address linking errors (regardless of CMake platform).
2052         Doing this in a .cpp file interferes with symbol creation.
2053
2054         * Modules/mediastream/MediaStreamTrack.cpp:
2055         * Modules/webvr/VREyeParameters.cpp:
2056         * Modules/webvr/VRFrameData.cpp:
2057         * Modules/webvr/VRPose.cpp:
2058         * accessibility/AccessibilityList.cpp:
2059         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2060         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
2061         * bindings/js/JSDOMConvertWebGL.cpp:
2062         * bindings/js/JSHistoryCustom.cpp:
2063         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2064         * bindings/js/JSPerformanceObserverCustom.cpp:
2065         * bindings/js/WindowProxy.cpp:
2066         * platform/ColorData.gperf:
2067         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
2068         * platform/network/DNSResolveQueue.cpp:
2069         * workers/service/ServiceWorkerClientQueryOptions.h:
2070         * workers/service/ServiceWorkerContainer.cpp:
2071         Add missing includes to address compiler errors on GTK.
2072
2073 2019-04-12  Zalan Bujtas  <zalan@apple.com>
2074
2075         REGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch.html is Timing out
2076         https://bugs.webkit.org/show_bug.cgi?id=196789
2077         <rdar://problem/49855255>
2078
2079         Reviewed by Tim Horton.
2080
2081         Disable auto-sizing mode at the start of each test.
2082
2083         * testing/Internals.cpp:
2084         (WebCore::Internals::resetToConsistentState):
2085
2086 2019-04-12  Eric Carlson  <eric.carlson@apple.com>
2087
2088         Update AudioSession route sharing policy
2089         https://bugs.webkit.org/show_bug.cgi?id=196776
2090         <rdar://problem/46501611>
2091
2092         Reviewed by Jer Noble.
2093
2094         No new tests, updated an API test.
2095
2096         * platform/audio/AudioSession.cpp:
2097         (WebCore::convertEnumerationToString):
2098         * platform/audio/AudioSession.h:
2099         (WTF::LogArgument<WebCore::RouteSharingPolicy>::toString):
2100         (WTF::LogArgument<WebCore::AudioSession::CategoryType>::toString):
2101         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2102         (MediaSessionManagerCocoa::updateSessionState):
2103         * platform/audio/ios/AudioSessionIOS.mm:
2104         (WebCore::AudioSession::setCategory):
2105         (WebCore::AudioSession::routeSharingPolicy const):
2106         * platform/audio/mac/AudioSessionMac.cpp:
2107         (WebCore::AudioSession::setCategory):
2108
2109 2019-04-12  Antoine Quint  <graouts@apple.com>
2110
2111         Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
2112         https://bugs.webkit.org/show_bug.cgi?id=196830
2113         <rdar://problem/49124313>
2114
2115         Reviewed by Wenson Hsieh.
2116
2117         We add a new policy to determine whether simulated mouse events dispatch are allowed and use it to determine whether the
2118         simulated mouse events dispatch quirk can be used for a given website. We then check the domain name for the current page's
2119         document to see if it matches some known websites that require this quirk.
2120
2121         We needed to add some calls into Quirks::shouldDispatchSimulateMouseEvents() where we used to only consult the RuntimeEnabledFeature
2122         flag to ensure we correctly created touch regions for simulated mouse events.
2123
2124         * dom/EventNames.h:
2125         (WebCore::EventNames::isTouchRelatedEventType const):
2126         * dom/Node.cpp:
2127         (WebCore::Node::moveNodeToNewDocument):
2128         (WebCore::tryAddEventListener):
2129         (WebCore::tryRemoveEventListener):
2130         (WebCore::Node::defaultEventHandler):
2131         * loader/DocumentLoader.h:
2132         (WebCore::DocumentLoader::simulatedMouseEventsDispatchPolicy const):
2133         (WebCore::DocumentLoader::setSimulatedMouseEventsDispatchPolicy):
2134         * page/DOMWindow.cpp:
2135         (WebCore::DOMWindow::addEventListener):
2136         (WebCore::DOMWindow::removeEventListener):
2137         * page/Quirks.cpp:
2138         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2139         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const): Deleted.
2140         * page/Quirks.h:
2141
2142 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
2143
2144         [iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
2145         https://bugs.webkit.org/show_bug.cgi?id=196146
2146
2147         Reviewed by Antti Koivisto.
2148         
2149         computeCoordinatedPositioningForLayer() failed to handle nested positions elements
2150         inside overflow scroll, because it only walked up to the first containing block of
2151         a nested position:absolute. We need to walk all the way up the ancestor layer chain,
2152         looking at containing block, scroller and composited ancestor relationships.
2153
2154         Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
2155         trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
2156         more ancestor traversals, but we now only run this code if there's composited scrolling
2157         in the ancestor chain.
2158
2159         Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
2160                scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
2161                scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
2162                scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
2163
2164         * rendering/RenderLayerCompositor.cpp:
2165         (WebCore::enclosingCompositedScrollingLayer):
2166         (WebCore::isScrolledByOverflowScrollLayer):
2167         (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
2168         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
2169         (WebCore::collectStationaryLayerRelatedOverflowNodes):
2170         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2171         (WebCore::collectRelatedCoordinatedScrollingNodes):
2172         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.
2173
2174 2019-04-12  Manuel Rego Casasnovas  <rego@igalia.com>
2175
2176         [css-flex][css-grid] Fix synthesized baseline
2177         https://bugs.webkit.org/show_bug.cgi?id=196312
2178
2179         Reviewed by Javier Fernandez.
2180
2181         When a flex or grid container has no baseline,
2182         its baseline should be synthesized from the border edges.
2183         The same happens for flex and grid items.
2184         
2185         Right now we were using the content box in some cases
2186         and even using the margin box in a particular scenario.
2187         The patch fixes this.
2188         
2189         At the same time this is also fixing the baseline for
2190         inline flex/grid containers to make it interoperable with Firefox.
2191         Inline blocks have a special behavior per legacy reasons,
2192         which applies to inline flex/grid containers when they have no items;
2193         otherwise the items should be used to compute its baseline.
2194         See more at: https://github.com/w3c/csswg-drafts/issues/3416
2195
2196         Note that we need to keep current behavior for buttons,
2197         as the flexbox spec doesn't apply to them.
2198
2199         Tests: css3/flexbox/flexbox-baseline-margins.html
2200                fast/css-grid-layout/grid-baseline-margins-1.html
2201                fast/css-grid-layout/grid-baseline-margins-2.html
2202                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html
2203                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html
2204                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html
2205
2206         * rendering/RenderButton.cpp:
2207         (WebCore::synthesizedBaselineFromContentBox):
2208         (WebCore::RenderButton::baselinePosition const):
2209         * rendering/RenderButton.h:
2210         * rendering/RenderFlexibleBox.cpp:
2211         (WebCore::synthesizedBaselineFromBorderBox):
2212         (WebCore::RenderFlexibleBox::baselinePosition const):
2213         (WebCore::RenderFlexibleBox::firstLineBaseline const):
2214         (WebCore::RenderFlexibleBox::inlineBlockBaseline const):
2215         * rendering/RenderGrid.cpp:
2216         (WebCore::RenderGrid::baselinePosition const):
2217         (WebCore::RenderGrid::inlineBlockBaseline const):
2218
2219 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
2220
2221         Avoid doing positioned scrolling tree node work for layers not inside overflow:scroll
2222         https://bugs.webkit.org/show_bug.cgi?id=196848
2223
2224         Reviewed by Zalan Bujtas.
2225
2226         Maintain a bit on RenderLayer which says if a layer has a composited scrolling ancestor
2227         in the layer tree. We only need to do work related to making positioned scrolling tree nodes
2228         for layers which are layer tree descendants of overflow:scroll.
2229
2230         * rendering/RenderLayer.cpp:
2231         (WebCore::RenderLayer::RenderLayer):
2232         (WebCore::RenderLayer::updateLayerPositions):
2233         (WebCore::outputPaintOrderTreeLegend):
2234         (WebCore::outputPaintOrderTreeRecursive):
2235         * rendering/RenderLayer.h:
2236         * rendering/RenderLayerCompositor.cpp:
2237         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2238         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
2239         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
2240         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
2241         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2242
2243 2019-04-11  Zalan Bujtas  <zalan@apple.com>
2244
2245         Try to fix Windows build.
2246
2247         * page/PrintContext.cpp:
2248         (WebCore::PrintContext::computedPageMargin):
2249
2250 2019-04-11  Megan Gardner  <megan_gardner@apple.com>
2251
2252         Update 'Save Image' to more clear instructions
2253         https://bugs.webkit.org/show_bug.cgi?id=196833
2254         <rdar://problem/47446845>
2255
2256         Reviewed by Wenson Hsieh.
2257
2258         Not testable, UI change only.
2259
2260         * en.lproj/Localizable.strings:
2261
2262 2019-04-11  Zalan Bujtas  <zalan@apple.com>
2263
2264         Add @page margin support
2265         https://bugs.webkit.org/show_bug.cgi?id=196680
2266         <rdar://problem/45217707>
2267
2268         Reviewed by Tim Horton.
2269
2270         This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default.
2271         We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback.
2272         UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context
2273         in the WebProcess if needed (see PrintInfo for current printer margins).
2274
2275         Tests: printing/page-with-10mm-left-margin.html
2276                printing/page-with-zero-margin.html
2277
2278         * page/PrintContext.cpp:
2279         (WebCore::PrintContext::computedPageMargin):
2280         (WebCore::PrintContext::computedPageSize):
2281         * page/PrintContext.h:
2282         * page/RuntimeEnabledFeatures.h:
2283         (WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const):
2284         (WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled):
2285
2286 2019-04-11  Dean Jackson  <dino@apple.com>
2287
2288         Extract UTI mapping and allow for additions
2289         https://bugs.webkit.org/show_bug.cgi?id=196822
2290         <rdar://problem/49822339>
2291
2292         Reviewed by Tim Horton.
2293
2294         Add an ADDITIONAL_SYSTEM_PREVIEW_TYPES macro to the list
2295         of accepted MIME types. And add a new helper to map
2296         MIME types to UTI types when the system was unable to
2297         find an existing type.
2298
2299         * platform/MIMETypeRegistry.cpp:
2300         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
2301         * platform/network/mac/UTIUtilities.mm:
2302         (WebCore::UTIFromUnknownMIMEType):
2303         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
2304
2305 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
2306
2307         [iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
2308         https://bugs.webkit.org/show_bug.cgi?id=196670
2309
2310         Reviewed by Wenson Hsieh.
2311
2312         The bug was ultimately caused by two reasons:
2313          1. On iOS, previousWordPositionBoundary would identify a blank line as a word boundary.
2314          2. SimplifiedBackwardsTextIterator generates a new line character (\n) between two block elements.
2315
2316         When moving backwards by word granularity, therefore, previousBoundary would encounter a new line created by (2)
2317         and then previousWordPositionBoundary would identify it as a word boundary.
2318
2319         Fixed the bug (2) by adding the same check as TextIterator::exitNode has to avoid generating an extra new line
2320         character following an exiting new line character. Also added internals.rangeAsTextUsingBackwardsTextIterator
2321         to make SimplifiedBackwardsTextIterator directly testable in layout tests.
2322
2323         This fix unveiled an unrelated bug when moving backwards with sentence granularity at the beginning of a line.
2324         In this case, WebKit was previously feeding ICU with the previous line's content followed by two new lines,
2325         which constituted a new sentence. However after the fix, ICU no longer detects a new sentence after the end
2326         of the prevous line. This patch, therefore, introduces a new optional argument to previousBoundary which forces
2327         the succeeding paragraph's content (i.e. the content of the line from which we're moving backwards with sentence
2328         granularity) to be fed to ICU. This fixes the bug that we were previously not being able to move backwards
2329         with sentence granularity at the beginning of a line as indicated by the new tests.
2330
2331         Tests: editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html
2332                editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html
2333                editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html
2334                editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html
2335                editing/text-iterator/backwards-text-iterator-basic.html
2336
2337         * accessibility/AXObjectCache.cpp:
2338         (WebCore::AXObjectCache::previousBoundary): Fixed the bug that moving backwards with sentence granularity at
2339         the beginning of a line does not work like we did in VisibleUnits. See the description below. It's tested by
2340         an existing layout test accessibility/mac/text-marker-sentence-nav.html, which would fail without this fix.
2341         (WebCore::AXObjectCache::startCharacterOffsetOfSentence):
2342         * accessibility/AXObjectCache.h:
2343         (WebCore::CharacterOffset::isEqual const):
2344         * editing/TextIterator.cpp:
2345         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Fixed the bug that we were generating two line
2346         lines between block elements. This fixes the bug that moving backwards with word granularity at the beginning
2347         of a line fails on iOS.
2348         (WebCore::plainTextUsingBackwardsTextIteratorForTesting): Added.
2349         * editing/TextIterator.h:
2350         * editing/VisibleUnits.cpp:
2351         (WebCore::previousBoundary): Added the code to extract the succeeding paragraph's content as context for ICU.
2352         This fixes the bug that moving backwards with sentence granularity at the beginning of a line fails.
2353         Limit the length of backwards iteration at the current position to avoid traversing backwards beyond
2354         the current position, and fixed a bug that an early return for the text node was not taking the suffix length
2355         into account when deciding whether next position resides in the starting container node or not.
2356         (WebCore::startSentenceBoundary):
2357         (WebCore::startOfSentence):
2358         * testing/Internals.cpp:
2359         (WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Added.
2360         * testing/Internals.h:
2361         * testing/Internals.idl:
2362
2363 2019-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2364
2365         Allow the MediaSource API to be enabled via website policy
2366         https://bugs.webkit.org/show_bug.cgi?id=196429
2367         <rdar://problem/48774333>
2368
2369         Reviewed by Tim Horton.
2370
2371         Add support in DocumentLoader for adjusting page settings using its per-site policies. See WebKit ChangeLog for
2372         more detail (in particular, the implementation of applyToDocumentLoader).
2373
2374         Test: fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode.html
2375
2376         * loader/DocumentLoader.cpp:
2377         (WebCore::DocumentLoader::applyPoliciesToSettings const):
2378         (WebCore::DocumentLoader::attachToFrame):
2379         * loader/DocumentLoader.h:
2380
2381         Add an enum class for MediaSource policies; while we're at it, make all of these enum values 8 bits wide.
2382
2383         (WebCore::DocumentLoader::mediaSourcePolicy const):
2384         (WebCore::DocumentLoader::setMediaSourcePolicy):
2385
2386 2019-04-11  Youenn Fablet  <youenn@apple.com>
2387
2388         Support RTCDataChannel blob binaryType
2389         https://bugs.webkit.org/show_bug.cgi?id=196821
2390
2391         Reviewed by Eric Carlson.
2392
2393         Add support for receiving blobs.
2394         Default value is still left to 'arraybuffer' which is not spec compliant.
2395         Covered by rebased test.
2396
2397         * Modules/mediastream/RTCDataChannel.cpp:
2398         (WebCore::RTCDataChannel::setBinaryType):
2399         (WebCore::RTCDataChannel::didReceiveRawData):
2400
2401 2019-04-11  Devin Rousso  <drousso@apple.com>
2402
2403         Web Inspector: Timelines: can't reliably stop/start a recording
2404         https://bugs.webkit.org/show_bug.cgi?id=196778
2405         <rdar://problem/47606798>
2406
2407         Reviewed by Timothy Hatcher.
2408
2409         * inspector/agents/InspectorTimelineAgent.cpp:
2410         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
2411         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
2412         It is possible to determine when programmatic capturing starts/stops in the frontend based
2413         on the state when the backend causes the state to change, such as if the state is "inactive"
2414         when the frontend is told that the backend has started capturing.
2415
2416         * inspector/agents/InspectorCPUProfilerAgent.cpp:
2417         (WebCore::InspectorCPUProfilerAgent::stopTracking):
2418         * inspector/agents/InspectorMemoryAgent.cpp:
2419         (WebCore::InspectorMemoryAgent::stopTracking):
2420         Send an end timestamp to match other instruments.
2421
2422 2019-04-11  Truitt Savell  <tsavell@apple.com>
2423
2424         Unreviewed, rolling out r244158.
2425
2426         Casued 8 inspector/timeline/ test failures.
2427
2428         Reverted changeset:
2429
2430         "Web Inspector: Timelines: can't reliably stop/start a
2431         recording"
2432         https://bugs.webkit.org/show_bug.cgi?id=196778
2433         https://trac.webkit.org/changeset/244158
2434
2435 2019-04-11  Pablo Saavedra  <psaavedra@igalia.com>
2436
2437         [WPE] Build error with ENABLE_VIDEO=OFF after r244078
2438         https://bugs.webkit.org/show_bug.cgi?id=196811
2439
2440         createGenericCue() is only defined when VIDEO_TRACK is enabled.
2441
2442         Reviewed by Eric Carlson.
2443
2444         * testing/Internals.cpp:
2445         (WebCore::Internals::createGenericCue):
2446         * testing/Internals.h:
2447
2448 2019-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2449
2450         [GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after r184890
2451         https://bugs.webkit.org/show_bug.cgi?id=146718
2452         <rdar://problem/21722487>
2453
2454         Reviewed by Joanmarie Diggs.
2455
2456         Allow to get the text under element for nodes hidden in DOM but explicitly exposed to accessibility with
2457         aria-hidden="false".
2458
2459         Fixes: accessibility/aria-hidden-false-works-in-subtrees.html
2460
2461         * accessibility/AccessibilityNodeObject.cpp:
2462         (WebCore::AccessibilityNodeObject::textUnderElement const):
2463         * accessibility/atk/WebKitAccessible.cpp:
2464         (roleIsTextType): Also consider ApplicationGroup role as text elements, so that <div>text</div> is equivalent to
2465         <div role="roup">test</div>.
2466
2467 2019-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2468
2469         requestAnimationFrame should execute before the next frame
2470         https://bugs.webkit.org/show_bug.cgi?id=177484
2471
2472         Reviewed by Simon Fraser.
2473
2474         This change fixes these issues with animation timing:
2475
2476         1. Calling the requestAnimationFrame callbacks would have happened when
2477            the DisplayLink fires. This may have happened even if the frame is
2478            missed and no display is committed.
2479
2480         2. Style changes and layout triggered by script could trigger painting
2481            at more than 60fps. CoreAnimation commits could happen at more than
2482            60fps, although WindowServer will throttle those, and only some will
2483            be shown on the screen.
2484
2485         This change introduces a new paint scheduling model where painting is
2486         driven by a "RenderingUpdateScheduler", which only triggers paints once
2487         per 16.7ms frame.
2488
2489         Code that previously scheduled a compositing layer flush now schedules a
2490         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
2491         callback. When the render happens, we service requestAnimationFrame callbacks,
2492         Web Animations, intersection observations and resize observations per the
2493         "Update the rendering" step of the HTML Event Loop specification:
2494         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
2495
2496         In the future, more rendering steps will be added to this code.
2497
2498         * Sources.txt:
2499         * WebCore.xcodeproj/project.pbxproj:
2500         * accessibility/mac/AXObjectCacheMac.mm:
2501         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
2502         Fix layout tests by adding null check.
2503
2504         * animation/DocumentAnimationScheduler.cpp: Removed.
2505         * animation/DocumentAnimationScheduler.h: Removed.
2506         * animation/DocumentTimeline.cpp:
2507         (WebCore::DocumentTimeline::DocumentTimeline):
2508         (WebCore::DocumentTimeline::updateThrottlingState):
2509         (WebCore::DocumentTimeline::suspendAnimations):
2510         (WebCore::DocumentTimeline::resumeAnimations):
2511         (WebCore::DocumentTimeline::liveCurrentTime const):
2512         (WebCore::DocumentTimeline::currentTime):
2513         (WebCore::DocumentTimeline::cacheCurrentTime):
2514         (WebCore::DocumentTimeline::animationTimingDidChange):
2515         (WebCore::DocumentTimeline::scheduleAnimationResolution):
2516         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
2517         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
2518         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
2519         (WebCore::DocumentTimeline::scheduleNextTick):
2520         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
2521         Simplify this function by handling the case of no-animations separately.
2522
2523         (WebCore::DocumentTimeline::resolveAnimationsForElement):
2524         Simplify the loop and delete hasPendingAcceleratedAnimations because it
2525         is initialized to true and is not changed inside the loop.
2526
2527         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
2528         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
2529         * animation/DocumentTimeline.h:
2530         * dom/Document.cpp:
2531         (WebCore::Document::resolveStyle):
2532         There is no need to force update in resolveStyle(). notifyFlushRequired()
2533         will be called eventually which will scheduleRenderingUpdate().
2534
2535         (WebCore::Document::prepareForDestruction):
2536         (WebCore::Document::updateAnimationsAndSendEvents):
2537         (WebCore::Document::serviceRequestAnimationFrameCallbacks):
2538         (WebCore::Document::windowScreenDidChange):
2539         (WebCore::Document::scheduleRenderingUpdate):
2540         (WebCore::Document::updateIntersectionObservations):
2541         (WebCore::Document::addResizeObserver):
2542         (WebCore::Document::updateResizeObservations):
2543         (WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
2544         (WebCore::Document::scheduleResizeObservations): Deleted.
2545         (WebCore::Document::animationScheduler): Deleted.
2546         No need to schedule web-animations, intersection observations and resize
2547         observations updates separately. All of them will be updated through the
2548         "Update the rendering" step, i.e. Page::updateRendering().        
2549
2550         * dom/Document.h:
2551         (WebCore::Document::numberOfIntersectionObservers const):
2552         * dom/ScriptedAnimationController.cpp:
2553         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
2554         (WebCore::ScriptedAnimationController::scheduleAnimation):
2555         (WebCore::ScriptedAnimationController::animationTimerFired):
2556         (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
2557         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
2558         * dom/ScriptedAnimationController.h:
2559         * page/FrameView.cpp:
2560         (WebCore::FrameView::didLayout):
2561         (WebCore::FrameView::viewportContentsChanged):
2562         * page/FrameViewLayoutContext.cpp:
2563         (WebCore::FrameViewLayoutContext::layoutTimerFired):
2564         * page/IntersectionObserver.cpp:
2565         (WebCore::IntersectionObserver::observe):
2566         * page/Page.cpp:
2567         (WebCore::Page::Page):
2568         (WebCore::Page::layoutIfNeeded):
2569         (WebCore::Page::updateRendering):
2570         (WebCore::Page::renderingUpdateScheduler):
2571         (WebCore::Page::willDisplayPage): Deleted.
2572         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
2573         (WebCore::Page::updateIntersectionObservations): Deleted.
2574         (WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
2575         (WebCore::Page::hasResizeObservers const): Deleted.
2576         (WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Deleted.
2577         (WebCore::Page::checkResizeObservations): Deleted.
2578         (WebCore::Page::scheduleResizeObservations): Deleted.
2579         (WebCore::Page::notifyResizeObservers): Deleted.
2580         * page/Page.h:
2581         (WebCore::Page::setNeedsCheckResizeObservations): Deleted.
2582         (WebCore::Page::needsCheckResizeObservations const): Deleted.
2583         The IntersectionObserver and the ResizeObserver do not need to schedule
2584         their own timers. The RenderingUpdateScheduler will schedule the "Update
2585         the rendering" step in which these obverses will be served.
2586
2587         * page/PageOverlayController.cpp:
2588         (WebCore::PageOverlayController::didChangeViewExposedRect):
2589         (WebCore::PageOverlayController::notifyFlushRequired):
2590         Force committing the layers to be 60 fps at maximum.
2591
2592         * page/RenderingUpdateScheduler.cpp: Added.
2593         (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
2594         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
2595         (WebCore::RenderingUpdateScheduler::isScheduled const):
2596         (WebCore::RenderingUpdateScheduler::startTimer):
2597         (WebCore::RenderingUpdateScheduler::clearScheduled):
2598         (WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
2599         (WebCore::RenderingUpdateScheduler::windowScreenDidChange):
2600         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
2601         (WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush):
2602         * page/RenderingUpdateScheduler.h: Added.
2603         (WebCore::RenderingUpdateScheduler::create):
2604         * page/ResizeObserver.cpp:
2605         (WebCore::ResizeObserver::observe):
2606         (WebCore::ResizeObserver::scheduleObservations): Deleted.
2607         * page/ResizeObserver.h:
2608         (WebCore::ResizeObserver::hasActiveObservations const):
2609         * page/ios/ContentChangeObserver.h:
2610         * page/mac/ServicesOverlayController.mm:
2611         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
2612         * page/scrolling/ScrollingStateTree.cpp:
2613         * rendering/RenderLayerCompositor.cpp:
2614         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
2615         (WebCore::RenderLayerCompositor::layerTreeAsText):
2616
2617 2019-04-10  Ryosuke Niwa  <rniwa@webkit.org>
2618
2619         Nullptr crash in CompositeEditCommand::moveParagraphs when root editable element goes away
2620         https://bugs.webkit.org/show_bug.cgi?id=193027
2621
2622         Reviewed by Wenson Hsieh.
2623
2624         Added an early exit when the root editable element (editing host in HTML5 spec terminology) is null
2625         during CompositeEditCommand::moveParagraphs. This could happen when the website does something crazy
2626         like removing contenteditable content attribute during DOM mutations or when the destination becomes
2627         disconnected (orphaned) from the document due to bugs elsewhere in the codebase.
2628
2629         Test: editing/deleting/merge-paragraphs-null-root-editable-element-crash.html
2630
2631         * editing/CompositeEditCommand.cpp:
2632         (WebCore::CompositeEditCommand::moveParagraphs): Added an early exit.
2633
2634 2019-04-10  Devin Rousso  <drousso@apple.com>
2635
2636         Web Inspector: save sheet should be anchored underneath the tab bar when detached
2637         https://bugs.webkit.org/show_bug.cgi?id=196722
2638         <rdar://problem/49613280>
2639
2640         Reviewed by Timothy Hatcher.
2641
2642         No web observable change.
2643
2644         * inspector/InspectorFrontendClient.h:
2645         (WebCore::InspectorFrontendClient::changeSheetRect): Added.
2646
2647         * inspector/InspectorFrontendClientLocal.h:
2648         * inspector/InspectorFrontendClientLocal.cpp:
2649         (WebCore::InspectorFrontendClientLocal::changeSheetRect): Added.
2650
2651         * inspector/InspectorFrontendHost.idl:
2652         * inspector/InspectorFrontendHost.h:
2653         * inspector/InspectorFrontendHost.cpp:
2654         (WebCore::InspectorFrontendHost::setSheetRect): Added.
2655
2656         * testing/Internals.cpp:
2657         (WebCore::InspectorStubFrontend::setSheetRect): Added.
2658
2659 2019-04-10  Devin Rousso  <drousso@apple.com>
2660
2661         Web Inspector: Inspector: lazily create the agent
2662         https://bugs.webkit.org/show_bug.cgi?id=195971
2663         <rdar://problem/49039645>
2664
2665         Reviewed by Joseph Pecoraro.
2666
2667         No change in functionality.
2668
2669         * inspector/InspectorController.h:
2670         * inspector/InspectorController.cpp:
2671         (WebCore::InspectorController::InspectorController):
2672         (WebCore::InspectorController::createLazyAgents):
2673         (WebCore::InspectorController::evaluateForTestInFrontend):
2674         (WebCore::InspectorController::ensureInspectorAgent):
2675
2676 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
2677
2678         Remove unneeded extern C
2679         https://bugs.webkit.org/show_bug.cgi?id=196786
2680
2681         Reviewed by Tim Horton.
2682
2683         No tests needed, just needs to compile.
2684
2685         Removing staging hack for Reveal framework.
2686
2687         * editing/cocoa/DictionaryLookup.mm:
2688
2689 2019-04-10  Devin Rousso  <drousso@apple.com>
2690
2691         Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
2692         https://bugs.webkit.org/show_bug.cgi?id=196725
2693         <rdar://problem/49669810>
2694
2695         Reviewed by Timothy Hatcher.
2696
2697         Move the logic for creating the `InspectorPageAgent` and `InspectorDOMAgent` into separate
2698         functions so that callers into `InspectorController` can be guaranteed to have a valid
2699         instance of the agent.
2700
2701         This doesn't interfere with the `Page.enable` command, as it doesn't clear any saved state.
2702         There is no `DOM.enable` command, so there's no issue there either.
2703
2704         * inspector/InspectorController.h:
2705         (WebCore::InspectorController::pageAgent): Deleted.
2706         * inspector/InspectorController.cpp:
2707         (WebCore::InspectorController::createLazyAgents):
2708         (WebCore::InspectorController::inspect):
2709         (WebCore::InspectorController::hideHighlight):
2710         (WebCore::InspectorController::ensureDOMAgent): Added.
2711         (WebCore::InspectorController::ensurePageAgent): Added.
2712
2713         * inspector/InspectorFrontendClientLocal.cpp:
2714         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
2715
2716 2019-04-10  Alex Christensen  <achristensen@webkit.org>
2717
2718         Add SPI WKNavigationResponse._downloadAttribute
2719         https://bugs.webkit.org/show_bug.cgi?id=196755
2720         <rdar://49587365>
2721
2722         Reviewed by Brady Eidson.
2723
2724         Covered by an API test that validates the attribute is correctly sent through the FrameLoader to the API.
2725         When a user clicks on a link with a download attribute, the download attribute should be used as the suggested filename sometimes.
2726         The application needs this information after it has received the response in order to make fully informed decisions about downloads.
2727         In order to get this attribute to the decidePolicyForNavigationResponse, we need to store the attribute on the DocumentLoader
2728         from the FrameLoadRequest then send it from the DocumentLoader when the response is received.
2729
2730         * loader/DocumentLoader.h:
2731         (WebCore::DocumentLoader::setDownloadAttribute):
2732         (WebCore::DocumentLoader::downloadAttribute const):
2733         * loader/EmptyFrameLoaderClient.h:
2734         * loader/FrameLoader.cpp:
2735         (WebCore::FrameLoader::checkContentPolicy):
2736         (WebCore::FrameLoader::loadURL):
2737         (WebCore::FrameLoader::loadWithNavigationAction):
2738         (WebCore::FrameLoader::loadPostRequest):
2739         * loader/FrameLoader.h:
2740         (WebCore::FrameLoader::loadWithNavigationAction):
2741         * loader/FrameLoaderClient.h:
2742
2743 2019-04-10  Youenn Fablet  <youenn@apple.com>
2744
2745         SWClientConnection should not double hop to fire some events
2746         https://bugs.webkit.org/show_bug.cgi?id=196735
2747
2748         Reviewed by Alex Christensen.
2749
2750         Some events, like postMessage in service workers is hopping from main thread to service worker thread to dispatch events.
2751         Some other events, like service worker state update, are hopping from main thread to service worker thread, then posting a task to dispatch events.
2752         This may create ordering problems.
2753
2754         To fix the issue, we now hop to the service worker thread and dispatch the events.
2755         In addition, for documents, we post a task and do the whole service worker processing in it.
2756         This ensures that some tests, like whether there is a service worker container,
2757         or creation of a service worker are done consistently.
2758
2759         Covered by unflaked test.
2760
2761         * workers/service/SWClientConnection.cpp:
2762         (WebCore::SWClientConnection::updateRegistrationState):
2763         (WebCore::SWClientConnection::updateWorkerState):
2764         (WebCore::SWClientConnection::fireUpdateFoundEvent):
2765         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
2766         * workers/service/ServiceWorker.cpp:
2767         (WebCore::ServiceWorker::updateState):
2768         * workers/service/ServiceWorker.h:
2769         * workers/service/ServiceWorkerContainer.cpp:
2770         (WebCore::ServiceWorkerContainer::updateRegistrationState):
2771         (WebCore::ServiceWorkerContainer::fireUpdateFoundEvent):
2772         (WebCore::ServiceWorkerContainer::fireControllerChangeEvent):
2773         * workers/service/ServiceWorkerContainer.h:
2774         * workers/service/ServiceWorkerJob.cpp:
2775         (WebCore::ServiceWorkerJob::notifyFinished):
2776         Notify of the script URL in the error message.
2777         This will help diagnose flakiness issues.
2778         * workers/service/ServiceWorkerRegistration.cpp:
2779         (WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
2780         * workers/service/ServiceWorkerRegistration.h:
2781
2782 2019-04-10  Devin Rousso  <drousso@apple.com>
2783
2784         Web Inspector: Timelines: can't reliably stop/start a recording
2785         https://bugs.webkit.org/show_bug.cgi?id=196778
2786         <rdar://problem/47606798>
2787
2788         Reviewed by Timothy Hatcher.
2789
2790         * inspector/agents/InspectorTimelineAgent.cpp:
2791         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
2792         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
2793         It is possible to determine when programmatic capturing starts/stops in the frontend based
2794         on the state when the backend causes the state to change, such as if the state is "inactive"
2795         when the frontend is told that the backend has started capturing.
2796
2797         * inspector/agents/InspectorCPUProfilerAgent.cpp:
2798         (WebCore::InspectorCPUProfilerAgent::stopTracking):
2799         * inspector/agents/InspectorMemoryAgent.cpp:
2800         (WebCore::InspectorMemoryAgent::stopTracking):
2801         Send an end timestamp to match other instruments.
2802
2803 2019-04-10  Tim Horton  <timothy_horton@apple.com>
2804
2805         Add modern API for overriding the page's specified viewport configuration
2806         https://bugs.webkit.org/show_bug.cgi?id=167734
2807         <rdar://problem/30331795>
2808
2809         Reviewed by Simon Fraser.
2810
2811         New API test: WebKit.OverrideViewportArguments
2812
2813         * dom/Document.cpp:
2814         (WebCore::Document::updateViewportArguments):
2815         * dom/Document.h:
2816         (WebCore::Document::viewportArguments const):
2817         Make the viewportArguments() getter respect the overridden arguments.
2818
2819         * dom/ViewportArguments.cpp:
2820         (WebCore::numericPrefix):
2821         (WebCore::findSizeValue):
2822         (WebCore::findScaleValue):
2823         (WebCore::findBooleanValue):
2824         (WebCore::parseViewportFitValue):
2825         (WebCore::viewportErrorMessage):
2826         (WebCore::reportViewportWarning):
2827         (WebCore::setViewportFeature):
2828         * dom/ViewportArguments.h:
2829         Make it possible to parse ViewportArguments without a Document, so
2830         that it can be used in the UI process. We only used the Document for
2831         two things: error reporting, and getting the state of one setting.
2832         Refactor error handling to use a passed-arund function, and add a
2833         variant of setViewportFeature() that doesn't take a Document.
2834
2835 2019-04-10  Justin Fan  <justin_fan@apple.com>
2836
2837         [Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
2838         https://bugs.webkit.org/show_bug.cgi?id=196758
2839
2840         Reviewed by Dean Jackson.
2841
2842         Test: webgpu/draw-indexed-triangles.html
2843
2844         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed to enable indexed drawing.
2845         Disable GPUCommandEncoders with active pass encoders from being submitted or encoding blits. 
2846
2847         Prevent active GPUCommandEncoders from being submitted or encoding blit commands:
2848         * Modules/webgpu/WebGPUCommandEncoder.cpp:
2849         (WebCore::WebGPUCommandEncoder::finish):
2850         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2851         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
2852         (WebCore::GPUCommandBuffer::copyBufferToTexture):
2853         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
2854         (WebCore::GPUCommandBuffer::copyTextureToTexture):
2855
2856         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed:
2857         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2858         (WebCore::WebGPURenderPassEncoder::setIndexBuffer):
2859         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Remove unnecessary move operations.
2860         (WebCore::WebGPURenderPassEncoder::drawIndexed): Added.
2861         * Modules/webgpu/WebGPURenderPassEncoder.h:
2862         * Modules/webgpu/WebGPURenderPassEncoder.idl:
2863         * platform/graphics/gpu/GPUBuffer.h:
2864         (WebCore::GPUBuffer::isIndex const):
2865         * platform/graphics/gpu/GPUInputStateDescriptor.h:
2866         * platform/graphics/gpu/GPURenderPassEncoder.h: Cache the index buffer, as Metal does not set the index buffer separate from the draw call.
2867         * platform/graphics/gpu/GPURenderPipeline.h:
2868         (WebCore::GPURenderPipeline::indexFormat const):
2869         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2870         (WebCore::GPURenderPassEncoder::setIndexBuffer):
2871         (WebCore::GPURenderPassEncoder::setVertexBuffers):
2872         (WebCore::mtlPrimitiveTypeForGPUPrimitiveTopology):
2873         (WebCore::GPURenderPassEncoder::draw):
2874         (WebCore::mtlIndexTypeForGPUIndexFormat): Added.
2875         (WebCore::GPURenderPassEncoder::drawIndexed): Added.
2876         (WebCore::primitiveTypeForGPUPrimitiveTopology): Deleted.
2877         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2878         (WebCore::GPURenderPipeline::tryCreate):
2879         (WebCore::GPURenderPipeline::GPURenderPipeline):
2880
2881 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
2882
2883         OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if offlineRender exists early
2884         https://bugs.webkit.org/show_bug.cgi?id=196759
2885
2886         Reviewed by Eric Carlson.
2887
2888         OfflineAudioDestinationNode::startRendering unconditionally ref's itself before invoking offlineRender() in a new thread.
2889         But offlineRender can early exit without ever calling deref() in the main thread, leading to the leak of
2890         OfflineAudioDestinationNode. Fixed the leak by always calling deref in the main thread after calling offlineRender().
2891
2892         Also removed the debug assertion in offlineRender which always hits when we run the relevant test.
2893
2894         Test: imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html
2895
2896         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2897         (WebCore::OfflineAudioDestinationNode::startRendering):
2898         (WebCore::OfflineAudioDestinationNode::offlineRender):
2899         (WebCore::OfflineAudioDestinationNode::notifyComplete): Merged into startRendering.
2900         * Modules/webaudio/OfflineAudioDestinationNode.h:
2901
2902 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
2903
2904         Fix text autoscrolling when typing in modern webkit
2905         https://bugs.webkit.org/show_bug.cgi?id=196718
2906         <rdar://problem/49225507>
2907
2908         Reviewed by Tim Horton.
2909
2910         Tests: fast/events/autoscroll-when-input-is-offscreen.html
2911                fast/events/autoscroll-with-software-keyboard.html
2912
2913         We have been relying on UIKit to scroll editable text, but
2914         since we cannot give them enough information for them to always
2915         do the right thing, we should just do all the work in WebKit.
2916         This has the added benifit of fixing some tricky autoscrolling
2917         bugs that have cropped up recently.
2918
2919         * editing/Editor.cpp:
2920         (WebCore::Editor::insertTextWithoutSendingTextEvent):
2921         (WebCore::Editor::revealSelectionAfterEditingOperation):
2922         We should be scrolling the main frame in WebKit. We have been relying on UIKit,
2923         but we cannot give them enough information to guarantee a correct scroll, so just
2924         do all the work in WebKit.
2925         * page/FrameView.cpp:
2926         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
2927         Update to use the rect that is actually visible, accounting for the software keyboard.
2928
2929 2019-04-10  Ross Kirsling  <ross.kirsling@sony.com>
2930
2931         WebCore should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
2932         https://bugs.webkit.org/show_bug.cgi?id=196762
2933
2934         Reviewed by Ryosuke Niwa.
2935
2936         * Modules/indexeddb/IDBCursor.h:
2937         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2938         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2939         * Modules/websockets/WebSocketFrame.cpp:
2940         * accessibility/AccessibilityARIAGridRow.cpp:
2941         (WebCore::AccessibilityARIAGridRow::parentTable const):
2942         * accessibility/AccessibilityObject.cpp:
2943         * accessibility/AccessibilityRenderObject.cpp:
2944         * animation/CSSAnimation.cpp:
2945         * animation/DeclarativeAnimation.cpp:
2946         * bindings/js/DOMGCOutputConstraint.h:
2947         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
2948         (WebCore::root):
2949         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
2950         (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
2951         * bindings/js/JSDOMConvertNumbers.cpp:
2952         * bindings/js/JSDOMWindowCustom.cpp:
2953         * bindings/js/JSExtendableMessageEventCustom.cpp:
2954         * bindings/js/SerializedScriptValue.cpp:
2955         * css/CSSFontFaceSource.cpp:
2956         * css/CSSFontFaceSource.h:
2957         * css/MediaQueryMatcher.h:
2958         * css/parser/CSSPropertyParserHelpers.cpp:
2959         * dom/DocumentParser.cpp:
2960         * dom/EventPath.cpp:
2961         * dom/MouseEvent.h:
2962         * dom/SpectreGadget.cpp:
2963         * dom/SpectreGadget.h:
2964         * editing/ChangeListTypeCommand.cpp:
2965         * editing/EditAction.cpp:
2966         * editing/ReplaceSelectionCommand.cpp:
2967         * editing/TextGranularity.h:
2968         * html/HTMLFormControlsCollection.cpp:
2969         * html/HTMLImageElement.cpp:
2970         * html/canvas/CanvasRenderingContext2DBase.cpp:
2971         * inspector/InspectorController.cpp:
2972         * inspector/agents/InspectorApplicationCacheAgent.cpp:
2973         * inspector/agents/InspectorCanvasAgent.cpp:
2974         * inspector/agents/WebHeapAgent.cpp:
2975         * inspector/agents/page/PageAuditAgent.cpp:
2976         * inspector/agents/page/PageConsoleAgent.cpp:
2977         * inspector/agents/page/PageNetworkAgent.cpp:
2978         * inspector/agents/worker/WorkerAuditAgent.cpp:
2979         * loader/CrossOriginAccessControl.h:
2980         * loader/CrossOriginPreflightResultCache.h:
2981         * loader/NavigationAction.cpp:
2982         * loader/ResourceLoadObserver.cpp:
2983         * page/FrameTree.cpp:
2984         * page/IntersectionObserver.cpp:
2985         * page/PageConfiguration.cpp:
2986         * page/PerformanceResourceTiming.cpp:
2987         * page/ResizeObservation.cpp:
2988         * page/UndoManager.cpp:
2989         * plugins/PluginData.cpp:
2990         * rendering/Grid.h:
2991         * rendering/GridBaselineAlignment.cpp:
2992         * rendering/GridBaselineAlignment.h:
2993         * rendering/GridLayoutFunctions.cpp:
2994         * rendering/GridLayoutFunctions.h:
2995         * rendering/GridTrackSizingAlgorithm.h:
2996         * rendering/RenderDeprecatedFlexibleBox.cpp:
2997         * rendering/RenderFlexibleBox.cpp:
2998         * rendering/RenderIFrame.cpp:
2999         * rendering/RenderLayerFilters.cpp:
3000         * rendering/TextDecorationPainter.cpp:
3001         * rendering/TextDecorationPainter.h:
3002         * rendering/TextPainter.cpp:
3003         * rendering/TextPainter.h:
3004         * rendering/style/StyleRareNonInheritedData.cpp:
3005         * rendering/style/StyleRareNonInheritedData.h:
3006         * rendering/svg/SVGRenderSupport.h:
3007         * rendering/updating/RenderTreeBuilder.cpp:
3008         * rendering/updating/RenderTreeBuilderSVG.cpp:
3009         * style/InlineTextBoxStyle.cpp:
3010         * style/InlineTextBoxStyle.h:
3011         * style/StylePendingResources.cpp:
3012         * svg/SVGMatrix.h:
3013         * svg/SVGViewSpec.h:
3014         * svg/SVGZoomAndPan.h:
3015         * workers/WorkerScriptLoader.cpp:
3016         * workers/WorkerScriptLoader.h:
3017         * workers/service/ServiceWorker.cpp:
3018         * workers/service/ServiceWorkerClientData.cpp:
3019         * workers/service/ServiceWorkerClients.cpp:
3020         * workers/service/ServiceWorkerClients.h:
3021         * workers/service/ServiceWorkerGlobalScope.cpp:
3022         * workers/service/ServiceWorkerJob.cpp:
3023         * workers/service/ServiceWorkerProvider.cpp:
3024         * workers/service/context/ServiceWorkerFetch.cpp:
3025         * workers/service/context/ServiceWorkerInspectorProxy.h:
3026         * workers/service/context/ServiceWorkerThread.cpp:
3027         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3028         * workers/service/server/SWServerJobQueue.cpp:
3029         * workers/service/server/SWServerToContextConnection.cpp:
3030         * workers/service/server/SWServerWorker.cpp:
3031         * workers/service/server/SWServerWorker.h:
3032         * worklets/Worklet.h:
3033
3034 2019-04-10  Antoine Quint  <graouts@apple.com>
3035
3036         Enable Pointer Events on watchOS
3037         https://bugs.webkit.org/show_bug.cgi?id=196771
3038         <rdar://problem/49040909>
3039
3040         Reviewed by Dean Jackson.
3041
3042         * Configurations/FeatureDefines.xcconfig:
3043
3044 2019-04-10  Youenn Fablet  <youenn@apple.com>
3045
3046         Delay initialization of quota users until the first quota request
3047         https://bugs.webkit.org/show_bug.cgi?id=196467
3048
3049         Reviewed by Chris Dumez.
3050
3051         Instead of triggering initialization of each user when being added,
3052         delay initialization until the first call to requestSpace with a non zero task size.
3053         This will make sure we do not load Cache API information in memory or check for
3054         IDB space until actually necessary.
3055
3056         To implement that, move from a HashSet of being initialized users to a HashMap where the key is user and
3057         the value is the user initialization state.
3058
3059         When removing a user, delay the call to processPendingRequest so that a synchronous call to addUser
3060         can be taken into consideration.
3061
3062         This unflakes some Cache API tests as these tests do clear the Cache API and check for the clearing result.
3063         Clearing the caches triggers a removeUser/addUser dance which then triggers initialization of the Caches structure.
3064
3065         Covered by existing tests.
3066
3067         * storage/StorageQuotaManager.cpp:
3068         (WebCore::StorageQuotaManager::initializeUsersIfNeeded):
3069         (WebCore::StorageQuotaManager::askUserToInitialize):
3070         (WebCore::StorageQuotaManager::addUser):
3071         (WebCore::StorageQuotaManager::requestSpace):
3072         * storage/StorageQuotaManager.h:
3073
3074 2019-04-10  Philippe Normand  <pnormand@igalia.com>
3075
3076         there is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
3077         https://bugs.webkit.org/show_bug.cgi?id=196615
3078
3079         Reviewed by Xabier Rodriguez-Calvar.
3080
3081         Add vp8.0 and vp9.0 in supported mime-types if the corresponding video decoders are found.
3082
3083         No new tests, existing web-platform-tests cover this change.
3084
3085         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
3086         (WebCore::GStreamerRegistryScanner::initialize):
3087
3088 2019-04-10  Philippe Normand  <pnormand@igalia.com>
3089
3090         [GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
3091         https://bugs.webkit.org/show_bug.cgi?id=196765
3092
3093         Reviewed by Xabier Rodriguez-Calvar.
3094
3095         Without the following patch in gst-plugins-bad, the uridownloader
3096         doesn't relay need-context messages to its parent, so in our case
3097         the player can't share its context with secondary webkitwebsrc
3098         elements and a RELEASE_ASSERT is hit in the WebProcess.
3099
3100         So the workaround is to use again webkit+ protocol prefixes for
3101         GStreamer versions older than 1.12.
3102
3103         https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/8cf858fb27919e1d631223375f81b98055623733
3104
3105         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3106         (WebCore::convertToInternalProtocol):
3107         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
3108         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
3109         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3110         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
3111         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3112         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3113         (webKitWebSrcStart):
3114         (webKitWebSrcGetProtocols):
3115         (convertPlaybinURI):
3116         (webKitWebSrcSetUri):
3117         (CachedResourceStreamingClient::responseReceived):
3118         (webKitSrcWouldTaintOrigin):
3119         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
3120
3121 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3122
3123         [ATK] Defer the emision of AtkObject::children-changed signal after layout is done
3124         https://bugs.webkit.org/show_bug.cgi?id=187948
3125
3126         Reviewed by Michael Catanzaro.
3127
3128         The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
3129         AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
3130         of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
3131         most of them update the backing store at the beginning.
3132
3133         Fixes: accessibility/children-changed-sends-notification.html
3134
3135         * accessibility/AXObjectCache.cpp:
3136         (WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
3137         * accessibility/AXObjectCache.h:
3138         * accessibility/atk/AXObjectCacheAtk.cpp:
3139         (WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
3140         (WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
3141         (WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
3142         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
3143         in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
3144         * accessibility/ios/AXObjectCacheIOS.mm:
3145         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
3146         * accessibility/mac/AXObjectCacheMac.mm:
3147         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
3148         * accessibility/win/AXObjectCacheWin.cpp:
3149         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
3150         * accessibility/wpe/AXObjectCacheWPE.cpp:
3151         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
3152
3153 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3154
3155         [ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
3156         https://bugs.webkit.org/show_bug.cgi?id=172281
3157         <rdar://problem/37030990>
3158
3159         Reviewed by Joanmarie Diggs.
3160
3161         The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
3162         first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
3163         things differently, we don't include the static text elements individually, but parent element uses
3164         textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.
3165
3166         Fixes: accessibility/insert-children-assert.html
3167
3168         * accessibility/AccessibilityRenderObject.cpp:
3169         (WebCore::AccessibilityRenderObject::textUnderElement const):
3170
3171 2019-04-09  Keith Rollin  <krollin@apple.com>
3172
3173         Unreviewed build maintenance -- update .xcfilelists.
3174
3175         * DerivedSources-input.xcfilelist:
3176         * DerivedSources-output.xcfilelist:
3177
3178 2019-04-09  Zalan Bujtas  <zalan@apple.com>
3179
3180         [AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
3181         https://bugs.webkit.org/show_bug.cgi?id=196743
3182         <rdar://problem/43897551>
3183
3184         Reviewed by Tim Horton.
3185
3186         This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
3187         Now with the initial containing block width is firmly set to auto-sizing width, the overflow content will not stretch the ICB. Instead it overflows the ICB
3188         and triggers scrolling the same way the non-auto-sizing mode does.
3189
3190         * page/FrameView.cpp:
3191         (WebCore::FrameView::autoSizeIfEnabled):
3192         (WebCore::FrameView::enableAutoSizeMode):
3193         * page/FrameView.h:
3194         * testing/Internals.cpp:
3195         (WebCore::Internals::enableAutoSizeMode):
3196         * testing/Internals.h:
3197         * testing/Internals.idl:
3198
3199 2019-04-09  Youenn Fablet  <youenn@apple.com>
3200
3201         Close service worker database on network process suspension
3202         https://bugs.webkit.org/show_bug.cgi?id=196623
3203         <rdar://problem/48930869>
3204
3205         Reviewed by Alex Christensen.
3206
3207         Add suspend/resume support to SWServer.
3208         On suspend, close the service worker database and stop pushing for changes.
3209         On resume, push changes if needed.
3210
3211         * workers/service/server/RegistrationDatabase.cpp:
3212         (WebCore::RegistrationDatabase::close):
3213         * workers/service/server/RegistrationDatabase.h:
3214         (WebCore::RegistrationDatabase::isClosed const): Deleted.
3215         * workers/service/server/RegistrationStore.cpp:
3216         (WebCore::RegistrationStore::closeDatabase):
3217         * workers/service/server/RegistrationStore.cpp:
3218         (WebCore::RegistrationStore::pushChangesToDatabase):
3219         (WebCore::RegistrationStore::clearAll):
3220         (WebCore::RegistrationStore::startSuspension):
3221         (WebCore::RegistrationStore::endSuspension):
3222         * workers/service/server/RegistrationStore.h:
3223         * workers/service/server/SWServer.cpp:
3224         (WebCore::SWServer::startSuspension):
3225         (WebCore::SWServer::endSuspension):
3226         * workers/service/server/SWServer.h:
3227
3228 2019-04-09  Justin Fan  <justin_fan@apple.com>
3229
3230         [Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
3231         https://bugs.webkit.org/show_bug.cgi?id=196719
3232
3233         Reviewed by Myles C. Maxfield.
3234
3235         Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.
3236
3237         Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html
3238
3239         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3240         (WebCore::WebGPURenderPassEncoder::setBlendColor):
3241         (WebCore::WebGPURenderPassEncoder::setViewport):
3242         (WebCore::WebGPURenderPassEncoder::setScissorRect):
3243         * Modules/webgpu/WebGPURenderPassEncoder.h:
3244         * Modules/webgpu/WebGPURenderPassEncoder.idl:
3245         * platform/graphics/gpu/GPURenderPassEncoder.h:
3246         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3247         (WebCore::GPURenderPassEncoder::setBlendColor):
3248         (WebCore::GPURenderPassEncoder::setViewport):
3249         (WebCore::GPURenderPassEncoder::setScissorRect):
3250
3251 2019-04-09  Andy Estes  <aestes@apple.com>
3252
3253         [Apple Pay] Add release logging to PaymentCoordinator
3254         https://bugs.webkit.org/show_bug.cgi?id=196738
3255
3256         Reviewed by Alex Christensen.
3257
3258         When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.
3259
3260         The following information might be logged: names of functions called, merchant API versions,
3261         boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
3262         completePaymentSession() was called with a final state result, boolean results of
3263         shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
3264         user scripts, and whether a client supports unrestricted Apple Pay.
3265
3266         * Modules/applepay/PaymentCoordinator.cpp:
3267         (WebCore::PaymentCoordinator::supportsVersion const):
3268         (WebCore::PaymentCoordinator::canMakePayments):
3269         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
3270         (WebCore::PaymentCoordinator::openPaymentSetup):
3271         (WebCore::PaymentCoordinator::beginPaymentSession):
3272         (WebCore::PaymentCoordinator::completeMerchantValidation):
3273         (WebCore::PaymentCoordinator::completeShippingMethodSelection):
3274         (WebCore::PaymentCoordinator::completeShippingContactSelection):
3275         (WebCore::PaymentCoordinator::completePaymentMethodSelection):
3276         (WebCore::PaymentCoordinator::completePaymentSession):
3277         (WebCore::PaymentCoordinator::abortPaymentSession):
3278         (WebCore::PaymentCoordinator::cancelPaymentSession):
3279         (WebCore::PaymentCoordinator::validateMerchant):
3280         (WebCore::PaymentCoordinator::didAuthorizePayment):
3281         (WebCore::PaymentCoordinator::didSelectPaymentMethod):
3282         (WebCore::PaymentCoordinator::didSelectShippingMethod):
3283         (WebCore::PaymentCoordinator::didSelectShippingContact):
3284         (WebCore::PaymentCoordinator::didCancelPaymentSession):
3285         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
3286         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
3287         * Modules/applepay/PaymentCoordinatorClient.h:
3288         (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
3289         * platform/Logging.h:
3290         * testing/MockPaymentCoordinator.h:
3291
3292 2019-04-09  John Wilander  <wilander@apple.com>
3293
3294         Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
3295         https://bugs.webkit.org/show_bug.cgi?id=196558
3296         <rdar://problem/47650245>
3297
3298         Reviewed by Youenn Fablet.
3299
3300         Tests: http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html
3301                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html
3302                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html
3303
3304         The existing API tests were expanded too.
3305
3306         * html/HTMLAnchorElement.cpp:
3307         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
3308            Enhanced the use of AdClickAttribution::MaxEntropy.
3309         * loader/AdClickAttribution.cpp:
3310         (WebCore::AdClickAttribution::parseConversionRequest):
3311             New function to parse and validate URLs with a path starting with
3312             /.well-known/ad-click-attribution/.
3313         (WebCore::AdClickAttribution::toString const):
3314             Added output for the conversion priority for testing purposes.
3315         * loader/AdClickAttribution.h:
3316         (WebCore::AdClickAttribution::Campaign::isValid const):
3317         (WebCore::AdClickAttribution::Conversion::isValid const):
3318            Enhanced the use of AdClickAttribution::MaxEntropy.
3319
3320 2019-04-09  Don Olmstead  <don.olmstead@sony.com>
3321
3322         [CMake] Apple builds should use ICU_INCLUDE_DIRS
3323         https://bugs.webkit.org/show_bug.cgi?id=196720
3324
3325         Reviewed by Konstantin Tokarev.
3326
3327         * PlatformMac.cmake:
3328
3329 2019-04-09  Jer Noble  <jer.noble@apple.com>
3330
3331         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
3332         https://bugs.webkit.org/show_bug.cgi?id=196097
3333
3334         Reviewed by Eric Carlson.
3335
3336         Test: media/track/track-in-band-metadata-display-order.html
3337
3338         Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
3339         by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
3340         TextTrackCueGeneric for testing.
3341
3342         Drive-by fixes:
3343
3344         Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
3345         parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
3346         a HTMLMediaElement*
3347
3348         TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
3349         enable use of is<> and downcast<>.
3350
3351         * Source/WebCore/CMakeLists.txt:
3352         * DerivedSources-input.xcfilelist:
3353         * DerivedSources-output.xcfilelist:
3354         * DerivedSources.make:
3355         * WebCore.xcodeproj/project.pbxproj:
3356         * Sources.txt:
3357         * html/shadow/MediaControlElementTypes.cpp:
3358         (WebCore::parentMediaElement):
3359         * html/shadow/MediaControlElementTypes.h:
3360         * html/shadow/MediaControlElements.cpp:
3361         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
3362         (WebCore::MediaControlTextTrackContainerElement::logger const):
3363         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
3364         (WebCore::MediaControlTextTrackContainerElement::logChannel const):
3365         * html/shadow/MediaControlElements.h:
3366         * html/track/DataCue.h:
3367         (isType):
3368         * html/track/TextTrackCueGeneric.h:
3369         (isType):
3370         * html/track/TextTrackCueGeneric.idl: Added.
3371         * html/track/VTTCue.h:
3372         (isType):
3373         * testing/Internals.cpp:
3374         (WebCore::Internals::createGenericCue):
3375         * testing/Internals.h:
3376         * testing/Internals.idl:
3377
3378 2019-04-09  Sihui Liu  <sihui_liu@apple.com>
3379
3380         Remove unnecessary network process assertion for IDB close
3381         https://bugs.webkit.org/show_bug.cgi?id=196693
3382
3383         Reviewed by Geoffrey Garen.
3384
3385         We already took assertion at WebCore::SQLiteDatabase::close.
3386
3387         * Modules/indexeddb/server/IDBServer.cpp:
3388         (WebCore::IDBServer::IDBServer::create):
3389         (WebCore::IDBServer::IDBServer::IDBServer):
3390         (WebCore::IDBServer::m_quotaManagerGetter): Deleted.
3391         (WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
3392         (WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
3393         * Modules/indexeddb/server/IDBServer.h:
3394         (WebCore::IDBServer::IDBServer::create): Deleted.
3395         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3396         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
3397         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
3398         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
3399         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3400         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3401         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
3402         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3403
3404 2019-04-09  Eike Rathke  <erack@redhat.com>
3405
3406         Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
3407         https://bugs.webkit.org/show_bug.cgi?id=196350
3408
3409         Reviewed by Xabier Rodriguez-Calvar.
3410
3411         trackTypeAsString was uninitialized in the
3412         TrackPrivateBaseGStreamer::TrackType::Text case when calling
3413         GST_INFO_OBJECT().
3414
3415         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3416         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
3417
3418 2019-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3419
3420         [ATK] Cleanup WebKitAccessibleHyperlink
3421         https://bugs.webkit.org/show_bug.cgi?id=196602
3422
3423         Reviewed by Michael Catanzaro.