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