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