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