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