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