ece62e8c97129fb2461a5d252747a09666657dff
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-19  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: ScriptProfiler: lazily create the agent
4         https://bugs.webkit.org/show_bug.cgi?id=195591
5         <rdar://problem/48791756>
6
7         Reviewed by Joseph Pecoraro.
8
9         No change in functionality.
10
11         * inspector/InspectorController.cpp:
12         (WebCore::InspectorController::InspectorController):
13         (WebCore::InspectorController::createLazyAgents):
14
15 2019-03-19  Devin Rousso  <drousso@apple.com>
16
17         Web Inspector: DOMStorage: lazily create the agent
18         https://bugs.webkit.org/show_bug.cgi?id=195588
19         <rdar://problem/48791878>
20
21         Reviewed by Joseph Pecoraro.
22
23         No change in functionality.
24
25         Make functions used by `CommandLineAPIHost` static so that an `InspectorDOMStorageAgent`
26         doesn't need to be created to call them.
27
28         * inspector/agents/InspectorDOMStorageAgent.h:
29         * inspector/agents/InspectorDOMStorageAgent.cpp:
30         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
31         (WebCore::InspectorDOMStorageAgent::enable):
32         (WebCore::InspectorDOMStorageAgent::disable):
33         (WebCore::InspectorDOMStorageAgent::storageId):
34         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
35         (WebCore::InspectorDOMStorageAgent::findStorageArea):
36         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent): Deleted.
37
38         * inspector/CommandLineAPIHost.h:
39         (WebCore::CommandLineAPIHost::init):
40         * inspector/CommandLineAPIHost.cpp:
41         (WebCore::CommandLineAPIHost::disconnect):
42         (WebCore::CommandLineAPIHost::storageId):
43
44         * inspector/InspectorController.cpp:
45         (WebCore::InspectorController::InspectorController):
46         (WebCore::InspectorController::createLazyAgents):
47         * inspector/WorkerInspectorController.cpp:
48         (WebCore::WorkerInspectorController::WorkerInspectorController):
49
50 2019-03-19  Youenn Fablet  <youenn@apple.com>
51
52         REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
53         https://bugs.webkit.org/show_bug.cgi?id=195779
54
55         Reviewed by Chris Dumez.
56
57         When requesting space, we might delay execution of the task.
58         In such a case, a task to close the database might be done before the task continues.
59         Check that the database is not closing to continue the task.
60         This should ensure that the cross thread queue is not already killed.
61
62         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
63         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
64
65 2019-03-19  Zalan Bujtas  <zalan@apple.com>
66
67         RenderElement::startAnimation should take const Animation&
68         https://bugs.webkit.org/show_bug.cgi?id=195929
69
70         Reviewed by Daniel Bates.
71
72         * animation/KeyframeEffect.cpp:
73         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
74         * page/animation/KeyframeAnimation.cpp:
75         (WebCore::KeyframeAnimation::startAnimation):
76         (WebCore::KeyframeAnimation::endAnimation):
77         * rendering/RenderElement.h:
78         (WebCore::RenderElement::startAnimation):
79         (WebCore::RenderElement::animationFinished):
80         * rendering/RenderLayerBacking.cpp:
81         (WebCore::RenderLayerBacking::startAnimation):
82         * rendering/RenderLayerBacking.h:
83         * rendering/RenderLayerModelObject.cpp:
84         (WebCore::RenderLayerModelObject::startAnimation):
85         (WebCore::RenderLayerModelObject::animationFinished):
86         * rendering/RenderLayerModelObject.h:
87
88 2019-03-19  Devin Rousso  <drousso@apple.com>
89
90         Web Inspector: Heap: lazily create the agent
91         https://bugs.webkit.org/show_bug.cgi?id=195590
92         <rdar://problem/48791750>
93
94         Reviewed by Joseph Pecoraro.
95
96         No change in functionality.
97
98         * inspector/agents/page/PageHeapAgent.cpp:
99         (WebCore::PageHeapAgent::disable):
100         * inspector/agents/WebHeapAgent.h:
101         * inspector/agents/WebHeapAgent.cpp:
102         (WebCore::WebHeapAgent::WebHeapAgent):
103         (WebCore::WebHeapAgent::enable): Added.
104         (WebCore::WebHeapAgent::disable):
105
106         * inspector/agents/page/PageConsoleAgent.h:
107         * inspector/agents/page/PageConsoleAgent.cpp:
108         (WebCore::PageConsoleAgent::PageConsoleAgent):
109         * inspector/agents/WebConsoleAgent.h:
110         * inspector/agents/WebConsoleAgent.cpp:
111         (WebCore::WebConsoleAgent::WebConsoleAgent):
112         * inspector/agents/worker/WorkerConsoleAgent.h:
113         * inspector/agents/worker/WorkerConsoleAgent.cpp:
114         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
115
116         * inspector/InspectorController.cpp:
117         (WebCore::InspectorController::InspectorController):
118         (WebCore::InspectorController::createLazyAgents):
119         * inspector/WorkerInspectorController.cpp:
120         (WebCore::WorkerInspectorController::WorkerInspectorController):
121         (WebCore::WorkerInspectorController::createLazyAgents):
122
123 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
124
125         Fix GraphicsLayer-related crashes after r243129
126         https://bugs.webkit.org/show_bug.cgi?id=195953
127
128         Reviewed by Dean Jackson.
129
130         Extending the lifetime of GraphicsLayers by referencing them in the scrolling tree (r243129)
131         revealed a bug where RenderLayerCompositor was failing to clear itself as the client of
132         GraphicsLayers that it owned, causing crashes.
133
134         Fix by using the GraphicsLayer::unparentAndClear() helper to clean up all the GraphicsLayers
135         owned by RenderLayerCompositor.
136
137         * rendering/RenderLayerCompositor.cpp:
138         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
139         * rendering/RenderLayerCompositor.h:
140
141 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
142
143         [Async overflow] Handle positioned nodes in a few more places
144         https://bugs.webkit.org/show_bug.cgi?id=195946
145
146         Reviewed by Zalan Bujtas.
147
148         When I added support for positioned nodes in the scrolling tree I missed handling
149         the ScrollCoordinationRole::Positioning in a few places.
150
151         I wasn't able to come up with a test for this; when a positioned node toggles between
152         tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
153         update the node with the new layer.
154
155         * rendering/RenderLayer.cpp:
156         (WebCore::outputPaintOrderTreeRecursive): Logging.
157         * rendering/RenderLayerBacking.cpp:
158         (WebCore::operator<<): Logging.
159         * rendering/RenderLayerCompositor.cpp:
160         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
161         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.
162
163 2019-03-19  Alex Christensen  <achristensen@webkit.org>
164
165         Make WTFLogChannelState and WTFLogLevel enum classes
166         https://bugs.webkit.org/show_bug.cgi?id=195904
167
168         Reviewed by Eric Carlson.
169
170         * Modules/mediasource/SourceBuffer.cpp:
171         (WebCore::removeSamplesFromTrackBuffer):
172         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
173         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
174         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
175         * dom/Document.cpp:
176         (WebCore::messageLevelFromWTFLogLevel):
177         * html/FTPDirectoryDocument.cpp:
178         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
179         * html/HTMLMediaElement.cpp:
180         (WebCore::HTMLMediaElement::seekTask):
181         (WebCore::HTMLMediaElement::selectNextSourceChild):
182         (WebCore::HTMLMediaElement::sourceWasAdded):
183         (WebCore::HTMLMediaElement::sourceWasRemoved):
184         * inspector/agents/WebConsoleAgent.cpp:
185         (WebCore::WebConsoleAgent::getLoggingChannels):
186         (WebCore::channelConfigurationForString):
187         * platform/Logging.cpp:
188         (WebCore::isLogChannelEnabled):
189         (WebCore::setLogChannelToAccumulate):
190         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
191         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
192         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
193         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
194         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
195         (WebCore::initializePeerConnectionFactoryAndThreads):
196         * rendering/RenderLayerCompositor.cpp:
197         (WebCore::compositingLogEnabled):
198
199 2019-03-19  Philippe Normand  <pnormand@igalia.com>
200
201         REGRESSION(r243058): [GStreamer] 3 tests now timing out
202         https://bugs.webkit.org/show_bug.cgi?id=195888
203
204         Reviewed by Xabier Rodriguez-Calvar.
205
206         A breaking change was introduced in r243058. Now on-disk-buffering
207         is disabled when the reported Content-Length is 0 or not present
208         at all. This broke the progress event logic in didLoadProgress()
209         because leading to progress events not being fired as expected.
210
211         The proposed solution is to make webkitwebsrc notify the player
212         every time the network process receives data from the network. So
213         the player can now easily determine if the load progressed by
214         checking the reported statistics.
215
216         No new tests, existing media tests cover this change.
217
218         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
219         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
220         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
221         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
222         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
223         (CachedResourceStreamingClient::dataReceived):
224
225 2019-03-19  Alicia Boya García  <aboya@igalia.com>
226
227         [MSE] Use tolerance in eraseBeginTime
228         https://bugs.webkit.org/show_bug.cgi?id=195911
229
230         Reviewed by Jer Noble.
231
232         https://bugs.webkit.org/show_bug.cgi?id=190085 introduced tolerance
233         when erasing frames during the Coded Frame Processing algorithm in
234         such a way that, in files with less than perfect timestamps, a frame
235         existing before after the current append is not erased accidentally
236         due to small overlaps.
237
238         This patch takes care of the opposite problem: we don't want an old
239         frame being accidentally NOT erased by a new one with the same
240         timestamps just because these overlaps make
241         highestPresentationTimestamp very slightly higher than the frame PTS.
242
243         This bug in practice causes some frames of the old quality to not be
244         erased when the new quality is appended, resulting in some seemingly
245         still frames from a different quality appearing at some points during
246         WebM video in presence of quality changes.
247
248         This bug can be reduced to this minimal test case that illustrates the
249         timestamp imprecission of a typical WebM file:
250
251         function sampleRun(generation) {
252             return concatenateSamples([
253                 makeASample(     0,      0, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation),
254                 makeASample(167000, 167000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
255                 makeASample(333000, 333000, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation), // overlaps previous frame
256                 makeASample(500000, 500000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
257             ]);
258         }
259
260         After appending this twice it would be expected that the second
261         generation takes fully over the first, since the timestamps are
262         completely the same. Due to the bug, sync frames with an overlap, like
263         the third one in that list, actually persist from the first
264         generation, due to lack of tolerance when comparing the start of a new
265         frame with highestPresentationTimestamp.
266
267         This patch introduces the tolerance in that case too to fix this
268         problem.
269
270         Test: media/media-source/media-source-append-twice-overlapping-sync-frame.html
271
272         * Modules/mediasource/SourceBuffer.cpp:
273         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
274
275 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
276
277         Unreviewed GTK build fix
278         https://bugs.webkit.org/show_bug.cgi?id=195863
279         <rdar://problem/49006248>
280
281         Patch by Diego Pino.
282
283         * svg/SVGTests.h:
284
285 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
286
287         Unreviewed, rolling out r243132.
288
289         Broke GTK build
290
291         Reverted changeset:
292
293         "Make WTFLogChannelState and WTFLogLevel enum classes"
294         https://bugs.webkit.org/show_bug.cgi?id=195904
295         https://trac.webkit.org/changeset/243132
296
297 2019-03-19  Antti Koivisto  <antti@apple.com>
298
299         Layer with no backing store should still hit-test over a scroller
300         https://bugs.webkit.org/show_bug.cgi?id=195378
301         <rdar://problem/48652078>
302
303         Reviewed by Simon Fraser.
304
305         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
306                fast/scrolling/ios/overflow-scroll-overlap-4.html
307
308         Move collecting event region from paint to compositing update time.
309         This solves a number of problems including regions for non-painting layers.
310
311         * platform/graphics/GraphicsLayer.h:
312         * rendering/RenderBlock.cpp:
313         (WebCore::RenderBlock::paintObject):
314
315         Use the existing visibleToHitTesting() helper.
316
317         * rendering/RenderLayer.cpp:
318         (WebCore::RenderLayer::paintLayerContents):
319
320         Use flag for event region collecting, don't paint content.
321
322         (WebCore::RenderLayer::paintList):
323
324         We can bail out immediately if there is no overflow.
325
326         (WebCore::RenderLayer::paintForegroundForFragments):
327         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
328         (WebCore::RenderLayer::collectEventRegionForFragments):
329
330         Move to a separate function.
331
332         * rendering/RenderLayer.h:
333         * rendering/RenderLayerBacking.cpp:
334         (WebCore::RenderLayerBacking::updateConfiguration):
335
336         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
337
338         (WebCore::RenderLayerBacking::updateEventRegion):
339         (WebCore::RenderLayerBacking::paintIntoLayer):
340         * rendering/RenderLayerBacking.h:
341
342 2019-03-18  Alex Christensen  <achristensen@webkit.org>
343
344         Make WTFLogChannelState and WTFLogLevel enum classes
345         https://bugs.webkit.org/show_bug.cgi?id=195904
346
347         Reviewed by Eric Carlson.
348
349         * Modules/mediasource/SourceBuffer.cpp:
350         (WebCore::removeSamplesFromTrackBuffer):
351         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
352         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
353         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
354         * dom/Document.cpp:
355         (WebCore::messageLevelFromWTFLogLevel):
356         * html/FTPDirectoryDocument.cpp:
357         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
358         * html/HTMLMediaElement.cpp:
359         (WebCore::HTMLMediaElement::seekTask):
360         (WebCore::HTMLMediaElement::selectNextSourceChild):
361         (WebCore::HTMLMediaElement::sourceWasAdded):
362         (WebCore::HTMLMediaElement::sourceWasRemoved):
363         * inspector/agents/WebConsoleAgent.cpp:
364         (WebCore::WebConsoleAgent::getLoggingChannels):
365         (WebCore::channelConfigurationForString):
366         * platform/Logging.cpp:
367         (WebCore::isLogChannelEnabled):
368         (WebCore::setLogChannelToAccumulate):
369         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
370         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
371         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
372         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
373         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
374         (WebCore::initializePeerConnectionFactoryAndThreads):
375         * rendering/RenderLayerCompositor.cpp:
376         (WebCore::compositingLogEnabled):
377
378 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
379
380         Remove the SVG property tear off objects for SVGStringList
381         https://bugs.webkit.org/show_bug.cgi?id=195863
382
383         Reviewed by Simon Fraser.
384
385         SVGStringList is not animated list. So we need to introduce two new classes:
386
387         -- SVGProperty: This will be the base of all the non-animated properties.
388            Like the SVGAnimatedProperty, SVGProperty will be registered with the
389            attribute name in SVGPropertyRegistery. It will also commit changes
390            to the reflecting attribute. And it will provide a synchronize string
391            for lazy attribute update.
392
393         -- SVGList: It will be the base of all the list properties. It can hold
394            primitive types or SVG types. In this patch primitive types will be 
395            supported only. To do that, a superclass called SVGPrimitiveList is
396            added. Its items are of primitive type such as String type.
397
398         * Sources.txt:
399         * WebCore.xcodeproj/project.pbxproj:
400         * svg/SVGElement.cpp:
401         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
402         (WebCore::SVGElement::commitPropertyChange):
403         * svg/SVGElement.h:
404         * svg/SVGStringList.h:
405         * svg/SVGStringListValues.cpp: Removed.
406         * svg/SVGStringListValues.h: Removed.
407         * svg/SVGTests.cpp:
408         (WebCore::SVGTests::SVGTests):
409         (WebCore::SVGTests::isKnownAttribute):
410         (WebCore::SVGTests::isValid const):
411         (WebCore::SVGTests::parseAttribute):
412         (WebCore::SVGTests::registerAttributes): Deleted.
413         (WebCore::SVGTests::requiredFeatures): Deleted.
414         (WebCore::SVGTests::requiredExtensions): Deleted.
415         (WebCore::SVGTests::systemLanguage): Deleted.
416         * svg/SVGTests.h:
417         (WebCore::SVGTests::requiredFeatures):
418         (WebCore::SVGTests::requiredExtensions):
419         (WebCore::SVGTests::systemLanguage):
420         (): Deleted.
421         * svg/SVGTests.idl:
422         * svg/SVGTextPositioningElement.h:
423         * svg/SVGViewElement.cpp:
424         (WebCore::SVGViewElement::SVGViewElement):
425         (WebCore::SVGViewElement::parseAttribute):
426         (WebCore::SVGViewElement::viewTarget): Deleted.
427         * svg/SVGViewElement.h:
428         * svg/properties/SVGAnimatedListPropertyTearOff.h:
429         * svg/properties/SVGAnimatedPrimitiveProperty.h:
430         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
431         * svg/properties/SVGAnimatedProperty.cpp:
432         (WebCore::SVGAnimatedProperty::commitPropertyChange):
433         * svg/properties/SVGAnimatedProperty.h:
434         * svg/properties/SVGAttributeRegistry.h:
435         * svg/properties/SVGList.h: Added.
436         (WebCore::SVGList::numberOfItems const):
437         (WebCore::SVGList::clear):
438         (WebCore::SVGList::getItem):
439         (WebCore::SVGList::initialize):
440         (WebCore::SVGList::insertItemBefore):
441         (WebCore::SVGList::replaceItem):
442         (WebCore::SVGList::removeItem):
443         (WebCore::SVGList::appendItem):
444         (WebCore::SVGList::items):
445         (WebCore::SVGList::items const):
446         (WebCore::SVGList::size const):
447         (WebCore::SVGList::isEmpty const):
448         (WebCore::SVGList::clearItems):
449         (WebCore::SVGList::canAlterList const):
450         (WebCore::SVGList::canGetItem):
451         (WebCore::SVGList::canReplaceItem):
452         (WebCore::SVGList::canRemoveItem):
453         (WebCore::SVGList::detachItems):
454         * svg/properties/SVGMemberAccessor.h:
455         (WebCore::SVGMemberAccessor::matches const):
456         * svg/properties/SVGPrimitiveList.h: Added.
457         * svg/properties/SVGProperty.h:
458         (WebCore::SVGProperty::isAttached const):
459         (WebCore::SVGProperty::attach):
460         (WebCore::SVGProperty::detach):
461         (WebCore::SVGProperty::contextElement const):
462         (WebCore::SVGProperty::commitChange):
463         (WebCore::SVGProperty::access const):
464         (WebCore::SVGProperty::isReadOnly const):
465         (WebCore::SVGProperty::isDirty const):
466         (WebCore::SVGProperty::setDirty):
467         (WebCore::SVGProperty::synchronize):
468         (WebCore::SVGProperty::valueAsString const):
469         (WebCore::SVGProperty::SVGProperty):
470         * svg/properties/SVGPropertyAccessor.h: Added.
471         * svg/properties/SVGPropertyAccessorImpl.h: Added.
472         * svg/properties/SVGPropertyOwner.h:
473         (WebCore::SVGPropertyOwner::commitPropertyChange):
474         * svg/properties/SVGPropertyOwnerRegistry.h:
475         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
476         * svg/properties/SVGPropertyRegistry.h:
477         * svg/properties/SVGStaticListPropertyTearOff.h: Removed.
478
479 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
480
481         Unreviewed followup to r243126.
482
483         LayerRepresentation operator=() needs to copy m_graphicsLayer now that it doesn't
484         share a pointer with m_typelessPlatformLayer. Also make the LayerRepresentation construction
485         from a GraphiscLayer* explicit.
486
487         * page/scrolling/ScrollingStateNode.h:
488         (WebCore::LayerRepresentation::operator=):
489         (WebCore::LayerRepresentation::toRepresentation const):
490
491 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
492
493         Scrolling state nodes should hold references to GraphicsLayers
494         https://bugs.webkit.org/show_bug.cgi?id=195844
495         <rdar://problem/48949634>
496
497         Reviewed by Tim Horton.
498
499         GraphicsLayers are refcounted, and the scrolling tree keeps GraphicsLayer pointers,
500         so for safely the scrolling tree should store RefPtr<GraphicsLayer> instead.
501
502         I removed the union (since it would be weird with a RefPtr and raw pointer). This code
503         should probably use WTF::Variant<> in future.
504
505         * page/scrolling/ScrollingStateNode.h:
506         (WebCore::LayerRepresentation::LayerRepresentation):
507         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
508
509 2019-03-18  Commit Queue  <commit-queue@webkit.org>
510
511         Unreviewed, rolling out r243092 and r243096.
512         https://bugs.webkit.org/show_bug.cgi?id=195926
513
514         Caused assertions in tests (Requested by smfr on #webkit).
515
516         Reverted changesets:
517
518         "Layer with no backing store should still hit-test over a
519         scroller"
520         https://bugs.webkit.org/show_bug.cgi?id=195378
521         https://trac.webkit.org/changeset/243092
522
523         "Try to fix Windows build."
524         https://trac.webkit.org/changeset/243096
525
526 2019-03-18  Megan Gardner  <megan_gardner@apple.com>
527
528         Smart Insert for paragraphs.
529         https://bugs.webkit.org/show_bug.cgi?id=194880
530
531         Reviewed by Ryosuke Niwa.
532
533         Add additional newlines to maintain spacing around paragraphs.
534
535         Tests: editing/pasteboard/smart-paste-paragraph-001.html
536                editing/pasteboard/smart-paste-paragraph-002.html
537                editing/pasteboard/smart-paste-paragraph-003.html
538                editing/pasteboard/smart-paste-paragraph-004.html
539
540         * dom/Document.cpp:
541         (WebCore::Document::editingBehavior const):
542         * dom/Document.h:
543
544         Expose editing behaviour through document so that is can be access from the selection commands
545         and allow the editing behaviour to be used.
546
547         * editing/CompositeEditCommand.h:
548         * editing/EditingBehavior.h:
549         (WebCore::EditingBehavior::shouldSmartInsertDeleteParagraphs const):
550
551         Only have editing insert paragraphs on iOS and in editing elements that support multiple lines.
552
553         * editing/ReplaceSelectionCommand.cpp:
554         (WebCore::ReplaceSelectionCommand::doApply):
555         (WebCore::ReplaceSelectionCommand::shouldPerformSmartParagraphReplace const):
556         (WebCore::ReplaceSelectionCommand::addNewLinesForSmartReplace):
557         * editing/ReplaceSelectionCommand.h:
558
559         Add addititional newlines when pasting full paragraphs to maintian two newlines between paragraphs
560         if that is what the original document had. If there are not multiple lines between paragraphs, do not
561         add additional new lines.
562
563 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
564
565         Reduce the size of Node::deref by eliminating an explicit parentNode check
566         https://bugs.webkit.org/show_bug.cgi?id=195776
567
568         Reviewed by Geoffrey Garen.
569
570         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
571         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
572         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
573
574         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
575         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
576         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
577         is identically equal to 0.
578
579         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
580         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
581         or not when m_referencingNodeCount becomes 0.
582
583         No new tests since there should be no behavioral change.
584
585         * dom/Document.cpp:
586         (WebCore::Document::removedLastRef):
587         * dom/Document.h:
588         (WebCore::Document::decrementReferencingNodeCount):
589         * dom/Node.cpp:
590         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
591         (WebCore::Node::~Node):
592         (WebCore::Node::removedLastRef):
593         * dom/Node.h:
594         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
595         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
596         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
597         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
598         (WebCore::Node::hasOneRef const):
599         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
600         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
601         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
602
603 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
604
605         Remove the SVG property tear off objects for SVGAnimatedBoolean
606         https://bugs.webkit.org/show_bug.cgi?id=195862
607
608         Reviewed by Simon Fraser.
609
610         -- SVGAnimatedBoolean will be defined as SVGAnimatedPrimitiveProperty<bool>.
611         -- SVGAnimatedBooleanAccessor is added to access a member of this type.
612         -- A function registerProperty() is added to SVGPropertyOwnerRegistry
613            to register this type.
614         -- SVGAnimatedBooleanAnimator is added to animate a member of this type.
615         -- SVGAnimationBooleanFunction is added to handle the progress of this
616            new type over a period of time.
617
618         SVGAnimationDiscreteFunction is the base class of SVGAnimationBooleanFunction.
619         It will be the base class of all the discrete animation function types:
620         string, bool, enum and PreserveAspectRatio types.
621
622         * Sources.txt:
623         * WebCore.xcodeproj/project.pbxproj:
624         * svg/SVGAnimationElement.h:
625         * svg/SVGAnimatorFactory.h:
626         (WebCore::SVGAnimatorFactory::create):
627         * svg/SVGClipPathElement.h:
628         * svg/SVGCursorElement.h:
629         * svg/SVGDefsElement.h:
630         * svg/SVGExternalResourcesRequired.cpp:
631         (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
632         (WebCore::SVGExternalResourcesRequired::parseAttribute):
633         (WebCore::SVGExternalResourcesRequired::registerAttributes): Deleted.
634         * svg/SVGExternalResourcesRequired.h:
635         (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
636         (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
637         (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): Deleted.
638         * svg/SVGFEConvolveMatrixElement.cpp:
639         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
640         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
641         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
642         * svg/SVGFEConvolveMatrixElement.h:
643         * svg/SVGFEImageElement.h:
644         * svg/SVGFontElement.h:
645         * svg/SVGForeignObjectElement.h:
646         * svg/SVGGElement.h:
647         * svg/SVGGradientElement.h:
648         * svg/SVGMPathElement.h:
649         * svg/SVGMarkerElement.h:
650         * svg/SVGMaskElement.h:
651         * svg/SVGPathElement.h:
652         * svg/SVGPatternElement.h:
653         * svg/SVGRectElement.h:
654         * svg/SVGSVGElement.h:
655         * svg/SVGScriptElement.h:
656         * svg/SVGSwitchElement.h:
657         * svg/SVGSymbolElement.h:
658         * svg/SVGTextContentElement.h:
659         * svg/SVGUseElement.h:
660         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
661         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
662         * svg/properties/SVGAnimatedPropertyImpl.h:
663         * svg/properties/SVGAnimationDiscreteFunction.h: Added.
664         (WebCore::SVGAnimationDiscreteFunction::SVGAnimationDiscreteFunction):
665         (WebCore::SVGAnimationDiscreteFunction::progress):
666         * svg/properties/SVGAnimationDiscreteFunctionImpl.h: Added.
667         * svg/properties/SVGAttributeRegistry.h:
668         * svg/properties/SVGPropertyOwnerRegistry.h:
669         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
670
671 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
672
673         Crash when reloading test with async overflow scrolling
674         https://bugs.webkit.org/show_bug.cgi?id=195629
675         <rdar://problem/48814045>
676
677         Reviewed by Antoine Quint.
678
679         RenderLayerCompositor::removeFromScrollCoordinatedLayers needs to pass the Positioning
680         bit to make sure we remove RenderLayers added m_scrollingNodeToLayerMap for Positioning
681         scrolling nodes.
682
683         Fixes crashes seen in compositing/clipping/border-radius-async-overflow-non-stacking.html
684         and scrollingcoordinator/scrolling-tree/remove-coordinated-frame.html.
685
686         * rendering/RenderLayerBacking.cpp:
687         (WebCore::RenderLayerBacking::~RenderLayerBacking):
688         * rendering/RenderLayerCompositor.cpp:
689         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
690
691 2019-03-18  Devin Rousso  <drousso@apple.com>
692
693         Web Inspector: Timeline: lazily create the agent
694         https://bugs.webkit.org/show_bug.cgi?id=195865
695         <rdar://problem/48965403>
696
697         Reviewed by Joseph Pecoraro.
698
699         No change in functionality.
700
701         * inspector/agents/InspectorTimelineAgent.h:
702         * inspector/agents/InspectorTimelineAgent.cpp:
703         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
704         (WebCore::InspectorTimelineAgent::toggleScriptProfilerInstrument):
705         (WebCore::InspectorTimelineAgent::toggleHeapInstrument):
706         (WebCore::InspectorTimelineAgent::setFrameIdentifier):
707
708         * inspector/InspectorInstrumentation.h:
709         (WebCore::InspectorInstrumentation::startProfiling):
710         (WebCore::InspectorInstrumentation::stopProfiling):
711         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
712         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
713
714         * inspector/InstrumentingAgents.h:
715         (WebCore::InstrumentingAgents::inspectorScriptProfilerAgent const): Added.
716         (WebCore::InstrumentingAgents::setInspectorScriptProfilerAgent): Added.
717         * inspector/InstrumentingAgents.cpp:
718         (WebCore::InstrumentingAgents::reset):
719
720         * inspector/InspectorController.cpp:
721         (WebCore::InspectorController::InspectorController):
722         (WebCore::InspectorController::createLazyAgents):
723
724 2019-03-18  Darin Adler  <darin@apple.com>
725
726         Cut down on use of StringBuffer, possibly leading toward removing it entirely
727         https://bugs.webkit.org/show_bug.cgi?id=195870
728
729         Reviewed by Daniel Bates.
730
731         * dom/Document.cpp:
732         (WebCore::canonicalizedTitle): Fixed all the problems mentioned in "FIXME".
733         Made this a single function rather than a function template. Switch to
734         StringBuilder instead of StringBuffer. Return the original string if the
735         canonicalize operation doesn't change anything.
736         (WebCore::Document::updateTitle): Updated for the change above.
737
738         * platform/Length.cpp:
739         (WebCore::newCoordsArray): Use createUninitialized instead of StringBuffer.
740         Also got rid of unneeded use of upconvertedCharacters on a temporary string
741         that we explicitly created with 16-bit characters. The performance of this
742         function could be considerably simplified by not copying the original string
743         at all, but didn't do that at this time.
744
745         * platform/text/TextCodecUTF16.cpp:
746         (WebCore::TextCodecUTF16::decode): Use createUninitialized instead of
747         StringBuffer. Also renamed numChars to numCodeUnits to both switch to complete
748         words and to be slightly more accurate.
749
750         * rendering/RenderText.cpp:
751         (WebCore::convertNoBreakSpace): Added.
752         (WebCore::capitalize): Use Vector instead of StringBuffer. Simplify code by
753         using convertNoBreakSpace function. Removed code that was using StringImpl
754         directly for a tiny speed boost; if we want to optimize the performance of
755         this function we would need to do more than that. Return the original string
756         if it happens to already be capitalized.
757
758 2019-03-18  Timothy Hatcher  <timothy@apple.com>
759
760         WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
761         https://bugs.webkit.org/show_bug.cgi?id=195916
762
763         Reviewed by Tim Horton.
764
765         * WebCore.xcodeproj/project.pbxproj: Make ColorIOS.h a private header.
766         * platform/ios/ColorIOS.h: Export colorFromUIColor.
767
768 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
769
770         Define the type of SVGPropertyOwnerRegistry for all SVG elements
771         https://bugs.webkit.org/show_bug.cgi?id=195859
772
773         Reviewed by Simon Fraser.
774
775         SVGPropertyOwnerRegistry will eventually replace SVGAttributeOwnerProxyImpl.
776
777         * svg/SVGAElement.h:
778         * svg/SVGAltGlyphElement.h:
779         * svg/SVGAnimationElement.h:
780         * svg/SVGCircleElement.h:
781         * svg/SVGClipPathElement.h:
782         * svg/SVGComponentTransferFunctionElement.h:
783         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
784         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
785         * svg/SVGCursorElement.h:
786         * svg/SVGDefsElement.h:
787         * svg/SVGElement.h:
788         * svg/SVGEllipseElement.h:
789         * svg/SVGExternalResourcesRequired.h:
790         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
791         * svg/SVGFEBlendElement.h:
792         * svg/SVGFEColorMatrixElement.h:
793         * svg/SVGFEComponentTransferElement.h:
794         * svg/SVGFECompositeElement.h:
795         * svg/SVGFEConvolveMatrixElement.h:
796         * svg/SVGFEDiffuseLightingElement.h:
797         * svg/SVGFEDisplacementMapElement.h:
798         * svg/SVGFEDropShadowElement.h:
799         * svg/SVGFEGaussianBlurElement.h:
800         * svg/SVGFEImageElement.h:
801         * svg/SVGFELightElement.h:
802         (WebCore::SVGFELightElement::attributeRegistry):
803         (WebCore::SVGFELightElement::isKnownAttribute):
804         * svg/SVGFEMergeNodeElement.h:
805         * svg/SVGFEMorphologyElement.h:
806         * svg/SVGFEOffsetElement.h:
807         * svg/SVGFESpecularLightingElement.h:
808         * svg/SVGFETileElement.h:
809         * svg/SVGFETurbulenceElement.cpp:
810         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
811         * svg/SVGFETurbulenceElement.h:
812         * svg/SVGFilterElement.h:
813         * svg/SVGFilterPrimitiveStandardAttributes.h:
814         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
815         * svg/SVGFitToViewBox.h:
816         (WebCore::SVGFitToViewBox::isKnownAttribute):
817         * svg/SVGFontElement.h:
818         * svg/SVGForeignObjectElement.h:
819         * svg/SVGGElement.h:
820         * svg/SVGGeometryElement.h:
821         (WebCore::SVGGeometryElement::isKnownAttribute):
822         * svg/SVGGlyphRefElement.h:
823         * svg/SVGGradientElement.h:
824         (WebCore::SVGGradientElement::isKnownAttribute):
825         * svg/SVGGraphicsElement.h:
826         (WebCore::SVGGraphicsElement::isKnownAttribute):
827         * svg/SVGImageElement.h:
828         * svg/SVGLineElement.h:
829         * svg/SVGLinearGradientElement.h:
830         * svg/SVGMPathElement.h:
831         * svg/SVGMarkerElement.h:
832         * svg/SVGMaskElement.h:
833         * svg/SVGPathElement.h:
834         * svg/SVGPatternElement.h:
835         * svg/SVGPolyElement.h:
836         (WebCore::SVGPolyElement::attributeRegistry):
837         (WebCore::SVGPolyElement::isKnownAttribute):
838         * svg/SVGRadialGradientElement.h:
839         * svg/SVGRectElement.h:
840         * svg/SVGSVGElement.h:
841         * svg/SVGScriptElement.h:
842         * svg/SVGStopElement.h:
843         * svg/SVGSwitchElement.h:
844         * svg/SVGSymbolElement.h:
845         * svg/SVGTRefElement.h:
846         * svg/SVGTests.h:
847         * svg/SVGTextContentElement.h:
848         (WebCore::SVGTextContentElement::isKnownAttribute):
849         * svg/SVGTextPathElement.h:
850         * svg/SVGTextPositioningElement.h:
851         (WebCore::SVGTextPositioningElement::isKnownAttribute):
852         * svg/SVGURIReference.h:
853         * svg/SVGUseElement.h:
854         * svg/SVGViewElement.h:
855         * svg/SVGViewSpec.h:
856         * svg/SVGZoomAndPan.cpp:
857         (WebCore::SVGZoomAndPan::parseZoomAndPan):
858         (WebCore::SVGZoomAndPan::parseAttribute):
859         (WebCore::SVGZoomAndPan::SVGZoomAndPan): Deleted.
860         (WebCore::SVGZoomAndPan::registerAttributes): Deleted.
861         * svg/SVGZoomAndPan.h:
862         (WebCore::SVGZoomAndPan::zoomAndPan const):
863         (WebCore::SVGZoomAndPan::setZoomAndPan):
864         (WebCore::SVGZoomAndPan::reset):
865         (WebCore::SVGZoomAndPan::attributeRegistry): Deleted.
866         (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
867
868 2019-03-18  Timothy Hatcher  <timothy@apple.com>
869
870         Add new NSAttributedString API for converting HTML.
871         https://bugs.webkit.org/show_bug.cgi?id=195636
872         rdar://problem/45055697
873
874         Reviewed by Tim Horton.
875
876         * en.lproj/Localizable.strings: Updated.
877
878 2019-03-18  Zalan Bujtas  <zalan@apple.com>
879
880         Call transition and animation callbacks on non-composited renderers too.
881         https://bugs.webkit.org/show_bug.cgi?id=195907
882
883         Reviewed by Simon Fraser.
884
885         These callbacks are not composited specific functions.
886
887         * page/animation/AnimationBase.cpp:
888         (WebCore::AnimationBase::freezeAtTime):
889         (WebCore::AnimationBase::compositedRenderer const): Deleted.
890         * page/animation/AnimationBase.h:
891         * page/animation/ImplicitAnimation.cpp:
892         (WebCore::ImplicitAnimation::startAnimation):
893         (WebCore::ImplicitAnimation::pauseAnimation):
894         (WebCore::ImplicitAnimation::endAnimation):
895         * page/animation/KeyframeAnimation.cpp:
896         (WebCore::KeyframeAnimation::startAnimation):
897         (WebCore::KeyframeAnimation::pauseAnimation):
898         (WebCore::KeyframeAnimation::endAnimation):
899         * rendering/RenderLayerModelObject.cpp:
900         (WebCore::RenderLayerModelObject::startTransition):
901         (WebCore::RenderLayerModelObject::transitionPaused):
902         (WebCore::RenderLayerModelObject::transitionFinished):
903         (WebCore::RenderLayerModelObject::startAnimation):
904         (WebCore::RenderLayerModelObject::animationPaused):
905         (WebCore::RenderLayerModelObject::animationSeeked):
906         (WebCore::RenderLayerModelObject::animationFinished):
907         (WebCore::RenderLayerModelObject::suspendAnimations):
908
909 2019-03-18  Jer Noble  <jer.noble@apple.com>
910
911         Add experimental "alphaChannel" property to VideoConfiguration
912         https://bugs.webkit.org/show_bug.cgi?id=195853
913
914         Reviewed by Eric Carlson.
915
916         Test: media/mediacapabilities/mock-decodingInfo-alphaChannel.html
917
918         Add a new, experimental addition to Media Capabilities to allow pages to query for
919         alpha channel support.
920
921         * Modules/mediacapabilities/MediaCapabilities.cpp:
922         (WebCore::MediaCapabilities::decodingInfo):
923         * Modules/mediacapabilities/MediaCapabilities.h:
924         * Modules/mediacapabilities/MediaCapabilities.idl:
925         * Modules/mediacapabilities/VideoConfiguration.idl:
926         * SourcesCocoa.txt:
927         * WebCore.xcodeproj/project.pbxproj:
928         * platform/cocoa/VideoToolboxSoftLink.cpp:
929         * platform/cocoa/VideoToolboxSoftLink.h:
930         * platform/graphics/cocoa/HEVCUtilitiesCocoa.h:
931         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: Renamed from Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp.
932         (WebCore::validateHEVCParameters):
933         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
934         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
935         * platform/mediacapabilities/VideoConfiguration.h:
936         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
937         (WebCore::canDecodeMedia):
938         (WebCore::canEncodeMedia):
939
940 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
941
942         Remove unused webkitEditableContentChanged event
943         https://bugs.webkit.org/show_bug.cgi?id=195909
944
945         Reviewed by Wenson Hsieh.
946
947         Removed webkitEditableContentChanged event which is no longer used after r206944.
948
949         Note that only WebKit's C++ code can fire events in TextControlInnerElements
950         since the element is an implementation detail of input and textarea elements.
951
952         * dom/EventNames.h:
953         * html/shadow/TextControlInnerElements.cpp:
954         (WebCore::TextControlInnerTextElement::defaultEventHandler):
955
956 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
957
958         [WHLSL] Hook up the compiler to our WebGPU implementation
959         https://bugs.webkit.org/show_bug.cgi?id=195509
960
961         Unreviewed.
962
963         Update after r243091.
964
965         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
966         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
967         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
968
969 2019-03-18  Chris Dumez  <cdumez@apple.com>
970
971         REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
972         https://bugs.webkit.org/show_bug.cgi?id=195322
973
974         Reviewed by Ryosuke Niwa.
975
976         Since r236862, DOMWindow objects get disconnected from their Frame object as soon as
977         their iframe element gets removed from the document. Previously, DOMWindow was a
978         FrameDestructionObserver and would stay connected to its frame until the frame died.
979
980         This means that some of the work that we were doing in DOMWindow::frameDestroyed() and
981         Document::willDetachPage() no longer happens for subframe windows because they get
982         disconnected from their frame because they get a chance to get such notifications.
983         To address this issue, we now also do this work in DOMWindow::willDetachDocumentFromFrame()
984         which gets called when the iframe gets removed from the document and the document / window
985         get disconnected from the Frame element.
986
987         No new tests, verified locally that the leak is gone on JetStream.
988
989         * page/DOMWindow.cpp:
990         (WebCore::DOMWindow::willDetachDocumentFromFrame):
991
992 2019-03-18  Zalan Bujtas  <zalan@apple.com>
993
994         Move animation and transition functions from RenderBoxModelObject to RenderElement
995         https://bugs.webkit.org/show_bug.cgi?id=195903
996
997         Reviewed by Simon Fraser.
998
999         Transitions and animations do not require RenderBoxModelObject. Move these functions to RenderElement and override them at RenderLayerModelObject to support
1000         composition related callbacks.
1001
1002         * page/animation/AnimationBase.cpp:
1003         (WebCore::AnimationBase::compositedRenderer const):
1004         * page/animation/AnimationBase.h:
1005         * rendering/RenderBoxModelObject.cpp:
1006         (WebCore::RenderBoxModelObject::startTransition): Deleted.
1007         (WebCore::RenderBoxModelObject::transitionPaused): Deleted.
1008         (WebCore::RenderBoxModelObject::transitionFinished): Deleted.
1009         (WebCore::RenderBoxModelObject::startAnimation): Deleted.
1010         (WebCore::RenderBoxModelObject::animationPaused): Deleted.
1011         (WebCore::RenderBoxModelObject::animationSeeked): Deleted.
1012         (WebCore::RenderBoxModelObject::animationFinished): Deleted.
1013         (WebCore::RenderBoxModelObject::suspendAnimations): Deleted.
1014         * rendering/RenderBoxModelObject.h:
1015         * rendering/RenderElement.cpp:
1016         (WebCore::RenderElement::startTransition):
1017         (WebCore::RenderElement::transitionPaused):
1018         (WebCore::RenderElement::transitionFinished):
1019         (WebCore::RenderElement::startAnimation):
1020         (WebCore::RenderElement::animationPaused):
1021         (WebCore::RenderElement::animationSeeked):
1022         (WebCore::RenderElement::animationFinished):
1023         (WebCore::RenderElement::suspendAnimations):
1024         * rendering/RenderElement.h:
1025
1026 2019-03-18  Antti Koivisto  <antti@apple.com>
1027
1028         Try to fix Windows build.
1029
1030         * rendering/RenderLayerBacking.cpp:
1031         (WebCore::RenderLayerBacking::updateEventRegion):
1032
1033 2019-03-18  Antti Koivisto  <antti@apple.com>
1034
1035         Layer with no backing store should still hit-test over a scroller
1036         https://bugs.webkit.org/show_bug.cgi?id=195378
1037         <rdar://problem/48652078>
1038
1039         Reviewed by Simon Fraser.
1040
1041         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
1042                fast/scrolling/ios/overflow-scroll-overlap-4.html
1043
1044         Move collecting event region from paint to compositing update time.
1045         This solves a number of problems including regions for non-painting layers.
1046
1047         * platform/graphics/GraphicsLayer.h:
1048         * rendering/RenderBlock.cpp:
1049         (WebCore::RenderBlock::paintObject):
1050
1051         Use the existing visibleToHitTesting() helper.
1052
1053         * rendering/RenderLayer.cpp:
1054         (WebCore::RenderLayer::paintLayerContents):
1055
1056         Use flag for event region collecting, don't paint content.
1057
1058         (WebCore::RenderLayer::paintList):
1059
1060         We can bail out immediately if there is no overflow.
1061
1062         (WebCore::RenderLayer::paintForegroundForFragments):
1063         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1064         (WebCore::RenderLayer::collectEventRegionForFragments):
1065
1066         Move to a separate function.
1067
1068         * rendering/RenderLayer.h:
1069         * rendering/RenderLayerBacking.cpp:
1070         (WebCore::RenderLayerBacking::updateConfiguration):
1071
1072         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
1073
1074         (WebCore::RenderLayerBacking::updateEventRegion):
1075         (WebCore::RenderLayerBacking::paintIntoLayer):
1076         * rendering/RenderLayerBacking.h:
1077
1078 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
1079
1080         [WHLSL] Hook up the compiler to our WebGPU implementation
1081         https://bugs.webkit.org/show_bug.cgi?id=195509
1082
1083         Reviewed by Dean Jackson.
1084
1085         This represents a collection of changes necessary to compile and run the first WHLSL program in WebKit.
1086
1087         Because WHLSL isn't fully implemented yet, this patch doesn't remove the existing method for supplying
1088         Metal shaders to WebGPU. Instead, it adds a new boolean to WebGPUShaderModuleDescriptor, "isWHLSL" which
1089         causes us to run the WHLSL compiler.
1090
1091         More details below.
1092
1093         Test: webgpu/whlsl.html
1094
1095         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Use raw pointer instead of Optional<std::reference_wrapper>.
1096         (WebCore::WHLSL::AST::CallExpression::setCastData):
1097         (WebCore::WHLSL::AST::CallExpression::isCast):
1098         (WebCore::WHLSL::AST::CallExpression::castReturnType):
1099         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
1100         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
1101         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsAtomic):
1102         (WebCore::WHLSL::AST::NativeTypeDeclaration::name const): Deleted. The parent class already has a name string.
1103         (WebCore::WHLSL::AST::NativeTypeDeclaration::name): Deleted.
1104         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
1105         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1106         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const): When cloning a type reference, make sure to
1107         clone the pointer to its resolved type, too.
1108         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
1109         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Incorporate resolution from
1110         https://github.com/gpuweb/gpuweb/pull/188.
1111         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
1112         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
1113         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
1114         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
1115         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
1116         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Support semantics being placed directly on the
1117         entry point, instead of being placed on a structure member.
1118         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
1119         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
1120         (WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const): Deleted.
1121         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
1122         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1123         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1124         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
1125         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
1126         (WebCore::WHLSL::Metal::metalFunctions):
1127         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups): Deleted. After
1128         https://github.com/gpuweb/gpuweb/pull/188, we don't need the mappings.
1129         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups): Deleted. Ditto.
1130         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups): Deleted. Ditto.
1131         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Ditto.
1132         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Ditto.
1133         (WebCore::WHLSL::Metal::generateMetalCodeShared):
1134         (WebCore::WHLSL::Metal::generateMetalCode):
1135         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Ditto.
1136         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Support compiler-generated functions. Change
1137         CRASH() to notImplemented().
1138         (WebCore::WHLSL::Metal::writeNativeFunction):
1139         (WebCore::WHLSL::Metal::getNativeName): Deleted.
1140         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
1141         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
1142         (WebCore::WHLSL::Metal::writeNativeType): 
1143         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: The dependency graph needs to track all unnamed types. Also,
1144         we need to track types that are the results of expressions (not just types literally spelled out in the
1145         program). Enumerations need to be emitted after their base types are emitted.
1146         (WebCore::WHLSL::Metal::TypeNamer::visit):
1147         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
1148         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
1149         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
1150         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
1151         (WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions):
1152         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
1153         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
1154         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
1155         (WebCore::WHLSL::checkDuplicateFunctions):
1156         * Modules/webgpu/WHLSL/WHLSLChecker.cpp: Wrap ResolvingType in a class to make sure it plays nicely with
1157         HashMap. Also, use raw pointers instead of Optional<std::reference_wrapper>s.
1158         (WebCore::WHLSL::resolveWithReferenceComparator):
1159         (WebCore::WHLSL::resolveByInstantiation):
1160         (WebCore::WHLSL::checkOperatorOverload):
1161         (WebCore::WHLSL::Checker::assignTypes):
1162         (WebCore::WHLSL::Checker::checkShaderType):
1163         (WebCore::WHLSL::Checker::visit):
1164         (WebCore::WHLSL::matchAndCommit):
1165         (WebCore::WHLSL::Checker::recurseAndGetInfo):
1166         (WebCore::WHLSL::Checker::assignType):
1167         (WebCore::WHLSL::Checker::forwardType):
1168         (WebCore::WHLSL::getUnnamedType):
1169         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
1170         (WebCore::WHLSL::Checker::isBoolType):
1171         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
1172         (WebCore::WHLSL::Gatherer::visit):
1173         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
1174         (WebCore::WHLSL::inferTypesForCall):
1175         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
1176         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
1177         (WebCore::WHLSL::Intrinsics::addPrimitive):
1178         (WebCore::WHLSL::Intrinsics::addFullTexture):
1179         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1180         (WebCore::WHLSL::Intrinsics::ucharType const):
1181         (WebCore::WHLSL::Intrinsics::ushortType const):
1182         (WebCore::WHLSL::Intrinsics::charType const):
1183         (WebCore::WHLSL::Intrinsics::shortType const):
1184         (WebCore::WHLSL::Intrinsics::intType const):
1185         (WebCore::WHLSL::Intrinsics::uchar2Type const):
1186         (WebCore::WHLSL::Intrinsics::uchar4Type const):
1187         (WebCore::WHLSL::Intrinsics::ushort2Type const):
1188         (WebCore::WHLSL::Intrinsics::ushort4Type const):
1189         (WebCore::WHLSL::Intrinsics::uint2Type const):
1190         (WebCore::WHLSL::Intrinsics::uint4Type const):
1191         (WebCore::WHLSL::Intrinsics::char2Type const):
1192         (WebCore::WHLSL::Intrinsics::char4Type const):
1193         (WebCore::WHLSL::Intrinsics::short2Type const):
1194         (WebCore::WHLSL::Intrinsics::short4Type const):
1195         (WebCore::WHLSL::Intrinsics::int2Type const):
1196         (WebCore::WHLSL::Intrinsics::int4Type const):
1197         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1198         (WebCore::WHLSL::Lexer::recognizeKeyword):
1199         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
1200         (WebCore::WHLSL::NameContext::add):
1201         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1202         (WebCore::WHLSL::NameResolver::visit): Don't visit recursive types.
1203         Also, make sure we preserve the CurrentFunction in our recursive scopes.
1204         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1205         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1206         (WebCore::WHLSL::Parser::fail):
1207         (WebCore::WHLSL::Parser::peek):
1208         (WebCore::WHLSL::Parser::parseType):
1209         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
1210         * Modules/webgpu/WHLSL/WHLSLParser.h:
1211         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
1212         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1213         (WebCore::WHLSL::prepareShared):
1214         (WebCore::WHLSL::prepare):
1215         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
1216         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Move big inline functions out-of-line.
1217         (WebCore::WHLSL::RecursiveTypeChecker::visit):
1218         (WebCore::WHLSL::checkRecursiveTypes):
1219         (): Deleted.
1220         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
1221         (WebCore::WHLSL::conversionCost):
1222         (WebCore::WHLSL::resolveFunctionOverloadImpl):
1223         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
1224         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
1225         (WebCore::WHLSL::ResolvingType::ResolvingType):
1226         (WebCore::WHLSL::ResolvingType::operator=):
1227         (WebCore::WHLSL::ResolvingType::getUnnamedType):
1228         (WebCore::WHLSL::ResolvingType::visit):
1229         * Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h.
1230         (WebCore::WHLSL::ScopedSetAdder::ScopedSetAdder):
1231         (WebCore::WHLSL::ScopedSetAdder::~ScopedSetAdder):
1232         (WebCore::WHLSL::ScopedSetAdder::isNewEntry const):
1233         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
1234         (WebCore::WHLSL::isAcceptableFormat):
1235         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Turns out a bunch of texture types don't exist in MSL.
1236         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
1237         (WebCore::WHLSL::synthesizeArrayOperatorLength):
1238         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
1239         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Adding to the program can fail.
1240         (WebCore::WHLSL::synthesizeConstructors): Some constructors shouldn't be generated for "void" and for atomic types.
1241         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Adding to the program can fail.
1242         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Ditto.
1243         (WebCore::WHLSL::synthesizeEnumerationFunctions):
1244         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Ditto.
1245         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Ditto.
1246         (WebCore::WHLSL::synthesizeStructureAccessors):
1247         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Ditto.
1248         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1249         (WebCore::WHLSL::Visitor::visit):
1250         * Modules/webgpu/WebGPUDevice.cpp: Add flag that triggers the WHLSL compiler.
1251         (WebCore::WebGPUDevice::createShaderModule const):
1252         * Modules/webgpu/WebGPUShaderModuleDescriptor.h: Ditto.
1253         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl: Ditto.
1254         * WebCore.xcodeproj/project.pbxproj:
1255         * platform/graphics/gpu/GPUPipelineLayout.h:
1256         (WebCore::GPUPipelineLayout::bindGroupLayouts const):
1257         * platform/graphics/gpu/GPUShaderModule.h: Add a string that represents the WHLSL shader source. The compiler currently
1258         needs the rest of the pipeline state descriptor, so we defer compilation until create*Pipeline().
1259         (WebCore::GPUShaderModule::platformShaderModule const):
1260         (WebCore::GPUShaderModule::whlslSource const):
1261         * platform/graphics/gpu/GPUShaderModuleDescriptor.h:
1262         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert GPU types into WHLSL types, and invoke the compiler.
1263         (WebCore::convertVertexFormat):
1264         (WebCore::convertShaderStageFlags):
1265         (WebCore::convertBindingType):
1266         (WebCore::convertTextureFormat):
1267         (WebCore::convertLayout):
1268         (WebCore::convertRenderPipelineDescriptor):
1269         (WebCore::trySetMetalFunctionsForPipelineDescriptor):
1270         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
1271         (WebCore::trySetFunctionsForPipelineDescriptor):
1272         (WebCore::tryCreateMtlRenderPipelineState):
1273         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
1274         (WebCore::GPUShaderModule::create):
1275         (WebCore::GPUShaderModule::GPUShaderModule):
1276
1277 2019-03-18  Justin Fan  <justin_fan@apple.com>
1278
1279         [Web GPU] GPUAdapter.createDevice -> GPUAdapter.requestDevice
1280         https://bugs.webkit.org/show_bug.cgi?id=195781
1281
1282         Reviewed by Myles C. Maxfield.
1283
1284         A Web GPU device is now acquired via a promise returned from GPUAdapter.requestDevice().
1285
1286         Existing tests updated for new behavior.
1287
1288         * Modules/webgpu/WebGPUAdapter.cpp:
1289         (WebCore::WebGPUAdapter::requestDevice const):
1290         (WebCore::WebGPUAdapter::createDevice): Deleted.
1291         * Modules/webgpu/WebGPUAdapter.h:
1292         * Modules/webgpu/WebGPUAdapter.idl:
1293         * Modules/webgpu/WebGPUDevice.cpp:
1294         (WebCore::WebGPUDevice::tryCreate):
1295         (WebCore::WebGPUDevice::WebGPUDevice):
1296         (WebCore::WebGPUDevice::create): Deleted.
1297         * Modules/webgpu/WebGPUDevice.h:
1298         * platform/graphics/gpu/GPUDevice.h:
1299         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1300         (WebCore::GPUDevice::tryCreate):
1301         (WebCore::GPUDevice::create): Deleted.
1302
1303 2019-03-18  Justin Fan  <justin_fan@apple.com>
1304
1305         [Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
1306         https://bugs.webkit.org/show_bug.cgi?id=195896
1307
1308         Reviewed by Jon Lee.
1309
1310         Rename createDefaultTextureView -> createDefaultView and move setPipeline from GPUProgrammablePassEncoder to GPURenderPassEncoder.
1311
1312         Existing tests updated for createDefaultView name.
1313
1314         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1315         (WebCore::WebGPUProgrammablePassEncoder::setPipeline): Deleted.
1316         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1317         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1318         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1319         (WebCore::WebGPURenderPassEncoder::setPipeline):
1320         * Modules/webgpu/WebGPURenderPassEncoder.h:
1321         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1322         * Modules/webgpu/WebGPUTexture.cpp:
1323         (WebCore::WebGPUTexture::createDefaultView):
1324         (WebCore::WebGPUTexture::createDefaultTextureView): Deleted.
1325         * Modules/webgpu/WebGPUTexture.h:
1326         * Modules/webgpu/WebGPUTexture.idl:
1327         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1328         * platform/graphics/gpu/GPURenderPassEncoder.h:
1329
1330 2019-03-18  Chris Dumez  <cdumez@apple.com>
1331
1332         [iOS] The network process sometimes gets killed for trying to suspend while holding locked files
1333         https://bugs.webkit.org/show_bug.cgi?id=195890
1334         <rdar://problem/48934338>
1335
1336         Reviewed by Geoffrey Garen.
1337
1338         The network process sometimes gets killed for trying to suspend while holding locked files while
1339         under SQLiteDatabase::open(). The SQLiteDatabaseTracker normally keeps tracking of "transactions"
1340         in progress so we know that we're holding locked files and the WebSQLiteDatabaseTracker takes
1341         care of notifying the UIProcess via IPC that it should hold a background assertion on our behalf
1342         to avoid trying to suspend while holding locked files.
1343         However, we were missing a SQLiteTransactionInProgressAutoCounter when trying to execute the
1344         PRAGMA statement.
1345
1346         Note that we have a similar SQLiteTransactionInProgressAutoCounter in SQLiteDatabase::useWALJournalMode()
1347         when executing such PRAGMA statement already.
1348
1349         * platform/sql/SQLiteDatabase.cpp:
1350         (WebCore::SQLiteDatabase::open):
1351
1352 2019-03-18  Ryan Haddad  <ryanhaddad@apple.com>
1353
1354         Unreviewed, rolling out r243037.
1355
1356         Broke the Windows build
1357
1358         Reverted changeset:
1359
1360         "Reduce the size of Node::deref by eliminating an explicit
1361         parentNode check"
1362         https://bugs.webkit.org/show_bug.cgi?id=195776
1363         https://trac.webkit.org/changeset/243037
1364
1365 2019-03-18  Eric Carlson  <eric.carlson@apple.com>
1366
1367         Change some logging levels
1368         https://bugs.webkit.org/show_bug.cgi?id=195861
1369         <rdar://problem/48961669>
1370
1371         Reviewed by Jer Noble.
1372
1373         * Modules/mediastream/RTCPeerConnection.cpp:
1374         (WebCore::RTCPeerConnection::dispatchEvent):
1375         * Modules/webaudio/AudioNode.cpp:
1376         (WebCore::AudioNode::addInput):
1377         (WebCore::AudioNode::addOutput):
1378         (WebCore::AudioNode::connect):
1379         (WebCore::AudioNode::disconnect):
1380         * Modules/webaudio/AudioParam.cpp:
1381         (WebCore::AudioParam::connect):
1382         (WebCore::AudioParam::disconnect):
1383         * Modules/webaudio/WaveShaperNode.cpp:
1384         (WebCore::WaveShaperNode::setOversample):
1385         * html/HTMLMediaElement.cpp:
1386         (WebCore::HTMLMediaElement::canPlayType const):
1387         (WebCore::HTMLMediaElement::seekTask):
1388         (WebCore::HTMLMediaElement::dispatchEvent):
1389         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1390         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1391         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
1392         * html/track/InbandGenericTextTrack.cpp:
1393         (WebCore::InbandGenericTextTrack::addGenericCue):
1394         (WebCore::InbandGenericTextTrack::removeGenericCue):
1395         (WebCore::InbandGenericTextTrack::newCuesParsed):
1396         * html/track/InbandWebVTTTextTrack.cpp:
1397         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
1398         * html/track/LoadableTextTrack.cpp:
1399         (WebCore::LoadableTextTrack::newCuesAvailable):
1400         * html/track/TextTrack.cpp:
1401         (WebCore::TextTrack::removeCue):
1402         * inspector/agents/WebConsoleAgent.cpp:
1403         (WebCore::WebConsoleAgent::getLoggingChannels):
1404         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1405         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
1406         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
1407         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
1408         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1409         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
1410         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
1411         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1412         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1413         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
1414         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
1415         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
1416
1417 2019-03-15  Antoine Quint  <graouts@apple.com>
1418
1419         Make mouse event simulation a quirk
1420         https://bugs.webkit.org/show_bug.cgi?id=195218
1421         <rdar://problem/48516794>
1422
1423         Reviewed by Dean Jackson.
1424
1425         Add new quirks to control whether we should dispatch simulated mouse events and whether we should assume
1426         preventDefault() was called when a simulated "mousemove" event was handled. Currently both return false
1427         but will be made to return more interesting results as we determine heuristics or specific sites that
1428         may require such quirks.
1429
1430         * page/Quirks.cpp:
1431         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const):
1432         (WebCore::Quirks::shouldMousemoveEventHandlingPreventDefault const):
1433         * page/Quirks.h:
1434
1435 2019-03-18  Philippe Normand  <pnormand@igalia.com>
1436
1437         [GStreamer] Rewrite HTTP source element using pushsrc base class
1438         https://bugs.webkit.org/show_bug.cgi?id=195631
1439
1440         Reviewed by Xabier Rodriguez-Calvar.
1441
1442         If we want to use webkitwebsrc in adaptivedemux (HLS, DASH, etc)
1443         we need a source element that behaves like souphttpsrc, which is
1444         implemented using pushsrc. This rewrite might also fix some seek
1445         issues.
1446
1447         No new tests, existing http/tests/media tests cover this patch.
1448
1449         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1450         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1451         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1452         (webkit_web_src_class_init):
1453         (webkitWebSrcReset):
1454         (webkit_web_src_init):
1455         (webKitWebSrcCreate):
1456         (webKitWebSrcStart):
1457         (webKitWebSrcCloseSession):
1458         (webKitWebSrcStop):
1459         (webKitWebSrcGetSize):
1460         (webKitWebSrcIsSeekable):
1461         (webKitWebSrcDoSeek):
1462         (webKitWebSrcQuery):
1463         (webKitWebSrcUnLock):
1464         (webKitWebSrcUnLockStop):
1465         (webKitWebSrcChangeState):
1466         (CachedResourceStreamingClient::checkUpdateBlocksize):
1467         (CachedResourceStreamingClient::responseReceived):
1468         (CachedResourceStreamingClient::dataReceived):
1469         (CachedResourceStreamingClient::accessControlCheckFailed):
1470         (CachedResourceStreamingClient::loadFailed):
1471         (CachedResourceStreamingClient::loadFinished):
1472         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
1473
1474 2019-03-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1475
1476         [WPE][GTK] Fix a build warning because of missing to handle an enum value
1477         https://bugs.webkit.org/show_bug.cgi?id=195876
1478
1479         Reviewed by Žan Doberšek.
1480
1481         When building WPE or GTK port, there is a build warning. The switch-case needs to
1482         handle *Positioned* enum value as well in order to avoid the build warning.
1483
1484         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
1485         (WebCore::ScrollingTreeNicosia::createScrollingTreeNode): Add case ScrollingNodeType::Positioned.
1486
1487 2019-03-17  Yusuke Suzuki  <ysuzuki@apple.com>
1488
1489         REGRESSION: !vm.isInitializingObject() void* JSC::tryAllocateCellHelper<JSC::Structure> JSC::Structure::create
1490         https://bugs.webkit.org/show_bug.cgi?id=195858
1491
1492         Reviewed by Mark Lam.
1493
1494         Changed the accessor names.
1495
1496         * bindings/js/SerializedScriptValue.cpp:
1497         (WebCore::CloneDeserializer::readTerminal):
1498
1499 2019-03-16  Darin Adler  <darin@apple.com>
1500
1501         Improve normalization code, including moving from unorm.h to unorm2.h
1502         https://bugs.webkit.org/show_bug.cgi?id=195330
1503
1504         Reviewed by Michael Catanzaro.
1505
1506         * editing/TextIterator.cpp: Include unorm2.h.
1507         (WebCore::normalizeCharacters): Rewrote to use unorm2_normalize rather than
1508         unorm_normalize, but left the logic otherwise the same.
1509
1510         * platform/graphics/SurrogatePairAwareTextIterator.cpp: Include unorm2.h.
1511         (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
1512         Use unorm2_composePair instead of unorm_normalize.
1513
1514         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1515         (characterSequenceIsEmoji): Changed to use existing SurrogatePairAwareTextIterator.
1516         (FontCascade::fontForCombiningCharacterSequence): Use normalizedNFC instead of
1517         calling unorm2_normalize directly.
1518
1519         * WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1520         Removed unneeded include of <unicode/normlzr.h>.
1521
1522         * platform/text/TextEncoding.cpp:
1523         (WebCore::TextEncoding::encode const): Use normalizedNFC instead of the
1524         code that was here. The normalizedNFC function is better in multiple ways,
1525         but primarily it handles 8-bit strings and other already-normalized
1526         strings much more efficiently.
1527
1528 2019-03-16  Jer Noble  <jer.noble@apple.com>
1529
1530         Unreviewed unified-build fix; GPUBindGroupMetal uses symbols from the Metal.framework; it should import it.
1531
1532         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1533
1534 2019-03-16  Jer Noble  <jer.noble@apple.com>
1535
1536         Add a new MediaCapabilitiesExtensionsEnabled setting
1537         https://bugs.webkit.org/show_bug.cgi?id=195843
1538
1539         Reviewed by Geoffrey Garen.
1540
1541         Add a new setting, MediaCapabilitiesExtensionsEnabled, which controls whether extensions
1542         to the Media Capabilities API are available.
1543
1544         Drive-by fix: make sure that the configuration is passed through to MediaCapabilitiesInfo
1545         when no factory can support the configuration.
1546
1547         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
1548         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
1549         * bindings/scripts/CodeGeneratorJS.pm:
1550         (GenerateDictionaryImplementationContent):
1551         * bindings/scripts/IDLAttributes.json:
1552         * page/Settings.yaml:
1553         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
1554         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
1555
1556 2019-03-16  Zalan Bujtas  <zalan@apple.com>
1557
1558         [iOS] Unable to close trending window on naver.com.
1559         https://bugs.webkit.org/show_bug.cgi?id=195842
1560         <rdar://problem/48067338>
1561
1562         This patch issues a synthetic mouse move to the tap location after we decided to hover.
1563         It ensures that the node under the mouse is up-to-date and when a new tap comes in we can
1564         send the mouseout event to the correct node. It fixes the case when the hover content is positioned over
1565         the tap target so that the tap target is no longer "under the mouse".
1566         On desktop this "transition" happens automatically since the mouse is always present. 
1567
1568         Reviewed by Simon Fraser.
1569
1570         Tests: fast/events/touch/ios/content-observation/new-content-covers-tap-target.html
1571                fast/events/touch/ios/content-observation/prevent-default-on-touch-start.html
1572
1573         * page/EventHandler.h:
1574         * page/ios/EventHandlerIOS.mm:
1575         (WebCore::EventHandler::dispatchSyntheticMouseMove):
1576
1577 2019-03-16  Sihui Liu  <sihui_liu@apple.com>
1578
1579         Layout tests imported/w3c/web-platform-tests/IndexedDB/*-exception-order.html are failing
1580         https://bugs.webkit.org/show_bug.cgi?id=195650
1581
1582         Reviewed by Ryosuke Niwa.
1583
1584         Fix some exception orders in IDB.
1585
1586         * Modules/indexeddb/IDBDatabase.cpp:
1587         (WebCore::IDBDatabase::createObjectStore):
1588         Step 6 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-createobjectstore.
1589
1590         (WebCore::IDBDatabase::transaction):
1591         Step 1 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-transaction.
1592
1593         * Modules/indexeddb/IDBIndex.cpp:
1594         (WebCore::IDBIndex::doOpenCursor):
1595         (WebCore::IDBIndex::openCursor):
1596         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-opencursor.
1597
1598         (WebCore::IDBIndex::doOpenKeyCursor):
1599         (WebCore::IDBIndex::openKeyCursor):
1600         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-openkeycursor.
1601
1602         (WebCore::IDBIndex::count):
1603         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-count.
1604
1605         (WebCore::IDBIndex::doCount):
1606         (WebCore::IDBIndex::get):
1607         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-get.
1608
1609         (WebCore::IDBIndex::doGet):
1610         (WebCore::IDBIndex::getKey):
1611         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
1612
1613         (WebCore::IDBIndex::doGetKey):
1614         (WebCore::IDBIndex::doGetAll):
1615         (WebCore::IDBIndex::getAll):
1616         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
1617         (WebCore::IDBIndex::doGetAllKeys):
1618         (WebCore::IDBIndex::getAllKeys):
1619         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getallkeys.
1620
1621         * Modules/indexeddb/IDBIndex.h:
1622         * Modules/indexeddb/IDBObjectStore.cpp:
1623         (WebCore::IDBObjectStore::doOpenCursor):
1624         (WebCore::IDBObjectStore::openCursor):
1625         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-opencursor.
1626
1627         (WebCore::IDBObjectStore::doOpenKeyCursor):
1628         (WebCore::IDBObjectStore::openKeyCursor):
1629         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-openkeycursor.
1630
1631         (WebCore::IDBObjectStore::deleteFunction):
1632         (WebCore::IDBObjectStore::doDelete):
1633         (WebCore::IDBObjectStore::count):
1634         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-count.
1635
1636         (WebCore::IDBObjectStore::doCount):
1637         (WebCore::IDBObjectStore::doGetAll):
1638         (WebCore::IDBObjectStore::getAll):
1639         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getall.
1640
1641         (WebCore::IDBObjectStore::doGetAllKeys):
1642         (WebCore::IDBObjectStore::getAllKeys):
1643         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getallkeys.
1644         * Modules/indexeddb/IDBObjectStore.h:
1645
1646 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
1647
1648         Reduce the size of Node::deref by eliminating an explicit parentNode check
1649         https://bugs.webkit.org/show_bug.cgi?id=195776
1650
1651         Reviewed by Geoffrey Garen.
1652
1653         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
1654         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
1655         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
1656
1657         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
1658         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
1659         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
1660         is identically equal to 0.
1661
1662         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
1663         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
1664         or not when m_referencingNodeCount becomes 0.
1665
1666         No new tests since there should be no behavioral change.
1667
1668         * dom/Document.cpp:
1669         (WebCore::Document::removedLastRef):
1670         * dom/Document.h:
1671         (WebCore::Document::decrementReferencingNodeCount):
1672         * dom/Node.cpp:
1673         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
1674         (WebCore::Node::~Node):
1675         (WebCore::Node::removedLastRef):
1676         * dom/Node.h:
1677         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
1678         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
1679         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
1680         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
1681         (WebCore::Node::hasOneRef const):
1682         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
1683         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
1684         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
1685
1686 2019-03-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1687
1688         Remove the SVG property tear off objects for SVGAnimatedInteger
1689         https://bugs.webkit.org/show_bug.cgi?id=195722
1690
1691         Reviewed by Simon Fraser.
1692
1693         Instead of saving a raw integer value in the SVGElement and then wrapping
1694         the pointer to this raw data in a tear off object, we will represent the
1695         integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the 
1696         representation of the property in IDL file match the C++ header file.
1697
1698         When the DOM requests the SVGAnimatedInteger, we get return a reference
1699         to the new animated property. When the rendering code asks for the current
1700         value of the this animated property, we return the animVal() or the
1701         baseVal() depending on whether the property is animating or not.
1702
1703         A pointer to a member in the SVGElement will be registered along with the
1704         associated attribute name in SVGPropertyRegistry. Registering the property
1705         creates an SVGMemberAccessor and links to the associated attribute. The
1706         function of SVGMemberAccessor is to retrieve the value of the property
1707         given a pointer to an SVGElement.
1708
1709         SVGPropertyRegistry manages all the properties of SVGElement. It takes
1710         into account the inherited properties as well.
1711
1712         SVGElement will have a virtual method called propertyRegistry(). Every
1713         superclass will override this method to return a reference to its registry
1714         which includes all the registered properties of this class and its bases.
1715
1716         One important function of the SVGPropertyRegistry and SVGAccessor is they
1717         create the appropriate SVGAttributeAnimator for this property.
1718
1719         SVGAttributeAnimator is just a connection between the animated property
1720         and SVGAnimationFunction. SVGAnimationFunction calculates the values of
1721         the animated property within a time interval. SVGAnimatedPropertyAnimator
1722         updates animVal of the animated property and invalidates the associated
1723         SVGElement and all the instances that references this element.
1724
1725         The plan is to remove all the SVG tear off objects like what this patch
1726         does for SVGAnimatedInteger. So for a period of time the old code and the
1727         new code will co-exist together. These things to consider when reviewing
1728         this patch:
1729
1730         -- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase
1731         which is inherited by SVGLegacyAttributeAnimationController and
1732         SVGAttributeAnimationController. The tear-off properties code which uses
1733         SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The
1734         new code was added to SVGAttributeAnimationController. The plan is to 
1735         remove the three animation controllers and to move the code of
1736         SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear
1737         off code is removed.
1738
1739         -- SVGElement now keeps two registries one for the tear-off world and the
1740         other for the new world. Eventually we need to get rid of tear-off registry.
1741
1742         -- SVGElement will differentiate between the type of the property by the
1743         the method isAnimatedAttribute().
1744
1745         * Sources.txt:
1746         * WebCore.xcodeproj/project.pbxproj:
1747         * bindings/scripts/CodeGeneratorJS.pm:
1748         (GenerateHeader):
1749         * svg/SVGAnimateElementBase.cpp:
1750         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
1751         (WebCore::SVGAnimateElementBase::attributeAnimationController):
1752         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists):
1753         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
1754         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const):
1755         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
1756         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
1757         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
1758         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
1759         (WebCore::SVGAnimateElementBase::resetAnimatedType):
1760         (WebCore::SVGAnimateElementBase::clearAnimatedType):
1761         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
1762         (WebCore::SVGAnimateElementBase::isAdditive const):
1763         (WebCore::SVGAnimateElementBase::calculateDistance):
1764         (WebCore::SVGAnimateElementBase::setTargetElement):
1765         (WebCore::SVGAnimateElementBase::setAttributeName):
1766         (WebCore::SVGAnimateElementBase::resetAnimation):
1767         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
1768         (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted.
1769         (WebCore::propertyTypesAreConsistent): Deleted.
1770         (WebCore::applyCSSPropertyToTarget): Deleted.
1771         (WebCore::removeCSSPropertyFromTarget): Deleted.
1772         (WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
1773         (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
1774         (WebCore::notifyTargetAboutAnimValChange): Deleted.
1775         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
1776         (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted.
1777         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted.
1778         (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted.
1779         * svg/SVGAnimateElementBase.h:
1780         * svg/SVGAnimateMotionElement.cpp:
1781         (WebCore::SVGAnimateMotionElement::hasValidAttributeType const):
1782         (WebCore::SVGAnimateMotionElement::hasValidAttributeName const):
1783         (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted.
1784         (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted.
1785         * svg/SVGAnimateMotionElement.h:
1786         * svg/SVGAnimateTransformElement.cpp:
1787         (WebCore::SVGAnimateTransformElement::hasValidAttributeType const):
1788         (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted.
1789         * svg/SVGAnimateTransformElement.h:
1790         * svg/SVGAnimatedInteger.cpp: Removed.
1791         * svg/SVGAnimatedInteger.h: Removed.
1792         * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed.
1793         * svg/SVGAnimatedIntegerOptionalInteger.h: Removed.
1794         * svg/SVGAnimatedPointList.h:
1795         * svg/SVGAnimationElement.cpp:
1796         (WebCore::SVGAnimationElement::setAttributeType):
1797         (WebCore::SVGAnimationElement::resetAnimation):
1798         (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted.
1799         (WebCore::SVGAnimationElement::setTargetElement): Deleted.
1800         (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted.
1801         * svg/SVGAnimationElement.h:
1802         (WebCore::SVGAnimationElement::attributeType const):
1803         (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted.
1804         * svg/SVGAnimatorFactory.h:
1805         (WebCore::SVGAnimatorFactory::create):
1806         * svg/SVGAttributeAnimationController.cpp: Added.
1807         (WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController):
1808         (WebCore::SVGAttributeAnimationController::animator const):
1809         (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
1810         (WebCore::SVGAttributeAnimationController::isAdditive const):
1811         (WebCore::SVGAttributeAnimationController::hasValidAttributeType const):
1812         (WebCore::SVGAttributeAnimationController::calculateFromAndToValues):
1813         (WebCore::SVGAttributeAnimationController::calculateFromAndByValues):
1814         (WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue):
1815         (WebCore::SVGAttributeAnimationController::resetAnimatedType):
1816         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
1817         (WebCore::SVGAttributeAnimationController::applyResultsToTarget):
1818         (WebCore::SVGAttributeAnimationController::clearAnimatedType):
1819         (WebCore::SVGAttributeAnimationController::calculateDistance):
1820         * svg/SVGAttributeAnimationController.h: Added.
1821         (WebCore::SVGAttributeAnimationController::animatorIfExists const):
1822         * svg/SVGAttributeAnimationControllerBase.cpp: Added.
1823         (WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase):
1824         (WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType):
1825         * svg/SVGAttributeAnimationControllerBase.h: Added.
1826         * svg/SVGElement.cpp:
1827         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
1828         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
1829         (WebCore::SVGElement::commitPropertyChange):
1830         (WebCore::SVGElement::isAnimatedPropertyAttribute const):
1831         (WebCore::SVGElement::isAnimatedAttribute const):
1832         (WebCore::SVGElement::createAnimator):
1833         * svg/SVGElement.h:
1834         (WebCore::SVGElement::propertyRegistry const):
1835         * svg/SVGFEConvolveMatrixElement.cpp:
1836         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
1837         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
1838         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1839         (WebCore::SVGFEConvolveMatrixElement::setOrder):
1840         (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted.
1841         (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted.
1842         * svg/SVGFEConvolveMatrixElement.h:
1843         * svg/SVGFETurbulenceElement.cpp:
1844         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
1845         (WebCore::SVGFETurbulenceElement::registerAttributes):
1846         (WebCore::SVGFETurbulenceElement::parseAttribute):
1847         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
1848         * svg/SVGFETurbulenceElement.h:
1849         * svg/SVGFilterElement.h:
1850         * svg/SVGLegacyAttributeAnimationController.cpp: Added.
1851         (WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController):
1852         (WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator):
1853         (WebCore::SVGLegacyAttributeAnimationController::isAdditive const):
1854         (WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const):
1855         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues):
1856         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues):
1857         (WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue):
1858         (WebCore::propertyTypesAreConsistent):
1859         (WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType):
1860         (WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue):
1861         (WebCore::applyCSSPropertyToTarget):
1862         (WebCore::removeCSSPropertyFromTarget):
1863         (WebCore::applyCSSPropertyToTargetAndInstances):
1864         (WebCore::removeCSSPropertyFromTargetAndInstances):
1865         (WebCore::notifyTargetAboutAnimValChange):
1866         (WebCore::notifyTargetAndInstancesAboutAnimValChange):
1867         (WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget):
1868         (WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType):
1869         (WebCore::SVGLegacyAttributeAnimationController::calculateDistance):
1870         * svg/SVGLegacyAttributeAnimationController.h: Added.
1871         * svg/animation/SVGSMILElement.cpp:
1872         (WebCore::SVGSMILElement::hasValidAttributeName const):
1873         (WebCore::SVGSMILElement::hasValidAttributeName): Deleted.
1874         * svg/animation/SVGSMILElement.h:
1875         * svg/properties/SVGAnimatedPrimitiveProperty.h: Added.
1876         (WebCore::SVGAnimatedPrimitiveProperty::create):
1877         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
1878         (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal):
1879         (WebCore::SVGAnimatedPrimitiveProperty::baseVal const):
1880         (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal):
1881         (WebCore::SVGAnimatedPrimitiveProperty::animVal const):
1882         (WebCore::SVGAnimatedPrimitiveProperty::animVal):
1883         (WebCore::SVGAnimatedPrimitiveProperty::currentValue const):
1884         (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty):
1885         * svg/properties/SVGAnimatedProperty.cpp: Added.
1886         (WebCore::SVGAnimatedProperty::owner const):
1887         (WebCore::SVGAnimatedProperty::commitPropertyChange):
1888         * svg/properties/SVGAnimatedProperty.h: Added.
1889         (WebCore::SVGAnimatedProperty::isAttached const):
1890         (WebCore::SVGAnimatedProperty::detach):
1891         (WebCore::SVGAnimatedProperty::contextElement const):
1892         (WebCore::SVGAnimatedProperty::baseValAsString const):
1893         (WebCore::SVGAnimatedProperty::animValAsString const):
1894         (WebCore::SVGAnimatedProperty::isDirty const):
1895         (WebCore::SVGAnimatedProperty::setDirty):
1896         (WebCore::SVGAnimatedProperty::synchronize):
1897         (WebCore::SVGAnimatedProperty::isAnimating const):
1898         (WebCore::SVGAnimatedProperty::startAnimation):
1899         (WebCore::SVGAnimatedProperty::stopAnimation):
1900         (WebCore::SVGAnimatedProperty::instanceStartAnimation):
1901         (WebCore::SVGAnimatedProperty::instanceStopAnimation):
1902         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
1903         * svg/properties/SVGAnimatedPropertyAccessor.h: Added.
1904         * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added.
1905         * svg/properties/SVGAnimatedPropertyAnimator.h: Added.
1906         (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance):
1907         (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator):
1908         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added.
1909         * svg/properties/SVGAnimatedPropertyImpl.h: Added.
1910         * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added.
1911         (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor):
1912         (WebCore::SVGAnimatedPropertyPairAccessor::singleton):
1913         (WebCore::SVGAnimatedPropertyPairAccessor::property1 const):
1914         (WebCore::SVGAnimatedPropertyPairAccessor::property2 const):
1915         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added.
1916         * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added.
1917         (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
1918         (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator):
1919         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added.
1920         * svg/properties/SVGAnimationAdditiveFunction.h: Added.
1921         (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction):
1922         (WebCore::SVGAnimationAdditiveFunction::progress):
1923         * svg/properties/SVGAnimationAdditiveValueFunction.h: Added.
1924         (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const):
1925         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added.
1926         (WebCore::SVGAnimationIntegerFunction::progress):
1927         * svg/properties/SVGAnimationFunction.h: Added.
1928         (WebCore::SVGAnimationFunction::isDiscrete const):
1929         (WebCore::SVGAnimationFunction::calculateDistance const):
1930         (WebCore::SVGAnimationFunction::SVGAnimationFunction):
1931         (WebCore::SVGAnimationFunction::addFromAndToValues):
1932         * svg/properties/SVGAttributeAnimator.cpp: Added.
1933         (WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange):
1934         * svg/properties/SVGAttributeAnimator.h: Added.
1935         (WebCore::SVGAttributeAnimator::SVGAttributeAnimator):
1936         (WebCore::SVGAttributeAnimator::isDiscrete const):
1937         (WebCore::SVGAttributeAnimator::setFromAndToValues):
1938         (WebCore::SVGAttributeAnimator::setFromAndByValues):
1939         (WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue):
1940         (WebCore::SVGAttributeAnimator::calculateDistance const):
1941         * svg/properties/SVGAttributeOwnerProxy.cpp:
1942         * svg/properties/SVGAttributeOwnerProxy.h:
1943         * svg/properties/SVGAttributeRegistry.h:
1944         * svg/properties/SVGMemberAccessor.h: Added.
1945         (WebCore::SVGMemberAccessor::detach const):
1946         (WebCore::SVGMemberAccessor::isAnimatedProperty const):
1947         (WebCore::SVGMemberAccessor::isAnimatedLength const):
1948         (WebCore::SVGMemberAccessor::matches const):
1949         (WebCore::SVGMemberAccessor::synchronize const):
1950         (WebCore::SVGMemberAccessor::createAnimator const):
1951         (WebCore::SVGMemberAccessor::appendAnimatedInstance const):
1952         * svg/properties/SVGPointerMemberAccessor.h: Added.
1953         (WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor):
1954         (WebCore::SVGPointerMemberAccessor::property const):
1955         (WebCore::SVGPointerMemberAccessor::singleton):
1956         * svg/properties/SVGProperty.h: Added.
1957         * svg/properties/SVGPropertyOwner.h: Added.
1958         (WebCore::SVGPropertyOwner::owner const):
1959         (WebCore::SVGPropertyOwner::attributeContextElement const):
1960         (WebCore::SVGPropertyOwner::commitPropertyChange):
1961         * svg/properties/SVGPropertyOwnerRegistry.h: Added.
1962         (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry):
1963         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1964         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively):
1965         (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute):
1966         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes):
1967         (WebCore::SVGPropertyOwnerRegistry::findAccessor):
1968         * svg/properties/SVGPropertyRegistry.h: Added.
1969
1970 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
1971
1972         Remove LayoutAssertionDisableScope after r241289
1973         https://bugs.webkit.org/show_bug.cgi?id=195848
1974
1975         Reviewed by Antti Koivisto.
1976
1977         Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.
1978
1979         * dom/Document.cpp:
1980         (WebCore::isSafeToUpdateStyleOrLayout):
1981         * dom/ScriptDisallowedScope.h:
1982         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.
1983         * page/FrameViewLayoutContext.cpp:
1984         (WebCore::FrameViewLayoutContext::layout):
1985
1986 2019-03-15  Eric Carlson  <eric.carlson@apple.com>
1987
1988         Add media stream release logging
1989         https://bugs.webkit.org/show_bug.cgi?id=195823
1990         <rdar://problem/48939406>
1991
1992         Reviewed by Youenn Fablet.
1993
1994         No new tests, no behavioral change.
1995
1996         * Modules/mediastream/MediaStream.cpp:
1997         (WebCore::MediaStream::MediaStream):
1998         (WebCore::MediaStream::clone):
1999         (WebCore::MediaStream::addTrack):
2000         (WebCore::MediaStream::removeTrack):
2001         (WebCore::MediaStream::addTrackFromPlatform):
2002         (WebCore::MediaStream::setIsActive):
2003         (WebCore::MediaStream::mediaCanStart):
2004         (WebCore::MediaStream::startProducingData):
2005         (WebCore::MediaStream::stopProducingData):
2006         (WebCore::MediaStream::endCaptureTracks):
2007         (WebCore::MediaStream::stop):
2008         (WebCore::MediaStream::logChannel const):
2009         * Modules/mediastream/MediaStream.h:
2010         * Modules/mediastream/MediaStreamTrack.cpp:
2011         (WebCore::MediaStreamTrack::MediaStreamTrack):
2012         (WebCore::MediaStreamTrack::logChannel const):
2013         * Modules/mediastream/MediaStreamTrack.h:
2014         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2015         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2016         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
2017         * Modules/webaudio/AudioContext.cpp:
2018         (WebCore::AudioContext::AudioContext):
2019         (WebCore::nextLogIdentifier): Deleted.
2020         * html/HTMLMediaElement.cpp:
2021         (WebCore::HTMLMediaElement::HTMLMediaElement):
2022         (WebCore::nextLogIdentifier): Deleted.
2023         * html/HTMLMediaElement.h:
2024         * platform/audio/PlatformMediaSession.cpp:
2025         (WebCore::PlatformMediaSession::PlatformMediaSession):
2026         (WebCore::nextLogIdentifier): Deleted.
2027         * platform/audio/PlatformMediaSession.h:
2028         * platform/graphics/IntSize.cpp:
2029         (WebCore::IntSize::toJSONObject const):
2030         (WebCore::IntSize::toJSONString const):
2031         * platform/graphics/IntSize.h:
2032         (WTF::LogArgument<WebCore::IntSize>::toString):
2033         * platform/mediastream/MediaStreamPrivate.cpp:
2034         (WebCore::MediaStreamPrivate::addTrack):
2035         (WebCore::MediaStreamPrivate::removeTrack):
2036         (WebCore::MediaStreamPrivate::startProducingData):
2037         (WebCore::MediaStreamPrivate::stopProducingData):
2038         (WebCore::MediaStreamPrivate::setCaptureTracksMuted):
2039         (WebCore::MediaStreamPrivate::trackMutedChanged):
2040         (WebCore::MediaStreamPrivate::trackEnabledChanged):
2041         (WebCore::MediaStreamPrivate::trackStarted):
2042         (WebCore::MediaStreamPrivate::trackEnded):
2043         (WebCore::MediaStreamPrivate::setLogger):
2044         (WebCore::MediaStreamPrivate::logChannel const):
2045         * platform/mediastream/MediaStreamPrivate.h:
2046         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2047         (WebCore::MediaStreamTrackPrivate::setLogger):
2048         (WebCore::MediaStreamTrackPrivate::logChannel const):
2049         * platform/mediastream/MediaStreamTrackPrivate.h:
2050         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2051         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
2052         (WebCore::RealtimeIncomingAudioSource::logChannel const): Deleted.
2053         (WebCore::RealtimeIncomingAudioSource::logger const): Deleted.
2054         * platform/mediastream/RealtimeIncomingAudioSource.h:
2055         (WebCore::RealtimeIncomingAudioSource::setLogger): Deleted.
2056         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2057         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2058         (WebCore::RealtimeIncomingVideoSource::logChannel const): Deleted.
2059         (WebCore::RealtimeIncomingVideoSource::logger const): Deleted.
2060         * platform/mediastream/RealtimeIncomingVideoSource.h:
2061         (WebCore::RealtimeIncomingVideoSource::setLogger): Deleted.
2062         * platform/mediastream/RealtimeMediaSource.cpp:
2063         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
2064         (WebCore::RealtimeMediaSource::setInterrupted):
2065         (WebCore::RealtimeMediaSource::setMuted):
2066         (WebCore::RealtimeMediaSource::notifyMutedChange):
2067         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
2068         (WebCore::RealtimeMediaSource::videoSampleAvailable):
2069         (WebCore::RealtimeMediaSource::start):
2070         (WebCore::RealtimeMediaSource::stop):
2071         (WebCore::RealtimeMediaSource::captureFailed):
2072         (WebCore::RealtimeMediaSource::applyConstraint):
2073         (WebCore::RealtimeMediaSource::supportsConstraints):
2074         (WebCore::RealtimeMediaSource::applyConstraints):
2075         (WebCore::RealtimeMediaSource::setSize):
2076         (WebCore::RealtimeMediaSource::setIntrinsicSize):
2077         (WebCore::RealtimeMediaSource::setFrameRate):
2078         (WebCore::RealtimeMediaSource::setAspectRatio):
2079         (WebCore::RealtimeMediaSource::setFacingMode):
2080         (WebCore::RealtimeMediaSource::setVolume):
2081         (WebCore::RealtimeMediaSource::setSampleRate):
2082         (WebCore::RealtimeMediaSource::setSampleSize):
2083         (WebCore::RealtimeMediaSource::setEchoCancellation):
2084         (WebCore::RealtimeMediaSource::setLogger):
2085         (WebCore::RealtimeMediaSource::logChannel const):
2086         (WebCore::convertEnumerationToString):
2087         * platform/mediastream/RealtimeMediaSource.h:
2088         (WTF::LogArgument<WebCore::RealtimeMediaSource::Type>::toString):
2089         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
2090         (WebCore::RealtimeMediaSourceSettings::convertFlagsToString):
2091         (WebCore::convertEnumerationToString):
2092         * platform/mediastream/RealtimeMediaSourceSettings.h:
2093         (WTF::LogArgument<WebCore::RealtimeMediaSourceSettings::VideoFacingMode>::toString):
2094         (WTF::LogArgument<OptionSet<WebCore::RealtimeMediaSourceSettings::Flag>>::toString):
2095         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2096         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
2097         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
2098         (WebCore::RealtimeOutgoingAudioSource::logger const): Deleted.
2099         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2100         (WebCore::RealtimeOutgoingAudioSource::setLogger): Deleted.
2101         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2102         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
2103         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
2104         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
2105         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
2106         (WebCore::RealtimeOutgoingVideoSource::logger const): Deleted.
2107         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2108         (WebCore::RealtimeOutgoingVideoSource::setLogger): Deleted.
2109         * platform/mediastream/RealtimeVideoSource.cpp:
2110         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
2111         (WebCore::SizeAndFrameRate::toJSONObject const):
2112         (WebCore::SizeAndFrameRate::toJSONString const):
2113         * platform/mediastream/RealtimeVideoSource.h:
2114         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
2115         * platform/mediastream/mac/AVVideoCaptureSource.h:
2116         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2117         (WebCore::AVVideoCaptureSource::clearSession):
2118         (WebCore::AVVideoCaptureSource::startProducingData):
2119         (WebCore::AVVideoCaptureSource::stopProducingData):
2120         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2121         (WebCore::AVVideoCaptureSource::setupSession):
2122         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
2123         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2124         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
2125         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
2126         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
2127         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
2128         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
2129         (WebCore::AVVideoCaptureSource::deviceDisconnected):
2130         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
2131         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
2132         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
2133         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
2134         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
2135         (WebCore::AVVideoCaptureSource::initializeSession): Deleted.
2136         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2137         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
2138         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
2139         (WebCore::CoreAudioSharedUnit::captureFailed):
2140         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
2141         (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
2142         (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
2143         (WebCore::CoreAudioCaptureSource::startProducingData):
2144         (WebCore::CoreAudioCaptureSource::stopProducingData):
2145         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
2146         (WebCore::CoreAudioCaptureSource::beginInterruption):
2147         (WebCore::CoreAudioCaptureSource::endInterruption):
2148         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2149         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2150         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2151         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
2152         (WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
2153         (WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
2154         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
2155
2156 2019-03-15  Devin Rousso  <drousso@apple.com>
2157
2158         Web Inspector: Canvas: remove agent as observer when disabling
2159         https://bugs.webkit.org/show_bug.cgi?id=195825
2160         <rdar://problem/48940255>
2161
2162         Reviewed by Joseph Pecoraro.
2163
2164         No change in functionality.
2165
2166         * inspector/agents/InspectorCanvasAgent.cpp:
2167         (WebCore::InspectorCanvasAgent::disable):
2168
2169 2019-03-15  Ryosuke Niwa  <rniwa@webkit.org>
2170
2171         REGRESSION (r239814): Most classes that user Timer have 7 bytes of padding after the Timer
2172         https://bugs.webkit.org/show_bug.cgi?id=194196
2173
2174         Reviewed by Simon Fraser.
2175
2176         Use std::nan as the value of m_unalignedNextFireTime to indicate the timer had been deleted
2177         instead of having a dedicated boolean, which consumes 7 extra bytes for padding.
2178
2179         Note that some code in WebKit uses +Infinity as a fire time so we can't use that.
2180
2181         * platform/Timer.cpp:
2182         (WebCore::TimerBase::TimerBase):
2183         (WebCore::TimerBase::~TimerBase):
2184         (WebCore::TimerBase::setNextFireTime):
2185         (WebCore::TimerBase::nextUnalignedFireInterval const):
2186         * platform/Timer.h:
2187
2188 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
2189
2190         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
2191         https://bugs.webkit.org/show_bug.cgi?id=190350
2192         <rdar://problem/45089503>
2193
2194         Reviewed by Geoffrey Garen.
2195
2196         Start to use hash for database file names so that the files can work on any filesystem.
2197
2198         We created v0 folder in IndexedDB directory to put the legacy databases, and v1 folder to put the upgraded 
2199         databases.
2200
2201         Tests: TestWebKitAPI.IndexedDB.IndexedDBFileName
2202                TestWebKitAPI.IndexedDB.IndexedDBFileNameV0
2203                TestWebKitAPI.IndexedDB.IndexedDBFileNameV1
2204                TestWebKitAPI.IndexedDB.IndexedDBFileNameAPI
2205                TestWebKitAPI.IndexedDB.HashCollision
2206
2207         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2208         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
2209         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
2210         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2211         * Modules/indexeddb/server/IDBServer.cpp:
2212         (WebCore::IDBServer::m_quotaManagerGetter):
2213         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
2214         (WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
2215         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
2216         (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
2217         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
2218         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
2219         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
2220         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
2221         (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
2222         * Modules/indexeddb/server/IDBServer.h:
2223         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2224         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
2225         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
2226         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath const):
2227         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
2228         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
2229         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2230         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
2231         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
2232         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
2233         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
2234         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory const): Deleted.
2235         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2236         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const):
2237         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2238         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
2239         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
2240         * platform/sql/SQLiteFileSystem.cpp:
2241         (WebCore::SQLiteFileSystem::computeHashForFileName):
2242         * platform/sql/SQLiteFileSystem.h:
2243
2244 2019-03-15  Zalan Bujtas  <zalan@apple.com>
2245
2246         [ContentChangeObserver] HTMLImageElement::willRespondToMouseClickEvents returns quirk value.
2247         https://bugs.webkit.org/show_bug.cgi?id=195657
2248         <rdar://problem/48834987>
2249
2250         Reviewed by Simon Fraser.
2251
2252         Images should not trigger hover by default (only when they actually respond to mouse events).
2253
2254         Test: fast/events/touch/ios/content-observation/visibility-change-with-image-content.html
2255
2256         * page/ios/ContentChangeObserver.cpp:
2257         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
2258
2259 2019-03-15  Jer Noble  <jer.noble@apple.com>
2260
2261         Add a "supportedConfiguration" dictionary to MediaCapabilitiesDecodingInfo and MediaCapabilitiesEncodingInfo
2262         https://bugs.webkit.org/show_bug.cgi?id=195763
2263
2264         Reviewed by Jon Lee.
2265
2266         Test: media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html
2267
2268         Add support for a proposed addition to the Media Capabilities spec that would future-proof additional changes
2269         to Media Capabilities by allowing sites to check exactly what properties were queried by the browser when
2270         answering a decodeInfo() or enocdeInfo() query.
2271
2272         * CMakeLists.txt:
2273         * DerivedSources-input.xcfilelist:
2274         * DerivedSources-output.xcfilelist:
2275         * DerivedSources.make:
2276         * Modules/mediacapabilities/AudioConfiguration.idl:
2277         * Modules/mediacapabilities/MediaCapabilities.cpp:
2278         (WebCore::MediaCapabilities::decodingInfo):
2279         (WebCore::MediaCapabilities::encodingInfo):
2280         * Modules/mediacapabilities/MediaCapabilities.idl:
2281         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
2282         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
2283         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
2284         * Modules/mediacapabilities/MediaDecodingConfiguration.idl:
2285         * Modules/mediacapabilities/MediaEncodingConfiguration.idl:
2286         * Modules/mediacapabilities/VideoConfiguration.idl:
2287         * Sources.txt:
2288         * WebCore.xcodeproj/project.pbxproj:
2289         * platform/MediaCapabilitiesDecodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
2290         (WebCore::MediaCapabilitiesDecodingInfo::MediaCapabilitiesDecodingInfo):
2291         * platform/MediaCapabilitiesEncodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
2292         (WebCore::MediaCapabilitiesEncodingInfo::MediaCapabilitiesEncodingInfo):
2293         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
2294         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
2295         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h:
2296         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp:
2297         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
2298         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h:
2299         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
2300         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
2301         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
2302         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
2303         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
2304         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
2305         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
2306         * platform/mock/MediaEngineConfigurationFactoryMock.h:
2307
2308 2019-03-15  Antti Koivisto  <antti@apple.com>
2309
2310         Use Region for event region even when it is a rectangle
2311         https://bugs.webkit.org/show_bug.cgi?id=195803
2312
2313         Reviewed by Simon Fraser.
2314
2315         Region type is now optimized for the common single-rectangle case so we can simplify code.
2316
2317         * platform/graphics/GraphicsLayer.cpp:
2318         (WebCore::GraphicsLayer::setEventRegion):
2319         * platform/graphics/GraphicsLayer.h:
2320         (WebCore::GraphicsLayer::eventRegion const):
2321         * platform/graphics/ca/GraphicsLayerCA.cpp:
2322         (WebCore::GraphicsLayerCA::setEventRegion):
2323         * platform/graphics/ca/GraphicsLayerCA.h:
2324         * platform/graphics/ca/PlatformCALayer.h:
2325         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2326         * rendering/RenderLayerBacking.cpp:
2327         (WebCore::RenderLayerBacking::paintIntoLayer):
2328
2329 2019-03-15  Jer Noble  <jer.noble@apple.com>
2330
2331         Unreviewed unified build fix: GPUBindGroup has a default public constructor and destructor, so all its member
2332         variables must be fully defined.
2333
2334         * platform/graphics/gpu/GPUBindGroup.h:
2335
2336 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
2337
2338         [macOS] Broker access to Speech Synthesis
2339         https://bugs.webkit.org/show_bug.cgi?id=195645
2340         <rdar://problem/35369026>
2341
2342         Reviewed by Brent Fulgham.
2343
2344         To be able to close the connection to the speech synthesis daemon in the WebContent process,
2345         speech synthesis should be performed in the UI process. This patch forwards speech synthesis
2346         requests to the UI process by sending messages. On the UI process side, the speech synthesis
2347         is performed by simply using the existing platform speech synthesizer. Speech synthesis
2348         events are sent back to the WebContent process. All messages are async, except for the
2349         message to get the list of available voices.
2350
2351         No new tests, covered by existing tests.
2352
2353         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
2354         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
2355         * Modules/speech/SpeechSynthesis.cpp:
2356         (WebCore::SpeechSynthesis::create):
2357         (WebCore::SpeechSynthesis::SpeechSynthesis):
2358         (WebCore::SpeechSynthesis::setPlatformSynthesizer):
2359         (WebCore::SpeechSynthesis::getVoices):
2360         (WebCore::SpeechSynthesis::startSpeakingImmediately):
2361         (WebCore::SpeechSynthesis::cancel):
2362         (WebCore::SpeechSynthesis::pause):
2363         (WebCore::SpeechSynthesis::resume):
2364         (WebCore::SpeechSynthesis::boundaryEventOccurred):
2365         (WebCore::SpeechSynthesis::didStartSpeaking):
2366         (WebCore::SpeechSynthesis::didFinishSpeaking):
2367         (WebCore::SpeechSynthesis::didPauseSpeaking):
2368         (WebCore::SpeechSynthesis::didResumeSpeaking):
2369         (WebCore::SpeechSynthesis::speakingErrorOccurred):
2370         (WebCore::SpeechSynthesis::voicesChanged):
2371         * Modules/speech/SpeechSynthesis.h:
2372         * WebCore.xcodeproj/project.pbxproj:
2373         * page/Page.cpp:
2374         (WebCore::Page::Page):
2375         * page/Page.h:
2376         (WebCore::Page::speechSynthesisClient const):
2377         * page/PageConfiguration.cpp:
2378         * page/PageConfiguration.h:
2379         * page/SpeechSynthesisClient.h: Added.
2380         * platform/PlatformSpeechSynthesisUtterance.h:
2381         * platform/PlatformSpeechSynthesizer.h:
2382         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2383         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
2384         * platform/mac/PlatformSpeechSynthesizerMac.mm:
2385         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakWord:ofString:]):
2386         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
2387         (WebCore::PlatformSpeechSynthesizerMock::speak):
2388
2389 2019-03-15  Antti Koivisto  <antti@apple.com>
2390
2391         Try to fix watchOS build.
2392
2393         * platform/graphics/Region.h:
2394         (WebCore::Region::Span::decode):
2395
2396 2019-03-15  Simon Fraser  <simon.fraser@apple.com>
2397
2398         [Async overflow Scrolling] Update positioned node layers when overflows are scrolled
2399         https://bugs.webkit.org/show_bug.cgi?id=195733
2400         rdar://problem/11642295
2401
2402         Reviewed by Antti Koivisto.
2403
2404         Make ScrollingTree positioned nodes in the two cases where we need them, as
2405         detected by RenderLayerCompositor::computeCoordinatedPositioningForLayer().
2406
2407         For "Moves" layers we know that the overflow is not in the z-order ancestor chain,
2408         so ScrollingTree needs a map of overflow node -> affected positioned nodes which
2409         notifyRelatedNodesAfterScrollPositionChange() uses to find nodes to update after
2410         a scroll. Computing these dependent nodes in RenderLayerCompositor() would require
2411         correct dependency analysis between an overflow layers and "positioned" layers which
2412         is hard. It's easier to have "positioned" layers figure out which overflow nodes
2413         affect them, then compute the inverse relationship when the scrolling tree is updated
2414         which happens in ScrollingTreePositionedNode::commitStateBeforeChildren().
2415
2416         Tests: scrollingcoordinator/ios/absolute-layer-should-not-move-with-scroll.html
2417                scrollingcoordinator/ios/relative-layer-should-move-with-scroll.html
2418
2419         * page/scrolling/ScrollingTree.cpp:
2420         (WebCore::ScrollingTree::commitTreeState):
2421         (WebCore::ScrollingTree::applyLayerPositions):
2422         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
2423         (WebCore::ScrollingTree::scrollingTreeAsText):
2424         * page/scrolling/ScrollingTree.h:
2425         (WebCore::ScrollingTree::overflowRelatedNodes):
2426         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
2427         (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
2428         * page/scrolling/ScrollingTreeOverflowScrollingNode.h:
2429         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2430         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2431         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
2432         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
2433         * rendering/RenderLayerCompositor.cpp:
2434         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary):
2435         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
2436         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2437         (WebCore::collectRelatedCoordinatedScrollingNodes):
2438         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
2439
2440 2019-03-15  Antti Koivisto  <antti@apple.com>
2441
2442         Optimize Region for single rectangle case
2443         https://bugs.webkit.org/show_bug.cgi?id=195743
2444
2445         Reviewed by Simon Fraser.
2446
2447         Instrumentation shows vast majority of Region objects consist of a single rectangle. However it always allocates
2448         the large Shape data structure. This makes it unsuitable to use as a member in any popular objects.
2449
2450         This patch optimizes the single rectangle case by using only the bounds rectangle to describe it.
2451         Shape is allocated on demand. This makes it safe to use Region as a data member where a rectangle is the common case.
2452
2453         The patch also modernizes Region encoding/decoding support.
2454
2455         * platform/graphics/Region.cpp:
2456         (WebCore::Region::Region):
2457         (WebCore::Region::~Region):
2458         (WebCore::Region::operator=):
2459         (WebCore::Region::rects const):
2460         (WebCore::Region::contains const):
2461         (WebCore::Region::intersects const):
2462         (WebCore::Region::Shape::Shape):
2463         (WebCore::Region::Shape::appendSpan):
2464         (WebCore::Region::dump const):
2465         (WebCore::Region::intersect):
2466         (WebCore::Region::unite):
2467         (WebCore::Region::subtract):
2468         (WebCore::Region::translate):
2469         (WebCore::Region::setShape):
2470         (WebCore::Region::Shape::isValid const): Deleted.
2471         (WebCore::Region::Shape::swap): Deleted.
2472         (WebCore::Region::updateBoundsFromShape): Deleted.
2473
2474         Remove some now unused function.
2475
2476         * platform/graphics/Region.h:
2477         (WebCore::Region::isRect const):
2478         (WebCore::Region::gridSize const):
2479         (WebCore::Region::copyShape const):
2480         (WebCore::operator==):
2481         (WebCore::Region::Span::encode const):
2482         (WebCore::Region::Span::decode):
2483         (WebCore::Region::Shape::encode const):
2484         (WebCore::Region::Shape::decode):
2485         (WebCore::Region::encode const):
2486         (WebCore::Region::decode):
2487
2488         This is now part of type.
2489
2490         (WebCore::Region::isValid const): Deleted.
2491         (WebCore::Region::Span::Span): Deleted.
2492         (WebCore::Region::shapeSegments const): Deleted.
2493         (WebCore::Region::shapeSpans const): Deleted.
2494         (WebCore::Region::setShapeSegments): Deleted.
2495         (WebCore::Region::setShapeSpans): Deleted.
2496         (WebCore::Region::Shape::segments const): Deleted.
2497         (WebCore::Region::Shape::spans const): Deleted.
2498         (WebCore::Region::Shape::setSegments): Deleted.
2499         (WebCore::Region::Shape::setSpans): Deleted.
2500
2501         No need to expose these for encoding anymore.
2502
2503 2019-03-15  Devin Rousso  <drousso@apple.com>
2504
2505         Web Inspector: provide a way to capture a screenshot of a node from within the page
2506         https://bugs.webkit.org/show_bug.cgi?id=194279
2507         <rdar://problem/10731573>
2508
2509         Reviewed by Joseph Pecoraro.
2510
2511         Test: inspector/console/console-screenshot.html
2512
2513         Add `console.screenshot` functionality, which displays a screenshot of a given object (if
2514         able) within Web Inspector's Console tab. From there, it can be viewed and saved.
2515
2516         Currently, `console.screenshot` will
2517          - capture an image of a `Node` (if provided)
2518          - capture an image of the viewport if nothing is provided
2519
2520         * page/PageConsoleClient.h:
2521         * page/PageConsoleClient.cpp:
2522         (WebCore::PageConsoleClient::addMessage):
2523         (WebCore::PageConsoleClient::screenshot): Added.
2524
2525         * workers/WorkerConsoleClient.h:
2526         * workers/WorkerConsoleClient.cpp:
2527         (WebCore::WorkerConsoleClient::screenshot): Added.
2528         * worklets/WorkletConsoleClient.h:
2529         * worklets/WorkletConsoleClient.cpp:
2530         (WebCore::WorkletConsoleClient::screenshot): Added.
2531
2532         * inspector/CommandLineAPIModuleSource.js:
2533         (CommandLineAPIImpl.prototype.screenshot): Added.
2534
2535         * inspector/InspectorInstrumentation.h:
2536
2537 2019-03-14  Yusuke Suzuki  <ysuzuki@apple.com>
2538
2539         [JSC] Retain PrivateName of Symbol before passing it to operations potentially incurring GC
2540         https://bugs.webkit.org/show_bug.cgi?id=195791
2541         <rdar://problem/48806130>
2542
2543         Reviewed by Mark Lam.
2544
2545         * bindings/js/ScriptController.cpp:
2546         (WebCore::ScriptController::setupModuleScriptHandlers):
2547
2548 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
2549
2550         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
2551         https://bugs.webkit.org/show_bug.cgi?id=195754
2552         <rdar://problem/48591957>
2553
2554         Reviewed by Jiewen Tan.
2555
2556         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
2557         Update the const correctness of one function call to match new SDK declaration.
2558
2559         No tests because there are no changes in behavior.
2560
2561         * crypto/CommonCryptoUtilities.h:
2562         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2563         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2564
2565 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
2566
2567         IndexedDB: re-enable some leak tests
2568         https://bugs.webkit.org/show_bug.cgi?id=194806
2569
2570         Reviewed by Geoffrey Garen.
2571
2572         Protected JSIDBCursor object when advance/continue request on IDBCursor is not finished, because after the 
2573         advance operation completes on success, we need to return the same JSIDBCursor object as before the advance, 
2574         and during the wait for advance operation to complete, we need to return error as the result. 
2575  
2576         Covered by existing tests.
2577
2578         * Modules/indexeddb/IDBCursor.cpp:
2579         (WebCore::IDBCursor::setGetResult):
2580         (WebCore::IDBCursor::clearWrappers):
2581         * Modules/indexeddb/IDBCursor.h:
2582         * Modules/indexeddb/IDBRequest.cpp:
2583         (WebCore::IDBRequest::stop):
2584         (WebCore::IDBRequest::setResult):
2585         (WebCore::IDBRequest::setResultToStructuredClone):
2586         (WebCore::IDBRequest::setResultToUndefined):
2587         (WebCore::IDBRequest::willIterateCursor):
2588         (WebCore::IDBRequest::didOpenOrIterateCursor):
2589         (WebCore::IDBRequest::clearWrappers):
2590         * Modules/indexeddb/IDBRequest.h:
2591         (WebCore::IDBRequest::cursorWrapper):
2592         * bindings/js/JSIDBRequestCustom.cpp:
2593         (WebCore::JSIDBRequest::visitAdditionalChildren):
2594         * bindings/js/JSValueInWrappedObject.h:
2595         (WebCore::JSValueInWrappedObject::JSValueInWrappedObject):
2596         (WebCore::JSValueInWrappedObject::operator=):
2597         (WebCore::JSValueInWrappedObject::clear):
2598
2599 2019-03-14  Shawn Roberts  <sroberts@apple.com>
2600
2601         Unreviewed, rolling out r242981.
2602
2603         Causing internal build failures on watch/tv OS
2604
2605         Reverted changeset:
2606
2607         "Move CoreCrypto SPI declarations to an appropriate PAL/spi
2608         header"
2609         https://bugs.webkit.org/show_bug.cgi?id=195754
2610         https://trac.webkit.org/changeset/242981
2611
2612 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
2613
2614         Web process is put to suspended when holding locked WebSQL files
2615         https://bugs.webkit.org/show_bug.cgi?id=195768
2616
2617         Reviewed by Geoffrey Garen.
2618
2619         We need to keep processes active during database close, because SQLite database may run a checkpoint operation
2620         and lock database files.
2621
2622         * platform/sql/SQLiteDatabase.cpp:
2623         (WebCore::SQLiteDatabase::useWALJournalMode):
2624         (WebCore::SQLiteDatabase::close):
2625         * platform/sql/SQLiteDatabase.h:
2626
2627 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
2628
2629         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
2630         https://bugs.webkit.org/show_bug.cgi?id=195754
2631         <rdar://problem/48591957>
2632
2633         Reviewed by Jiewen Tan.
2634
2635         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
2636         Update the const correctness of one function call to match new SDK declaration.
2637
2638         No tests because there are no changes in behavior.
2639
2640         * crypto/CommonCryptoUtilities.h:
2641         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2642         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2643
2644 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2645
2646         Rename SVGProperty to SVGLegacyProperty and rename SVGAnimatedProperty to SVGLegacyAnimatedProperty
2647         https://bugs.webkit.org/show_bug.cgi?id=195767
2648
2649         Reviewed by Tim Horton.
2650
2651         This is a step towards removing the SVG properties tear off objects.
2652
2653         * Sources.txt:
2654         * WebCore.xcodeproj/project.pbxproj:
2655         * svg/SVGAngle.h:
2656         (WebCore::SVGAngle::create):
2657         (WebCore::SVGAngle::SVGAngle):
2658         * svg/SVGAnimateElement.h:
2659         * svg/SVGAnimatedTypeAnimator.h:
2660         (WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
2661         * svg/SVGElement.h:
2662         (WebCore::SVGElement::lookupAnimatedProperty const):
2663         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
2664         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
2665         * svg/SVGLength.h:
2666         (WebCore::SVGLength::create):
2667         (WebCore::SVGLength::SVGLength):
2668         * svg/SVGMatrix.h:
2669         (WebCore::SVGMatrix::create):
2670         (WebCore::SVGMatrix::SVGMatrix):
2671         * svg/SVGNumber.h:
2672         (WebCore::SVGNumber::create):
2673         (WebCore::SVGNumber::SVGNumber):
2674         * svg/SVGPathElement.cpp:
2675         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
2676         * svg/SVGPathElement.h:
2677         * svg/SVGPathSegList.cpp:
2678         (WebCore::SVGPathSegList::processIncomingListItemValue):
2679         * svg/SVGPathSegWithContext.h:
2680         (WebCore::SVGPathSegWithContext::animatedProperty const):
2681         * svg/SVGPoint.h:
2682         (WebCore::SVGPoint::create):
2683         (WebCore::SVGPoint::SVGPoint):
2684         * svg/SVGPreserveAspectRatio.h:
2685         (WebCore::SVGPreserveAspectRatio::create):
2686         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
2687         * svg/SVGRect.h:
2688         (WebCore::SVGRect::create):
2689         (WebCore::SVGRect::SVGRect):
2690         * svg/SVGTransform.h:
2691         (WebCore::SVGTransform::create):
2692         (WebCore::SVGTransform::SVGTransform):
2693         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2694         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
2695         (WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff):
2696         * svg/properties/SVGAnimatedProperty.cpp: Removed.
2697         * svg/properties/SVGAnimatedProperty.h: Removed.
2698         * svg/properties/SVGAnimatedPropertyTearOff.h:
2699         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
2700         (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
2701         * svg/properties/SVGAttributeAccessor.h:
2702         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
2703         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
2704         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
2705         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
2706         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
2707         * svg/properties/SVGAttributeOwnerProxy.h:
2708         * svg/properties/SVGAttributeOwnerProxyImpl.h:
2709         * svg/properties/SVGAttributeRegistry.h:
2710         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
2711         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
2712         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
2713         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
2714         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
2715         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
2716         * svg/properties/SVGLegacyAnimatedProperty.cpp: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.cpp.
2717         (WebCore::SVGLegacyAnimatedProperty::SVGLegacyAnimatedProperty):
2718         (WebCore::SVGLegacyAnimatedProperty::~SVGLegacyAnimatedProperty):
2719         (WebCore::SVGLegacyAnimatedProperty::commitChange):
2720         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Deleted.
2721         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Deleted.
2722         (WebCore::SVGAnimatedProperty::commitChange): Deleted.
2723         * svg/properties/SVGLegacyAnimatedProperty.h: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.h.
2724         (WebCore::SVGLegacyAnimatedProperty::lookupOrCreateAnimatedProperty):
2725         (WebCore::SVGLegacyAnimatedProperty::lookupAnimatedProperty):
2726         (WebCore::SVGAnimatedProperty::isAnimating const): Deleted.
2727         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): Deleted.
2728         (WebCore::SVGAnimatedProperty::contextElement const): Deleted.
2729         (WebCore::SVGAnimatedProperty::attributeName const): Deleted.
2730         (WebCore::SVGAnimatedProperty::animatedPropertyType const): Deleted.
2731         (WebCore::SVGAnimatedProperty::isReadOnly const): Deleted.
2732         (WebCore::SVGAnimatedProperty::setIsReadOnly): Deleted.
2733         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): Deleted.
2734         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): Deleted.
2735         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
2736         * svg/properties/SVGLegacyProperty.h: Copied from Source/WebCore/svg/properties/SVGProperty.h.
2737         * svg/properties/SVGListProperty.h:
2738         * svg/properties/SVGProperty.h: Removed.
2739         * svg/properties/SVGPropertyTearOff.h:
2740         (WebCore::SVGPropertyTearOff::create):
2741         (WebCore::SVGPropertyTearOff::animatedProperty const):
2742         (WebCore::SVGPropertyTearOff::setAnimatedProperty):
2743         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
2744
2745 2019-03-14  Ryan Haddad  <ryanhaddad@apple.com>
2746
2747         Unreviewed, rolling out r242963.
2748
2749         Breaks watchOS build.
2750
2751         Reverted changeset:
2752
2753         "Move CommonCrypto SPI declarations to an appropriate PAL/spi
2754         header"
2755         https://bugs.webkit.org/show_bug.cgi?id=195754
2756         https://trac.webkit.org/changeset/242963
2757
2758 2019-03-14  Chris Dumez  <cdumez@apple.com>
2759
2760         Unreviewed, update xcfilelist files as they are out of sync.
2761
2762         * DerivedSources-input.xcfilelist:
2763         * DerivedSources-output.xcfilelist:
2764
2765 2019-03-14  Justin Fan  <justin_fan@apple.com>
2766
2767         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
2768         https://bugs.webkit.org/show_bug.cgi?id=195083
2769         <rdar://problem/48423591>
2770
2771         Reviewed by Dean Jackson.
2772
2773         Fixing build error and re-introducing rolled-out changes.
2774         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
2775         is now WebGPUCommandEncoder.
2776
2777         Affected Web GPU tests updated to match new API.
2778
2779         New files and symbols:
2780         * CMakeLists.txt:
2781         * DerivedSources.make:
2782         * Sources.txt:
2783         * WebCore.xcodeproj/project.pbxproj:
2784         * bindings/js/WebCoreBuiltinNames.h:
2785
2786         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
2787         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2788         (WebCore::WebGPUCommandBuffer::create):
2789         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
2790         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
2791         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
2792         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
2793         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
2794         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
2795         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
2796         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
2797         * Modules/webgpu/WebGPUCommandBuffer.h:
2798         (WebCore::WebGPUCommandBuffer::commandBuffer):
2799         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
2800         * Modules/webgpu/WebGPUCommandBuffer.idl:
2801
2802         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
2803         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
2804         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
2805         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
2806         (WebCore::WebGPUCommandEncoder::create):
2807         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
2808         (WebCore::WebGPUCommandEncoder::beginRenderPass):
2809         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
2810         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
2811         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
2812         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
2813         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
2814         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
2815         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
2816         * Modules/webgpu/WebGPUDevice.cpp:
2817         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
2818         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
2819         * Modules/webgpu/WebGPUDevice.h:
2820         * Modules/webgpu/WebGPUDevice.idl:
2821         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2822         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
2823         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
2824         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
2825         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
2826         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2827         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
2828         * Modules/webgpu/WebGPUQueue.cpp:
2829         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
2830         * Modules/webgpu/WebGPUQueue.h:
2831         * Modules/webgpu/WebGPUQueue.idl:
2832         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2833         (WebCore::WebGPURenderPassEncoder::create):
2834         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
2835         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
2836         (WebCore::WebGPURenderPassEncoder::draw):
2837         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
2838         * Modules/webgpu/WebGPURenderPassEncoder.h:
2839         * Modules/webgpu/WebGPUSwapChain.cpp:
2840         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
2841         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
2842         * platform/graphics/gpu/GPUDevice.cpp:
2843         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
2844         (WebCore::GPUDevice::createCommandBuffer): Deleted.
2845         * platform/graphics/gpu/GPUDevice.h:
2846         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2847         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
2848         (WebCore::GPUCommandBuffer::create): Deleted.
2849
2850 2019-03-14  Justin Fan  <justin_fan@apple.com>
2851
2852         [Web GPU] Enum cleanup
2853         https://bugs.webkit.org/show_bug.cgi?id=195766
2854
2855         Reviewed by Myles C. Maxfield.
2856
2857         Clean up enum implementations in Web GPU. Enums referenced by only one class now share implementation files with that class to reduce clutter.
2858         
2859         No change in behavior.
2860
2861         * DerivedSources.make:
2862         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
2863         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
2864         * Modules/webgpu/GPUInputStateDescriptor.idl:
2865         * Modules/webgpu/GPURequestAdapterOptions.idl:
2866         * Modules/webgpu/GPUSamplerDescriptor.idl:
2867         * Modules/webgpu/GPUTextureDescriptor.idl:
2868         * Modules/webgpu/GPUTextureDimension.idl: Removed.
2869         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
2870         * Modules/webgpu/GPUVertexInputDescriptor.idl:
2871         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
2872         (WebCore::validateBufferBindingType):
2873         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
2874         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
2875         * Sources.txt:
2876         * WebCore.xcodeproj/project.pbxproj:
2877         * platform/graphics/gpu/GPUInputStateDescriptor.h:
2878         * platform/graphics/gpu/GPURequestAdapterOptions.h:
2879         * platform/graphics/gpu/GPUSamplerDescriptor.h:
2880         * platform/graphics/gpu/GPUTextureDescriptor.h:
2881         * platform/graphics/gpu/GPUTextureDimension.h: Removed.
2882         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
2883         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
2884         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2885         (WebCore::MTLDataTypeForBindingType):
2886         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
2887         (WebCore::GPUBindGroup::tryCreate):
2888         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2889         (WebCore::GPUDevice::create):
2890         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
2891         (WebCore::mtlAddressModeForAddressMode):
2892         (WebCore::mtlMinMagFilterForFilterMode):
2893         (WebCore::mtlMipFilterForFilterMode):
2894
2895 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2896
2897         Use enum class for AnimationMode
2898         https://bugs.webkit.org/show_bug.cgi?id=195762
2899
2900         Reviewed by Tim Horton.
2901
2902         Convert AnimationMode into an enum class.
2903
2904         * svg/SVGAnimateElementBase.cpp:
2905         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
2906         (WebCore::SVGAnimateElementBase::isAdditive const):
2907         * svg/SVGAnimateMotionElement.cpp:
2908         (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
2909         (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
2910         (WebCore::SVGAnimateMotionElement::updateAnimationMode):
2911         * svg/SVGAnimatedAngle.cpp:
2912         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
2913         * svg/SVGAnimatedBoolean.cpp:
2914         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
2915         * svg/SVGAnimatedColor.cpp:
2916         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
2917         * svg/SVGAnimatedEnumeration.cpp:
2918         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
2919         * svg/SVGAnimatedInteger.cpp:
2920         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
2921         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
2922         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
2923         * svg/SVGAnimatedLength.cpp:
2924         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
2925         * svg/SVGAnimatedLengthList.cpp:
2926         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
2927         * svg/SVGAnimatedNumber.cpp:
2928         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
2929         * svg/SVGAnimatedNumberList.cpp:
2930         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
2931         * svg/SVGAnimatedNumberOptionalNumber.cpp:
2932         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
2933         * svg/SVGAnimatedPath.cpp:
2934         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
2935         * svg/SVGAnimatedPointList.cpp:
2936         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
2937         * svg/SVGAnimatedPreserveAspectRatio.cpp:
2938         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
2939         * svg/SVGAnimatedRect.cpp:
2940         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
2941         * svg/SVGAnimatedTransformList.cpp:
2942         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
2943         * svg/SVGAnimationElement.cpp:
2944         (WebCore::SVGAnimationElement::updateAnimationMode):
2945         (WebCore::SVGAnimationElement::isAdditive const):
2946         (WebCore::SVGAnimationElement::isAccumulated const):
2947         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
2948         (WebCore::SVGAnimationElement::startedActiveInterval):
2949         (WebCore::SVGAnimationElement::updateAnimation):
2950         * svg/SVGAnimationElement.h:
2951         (WebCore::SVGAnimationElement::adjustFromToListValues):
2952         (WebCore::SVGAnimationElement::animateDiscreteType):
2953         (WebCore::SVGAnimationElement::animateAdditiveNumber):
2954         * svg/SVGSetElement.cpp:
2955         (WebCore::SVGSetElement::SVGSetElement):
2956         (WebCore::SVGSetElement::updateAnimationMode):
2957
2958 2019-03-14  Ryosuke Niwa  <rniwa@webkit.org>
2959
2960         Storing a Node in Ref/RefPtr inside its destructor results in double delete
2961         https://bugs.webkit.org/show_bug.cgi?id=195661
2962
2963         Reviewed by Brent Fulgham.
2964
2965         Set Node::m_refCount to 1 before calling its virtual destructor.
2966
2967         This is a security mitigation to prevent any code which ends up storing the node to Ref / RefPtr
2968         inside the destructor, which is a programming error caught by debug assertions, from triggering
2969         a double-delete on the same Node.
2970
2971         Such a code would hit the debug assertions in Node::deref() because m_inRemovedLastRefFunction
2972         had been set to true by then.
2973
2974         * dom/Document.cpp:
2975         (WebCore::Document::removedLastRef):
2976         * dom/Document.h:
2977         (WebCore::Document::decrementReferencingNodeCount):
2978         * dom/Node.cpp:
2979         (WebCore::Node::~Node):
2980         (WebCore::Node::removedLastRef):
2981
2982 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
2983
2984         Move CommonCrypto SPI declarations to an appropriate PAL/spi header
2985         https://bugs.webkit.org/show_bug.cgi?id=195754
2986         <rdar://problem/48591957>
2987
2988         Reviewed by Jiewen Tan.
2989
2990         Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
2991         Update the const correctness of one function call to match new SDK declaration.
2992
2993         No tests because there are no changes in behavior.
2994
2995         * crypto/CommonCryptoUtilities.h:
2996         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
2997         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2998
2999 2019-03-14  Chris Dumez  <cdumez@apple.com>
3000
3001         Add WebsitePolicy for the client to specify the device orientation & motion access policy
3002         https://bugs.webkit.org/show_bug.cgi?id=195750
3003
3004         Reviewed by Geoffrey Garen.
3005
3006         Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
3007         the client already knows access to the device motion & orientation API will be granted / denied,
3008         it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
3009         permission is requested by JS.
3010
3011         * dom/DeviceOrientationAndMotionAccessController.cpp:
3012         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
3013         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
3014         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
3015         * dom/DeviceOrientationAndMotionAccessController.h:
3016         * loader/DocumentLoader.h:
3017         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
3018         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
3019         * page/DOMWindow.cpp:
3020         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
3021
3022 2019-03-14  Shawn Roberts  <sroberts@apple.com>
3023
3024         Unreviewed, rolling out r242931.
3025
3026         Causing internal watch/tv OS build failures
3027
3028         Reverted changeset:
3029
3030         "[Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue
3031         concept"
3032         https://bugs.webkit.org/show_bug.cgi?id=195083
3033         https://trac.webkit.org/changeset/242931
3034
3035 2019-03-14  Chris Dumez  <cdumez@apple.com>
3036
3037         Device orientation's permission should only require a user gesture to prompt the user
3038         https://bugs.webkit.org/show_bug.cgi?id=195731
3039
3040         Reviewed by Geoffrey Garen.
3041
3042         Device orientation's permission should only require a user gesture to prompt the user. If the
3043         user already made a decision, we should resolve the promise with this decision, even without
3044         user gesture.
3045
3046         This is useful for JS to figure out if they are access to device orientation or not because
3047         showing UI for the user to give permission.
3048
3049         No new tests, updated existing tests.
3050
3051         * dom/DeviceOrientationAndMotionAccessController.cpp:
3052         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
3053         * dom/DeviceOrientationAndMotionAccessController.h:
3054         * dom/DeviceOrientationOrMotionEvent.cpp:
3055         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
3056
3057 2019-03-14  Youenn Fablet  <youenn@apple.com>
3058
3059         Reset storage quota when clearing IDB/Cache API entries
3060         https://bugs.webkit.org/show_bug.cgi?id=195716
3061
3062         Reviewed by Chris Dumez.
3063
3064         On clearing of databases, reset all quota users.
3065         This will ensure all layout test runs start with a clean state.
3066
3067         * Modules/indexeddb/server/IDBServer.cpp:
3068         (WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases):
3069         * storage/StorageQuotaManager.h:
3070         (WebCore::StorageQuotaManager::resetQuota):
3071
3072 2019-03-14  Jer Noble  <jer.noble@apple.com>
3073
3074         Certain videos are causing a crash when used as WebGL texture
3075         https://bugs.webkit.org/show_bug.cgi?id=195700
3076         <rdar://problem/48869347>
3077
3078         Reviewed by Eric Carlson.
3079
3080         CFEqual is not null-safe, so perform a null and type check before comparing.
3081
3082         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3083         (WebCore::transferFunctionFromString):
3084
3085 2019-03-14  Zalan Bujtas  <zalan@apple.com>
3086
3087         Cleanup inline boxes when list marker gets blockified
3088         https://bugs.webkit.org/show_bug.cgi?id=195746
3089         <rdar://problem/48049175>
3090
3091         Reviewed by Antti Koivisto.
3092
3093         Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
3094         During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
3095         change does not require a new renderer.
3096         This patch takes care of destroying the inline boxtree when the marker gains block display type. 
3097
3098         Test: fast/block/float/list-marker-is-float-crash.html
3099
3100         * rendering/RenderListMarker.cpp:
3101         (WebCore::RenderListMarker::styleDidChange):
3102
3103 2019-03-14  Devin Rousso  <drousso@apple.com>
3104
3105         Web Inspector: Audit: provide a way to get the contents of resources
3106         https://bugs.webkit.org/show_bug.cgi?id=195266
3107         <rdar://problem/48550911>
3108
3109         Reviewed by Joseph Pecoraro.
3110
3111         Test: inspector/audit/run-resources.html
3112
3113         * inspector/InspectorAuditResourcesObject.idl: Added.
3114         * inspector/InspectorAuditResourcesObject.h: Added.
3115         (WebCore::InspectorAuditResourcesObject::create):
3116         (WebCore::InspectorAuditResourcesObject::Resource):
3117         (WebCore::InspectorAuditResourcesObject::ResourceContent):
3118         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient):
3119         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient):
3120         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient):
3121         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient):
3122         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient):
3123         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient):
3124         * inspector/InspectorAuditResourcesObject.cpp: Added.
3125         (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject):
3126         (WebCore::InspectorAuditResourcesObject::getResources):
3127         (WebCore::InspectorAuditResourcesObject::getResourceContent):
3128         (WebCore::InspectorAuditResourcesObject::clientForResource):
3129
3130         * inspector/agents/InspectorPageAgent.h:
3131         * inspector/agents/InspectorPageAgent.cpp:
3132         (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added.
3133         (WebCore::allResourcesURLsForFrame):
3134         Moved a file static function to be a class static function so it can be used elsewhere.
3135
3136         * CMakeLists.txt:
3137         * DerivedSources-input.xcfilelist:
3138         * DerivedSources-output.xcfilelist:
3139         * DerivedSources.make:
3140         * Sources.txt:
3141         * WebCore.xcodeproj/project.pbxproj:
3142
3143 2019-03-14  Devin Rousso  <drousso@apple.com>
3144
3145         Web Inspector: Console: getEventListeners should work for any EventTarget
3146         https://bugs.webkit.org/show_bug.cgi?id=195713
3147
3148         Reviewed by Joseph Pecoraro.
3149
3150         Test: inspector/console/command-line-api-getEventListeners.html
3151
3152         * dom/EventTarget.h:
3153         * dom/EventTarget.cpp:
3154         (WebCore::EventTarget::eventTypes): Added.
3155
3156         * inspector/CommandLineAPIHost.idl:
3157         * inspector/CommandLineAPIHost.h:
3158         (WebCore::CommandLineAPIHost::init):
3159         * inspector/CommandLineAPIHost.cpp:
3160         (WebCore::CommandLineAPIHost::disconnect):
3161         (WebCore::CommandLineAPIHost::getEventListeners):
3162         (WebCore::listenerEntriesFromListenerInfo): Deleted.
3163
3164         * inspector/CommandLineAPIModuleSource.js:
3165         (CommandLineAPIImpl.prototype.getEventListeners):
3166
3167         * inspector/InspectorController.cpp:
3168         (WebCore::InspectorController::InspectorController):
3169         * inspector/WorkerInspectorController.cpp:
3170         (WebCore::WorkerInspectorController::WorkerInspectorController):
3171
3172 2019-03-14  Devin Rousso  <drousso@apple.com>
3173
3174         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
3175         https://bugs.webkit.org/show_bug.cgi?id=195123
3176         <rdar://problem/48450148>
3177
3178         Reviewed by Joseph Pecoraro.
3179
3180         Test: inspector/css/getMatchedStylesForNode.html
3181
3182         * inspector/agents/InspectorCSSAgent.cpp:
3183         (WebCore::protocolValueForPseudoId): Added.
3184         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
3185
3186 2019-03-13  Benjamin Poulain  <benjamin@webkit.org>
3187
3188         Fix the argument type of RenderView::resumePausedImageAnimationsIfNeeded()
3189         https://bugs.webkit.org/show_bug.cgi?id=195659
3190
3191         Reviewed by Saam Barati.
3192
3193         The two callers of resumePausedImageAnimationsIfNeeded() both get the IntRect
3194         as a reference. The rect was going on the stack then used as a reference again.
3195
3196         * rendering/RenderView.cpp:
3197         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
3198         * rendering/RenderView.h:
3199
3200 2019-03-13  Zalan Bujtas  <zalan@apple.com>
3201
3202         [ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
3203         https://bugs.webkit.org/show_bug.cgi?id=195724
3204         <rdar://problem/48873456>
3205
3206         Reviewed by Simon Fraser.
3207
3208         Call willNotProceedWithClick on preventDefault. This is very similar to the long press case.
3209
3210         * page/ios/ContentChangeObserver.cpp:
3211         (WebCore::willNotProceedWithClick):
3212         (WebCore::ContentChangeObserver::didRecognizeLongPress):
3213         (WebCore::ContentChangeObserver::didPreventDefaultForEvent):
3214         * page/ios/ContentChangeObserver.h:
3215
3216 2019-03-13  Justin Fan  <justin_fan@apple.com>
3217
3218         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue concept
3219         https://bugs.webkit.org/show_bug.cgi?id=195083
3220         <rdar://problem/48423591>
3221
3222         Reviewed by Dean Jackson.
3223
3224         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
3225         is now WebGPUCommandEncoder.
3226
3227         Affected Web GPU tests updated to match new API.
3228
3229         New files and symbols:
3230         * CMakeLists.txt:
3231         * DerivedSources.make:
3232         * Sources.txt:
3233         * WebCore.xcodeproj/project.pbxproj:
3234         * bindings/js/WebCoreBuiltinNames.h:
3235
3236         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
3237         * Modules/webgpu/WebGPUCommandBuffer.cpp:
3238         (WebCore::WebGPUCommandBuffer::create):
3239         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
3240         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
3241         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
3242         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
3243         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
3244         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
3245         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
3246         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
3247         * Modules/webgpu/WebGPUCommandBuffer.h:
3248         (WebCore::WebGPUCommandBuffer::commandBuffer):
3249         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
3250         * Modules/webgpu/WebGPUCommandBuffer.idl:
3251
3252         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
3253         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
3254         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
3255         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
3256         (WebCore::WebGPUCommandEncoder::create):
3257         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
3258         (WebCore::WebGPUCommandEncoder::beginRenderPass):
3259         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
3260         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
3261         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
3262         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
3263         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
3264         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
3265         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
3266         * Modules/webgpu/WebGPUDevice.cpp:
3267         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
3268         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
3269         * Modules/webgpu/WebGPUDevice.h:
3270         * Modules/webgpu/WebGPUDevice.idl:
3271         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
3272         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
3273         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
3274         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
3275         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
3276         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
3277         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
3278         * Modules/webgpu/WebGPUQueue.cpp:
3279         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
3280         * Modules/webgpu/WebGPUQueue.h:
3281         * Modules/webgpu/WebGPUQueue.idl:
3282         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3283         (WebCore::WebGPURenderPassEncoder::create):
3284         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
3285         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
3286         (WebCore::WebGPURenderPassEncoder::draw):
3287         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
3288         * Modules/webgpu/WebGPURenderPassEncoder.h:
3289         * Modules/webgpu/WebGPUSwapChain.cpp:
3290         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
3291         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
3292         * platform/graphics/gpu/GPUDevice.cpp:
3293         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
3294         (WebCore::GPUDevice::createCommandBuffer): Deleted.
3295         * platform/graphics/gpu/GPUDevice.h:
3296         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3297         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
3298         (WebCore::GPUCommandBuffer::create): Deleted.
3299
3300 2019-03-13  Zalan Bujtas  <zalan@apple.com>
3301
3302         [WeakPtr] RenderListMarker::m_listItem should be a WeakPtr
3303         https://bugs.webkit.org/show_bug.cgi?id=195704
3304         <rdar://problem/48486278>
3305
3306         Reviewed by Simon Fraser.
3307
3308         * rendering/RenderListMarker.cpp:
3309         (WebCore::RenderListMarker::RenderListMarker):
3310         (WebCore::RenderListMarker::paint):
3311         (WebCore::RenderListMarker::layout):
3312         (WebCore::RenderListMarker::updateContent):
3313         (WebCore::RenderListMarker::computePreferredLogicalWidths):
3314         (WebCore::RenderListMarker::lineHeight const):
3315         (WebCore::RenderListMarker::baselinePosition const):
3316         (WebCore::RenderListMarker::suffix const):
3317         (WebCore::RenderListMarker::isInside const):
3318         (WebCore::RenderListMarker::getRelativeMarkerRect):
3319         * rendering/RenderListMarker.h:
3320
3321 2019-03-13  Dean Jackson  <dino@apple.com>
3322
3323         Block all plugins smaller than 5x5px
3324         https://bugs.webkit.org/show_bug.cgi?id=195702
3325         <rdar://problem/28435204>
3326
3327         Reviewed by Sam Weinig.
3328
3329         Block all plugins that are smaller than a threshold, in this case
3330         5px x 5px. Other browsers have implemented this for a while, and now
3331         that we have Intersection Observers, small plugins are no longer
3332         necessary.
3333
3334         Test: plugins/small-plugin-blocked.html
3335
3336         * en.lproj/Localizable.strings: New message for a small plugin.
3337         * platform/LocalizedStrings.cpp:
3338         (WebCore::pluginTooSmallText):
3339         * platform/LocalizedStrings.h:
3340
3341         * html/HTMLPlugInElement.cpp: Helper function for Internals testing.
3342         (WebCore::HTMLPlugInElement::isBelowSizeThreshold const):
3343         * html/HTMLPlugInElement.h:
3344
3345         * loader/EmptyClients.cpp: Removed an unused function.
3346         (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted.
3347         * loader/EmptyFrameLoaderClient.h:
3348         * loader/FrameLoaderClient.h:
3349
3350         * page/Settings.yaml: Add flag for new feature.
3351
3352         * rendering/RenderEmbeddedObject.cpp: New unavailability reason for
3353         embedded objects.
3354         (WebCore::unavailablePluginReplacementText):
3355         * rendering/RenderEmbeddedObject.h:
3356         (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const):
3357
3358         * testing/Internals.cpp: Helper function for testing.
3359         (WebCore::Internals::pluginIsBelowSizeThreshold):
3360         * testing/Internals.h:
3361         * testing/Internals.idl:
3362
3363 2019-03-13  Zalan Bujtas  <zalan@apple.com>
3364
3365         Use RenderBox::previousSiblingBox/nextSiblingBox in RenderMultiColumnFlow
3366         https://bugs.webkit.org/show_bug.cgi?id=195701
3367         <rdar://problem/48448658>
3368
3369         Reviewed by Simon Fraser.
3370
3371         It's safer to use existing RenderBox functions to get sibling boxes.
3372
3373         Test: fast/ruby/crash-when-paginated-ruby.html
3374
3375         * rendering/RenderMultiColumnFlow.cpp:
3376         (WebCore::RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf):
3377         (WebCore::RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf):
3378
3379 2019-03-13  Keith Rollin  <krollin@apple.com>
3380
3381         Add support for new StagedFrameworks layout
3382         https://bugs.webkit.org/show_bug.cgi?id=195543
3383
3384         Reviewed by Alexey Proskuryakov.
3385
3386         When creating the WebKit layout for out-of-band Safari/WebKit updates,
3387         use an optional path prefix when called for.
3388
3389         No new tests since there should be no observable behavior difference.
3390
3391         * Configurations/WebCore.xcconfig:
3392
3393 2019-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3394
3395         Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element
3396         https://bugs.webkit.org/show_bug.cgi?id=195663
3397         <rdar://problem/48576391>
3398
3399         Reviewed by Ryosuke Niwa.
3400
3401         Currently, it's possible for HTMLFormControlElement's destructor to be reentrant. This may happen if the form
3402         control element is ref'd while carrying out its destructor's logic. This may happen in two places in
3403         HTMLFormControlElement (didChangeForm and resetDefaultButton), both of which actually don't require ensuring a
3404         protected reference to the form control element since they should never result in any script execution.
3405
3406         To fix the bug, convert these strong references into raw pointers, and add ScriptDisallowedScope to ensure that
3407         we don't change these codepaths in the future, such that they trigger arbitrary script execution.
3408
3409         Test: fast/forms/remove-associated-element-after-gc.html
3410
3411         * html/HTMLFormControlElement.cpp:
3412         (WebCore::HTMLFormControlElement::didChangeForm):
3413         * html/HTMLFormElement.cpp:
3414         (WebCore::HTMLFormElement::resetDefaultButton):
3415
3416 2019-03-13  Daniel Bates  <dabates@apple.com>
3417
3418         Remove some unnecessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards
3419         https://bugs.webkit.org/show_bug.cgi?id=195703
3420
3421         Reviewed by Tim Horton.
3422
3423         Remove out-of-date comment and unncessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards. Following
3424         r240604 we now make use of WebCore::windowsKeyCodeForCharCode() even for hardware key events
3425         when USE(UIKIT_KEYBOARD_ADDITIONS) is enabled.
3426
3427         No functionality changed. So, no new tests.
3428
3429         * platform/ios/KeyEventIOS.mm:
3430         (WebCore::windowsKeyCodeForCharCode):
3431         * platform/ios/WebEvent.mm:
3432         (normalizedStringWithAppKitCompatibilityMapping):
3433
3434 2019-03-13  Simon Fraser  <simon.fraser@apple.com>
3435
3436         Scrolling tree should reposition non-stacking order descendents of overflow:scroll
3437         https://bugs.webkit.org/show_bug.cgi?id=195608
3438
3439         Reviewed by Zalan Bujtas.
3440         
3441         Step 1: add scrolling tree positioning nodes classes (but don't create them yet).
3442
3443         Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
3444         an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
3445         the values of ScrollPositioningBehavior:
3446
3447         ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
3448             async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
3449             When the overflow scrolls, this layer has to move along with the overflow.
3450
3451         ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
3452             overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
3453             This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.
3454
3455         PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
3456         
3457         This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
3458         is just a stub so the new node types aren't created yet.
3459         
3460         RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
3461         role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
3462         the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.
3463
3464         Test: scrollingcoordinator/scrolling-tree/positioned-nodes.html
3465
3466         * Sources.txt:
3467         * SourcesCocoa.txt:
3468         * WebCore.xcodeproj/project.pbxproj:
3469         * page/scrolling/AsyncScrollingCoordinator.cpp:
3470         (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry):
3471         (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
3472         * page/scrolling/AsyncScrollingCoordinator.h:
3473         * page/scrolling/ScrollingConstraints.cpp:
3474         (WebCore::operator<<):
3475         * page/scrolling/ScrollingConstraints.h:
3476         (WebCore::LayoutConstraints::LayoutConstraints):
3477         (WebCore::LayoutConstraints::operator== const):
3478         (WebCore::LayoutConstraints::operator!= const):
3479         (WebCore::LayoutConstraints::alignmentOffset const):
3480         (WebCore::LayoutConstraints::setAlignmentOffset):
3481         (WebCore::LayoutConstraints::layerPositionAtLastLayout const):
3482         (WebCore::LayoutConstraints::setLayerPositionAtLastLayout):
3483         (WebCore::LayoutConstraints::scrollPositioningBehavior const):
3484         (WebCore::LayoutConstraints::setScrollPositioningBehavior):
3485         * page/scrolling/ScrollingCoordinator.cpp:
3486         (WebCore::operator<<):
3487         * page/scrolling/ScrollingCoordinator.h:
3488         (WebCore::ScrollingCoordinator::setPositionedNodeGeometry):
3489         (WebCore::ScrollingCoordinator::setRelatedOverflowScrollingNodes):
3490         * page/scrolling/ScrollingCoordinatorTypes.h:
3491         * page/scrolling/ScrollingStateNode.h:
3492         (WebCore::ScrollingStateNode::isPositionedNode const):
3493         * page/scrolling/ScrollingStatePositionedNode.cpp: Added.
3494         (WebCore::ScrollingStatePositionedNode::create):
3495         (WebCore::ScrollingStatePositionedNode::ScrollingStatePositionedNode):
3496         (WebCore::ScrollingStatePositionedNode::clone):
3497         (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged):
3498         (WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes):
3499         (WebCore::ScrollingStatePositionedNode::updateConstraints):
3500         (WebCore::ScrollingStatePositionedNode::dumpProperties const):
3501         * page/scrolling/ScrollingStatePositionedNode.h: Added.
3502         * page/scrolling/ScrollingStateTree.cpp:
3503         (WebCore::ScrollingStateTree::createNode):
3504         * page/scrolling/ScrollingTree.cpp:
3505         (WebCore::ScrollingTree::updateTreeFromStateNode):
3506         * page/scrolling/ScrollingTree.h:
3507         * page/scrolling/ScrollingTreeNode.h:
3508         (WebCore::ScrollingTreeNode::isPositionedNode const):
3509         * page/scrolling/cocoa/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h.
3510         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: Added.
3511         (WebCore::ScrollingTreePositionedNode::create):
3512         (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
3513         (WebCore::ScrollingTreePositionedNode::~ScrollingTreePositionedNode):
3514         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
3515         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
3516         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
3517         (WebCore::ScrollingTreePositionedNode::dumpProperties const):
3518         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
3519         * page/scrolling/mac/ScrollingTreeMac.cpp:
3520         (ScrollingTreeMac::createScrollingTreeNode):
3521         * platform/ScrollTypes.h:
3522         * rendering/RenderLayerBacking.cpp:
3523         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
3524         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
3525         * rendering/RenderLayerBacking.h:
3526         * rendering/RenderLayerCompositor.cpp:
3527         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
3528         (WebCore::scrollCoordinationRoleForNodeType):
3529         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
3530         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
3531         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
3532         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
3533         * rendering/RenderLayerCompositor.h:
3534
3535 2019-03-13  Youenn Fablet  <youenn@apple.com>
3536
3537         Check IDB quota usage through QuotaManager
3538         https://bugs.webkit.org/show_bug.cgi?id=195302
3539
3540         Reviewed by Chris Dumez.
3541
3542         For every write operation, compute an estimate size and check for quota before proceeding.
3543         When proceeding, store the estimate size in a map.
3544         If size of the database is to be computed when the task is not done,
3545         the estimate size will be added to the current size of the databases.
3546         At the end of the task, the estimate size is removed from the map,
3547         and the databases size is refreshed.
3548
3549         This patch implements size estimation for write tasks.
3550         Put/add operations might overestimate the size
3551         when an old value will be replaced by a new value.
3552         In that case, we do not substract the old value size since we do not know it.
3553
3554         This patch implements database opening by adding a fixed small cost,
3555         as we do not know whether the database is new or not.
3556
3557         For the first IDB request, we have not computed the size of the database.
3558         To do so, we need to go to a background thread and do that file size computation.
3559         For that purpose, we add support for being-initialized quota user.
3560         Quota manager is calling whenInitialized on its quota user and will
3561         delay any quota check requests until its quota user is answering this callback.
3562
3563         For in process IDB, use the default storage quota per origin and do not increase it.
3564         Future work should move it to NetworkProcess and implement some quota checking.
3565
3566         Cache API and IDB quota management are not yet fully unified.
3567         If IDB is used on start-up, we should check for Cache API storage size.
3568         Conversely, on Cache API first wite task, even if IDB is not being used,
3569         we should compute the size of the IDB data for the given origin.
3570
3571         Test: http/tests/IndexedDB/storage-limit.https.html
3572
3573         * Modules/indexeddb/server/IDBBackingStore.h:
3574         * Modules/indexeddb/server/IDBServer.cpp:
3575         (WebCore::IDBServer::IDBServer::create):
3576         (WebCore::IDBServer::IDBServer::IDBServer):
3577         (WebCore::IDBServer::m_quotaManagerGetter):
3578         (WebCore::IDBServer::IDBServer::QuotaUser::QuotaUser):
3579         (WebCore::IDBServer::IDBServer::QuotaUser::~QuotaUser):
3580         (WebCore::IDBServer::IDBServer::QuotaUser::clearSpaceUsed):
3581         (WebCore::IDBServer::IDBServer::QuotaUser::whenInitialized):
3582         (WebCore::IDBServer::IDBServer::QuotaUser::initializeSpaceUsed):
3583         (WebCore::IDBServer::IDBServer::quotaUser):
3584         (WebCore::IDBServer::IDBServer::startComputingSpaceUsedForOrigin):
3585         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
3586         (WebCore::IDBServer::IDBServer::finishComputingSpaceUsedForOrigin):
3587         (WebCore::IDBServer::IDBServer::requestSpace):
3588         (WebCore::IDBServer::IDBServer::clearSpaceUsed):
3589         (WebCore::IDBServer::IDBServer::setSpaceUsed):
3590         (WebCore::IDBServer::IDBServer::increasePotentialSpaceUsed):
3591         (WebCore::IDBServer::IDBServer::decreasePotentialSpaceUsed):
3592         * Modules/indexeddb/server/IDBServer.h:
3593         (WebCore::IDBServer::IDBServer::create):
3594         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3595         (WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const):
3596         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3597         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3598         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder):
3599         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
3600         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
3601         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3602         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3603         (WebCore::IDBServer::estimateSize):
3604         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
3605         (WebCore::IDBServer::quotaErrorMessageName):
3606         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
3607         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
3608         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
3609         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
3610         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
3611         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
3612         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
3613         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
3614         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
3615         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
3616         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
3617         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
3618         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
3619         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
3620         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3621         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
3622         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
3623         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
3624         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3625         (WebCore::IDBServer::UniqueIDBDatabase::server):
3626         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3627         (WebCore::InProcessIDBServer::create):
3628         (WebCore::InProcessIDBServer::quotaManager):
3629         (WebCore::storageQuotaManagerGetter):
3630         (WebCore::InProcessIDBServer::InProcessIDBServer):
3631         * Modules/indexeddb/shared/InProcessIDBServer.h:
3632         * loader/EmptyClients.cpp:
3633         * storage/StorageQuotaManager.cpp:
3634         (WebCore::StorageQuotaManager::addUser):
3635         (WebCore::StorageQuotaManager::requestSpace):
3636         * storage/StorageQuotaManager.h:
3637         (WebCore::StorageQuotaManager::defaultQuota):
3638         (WebCore::StorageQuotaManager::removeUser):
3639         * storage/StorageQuotaUser.h:
3640         (WebCore::StorageQuotaUser::whenInitialized):
3641
3642 2019-03-13  Chris Dumez  <cdumez@apple.com>
3643
3644         Better build fix after r242901.
3645
3646         Reviewed by Jer Noble.
3647
3648         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3649         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
3650         (MediaSessionManagerCocoa::updateNowPlayingInfo):
3651
3652 2019-03-13  Timothy Hatcher  <timothy@apple.com>
3653
3654         Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
3655         https://bugs.webkit.org/show_bug.cgi?id=195636
3656         rdar://problem/45055697
3657
3658         Reviewed by Ryosuke Niwa.
3659
3660         * editing/DictionaryPopupInfo.h:
3661         (WebCore::DictionaryPopupInfo::encodingRequiresPlatformData const): Added.
3662         * editing/FontAttributes.h:
3663         (WebCore::FontAttributes::encodingRequiresPlatformData const): Added.
3664
3665 2019-03-13  Chris Dumez  <cdumez@apple.com>
3666
3667         Unreviewed build fix after r242901.
3668
3669         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3670         (MediaSessionManagerCocoa::updateNowPlayingInfo):
3671
3672 2019-03-13  Chris Dumez  <cdumez@apple.com>
3673
3674         Use a ServiceWorker process per registrable domain
3675         https://bugs.webkit.org/show_bug.cgi?id=195649
3676
3677         Reviewed by Youenn Fablet.
3678
3679         Use a ServiceWorker process per registrable domain instead of one per security origin. This is
3680         more in line with PSON and avoids launching too many processes.
3681
3682         * page/ClientOrigin.h:
3683         (WebCore::ClientOrigin::clientRegistrableDomain const):
3684         * workers/service/server/SWServer.cpp:
3685         (WebCore::SWServer::tryInstallContextData):
3686         (WebCore::SWServer::serverToContextConnectionCreated):
3687         (WebCore::SWServer::runServiceWorkerIfNecessary):
3688         (WebCore::SWServer::markAllWorkersForRegistrableDomainAsTerminated):
3689         (WebCore::SWServer::registerServiceWorkerClient):
3690         (WebCore::SWServer::unregisterServiceWorkerClient):
3691         (WebCore::SWServer::needsServerToContextConnectionForRegistrableDomain const):
3692         * workers/service/server/SWServer.h:
3693         * workers/service/server/SWServerToContextConnection.cpp:
3694         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
3695         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
3696         (WebCore::SWServerToContextConnection::connectionForRegistrableDomain):
3697         * workers/service/server/SWServerToContextConnection.h:
3698         (WebCore::SWServerToContextConnection::registrableDomain const):
3699         * workers/service/server/SWServerWorker.cpp:
3700         (WebCore::SWServerWorker::contextConnection):
3701         * workers/service/server/SWServerWorker.h:
3702         (WebCore::SWServerWorker::registrableDomain const):
3703
3704 2019-03-13  Chris Dumez  <cdumez@apple.com>
3705
3706         REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
3707         https://bugs.webkit.org/show_bug.cgi?id=195684
3708         <rdar://problem/48294714>
3709
3710         Reviewed by Antti Koivisto.
3711
3712         The issue was caused by us failing to suspend the current page on navigation because the source and
3713         target WebBackForwardListItem are identical. The source WebBackForwardListItem was wrong.
3714
3715         When a navigation is triggered by the WebContent process (and not the UIProcess), we create the Navigation
3716         object in WebPageProxy::decidePolicyForNavigationAction(). For the navigation's targetItem, we use the
3717         target item identifier provided by the WebContent process via the NavigationActionData. However,
3718         for the source item, we would use the WebBackForwardList's currentItem in the UIProcess. The issue
3719         is that the WebBackForwardList's currentItem usually has already been updated to be the target
3720         item via a WebPageProxy::BackForwardGoToItem() synchronous IPC.
3721
3722         To avoid raciness and given that the current history management is fragile (as it is managed by
3723         both the UIProcess and the WebProcess), I am now passing the source item identifier in
3724         addition to the target item identifier in the NavigationActionData that is sent by the WebProcess.
3725         This is a lot less error prone, the WebProcess knows more accurately which history items it is going
3726         from and to.
3727
3728         * loader/FrameLoader.cpp:
3729         (WebCore::FrameLoader::loadURLIntoChildFrame):
3730         (WebCore::FrameLoader::loadDifferentDocumentItem):
3731         (WebCore::FrameLoader::loadItem):
3732         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
3733         * loader/FrameLoader.h:
3734         * loader/HistoryController.cpp:
3735         (WebCore::HistoryController::recursiveGoToItem):
3736         * loader/NavigationAction.cpp:
3737         (WebCore::NavigationAction::setSourceBackForwardItem):
3738         * loader/NavigationAction.h:
3739         (WebCore::NavigationAction::sourceBackForwardItemIdentifier const):
3740
3741 2019-03-13  Jer Noble  <jer.noble@apple.com>
3742
3743         Add AggregateLogger, a Logger specialization for singleton classes.
3744         https://bugs.webkit.org/show_bug.cgi?id=195644
3745
3746         Reviewed by Eric Carlson.
3747
3748         Convert debug logging over to release logging through the use of AggregateLogger.
3749
3750         * platform/audio/PlatformMediaSession.h:
3751         (WebCore::PlatformMediaSession::client const):
3752         * platform/audio/PlatformMediaSessionManager.cpp:
3753         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
3754         (WebCore::PlatformMediaSessionManager::beginInterruption):
3755         (WebCore::PlatformMediaSessionManager::endInterruption):
3756         (WebCore::PlatformMediaSessionManager::addSession):
3757         (WebCore::PlatformMediaSessionManager::removeSession):
3758         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
3759         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
3760         (WebCore::PlatformMediaSessionManager::setCurrentSession):
3761         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
3762         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
3763         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
3764         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
3765         (WebCore::PlatformMediaSessionManager::logChannel const):
3766         * platform/audio/PlatformMediaSessionManager.h:
3767         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3768         (MediaSessionManagerCocoa::updateSessionState):
3769         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
3770         (MediaSessionManagerCocoa::removeSession):
3771         (MediaSessionManagerCocoa::sessionWillEndPlayback):
3772         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
3773         (MediaSessionManagerCocoa::updateNowPlayingInfo):
3774         * platform/audio/ios/MediaSessionManagerIOS.mm:
3775         (WebCore::MediaSessionManageriOS::resetRestrictions):
3776         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
3777
3778 2019-03-13  Chris Dumez  <cdumez@apple.com>
3779
3780         Drop legacy WebCore::toRegistrableDomain() utility function
3781         https://bugs.webkit.org/show_bug.cgi?id=195637
3782
3783         Reviewed by Geoffrey Garen.
3784
3785         Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
3786         Update call sites to use modern RegistrableDomain type instead.
3787
3788         * loader/CrossOriginAccessControl.cpp:
3789         (WebCore::shouldCrossOriginResourcePolicyCancelLoad):
3790         * loader/FrameLoader.cpp:
3791         (WebCore::FrameLoader::setFirstPartyForCookies):
3792         * page/DOMWindow.cpp:
3793         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
3794         * platform/RegistrableDomain.h:
3795         (WebCore::registrableDomainsAreEqual):
3796         * platform/network/ResourceRequestBase.h:
3797         * platform/network/cf/ResourceRequestCFNet.cpp:
3798         * platform/network/cocoa/ResourceRequestCocoa.mm:
3799
3800 2019-03-13  Alex Christensen  <achristensen@webkit.org>
3801
3802         Prevent checked_cf_cast crashes in ResourceResponse::platformCertificateInfo
3803         https://bugs.webkit.org/show_bug.cgi?id=195686
3804
3805         Reviewed by Tim Horton.
3806
3807         This covers up a type confusion bug on some OSes until rdar://problem/48853137 is resolved.
3808
3809         * SourcesCocoa.txt:
3810         * WebCore.xcodeproj/project.pbxproj:
3811         * platform/network/cocoa/ResourceResponseCocoa.mm:
3812
3813 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
3814
3815         [GStreamer][WebRTC] Add support for omxh264enc encoder
3816         https://bugs.webkit.org/show_bug.cgi?id=195676
3817
3818         Reviewed by Philippe Normand.
3819
3820         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
3821         (setup_omxh264enc):
3822         (set_bitrate_bit_per_sec):
3823         (gst_webrtc_video_encoder_class_init):
3824
3825 2019-03-13  Antoine Quint  <graouts@apple.com>
3826
3827         REGRESSION(r240634): Element::hasPointerCapture() passes a JS-controlled value directly into a HashMap as a key
3828         https://bugs.webkit.org/show_bug.cgi?id=195683
3829         <rdar://problem/48659950>
3830
3831         Reviewed by Alex Christensen.
3832
3833         While PointerID is defined as int32_t, we now use int64_t as the key of the HashMap mapping PointerID to CapturingData so that we use
3834         a value outside of the int32_t range as a safe empty and removed values, allowing any int32_t to be provided through the API for
3835         lookup in this HashMap.
3836
3837         Test: pointerevents/pointer-id-crash.html
3838
3839         * page/PointerCaptureController.h:
3840
3841 2019-03-12  Brady Eidson  <beidson@apple.com>
3842
3843         Take UnboundedNetworking assertion when a file upload is in progress.
3844         https://bugs.webkit.org/show_bug.cgi?id=195497
3845
3846         Reviewed by Geoff Garen.
3847
3848         * platform/network/ResourceRequestBase.cpp:
3849         (WebCore::ResourceRequestBase::hasUpload const):
3850         * platform/network/ResourceRequestBase.h:
3851
3852 2019-03-13  Youenn Fablet  <youenn@apple.com>
3853
3854         Enable libwebrtc logging control through WebCore
3855         https://bugs.webkit.org/show_bug.cgi?id=195658
3856
3857         Reviewed by Eric Carlson.
3858
3859         Add support for WebCore logging of libwebrtc messages.
3860         This is controlled by WebRTC log channel state and level.
3861         In case of private browsing mode, any logging is disabled.
3862         This will stay for the lifetime of the process.
3863         No change of behavior.
3864
3865         * Modules/mediastream/RTCPeerConnection.cpp:
3866         (WebCore::RTCPeerConnection::create):
3867         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3868         (WebCore::doReleaseLogging):
3869         (WebCore::setLogging):
3870         (WebCore::computeLogLevel):
3871         (WebCore::initializePeerConnectionFactoryAndThreads):
3872         (WebCore::LibWebRTCProvider::setEnableLogging):
3873         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3874
3875 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
3876
3877         [GStreamer][WebRTC] Do not sync encoder on the clock
3878         https://bugs.webkit.org/show_bug.cgi?id=195673
3879
3880         we should encode as fast as possible and totally ignore timestamp while
3881         doing so.
3882
3883         Reviewed by Philippe Normand.
3884
3885         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3886         (WebCore::GStreamerVideoEncoder::InitEncode):
3887
3888 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
3889
3890         [GStreamer][WebRTC]: Use codec setting video height/width as fallback
3891         https://bugs.webkit.org/show_bug.cgi?id=195675
3892
3893         Reviewed by Philippe Normand.
3894
3895         In some cases the frame height and width is not set (not sure why/ in
3896         what conditions but it happens) so make sure to get the information from
3897         the VideoCodec when configuring the encoder.
3898
3899         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
3900         (WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
3901         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
3902
3903 2019-03-13  Miguel Gomez  <magomez@igalia.com>
3904
3905         [CoordinatedGraphics] Null dereference in CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded
3906         https://bugs.webkit.org/show_bug.cgi?id=195615
3907
3908         Reviewed by Carlos Garcia Campos.
3909
3910         Exit early if we don't receive a valid coordinator.
3911
3912         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3913         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
3914
3915 2019-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>
3916
3917         [Win][PlayStation] Remove WebCore::standardUserAgentForURL
3918         https://bugs.webkit.org/show_bug.cgi?id=195662
3919
3920         Reviewed by Ryosuke Niwa.
3921
3922         WebCore::standardUserAgentForURL is just a stub in Windows port.
3923
3924         No new tests because there is no behavior change.
3925
3926         * platform/win/UserAgentWin.cpp:
3927         (WebCore::standardUserAgentForURL): Deleted.
3928         * platform/playstation/UserAgentPlayStation.cpp:
3929         (WebCore::standardUserAgentForURL): Deleted.
3930
3931 2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
3932
3933         [Win] Fix a slew of simple clang-cl warnings.
3934         https://bugs.webkit.org/show_bug.cgi?id=195652
3935
3936         Reviewed by Don Olmstead.
3937
3938         * page/AutoscrollController.cpp:
3939         (WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
3940         * platform/network/curl/CurlContext.cpp:
3941         (WebCore::CurlHandle::willSetupSslCtx):
3942         (WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
3943         * platform/network/curl/CurlFormDataStream.cpp:
3944         (WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
3945         * platform/network/curl/CurlRequest.cpp:
3946         (WebCore::CurlRequest::CurlRequest): -Wreorder
3947         (WebCore::CurlRequest::setupTransfer): -Wunused-variable
3948         * platform/network/curl/CurlSSLVerifier.cpp:
3949         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
3950         * platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
3951         * platform/win/LoggingWin.cpp:
3952         (WebCore::logLevelString): -Wwritable-strings
3953         * rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
3954         (WebCore::RenderThemeWin::getThemeData): -Wswitch
3955
3956 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
3957
3958         Move the code for determining the need for touch bar quirks to Quirks class
3959         https://bugs.webkit.org/show_bug.cgi?id=195654
3960
3961         Reviewed by Brent Fulgham.
3962
3963         Moved the code to determine whether the touch bar quirks are needed or not from WebKit2.
3964
3965         * WebCore.xcodeproj/project.pbxproj:
3966         * page/Quirks.cpp:
3967         (WebCore::Quirks::isTouchBarUpdateSupressedForHiddenContentEditable const):
3968         (WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
3969         * page/Quirks.h:
3970
3971 2019-03-12  Justin Fan  <justin_fan@apple.com>
3972
3973         [Web GPU] Update GPURenderPipelineDescriptor and add GPUColorStateDescriptor.format
3974         https://bugs.webkit.org/show_bug.cgi?id=195518
3975         <rdar://problem/46322356>
3976
3977         Reviewed by Myles C. Maxfield.
3978
3979         Upgrade the implementation of GPURenderPipelineDescriptor and GPURenderPipeline and match the updated Web GPU API.
3980         Add stubs for GPUColorStateDescriptor so attachment format can be provided by GPURenderPipelineDescriptor.
3981
3982         All affected Web GPU tests updated to cover existing behavior.
3983