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