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