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