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