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