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