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