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