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