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