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