[iOS] Programmaic scroll of "scrolling=no" iframe fails
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-05-19  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS] Programmaic scroll of "scrolling=no" iframe fails
4         https://bugs.webkit.org/show_bug.cgi?id=212063
5         <rdar://problem/57049514>
6
7         Reviewed by Antti Koivisto.
8
9         ScrollView::setScrollPosition() calls requestScrollPositionUpdate(), and if this returns
10         false it relies on the confusingly-named updateScrollbars() to actually do the scroll.
11         This code path is hit for "scrolling=no" frames, which are not scroll-coordinated.
12
13         ScrollView::updateScrollbars() fails to set the scroll position on iOS, where managesScrollbars()
14         returns false, so fix that.
15
16         Test: fast/scrolling/progammatic-scroll-scrolling-no-frame.html
17
18         * platform/ScrollView.cpp:
19         (WebCore::ScrollView::updateScrollbars):
20
21 2020-05-19  Andy Estes  <aestes@apple.com>
22
23         [Apple Pay] Add testing and logging for ApplePaySetup
24         https://bugs.webkit.org/show_bug.cgi?id=211972
25         <rdar://problem/63291965>
26
27         Reviewed by Alex Christensen.
28
29         Test: http/tests/ssl/applepay/ApplePaySetup.https.html
30
31         * DerivedSources-input.xcfilelist:
32         * DerivedSources-output.xcfilelist:
33         * DerivedSources.make:
34         * Modules/applepay/ApplePaySetup.cpp:
35         (WebCore::ApplePaySetup::getSetupFeatures):
36         (WebCore::ApplePaySetup::begin):
37         (WebCore::ApplePaySetup::ApplePaySetup):
38         (WebCore::ApplePaySetup::stop):
39         * Modules/applepay/ApplePaySetup.idl:
40         * Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
41         * Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
42         * Modules/applepay/ApplePaySetupFeature.idl:
43         * Modules/applepay/ApplePaySetupFeature.mm:
44         (WebCore::ApplePaySetupFeature::state const):
45         * Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
46         * Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
47         * Modules/applepay/ApplePaySetupFeatureType.idl:
48         * Modules/applepay/ApplePaySetupFeatureWebCore.h:
49         * Modules/applepay/ApplePaySetupWebCore.h:
50         (WebCore::ApplePaySetup::create):
51         * Modules/applepay/PaymentCoordinator.cpp:
52         (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const):
53         (WebCore::PaymentCoordinator::getSetupFeatures):
54         (WebCore::PaymentCoordinator::beginApplePaySetup):
55         (WebCore::PaymentCoordinator::endApplePaySetup):
56         * Modules/applepay/PaymentCoordinator.h:
57         * Modules/applepay/PaymentCoordinatorClient.h:
58         (WebCore::PaymentCoordinatorClient::getSetupFeatures):
59         (WebCore::PaymentCoordinatorClient::beginApplePaySetup):
60         * SourcesCocoa.txt:
61         * WebCore.xcodeproj/project.pbxproj:
62         * testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
63         (WebCore::MockApplePaySetupFeature::create):
64         (WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature):
65         * testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
66         * testing/MockPaymentCoordinator.cpp:
67         (WebCore::MockPaymentCoordinator::addSetupFeature):
68         (WebCore::MockPaymentCoordinator::getSetupFeatures):
69         (WebCore::MockPaymentCoordinator::beginApplePaySetup):
70         * testing/MockPaymentCoordinator.h:
71         * testing/MockPaymentCoordinator.idl:
72
73 2020-05-19  Sergio Villar Senin  <svillar@igalia.com>
74
75         [WebXR] Implement requestSession()
76         https://bugs.webkit.org/show_bug.cgi?id=211888
77
78         Reviewed by Youenn Fablet.
79
80         This patch adds a preliminar implementation of the requestSession()
81         API used to get a WebXRSession from the UA. It includes a fairly good
82         amount of checks to verify that the request can be satisfied given the
83         device's enabled features per session modes. The specs also describe how
84         to request persmission for some actions using the Permissions API which
85         WebKit does not currently implement. That should be done in a follow up
86         patch perhaps using a similar approach to other APIs as Geolocation for
87         example.
88
89         In order to get some of the requestSession() tests passing the session
90         finalization (shutdown) had to be implemented too.
91
92         Several tests where unskipped for WPE port as they're now passing.
93
94         * Modules/webxr/WebXRRenderState.cpp:
95         (WebCore::WebXRRenderState::create): Pass XRSessionMode as argument
96         instead of a WebXRSession.
97         * Modules/webxr/WebXRRenderState.h: Ditto.
98         * Modules/webxr/WebXRSession.cpp:
99         (WebCore::WebXRSession::create): Added.
100         (WebCore::WebXRSession::WebXRSession): Added.
101         (WebCore::WebXRSession::renderState const):
102         (WebCore::WebXRSession::inputSources const):
103         (WebCore::WebXRSession::shutdown): Shutdown process called on session end.
104         (WebCore::WebXRSession::end): Implemented session ending.
105         * Modules/webxr/WebXRSession.h: Added create() and private constructor. Fixed some naming.
106         * Modules/webxr/WebXRSystem.cpp:
107         (WebCore::WebXRSystem::DummyInlineDevice::DummyInlineDevice): Contructor for the
108         dummy inline device.
109         (WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected): Use a counter instead of a boolean
110         to track testing devices as there might be more than 1.
111         (WebCore::WebXRSystem::obtainCurrentDevice): Implemented from specs text.
112         (WebCore::WebXRSystem::immersiveSessionRequestIsAllowedForGlobalObject const): Ditto.
113         (WebCore::WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject const): Ditto.
114         (WebCore::WebXRSystem::resolveRequestedFeatures const): Ditto.
115         (WebCore::WebXRSystem::isXRPermissionGranted const): Ditto.
116         (WebCore::WebXRSystem::requestSession): Ditto.
117         (WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Use a counter instead of a bool.
118         Also use a reference in the method argument.
119         (WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Ditto.
120         (WebCore::WebXRSystem::sessionEnded): Added, used by sessions to notify the XRSystem.
121         * Modules/webxr/WebXRSystem.h:
122         * Modules/webxr/WebXRSystem.idl: Call requestSession with Document.
123         * dom/TaskSource.h: Added a WebXR task source.
124         * platform/xr/PlatformXR.h: Specs state that devices have a list of enabled features per session
125         mode so store them in a hashmap instead of in a Vector.
126         (PlatformXR::Device::supports const): Use the new Hashmap of session modes.
127         (PlatformXR::Device::setEnabledFeatures): Ditto.
128         (PlatformXR::Device::enabledFeatures const): Ditto.
129         (PlatformXR::Device::setSupportedModes): Deleted.
130         * platform/xr/openxr/PlatformXR.cpp:
131         (PlatformXR::Instance::Impl::collectSupportedSessionModes): Return session modes if any.
132         (PlatformXR::Instance::enumerateImmersiveXRDevices): Fill in features per session mode.
133         * testing/WebXRTest.cpp:
134         (WebCore::WebXRTest::simulateDeviceConnection): Fill in features per session mode.
135         (WebCore::WebXRTest::disconnectAllDevices): Pass a reference to unregister.
136
137 2020-05-19  Antti Koivisto  <antti@apple.com>
138
139         Animation of font-size with rem values is incorrect
140         https://bugs.webkit.org/show_bug.cgi?id=194765
141         <rdar://problem/48171742>
142
143         Reviewed by Antoine Quint.
144
145         Test: animations/keyframe-rem-unit.html
146
147         'rem' computation fails on first style resolution because the document element style is not available.
148
149         * style/StyleResolver.cpp:
150         (WebCore::Style::Resolver::styleForKeyframe):
151
152         Provide the override value, needed because the style can't be found from DOM tree yet.
153
154 2020-05-19  Andy Estes  <aestes@apple.com>
155
156         [Apple Pay] Add testing and logging for ApplePaySetup
157         https://bugs.webkit.org/show_bug.cgi?id=211972
158         <rdar://problem/63291965>
159
160         Reviewed by Alex Christensen.
161
162         Added support for ApplePaySetup to MockPaymentCoordinator and wrote a test.
163
164         Added release logging for ApplePaySetup and removed a noisy log message
165         from setApplePayIsActiveIfAllowed.
166
167         Test: http/tests/ssl/applepay/ApplePaySetup.https.html
168
169         * DerivedSources-input.xcfilelist:
170         * DerivedSources-output.xcfilelist:
171         * DerivedSources.make:
172         * Modules/applepay/ApplePaySetup.cpp:
173         (WebCore::ApplePaySetup::getSetupFeatures):
174         (WebCore::ApplePaySetup::begin):
175         (WebCore::ApplePaySetup::ApplePaySetup):
176         (WebCore::ApplePaySetup::stop):
177         * Modules/applepay/ApplePaySetup.idl:
178         * Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
179         * Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
180         * Modules/applepay/ApplePaySetupFeature.idl:
181         * Modules/applepay/ApplePaySetupFeature.mm:
182         (WebCore::ApplePaySetupFeature::state const):
183         * Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
184         * Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
185         * Modules/applepay/ApplePaySetupFeatureType.idl:
186         * Modules/applepay/ApplePaySetupFeatureWebCore.h:
187         * Modules/applepay/ApplePaySetupWebCore.h:
188         (WebCore::ApplePaySetup::create):
189         * Modules/applepay/PaymentCoordinator.cpp:
190         (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const):
191         (WebCore::PaymentCoordinator::getSetupFeatures):
192         (WebCore::PaymentCoordinator::beginApplePaySetup):
193         (WebCore::PaymentCoordinator::endApplePaySetup):
194         * Modules/applepay/PaymentCoordinator.h:
195         * Modules/applepay/PaymentCoordinatorClient.h:
196         (WebCore::PaymentCoordinatorClient::getSetupFeatures):
197         (WebCore::PaymentCoordinatorClient::beginApplePaySetup):
198         * SourcesCocoa.txt:
199         * WebCore.xcodeproj/project.pbxproj:
200         * testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetup.idl.
201         (WebCore::MockApplePaySetupFeature::create):
202         (WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature):
203         * testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
204         * testing/MockPaymentCoordinator.cpp:
205         (WebCore::MockPaymentCoordinator::addSetupFeature):
206         (WebCore::MockPaymentCoordinator::getSetupFeatures):
207         (WebCore::MockPaymentCoordinator::beginApplePaySetup):
208         * testing/MockPaymentCoordinator.h:
209         * testing/MockPaymentCoordinator.idl:
210
211 2020-05-19  Youenn Fablet  <youenn@apple.com>
212
213         Allow calling VideoSampleObserver::videoSampleAvailable from a background thread
214         https://bugs.webkit.org/show_bug.cgi?id=212024
215
216         Reviewed by Eric Carlson.
217
218         Allow RealtimeMediaSource::videoSampleAvailable to be called on a background thread, typically the capture thread.
219         Make WebRTC remote sources and mock capture sources do that.
220
221         RealtimeMediaSource is then updating its intrinsic size from the generation thread while updating its size in the main thread.
222         The size() getter can be called from both threads.
223
224         Existing consumers do the following:
225         - media player will hop to the main thread.
226         - media recorder will do processing from the background thread.
227         - WebRTC sender will do processing from the background thread, except when sending black frames where this will still be done on the main thread.
228         This is ok as we ensure either we send black frames on the main thread (and we do not observe the source) or we observe the source to send.
229
230         Follow-ups will migrate the real capture sources as well as migrating media player processing out of the main thread.
231         Covered by existing tests.
232
233         * platform/MediaSample.h:
234         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
235         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
236         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
237         * platform/mediastream/RealtimeMediaSource.cpp:
238         (WebCore::RealtimeMediaSource::videoSampleAvailable):
239         (WebCore::RealtimeMediaSource::setIntrinsicSize):
240         * platform/mediastream/RealtimeMediaSource.h:
241         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
242         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
243         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
244         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
245         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
246         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
247         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
248         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): Deleted.
249
250 2020-05-19  Michael Catanzaro  <mcatanzaro@gnome.org>
251
252         REGRESSION(r257463): [GTK] Build failure with -DENABLE_GLES2=ON
253         https://bugs.webkit.org/show_bug.cgi?id=212043
254
255         Reviewed by Philippe Normand.
256
257         Fix the typo "Platfom" -> "Platform"
258
259         * platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp:
260         (createGstGLDisplay):
261
262 2020-05-18  Simon Fraser  <simon.fraser@apple.com>
263
264         Move some of the more chatty Scrolling logging to a ScrollingTree channel
265         https://bugs.webkit.org/show_bug.cgi?id=212061
266
267         Reviewed by Tim Horton.
268
269         Move logging about the scrolling tree to a new channel.
270
271         * page/FrameView.cpp:
272         (WebCore::FrameView::scrollToFragmentInternal):
273         (WebCore::FrameView::scrollToAnchor):
274         * page/scrolling/AsyncScrollingCoordinator.cpp:
275         (WebCore::AsyncScrollingCoordinator::createNode):
276         (WebCore::AsyncScrollingCoordinator::insertNode):
277         * page/scrolling/ScrollingStateTree.cpp:
278         (WebCore::ScrollingStateTree::createUnparentedNode):
279         (WebCore::ScrollingStateTree::insertNode):
280         (WebCore::ScrollingStateTree::unparentNode):
281         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
282         (WebCore::ScrollingStateTree::detachAndDestroySubtree):
283         * page/scrolling/ScrollingTree.cpp:
284         (WebCore::ScrollingTree::commitTreeState):
285         * page/scrolling/ScrollingTreeScrollingNode.cpp:
286         (WebCore::ScrollingTreeScrollingNode::scrollTo):
287         * page/scrolling/ThreadedScrollingTree.cpp:
288         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
289         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
290         (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
291         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
292         (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
293         * platform/Logging.h:
294         * rendering/RenderLayerCompositor.cpp:
295         (WebCore::RenderLayerCompositor::attachScrollingNode):
296
297 2020-05-18  David Kilzer  <ddkilzer@apple.com>
298
299         Replace TextIndicatorOptions with OptionSet<TextIndicatorOption>
300         <https://webkit.org/b/212051>
301         <rdar://problem/63368556>
302
303         Reviewed by Simon Fraser.
304
305         Use OptionSet<TextIndicatorOption> everywhere
306         TextIndicatorOptions was previously used, plus:
307         - Make TextIndicatorOption an enum class.  Remove
308           "TextIndicatorOption" prefix so TextIndicatorOptionBar becomes
309           TextIndicatorOption::Bar.
310         - Remove TextIndicatorOptionDefault because OptionSet<>
311           initializes to zero.
312         - Replace static variables (including two globals in WebCore)
313           with constexpr variables.
314
315         * page/TextIndicator.cpp:
316         (WebCore::TextIndicator::createWithRange):
317         (WebCore::TextIndicator::createWithSelectionInFrame):
318         (WebCore::snapshotOptionsForTextIndicatorOptions):
319         (WebCore::takeSnapshots):
320         (WebCore::hasAnyIllegibleColors):
321         (WebCore::initializeIndicator):
322         * page/TextIndicator.h:
323         * platform/ios/DragImageIOS.mm:
324         (WebCore::createDragImageForLink):
325         (WebCore::createDragImageForSelection):
326         (WebCore::createDragImageForRange):
327         * testing/Internals.h:
328
329 2020-05-18  Andy Estes  <aestes@apple.com>
330
331         http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html fails in public SDK builds
332         https://bugs.webkit.org/show_bug.cgi?id=212000
333         <rdar://problem/63323082>
334
335         Reviewed by Youenn Fablet.
336
337         * Configurations/FeatureDefines.xcconfig:
338         * bindings/js/WebCoreBuiltinNames.h:
339
340 2020-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
341
342         [WebGPU] Validation for GPUDevice.createTexture()
343         https://bugs.webkit.org/show_bug.cgi?id=211882
344         <rdar://problem/63215999>
345
346         Reviewed by Dean Jackson.
347
348         Add lots of validation for texture creation. The logic was gathered by
349         trial and error.
350
351         Before this patch, we didn't have any validation. This is a first pass, as
352         the validation logic isn't spelled out in the spec. Next, I will make a pull
353         request to the spec to match this patch.
354
355         This patch also updates three pieces of our IDL files to match the spec for
356         WebGPU: One to remove GPUTextureUsage.NONE which was replaced with just 0,
357         one to remove GPUTextureDescriptor.arrayLayerCount, which was deleted in
358         favor of using regular dimension fields, and one to add [EnforceRange] to
359         various values.
360
361         This patch also updates GPUDevice to have a GPUErrorScopes object, which is
362         required for good error messages.
363
364         Test: webgpu/texture-creation.html
365
366         * Modules/webgpu/GPUExtent3D.idl:
367         * Modules/webgpu/GPUTextureDescriptor.idl:
368         * Modules/webgpu/WebGPUDevice.cpp:
369         (WebCore::WebGPUDevice::tryCreate):
370         (WebCore::WebGPUDevice::createTexture const):
371         * Modules/webgpu/WebGPUDevice.h:
372         * platform/graphics/gpu/GPUDevice.cpp:
373         (WebCore::maximumMipLevelCount):
374         (WebCore::GPUDevice::tryCreateTexture const):
375         * platform/graphics/gpu/GPUDevice.h:
376         (WebCore::GPUDevice::setErrorScopes):
377         * platform/graphics/gpu/GPUExtent3D.h:
378         * platform/graphics/gpu/GPUObjectBase.h:
379         (WebCore::GPUObjectBase::errorScopes const):
380         (WebCore::GPUObjectBase::errorScopes): Deleted.
381         * platform/graphics/gpu/GPUTexture.h:
382         * platform/graphics/gpu/GPUTextureDescriptor.h:
383         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
384         (WebCore::mtlTextureTypeForGPUTextureDescriptor):
385         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
386         (WebCore::tryCreateMtlTextureDescriptor):
387         (WebCore::GPUTexture::tryCreate):
388
389 2020-05-18  Oriol Brufau  <obrufau@igalia.com>
390
391         [css-grid] Clear the override width for computing percent margins
392         https://bugs.webkit.org/show_bug.cgi?id=209461
393
394         Reviewed by Manuel Rego Casasnovas.
395
396         When calculating the min-content contribution of a grid item of an auto
397         sized grid track we must consider the grid item's margin. When the grid
398         item's area is indefinite, a percent margin is resolved to zero.
399         However, when performing a relayout, the percent margin may be solved
400         against the previously computed grid area, since the grid item has
401         already an OverrideContainingBlockLogicalWidth value.
402
403         In order to re-compute the percent margin properly, we need to clear
404         the previously override value. It's important to be careful of not
405         clearing the override value set during intrinsic size, since we need
406         it for the actual layout phase. Hence, we only reset the 'override'
407         value when we are executing a definite strategy.
408
409         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html
410                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-dynamic-min-contribution-001.html
411                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-003.html
412                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-004.html
413                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-005.html
414                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-006.html
415                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-007.html
416                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-008.html
417                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-009.html
418                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-010.html
419                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-011.html
420                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-012.html
421                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-013.html
422                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-014.html
423                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-003.html
424                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-004.html
425                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-005.html
426                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-006.html
427                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-007.html
428                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-008.html
429                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-009.html
430                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-010.html
431                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-011.html
432                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-012.html
433                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-013.html
434                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-014.html
435
436         * rendering/GridTrackSizingAlgorithm.cpp:
437         (WebCore::hasRelativeMarginOrPaddingForChild):
438         (WebCore::hasRelativeOrIntrinsicSizeForChild):
439         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
440         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
441         (WebCore::GridTrackSizingAlgorithmStrategy::minLogicalSizeForChild const):
442         (WebCore::DefiniteSizeStrategy::minLogicalSizeForChild const):
443         (WebCore::DefiniteSizeStrategy::minContentForChild const):
444         * rendering/GridTrackSizingAlgorithm.h:
445
446 2020-05-18  David Kilzer  <ddkilzer@apple.com>
447
448         Follow-up: Use default initializers in TextIndicatorData
449         <https://webkit.org/b/212039>
450         <rdar://problem/63355619>
451
452         * page/TextIndicator.h:
453         (WebCore::TextIndicatorData::contentImageScaleFactor):
454         - Simon Fraser says 1 is a better default than 0.
455
456 2020-05-18  Peng Liu  <peng.liu6@apple.com>
457
458         Add a quirk to allow an embedded Twitter video to play with one tapping
459         https://bugs.webkit.org/show_bug.cgi?id=211932
460
461         Reviewed by Maciej Stachowiak.
462
463         * html/MediaElementSession.cpp:
464         (WebCore::MediaElementSession::playbackPermitted const):
465         Need to check the topDocument for the existence of user interactions.
466         (WebCore::MediaElementSession::updateMediaUsageIfChanged): Ditto.
467
468         * page/Quirks.cpp:
469         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
470         Add the missing needsQuirks() checking.
471         (WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const):
472         Add a the quirk for twitter.com.
473
474         * platform/audio/ios/MediaSessionManagerIOS.mm:
475         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
476         Clarify the log message.
477
478 2020-05-18  Simon Fraser  <simon.fraser@apple.com>
479
480         Content disappears on CSS parallax example
481         https://bugs.webkit.org/show_bug.cgi?id=212045
482         <rdar://problem/63194217>
483
484         Reviewed by Tim Horton.
485         
486         In r261632 I fixed parallax scrolling by migrating the perspective transform onto
487         the scroll container layer, and making the scrolled contents layer a "preserve3D" layer.
488         
489         However, scrolling is achieved by changing the boundsOrigin of the scrolled contents layer,
490         so the computation of the perspective matrix, which is a "child layer transform", has to
491         take this boundsOrigin into account, otherwise we compute bad coverage rects, and drop
492         backing store erroneously.
493
494         Test: compositing/tiling/perspective-on-scroller-tile-coverage.html
495
496         * platform/graphics/FloatPoint3D.h:
497         (WebCore::FloatPoint3D::FloatPoint3D):
498         (WebCore::FloatPoint3D::move):
499         (WebCore::operator +=):
500         (WebCore::operator -=):
501         (WebCore::operator+):
502         (WebCore::operator-):
503         * platform/graphics/ca/GraphicsLayerCA.cpp:
504         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
505         (WebCore::GraphicsLayerCA::layerTransform const):
506         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
507         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
508
509 2020-05-18  David Kilzer  <ddkilzer@apple.com>
510
511         Use default initializers in TextIndicatorData
512         <https://webkit.org/b/212039>
513         <rdar://problem/63355619>
514
515         Reviewed by Alex Christensen.
516
517         Tested by IPC::Decoder::decode() and IPC::Encoder::operator<<()
518         running on WebKit2 API and layout tests.
519
520         * page/TextIndicator.h:
521         (WebCore::TextIndicatorData):
522         - Add default initializers.
523         (WTF::EnumTraits<WebCore::TextIndicatorPresentationTransition>):
524         - Add EnumTraits so TextIndicatorPresentationTransition may be
525           used by IPC::Decoder::decode() and IPC::Encoder::operator<<().
526
527 2020-05-18  Simon Fraser  <simon.fraser@apple.com>
528
529         Fix operator== and hash() for ExtendedColor
530         https://bugs.webkit.org/show_bug.cgi?id=211993
531
532         Post-landing followup. ExtendedColor operator== has to do exact comparison to be
533         consistent with hash().
534
535         * platform/graphics/ExtendedColor.h:
536         (WebCore::operator==):
537
538 2020-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
539
540         Replace uses of +self with +class
541         https://bugs.webkit.org/show_bug.cgi?id=212041
542
543         Reviewed by Darin Adler.
544
545         No change in behavior.
546
547         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
548         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
549         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
550         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
551         (WebCore::PlatformCALayer::isWebLayer):
552
553 2020-05-18  Ross Kirsling  <ross.kirsling@sony.com>
554
555         Unreviewed restabilization of non-unified build. 
556
557         * accessibility/AXObjectCache.cpp:
558         * html/HTMLAttachmentElement.h:
559         * inspector/agents/InspectorCSSAgent.cpp:
560         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
561         * layout/tableformatting/TableFormattingContextGeometry.cpp:
562         * layout/tableformatting/TableFormattingState.cpp:
563         * rendering/RenderTextFragment.h:
564         * rendering/style/KeyframeList.h:
565
566 2020-05-18  Pinki Gyanchandani  <pgyanchandani@apple.com>
567
568         Null Ptr Deref @ WebCore::CSSValue::classType
569         https://bugs.webkit.org/show_bug.cgi?id=212036
570
571         Reviewed by Geoffrey Garen.
572
573         Calculated value for a primitive value type can be NULL for a CSS property. Added a null check before dereferencing it.
574
575         Test: editing/execCommand/null_calc_primitive_value_for_css_property.html
576
577         * css/CSSPrimitiveValue.cpp:
578         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
579
580 2020-05-18  Simon Fraser  <simon.fraser@apple.com>
581
582         Implement conversion between P3 and sRGB color
583         https://bugs.webkit.org/show_bug.cgi?id=211998
584
585         Reviewed by Daniel Bates.
586         
587         Color::toSRGBAComponentsLossy() was a lie because it didn't actually convert extended
588         colors into sRGB. Fix that by converting P3 and linaerRGB colors into sRGB, using the color
589         math from CSS Color 4.
590
591         Renamed the various "linear to sRGB" functions because they work for any RGB colors,
592         not just sRGB.
593
594         * platform/graphics/Color.cpp:
595         (WebCore::Color::toSRGBAComponentsLossy const):
596         * platform/graphics/Color.h:
597         * platform/graphics/ColorUtilities.cpp:
598         (WebCore::linearToRGBColorComponent):
599         (WebCore::RGBToLinearColorComponent):
600         (WebCore::sRGBColorToLinearComponents):
601         (WebCore::RGBToLinearComponents):
602         (WebCore::linearToRGBComponents):
603         (WebCore::XYZToLinearSRGB):
604         (WebCore::linearSRGBToXYZ):
605         (WebCore::XYZToLinearP3):
606         (WebCore::linearP3ToXYZ):
607         (WebCore::P3ToSRGB):
608         (WebCore::sRGBToP3):
609         (WebCore::ColorMatrix::transformedColorComponents const):
610         (WebCore::linearToSRGBColorComponent): Deleted.
611         (WebCore::sRGBToLinearColorComponent): Deleted.
612         (WebCore::sRGBToLinearComponents): Deleted.
613         (WebCore::linearToSRGBComponents): Deleted.
614         * platform/graphics/ColorUtilities.h:
615
616 2020-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
617
618         Allow clipboard API access when pasting from a menu item or key binding
619         https://bugs.webkit.org/show_bug.cgi?id=211990
620         <rdar://problem/63308916>
621
622         Reviewed by Megan Gardner.
623
624         Allow the contents of the clipboard to be programmatically requested by the page while pasting from trusted UI
625         (i.e. the paste menu item, or when WebKit API is called by the app to trigger the paste). This allows the
626         'reading' part of the async clipboard API (`read` and `readText`) to be used when the user pastes in an editable
627         element, without having to fall back to showing the DOM paste access menu.
628
629         Note that this change should not have an effect on the pasteboard security model, since it only grants the page
630         programmatic access to the contents of the pasteboard in the case where access to the pasteboard has already
631         been granted by the user. Additionally, even in the event that the web process is compromised, even if the web
632         process can be tricked into believing it has been granted pasteboard access, the changes in r259151 will prevent
633         it from being able to request pasteboard data, unless the user (or the application, on behalf of the user) has
634         explicitly pasted via trusted API calls that are inaccessible from the web process.
635
636         Test: editing/async-clipboard/clipboard-read-while-pasting.html
637
638         * editing/Editor.cpp:
639         (WebCore::Editor::paste):
640         (WebCore::Editor::pasteAsPlainText):
641         (WebCore::Editor::pasteAsQuotation):
642
643         If `FromMenuOrKeyBinding::Yes` is passed in, set the `m_pastingFromMenuOrKeyBinding` flag to true during the
644         scope of the paste command.
645
646         * editing/Editor.h:
647         (WebCore::Editor::isPastingFromMenuOrKeyBinding const):
648         * editing/EditorCommand.cpp:
649         (WebCore::executePaste):
650         (WebCore::executePasteAndMatchStyle):
651         (WebCore::executePasteAsPlainText):
652         (WebCore::executePasteAsQuotation):
653
654         Pass in `FromMenuOrKeyBinding::Yes` when triggering the paste from a menu item or key binding.
655
656         * page/Frame.cpp:
657         (WebCore::Frame::requestDOMPasteAccess):
658
659         When pasting from menu or key binding, grant the page DOM paste access without requiring the DOM paste access
660         UI to be shown and confirmed.
661
662 2020-05-18  Per Arne Vollan  <pvollan@apple.com>
663
664         [Win] Fix AppleWin build
665         https://bugs.webkit.org/show_bug.cgi?id=212030
666
667         Reviewed by Brent Fulgham.
668
669         The build fails because the number of bitfields in GreaterThanOrSameSizeAsStyleRareInheritedData does not match the
670         actual number of bitfields in StyleRareInheritedData.
671
672         * rendering/style/StyleRareInheritedData.cpp:
673
674 2020-05-18  Rob Buis  <rbuis@igalia.com>
675
676         Remove certain headers when a redirect causes a request method change
677         https://bugs.webkit.org/show_bug.cgi?id=205119
678
679         Reviewed by Youenn Fablet.
680
681         Implement step 11 of HTTP-redirect fetch [1] to redirect to GET
682         method, remove body and strip certain headers for 301, 302 and 303 redirects.
683
684         Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.html
685                imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker.html
686
687         * loader/SubresourceLoader.cpp:
688         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
689         * platform/network/HTTPHeaderNames.in:
690         * platform/network/ResourceRequestBase.cpp:
691         (WebCore::shouldUseGet):
692         (WebCore::ResourceRequestBase::redirectAsGETIfNeeded):
693         (WebCore::ResourceRequestBase::redirectedRequest const):
694         * platform/network/ResourceRequestBase.h:
695
696 2020-05-18  Antti Koivisto  <antti@apple.com>
697
698         [Wheel event region] Invalidation for root style
699         https://bugs.webkit.org/show_bug.cgi?id=212029
700
701         Reviewed by Simon Fraser.
702
703         Test: fast/scrolling/mac/wheel-event-listener-region-root-invalidation.html
704
705         Invalidate the region when event listeners change on Document or Window.
706
707         * dom/Document.cpp:
708         (WebCore::Document::invalidateEventListenerRegions):
709         * dom/Document.h:
710         (isType):
711         * dom/Element.cpp:
712         (WebCore::Element::invalidateEventListenerRegions):
713         * dom/Element.h:
714         * dom/EventTarget.cpp:
715         (WebCore::EventTarget::addEventListener):
716         (WebCore::EventTarget::removeEventListener):
717         (WebCore::EventTarget::removeAllEventListeners):
718         (WebCore::EventTarget::invalidateEventListenerRegions):
719         * dom/EventTarget.h:
720         * style/StyleAdjuster.cpp:
721         (WebCore::Style::Adjuster::adjustEventListenerRegionTypesForRootStyle):
722         * style/StyleAdjuster.h:
723         * style/StyleResolveForDocument.cpp:
724         (WebCore::Style::resolveForDocument):
725
726 2020-05-18  Simon Fraser  <simon.fraser@apple.com>
727
728         Find doesn't always scroll search results into view
729         https://bugs.webkit.org/show_bug.cgi?id=212007
730         <rdar://problem/36333321>
731
732         Reviewed by Wenson Hsieh.
733
734         HighlightData::collectBounds() could produce overly large bounds, causing the selection
735         to fail to scroll into view.
736         
737         This happened when multiple block ancestors were added to 'renderers', with empty
738         rects. The process of mapping that empty rect to a quad via localToAbsoluteQuad()
739         could produce an empty quad at a fractional offset, then calling enclosingBoundingBox()
740         on the quad would create a 1x1 rectangle, which got unioned with selectionRect.
741
742         Fix by skipping entries with empty rects.
743
744         Add a Selection log channel and some logging that makes this trivial to see.
745
746         Test: editing/selection/selection-bounds-fractional-containing-blocks.html
747
748         * platform/Logging.h:
749         * rendering/HighlightData.cpp:
750         (WebCore::HighlightData::collectBounds const):
751
752 2020-05-18  Darin Adler  <darin@apple.com>
753
754         Add iterator checking to ListHashSet
755         https://bugs.webkit.org/show_bug.cgi?id=211669
756
757         Reviewed by Anders Carlsson.
758
759         * page/ios/ContentChangeObserver.h: Added an include of Element.h, needed to call
760         makeWeakPtr in an inline function. This is due to a change in the way makeWeakPtr
761         now checks the type of the argument. It's possible we could refine it further to
762         relax this requirement, but it seems OK to include Element.h here.
763
764 2020-05-18  Zalan Bujtas  <zalan@apple.com>
765
766         [LFC][TFC] Add support for computing the collapsed table border
767         https://bugs.webkit.org/show_bug.cgi?id=212003
768
769         Reviewed by Antti Koivisto.
770
771         UAs must compute an initial left and right border width for the table by examining
772         the first and last cells in the first row of the table.
773         The left border width of the table is half of the first cell's collapsed left border,
774         and the right border width of the table is half of the last cell's collapsed right border.
775         The top border width of the table is computed by examining all cells who collapse their top
776         borders with the top border of the table. The top border width of the table is equal to half of the
777         maximum collapsed top border. The bottom border width is computed by examining all cells whose bottom borders collapse
778         with the bottom of the table. The bottom border width is equal to half of the maximum collapsed bottom border.
779
780         https://www.w3.org/TR/CSS22/tables.html#collapsing-borders
781
782         This patch implements the table box part of the border collapsing. Inner table elements need to implement collapsing as well.
783
784         * layout/LayoutState.cpp:
785         (WebCore::Layout::LayoutState::ensureTableFormattingState):
786         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
787         (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox):
788         (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
789         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
790         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h:
791         * layout/tableformatting/TableFormattingContext.cpp:
792         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
793         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
794         * layout/tableformatting/TableFormattingContext.h:
795         * layout/tableformatting/TableFormattingState.cpp:
796         (WebCore::Layout::TableFormattingState::TableFormattingState):
797         * layout/tableformatting/TableFormattingState.h:
798
799 2020-05-18  Antoine Quint  <graouts@apple.com>
800
801         Clean up media controls content for Apple platforms
802         https://bugs.webkit.org/show_bug.cgi?id=212011
803         <rdar://problem/63298588>
804
805         Reviewed by Dean Jackson.
806
807         We strip Copyright and other comments from the CSS and JS media controls files.
808
809         * WebCore.xcodeproj/project.pbxproj:
810
811 2020-05-18  Alicia Boya García  <aboya@igalia.com>
812
813         [GStreamer][MediaSource] Remove orphaned tracks in updateTracks()
814         https://bugs.webkit.org/show_bug.cgi?id=211980
815
816         Reviewed by Xabier Rodriguez-Calvar.
817
818         This patch ensures tracks missing from a subsequent updateTracks()
819         calls are removed from the player.
820
821         This fixes regressions on the following tests caused on r261683.
822
823         imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-removetrack.https.html
824         imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-applyConstraints.https.html
825
826         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
827         (WebCore::hashSetFromHashMapKeys):
828         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
829
830 2020-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
831
832         [GTK] "ASSERTION FAILED: !m_adoptionIsRequired" when double clicking on a word
833         https://bugs.webkit.org/show_bug.cgi?id=211957
834
835         Reviewed by Adrian Perez de Castro.
836
837         Make SelectionData non-refcounted. We can just move in most of the cases to avoid copies.
838
839         * platform/Pasteboard.h:
840         * platform/gtk/PasteboardGtk.cpp:
841         (WebCore::Pasteboard::createForDragAndDrop):
842         (WebCore::Pasteboard::Pasteboard):
843         (WebCore::Pasteboard::selectionData const):
844         * platform/gtk/SelectionData.h:
845
846 2020-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
847
848         [GTK] Add WebKitContextMenuItemType for paste as plaintext
849         https://bugs.webkit.org/show_bug.cgi?id=177638
850
851         Reviewed by Michael Catanzaro.
852
853         Add paste as plain text context menu item for rich editable content.
854
855         * page/ContextMenuController.cpp:
856         (WebCore::ContextMenuController::contextMenuItemSelected):
857         (WebCore::ContextMenuController::populate):
858         (WebCore::ContextMenuController::checkOrEnableIfNeeded const):
859         * platform/ContextMenuItem.h:
860         * platform/LocalizedStrings.h:
861         * platform/gtk/LocalizedStringsGtk.cpp:
862         (WebCore::contextMenuItemTagPasteAsPlainText):
863
864 2020-05-17  Simon Fraser  <simon.fraser@apple.com>
865
866         Fix operator== and hash() for ExtendedColor
867         https://bugs.webkit.org/show_bug.cgi?id=211993
868
869         Reviewed by Sam Weinig.
870
871         Color::operator== and hash() were wrong for extended color. Fix operator==
872         to compare extended colors. Extended and non-extended colors have to always
873         conpare as non-equal to preserve computed style behavior, currently.
874
875         Fix hash() to hash the color components and colorspace for ExtendedColor.
876
877         Add some API tests for these code paths.
878
879         * platform/graphics/Color.cpp:
880         (WebCore::extendedColorsEqual):
881         * platform/graphics/Color.h:
882         (WebCore::operator==):
883         (WebCore::Color::hash const):
884         * platform/graphics/ColorUtilities.cpp:
885         (WebCore::areEssentiallyEqual):
886         * platform/graphics/ColorUtilities.h:
887         (WebCore::operator==):
888         (WebCore::operator!=):
889         * platform/graphics/ExtendedColor.cpp:
890         (WebCore::ExtendedColor::hash const):
891         * platform/graphics/ExtendedColor.h:
892         (WebCore::operator==):
893         (WebCore::operator!=):
894
895 2020-05-17  Zalan Bujtas  <zalan@apple.com>
896
897         [LFC][BFC] Introduce TableWrapperBlockFormattingContext
898         https://bugs.webkit.org/show_bug.cgi?id=211996
899
900         Reviewed by Antti Koivisto.
901
902         Table wrapper box establishes a special BFC with only captions and the actual table box in it.
903         It mostly behaves like a normal BFC but the table box requires some special handing when it comes
904         to padding/border and width/height computation.
905         This patch moves the table box specific code from generic BFC to this new subclass. 
906
907         * Sources.txt:
908         * WebCore.xcodeproj/project.pbxproj:
909         * layout/FormattingContext.h:
910         * layout/LayoutContext.cpp:
911         (WebCore::Layout::LayoutContext::createFormattingContext):
912         * layout/blockformatting/BlockFormattingContext.cpp:
913         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
914         * layout/blockformatting/BlockFormattingContext.h:
915         (): Deleted.
916         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
917         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
918         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: Added.
919         (WebCore::Layout::TableWrapperBlockFormattingContext::TableWrapperBlockFormattingContext):
920         (WebCore::Layout::TableWrapperBlockFormattingContext::layoutInFlowContent):
921         (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox):
922         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
923         (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
924         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: Added.
925
926 2020-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
927
928         [GTK] Move to new Pasteboard API
929         https://bugs.webkit.org/show_bug.cgi?id=177633
930
931         Reviewed by Adrian Perez de Castro.
932
933         Add support for custom data and remove the support for unknown data types that is currently unused.
934
935         * editing/gtk/EditorGtk.cpp:
936         (WebCore::Editor::writeSelectionToPasteboard): Set the contentOrigin.
937         * editing/gtk/WebContentReaderGtk.cpp:
938         (WebCore::shouldReplaceSubresourceURL): Helper to decide whether to replace the subresource URL.
939         (WebCore::WebContentMarkupReader::readHTML): Create a fragment for HTML sanitizing it if needed.
940         * platform/Pasteboard.h:
941         * platform/PasteboardCustomData.h:
942         (WebCore::PasteboardCustomData::gtkType): Mime type name for GTK custom pasteboard data.
943         * platform/SharedBuffer.h:
944         * platform/glib/SharedBufferGlib.cpp:
945         (WebCore::SharedBuffer::createGBytes const): Create a GBytes wrapping the SharedBuffer data.
946         * platform/gtk/PasteboardGtk.cpp:
947         (WebCore::Pasteboard::writeString):
948         (WebCore::Pasteboard::write):
949         (WebCore::Pasteboard::read):
950         (WebCore::Pasteboard::hasData):
951         (WebCore::Pasteboard::typesSafeForBindings):
952         (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
953         (WebCore::Pasteboard::readOrigin):
954         (WebCore::Pasteboard::readString):
955         (WebCore::Pasteboard::readStringInCustomData):
956         (WebCore::Pasteboard::fileContentState):
957         (WebCore::Pasteboard::writeCustomData):
958         * platform/gtk/SelectionData.cpp:
959         (WebCore::SelectionData::clearAllExceptFilenames):
960         * platform/gtk/SelectionData.h:
961         (WebCore::SelectionData::setCustomData):
962         (WebCore::SelectionData::customData const):
963         (WebCore::SelectionData::hasCustomData const):
964         (WebCore::SelectionData::clearCustomData):
965
966 2020-05-16  Simon Fraser  <simon.fraser@apple.com>
967
968         Some color-related cleanup
969         https://bugs.webkit.org/show_bug.cgi?id=211991
970
971         Reviewed by Sam Weinig.
972
973         Change FloatComponents and ColorComponents to use std::array<>.
974
975         Add Color::toSRGBAComponentsLossy() to make explicit potentially lossy conversions
976         between P3 and sRGB colors, and call it in places where we do that conversion.
977
978         Add const in a few places.
979
980         * Headers.cmake:
981         * WebCore.xcodeproj/project.pbxproj:
982         * platform/graphics/Color.cpp:
983         (WebCore::Color::Color):
984         (WebCore::Color::toSRGBAComponentsLossy const):
985         (WebCore::Color::asExtended const):
986         * platform/graphics/Color.h:
987         * platform/graphics/ColorUtilities.cpp:
988         (WebCore::ColorMatrix::ColorMatrix):
989         * platform/graphics/ColorUtilities.h:
990         (WebCore::FloatComponents::FloatComponents):
991         (): Deleted.
992         * platform/graphics/ExtendedColor.cpp:
993         (WebCore::ExtendedColor::create):
994         (WebCore::ExtendedColor::cssText const):
995         * platform/graphics/ExtendedColor.h:
996         (WebCore::ExtendedColor::red const):
997         (WebCore::ExtendedColor::green const):
998         (WebCore::ExtendedColor::blue const):
999         (WebCore::ExtendedColor::alpha const):
1000         (WebCore::ExtendedColor::channels const):
1001         (WebCore::ExtendedColor::ExtendedColor):
1002         * platform/graphics/cg/ColorCG.cpp:
1003         (WebCore::leakCGColor):
1004         * platform/graphics/filters/FETurbulence.cpp:
1005         (WebCore::FETurbulence::fillRegion const):
1006         * platform/graphics/filters/FilterOperation.cpp:
1007         (WebCore::InvertLightnessFilterOperation::transformColor const):
1008         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
1009         * platform/graphics/gtk/ColorGtk.cpp:
1010         (WebCore::Color::operator GdkRGBA const):
1011         * platform/graphics/win/ColorDirect2D.cpp:
1012         (WebCore::Color::operator D2D1_COLOR_F const):
1013         (WebCore::Color::operator D2D1_VECTOR_4F const):
1014
1015 2020-05-16  Andy Estes  <aestes@apple.com>
1016
1017         Fix the build after r261785.
1018
1019         * Modules/applepay/PaymentInstallmentConfiguration.mm:
1020         (WebCore::fromDecimalNumber):
1021
1022 2020-05-16  David Kilzer  <ddkilzer@apple.com>
1023
1024         Let Xcode have its way with WebCore project
1025
1026         * WebCore.xcodeproj/project.pbxproj:
1027         - Resort TableLayout.cpp.
1028
1029 2020-05-16  Zalan Bujtas  <zalan@apple.com>
1030
1031         Add missing is<RenderTableSection> check.
1032
1033         Unreviewed.
1034
1035         * layout/Verification.cpp:
1036         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1037
1038 2020-05-16  Andy Estes  <aestes@apple.com>
1039
1040         REGRESSION (r260717): installmentConfiguration member is no longer available on ApplePayPaymentRequest
1041         https://bugs.webkit.org/show_bug.cgi?id=211911
1042         <rdar://problem/63236367>
1043
1044         Reviewed by Tim Horton.
1045
1046         Prior to r260717, installmentConfiguration was a member of ApplePayRequestBase, making it
1047         available on ApplePayRequest and ApplePayPaymentRequest. In r260717, it was mistakenly
1048         moved to ApplePayRequest.
1049
1050         This change moves it back to ApplePayRequestBase, adds infrastructure for regression testing
1051         ApplePayInstallmentConfiguration, and adds a regression test.
1052
1053         Test: http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html
1054
1055         * Modules/applepay/ApplePayInstallmentConfiguration.idl:
1056         * Modules/applepay/ApplePayRequestBase.cpp:
1057         (WebCore::convertAndValidate):
1058         (WebCore::finishConverting): Deleted.
1059         * Modules/applepay/ApplePayRequestBase.idl:
1060         * Modules/applepay/PaymentInstallmentConfiguration.mm:
1061         (WebCore::fromDecimalNumber):
1062         (WebCore::applePaySetupFeatureType):
1063         (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const):
1064         * Modules/applepay/PaymentInstallmentConfigurationWebCore.h:
1065         * Modules/applepay/paymentrequest/ApplePayRequest.idl:
1066         * testing/MockPaymentCoordinator.cpp:
1067         (WebCore::MockPaymentCoordinator::showPaymentUI):
1068         * testing/MockPaymentCoordinator.h:
1069         * testing/MockPaymentCoordinator.idl:
1070
1071 2020-05-16  Zalan Bujtas  <zalan@apple.com>
1072
1073         [LFC][TFC] Ignore table padding when borders are collapsed
1074         https://bugs.webkit.org/show_bug.cgi?id=211984
1075
1076         Reviewed by Antti Koivisto.
1077
1078         Table padding has no room left when the table border is collapsed with the inner table elements.
1079
1080         Test: fast/layoutformattingcontext/table-simple-border-collapse-with-padding.html
1081
1082         * layout/Verification.cpp:
1083         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1084         * layout/layouttree/LayoutBox.cpp:
1085         (WebCore::Layout::Box::isPaddingApplicable const):
1086
1087 2020-05-16  Zalan Bujtas  <zalan@apple.com>
1088
1089         [LFC][TFC] Take vertical spacing into account when setting the height of a cell with rowspan
1090         https://bugs.webkit.org/show_bug.cgi?id=211976
1091
1092         Reviewed by Antti Koivisto.
1093
1094         When a cell spans over multiple rows, the height of the cell includes the vertical spacing between those spanned rows as well.
1095
1096         Test: fast/layoutformattingcontext/table-simple-rowspan-with-spacing.html
1097
1098         * layout/tableformatting/TableFormattingContext.cpp:
1099         (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
1100
1101 2020-05-15  Antti Koivisto  <antti@apple.com>
1102
1103         Nullptr crash in MediaQueryMatcher::evaluateAll
1104         https://bugs.webkit.org/show_bug.cgi?id=211963
1105         <rdar://problem/62850977>
1106
1107         Reviewed by Brent Fulgham.
1108
1109         Test: fast/media/media-query-list-mutation.html
1110
1111         * css/MediaQueryMatcher.cpp:
1112         (WebCore::MediaQueryMatcher::evaluateAll):
1113
1114         Copy the vector before iterating.
1115
1116 2020-05-15  Jack Lee  <shihchieh_lee@apple.com>
1117
1118         Nullptr crash in WebCore::Node::treeScope() when processing nested list insertion commands.
1119         https://bugs.webkit.org/show_bug.cgi?id=211964
1120         <rdar://problem/63224871>
1121
1122         Reviewed by Geoffrey Garen.
1123
1124         Load event may fire in fixOrphanedListChild() and change the node tree. In doApplyForSingleParagraph check for 
1125         disconnected node returned by fixOrphanedListChild() and bail out.
1126
1127         Test: editing/inserting/nested-list-insertion-crash.html
1128
1129         * editing/InsertListCommand.cpp:
1130         (WebCore::InsertListCommand::doApplyForSingleParagraph):
1131
1132 2020-05-15  Alex Christensen  <achristensen@webkit.org>
1133
1134         Use enum serialization instead of casting to/from uint32_t
1135         https://bugs.webkit.org/show_bug.cgi?id=211885
1136         <rdar://problem/60106629> and <rdar://problem/60107663>
1137
1138         Reviewed by Geoffrey Garen.
1139
1140         This doesn't change anything except make stricter checks at IPC boundaries.
1141
1142         * accessibility/AccessibilityRenderObject.cpp:
1143         (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const):
1144         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1145         (-[WebAccessibilityObjectWrapper accessibilityModifySelection:increase:]):
1146         * editing/EditingBehavior.h:
1147         * editing/Editor.cpp:
1148         (WebCore::Editor::shouldSmartDelete):
1149         (WebCore::Editor::deleteWithDirection):
1150         (WebCore::Editor::misspelledWordAtCaretOrRange const):
1151         (WebCore::Editor::guessesForMisspelledOrUngrammatical):
1152         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1153         (WebCore::Editor::markAndReplaceFor):
1154         (WebCore::Editor::handleAcceptedCandidate):
1155         * editing/EditorCommand.cpp:
1156         (WebCore::executeDeleteBackward):
1157         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter):
1158         (WebCore::executeDeleteForward):
1159         (WebCore::executeDeleteToBeginningOfLine):
1160         (WebCore::executeDeleteToBeginningOfParagraph):
1161         (WebCore::executeDeleteToEndOfLine):
1162         (WebCore::executeDeleteToEndOfParagraph):
1163         (WebCore::executeDeleteWordBackward):
1164         (WebCore::executeDeleteWordForward):
1165         (WebCore::executeForwardDelete):
1166         (WebCore::executeMoveBackward):
1167         (WebCore::executeMoveBackwardAndModifySelection):
1168         (WebCore::executeMoveDown):
1169         (WebCore::executeMoveDownAndModifySelection):
1170         (WebCore::executeMoveForward):
1171         (WebCore::executeMoveForwardAndModifySelection):
1172         (WebCore::executeMoveLeft):
1173         (WebCore::executeMoveLeftAndModifySelection):
1174         (WebCore::executeMoveRight):
1175         (WebCore::executeMoveRightAndModifySelection):
1176         (WebCore::executeMoveToBeginningOfDocument):
1177         (WebCore::executeMoveToBeginningOfDocumentAndModifySelection):
1178         (WebCore::executeMoveToBeginningOfLine):
1179         (WebCore::executeMoveToBeginningOfLineAndModifySelection):
1180         (WebCore::executeMoveToBeginningOfParagraph):
1181         (WebCore::executeMoveToBeginningOfParagraphAndModifySelection):
1182         (WebCore::executeMoveToBeginningOfSentence):
1183         (WebCore::executeMoveToBeginningOfSentenceAndModifySelection):
1184         (WebCore::executeMoveToEndOfDocument):
1185         (WebCore::executeMoveToEndOfDocumentAndModifySelection):
1186         (WebCore::executeMoveToEndOfSentence):
1187         (WebCore::executeMoveToEndOfSentenceAndModifySelection):
1188         (WebCore::executeMoveToEndOfLine):
1189         (WebCore::executeMoveToEndOfLineAndModifySelection):
1190         (WebCore::executeMoveToEndOfParagraph):
1191         (WebCore::executeMoveToEndOfParagraphAndModifySelection):
1192         (WebCore::executeMoveParagraphBackwardAndModifySelection):
1193         (WebCore::executeMoveParagraphForwardAndModifySelection):
1194         (WebCore::executeMoveUp):
1195         (WebCore::executeMoveUpAndModifySelection):
1196         (WebCore::executeMoveWordBackward):
1197         (WebCore::executeMoveWordBackwardAndModifySelection):
1198         (WebCore::executeMoveWordForward):
1199         (WebCore::executeMoveWordForwardAndModifySelection):
1200         (WebCore::executeMoveWordLeft):
1201         (WebCore::executeMoveWordLeftAndModifySelection):
1202         (WebCore::executeMoveWordRight):
1203         (WebCore::executeMoveWordRightAndModifySelection):
1204         (WebCore::executeMoveToLeftEndOfLine):
1205         (WebCore::executeMoveToLeftEndOfLineAndModifySelection):
1206         (WebCore::executeMoveToRightEndOfLine):
1207         (WebCore::executeMoveToRightEndOfLineAndModifySelection):
1208         (WebCore::executeSelectLine):
1209         (WebCore::executeSelectParagraph):
1210         (WebCore::executeSelectSentence):
1211         (WebCore::executeSelectWord):
1212         * editing/FrameSelection.cpp:
1213         (WebCore::FrameSelection::FrameSelection):
1214         (WebCore::FrameSelection::willBeModified):
1215         (WebCore::FrameSelection::modifyExtendingRight):
1216         (WebCore::FrameSelection::modifyExtendingForward):
1217         (WebCore::FrameSelection::modifyMovingRight):
1218         (WebCore::FrameSelection::modifyMovingForward):
1219         (WebCore::FrameSelection::modifyExtendingLeft):
1220         (WebCore::FrameSelection::modifyExtendingBackward):
1221         (WebCore::FrameSelection::modifyMovingLeft):
1222         (WebCore::FrameSelection::modifyMovingBackward):
1223         (WebCore::isBoundary):
1224         (WebCore::FrameSelection::textSelectionIntent):
1225         (WebCore::textSelectionWithDirectionAndGranularity):
1226         (WebCore::FrameSelection::modify):
1227         (WebCore::FrameSelection::clear):
1228         (WebCore::FrameSelection::willBeRemovedFromFrame):
1229         (WebCore::FrameSelection::updateAppearance):
1230         (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
1231         (WebCore::FrameSelection::rangeByAlteringCurrentSelection const):
1232         * editing/FrameSelection.h:
1233         * editing/TextGranularity.h:
1234         (): Deleted.
1235         * editing/TypingCommand.cpp:
1236         (WebCore::editActionForTypingCommand):
1237         (WebCore::TypingCommand::deleteKeyPressed):
1238         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1239         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
1240         (WebCore::TypingCommand::insertLineBreak):
1241         (WebCore::TypingCommand::insertParagraphSeparator):
1242         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
1243         (WebCore::TypingCommand::deleteSelection):
1244         * editing/TypingCommand.h:
1245         * editing/VisibleSelection.cpp:
1246         (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
1247         * editing/VisibleSelection.h:
1248         * editing/VisibleUnits.cpp:
1249         (WebCore::directionIsDownstream):
1250         (WebCore::atBoundaryOfGranularity):
1251         (WebCore::withinTextUnitOfGranularity):
1252         (WebCore::nextWordBoundaryInDirection):
1253         (WebCore::nextSentenceBoundaryInDirection):
1254         (WebCore::nextParagraphBoundaryInDirection):
1255         (WebCore::positionOfNextBoundaryOfGranularity):
1256         (WebCore::enclosingTextUnitOfGranularity):
1257         (WebCore::charactersAroundPosition):
1258         (WebCore::wordRangeFromPosition):
1259         (WebCore::closestWordBoundaryForPosition):
1260         (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
1261         (WebCore::wordBoundaryForPositionWithoutCrossingLine):
1262         * editing/cocoa/DataDetection.mm:
1263         (WebCore::DataDetection::detectItemAroundHitTestResult):
1264         * editing/cocoa/DictionaryLookup.mm:
1265         * editing/mac/DictionaryLookupLegacy.mm:
1266         * html/canvas/WebGLRenderingContextBase.cpp:
1267         (WebCore::WebGLRenderingContextBase::create):
1268         * loader/FrameLoaderClient.h:
1269         (WebCore::FrameLoaderClient::webGLPolicyForURL const):
1270         (WebCore::FrameLoaderClient::resolveWebGLPolicyForURL const):
1271         (): Deleted.
1272         * loader/FrameLoaderTypes.h:
1273         * page/ContextMenuController.cpp:
1274         (WebCore::ContextMenuController::contextMenuItemSelected):
1275         * page/DOMSelection.cpp:
1276         (WebCore::DOMSelection::modify):
1277         * page/DragController.cpp:
1278         (WebCore::DragController::concludeEditDrag):
1279         * page/EventHandler.cpp:
1280         (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
1281         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
1282         (WebCore::EventHandler::selectClosestContextualWordFromMouseEvent):
1283         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent):
1284         (WebCore::EventHandler::handleMousePressEventTripleClick):
1285         (WebCore::EventHandler::handleMousePressEventSingleClick):
1286         (WebCore::EventHandler::updateSelectionForMouseDrag):
1287         (WebCore::setInitialKeyboardSelection):
1288         (WebCore::handleKeyboardSelectionMovement):
1289         * rendering/HitTestResult.cpp:
1290         (WebCore::HitTestResult::isOverTextInsideFormControlElement const):
1291
1292 2020-05-15  Simon Fraser  <simon.fraser@apple.com>
1293
1294         Rename the mapLocalToContainer() container argument, since it's not just used for repaint
1295         https://bugs.webkit.org/show_bug.cgi?id=211974
1296
1297         Reviewed by Zalan Bujtas.
1298
1299         mapLocalToContainer() is a generic geometry mapping function, and not just used for repaint,
1300         so rename the "repaintContainer" argument to "ancestorContainer".
1301
1302         Also fix some weirdly named variables in RenderMultiColumnFlow.
1303
1304         * rendering/RenderBox.cpp:
1305         (WebCore::RenderBox::mapLocalToContainer const):
1306         * rendering/RenderBox.h:
1307         * rendering/RenderFragmentedFlow.cpp:
1308         (WebCore::RenderFragmentedFlow::mapLocalToContainer const):
1309         * rendering/RenderFragmentedFlow.h:
1310         * rendering/RenderInline.cpp:
1311         (WebCore::RenderInline::mapLocalToContainer const):
1312         (WebCore::RenderInline::pushMappingToContainer const):
1313         * rendering/RenderMultiColumnFlow.cpp:
1314         (WebCore::RenderMultiColumnFlow::addFragmentToThread):
1315         (WebCore::RenderMultiColumnFlow::mapFromFlowToFragment const):
1316         (WebCore::RenderMultiColumnFlow::physicalTranslationOffsetFromFlowToFragment const):
1317         (WebCore::RenderMultiColumnFlow::physicalTranslationFromFlowToFragment const):
1318         * rendering/RenderObject.cpp:
1319         (WebCore::RenderObject::mapLocalToContainer const):
1320         (WebCore::RenderObject::localToContainerQuad const):
1321         (WebCore::RenderObject::localToContainerPoint const):
1322         * rendering/RenderObject.h:
1323         * rendering/RenderView.cpp:
1324         (WebCore::RenderView::mapLocalToContainer const):
1325         * rendering/svg/RenderSVGForeignObject.cpp:
1326         (WebCore::RenderSVGForeignObject::mapLocalToContainer const):
1327         * rendering/svg/RenderSVGForeignObject.h:
1328         * rendering/svg/RenderSVGInline.cpp:
1329         (WebCore::RenderSVGInline::mapLocalToContainer const):
1330         * rendering/svg/RenderSVGInline.h:
1331         * rendering/svg/RenderSVGModelObject.cpp:
1332         (WebCore::RenderSVGModelObject::mapLocalToContainer const):
1333         * rendering/svg/RenderSVGModelObject.h:
1334         * rendering/svg/RenderSVGRoot.cpp:
1335         (WebCore::RenderSVGRoot::mapLocalToContainer const):
1336         * rendering/svg/RenderSVGRoot.h:
1337         * rendering/svg/RenderSVGText.cpp:
1338         (WebCore::RenderSVGText::mapLocalToContainer const):
1339         * rendering/svg/RenderSVGText.h:
1340         * rendering/svg/SVGRenderSupport.cpp:
1341         (WebCore::SVGRenderSupport::mapLocalToContainer):
1342         * rendering/svg/SVGRenderSupport.h:
1343
1344 2020-05-15  Simon Fraser  <simon.fraser@apple.com>
1345
1346         REGRESSION (r249091): Can't click on a video in the second column of a paginated web view
1347         https://bugs.webkit.org/show_bug.cgi?id=211973
1348         <rdar://problem/61418775>
1349
1350         Reviewed by Zalan Bujtas.
1351
1352         In r249091 I made clip layer computation use offsetFromAncestor() by default, but this turns
1353         out to give different behavior from mapping via renderers in columns.
1354
1355         The bug was that accumulateOffsetTowardsAncestor() would map through the
1356         RenderMultiColumnFlow columns if the ancestorLayer was the one that was using columns,
1357         but mapping via renderers only maps through columns if converting to some ancestor of
1358         the columnated renderer.
1359
1360         I did not investigate why this only affects video.
1361
1362         Test: fast/multicol/clipped-video-in-second-column.html
1363
1364         * rendering/RenderLayer.cpp:
1365         (WebCore::accumulateOffsetTowardsAncestor):
1366         (WebCore::RenderLayer::calculateClipRects const):
1367
1368 2020-05-15  Kenneth Russell  <kbr@chromium.org>
1369
1370         OES_texture_float internal format conversion must depend on WEBGL_color_buffer_float
1371         https://bugs.webkit.org/show_bug.cgi?id=211971
1372
1373         Reviewed by Dean Jackson.
1374
1375         Only adjust the internal formats of textures created for the WebGL
1376         1.0 OES_texture_float extension if the WEBGL_color_buffer_float
1377         extension has been enabled.
1378
1379         Covered by the WebGL 1.0 OES_texture_float conformance tests when
1380         run on iOS with another forthcoming fix to ANGLE which will enable
1381         the OES_texture_float extension on that platform.
1382
1383         * platform/graphics/angle/ExtensionsGLANGLE.cpp:
1384         (WebCore::ExtensionsGLANGLE::ensureEnabled):
1385         (WebCore::ExtensionsGLANGLE::adjustWebGL1TextureInternalFormat):
1386         * platform/graphics/angle/ExtensionsGLANGLE.h:
1387         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
1388         (WebCore::GraphicsContextGLOpenGL::texImage2DDirect):
1389
1390 2020-05-15  Oriol Brufau  <obrufau@igalia.com>
1391
1392         [css-grid] Treat percentages as auto for the minimum contribution
1393         https://bugs.webkit.org/show_bug.cgi?id=195967
1394
1395         Reviewed by Manuel Rego Casasnovas.
1396
1397         The minimum contribution of a grid item is the outer size resulting from
1398         the minimum size if the computed preferred size behaves as auto, or the
1399         min-content contribution otherwise.
1400
1401         If the preferred size is a percentage, it should be resolved with
1402         respect to the grid area, which depends on the minimum contribution
1403         of the item. Thus the percentage is cyclic and behaves as auto.
1404
1405         Before this change, WebKit only checked whether the preferred size is
1406         auto, not whether it behaves as auto. In fact this was according to
1407         an older version of the spec, but it was changed in
1408         https://github.com/w3c/csswg-drafts/issues/2367
1409
1410         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html
1411
1412         Some cases in the test still fail due to bug 209461.
1413
1414         * rendering/GridTrackSizingAlgorithm.cpp:
1415         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1416
1417 2020-05-15  Antoine Quint  <graouts@apple.com>
1418
1419         [Web Animations] Animation with a single keyframe is not accelerated
1420         https://bugs.webkit.org/show_bug.cgi?id=188730
1421         <rdar://problem/43481113>
1422
1423         Reviewed by Dean Jackson.
1424
1425         Test: webanimations/accelerated-animation-single-keyframe.html
1426
1427         Prior to attempting to run an accelerated effect, ensure that the KeyframeList passed to
1428         RenderLayerModelObject::startAnimation() does not have implicit keyframes since eventually
1429         GraphicsLayerCA::animationCanBeAccelerated() would be called and would reject a single-keyframe
1430         animation. To do this, we use the same code used in Style::Resolver::keyframeStylesForAnimation()
1431         which we refactor in the new KeyframeList::fillImplicitKeyframes() method.
1432
1433         * animation/KeyframeEffect.cpp:
1434         (WebCore::KeyframeEffect::copyPropertiesFromSource):
1435         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1436         * rendering/style/KeyframeList.cpp:
1437         (WebCore::KeyframeList::hasImplicitKeyframes const):
1438         (WebCore::KeyframeList::copyKeyframes):
1439         (WebCore::zeroPercentKeyframe):
1440         (WebCore::hundredPercentKeyframe):
1441         (WebCore::KeyframeList::fillImplicitKeyframes):
1442         * rendering/style/KeyframeList.h:
1443         * style/StyleResolver.cpp:
1444         (WebCore::Style::Resolver::keyframeStylesForAnimation):
1445
1446 2020-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
1447
1448         The initial value of "transform-box" should be "view-box"
1449         https://bugs.webkit.org/show_bug.cgi?id=211927
1450
1451         Reviewed by Simon Fraser.
1452
1453         Specs: https://drafts.csswg.org/css-transforms/#transform-box.
1454
1455         Test: svg/transforms/svg-transform-box-initial.html
1456
1457         * css/CSSProperties.json:
1458         * rendering/style/RenderStyle.h:
1459         (WebCore::RenderStyle::initialTransformBox):
1460
1461 2020-05-15  Andres Gonzalez  <andresg_22@apple.com>
1462
1463         Fix for crash in accessibility/mac/replace-text-with-range-on-webarea-element.html in isolated tree mode.
1464         https://bugs.webkit.org/show_bug.cgi?id=211954
1465
1466         Reviewed by Chris Fleizach.
1467
1468         Fixes crash in isolated tree mode in accessibility/mac/replace-text-with-range-on-webarea-element.html.
1469
1470         * accessibility/AXObjectCache.cpp:
1471         (WebCore::AXObjectCache::postTextStateChangeNotification): Check for null object before dereferencing.
1472         (WebCore::AXObjectCache::rootWebArea): Reverted to returning an AXObject since it is not needed to return AXCoreObject.
1473         * accessibility/AXObjectCache.h:
1474
1475 2020-05-15  Zalan Bujtas  <zalan@apple.com>
1476
1477         [LFC][TFC] Move column and row balancing logic to a dedicated class
1478         https://bugs.webkit.org/show_bug.cgi?id=211937
1479
1480         Reviewed by Antti Koivisto.
1481
1482         * Sources.txt:
1483         * WebCore.xcodeproj/project.pbxproj:
1484         * layout/tableformatting/TableFormattingContext.cpp:
1485         (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
1486         (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
1487         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace):
1488         (WebCore::Layout::ColumnSpan::hasSpan): Deleted.
1489         (WebCore::Layout::ColumnSpan::isSpanned): Deleted.
1490         (WebCore::Layout::ColumnSpan::spanCount): Deleted.
1491         (WebCore::Layout::ColumnSpan::startSpan): Deleted.
1492         (WebCore::Layout::ColumnSpan::endSpan): Deleted.
1493         (WebCore::Layout::ColumnSpan::index): Deleted.
1494         (WebCore::Layout::ColumnSpan::size): Deleted.
1495         (WebCore::Layout::ColumnSpan::spacing): Deleted.
1496         (WebCore::Layout::RowSpan::hasSpan): Deleted.
1497         (WebCore::Layout::RowSpan::isSpanned): Deleted.
1498         (WebCore::Layout::RowSpan::spanCount): Deleted.
1499         (WebCore::Layout::RowSpan::startSpan): Deleted.
1500         (WebCore::Layout::RowSpan::endSpan): Deleted.
1501         (WebCore::Layout::RowSpan::index): Deleted.
1502         (WebCore::Layout::RowSpan::size): Deleted.
1503         (WebCore::Layout::RowSpan::spacing): Deleted.
1504         (WebCore::Layout::GridSpace::isEmpty const): Deleted.
1505         (): Deleted.
1506         (WebCore::Layout::max): Deleted.
1507         (WebCore::Layout::operator-): Deleted.
1508         (WebCore::Layout::operator+=): Deleted.
1509         (WebCore::Layout::operator-=): Deleted.
1510         (WebCore::Layout::operator/): Deleted.
1511         (WebCore::Layout::distributeAvailableSpace): Deleted.
1512         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): Deleted.
1513         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): Deleted.
1514         * layout/tableformatting/TableFormattingContext.h:
1515         * layout/tableformatting/TableFormattingState.h:
1516         (WebCore::Layout::TableFormattingState::tableGrid const):
1517         * layout/tableformatting/TableGrid.h:
1518         (WebCore::Layout::TableGrid::widthConstraints const):
1519         (WebCore::Layout::TableGrid::Rows::list const):
1520         (WebCore::Layout::TableGrid::widthConstraints): Deleted.
1521         (WebCore::Layout::TableGrid::Rows::rowList const): Deleted.
1522
1523 2020-05-15  Alicia Boya García  <aboya@igalia.com>
1524
1525         [GStreamer][MediaStream] Fix missing video size
1526         https://bugs.webkit.org/show_bug.cgi?id=211938
1527
1528         Reviewed by Philippe Normand.
1529
1530         r261683 redefined m_currentVideoStreamId. Under the new design, tracks
1531         have several states:
1532
1533         - "wanted": a track has been selected from JavaScript, or chosen by
1534           default.
1535
1536         - "requested": a track that is expected to be chosen by the next
1537           STREAMS_SELECTED message.
1538
1539         - "current": a track that has been selected after the STREAMS_SELECTED
1540           message has been handled.
1541
1542         naturalSize() used to check m_currentVideoStreamId to look for the
1543         video size, but this is called relatively early before the track
1544         becomes "current" under the new design.
1545
1546         Since the size tags can't be queried at any time, it makes sense to
1547         use m_wantedVideoStreamId instead.
1548
1549         This fixes the following tests which were previously regressed:
1550
1551         fast/mediastream/get-user-media-constraints.html
1552         fast/mediastream/getUserMedia-video-rescaling.html
1553         fast/mediastream/mediastreamtrack-video-clone.html
1554         imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-firstframe.https.html
1555         fast/mediastream/media-stream-renders-first-frame.html
1556
1557         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1558         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
1559
1560 2020-05-15  Antti Koivisto  <antti@apple.com>
1561
1562         [Wheel event region] Invalidation when changing listeners on elements
1563         https://bugs.webkit.org/show_bug.cgi?id=211895
1564
1565         Reviewed by Simon Fraser.
1566
1567         Doesn't handle root (window/document) invalidation yet.
1568
1569         Test: fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html
1570
1571         * dom/EventTarget.cpp:
1572         (WebCore::EventTarget::addEventListener):
1573         (WebCore::EventTarget::removeEventListener):
1574         (WebCore::EventTarget::removeAllEventListeners):
1575
1576         Invalidate element style on wheel event changes.
1577
1578         * rendering/RenderElement.cpp:
1579         (WebCore::RenderElement::styleWillChange):
1580         * rendering/RenderLayer.cpp:
1581         (WebCore::RenderLayer::invalidateEventRegion):
1582
1583         Build on non-iOS platforms.
1584
1585         * rendering/RenderLayerBacking.cpp:
1586         (WebCore::RenderLayerBacking::maintainsEventRegion const):
1587
1588         Factor into function so it can be shared with RenderLayer::invalidateEventRegion.
1589
1590         (WebCore::RenderLayerBacking::updateEventRegion):
1591         * rendering/RenderLayerBacking.h:
1592
1593 2020-05-15  Antoine Quint  <graouts@apple.com>
1594
1595         Cursor should not update on a 20ms timer
1596         https://bugs.webkit.org/show_bug.cgi?id=211884
1597         <rdar://problem/63220368>
1598
1599         Reviewed by Simon Fraser.
1600
1601         Test: fast/events/mouse-cursor-udpate-during-raf.html
1602
1603         Update cursors after rAF callbacks have been serviced and layout has been updated.
1604
1605         * page/Page.cpp:
1606         (WebCore::Page::updateRendering):
1607         (WebCore::Page::doAfterUpdateRendering):
1608
1609 2020-05-15  Andres Gonzalez  <andresg_22@apple.com>
1610
1611         Update the isolated tree only if isolated tree mode is enabled.
1612         https://bugs.webkit.org/show_bug.cgi?id=211936
1613
1614         Reviewed by Chris Fleizach.
1615
1616         Check for isIsolatedTreeEnabled before updating the isolated tree.
1617
1618         * accessibility/AXObjectCache.cpp:
1619         (WebCore::AXObjectCache::updateIsolatedTree):
1620
1621 2020-05-15  Adrian Perez de Castro  <aperez@igalia.com>
1622
1623         [GTK3] Bring back usage of GtkMenu for context menus
1624         https://bugs.webkit.org/show_bug.cgi?id=211557
1625
1626         Reviewed by Carlos Garcia Campos.
1627
1628         No new tests needed.
1629
1630         * platform/gtk/GtkVersioning.h: Remove GtkPopover functions used only for context menus.
1631
1632 2020-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1633
1634         Unreviewed. Fix build warning after r261113
1635
1636         Remove unused variable.
1637
1638         * dom/ScriptedAnimationController.cpp:
1639         (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
1640
1641 2020-05-14  Andres Gonzalez  <andresg_22@apple.com>
1642
1643         Expose isColumnHeaderCell and isRowHeaderCell through AXCoreObject.
1644         https://bugs.webkit.org/show_bug.cgi?id=211919
1645
1646         Reviewed by Chris Fleizach.
1647
1648         Multiple tests including accessibility/crash-table-recursive-layout.html.
1649
1650         - Expose isColumn/RowHeaderCell through AXCoreObject in order to make the
1651         return value of AccessibilityTable::cellForColumnAndRow an AXCoreObject.
1652         - Implemented these methods for AXIsolatedObject.
1653         - isolatedCopy the accessibilityDescription property.
1654
1655         * accessibility/AccessibilityObject.h:
1656         * accessibility/AccessibilityObjectInterface.h:
1657         * accessibility/AccessibilityTable.cpp:
1658         (WebCore::AccessibilityTable::cellForColumnAndRow): Removed incorrect
1659         assert since children are AXCoreObjects and not necessarily AccessibilityTableCells.
1660         * accessibility/AccessibilityTable.h:
1661         * accessibility/AccessibilityTableCell.cpp:
1662         (WebCore::AccessibilityTableCell::isTableCellInSameRowGroup):
1663         (WebCore::AccessibilityTableCell::isTableCellInSameColGroup):
1664         (WebCore::AccessibilityTableCell::columnHeaders):
1665         (WebCore::AccessibilityTableCell::rowHeaders):
1666         * accessibility/AccessibilityTableCell.h:
1667         * accessibility/AccessibilityTableColumn.cpp:
1668         (WebCore::AccessibilityTableColumn::addChildren):
1669         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1670         (-[WebAccessibilityObjectWrapper accessibilityElementForRow:andColumn:]):
1671         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1672         (WebCore::AXIsolatedObject::initializeAttributeData):
1673         * accessibility/isolatedtree/AXIsolatedObject.h:
1674
1675 2020-05-14  Timothy Hatcher  <timothy@apple.com>
1676
1677         Add baseURL version of _WKUserStyleSheet forWKWebView.
1678         https://bugs.webkit.org/show_bug.cgi?id=211926
1679         rdar://problem/62074675
1680
1681         Reviewed by Devin Rousso.
1682
1683         Consolidate the paths taken for adding a UserStyleSheet. The m_injectedStyleSheetToSource
1684         was missing for page specific style sheets since it was another loop.
1685
1686         * dom/ExtensionStyleSheets.cpp:
1687         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
1688         (WebCore::ExtensionStyleSheets::injectPageSpecificUserStyleSheet):
1689         (WebCore::ExtensionStyleSheets::removePageSpecificUserStyleSheet):
1690         (WebCore::ExtensionStyleSheets::detachFromDocument):
1691         * dom/ExtensionStyleSheets.h:
1692
1693 2020-05-14  Jiewen Tan  <jiewen_tan@apple.com>
1694
1695         [WebAuthn] Relaxing signature length requirements for U2fRegister
1696         https://bugs.webkit.org/show_bug.cgi?id=209645
1697         <rdar://problem/63204591>
1698
1699         Reviewed by Brent Fulgham.
1700
1701         It turns out the length range specified from the spec, i.e., [71, 73] is wrong.
1702         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#registration-response-message-success
1703
1704         It should actually be [70, 72]. However, as a middleware to relay the messages, user agents
1705         are not necessary to check the length. Therefore, the check is relaxed to make the code more robust.
1706
1707         Covered by existing tests.
1708
1709         * Modules/webauthn/fido/U2fResponseConverter.cpp:
1710         (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
1711
1712 2020-05-14  Timothy Hatcher  <timothy@apple.com>
1713
1714         Add sourceURL to _evaluateJavaScript: so the scripts appear in Web Inspector.
1715         https://bugs.webkit.org/show_bug.cgi?id=211904
1716         rdar://problem/62074376
1717
1718         Reviewed by Devin Rousso.
1719
1720         Added sourceURL to RunJavaScriptParameters. Use it instead of the frame's document URL.
1721
1722         * bindings/js/RunJavaScriptParameters.h:
1723         (WebCore::RunJavaScriptParameters::RunJavaScriptParameters):
1724         (WebCore::RunJavaScriptParameters::encode const):
1725         (WebCore::RunJavaScriptParameters::decode):
1726         * bindings/js/ScriptController.cpp:
1727         (WebCore::ScriptController::executeScriptInWorldIgnoringException):
1728         (WebCore::ScriptController::executeScriptInWorld):
1729         (WebCore::ScriptController::callInWorld):
1730         (WebCore::ScriptController::executeUserAgentScriptInWorld):
1731
1732 2020-05-14  Eric Carlson  <eric.carlson@apple.com>
1733
1734         [Cocoa] Don't clear NowPlaying state unless it was set
1735         https://bugs.webkit.org/show_bug.cgi?id=211899
1736         <rdar://problem/62249870>
1737
1738         Reviewed by Jer Noble.
1739
1740         Test: media/now-playing-status-without-media.html
1741
1742         * platform/audio/PlatformMediaSessionManager.h:
1743         (WebCore::PlatformMediaSessionManager::haveEverRegisteredAsNowPlayingApplication const): Method
1744         added for testing.
1745
1746         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1747         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1748         (WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo): Don't clear NowPlaying state unless
1749         it was setup in the first place.
1750
1751         * testing/Internals.cpp:
1752         (WebCore::Internals::nowPlayingState const): Add new property.
1753         * testing/Internals.h:
1754         * testing/Internals.idl:
1755
1756 2020-05-14  Andres Gonzalez  <andresg_22@apple.com>
1757
1758         AXCoreObject font comparison methods should take another AXCoreObject instead of a RenderObject.
1759         https://bugs.webkit.org/show_bug.cgi?id=211909
1760
1761         Reviewed by Chris Fleizach.
1762
1763         Covered by existing tests.
1764
1765         - In order for font comparison methods to be implementted for both
1766         AXObjects and AXIsolatedObjects, they should take another AXCoreObject
1767         to compare against, instead of a RenderObject.
1768         - The AXIsolatedObject implementation of these methods is forwarded to
1769         the associated AXObject and dispatched to the main thread.
1770         - Implemented AXIsolatedObject::accessibilityDescription, hasUnderline and isUnvisited.
1771
1772         * accessibility/AccessibilityObject.cpp:
1773         (WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex):
1774         * accessibility/AccessibilityObject.h:
1775         * accessibility/AccessibilityObjectInterface.h:
1776         (WebCore::AXCoreObject::isNativeListBox const):
1777         * accessibility/AccessibilityRenderObject.cpp:
1778         (WebCore::AccessibilityRenderObject::hasSameFont const):
1779         (WebCore::AccessibilityRenderObject::hasSameFontColor const):
1780         (WebCore::AccessibilityRenderObject::hasSameStyle const):
1781         * accessibility/AccessibilityRenderObject.h:
1782         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1783         (WebCore::AXIsolatedObject::initializeAttributeData):
1784         (WebCore::AXIsolatedObject::hasSameFont const):
1785         (WebCore::AXIsolatedObject::hasSameFontColor const):
1786         (WebCore::AXIsolatedObject::hasSameStyle const):
1787         (WebCore::AXIsolatedObject::isNativeListBox const): Deleted, implemented in base class.
1788         (WebCore::AXIsolatedObject::isUnvisited const): Deleted, inlined in header.
1789         (WebCore::AXIsolatedObject::hasUnderline const): Deleted, inlined in header.
1790         (WebCore::AXIsolatedObject::accessibilityDescription const): Deleted, inlined in header.
1791         * accessibility/isolatedtree/AXIsolatedObject.h:
1792
1793 2020-05-14  Nikita Vasilyev  <nvasilyev@apple.com>
1794
1795         Web Inspector: front-end shouldn't change the order of User Style Sheet rules
1796         https://bugs.webkit.org/show_bug.cgi?id=210893
1797         <rdar://problem/61937118>
1798
1799         Reviewed by Devin Rousso.
1800
1801         Previously, some style sheets were falsly detected as Inspector::Protocol::CSS::StyleSheetOrigin::User
1802         causing incorrect order of style rules in Web Inspector.
1803
1804         Test: inspector/css/getMatchedStylesForNode.html
1805
1806         * inspector/agents/InspectorCSSAgent.cpp:
1807         (WebCore::InspectorCSSAgent::detectOrigin):
1808
1809 2020-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1810
1811         [macOS] Update the placeholder icon image for attachment elements with progress="0"
1812         https://bugs.webkit.org/show_bug.cgi?id=211898
1813         <rdar://problem/63203900>
1814
1815         Reviewed by Timothy Hatcher.
1816
1817         Refactor logic for creating an attachment placeholder image into a separate helper method, with a
1818         WebKitAdditions implementation when HAVE(SYSTEM_ATTACHMENT_PLACEHOLDER_ICON) is defined.
1819
1820         * rendering/RenderThemeMac.mm:
1821         (WebCore::createAttachmentPlaceholderImage):
1822         (WebCore::paintAttachmentIconPlaceholder):
1823
1824 2020-05-14  Chris Dumez  <cdumez@apple.com>
1825
1826         Regression(r254856) Family Health iOS app is broken due to lack for WebSQL support
1827         https://bugs.webkit.org/show_bug.cgi?id=211896
1828         <rdar://problem/63025045>
1829
1830         Reviewed by Maciej Stachowiak.
1831
1832         Add RuntimeApplicationChecks function to identify Family Health app on iOS.
1833
1834         * platform/RuntimeApplicationChecks.h:
1835         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1836         (WebCore::IOSApplication::isFamilyHealthApp):
1837
1838 2020-05-14  Andres Gonzalez  <andresg_22@apple.com>
1839
1840         AXIsolatedTree::updateChildren needs to apply pending changes before updating the given node.
1841         https://bugs.webkit.org/show_bug.cgi?id=211790
1842
1843         Reviewed by Chris Fleizach.
1844
1845         Covered by multiple tests.
1846
1847         AXIsolatedTree::updateChildren may be fired for an isolated object that
1848         is still in the pending changes list, and thus nodeForID would fail,
1849         causing the isolated tree to not be updated. This patch calls
1850         applyPendingChanges before updating the given node's children.
1851         Additional logging was added including the logging of the AXObjectCache
1852         object hierarchy.
1853
1854         * accessibility/AXLogger.cpp:
1855         (WebCore::AXLogger::log):
1856         (WebCore::operator<<):
1857         * accessibility/AXLogger.h:
1858         * accessibility/AXObjectCache.cpp:
1859         (WebCore::AXObjectCache::remove):
1860         (WebCore::AXObjectCache::postNotification):
1861         (WebCore::AXObjectCache::performDeferredCacheUpdate):
1862         (WebCore::AXObjectCache::updateIsolatedTree):
1863         * accessibility/AXObjectCache.h:
1864         * accessibility/isolatedtree/AXIsolatedTree.cpp:
1865         (WebCore::AXIsolatedTree::updateNode):
1866         (WebCore::AXIsolatedTree::updateSubtree):
1867         (WebCore::AXIsolatedTree::updateChildren):
1868         (WebCore::AXIsolatedTree::focusedNode):
1869         (WebCore::AXIsolatedTree::removeNode):
1870         (WebCore::AXIsolatedTree::removeSubtree):
1871         (WebCore::AXIsolatedTree::applyPendingChanges):
1872         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1873         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1874
1875 2020-05-14  Andres Gonzalez  <andresg_22@apple.com>
1876
1877         Fix for crash in LayoutTest in isolated tree mode.
1878         https://bugs.webkit.org/show_bug.cgi?id=211894
1879
1880         Reviewed by Chris Fleizach.
1881
1882         Several LayoutTests.
1883
1884         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1885         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): Check backing object for nullity before dereferencing.
1886
1887 2020-05-14  Andres Gonzalez  <andresg_22@apple.com>
1888
1889         AXIsolatedObject::isOnScreen needs to be dispatched to the main thread.
1890         https://bugs.webkit.org/show_bug.cgi?id=211893
1891
1892         Reviewed by Chris Fleizach.
1893
1894         Covered by existing tests.
1895
1896         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1897         (WebCore::AXIsolatedObject::children): Split assert into two lines for readability.
1898         (WebCore::AXIsolatedObject::isOnScreen const): Forward to associated AXObject and dispatch to the main thread.
1899
1900 2020-05-14  Andres Gonzalez  <andresg_22@apple.com>
1901
1902         Implementation of AXIsolatedObject::hasPlainText.
1903         https://bugs.webkit.org/show_bug.cgi?id=211892
1904
1905         Reviewed by Chris Fleizach.
1906
1907         Covered by existing tests.
1908
1909         Adding hasPlainText to the cached properties map.
1910
1911         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1912         (WebCore::AXIsolatedObject::initializeAttributeData):
1913         (WebCore::AXIsolatedObject::hasPlainText const): Deleted, inlined in header.
1914         * accessibility/isolatedtree/AXIsolatedObject.h:
1915
1916 2020-05-14  Sergio Villar Senin  <svillar@igalia.com>
1917
1918         Unreviewed build fix.
1919
1920         * html/HTMLCanvasElement.cpp:
1921         (WebCore::HTMLCanvasElement::createContextWebGL): downcast m_context to
1922         WebGLRenderingContextBase before calling isXRCompatible(). It's created
1923         as a WebGLRenderingContextBase but stored in a CanvasRenderingContext.
1924
1925 2020-05-14  Andres Gonzalez  <andresg_22@apple.com>
1926
1927         Replacing and inserting text need to be dispatched to the main thread.
1928         https://bugs.webkit.org/show_bug.cgi?id=211863
1929
1930         Reviewed by Chris Fleizach.
1931
1932         Covered by existing tests.
1933
1934         In isolated tree mode WebAccessibilityObjectWrapper accessibilityReplaceRange
1935         and InsertText may be called on the secondary thread. Thus the AXIsolatedObject
1936         implementation of this functionality needs to forward these calls to the
1937         associated AXObject on the main thread.
1938
1939         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1940         (WebCore::AXIsolatedObject::replaceTextInRange):
1941         (WebCore::AXIsolatedObject::insertText):
1942         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1943         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
1944         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1945
1946 2020-05-14  Antoine Quint  <graouts@apple.com>
1947
1948         Cursor should not update on a 20ms timer
1949         https://bugs.webkit.org/show_bug.cgi?id=211884
1950         <rdar://problem/63220368>
1951
1952         Reviewed by Antti Koivisto.
1953
1954         Update the cursor during page rendering rather than using a 20ms timer.
1955
1956         * page/EventHandler.cpp:
1957         (WebCore::EventHandler::EventHandler):
1958         (WebCore::EventHandler::clear):
1959         (WebCore::EventHandler::updateCursorIfNeeded):
1960         (WebCore::EventHandler::handleMouseMoveEvent):
1961         (WebCore::EventHandler::scheduleCursorUpdate):
1962         (WebCore::EventHandler::cursorUpdateTimerFired): Deleted.
1963         * page/EventHandler.h:
1964         * page/Page.cpp:
1965         (WebCore::Page::updateRendering):
1966
1967 2020-05-14  Philippe Normand  <pnormand@igalia.com>
1968
1969         [GStreamer] webrtc/disable-encryption.html is a crashing flaky
1970         https://bugs.webkit.org/show_bug.cgi?id=211166
1971
1972         Reviewed by Xabier Rodriguez-Calvar.
1973
1974         Make sure the audio and video mediastream source elements are correctly removed and disposed
1975         from their parent bin when resetting the track sources. Before this change there was a
1976         possibility of disposing the elements while they were still in PLAYING state.
1977
1978         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
1979         (WebCore::_WebKitMediaStreamSrc::SourceData::reset):
1980         (WebCore::webkitMediaStreamSrcDispose):
1981         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
1982
1983 2020-05-14  Adrian Perez de Castro  <aperez@igalia.com>
1984
1985         Non-unified build fixed, mid May 2020 edition
1986         https://bugs.webkit.org/show_bug.cgi?id=211859
1987
1988         Unreviewed build.
1989
1990         No new tests needed.
1991
1992         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Add missing IDBBindingUtilities.h and
1993         IDBSerializationContext.h includes.
1994         * accessibility/AccessibilityRenderObject.cpp: Add missing EventHandler.h include.
1995         * css/parser/CSSParserToken.cpp: Add missing RuntimeEnabledFeatures.h include.
1996         * editing/gtk/WebContentReaderGtk.cpp: Add missing Blob.h include.
1997         * html/canvas/OESTextureHalfFloat.cpp: Add missing ExtensionsGL.h include.
1998         * page/ShareDataReader.h: Add missing ExceptionOr.h include.
1999         * rendering/ContentfulPaintChecker.cpp: Add missing RenderView.h include.
2000         * rendering/style/StyleRareInheritedData.h: Add missing RenderStyleConstants.h and
2001         wtf/OptionSet.h includes.
2002         * rendering/style/StyleRareNonInheritedData.h: Add missing TouchAction.h and wtf/OptionSet.h
2003         includes.
2004         * style/StyleAdjuster.h: Add missing RenderStyleConstants.h include and forward declaration
2005         for WebCore::EventTarget.
2006
2007 2020-05-14  Alicia Boya García  <aboya@igalia.com>
2008
2009         [GStreamer] Playbin3 track switch rework
2010         https://bugs.webkit.org/show_bug.cgi?id=211623
2011
2012         Reviewed by Philippe Normand.
2013
2014         This patch reworks how track selection and reporting of selected
2015         tracks is done in the player.
2016
2017         The following found limitations and assumptions in current GStreamer
2018         have informed this patch:
2019
2020         a) Although the API for playbin3 is designed to be able to accept any
2021         number of tracks of any kind, this is not supported in practice.
2022
2023         b) The first track of each type is always selected. Even in playbin3
2024         mode, looking for GST_STREAM_FLAG_SELECT is not a reliable method, as
2025         in most cases the demuxer does not set it at all. [qtdemux never sets
2026         it at all, and matroskademux only sets it in certain cases.]
2027
2028         c) Sending GST_EVENT_SELECT_STREAMS is only safe at certain moments.
2029         It's not safe before pre-roll, after EOS or during the handling of
2030         another SELECT_STREAMS.
2031
2032         d) Selecting text tracks with playbin APIs is not relevant. All text
2033         tracks are already being picked by WebKitTextCombiner, unaffected by
2034         playbin track selection.
2035
2036         e) Tracks requested in a GST_EVENT_SELECT_STREAMS are eventually
2037         selected. On the other hand,  looking at
2038         GST_MESSAGE_STREAMS_SELECTED's content is not reliable, as this has
2039         been seen to miss tracks depending on thread luck.
2040
2041         This patch takes the points above into account to rework how track
2042         selection is handled in MediaPlayerPrivateGStreamer and fix the
2043         following issues:
2044
2045         1) In playbin3 mode, no track was marked as selected initially,
2046         because of reliance on GST_STREAM_FLAG_SELECT.
2047
2048         2) In playbin2 mode, sometimes tracks would not be initially marked as
2049         selected. This occurred because of reliance on the "selected" property
2050         in inputselector sinkpads, whose initialization is racy -- it can
2051         occur after the track has been added and picked up by WebKit.
2052
2053         3) In playbin3 mode, the limitations explained before has been honored
2054         to make track selection stable, delaying SELECT_STREAMS events until
2055         they are safe to send.
2056
2057         This patch doesn't introduce significative behavior changes, rather
2058         aiming for improving the stabilitity of the player. Existing tests
2059         should provide enough coverage.
2060
2061         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
2062         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
2063         (WebCore::AudioTrackPrivateGStreamer::setEnabled):
2064         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2065         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2066         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2067         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2068         (WebCore::MediaPlayerPrivateGStreamer::updateEnabledVideoTrack):
2069         (WebCore::MediaPlayerPrivateGStreamer::updateEnabledAudioTrack):
2070         (WebCore::MediaPlayerPrivateGStreamer::playbin3SendSelectStreamsIfAppropriate):
2071         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
2072         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
2073         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2074         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
2075         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2076         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2077         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
2078         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2079         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
2080         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
2081         (WebCore::VideoTrackPrivateGStreamer::setSelected):
2082         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2083
2084 2020-05-14  Philippe Normand  <pnormand@igalia.com>
2085
2086         [GStreamer] Can't replay blob videos in web.whatsapp.com
2087         https://bugs.webkit.org/show_bug.cgi?id=192540
2088
2089         Reviewed by Xabier Rodriguez-Calvar.
2090
2091         This is a variant of bug 211627 but I could reproduce it only for videos. Unfortunately I
2092         wasn't able to write a reliable test for this.
2093
2094         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2095         (WebCore::MediaPlayerPrivateGStreamer::updateBufferingStatus): Prevent the fill timer from
2096         running forever after buffering completed.
2097         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2098         (webKitWebSrcMakeRequest): Don't buffer blobs, this doesn't seem useful as they're already
2099         in memory anyway.
2100
2101 2020-05-06  Sergio Villar Senin  <svillar@igalia.com>
2102
2103         [WebXR] Implement WebGLRenderingContextBase::makeXRCompatible()
2104         https://bugs.webkit.org/show_bug.cgi?id=211506
2105
2106         Reviewed by Youenn Fablet.
2107
2108         The WebXR spec defines a way to mark a WebGLRenderingContext as
2109         compatible with WebXR. This can be made at creation time (by setting the
2110         xrCompatible) attribute or by calling makeXRCompatible().
2111
2112         There are several web-platform-tests testing/using this feature, however we
2113         cannot enable them right now as we need some other features to be implemented
2114         first.
2115
2116         * Modules/webxr/NavigatorWebXR.cpp:
2117         (WebCore::NavigatorWebXR::xr): Do not pass ScriptExecutionContext and use
2118         the Navigator's instead.
2119         * Modules/webxr/NavigatorWebXR.h: Ditto.
2120         * Modules/webxr/NavigatorWebXR.idl: Ditto.
2121         * Modules/webxr/WebXRSystem.h: expose ensureImmersiveXRDeviceIsSelected() and
2122         hasActiveImmersiveXRDevice() to be used from canvas and the rendering context.
2123         * html/HTMLCanvasElement.cpp:
2124         (WebCore::HTMLCanvasElement::createContextWebGL): call
2125         ensureImmersiveXRDeviceIsSelected() if xrCompatible is set.
2126         * html/canvas/WebGLContextAttributes.idl: Added xrCompatible.
2127         * html/canvas/WebGLRenderingContextBase.cpp:
2128         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2129         Initialize m_isXRCompatible.
2130         (WebCore::WebGLRenderingContextBase::makeXRCompatible): Implemented.
2131         * html/canvas/WebGLRenderingContextBase.h: Defined makeXRCompatible().
2132         * html/canvas/WebGLRenderingContextBase.idl: Added makeXRCompatible().
2133         * platform/graphics/GraphicsContextGLAttributes.h: Added xrCompatible.
2134         * testing/Internals.cpp:
2135         (WebCore::Internals::xrTest): Simplified the usage of NavigatorWebXR.
2136
2137 2020-05-13  Zalan Bujtas  <zalan@apple.com>
2138
2139         [LFC][TFC] Add support for cases when the balancing is not based on the initial width
2140         https://bugs.webkit.org/show_bug.cgi?id=211878
2141
2142         Reviewed by Antti Koivisto.
2143
2144         This patch adds support for the cases when the table stretches all the way to the maximum content size,
2145         and we still choose the minimum width as the initial width and the maximum width as the base for balancing the extra space.
2146
2147         Consider the following 2 tables:
2148
2149         <table>
2150           <tr><td style="width: 20px"></td><td>some long long long content</td></tr>
2151           <tr><td style="width: 20px"></td><td>22px width content</td></tr>
2152         </table>
2153
2154         <table>
2155           <tr><td style="width: 20px"></td><td>some long long long content</td></tr>
2156           <tr><td style="width: 20px"></td><td id=fixed_width style="width: 22px;">22px width content</td></tr>
2157         </table>
2158
2159         These tables have the same maximum widths and they both stretch to that size. 
2160         However the second table will end up with a wider first and narrower second column because of the
2161         width property on the [fixed_width] cell.
2162         While the first table applies the maximum width for each columns, the second table uses the minimum width as the
2163         initial width and balances the extra space using the maximum width (as the distribution ratio).
2164         This produces a very different layout where the first table has no line wrapping, while
2165         the second table wraps the "some long long long content" text (even though the used max widths are the same for each cells).
2166
2167         Test: fast/layoutformattingcontext/table-fixed-width-with-max-distribution.html
2168
2169         * layout/tableformatting/TableFormattingContext.cpp:
2170         (WebCore::Layout::ColumnSpan::spacing):
2171         (WebCore::Layout::RowSpan::spacing):
2172         (WebCore::Layout::distributeAvailableSpace):
2173         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
2174         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2175
2176 2020-05-13  Zalan Bujtas  <zalan@apple.com>
2177
2178         Do not clear selection/repaint when the renderer gets moved during tree normalization.
2179         https://bugs.webkit.org/show_bug.cgi?id=211865
2180         <rdar://problem/62849044>
2181
2182         Reviewed by Antti Koivisto.
2183
2184         While detachFromRenderElement should really be about "this renderer is being detached from its parent", some code in here assumes
2185         the renderer is not only going to be detached but also going to be destroyed. Ideally such code should live in RenderObject::willBeDestroyed(),
2186         but no tree walk is possible in there anymore.
2187
2188         The reason for the crash is that when we split the inline for continuation, we construct new anonymous containers and move subtrees over
2189         to these new renderers. However at this point these new parent containers are not yet attached to the tree
2190         so any tree-walking cleanup code will fail (in detachFromRenderElement).
2191
2192         Test: fast/repaint/do-no-repaint-on-internal-move.html
2193
2194         * rendering/updating/RenderTreeBuilder.cpp:
2195         (WebCore::RenderTreeBuilder::detachFromRenderElement):
2196         * rendering/updating/RenderTreeBuilder.h:
2197         * rendering/updating/RenderTreeBuilderInline.cpp:
2198         (WebCore::RenderTreeBuilder::Inline::splitInlines):
2199
2200 2020-05-13  Devin Rousso  <drousso@apple.com>
2201
2202         Web Inspector: show EventTarget listeners as an internal property
2203         https://bugs.webkit.org/show_bug.cgi?id=211766
2204
2205         Reviewed by Timothy Hatcher.
2206
2207         Test: inspector/runtime/getProperties-internalProperties.html
2208
2209         Add a `listeners` internal property for `EventTarget` objects with the value
2210         ```
2211             listeners: {
2212                 <event>: [
2213                     {
2214                         callback: <function>
2215                         capture: <boolean>
2216                         passive: <boolean>
2217                         once: <boolean>
2218                     }
2219                     ...
2220                 ]
2221                 ...
2222             }
2223         ```
2224         so long as at least one `JSEventListener` has been added prior to that point.
2225
2226         * inspector/WebInjectedScriptHost.cpp:
2227         (WebCore::objectForEventTargetListeners): Added.
2228         (WebCore::WebInjectedScriptHost::getInternalProperties):
2229         Drive-by: only add the `name` internal property if the `Worker` actually has a name.
2230
2231 2020-05-13  Devin Rousso  <drousso@apple.com>
2232
2233         Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec
2234         https://bugs.webkit.org/show_bug.cgi?id=211827
2235
2236         Reviewed by Timothy Hatcher.
2237
2238         Tests: inspector/css/add-rule.html
2239                inspector/css/getMatchedStylesForNode.html
2240
2241         * inspector/agents/InspectorCSSAgent.cpp:
2242         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
2243         (WebCore::InspectorCSSAgent::detectOrigin):
2244         * inspector/InspectorStyleSheet.cpp:
2245         (WebCore::InspectorStyleSheet::buildObjectForRule):
2246
2247 2020-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
2248
2249         JSDOMWindowBase m_windowCloseWatchpoints must be Ref<>
2250         https://bugs.webkit.org/show_bug.cgi?id=211844
2251
2252         Reviewed by Mark Lam.
2253
2254         JSDOMWindowBase::m_windowCloseWatchpoints is WatchpointSet, not Ref<WatchpointSet>. And it is passed to JSC IC layer via PropertySlot::setWatchpoint(...).
2255         And ProxyableAccessCase can hold it as `RefPtr<WatchpointSet> m_additionalSet;`, this is wrong.
2256
2257         This patch hides WatchpointSet constructor behind `protected` to disallow non Ref<> WatchpointSet construction. We made it `protected` since InferredValueWatchpointSet
2258         inherits WatchpointSet and uses this constructor.
2259
2260         Possibly, this does not matter: ProxyableAccessCase keeps Structure, which points to JSDOMWindowBase. So, it would not happen that ProxyableAccessCase has a wrong pointer
2261         to WatchpointSet since JSDOMWindowBase is kept alive anyway. But avoid using RefCounted objects without RefCount allocation is better since this can cause bugs easily.
2262
2263         * bindings/js/JSDOMWindowBase.cpp:
2264         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
2265         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
2266         * bindings/js/JSDOMWindowBase.h:
2267         * bindings/js/JSDOMWindowCustom.cpp:
2268         (WebCore::JSDOMWindow::getOwnPropertySlot):
2269
2270 2020-05-13  Jack Lee  <shihchieh_lee@apple.com>
2271
2272         Nullptr crash in InsertParagraphSeparatorCommand::doApply when the canonical position is uneditable
2273         https://bugs.webkit.org/show_bug.cgi?id=211864
2274         <rdar://problem/62982161>
2275
2276         Reviewed by Geoffrey Garen.
2277
2278         The position returned by positionAvoidingSpecialElementBoundary() is uneditable so we need to 
2279         check for uneditable insertion position and bail out before calling insertNodeAt to avoid assertion.
2280
2281         Test: editing/inserting/insert-img-uneditable-canonical-position-crash.html
2282
2283         * editing/InsertParagraphSeparatorCommand.cpp:
2284         (WebCore::InsertParagraphSeparatorCommand::doApply):
2285
2286 2020-05-13  Jack Lee  <shihchieh_lee@apple.com>
2287
2288         Nullptr crash in DeleteSelectionCommand::doApply() when merge node is disconnected.
2289         https://bugs.webkit.org/show_bug.cgi?id=211793
2290         <rdar://problem/62993645>
2291
2292         Reviewed by Geoffrey Garen.
2293
2294         Check for disconnected merge destination and endingSelection() after mergeParagraph is
2295         Called and bail out to avoid using corrupted positions for node insertion.
2296
2297         Test: editing/inserting/insert-text-merge-node-removed-crash.html
2298
2299         * editing/CompositeEditCommand.cpp:
2300         (WebCore::CompositeEditCommand::moveParagraphs):
2301         * editing/DeleteSelectionCommand.cpp:
2302         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2303
2304 2020-05-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2305
2306         Re-enable 'OutsideViewport' rAF throttling
2307         https://bugs.webkit.org/show_bug.cgi?id=211482
2308
2309         Reviewed by Darin Adler.
2310
2311         Test: fast/animation/request-animation-frame-throttling-outside-viewport.html
2312
2313         Make preferredFrameInterval return AggressiveThrottlingAnimationInterval
2314         if the OutsideViewport throttling reason exists.
2315
2316         Add an internal setting for enabling 'OutsideViewport' rAF throttling. It
2317         is on by default but it is off by default for DRT and WTR. An Internals
2318         API is added to enable it for specific tests which want to test its
2319         functionality.
2320
2321         * page/FrameView.cpp:
2322         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2323         * page/Page.cpp:
2324         (WebCore::Page::setOutsideViewportThrottlingEnabledForTesting):
2325         * page/Page.h:
2326         (WebCore::Page::canUpdateThrottlingReason const):
2327         * platform/graphics/AnimationFrameRate.h:
2328         (WebCore::preferredFrameInterval):
2329         (WebCore::operator<<):
2330         * testing/Internals.cpp:
2331         (WebCore::Internals::resetToConsistentState):
2332         (WebCore::Internals::setOutsideViewportThrottlingEnabled):
2333         * testing/Internals.h:
2334         * testing/Internals.idl:
2335
2336 2020-05-13  Andres Gonzalez  <andresg_22@apple.com>
2337
2338         Remove unnecessary assert in {WebAccessibilityObjectWrapper attachmentView].
2339         https://bugs.webkit.org/show_bug.cgi?id=211857
2340
2341         Reviewed by Chris Fleizach.
2342
2343         This assert is unnecessary since the backing object that is relevant is
2344         the one on the main thread. This was causing crashes in LayoutTest in
2345         isolated tree mode.
2346
2347         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2348         (-[WebAccessibilityObjectWrapper attachmentView]):
2349
2350 2020-05-13  Jer Noble  <jer.noble@apple.com>
2351
2352         Replace isNullFunctionPointer with real weak-linking support
2353         https://bugs.webkit.org/show_bug.cgi?id=211751
2354
2355         Reviewed by Sam Weinig.
2356
2357         Use the new WTF_WEAK_LINK_FORCE_IMPORT macro.
2358
2359         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2360         (WebCore::LibWebRTCProvider::webRTCAvailable):
2361
2362 2020-05-13  Andres Gonzalez  <andresg_22@apple.com>
2363
2364         Implementation of AXIsolatedObject::hasBoldFont and hasItalicFont.
2365         https://bugs.webkit.org/show_bug.cgi?id=211858
2366
2367         Reviewed by Chris Fleizach.
2368
2369         Added hasBoldFont and hasItalicFont to the cached properties map.
2370
2371         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2372         (WebCore::AXIsolatedObject::initializeAttributeData): Added properties to cache.
2373         (WebCore::AXIsolatedObject::hasBoldFont const): Deleted. Inlined in header.
2374         (WebCore::AXIsolatedObject::hasItalicFont const): Deleted. Inlined in header.
2375         * accessibility/isolatedtree/AXIsolatedObject.h:
2376
2377 2020-05-13  Tim Horton  <timothy_horton@apple.com>
2378
2379         Add SPI for reverting to touch events for iPad trackpad interactions
2380         https://bugs.webkit.org/show_bug.cgi?id=211824
2381         <rdar://problem/61363084>
2382
2383         Reviewed by Megan Gardner.
2384
2385         * loader/DocumentLoader.h:
2386         (WebCore::DocumentLoader::mouseEventPolicy const):
2387         (WebCore::DocumentLoader::setMouseEventPolicy):
2388
2389 2020-05-13  Kenneth Russell  <kbr@chromium.org>
2390
2391         Bad flicker on three.js example
2392         https://bugs.webkit.org/show_bug.cgi?id=183151
2393
2394         Reviewed by Dean Jackson.
2395
2396         With preserveDrawingBuffer:true and antialias:false, allocate an
2397         intermediate texture and FBO, and blit from it to the destination
2398         texture in prepareTexture(). Use wipeAlphaChannelFromPixels on iOS
2399         as well as macOS.
2400
2401         In addition to fixing the test case from the bug, this also fixes
2402         the webgl/2.0.0/conformance2/textures/webgl_canvas/ layout tests,
2403         which will be re-enabled in a subsequent patch. It also passes the
2404         more stringent webgl_canvas conformance tests in
2405         https://github.com/KhronosGroup/WebGL/pull/3071 .
2406
2407         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
2408         (WebCore::GraphicsContextGLOpenGL::readPixelsAndConvertToBGRAIfNecessary):
2409         (WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
2410         (WebCore::GraphicsContextGLOpenGL::resolveMultisamplingIfNecessary):
2411         (WebCore::GraphicsContextGLOpenGL::readPixels):
2412         (WebCore::GraphicsContextGLOpenGL::validateDepthStencil):
2413         (WebCore::GraphicsContextGLOpenGL::prepareTexture):
2414         (WebCore::GraphicsContextGLOpenGL::reshape):
2415         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
2416         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
2417         (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
2418         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2419
2420 2020-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2421
2422         [iOS] "Copy" context menu action for attachment element does not work in Mail
2423         https://bugs.webkit.org/show_bug.cgi?id=211817
2424         <rdar://problem/58043110>
2425
2426         Reviewed by Tim Horton.
2427
2428         Minor refactoring to help support writing attachment data to the pasteboard when using context menu actions to
2429         copy an attachment element on iOS. See below for more details, as well as the WebKit ChangeLog entry.
2430
2431         Test: WKAttachmentTestsIOS.CopyAttachmentUsingElementAction
2432
2433         * editing/Editor.cpp:
2434         (WebCore::Editor::platformContentTypeForBlobType const):
2435         (WebCore::Editor::promisedAttachmentInfo):
2436
2437         Move promisedAttachmentInfo out of DragController and into Editor, so that it is accessible outside of drag
2438         and drop code.
2439
2440         * editing/Editor.h:
2441         * editing/cocoa/EditorCocoa.mm:
2442         (WebCore::Editor::platformContentTypeForBlobType const):
2443
2444         Move this private helper function out of DragController as well, and into Editor.
2445
2446         * page/DragClient.h:
2447         * page/DragController.cpp:
2448         (WebCore::DragController::startDrag):
2449
2450         Refactor this to use Editor::promisedAttachmentInfo().
2451
2452         (WebCore::DragController::platformContentTypeForBlobType const): Deleted.
2453         (WebCore::DragController::promisedAttachmentInfo): Deleted.
2454         * page/DragController.h:
2455         * page/mac/DragControllerMac.mm:
2456         (WebCore::DragController::platformContentTypeForBlobType const): Deleted.
2457
2458 2020-05-13  Antoine Quint  <graouts@apple.com>
2459
2460         [Web Animations] Calling reverse() on an accelerated animation has no effect
2461         https://bugs.webkit.org/show_bug.cgi?id=204717
2462         <rdar://problem/62503582>
2463
2464         Reviewed by Dean Jackson.
2465
2466         Test: webanimations/accelerated-animation-playback-rate.html
2467
2468         We completely ignored the playbackRate set on a WebAnimation object when considering whether we could run an accelerated animation.
2469         To address this we do several things.
2470
2471         First, we now add a playbackRate() on Animation objects such that we can make GraphicsLayerCA aware of the originating WebAnimation's
2472         playback rate and use this data to opt out of running CA animations for animations with a playbackRate other than 1 in
2473         GraphicsLayerCA::animationCanBeAccelerated(). We'll be looking to add support for variable playback rates for CA animations in
2474         https://bugs.webkit.org/show_bug.cgi?id=211839.
2475
2476         Then, we make sure to completely replace an accelerated animation whenever one of the properties affected timing would change. Up until
2477         now we would onyl do this for a change in the effective currentTime, but this needs to also happen when the current time doesn't change
2478         but the animation may have changed playback rate or any of its timing properties that could change the duration of the animation. So we
2479         remove the "Seek" command and instead use an "UpdateTiming" command that will remove the existing animation and add a new one.
2480
2481         This allows us to remove any notion of seeking in GraphicsLayer since now we'll just create a new animation when its timing attributes
2482         changed.
2483
2484         This revealed an issue where if we called animationFinished() and startAnimation() on a RenderLayerModelObject in succession, theanimation
2485         removal would not occur on the GraphicsLayerCA because we disregarded any pending accelerated action for an animation we knew would be
2486         replaced. We now ensure we honor the removal in GraphicsLayerCA::appendToUncommittedAnimations().
2487
2488         * animation/AnimationEffect.cpp:
2489         (WebCore::AnimationEffect::updateTiming):
2490         * animation/AnimationEffect.h:
2491         * animation/CSSAnimation.cpp:
2492         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
2493         * animation/KeyframeEffect.cpp:
2494         (WebCore::KeyframeEffect::addPendingAcceleratedAction):
2495         (WebCore::KeyframeEffect::animationDidChangeTimingProperties):
2496         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
2497         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
2498         (WebCore::KeyframeEffect::animationDidSeek): Deleted.
2499         * animation/KeyframeEffect.h:
2500         * animation/WebAnimation.cpp:
2501         (WebCore::WebAnimation::effectTimingDidChange):
2502         (WebCore::WebAnimation::setCurrentTime):
2503         (WebCore::WebAnimation::setPlaybackRate):
2504         (WebCore::WebAnimation::updatePlaybackRate):
2505         (WebCore::WebAnimation::reverse):
2506         * animation/WebAnimation.h:
2507         * platform/animation/Animation.h:
2508         (WebCore::Animation::playbackRate const):
2509         (WebCore::Animation::setPlaybackRate):
2510         * platform/graphics/GraphicsLayer.h:
2511         (WebCore::GraphicsLayer::pauseAnimation):
2512         (WebCore::GraphicsLayer::seekAnimation): Deleted.
2513         * platform/graphics/ca/GraphicsLayerCA.cpp:
2514         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2515         (WebCore::GraphicsLayerCA::updateAnimations):
2516         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
2517         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2518         (WebCore::GraphicsLayerCA::seekAnimation): Deleted.
2519         (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Deleted.
2520         * platform/graphics/ca/GraphicsLayerCA.h:
2521         * rendering/RenderElement.h:
2522         (WebCore::RenderElement::animationPaused):
2523         (WebCore::RenderElement::animationSeeked): Deleted.
2524         * rendering/RenderLayerBacking.cpp:
2525         (WebCore::RenderLayerBacking::animationSeeked): Deleted.
2526         * rendering/RenderLayerBacking.h:
2527         * rendering/RenderLayerModelObject.cpp:
2528         (WebCore::RenderLayerModelObject::animationSeeked): Deleted.
2529         * rendering/RenderLayerModelObject.h:
2530
2531 2020-05-13  Antti Koivisto  <antti@apple.com>
2532
2533         [Wheel event region] Debug overlay
2534         https://bugs.webkit.org/show_bug.cgi?id=211850
2535
2536         Reviewed by Simon Fraser.
2537
2538         This is tied to the existing Wheel event handler overlay debug flag.
2539
2540         * platform/graphics/Color.cpp:
2541         (WebCore::makeRGB): Deleted.
2542         (WebCore::makeRGBA): Deleted.
2543         * platform/graphics/Color.h:
2544         (WebCore::makeRGB):
2545         (WebCore::makeRGBA):
2546
2547         Make constexpr.
2548
2549         * rendering/EventRegion.cpp:
2550         (WebCore::EventRegion::eventListenerRegionForType const):
2551         * rendering/EventRegion.h:
2552         * rendering/RenderLayerBacking.cpp:
2553         (WebCore::patternForDescription):
2554
2555         Factor into a function.
2556
2557         (WebCore::patternForTouchAction):
2558         (WebCore::patternForEventListenerRegionType):
2559         (WebCore::RenderLayerBacking::paintDebugOverlays):
2560         (WebCore::RenderLayerBacking::paintContents):
2561
2562 2020-05-13  Antoine Quint  <graouts@apple.com>
2563
2564         [Web Animations] Fix refactoring issue with animation suspension following r261336
2565         https://bugs.webkit.org/show_bug.cgi?id=211842
2566         <rdar://problem/63118326>
2567
2568         Reviewed by Dean Jackson.
2569
2570         We moved up the suspension code up from DocumentTimeline to DocumentTimelinesController in r261336
2571         and forgot to move the code that set the initial suspension state from the DocumentTimeline constructor
2572         to the DocumentTimelinesController constructor. This is problematic because the suspension state is
2573         only recorded on DocumentTimelinesController itself.
2574
2575         * animation/DocumentTimeline.cpp:
2576         (WebCore::DocumentTimeline::DocumentTimeline):
2577         * animation/DocumentTimelinesController.cpp:
2578         (WebCore::DocumentTimelinesController::DocumentTimelinesController):
2579         (WebCore::DocumentTimelinesController::addTimeline):
2580
2581 2020-05-13  Simon Fraser  <simon.fraser@apple.com>
2582
2583         composited scrolling interferes with the propagation of perspective
2584         https://bugs.webkit.org/show_bug.cgi?id=156435
2585         <rdar://problem/25642222>
2586
2587         Reviewed by Antti Koivisto.
2588         
2589         When we made RenderLayerBacking-internal layers for composited scrolling (m_scrollContainerLayer,
2590         m_scrolledContentsLayer) we'd lose the effects of the sublayer transform, which was applied
2591         to the primary layer, causing perspective on the scroller to not propagate to transformed descendants.
2592
2593         Fix by moving the sublayer transform to the scroll container layer (adjusting the perspective
2594         matrix as appropriate), and making the scrolled contents layer a "preserve3D" layer so
2595         that it doesn't flatten.
2596
2597         This fixes both macOS and iOS.
2598
2599         Test: compositing/transforms/perspective-with-scrolling.html
2600
2601         * rendering/RenderLayerBacking.cpp:
2602         (WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint):
2603
2604 2020-05-13  Youenn Fablet  <youenn@apple.com>
2605
2606         Allow WebAudioBufferList to dynamically change its number of frames
2607         https://bugs.webkit.org/show_bug.cgi?id=211720
2608
2609         Reviewed by Eric Carlson.
2610
2611         We sometimes create WebAudioBufferList on the stack which triggers allocation of several vectors.
2612         Instead of doing that for every audio sample chunk, we should allocate the WebAudioBufferList and resize it as necessary.
2613         For that purpose, we introduce WebAudioBufferList::updateWithNumberOfFrames and use it in two places:
2614         - When creating an audio track into WebAudio.
2615         - When receiving audio chunks from another process.
2616         Covered by existing tests.
2617
2618         * Modules/webaudio/MediaStreamAudioSource.cpp:
2619         (WebCore::MediaStreamAudioSource::~MediaStreamAudioSource):
2620         * Modules/webaudio/MediaStreamAudioSource.h:
2621         * Modules/webaudio/MediaStreamAudioSourceCocoa.cpp:
2622         (WebCore::streamDescription):
2623         (WebCore::MediaStreamAudioSource::consumeAudio):
2624         * platform/audio/cocoa/WebAudioBufferList.cpp:
2625         (WebCore::WebAudioBufferList::WebAudioBufferList):
2626         (WebCore::WebAudioBufferList::updateWithNumberOfFrames):
2627         (WebCore::WebAudioBufferList::channelCount const):
2628         * platform/audio/cocoa/WebAudioBufferList.h:
2629         * platform/mediastream/mac/MockAudioSharedUnit.mm:
2630         (WebCore::MockAudioSharedUnit::reconfigure):
2631         Drive-by fix, we do not need to give the size in bytes but the size in samples.
2632
2633 2020-05-13  Andres Gonzalez  <andresg_22@apple.com>
2634
2635         Check for accessibilityEnabled() before posting notifications asynchronously.
2636         https://bugs.webkit.org/show_bug.cgi?id=211848
2637
2638         Reviewed by Chris Fleizach.
2639
2640         Covered by multiple tests. Fixes crashes in LayoutTests in isolated tree mode.
2641
2642         During LayoutTests, accessibility may be disabled between the time the
2643         notifications are queued and the timer fires. Thus it is necessary to
2644         check for accessibilityEnabled() before posting the notifications
2645         asynchronously. Not doing so was causing crashes in isolated mode.
2646
2647         * accessibility/AXObjectCache.cpp:
2648         (WebCore::AXObjectCache::notificationPostTimerFired):
2649
2650 2020-05-13  Simon Fraser  <simon.fraser@apple.com>
2651
2652         The perspective matrix is affected by overflow:hidden on a box with borders
2653         https://bugs.webkit.org/show_bug.cgi?id=211828
2654
2655         Reviewed by Zalan Bujtas.
2656
2657         For a box with non-uniform borders, the layer created for overflow:hidden is not
2658         centered in its parent layer. However, we push the childrenTransform onto this
2659         clipping layer, so that transform needs to be adjusted to account for the geometry
2660         of the clipping layer.
2661
2662         Test: compositing/transforms/perspective-with-clipping.html
2663
2664         * rendering/RenderLayer.cpp:
2665         (WebCore::RenderLayer::perspectiveTransform const):
2666         * rendering/RenderLayerBacking.cpp:
2667         (WebCore::scrollContainerLayerBox):
2668         (WebCore::clippingLayerBox):
2669         (WebCore::overflowControlsHostLayerBox):
2670         (WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint):
2671
2672 2020-05-13  Tomoki Imai  <Tomoki.Imai@sony.com>
2673
2674         Selected element on Web Inspector is not highlighted with CPU Rendering.
2675         https://bugs.webkit.org/show_bug.cgi?id=195933
2676
2677         Reviewed by Devin Rousso.
2678
2679         Expose InspectorOverlay::shouldShowOverlay via InspectorController.
2680         It's used to determine whether WebPage needs a transparency layer to draw highlight.
2681
2682         * inspector/InspectorController.cpp:
2683         (WebCore::InspectorController::shouldShowOverlay const):
2684         * inspector/InspectorController.h:
2685         * inspector/InspectorOverlay.h:
2686
2687 2020-05-13  Zan Dobersek  <zdobersek@igalia.com>
2688
2689         REGRESSION(r261023): [GTK][WPE] Several WebGL tests are failing
2690         https://bugs.webkit.org/show_bug.cgi?id=211338
2691
2692         Reviewed by Dean Jackson.
2693
2694         For non-ANGLE-backed WebGL, we are still required to query the internal
2695         format of the target texture for the texture sub-image commands. Falling
2696         back to that behavior on !USE(ANGLE) removes regressions in a bunch of
2697         WebGL tests.
2698
2699         * html/canvas/WebGLRenderingContextBase.cpp:
2700         (WebCore::WebGLRenderingContextBase::texImageSourceHelper):
2701         (WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper):
2702
2703 2020-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2704
2705         Unreviewed. Fix GTK debug build after r261554
2706
2707         Remove writeToClipboard that receives a const SelectionData& that is no longer used. Make
2708         readBufferFromClipboard pure virtual and remove the GTK leftovers from PlatformPasteboard.
2709
2710         * platform/PasteboardStrategy.h:
2711         * platform/PlatformPasteboard.h:
2712
2713 2020-05-13  Antti Koivisto  <antti@apple.com>
2714
2715         [Wheel event region] Add support for getting wheel event region from ScrollingTree
2716         https://bugs.webkit.org/show_bug.cgi?id=211785
2717
2718         Reviewed by Simon Fraser.
2719
2720         Add ScrollingTree::eventListenerRegionTypesForPoint. It is not used yet.
2721
2722         * page/scrolling/ScrollingTree.cpp:
2723         (WebCore::ScrollingTree::eventListenerRegionTypesForPoint const):
2724         * page/scrolling/ScrollingTree.h:
2725         * page/scrolling/mac/ScrollingTreeMac.h:
2726         * page/scrolling/mac/ScrollingTreeMac.mm:
2727         (collectDescendantLayersAtPoint):
2728         (ScrollingTreeMac::eventListenerRegionTypesForPoint const):
2729         * platform/graphics/ca/PlatformCALayer.h:
2730         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2731         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2732         (WebCore::PlatformCALayerCocoa::eventRegionContainsPoint const): Deleted.
2733         * rendering/EventRegion.cpp:
2734         (WebCore::EventRegion::eventListenerRegionTypesForPoint const):
2735         * rendering/EventRegion.h:
2736
2737 2020-05-12  Alex Christensen  <achristensen@webkit.org>
2738
2739         Give some NetworkLoadMetrics to WebCoreNSURLSession's delegate
2740         https://bugs.webkit.org/show_bug.cgi?id=211759
2741         <rdar://problem/62909440>
2742
2743         Reviewed by Jer Noble.
2744
2745         This required packaging the fetchStart time with the rest of the time deltas,
2746         passing a const NetworkLoadMetrics& down to the media loader, and packaging the data up
2747         in an ObjC object that pretends to be NSURLSessionTaskMetrics, just like WebCoreNSURLSession
2748         pretends to be an NSURLSession.
2749
2750         I manually verified the NSDates are correct.  This is not straightforward to automate tests for
2751         because of the inherant dynamic nature of timing data, and because our other WebCoreNSURLSession
2752         tests use WebKitLegacy, and that approach won't work here because we are only hooking up data from
2753         NSURLSession, which is only used in modern WebKit.
2754
2755         * Modules/beacon/NavigatorBeacon.cpp:
2756         (WebCore::NavigatorBeacon::notifyFinished):
2757         * Modules/beacon/NavigatorBeacon.h:
2758         * bindings/js/CachedModuleScriptLoader.cpp:
2759         (WebCore::CachedModuleScriptLoader::notifyFinished):
2760         * bindings/js/CachedModuleScriptLoader.h:
2761         * dom/LoadableClassicScript.cpp:
2762         (WebCore::LoadableClassicScript::notifyFinished):
2763         * dom/LoadableClassicScript.h:
2764         * html/HTMLImageLoader.cpp:
2765         (WebCore::HTMLImageLoader::notifyFinished):
2766         * html/HTMLImageLoader.h:
2767         * html/ImageDocument.cpp:
2768         (WebCore::ImageDocument::finishedParsing):
2769         * loader/ApplicationManifestLoader.cpp:
2770         (WebCore::ApplicationManifestLoader::notifyFinished):
2771         * loader/ApplicationManifestLoader.h:
2772         * loader/CrossOriginPreflightChecker.cpp:
2773         (WebCore::CrossOriginPreflightChecker::notifyFinished):
2774         * loader/CrossOriginPreflightChecker.h:
2775         * loader/DocumentLoader.cpp:
2776         (WebCore::DocumentLoader::notifyFinished):
2777         * loader/DocumentLoader.h:
2778         * loader/DocumentThreadableLoader.cpp:
2779         (WebCore::DocumentThreadableLoader::notifyFinished):
2780         * loader/DocumentThreadableLoader.h:
2781         * loader/ImageLoader.cpp:
2782         (WebCore::ImageLoader::notifyFinished):
2783         * loader/ImageLoader.h:
2784         * loader/LinkLoader.cpp:
2785         (WebCore::LinkLoader::notifyFinished):
2786         * loader/LinkLoader.h:
2787         * loader/LinkPreloadResourceClients.h:
2788         * loader/MediaResourceLoader.cpp:
2789         (WebCore::MediaResource::notifyFinished):
2790         * loader/MediaResourceLoader.h:
2791         * loader/SubresourceLoader.cpp:
2792         (WebCore::SubresourceLoader::didReceiveResponse):
2793         (WebCore::SubresourceLoader::didFinishLoading):
2794         * loader/TextTrackLoader.cpp:
2795         (WebCore::TextTrackLoader::notifyFinished):
2796         * loader/TextTrackLoader.h:
2797         * loader/appcache/ApplicationCacheResourceLoader.cpp:
2798         (WebCore::ApplicationCacheResourceLoader::responseReceived):
2799         (WebCore::ApplicationCacheResourceLoader::notifyFinished):
2800         * loader/appcache/ApplicationCacheResourceLoader.h:
2801         * loader/cache/CachedApplicationManifest.cpp:
2802         (WebCore::CachedApplicationManifest::finishLoading):
2803         * loader/cache/CachedApplicationManifest.h:
2804         * loader/cache/CachedCSSStyleSheet.cpp:
2805         (WebCore::CachedCSSStyleSheet::finishLoading):
2806         (WebCore::CachedCSSStyleSheet::checkNotify):
2807         * loader/cache/CachedCSSStyleSheet.h:
2808         * loader/cache/CachedFont.cpp:
2809         (WebCore::CachedFont::finishLoading):
2810         (WebCore::CachedFont::checkNotify):
2811         * loader/cache/CachedFont.h:
2812         * loader/cache/CachedImage.cpp:
2813         (WebCore::CachedImage::finishLoading):
2814         * loader/cache/CachedImage.h:
2815         * loader/cache/CachedRawResource.cpp:
2816         (WebCore::CachedRawResource::updateBuffer):
2817         (WebCore::CachedRawResource::finishLoading):
2818         * loader/cache/CachedRawResource.h:
2819         * loader/cache/CachedResource.cpp:
2820         (WebCore::CachedResource::load):
2821         (WebCore::CachedResource::checkNotify):
2822         (WebCore::CachedResource::finishLoading):
2823         (WebCore::CachedResource::error):
2824         (WebCore::CachedResource::cancelLoad):
2825         (WebCore::CachedResource::didAddClient):
2826         * loader/cache/CachedResource.h:
2827         * loader/cache/CachedResourceClient.h:
2828         (WebCore::CachedResourceClient::notifyFinished):
2829         * loader/cache/CachedSVGDocument.cpp:
2830         (WebCore::CachedSVGDocument::finishLoading):
2831         * loader/cache/CachedSVGDocument.h:
2832         * loader/cache/CachedScript.cpp:
2833         (WebCore::CachedScript::finishLoading):
2834         * loader/cache/CachedScript.h:
2835         * loader/cache/CachedTextTrack.cpp:
2836         (WebCore::CachedTextTrack::finishLoading):
2837         * loader/cache/CachedTextTrack.h:
2838         * loader/cache/CachedXSLStyleSheet.cpp:
2839         (WebCore::CachedXSLStyleSheet::finishLoading):
2840         (WebCore::CachedXSLStyleSheet::checkNotify):
2841         * loader/cache/CachedXSLStyleSheet.h:
2842         * loader/cache/KeepaliveRequestTracker.cpp:
2843         (WebCore::KeepaliveRequestTracker::notifyFinished):
2844         * loader/cache/KeepaliveRequestTracker.h:
2845         * loader/icon/IconLoader.cpp:
2846         (WebCore::IconLoader::notifyFinished):
2847         * loader/icon/IconLoader.h:
2848         * platform/graphics/PlatformMediaResourceLoader.h:
2849         (WebCore::PlatformMediaResourceClient::loadFinished):
2850         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2851         (WebCore::CachedResourceMediaLoader::notifyFinished):
2852         * platform/network/NetworkLoadMetrics.h:
2853         (WebCore::NetworkLoadMetrics::isolatedCopy const):
2854         (WebCore::NetworkLoadMetrics::operator== const):
2855         (WebCore::NetworkLoadMetrics::encode const):
2856         (WebCore::NetworkLoadMetrics::decode):
2857         (WTF::Persistence::Coder<Optional<WebCore::NetworkLoadPriority>>::encode): Deleted.
2858         (WTF::Persistence::Coder<Optional<WebCore::NetworkLoadPriority>>::decode): Deleted.
2859         * platform/network/cocoa/NetworkLoadMetrics.mm:
2860         (WebCore::copyTimingData):
2861         * platform/network/cocoa/WebCoreNSURLSession.mm:
2862         (networkLoadMetricsDate):
2863         (-[WebCoreNSURLSessionTaskTransactionMetrics _initWithMetrics:]):
2864         (-[WebCoreNSURLSessionTaskTransactionMetrics fetchStartDate]):
2865         (-[WebCoreNSURLSessionTaskTransactionMetrics domainLookupStartDate]):
2866         (-[WebCoreNSURLSessionTaskTransactionMetrics domainLookupEndDate]):
2867         (-[WebCoreNSURLSessionTaskTransactionMetrics connectStartDate]):
2868         (-[WebCoreNSURLSessionTaskTransactionMetrics secureConnectionStartDate]):
2869         (-[WebCoreNSURLSessionTaskTransactionMetrics connectEndDate]):
2870         (-[WebCoreNSURLSessionTaskTransactionMetrics requestStartDate]):
2871         (-[WebCoreNSURLSessionTaskTransactionMetrics responseStartDate]):
2872         (-[WebCoreNSURLSessionTaskTransactionMetrics responseEndDate]):
2873         (-[WebCoreNSURLSessionTaskMetrics _initWithMetrics:]):
2874         (-[WebCoreNSURLSessionTaskMetrics transactionMetrics]):
2875         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
2876         (-[WebCoreNSURLSessionDataTask _finish]):
2877         (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:metrics:]):
2878         (-[WebCoreNSURLSessionDataTask resource:accessControlCheckFailedWithError:]):
2879         (-[WebCoreNSURLSessionDataTask resource:loadFailedWithError:]):
2880         (-[WebCoreNSURLSessionDataTask resourceFinished:metrics:]):
2881         (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]): Deleted.
2882         (-[WebCoreNSURLSessionDataTask resourceFinished:]): Deleted.
2883         * rendering/RenderElement.cpp:
2884         (WebCore::RenderElement::notifyFinished):
2885         * rendering/RenderElement.h:
2886         * rendering/RenderImage.cpp:
2887         (WebCore::RenderImage::notifyFinished):
2888         * rendering/RenderImage.h:
2889         * rendering/RenderLayerFilters.cpp:
2890         (WebCore::RenderLayerFilters::notifyFinished):
2891         * rendering/RenderLayerFilters.h:
2892         * svg/SVGFEImageElement.cpp:
2893         (WebCore::SVGFEImageElement::notifyFinished):
2894         * svg/SVGFEImageElement.h:
2895         * svg/SVGUseElement.cpp:
2896         (WebCore::SVGUseElement::notifyFinished):
2897         * svg/SVGUseElement.h:
2898
2899 2020-05-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
2900
2901         [CG] Change the UTI of the "WebP" image to be "org.webmproject.webp"
2902         https://bugs.webkit.org/show_bug.cgi?id=211794
2903         <rdar://problem/63031187>
2904
2905         Reviewed by Darin Adler.
2906
2907         See https://developers.google.com/speed/webp/docs/riff_container.
2908
2909         * platform/graphics/cg/UTIRegistry.cpp:
2910         (WebCore::defaultSupportedImageTypes):
2911         Fix review comments from bug 208038.
2912
2913 2020-05-12  Simon Fraser  <simon.fraser@apple.com>
2914
2915         Move perspective-setting code into its own function
2916         https://bugs.webkit.org/show_bug.cgi?id=211812
2917
2918         Reviewed by Zalan Bujtas.
2919
2920         Move the code that updates anchor point and children transform (for perspective)
2921         into its own function.
2922
2923         No behavior change.
2924
2925         * rendering/RenderLayerBacking.cpp:
2926         (WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint):
2927         (WebCore::computeOffsetFromAncestorGraphicsLayer):
2928         (WebCore::RenderLayerBacking::updateGeometry):
2929         * rendering/RenderLayerBacking.h:
2930
2931 2020-05-12  Jiewen Tan  <jiewen_tan@apple.com>
2932
2933         [WebAuthn] Don't assume extensions always exist
2934         https://bugs.webkit.org/show_bug.cgi?id=211760
2935         <rdar://problem/61217642>
2936
2937         Reviewed by Brent Fulgham.
2938
2939         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2940         (fido::processGoogleLegacyAppIdSupportExtension):
2941
2942 2020-05-12  Jer Noble  <jer.noble@apple.com>
2943
2944         [iOS] REGRESSION: (r261342) Play/pause button doesn't work upon first entering fullscreen mode
2945         https://bugs.webkit.org/show_bug.cgi?id=211797
2946         <rdar://problem/63118008>
2947
2948         Reviewed by Eric Carlson.
2949
2950         In r261342 we added code to handle "canplay" and "waiting" events without ever actually
2951         adding event listeners for them. So when we enter fullscreen before the "canplay" event, we
2952         never re-evaluate whether we're playing or not.
2953
2954         Drive-by fix: Also noticed that stalls will cause the play/pause toggle to switch from the
2955         "pause icon" to the "play icon", which is incorrect; we're still "playing" event when we're
2956         stalled. So when we are in the stalled state, set the "playbackRate" property to some very
2957         small, but non-zero value. This will cause the playback slider to stop progressing, but
2958         won't also cause the play/pause button to swap states.
2959
2960         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2961         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
2962         (WebCore::PlaybackSessionModelMediaElement::observedEventNames):
2963
2964 2020-05-12  Chris Dumez  <cdumez@apple.com>
2965
2966         [WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
2967         https://bugs.webkit.org/show_bug.cgi?id=211808
2968
2969         Reviewed by Darin Adler.
2970
2971         Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly
2972         different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support
2973         for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not
2974         seem worth it anymore.
2975
2976         * dom/Document.cpp:
2977         (WebCore::Document::resume):
2978         * html/HTMLFrameSetElement.cpp:
2979         (WebCore::HTMLFrameSetElement::insertedIntoAncestor):
2980         (WebCore::HTMLFrameSetElement::removedFromAncestor):
2981         * loader/EmptyFrameLoaderClient.h:
2982         * loader/FrameLoaderClient.h:
2983
2984 2020-05-12  Simon Fraser  <simon.fraser@apple.com>
2985
2986         Clean up some transformOrigin and perspectiveOrigin code
2987         https://bugs.webkit.org/show_bug.cgi?id=211807
2988
2989         Reviewed by Zalan Bujtas.
2990
2991         Add LengthPoint and LengthSize-based "value for length" functions so we can do
2992         point and size math as we do for LayoutPoint/FloatPoint etc.
2993
2994         Use them in code that computes transform and perspective origins.
2995
2996         * animation/KeyframeEffect.cpp:
2997         (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const):
2998         * css/LengthFunctions.cpp:
2999         (WebCore::sizeForLengthSize):
3000         (WebCore::pointForLengthPoint):
3001         (WebCore::floatPointForLengthPoint):
3002         * css/LengthFunctions.h:
3003         * page/animation/AnimationBase.cpp:
3004         (WebCore::AnimationBase::computeTransformedExtentViaTransformList const):
3005         * platform/Length.h:
3006         * platform/LengthPoint.h:
3007         * rendering/RenderLayer.cpp:
3008         (WebCore::RenderLayer::perspectiveTransform const):
3009         (WebCore::RenderLayer::perspectiveOrigin const):
3010         * rendering/RenderLayerBacking.cpp:
3011         (WebCore::RenderLayerBacking::computeTransformOriginForPainting const):
3012         * rendering/style/BasicShapes.cpp:
3013         (WebCore::BasicShapeInset::path):
3014         (WebCore::floatSizeForLengthSize): Deleted.
3015         * rendering/style/RenderStyle.cpp:
3016         (WebCore::RenderStyle::applyTransform const):
3017         * rendering/style/RenderStyle.h:
3018         (WebCore::RenderStyle::transformOriginXY const): Explicitly "xy" because it excludes the z component.
3019         (WebCore::RenderStyle::perspectiveOrigin const):
3020         * rendering/style/StyleRareNonInheritedData.h:
3021         (WebCore::StyleRareNonInheritedData::perspectiveOrigin const):
3022         * rendering/style/StyleTransformData.h:
3023         (WebCore::StyleTransformData::originXY const):
3024
3025 2020-05-12  Michael Catanzaro  <mcatanzaro@gnome.org>
3026
3027         -Wattribute warning in BreakLines.cpp
3028         https://bugs.webkit.org/show_bug.cgi?id=211784
3029
3030         Reviewed by Darin Adler.
3031
3032         Remove export attribute. These only work in header files.
3033
3034         * rendering/BreakLines.cpp:
3035
3036 2020-05-12  Eric Carlson  <eric.carlson@apple.com>
3037
3038         Poster set after playback begins should be ignored
3039         https://bugs.webkit.org/show_bug.cgi?id=211464
3040         <rdar://problem/62605114>
3041
3042         Reviewed by Darin Adler.
3043
3044         Test: media/video-poster-set-after-playback.html
3045
3046         * html/HTMLVideoElement.cpp:
3047         (WebCore::HTMLVideoElement::parseAttribute): Ignore `poster` changes after first video frame
3048         is available.
3049         (WebCore::HTMLVideoElement::updateDisplayState): Set mode to Video if the first video
3050         frame is available.
3051
3052         * testing/Internals.cpp:
3053         (WebCore::Internals::elementShouldDisplayPosterImage const):
3054         * testing/Internals.h:
3055         * testing/Internals.idl:
3056
3057 2020-05-12  Simon Fraser  <simon.fraser@apple.com>
3058
3059         Perpective origin should be relative to the reference box
3060         https://bugs.webkit.org/show_bug.cgi?id=211769
3061
3062         Reviewed by Zalan Bujtas.
3063
3064         Use the reference box <https://drafts.csswg.org/css-transforms-1/#reference-box> when
3065         computing perspective-origin <https://drafts.csswg.org/css-transforms-2/#perspective-origin-property>,
3066         adding a referenceBox() helper on RenderBox.
3067
3068         The code to compute the perspective transform is wrong; for now, fudge it by passing in the border box,
3069         but this code needs to account for GraphicsLayer geometry and transform-origin in future (webkit.org/b/211787).
3070
3071         Test: compositing/transforms/perspective-transform-box.html
3072
3073         * rendering/RenderBlock.cpp:
3074         (WebCore::RenderBlock::nodeAtPoint):
3075         * rendering/RenderBox.cpp:
3076         (WebCore::RenderBox::referenceBox const):
3077         * rendering/RenderBox.h:
3078         * rendering/RenderLayer.cpp:
3079         (WebCore::computeReferenceRectFromBox):
3080         (WebCore::computeReferenceBox):
3081         (WebCore::RenderLayer::updateTransform):
3082         (WebCore::RenderLayer::currentTransform const):
3083         (WebCore::RenderLayer::perspectiveTransform const):
3084         (WebCore::RenderLayer::computeClipPath const):
3085         * rendering/RenderLayer.h:
3086         * rendering/RenderLayerBacking.cpp:
3087         (WebCore::RenderLayerBacking::updateGeometry):
3088
3089 2020-05-12  Ross Kirsling  <ross.kirsling@sony.com>
3090
3091         Unreviewed PlayStation / clang-cl build fix following r261533.
3092
3093         Apparently r261572 only caught half of the cases.
3094
3095         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3096         (WebCore::IDBServer::estimateSize):
3097         * bindings/js/IDBBindingUtilities.cpp:
3098         (WebCore::generateIndexKeyMapForValue):
3099
3100 2020-05-12  Myles C. Maxfield  <mmaxfield@apple.com>
3101
3102         Text is clipped when rendered with fonts which have a negative line gap metric
3103         https://bugs.webkit.org/show_bug.cgi?id=211683
3104         <rdar://problem/62192986>
3105
3106         Reviewed by Zalan Bujtas.
3107
3108         ... As seen on nytimes.com.
3109
3110         Some fonts have negative line gap metrics. Chrome and Firefox both clamp it to 0, so the
3111         line-height isn't decreased. However, we were honoring the negative line gap, thereby decreasing
3112         line-height.
3113
3114         There are some typographical reasons to want a negative line gap, which is why this clamping
3115         behavior shouldn't be done in the platform text library. In the interest of matching other
3116         browsers, we should perform this clamping ourselves in WebKit.
3117
3118         Test: fast/text/negative-line-gap.html
3119
3120         * platform/graphics/Font.cpp:
3121         (WebCore::Font::platformGlyphInit):
3122
3123 2020-05-12  Ross Kirsling  <ross.kirsling@sony.com>
3124
3125         Unreviewed PlayStation / clang-cl build fix following r261533.
3126
3127         clang for Windows (< v10.0.0) cannot destructure a const class.
3128         See also r254471, r249524, etc.
3129
3130         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3131         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
3132         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3133         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
3134
3135 2020-05-12  Ross Kirsling  <ross.kirsling@sony.com>
3136
3137         Unreviewed PlayStation build fix following r261494.
3138
3139         * PlatformPlayStation.cmake:
3140
3141 2020-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3142
3143         [GTK] Rework drag and drop handling in preparation for GTK4
3144         https://bugs.webkit.org/show_bug.cgi?id=211723
3145
3146         Reviewed by Adrian Perez de Castro.
3147
3148         Remove PasteboardHelper that is no longer used and add conversion functions to GtkUtilities.
3149
3150         * PlatformGTK.cmake:
3151         * SourcesGTK.txt:
3152         * platform/gtk/GtkUtilities.cpp:
3153         (WebCore::gdkDragActionToDragOperation):
3154         (WebCore::dragOperationToGdkDragActions):
3155         (WebCore::dragOperationToSingleGdkDragAction):
3156         * platform/gtk/GtkUtilities.h:
3157         * platform/gtk/PasteboardHelper.cpp: Removed.
3158         * platform/gtk/PasteboardHelper.h: Removed.
3159
3160 2020-05-12  Jacob Uphoff  <jacob_uphoff@apple.com>
3161
3162         Unreviewed, reverting r261557.
3163
3164         This commit caused testing to exit early due to too many
3165         crashes on macOS Catalina Asan
3166
3167         Reverted changeset:
3168
3169         "Allow WebAudioBufferList to dynamically change its number of
3170         frames"
3171         https://bugs.webkit.org/show_bug.cgi?id=211720
3172         https://trac.webkit.org/changeset/261557
3173
3174 2020-05-12  Simon Fraser  <simon.fraser@apple.com>
3175
3176         Speculative fix for crash in ScrollingTree::handleWheelEvent()
3177         https://bugs.webkit.org/show_bug.cgi?id=211763
3178         <rdar://problem/62926117>
3179
3180         Reviewed by Andy Estes.
3181
3182         Crash data shows a null-deref crash in ScrollingTree::handleWheelEvent() which
3183         is most likely because m_rootNode is null. Protect against this.
3184
3185         * page/scrolling/ScrollingTree.cpp:
3186         (WebCore::ScrollingTree::handleWheelEvent):
3187
3188 2020-05-12  Youenn Fablet  <youenn@apple.com>
3189
3190         Allow WebAudioBufferList to dynamically change its number of frames
3191         https://bugs.webkit.org/show_bug.cgi?id=211720
3192
3193         Reviewed by Eric Carlson.
3194
3195         We sometimes create WebAudioBufferList on the stack which triggers allocation of several vectors.
3196         Instead of doing that for every audio sample chunk, we should allocate the WebAudioBufferList and resize it as necessary.
3197         For that purpose, we introduce WebAudioBufferList::updateWithNumberOfFrames and use it in two places:
3198         - When creating an audio track into WebAudio.
3199         - When receiving audio chunks from another process.
3200         Covered by existing tests.
3201
3202         * Modules/webaudio/MediaStreamAudioSource.cpp:
3203         (WebCore::MediaStreamAudioSource::~MediaStreamAudioSource):
3204         * Modules/webaudio/MediaStreamAudioSource.h:
3205         * Modules/webaudio/MediaStreamAudioSourceCocoa.cpp:
3206         (WebCore::streamDescription):
3207         (WebCore::MediaStreamAudioSource::consumeAudio):
3208         * platform/audio/cocoa/WebAudioBufferList.cpp:
3209         (WebCore::WebAudioBufferList::WebAudioBufferList):
3210         (WebCore::WebAudioBufferList::updateWithNumberOfFrames):
3211         (WebCore::WebAudioBufferList::channelCount const):
3212         * platform/audio/cocoa/WebAudioBufferList.h:
3213
3214 2020-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3215
3216         [GTK] Rework clipboard handling in preparation for GTK4
3217         https://bugs.webkit.org/show_bug.cgi?id=211511
3218
3219         Reviewed by Adrian Perez de Castro.
3220
3221         Remove PlatformPasteboard implementation that has been replaced by Clipboard class in the WebKit
3222         layer. When Pasteboard class is created for copy and paste operations, it no longer has a SelectionData member,
3223         it just uses the new methods in the pasteboard strategy to communicate with the clipboard. WebContentReader has
3224         now an implementation for GTK and it's used when reading from the clipboard, the same way it's done in other ports.
3225
3226         * SourcesGTK.txt:
3227         * editing/WebContentReader.h:
3228         * editing/gtk/EditorGtk.cpp:
3229         (WebCore::Editor::pasteWithPasteboard): Use webContentFromPasteboard().
3230         (WebCore::Editor::webContentFromPasteboard): Use WebContentReader.
3231         * editing/gtk/WebContentReaderGtk.cpp: Added.
3232         (WebCore::WebContentReader::readFilePath):
3233         (WebCore::WebContentReader::readFilePaths):
3234         (WebCore::WebContentReader::readHTML):
3235         (WebCore::WebContentReader::readPlainText):
3236         (WebCore::WebContentReader::readImage):
3237         (WebCore::WebContentReader::readURL):
3238         (WebCore::WebContentMarkupReader::readHTML):
3239         * platform/Pasteboard.h:
3240         (WebCore::PasteboardWebContentReader::readDataBuffer):
3241         * platform/PasteboardStrategy.h:
3242         * platform/gtk/PasteboardGtk.cpp:
3243         (WebCore::Pasteboard::Pasteboard):
3244         (WebCore::Pasteboard::selectionData const):
3245         (WebCore::Pasteboard::writeString):
3246         (WebCore::Pasteboard::writePlainText):
3247         (WebCore::Pasteboard::write):
3248         (WebCore::Pasteboard::clear):
3249         (WebCore::Pasteboard::canSmartReplace):
3250         (WebCore::Pasteboard::read):
3251         (WebCore::Pasteboard::hasData):
3252         (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
3253         (WebCore::Pasteboard::readString):
3254         (WebCore::Pasteboard::fileContentState):
3255         * platform/gtk/PasteboardHelper.cpp:
3256         * platform/gtk/PasteboardHelper.h:
3257         * platform/gtk/PlatformPasteboardGtk.cpp: Removed.
3258         * platform/gtk/SelectionData.cpp:
3259         (WebCore::SelectionData::setURL): Do not override the text and markup if it has already been set.
3260
3261 2020-05-12  Youenn Fablet  <youenn@apple.com>
3262
3263         Introduce a RealtimeMediaSource video sample observer
3264         https://bugs.webkit.org/show_bug.cgi?id=211718
3265
3266         Reviewed by Eric Carlson.
3267
3268         We introduce an observer dedicated to video samples similarly to AudioSampleObserver for audio.
3269         This will allow to move video frame processing out of the main thread progressively.
3270         For now, we remove video sample observing from the track private and observers should now register directly to the realtime media source.
3271         We update the various users, including MediaRecorder and the media player.
3272         In both cases, they will only observe the video track to be played/recorded, which is both more efficient and simpler.
3273
3274         We introduced RealtimeMediaSource::Observer::hasStartedProducingData callback for MediaStreamTrackPrivate so 
3275         that the processing to do when the first samples are available can be done on the main thread.
3276
3277         MediaStreamTrackPrivate no longer filters out samples if it is not enabled.
3278         As such, each consumer is now responsible to observe/unobserve the source when its track gets enabled/disabled similarly as for audio,
3279         or do nothing if track is not enabled.
3280
3281         Similarly, RealtimeOutgoingVideoSourceCocoa will now only observe video samples when the track is enabled and not muted.
3282
3283         Covered by existing tests.
3284
3285         * Modules/mediarecorder/MediaRecorder.cpp:
3286         (WebCore::MediaRecorder::sampleBufferUpdated): Deleted.
3287         * Modules/mediarecorder/MediaRecorder.h:
3288         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3289         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3290         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
3291         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3292         We can renove the track check since we only observe the active video track.
3293         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
3294         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
3295         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Deleted.
3296         * platform/mediarecorder/MediaRecorderPrivate.h:
3297         (WebCore::MediaRecorderPrivate::setVideoSource):
3298         (WebCore::MediaRecorderPrivate::~MediaRecorderPrivate):
3299         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
3300         (WebCore::MediaRecorderPrivateAVFImpl::create):
3301         (WebCore::MediaRecorderPrivateAVFImpl::~MediaRecorderPrivateAVFImpl):
3302         (WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable):
3303         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
3304         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): Deleted.
3305         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
3306         * platform/mediarecorder/MediaRecorderPrivateMock.cpp:
3307         (WebCore::MediaRecorderPrivateMock::MediaRecorderPrivateMock):
3308         (WebCore::MediaRecorderPrivateMock::~MediaRecorderPrivateMock):
3309         (WebCore::MediaRecorderPrivateMock::stopRecording):
3310         (WebCore::MediaRecorderPrivateMock::videoSampleAvailable):
3311         (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated): Deleted.
3312         * platform/mediarecorder/MediaRecorderPrivateMock.h:
3313         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3314         (WebCore::MediaStreamTrackPrivate::hasStartedProducingData):
3315         (WebCore::MediaStreamTrackPrivate::updateReadyState):
3316         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable): Deleted.
3317         (WebCore::MediaStreamTrackPrivate::hasStartedProducingAudioData): Deleted.
3318         * platform/mediastream/MediaStreamTrackPrivate.h:
3319         * platform/mediastream/RealtimeMediaSource.cpp:
3320         (WebCore::RealtimeMediaSource::addVideoSampleObserver):
3321         (WebCore::RealtimeMediaSource::removeVideoSampleObserver):
3322         (WebCore::RealtimeMediaSource::updateHasStartedProducingData):
3323         (WebCore::RealtimeMediaSource::videoSampleAvailable):
3324         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
3325         * platform/mediastream/RealtimeMediaSource.h:
3326         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
3327         (WebCore::RealtimeOutgoingVideoSource::unobserveSource):
3328         (WebCore::RealtimeOutgoingVideoSource::updateBlackFramesSending):
3329         * platform/mediastream/RealtimeOutgoingVideoSource.h:
3330         * platform/mediastream/RealtimeVideoSource.cpp:
3331         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
3332         (WebCore::RealtimeVideoSource::startProducingData):
3333         (WebCore::RealtimeVideoSource::stopProducingData):
3334         (WebCore::RealtimeVideoSource::videoSampleAvailable):
3335         * platform/mediastream/RealtimeVideoSource.h:
3336         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3337         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
3338         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
3339         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3340         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
3341         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3342         (WebCore::RealtimeOutgoingVideoSourceCocoa::videoSampleAvailable):
3343         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated): Deleted.
3344         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
3345         * platform/mock/MockRealtimeVideoSource.cpp:
3346         * testing/Internals.cpp:
3347         (WebCore::Internals::~Internals):
3348         (WebCore::Internals::stopObservingRealtimeMediaSource):
3349         (WebCore::Internals::observeMediaStreamTrack):
3350         * testing/Internals.h:
3351
3352 2020-05-12  Philippe Normand  <pnormand@igalia.com>
3353
3354         [GStreamer] Audio messages in web.whatsapp.com only play once.
3355         https://bugs.webkit.org/show_bug.cgi?id=211627
3356
3357         Reviewed by Xabier Rodriguez-Calvar.
3358
3359         Test: media/video-src-blob-replay.html
3360         
3361         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3362         (WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag): Make sure on-disk
3363         buffering is disabled for blob URIs, because it messes up the pipeline for replays, and it's
3364         useless for that use-case anyway.
3365
3366 2020-05-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
3367
3368         Need to advertise support for WebP in the Accept header
3369         https://bugs.webkit.org/show_bug.cgi?id=211735
3370
3371         Reviewed by Darin Adler.
3372
3373         On Mac and iOS, the system has to support WebP: HAVE(WEBP).
3374         On other platforms, WebKit has to be able to decode WebP images: USE(WEBP).
3375
3376         * css/CSSCalculationValue.cpp:
3377         (WebCore::createCSS):
3378         Fix unrealted coding style issue.
3379
3380         * loader/cache/CachedResourceRequest.cpp:
3381         (WebCore::acceptHeaderValueForImageResource):
3382         (WebCore::acceptHeaderValueFromType):
3383
3384 2020-05-11  Darin Adler  <darin@apple.com>
3385
3386         Fix problems caught by replacing WTF::Optional with std::optional
3387         https://bugs.webkit.org/show_bug.cgi?id=211703
3388
3389         Reviewed by Chris Dumez.
3390
3391         * editing/EditorCommand.cpp:
3392         (WebCore::executeSelectToMark): Remove erroneous code that converts
3393         a live range to a SimpleRange and then back again.
3394
3395         * inspector/agents/InspectorNetworkAgent.cpp:
3396         (WebCore::InspectorNetworkAgent::willSendRequest): Pass a pointer to
3397         a ResourceRequest.
3398         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache): Ditto.
3399         (WebCore::InspectorNetworkAgent::buildInitiatorObject): Take a const*
3400         to a ResourceRequest instead of an Optional<const ResourceRequest&>
3401         because std::optional does not work with reference types.
3402         * inspector/agents/InspectorNetworkAgent.h: Update for the change above.
3403
3404         * layout/floats/FloatingContext.cpp:
3405         (WebCore::Layout::Iterator::operator++): Fix code that was accidentally
3406         comparing two optionals, after already checking them for null. Instead
3407         we should compare their values.
3408
3409         * platform/PlatformScreen.cpp:
3410         (WebCore::screenData): Return a const* instead of an Optional<const&>
3411         because std::optonal does not work with reference types.
3412         * platform/PlatformScreen.h: Updated for the above. Also removed both
3413         the unneeded include of Optional.h (could have included Forward.h) and
3414         of HashMap.h and put the Mac-specific type IORegistryGPUID inside a
3415         PLATFORM(MAC) #if statement.
3416
3417         * platform/ScreenProperties.h: Moved the HashMap.h include here, since
3418         this is the header that uses it. Changed the EncodedColorSpaceDataType
3419         enum to an enum class and gave it much shorter names.
3420         (WebCore::ScreenData::encode const): Updated for the enum class change.
3421         Also fixed a mistake where the code would use operator<< instead of
3422         encodeEnum for the color space type of Null. This would lead to some
3423         kind of decoding error, rather than a null cgColorSpace.
3424         (WebCore::ScreenData::decode): Ditto.
3425
3426   &n