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