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