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