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