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