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