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