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