Layout tests imported/w3c/web-platform-tests/IndexedDB/*-exception-order.html are...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-16  Sihui Liu  <sihui_liu@apple.com>
2
3         Layout tests imported/w3c/web-platform-tests/IndexedDB/*-exception-order.html are failing
4         https://bugs.webkit.org/show_bug.cgi?id=195650
5
6         Reviewed by Ryosuke Niwa.
7
8         Fix some exception orders in IDB.
9
10         * Modules/indexeddb/IDBDatabase.cpp:
11         (WebCore::IDBDatabase::createObjectStore):
12         Step 6 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-createobjectstore.
13
14         (WebCore::IDBDatabase::transaction):
15         Step 1 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-transaction.
16
17         * Modules/indexeddb/IDBIndex.cpp:
18         (WebCore::IDBIndex::doOpenCursor):
19         (WebCore::IDBIndex::openCursor):
20         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-opencursor.
21
22         (WebCore::IDBIndex::doOpenKeyCursor):
23         (WebCore::IDBIndex::openKeyCursor):
24         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-openkeycursor.
25
26         (WebCore::IDBIndex::count):
27         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-count.
28
29         (WebCore::IDBIndex::doCount):
30         (WebCore::IDBIndex::get):
31         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-get.
32
33         (WebCore::IDBIndex::doGet):
34         (WebCore::IDBIndex::getKey):
35         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
36
37         (WebCore::IDBIndex::doGetKey):
38         (WebCore::IDBIndex::doGetAll):
39         (WebCore::IDBIndex::getAll):
40         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
41         (WebCore::IDBIndex::doGetAllKeys):
42         (WebCore::IDBIndex::getAllKeys):
43         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getallkeys.
44
45         * Modules/indexeddb/IDBIndex.h:
46         * Modules/indexeddb/IDBObjectStore.cpp:
47         (WebCore::IDBObjectStore::doOpenCursor):
48         (WebCore::IDBObjectStore::openCursor):
49         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-opencursor.
50
51         (WebCore::IDBObjectStore::doOpenKeyCursor):
52         (WebCore::IDBObjectStore::openKeyCursor):
53         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-openkeycursor.
54
55         (WebCore::IDBObjectStore::deleteFunction):
56         (WebCore::IDBObjectStore::doDelete):
57         (WebCore::IDBObjectStore::count):
58         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-count.
59
60         (WebCore::IDBObjectStore::doCount):
61         (WebCore::IDBObjectStore::doGetAll):
62         (WebCore::IDBObjectStore::getAll):
63         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getall.
64
65         (WebCore::IDBObjectStore::doGetAllKeys):
66         (WebCore::IDBObjectStore::getAllKeys):
67         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getallkeys.
68         * Modules/indexeddb/IDBObjectStore.h:
69
70 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
71
72         Reduce the size of Node::deref by eliminating an explicit parentNode check
73         https://bugs.webkit.org/show_bug.cgi?id=195776
74
75         Reviewed by Geoffrey Garen.
76
77         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
78         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
79         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
80
81         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
82         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
83         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
84         is identically equal to 0.
85
86         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
87         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
88         or not when m_referencingNodeCount becomes 0.
89
90         No new tests since there should be no behavioral change.
91
92         * dom/Document.cpp:
93         (WebCore::Document::removedLastRef):
94         * dom/Document.h:
95         (WebCore::Document::decrementReferencingNodeCount):
96         * dom/Node.cpp:
97         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
98         (WebCore::Node::~Node):
99         (WebCore::Node::removedLastRef):
100         * dom/Node.h:
101         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
102         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
103         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
104         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
105         (WebCore::Node::hasOneRef const):
106         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
107         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
108         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
109
110 2019-03-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
111
112         Remove the SVG property tear off objects for SVGAnimatedInteger
113         https://bugs.webkit.org/show_bug.cgi?id=195722
114
115         Reviewed by Simon Fraser.
116
117         Instead of saving a raw integer value in the SVGElement and then wrapping
118         the pointer to this raw data in a tear off object, we will represent the
119         integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the 
120         representation of the property in IDL file match the C++ header file.
121
122         When the DOM requests the SVGAnimatedInteger, we get return a reference
123         to the new animated property. When the rendering code asks for the current
124         value of the this animated property, we return the animVal() or the
125         baseVal() depending on whether the property is animating or not.
126
127         A pointer to a member in the SVGElement will be registered along with the
128         associated attribute name in SVGPropertyRegistry. Registering the property
129         creates an SVGMemberAccessor and links to the associated attribute. The
130         function of SVGMemberAccessor is to retrieve the value of the property
131         given a pointer to an SVGElement.
132
133         SVGPropertyRegistry manages all the properties of SVGElement. It takes
134         into account the inherited properties as well.
135
136         SVGElement will have a virtual method called propertyRegistry(). Every
137         superclass will override this method to return a reference to its registry
138         which includes all the registered properties of this class and its bases.
139
140         One important function of the SVGPropertyRegistry and SVGAccessor is they
141         create the appropriate SVGAttributeAnimator for this property.
142
143         SVGAttributeAnimator is just a connection between the animated property
144         and SVGAnimationFunction. SVGAnimationFunction calculates the values of
145         the animated property within a time interval. SVGAnimatedPropertyAnimator
146         updates animVal of the animated property and invalidates the associated
147         SVGElement and all the instances that references this element.
148
149         The plan is to remove all the SVG tear off objects like what this patch
150         does for SVGAnimatedInteger. So for a period of time the old code and the
151         new code will co-exist together. These things to consider when reviewing
152         this patch:
153
154         -- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase
155         which is inherited by SVGLegacyAttributeAnimationController and
156         SVGAttributeAnimationController. The tear-off properties code which uses
157         SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The
158         new code was added to SVGAttributeAnimationController. The plan is to 
159         remove the three animation controllers and to move the code of
160         SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear
161         off code is removed.
162
163         -- SVGElement now keeps two registries one for the tear-off world and the
164         other for the new world. Eventually we need to get rid of tear-off registry.
165
166         -- SVGElement will differentiate between the type of the property by the
167         the method isAnimatedAttribute().
168
169         * Sources.txt:
170         * WebCore.xcodeproj/project.pbxproj:
171         * bindings/scripts/CodeGeneratorJS.pm:
172         (GenerateHeader):
173         * svg/SVGAnimateElementBase.cpp:
174         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
175         (WebCore::SVGAnimateElementBase::attributeAnimationController):
176         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists):
177         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
178         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const):
179         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
180         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
181         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
182         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
183         (WebCore::SVGAnimateElementBase::resetAnimatedType):
184         (WebCore::SVGAnimateElementBase::clearAnimatedType):
185         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
186         (WebCore::SVGAnimateElementBase::isAdditive const):
187         (WebCore::SVGAnimateElementBase::calculateDistance):
188         (WebCore::SVGAnimateElementBase::setTargetElement):
189         (WebCore::SVGAnimateElementBase::setAttributeName):
190         (WebCore::SVGAnimateElementBase::resetAnimation):
191         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
192         (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted.
193         (WebCore::propertyTypesAreConsistent): Deleted.
194         (WebCore::applyCSSPropertyToTarget): Deleted.
195         (WebCore::removeCSSPropertyFromTarget): Deleted.
196         (WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
197         (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
198         (WebCore::notifyTargetAboutAnimValChange): Deleted.
199         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
200         (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted.
201         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted.
202         (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted.
203         * svg/SVGAnimateElementBase.h:
204         * svg/SVGAnimateMotionElement.cpp:
205         (WebCore::SVGAnimateMotionElement::hasValidAttributeType const):
206         (WebCore::SVGAnimateMotionElement::hasValidAttributeName const):
207         (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted.
208         (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted.
209         * svg/SVGAnimateMotionElement.h:
210         * svg/SVGAnimateTransformElement.cpp:
211         (WebCore::SVGAnimateTransformElement::hasValidAttributeType const):
212         (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted.
213         * svg/SVGAnimateTransformElement.h:
214         * svg/SVGAnimatedInteger.cpp: Removed.
215         * svg/SVGAnimatedInteger.h: Removed.
216         * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed.
217         * svg/SVGAnimatedIntegerOptionalInteger.h: Removed.
218         * svg/SVGAnimatedPointList.h:
219         * svg/SVGAnimationElement.cpp:
220         (WebCore::SVGAnimationElement::setAttributeType):
221         (WebCore::SVGAnimationElement::resetAnimation):
222         (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted.
223         (WebCore::SVGAnimationElement::setTargetElement): Deleted.
224         (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted.
225         * svg/SVGAnimationElement.h:
226         (WebCore::SVGAnimationElement::attributeType const):
227         (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted.
228         * svg/SVGAnimatorFactory.h:
229         (WebCore::SVGAnimatorFactory::create):
230         * svg/SVGAttributeAnimationController.cpp: Added.
231         (WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController):
232         (WebCore::SVGAttributeAnimationController::animator const):
233         (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
234         (WebCore::SVGAttributeAnimationController::isAdditive const):
235         (WebCore::SVGAttributeAnimationController::hasValidAttributeType const):
236         (WebCore::SVGAttributeAnimationController::calculateFromAndToValues):
237         (WebCore::SVGAttributeAnimationController::calculateFromAndByValues):
238         (WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue):
239         (WebCore::SVGAttributeAnimationController::resetAnimatedType):
240         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
241         (WebCore::SVGAttributeAnimationController::applyResultsToTarget):
242         (WebCore::SVGAttributeAnimationController::clearAnimatedType):
243         (WebCore::SVGAttributeAnimationController::calculateDistance):
244         * svg/SVGAttributeAnimationController.h: Added.
245         (WebCore::SVGAttributeAnimationController::animatorIfExists const):
246         * svg/SVGAttributeAnimationControllerBase.cpp: Added.
247         (WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase):
248         (WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType):
249         * svg/SVGAttributeAnimationControllerBase.h: Added.
250         * svg/SVGElement.cpp:
251         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
252         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
253         (WebCore::SVGElement::commitPropertyChange):
254         (WebCore::SVGElement::isAnimatedPropertyAttribute const):
255         (WebCore::SVGElement::isAnimatedAttribute const):
256         (WebCore::SVGElement::createAnimator):
257         * svg/SVGElement.h:
258         (WebCore::SVGElement::propertyRegistry const):
259         * svg/SVGFEConvolveMatrixElement.cpp:
260         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
261         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
262         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
263         (WebCore::SVGFEConvolveMatrixElement::setOrder):
264         (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted.
265         (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted.
266         * svg/SVGFEConvolveMatrixElement.h:
267         * svg/SVGFETurbulenceElement.cpp:
268         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
269         (WebCore::SVGFETurbulenceElement::registerAttributes):
270         (WebCore::SVGFETurbulenceElement::parseAttribute):
271         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
272         * svg/SVGFETurbulenceElement.h:
273         * svg/SVGFilterElement.h:
274         * svg/SVGLegacyAttributeAnimationController.cpp: Added.
275         (WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController):
276         (WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator):
277         (WebCore::SVGLegacyAttributeAnimationController::isAdditive const):
278         (WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const):
279         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues):
280         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues):
281         (WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue):
282         (WebCore::propertyTypesAreConsistent):
283         (WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType):
284         (WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue):
285         (WebCore::applyCSSPropertyToTarget):
286         (WebCore::removeCSSPropertyFromTarget):
287         (WebCore::applyCSSPropertyToTargetAndInstances):
288         (WebCore::removeCSSPropertyFromTargetAndInstances):
289         (WebCore::notifyTargetAboutAnimValChange):
290         (WebCore::notifyTargetAndInstancesAboutAnimValChange):
291         (WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget):
292         (WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType):
293         (WebCore::SVGLegacyAttributeAnimationController::calculateDistance):
294         * svg/SVGLegacyAttributeAnimationController.h: Added.
295         * svg/animation/SVGSMILElement.cpp:
296         (WebCore::SVGSMILElement::hasValidAttributeName const):
297         (WebCore::SVGSMILElement::hasValidAttributeName): Deleted.
298         * svg/animation/SVGSMILElement.h:
299         * svg/properties/SVGAnimatedPrimitiveProperty.h: Added.
300         (WebCore::SVGAnimatedPrimitiveProperty::create):
301         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
302         (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal):
303         (WebCore::SVGAnimatedPrimitiveProperty::baseVal const):
304         (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal):
305         (WebCore::SVGAnimatedPrimitiveProperty::animVal const):
306         (WebCore::SVGAnimatedPrimitiveProperty::animVal):
307         (WebCore::SVGAnimatedPrimitiveProperty::currentValue const):
308         (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty):
309         * svg/properties/SVGAnimatedProperty.cpp: Added.
310         (WebCore::SVGAnimatedProperty::owner const):
311         (WebCore::SVGAnimatedProperty::commitPropertyChange):
312         * svg/properties/SVGAnimatedProperty.h: Added.
313         (WebCore::SVGAnimatedProperty::isAttached const):
314         (WebCore::SVGAnimatedProperty::detach):
315         (WebCore::SVGAnimatedProperty::contextElement const):
316         (WebCore::SVGAnimatedProperty::baseValAsString const):
317         (WebCore::SVGAnimatedProperty::animValAsString const):
318         (WebCore::SVGAnimatedProperty::isDirty const):
319         (WebCore::SVGAnimatedProperty::setDirty):
320         (WebCore::SVGAnimatedProperty::synchronize):
321         (WebCore::SVGAnimatedProperty::isAnimating const):
322         (WebCore::SVGAnimatedProperty::startAnimation):
323         (WebCore::SVGAnimatedProperty::stopAnimation):
324         (WebCore::SVGAnimatedProperty::instanceStartAnimation):
325         (WebCore::SVGAnimatedProperty::instanceStopAnimation):
326         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
327         * svg/properties/SVGAnimatedPropertyAccessor.h: Added.
328         * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added.
329         * svg/properties/SVGAnimatedPropertyAnimator.h: Added.
330         (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance):
331         (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator):
332         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added.
333         * svg/properties/SVGAnimatedPropertyImpl.h: Added.
334         * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added.
335         (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor):
336         (WebCore::SVGAnimatedPropertyPairAccessor::singleton):
337         (WebCore::SVGAnimatedPropertyPairAccessor::property1 const):
338         (WebCore::SVGAnimatedPropertyPairAccessor::property2 const):
339         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added.
340         * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added.
341         (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
342         (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator):
343         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added.
344         * svg/properties/SVGAnimationAdditiveFunction.h: Added.
345         (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction):
346         (WebCore::SVGAnimationAdditiveFunction::progress):
347         * svg/properties/SVGAnimationAdditiveValueFunction.h: Added.
348         (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const):
349         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added.
350         (WebCore::SVGAnimationIntegerFunction::progress):
351         * svg/properties/SVGAnimationFunction.h: Added.
352         (WebCore::SVGAnimationFunction::isDiscrete const):
353         (WebCore::SVGAnimationFunction::calculateDistance const):
354         (WebCore::SVGAnimationFunction::SVGAnimationFunction):
355         (WebCore::SVGAnimationFunction::addFromAndToValues):
356         * svg/properties/SVGAttributeAnimator.cpp: Added.
357         (WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange):
358         * svg/properties/SVGAttributeAnimator.h: Added.
359         (WebCore::SVGAttributeAnimator::SVGAttributeAnimator):
360         (WebCore::SVGAttributeAnimator::isDiscrete const):
361         (WebCore::SVGAttributeAnimator::setFromAndToValues):
362         (WebCore::SVGAttributeAnimator::setFromAndByValues):
363         (WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue):
364         (WebCore::SVGAttributeAnimator::calculateDistance const):
365         * svg/properties/SVGAttributeOwnerProxy.cpp:
366         * svg/properties/SVGAttributeOwnerProxy.h:
367         * svg/properties/SVGAttributeRegistry.h:
368         * svg/properties/SVGMemberAccessor.h: Added.
369         (WebCore::SVGMemberAccessor::detach const):
370         (WebCore::SVGMemberAccessor::isAnimatedProperty const):
371         (WebCore::SVGMemberAccessor::isAnimatedLength const):
372         (WebCore::SVGMemberAccessor::matches const):
373         (WebCore::SVGMemberAccessor::synchronize const):
374         (WebCore::SVGMemberAccessor::createAnimator const):
375         (WebCore::SVGMemberAccessor::appendAnimatedInstance const):
376         * svg/properties/SVGPointerMemberAccessor.h: Added.
377         (WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor):
378         (WebCore::SVGPointerMemberAccessor::property const):
379         (WebCore::SVGPointerMemberAccessor::singleton):
380         * svg/properties/SVGProperty.h: Added.
381         * svg/properties/SVGPropertyOwner.h: Added.
382         (WebCore::SVGPropertyOwner::owner const):
383         (WebCore::SVGPropertyOwner::attributeContextElement const):
384         (WebCore::SVGPropertyOwner::commitPropertyChange):
385         * svg/properties/SVGPropertyOwnerRegistry.h: Added.
386         (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry):
387         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
388         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively):
389         (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute):
390         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes):
391         (WebCore::SVGPropertyOwnerRegistry::findAccessor):
392         * svg/properties/SVGPropertyRegistry.h: Added.
393
394 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
395
396         Remove LayoutAssertionDisableScope after r241289
397         https://bugs.webkit.org/show_bug.cgi?id=195848
398
399         Reviewed by Antti Koivisto.
400
401         Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.
402
403         * dom/Document.cpp:
404         (WebCore::isSafeToUpdateStyleOrLayout):
405         * dom/ScriptDisallowedScope.h:
406         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.
407         * page/FrameViewLayoutContext.cpp:
408         (WebCore::FrameViewLayoutContext::layout):
409
410 2019-03-15  Eric Carlson  <eric.carlson@apple.com>
411
412         Add media stream release logging
413         https://bugs.webkit.org/show_bug.cgi?id=195823
414         <rdar://problem/48939406>
415
416         Reviewed by Youenn Fablet.
417
418         No new tests, no behavioral change.
419
420         * Modules/mediastream/MediaStream.cpp:
421         (WebCore::MediaStream::MediaStream):
422         (WebCore::MediaStream::clone):
423         (WebCore::MediaStream::addTrack):
424         (WebCore::MediaStream::removeTrack):
425         (WebCore::MediaStream::addTrackFromPlatform):
426         (WebCore::MediaStream::setIsActive):
427         (WebCore::MediaStream::mediaCanStart):
428         (WebCore::MediaStream::startProducingData):
429         (WebCore::MediaStream::stopProducingData):
430         (WebCore::MediaStream::endCaptureTracks):
431         (WebCore::MediaStream::stop):
432         (WebCore::MediaStream::logChannel const):
433         * Modules/mediastream/MediaStream.h:
434         * Modules/mediastream/MediaStreamTrack.cpp:
435         (WebCore::MediaStreamTrack::MediaStreamTrack):
436         (WebCore::MediaStreamTrack::logChannel const):
437         * Modules/mediastream/MediaStreamTrack.h:
438         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
439         (WebCore::LibWebRTCMediaEndpoint::addTrack):
440         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
441         * Modules/webaudio/AudioContext.cpp:
442         (WebCore::AudioContext::AudioContext):
443         (WebCore::nextLogIdentifier): Deleted.
444         * html/HTMLMediaElement.cpp:
445         (WebCore::HTMLMediaElement::HTMLMediaElement):
446         (WebCore::nextLogIdentifier): Deleted.
447         * html/HTMLMediaElement.h:
448         * platform/audio/PlatformMediaSession.cpp:
449         (WebCore::PlatformMediaSession::PlatformMediaSession):
450         (WebCore::nextLogIdentifier): Deleted.
451         * platform/audio/PlatformMediaSession.h:
452         * platform/graphics/IntSize.cpp:
453         (WebCore::IntSize::toJSONObject const):
454         (WebCore::IntSize::toJSONString const):
455         * platform/graphics/IntSize.h:
456         (WTF::LogArgument<WebCore::IntSize>::toString):
457         * platform/mediastream/MediaStreamPrivate.cpp:
458         (WebCore::MediaStreamPrivate::addTrack):
459         (WebCore::MediaStreamPrivate::removeTrack):
460         (WebCore::MediaStreamPrivate::startProducingData):
461         (WebCore::MediaStreamPrivate::stopProducingData):
462         (WebCore::MediaStreamPrivate::setCaptureTracksMuted):
463         (WebCore::MediaStreamPrivate::trackMutedChanged):
464         (WebCore::MediaStreamPrivate::trackEnabledChanged):
465         (WebCore::MediaStreamPrivate::trackStarted):
466         (WebCore::MediaStreamPrivate::trackEnded):
467         (WebCore::MediaStreamPrivate::setLogger):
468         (WebCore::MediaStreamPrivate::logChannel const):
469         * platform/mediastream/MediaStreamPrivate.h:
470         * platform/mediastream/MediaStreamTrackPrivate.cpp:
471         (WebCore::MediaStreamTrackPrivate::setLogger):
472         (WebCore::MediaStreamTrackPrivate::logChannel const):
473         * platform/mediastream/MediaStreamTrackPrivate.h:
474         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
475         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
476         (WebCore::RealtimeIncomingAudioSource::logChannel const): Deleted.
477         (WebCore::RealtimeIncomingAudioSource::logger const): Deleted.
478         * platform/mediastream/RealtimeIncomingAudioSource.h:
479         (WebCore::RealtimeIncomingAudioSource::setLogger): Deleted.
480         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
481         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
482         (WebCore::RealtimeIncomingVideoSource::logChannel const): Deleted.
483         (WebCore::RealtimeIncomingVideoSource::logger const): Deleted.
484         * platform/mediastream/RealtimeIncomingVideoSource.h:
485         (WebCore::RealtimeIncomingVideoSource::setLogger): Deleted.
486         * platform/mediastream/RealtimeMediaSource.cpp:
487         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
488         (WebCore::RealtimeMediaSource::setInterrupted):
489         (WebCore::RealtimeMediaSource::setMuted):
490         (WebCore::RealtimeMediaSource::notifyMutedChange):
491         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
492         (WebCore::RealtimeMediaSource::videoSampleAvailable):
493         (WebCore::RealtimeMediaSource::start):
494         (WebCore::RealtimeMediaSource::stop):
495         (WebCore::RealtimeMediaSource::captureFailed):
496         (WebCore::RealtimeMediaSource::applyConstraint):
497         (WebCore::RealtimeMediaSource::supportsConstraints):
498         (WebCore::RealtimeMediaSource::applyConstraints):
499         (WebCore::RealtimeMediaSource::setSize):
500         (WebCore::RealtimeMediaSource::setIntrinsicSize):
501         (WebCore::RealtimeMediaSource::setFrameRate):
502         (WebCore::RealtimeMediaSource::setAspectRatio):
503         (WebCore::RealtimeMediaSource::setFacingMode):
504         (WebCore::RealtimeMediaSource::setVolume):
505         (WebCore::RealtimeMediaSource::setSampleRate):
506         (WebCore::RealtimeMediaSource::setSampleSize):
507         (WebCore::RealtimeMediaSource::setEchoCancellation):
508         (WebCore::RealtimeMediaSource::setLogger):
509         (WebCore::RealtimeMediaSource::logChannel const):
510         (WebCore::convertEnumerationToString):
511         * platform/mediastream/RealtimeMediaSource.h:
512         (WTF::LogArgument<WebCore::RealtimeMediaSource::Type>::toString):
513         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
514         (WebCore::RealtimeMediaSourceSettings::convertFlagsToString):
515         (WebCore::convertEnumerationToString):
516         * platform/mediastream/RealtimeMediaSourceSettings.h:
517         (WTF::LogArgument<WebCore::RealtimeMediaSourceSettings::VideoFacingMode>::toString):
518         (WTF::LogArgument<OptionSet<WebCore::RealtimeMediaSourceSettings::Flag>>::toString):
519         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
520         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
521         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
522         (WebCore::RealtimeOutgoingAudioSource::logger const): Deleted.
523         * platform/mediastream/RealtimeOutgoingAudioSource.h:
524         (WebCore::RealtimeOutgoingAudioSource::setLogger): Deleted.
525         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
526         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
527         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
528         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
529         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
530         (WebCore::RealtimeOutgoingVideoSource::logger const): Deleted.
531         * platform/mediastream/RealtimeOutgoingVideoSource.h:
532         (WebCore::RealtimeOutgoingVideoSource::setLogger): Deleted.
533         * platform/mediastream/RealtimeVideoSource.cpp:
534         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
535         (WebCore::SizeAndFrameRate::toJSONObject const):
536         (WebCore::SizeAndFrameRate::toJSONString const):
537         * platform/mediastream/RealtimeVideoSource.h:
538         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
539         * platform/mediastream/mac/AVVideoCaptureSource.h:
540         * platform/mediastream/mac/AVVideoCaptureSource.mm:
541         (WebCore::AVVideoCaptureSource::clearSession):
542         (WebCore::AVVideoCaptureSource::startProducingData):
543         (WebCore::AVVideoCaptureSource::stopProducingData):
544         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
545         (WebCore::AVVideoCaptureSource::setupSession):
546         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
547         (WebCore::AVVideoCaptureSource::setupCaptureSession):
548         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
549         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
550         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
551         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
552         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
553         (WebCore::AVVideoCaptureSource::deviceDisconnected):
554         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
555         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
556         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
557         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
558         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
559         (WebCore::AVVideoCaptureSource::initializeSession): Deleted.
560         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
561         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
562         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
563         (WebCore::CoreAudioSharedUnit::captureFailed):
564         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
565         (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
566         (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
567         (WebCore::CoreAudioCaptureSource::startProducingData):
568         (WebCore::CoreAudioCaptureSource::stopProducingData):
569         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
570         (WebCore::CoreAudioCaptureSource::beginInterruption):
571         (WebCore::CoreAudioCaptureSource::endInterruption):
572         * platform/mediastream/mac/CoreAudioCaptureSource.h:
573         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
574         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
575         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
576         (WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
577         (WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
578         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
579
580 2019-03-15  Devin Rousso  <drousso@apple.com>
581
582         Web Inspector: Canvas: remove agent as observer when disabling
583         https://bugs.webkit.org/show_bug.cgi?id=195825
584         <rdar://problem/48940255>
585
586         Reviewed by Joseph Pecoraro.
587
588         No change in functionality.
589
590         * inspector/agents/InspectorCanvasAgent.cpp:
591         (WebCore::InspectorCanvasAgent::disable):
592
593 2019-03-15  Ryosuke Niwa  <rniwa@webkit.org>
594
595         REGRESSION (r239814): Most classes that user Timer have 7 bytes of padding after the Timer
596         https://bugs.webkit.org/show_bug.cgi?id=194196
597
598         Reviewed by Simon Fraser.
599
600         Use std::nan as the value of m_unalignedNextFireTime to indicate the timer had been deleted
601         instead of having a dedicated boolean, which consumes 7 extra bytes for padding.
602
603         Note that some code in WebKit uses +Infinity as a fire time so we can't use that.
604
605         * platform/Timer.cpp:
606         (WebCore::TimerBase::TimerBase):
607         (WebCore::TimerBase::~TimerBase):
608         (WebCore::TimerBase::setNextFireTime):
609         (WebCore::TimerBase::nextUnalignedFireInterval const):
610         * platform/Timer.h:
611
612 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
613
614         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
615         https://bugs.webkit.org/show_bug.cgi?id=190350
616         <rdar://problem/45089503>
617
618         Reviewed by Geoffrey Garen.
619
620         Start to use hash for database file names so that the files can work on any filesystem.
621
622         We created v0 folder in IndexedDB directory to put the legacy databases, and v1 folder to put the upgraded 
623         databases.
624
625         Tests: TestWebKitAPI.IndexedDB.IndexedDBFileName
626                TestWebKitAPI.IndexedDB.IndexedDBFileNameV0
627                TestWebKitAPI.IndexedDB.IndexedDBFileNameV1
628                TestWebKitAPI.IndexedDB.IndexedDBFileNameAPI
629                TestWebKitAPI.IndexedDB.HashCollision
630
631         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
632         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
633         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
634         * Modules/indexeddb/IDBDatabaseIdentifier.h:
635         * Modules/indexeddb/server/IDBServer.cpp:
636         (WebCore::IDBServer::m_quotaManagerGetter):
637         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
638         (WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
639         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
640         (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
641         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
642         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
643         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
644         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
645         (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
646         * Modules/indexeddb/server/IDBServer.h:
647         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
648         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
649         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
650         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath const):
651         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
652         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
653         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
654         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
655         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
656         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
657         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
658         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory const): Deleted.
659         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
660         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const):
661         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
662         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
663         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
664         * platform/sql/SQLiteFileSystem.cpp:
665         (WebCore::SQLiteFileSystem::computeHashForFileName):
666         * platform/sql/SQLiteFileSystem.h:
667
668 2019-03-15  Zalan Bujtas  <zalan@apple.com>
669
670         [ContentChangeObserver] HTMLImageElement::willRespondToMouseClickEvents returns quirk value.
671         https://bugs.webkit.org/show_bug.cgi?id=195657
672         <rdar://problem/48834987>
673
674         Reviewed by Simon Fraser.
675
676         Images should not trigger hover by default (only when they actually respond to mouse events).
677
678         Test: fast/events/touch/ios/content-observation/visibility-change-with-image-content.html
679
680         * page/ios/ContentChangeObserver.cpp:
681         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
682
683 2019-03-15  Jer Noble  <jer.noble@apple.com>
684
685         Add a "supportedConfiguration" dictionary to MediaCapabilitiesDecodingInfo and MediaCapabilitiesEncodingInfo
686         https://bugs.webkit.org/show_bug.cgi?id=195763
687
688         Reviewed by Jon Lee.
689
690         Test: media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html
691
692         Add support for a proposed addition to the Media Capabilities spec that would future-proof additional changes
693         to Media Capabilities by allowing sites to check exactly what properties were queried by the browser when
694         answering a decodeInfo() or enocdeInfo() query.
695
696         * CMakeLists.txt:
697         * DerivedSources-input.xcfilelist:
698         * DerivedSources-output.xcfilelist:
699         * DerivedSources.make:
700         * Modules/mediacapabilities/AudioConfiguration.idl:
701         * Modules/mediacapabilities/MediaCapabilities.cpp:
702         (WebCore::MediaCapabilities::decodingInfo):
703         (WebCore::MediaCapabilities::encodingInfo):
704         * Modules/mediacapabilities/MediaCapabilities.idl:
705         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
706         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
707         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
708         * Modules/mediacapabilities/MediaDecodingConfiguration.idl:
709         * Modules/mediacapabilities/MediaEncodingConfiguration.idl:
710         * Modules/mediacapabilities/VideoConfiguration.idl:
711         * Sources.txt:
712         * WebCore.xcodeproj/project.pbxproj:
713         * platform/MediaCapabilitiesDecodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
714         (WebCore::MediaCapabilitiesDecodingInfo::MediaCapabilitiesDecodingInfo):
715         * platform/MediaCapabilitiesEncodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
716         (WebCore::MediaCapabilitiesEncodingInfo::MediaCapabilitiesEncodingInfo):
717         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
718         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
719         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h:
720         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp:
721         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
722         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h:
723         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
724         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
725         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
726         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
727         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
728         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
729         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
730         * platform/mock/MediaEngineConfigurationFactoryMock.h:
731
732 2019-03-15  Antti Koivisto  <antti@apple.com>
733
734         Use Region for event region even when it is a rectangle
735         https://bugs.webkit.org/show_bug.cgi?id=195803
736
737         Reviewed by Simon Fraser.
738
739         Region type is now optimized for the common single-rectangle case so we can simplify code.
740
741         * platform/graphics/GraphicsLayer.cpp:
742         (WebCore::GraphicsLayer::setEventRegion):
743         * platform/graphics/GraphicsLayer.h:
744         (WebCore::GraphicsLayer::eventRegion const):
745         * platform/graphics/ca/GraphicsLayerCA.cpp:
746         (WebCore::GraphicsLayerCA::setEventRegion):
747         * platform/graphics/ca/GraphicsLayerCA.h:
748         * platform/graphics/ca/PlatformCALayer.h:
749         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
750         * rendering/RenderLayerBacking.cpp:
751         (WebCore::RenderLayerBacking::paintIntoLayer):
752
753 2019-03-15  Jer Noble  <jer.noble@apple.com>
754
755         Unreviewed unified build fix: GPUBindGroup has a default public constructor and destructor, so all its member
756         variables must be fully defined.
757
758         * platform/graphics/gpu/GPUBindGroup.h:
759
760 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
761
762         [macOS] Broker access to Speech Synthesis
763         https://bugs.webkit.org/show_bug.cgi?id=195645
764         <rdar://problem/35369026>
765
766         Reviewed by Brent Fulgham.
767
768         To be able to close the connection to the speech synthesis daemon in the WebContent process,
769         speech synthesis should be performed in the UI process. This patch forwards speech synthesis
770         requests to the UI process by sending messages. On the UI process side, the speech synthesis
771         is performed by simply using the existing platform speech synthesizer. Speech synthesis
772         events are sent back to the WebContent process. All messages are async, except for the
773         message to get the list of available voices.
774
775         No new tests, covered by existing tests.
776
777         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
778         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
779         * Modules/speech/SpeechSynthesis.cpp:
780         (WebCore::SpeechSynthesis::create):
781         (WebCore::SpeechSynthesis::SpeechSynthesis):
782         (WebCore::SpeechSynthesis::setPlatformSynthesizer):
783         (WebCore::SpeechSynthesis::getVoices):
784         (WebCore::SpeechSynthesis::startSpeakingImmediately):
785         (WebCore::SpeechSynthesis::cancel):
786         (WebCore::SpeechSynthesis::pause):
787         (WebCore::SpeechSynthesis::resume):
788         (WebCore::SpeechSynthesis::boundaryEventOccurred):
789         (WebCore::SpeechSynthesis::didStartSpeaking):
790         (WebCore::SpeechSynthesis::didFinishSpeaking):
791         (WebCore::SpeechSynthesis::didPauseSpeaking):
792         (WebCore::SpeechSynthesis::didResumeSpeaking):
793         (WebCore::SpeechSynthesis::speakingErrorOccurred):
794         (WebCore::SpeechSynthesis::voicesChanged):
795         * Modules/speech/SpeechSynthesis.h:
796         * WebCore.xcodeproj/project.pbxproj:
797         * page/Page.cpp:
798         (WebCore::Page::Page):
799         * page/Page.h:
800         (WebCore::Page::speechSynthesisClient const):
801         * page/PageConfiguration.cpp:
802         * page/PageConfiguration.h:
803         * page/SpeechSynthesisClient.h: Added.
804         * platform/PlatformSpeechSynthesisUtterance.h:
805         * platform/PlatformSpeechSynthesizer.h:
806         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
807         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
808         * platform/mac/PlatformSpeechSynthesizerMac.mm:
809         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakWord:ofString:]):
810         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
811         (WebCore::PlatformSpeechSynthesizerMock::speak):
812
813 2019-03-15  Antti Koivisto  <antti@apple.com>
814
815         Try to fix watchOS build.
816
817         * platform/graphics/Region.h:
818         (WebCore::Region::Span::decode):
819
820 2019-03-15  Simon Fraser  <simon.fraser@apple.com>
821
822         [Async overflow Scrolling] Update positioned node layers when overflows are scrolled
823         https://bugs.webkit.org/show_bug.cgi?id=195733
824         rdar://problem/11642295
825
826         Reviewed by Antti Koivisto.
827
828         Make ScrollingTree positioned nodes in the two cases where we need them, as
829         detected by RenderLayerCompositor::computeCoordinatedPositioningForLayer().
830
831         For "Moves" layers we know that the overflow is not in the z-order ancestor chain,
832         so ScrollingTree needs a map of overflow node -> affected positioned nodes which
833         notifyRelatedNodesAfterScrollPositionChange() uses to find nodes to update after
834         a scroll. Computing these dependent nodes in RenderLayerCompositor() would require
835         correct dependency analysis between an overflow layers and "positioned" layers which
836         is hard. It's easier to have "positioned" layers figure out which overflow nodes
837         affect them, then compute the inverse relationship when the scrolling tree is updated
838         which happens in ScrollingTreePositionedNode::commitStateBeforeChildren().
839
840         Tests: scrollingcoordinator/ios/absolute-layer-should-not-move-with-scroll.html
841                scrollingcoordinator/ios/relative-layer-should-move-with-scroll.html
842
843         * page/scrolling/ScrollingTree.cpp:
844         (WebCore::ScrollingTree::commitTreeState):
845         (WebCore::ScrollingTree::applyLayerPositions):
846         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
847         (WebCore::ScrollingTree::scrollingTreeAsText):
848         * page/scrolling/ScrollingTree.h:
849         (WebCore::ScrollingTree::overflowRelatedNodes):
850         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
851         (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
852         * page/scrolling/ScrollingTreeOverflowScrollingNode.h:
853         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
854         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
855         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
856         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
857         * rendering/RenderLayerCompositor.cpp:
858         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary):
859         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
860         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
861         (WebCore::collectRelatedCoordinatedScrollingNodes):
862         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
863
864 2019-03-15  Antti Koivisto  <antti@apple.com>
865
866         Optimize Region for single rectangle case
867         https://bugs.webkit.org/show_bug.cgi?id=195743
868
869         Reviewed by Simon Fraser.
870
871         Instrumentation shows vast majority of Region objects consist of a single rectangle. However it always allocates
872         the large Shape data structure. This makes it unsuitable to use as a member in any popular objects.
873
874         This patch optimizes the single rectangle case by using only the bounds rectangle to describe it.
875         Shape is allocated on demand. This makes it safe to use Region as a data member where a rectangle is the common case.
876
877         The patch also modernizes Region encoding/decoding support.
878
879         * platform/graphics/Region.cpp:
880         (WebCore::Region::Region):
881         (WebCore::Region::~Region):
882         (WebCore::Region::operator=):
883         (WebCore::Region::rects const):
884         (WebCore::Region::contains const):
885         (WebCore::Region::intersects const):
886         (WebCore::Region::Shape::Shape):
887         (WebCore::Region::Shape::appendSpan):
888         (WebCore::Region::dump const):
889         (WebCore::Region::intersect):
890         (WebCore::Region::unite):
891         (WebCore::Region::subtract):
892         (WebCore::Region::translate):
893         (WebCore::Region::setShape):
894         (WebCore::Region::Shape::isValid const): Deleted.
895         (WebCore::Region::Shape::swap): Deleted.
896         (WebCore::Region::updateBoundsFromShape): Deleted.
897
898         Remove some now unused function.
899
900         * platform/graphics/Region.h:
901         (WebCore::Region::isRect const):
902         (WebCore::Region::gridSize const):
903         (WebCore::Region::copyShape const):
904         (WebCore::operator==):
905         (WebCore::Region::Span::encode const):
906         (WebCore::Region::Span::decode):
907         (WebCore::Region::Shape::encode const):
908         (WebCore::Region::Shape::decode):
909         (WebCore::Region::encode const):
910         (WebCore::Region::decode):
911
912         This is now part of type.
913
914         (WebCore::Region::isValid const): Deleted.
915         (WebCore::Region::Span::Span): Deleted.
916         (WebCore::Region::shapeSegments const): Deleted.
917         (WebCore::Region::shapeSpans const): Deleted.
918         (WebCore::Region::setShapeSegments): Deleted.
919         (WebCore::Region::setShapeSpans): Deleted.
920         (WebCore::Region::Shape::segments const): Deleted.
921         (WebCore::Region::Shape::spans const): Deleted.
922         (WebCore::Region::Shape::setSegments): Deleted.
923         (WebCore::Region::Shape::setSpans): Deleted.
924
925         No need to expose these for encoding anymore.
926
927 2019-03-15  Devin Rousso  <drousso@apple.com>
928
929         Web Inspector: provide a way to capture a screenshot of a node from within the page
930         https://bugs.webkit.org/show_bug.cgi?id=194279
931         <rdar://problem/10731573>
932
933         Reviewed by Joseph Pecoraro.
934
935         Test: inspector/console/console-screenshot.html
936
937         Add `console.screenshot` functionality, which displays a screenshot of a given object (if
938         able) within Web Inspector's Console tab. From there, it can be viewed and saved.
939
940         Currently, `console.screenshot` will
941          - capture an image of a `Node` (if provided)
942          - capture an image of the viewport if nothing is provided
943
944         * page/PageConsoleClient.h:
945         * page/PageConsoleClient.cpp:
946         (WebCore::PageConsoleClient::addMessage):
947         (WebCore::PageConsoleClient::screenshot): Added.
948
949         * workers/WorkerConsoleClient.h:
950         * workers/WorkerConsoleClient.cpp:
951         (WebCore::WorkerConsoleClient::screenshot): Added.
952         * worklets/WorkletConsoleClient.h:
953         * worklets/WorkletConsoleClient.cpp:
954         (WebCore::WorkletConsoleClient::screenshot): Added.
955
956         * inspector/CommandLineAPIModuleSource.js:
957         (CommandLineAPIImpl.prototype.screenshot): Added.
958
959         * inspector/InspectorInstrumentation.h:
960
961 2019-03-14  Yusuke Suzuki  <ysuzuki@apple.com>
962
963         [JSC] Retain PrivateName of Symbol before passing it to operations potentially incurring GC
964         https://bugs.webkit.org/show_bug.cgi?id=195791
965         <rdar://problem/48806130>
966
967         Reviewed by Mark Lam.
968
969         * bindings/js/ScriptController.cpp:
970         (WebCore::ScriptController::setupModuleScriptHandlers):
971
972 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
973
974         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
975         https://bugs.webkit.org/show_bug.cgi?id=195754
976         <rdar://problem/48591957>
977
978         Reviewed by Jiewen Tan.
979
980         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
981         Update the const correctness of one function call to match new SDK declaration.
982
983         No tests because there are no changes in behavior.
984
985         * crypto/CommonCryptoUtilities.h:
986         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
987         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
988
989 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
990
991         IndexedDB: re-enable some leak tests
992         https://bugs.webkit.org/show_bug.cgi?id=194806
993
994         Reviewed by Geoffrey Garen.
995
996         Protected JSIDBCursor object when advance/continue request on IDBCursor is not finished, because after the 
997         advance operation completes on success, we need to return the same JSIDBCursor object as before the advance, 
998         and during the wait for advance operation to complete, we need to return error as the result. 
999  
1000         Covered by existing tests.
1001
1002         * Modules/indexeddb/IDBCursor.cpp:
1003         (WebCore::IDBCursor::setGetResult):
1004         (WebCore::IDBCursor::clearWrappers):
1005         * Modules/indexeddb/IDBCursor.h:
1006         * Modules/indexeddb/IDBRequest.cpp:
1007         (WebCore::IDBRequest::stop):
1008         (WebCore::IDBRequest::setResult):
1009         (WebCore::IDBRequest::setResultToStructuredClone):
1010         (WebCore::IDBRequest::setResultToUndefined):
1011         (WebCore::IDBRequest::willIterateCursor):
1012         (WebCore::IDBRequest::didOpenOrIterateCursor):
1013         (WebCore::IDBRequest::clearWrappers):
1014         * Modules/indexeddb/IDBRequest.h:
1015         (WebCore::IDBRequest::cursorWrapper):
1016         * bindings/js/JSIDBRequestCustom.cpp:
1017         (WebCore::JSIDBRequest::visitAdditionalChildren):
1018         * bindings/js/JSValueInWrappedObject.h:
1019         (WebCore::JSValueInWrappedObject::JSValueInWrappedObject):
1020         (WebCore::JSValueInWrappedObject::operator=):
1021         (WebCore::JSValueInWrappedObject::clear):
1022
1023 2019-03-14  Shawn Roberts  <sroberts@apple.com>
1024
1025         Unreviewed, rolling out r242981.
1026
1027         Causing internal build failures on watch/tv OS
1028
1029         Reverted changeset:
1030
1031         "Move CoreCrypto SPI declarations to an appropriate PAL/spi
1032         header"
1033         https://bugs.webkit.org/show_bug.cgi?id=195754
1034         https://trac.webkit.org/changeset/242981
1035
1036 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
1037
1038         Web process is put to suspended when holding locked WebSQL files
1039         https://bugs.webkit.org/show_bug.cgi?id=195768
1040
1041         Reviewed by Geoffrey Garen.
1042
1043         We need to keep processes active during database close, because SQLite database may run a checkpoint operation
1044         and lock database files.
1045
1046         * platform/sql/SQLiteDatabase.cpp:
1047         (WebCore::SQLiteDatabase::useWALJournalMode):
1048         (WebCore::SQLiteDatabase::close):
1049         * platform/sql/SQLiteDatabase.h:
1050
1051 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
1052
1053         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
1054         https://bugs.webkit.org/show_bug.cgi?id=195754
1055         <rdar://problem/48591957>
1056
1057         Reviewed by Jiewen Tan.
1058
1059         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
1060         Update the const correctness of one function call to match new SDK declaration.
1061
1062         No tests because there are no changes in behavior.
1063
1064         * crypto/CommonCryptoUtilities.h:
1065         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
1066         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
1067
1068 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1069
1070         Rename SVGProperty to SVGLegacyProperty and rename SVGAnimatedProperty to SVGLegacyAnimatedProperty
1071         https://bugs.webkit.org/show_bug.cgi?id=195767
1072
1073         Reviewed by Tim Horton.
1074
1075         This is a step towards removing the SVG properties tear off objects.
1076
1077         * Sources.txt:
1078         * WebCore.xcodeproj/project.pbxproj:
1079         * svg/SVGAngle.h:
1080         (WebCore::SVGAngle::create):
1081         (WebCore::SVGAngle::SVGAngle):
1082         * svg/SVGAnimateElement.h:
1083         * svg/SVGAnimatedTypeAnimator.h:
1084         (WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
1085         * svg/SVGElement.h:
1086         (WebCore::SVGElement::lookupAnimatedProperty const):
1087         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
1088         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
1089         * svg/SVGLength.h:
1090         (WebCore::SVGLength::create):
1091         (WebCore::SVGLength::SVGLength):
1092         * svg/SVGMatrix.h:
1093         (WebCore::SVGMatrix::create):
1094         (WebCore::SVGMatrix::SVGMatrix):
1095         * svg/SVGNumber.h:
1096         (WebCore::SVGNumber::create):
1097         (WebCore::SVGNumber::SVGNumber):
1098         * svg/SVGPathElement.cpp:
1099         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
1100         * svg/SVGPathElement.h:
1101         * svg/SVGPathSegList.cpp:
1102         (WebCore::SVGPathSegList::processIncomingListItemValue):
1103         * svg/SVGPathSegWithContext.h:
1104         (WebCore::SVGPathSegWithContext::animatedProperty const):
1105         * svg/SVGPoint.h:
1106         (WebCore::SVGPoint::create):
1107         (WebCore::SVGPoint::SVGPoint):
1108         * svg/SVGPreserveAspectRatio.h:
1109         (WebCore::SVGPreserveAspectRatio::create):
1110         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
1111         * svg/SVGRect.h:
1112         (WebCore::SVGRect::create):
1113         (WebCore::SVGRect::SVGRect):
1114         * svg/SVGTransform.h:
1115         (WebCore::SVGTransform::create):
1116         (WebCore::SVGTransform::SVGTransform):
1117         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1118         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
1119         (WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff):
1120         * svg/properties/SVGAnimatedProperty.cpp: Removed.
1121         * svg/properties/SVGAnimatedProperty.h: Removed.
1122         * svg/properties/SVGAnimatedPropertyTearOff.h:
1123         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
1124         (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
1125         * svg/properties/SVGAttributeAccessor.h:
1126         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
1127         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
1128         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
1129         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
1130         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
1131         * svg/properties/SVGAttributeOwnerProxy.h:
1132         * svg/properties/SVGAttributeOwnerProxyImpl.h:
1133         * svg/properties/SVGAttributeRegistry.h:
1134         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
1135         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
1136         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
1137         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
1138         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
1139         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
1140         * svg/properties/SVGLegacyAnimatedProperty.cpp: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.cpp.
1141         (WebCore::SVGLegacyAnimatedProperty::SVGLegacyAnimatedProperty):
1142         (WebCore::SVGLegacyAnimatedProperty::~SVGLegacyAnimatedProperty):
1143         (WebCore::SVGLegacyAnimatedProperty::commitChange):
1144         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Deleted.
1145         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Deleted.
1146         (WebCore::SVGAnimatedProperty::commitChange): Deleted.
1147         * svg/properties/SVGLegacyAnimatedProperty.h: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.h.
1148         (WebCore::SVGLegacyAnimatedProperty::lookupOrCreateAnimatedProperty):
1149         (WebCore::SVGLegacyAnimatedProperty::lookupAnimatedProperty):
1150         (WebCore::SVGAnimatedProperty::isAnimating const): Deleted.
1151         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): Deleted.
1152         (WebCore::SVGAnimatedProperty::contextElement const): Deleted.
1153         (WebCore::SVGAnimatedProperty::attributeName const): Deleted.
1154         (WebCore::SVGAnimatedProperty::animatedPropertyType const): Deleted.
1155         (WebCore::SVGAnimatedProperty::isReadOnly const): Deleted.
1156         (WebCore::SVGAnimatedProperty::setIsReadOnly): Deleted.
1157         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): Deleted.
1158         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): Deleted.
1159         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
1160         * svg/properties/SVGLegacyProperty.h: Copied from Source/WebCore/svg/properties/SVGProperty.h.
1161         * svg/properties/SVGListProperty.h:
1162         * svg/properties/SVGProperty.h: Removed.
1163         * svg/properties/SVGPropertyTearOff.h:
1164         (WebCore::SVGPropertyTearOff::create):
1165         (WebCore::SVGPropertyTearOff::animatedProperty const):
1166         (WebCore::SVGPropertyTearOff::setAnimatedProperty):
1167         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
1168
1169 2019-03-14  Ryan Haddad  <ryanhaddad@apple.com>
1170
1171         Unreviewed, rolling out r242963.
1172
1173         Breaks watchOS build.
1174
1175         Reverted changeset:
1176
1177         "Move CommonCrypto SPI declarations to an appropriate PAL/spi
1178         header"
1179         https://bugs.webkit.org/show_bug.cgi?id=195754
1180         https://trac.webkit.org/changeset/242963
1181
1182 2019-03-14  Chris Dumez  <cdumez@apple.com>
1183
1184         Unreviewed, update xcfilelist files as they are out of sync.
1185
1186         * DerivedSources-input.xcfilelist:
1187         * DerivedSources-output.xcfilelist:
1188
1189 2019-03-14  Justin Fan  <justin_fan@apple.com>
1190
1191         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
1192         https://bugs.webkit.org/show_bug.cgi?id=195083
1193         <rdar://problem/48423591>
1194
1195         Reviewed by Dean Jackson.
1196
1197         Fixing build error and re-introducing rolled-out changes.
1198         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
1199         is now WebGPUCommandEncoder.
1200
1201         Affected Web GPU tests updated to match new API.
1202
1203         New files and symbols:
1204         * CMakeLists.txt:
1205         * DerivedSources.make:
1206         * Sources.txt:
1207         * WebCore.xcodeproj/project.pbxproj:
1208         * bindings/js/WebCoreBuiltinNames.h:
1209
1210         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
1211         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1212         (WebCore::WebGPUCommandBuffer::create):
1213         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
1214         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
1215         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
1216         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
1217         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
1218         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
1219         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
1220         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
1221         * Modules/webgpu/WebGPUCommandBuffer.h:
1222         (WebCore::WebGPUCommandBuffer::commandBuffer):
1223         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
1224         * Modules/webgpu/WebGPUCommandBuffer.idl:
1225
1226         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
1227         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
1228         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
1229         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
1230         (WebCore::WebGPUCommandEncoder::create):
1231         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
1232         (WebCore::WebGPUCommandEncoder::beginRenderPass):
1233         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
1234         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
1235         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
1236         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
1237         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
1238         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
1239         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
1240         * Modules/webgpu/WebGPUDevice.cpp:
1241         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
1242         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
1243         * Modules/webgpu/WebGPUDevice.h:
1244         * Modules/webgpu/WebGPUDevice.idl:
1245         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1246         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
1247         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
1248         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
1249         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
1250         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1251         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1252         * Modules/webgpu/WebGPUQueue.cpp:
1253         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
1254         * Modules/webgpu/WebGPUQueue.h:
1255         * Modules/webgpu/WebGPUQueue.idl:
1256         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1257         (WebCore::WebGPURenderPassEncoder::create):
1258         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
1259         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1260         (WebCore::WebGPURenderPassEncoder::draw):
1261         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
1262         * Modules/webgpu/WebGPURenderPassEncoder.h:
1263         * Modules/webgpu/WebGPUSwapChain.cpp:
1264         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
1265         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
1266         * platform/graphics/gpu/GPUDevice.cpp:
1267         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
1268         (WebCore::GPUDevice::createCommandBuffer): Deleted.
1269         * platform/graphics/gpu/GPUDevice.h:
1270         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1271         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
1272         (WebCore::GPUCommandBuffer::create): Deleted.
1273
1274 2019-03-14  Justin Fan  <justin_fan@apple.com>
1275
1276         [Web GPU] Enum cleanup
1277         https://bugs.webkit.org/show_bug.cgi?id=195766
1278
1279         Reviewed by Myles C. Maxfield.
1280
1281         Clean up enum implementations in Web GPU. Enums referenced by only one class now share implementation files with that class to reduce clutter.
1282         
1283         No change in behavior.
1284
1285         * DerivedSources.make:
1286         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
1287         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
1288         * Modules/webgpu/GPUInputStateDescriptor.idl:
1289         * Modules/webgpu/GPURequestAdapterOptions.idl:
1290         * Modules/webgpu/GPUSamplerDescriptor.idl:
1291         * Modules/webgpu/GPUTextureDescriptor.idl:
1292         * Modules/webgpu/GPUTextureDimension.idl: Removed.
1293         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
1294         * Modules/webgpu/GPUVertexInputDescriptor.idl:
1295         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
1296         (WebCore::validateBufferBindingType):
1297         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
1298         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
1299         * Sources.txt:
1300         * WebCore.xcodeproj/project.pbxproj:
1301         * platform/graphics/gpu/GPUInputStateDescriptor.h:
1302         * platform/graphics/gpu/GPURequestAdapterOptions.h:
1303         * platform/graphics/gpu/GPUSamplerDescriptor.h:
1304         * platform/graphics/gpu/GPUTextureDescriptor.h:
1305         * platform/graphics/gpu/GPUTextureDimension.h: Removed.
1306         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
1307         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1308         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1309         (WebCore::MTLDataTypeForBindingType):
1310         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1311         (WebCore::GPUBindGroup::tryCreate):
1312         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1313         (WebCore::GPUDevice::create):
1314         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
1315         (WebCore::mtlAddressModeForAddressMode):
1316         (WebCore::mtlMinMagFilterForFilterMode):
1317         (WebCore::mtlMipFilterForFilterMode):
1318
1319 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1320
1321         Use enum class for AnimationMode
1322         https://bugs.webkit.org/show_bug.cgi?id=195762
1323
1324         Reviewed by Tim Horton.
1325
1326         Convert AnimationMode into an enum class.
1327
1328         * svg/SVGAnimateElementBase.cpp:
1329         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
1330         (WebCore::SVGAnimateElementBase::isAdditive const):
1331         * svg/SVGAnimateMotionElement.cpp:
1332         (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
1333         (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
1334         (WebCore::SVGAnimateMotionElement::updateAnimationMode):
1335         * svg/SVGAnimatedAngle.cpp:
1336         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
1337         * svg/SVGAnimatedBoolean.cpp:
1338         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
1339         * svg/SVGAnimatedColor.cpp:
1340         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
1341         * svg/SVGAnimatedEnumeration.cpp:
1342         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
1343         * svg/SVGAnimatedInteger.cpp:
1344         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
1345         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
1346         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
1347         * svg/SVGAnimatedLength.cpp:
1348         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
1349         * svg/SVGAnimatedLengthList.cpp:
1350         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
1351         * svg/SVGAnimatedNumber.cpp:
1352         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
1353         * svg/SVGAnimatedNumberList.cpp:
1354         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
1355         * svg/SVGAnimatedNumberOptionalNumber.cpp:
1356         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
1357         * svg/SVGAnimatedPath.cpp:
1358         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
1359         * svg/SVGAnimatedPointList.cpp:
1360         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
1361         * svg/SVGAnimatedPreserveAspectRatio.cpp:
1362         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
1363         * svg/SVGAnimatedRect.cpp:
1364         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
1365         * svg/SVGAnimatedTransformList.cpp:
1366         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
1367         * svg/SVGAnimationElement.cpp:
1368         (WebCore::SVGAnimationElement::updateAnimationMode):
1369         (WebCore::SVGAnimationElement::isAdditive const):
1370         (WebCore::SVGAnimationElement::isAccumulated const):
1371         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
1372         (WebCore::SVGAnimationElement::startedActiveInterval):
1373         (WebCore::SVGAnimationElement::updateAnimation):
1374         * svg/SVGAnimationElement.h:
1375         (WebCore::SVGAnimationElement::adjustFromToListValues):
1376         (WebCore::SVGAnimationElement::animateDiscreteType):
1377         (WebCore::SVGAnimationElement::animateAdditiveNumber):
1378         * svg/SVGSetElement.cpp:
1379         (WebCore::SVGSetElement::SVGSetElement):
1380         (WebCore::SVGSetElement::updateAnimationMode):
1381
1382 2019-03-14  Ryosuke Niwa  <rniwa@webkit.org>
1383
1384         Storing a Node in Ref/RefPtr inside its destructor results in double delete
1385         https://bugs.webkit.org/show_bug.cgi?id=195661
1386
1387         Reviewed by Brent Fulgham.
1388
1389         Set Node::m_refCount to 1 before calling its virtual destructor.
1390
1391         This is a security mitigation to prevent any code which ends up storing the node to Ref / RefPtr
1392         inside the destructor, which is a programming error caught by debug assertions, from triggering
1393         a double-delete on the same Node.
1394
1395         Such a code would hit the debug assertions in Node::deref() because m_inRemovedLastRefFunction
1396         had been set to true by then.
1397
1398         * dom/Document.cpp:
1399         (WebCore::Document::removedLastRef):
1400         * dom/Document.h:
1401         (WebCore::Document::decrementReferencingNodeCount):
1402         * dom/Node.cpp:
1403         (WebCore::Node::~Node):
1404         (WebCore::Node::removedLastRef):
1405
1406 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
1407
1408         Move CommonCrypto SPI declarations to an appropriate PAL/spi header
1409         https://bugs.webkit.org/show_bug.cgi?id=195754
1410         <rdar://problem/48591957>
1411
1412         Reviewed by Jiewen Tan.
1413
1414         Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
1415         Update the const correctness of one function call to match new SDK declaration.
1416
1417         No tests because there are no changes in behavior.
1418
1419         * crypto/CommonCryptoUtilities.h:
1420         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
1421         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
1422
1423 2019-03-14  Chris Dumez  <cdumez@apple.com>
1424
1425         Add WebsitePolicy for the client to specify the device orientation & motion access policy
1426         https://bugs.webkit.org/show_bug.cgi?id=195750
1427
1428         Reviewed by Geoffrey Garen.
1429
1430         Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
1431         the client already knows access to the device motion & orientation API will be granted / denied,
1432         it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
1433         permission is requested by JS.
1434
1435         * dom/DeviceOrientationAndMotionAccessController.cpp:
1436         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
1437         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
1438         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
1439         * dom/DeviceOrientationAndMotionAccessController.h:
1440         * loader/DocumentLoader.h:
1441         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
1442         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
1443         * page/DOMWindow.cpp:
1444         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
1445
1446 2019-03-14  Shawn Roberts  <sroberts@apple.com>
1447
1448         Unreviewed, rolling out r242931.
1449
1450         Causing internal watch/tv OS build failures
1451
1452         Reverted changeset:
1453
1454         "[Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue
1455         concept"
1456         https://bugs.webkit.org/show_bug.cgi?id=195083
1457         https://trac.webkit.org/changeset/242931
1458
1459 2019-03-14  Chris Dumez  <cdumez@apple.com>
1460
1461         Device orientation's permission should only require a user gesture to prompt the user
1462         https://bugs.webkit.org/show_bug.cgi?id=195731
1463
1464         Reviewed by Geoffrey Garen.
1465
1466         Device orientation's permission should only require a user gesture to prompt the user. If the
1467         user already made a decision, we should resolve the promise with this decision, even without
1468         user gesture.
1469
1470         This is useful for JS to figure out if they are access to device orientation or not because
1471         showing UI for the user to give permission.
1472
1473         No new tests, updated existing tests.
1474
1475         * dom/DeviceOrientationAndMotionAccessController.cpp:
1476         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
1477         * dom/DeviceOrientationAndMotionAccessController.h:
1478         * dom/DeviceOrientationOrMotionEvent.cpp:
1479         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
1480
1481 2019-03-14  Youenn Fablet  <youenn@apple.com>
1482
1483         Reset storage quota when clearing IDB/Cache API entries
1484         https://bugs.webkit.org/show_bug.cgi?id=195716
1485
1486         Reviewed by Chris Dumez.
1487
1488         On clearing of databases, reset all quota users.
1489         This will ensure all layout test runs start with a clean state.
1490
1491         * Modules/indexeddb/server/IDBServer.cpp:
1492         (WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases):
1493         * storage/StorageQuotaManager.h:
1494         (WebCore::StorageQuotaManager::resetQuota):
1495
1496 2019-03-14  Jer Noble  <jer.noble@apple.com>
1497
1498         Certain videos are causing a crash when used as WebGL texture
1499         https://bugs.webkit.org/show_bug.cgi?id=195700
1500         <rdar://problem/48869347>
1501
1502         Reviewed by Eric Carlson.
1503
1504         CFEqual is not null-safe, so perform a null and type check before comparing.
1505
1506         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1507         (WebCore::transferFunctionFromString):
1508
1509 2019-03-14  Zalan Bujtas  <zalan@apple.com>
1510
1511         Cleanup inline boxes when list marker gets blockified
1512         https://bugs.webkit.org/show_bug.cgi?id=195746
1513         <rdar://problem/48049175>
1514
1515         Reviewed by Antti Koivisto.
1516
1517         Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
1518         During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
1519         change does not require a new renderer.
1520         This patch takes care of destroying the inline boxtree when the marker gains block display type. 
1521
1522         Test: fast/block/float/list-marker-is-float-crash.html
1523
1524         * rendering/RenderListMarker.cpp:
1525         (WebCore::RenderListMarker::styleDidChange):
1526
1527 2019-03-14  Devin Rousso  <drousso@apple.com>
1528
1529         Web Inspector: Audit: provide a way to get the contents of resources
1530         https://bugs.webkit.org/show_bug.cgi?id=195266
1531         <rdar://problem/48550911>
1532
1533         Reviewed by Joseph Pecoraro.
1534
1535         Test: inspector/audit/run-resources.html
1536
1537         * inspector/InspectorAuditResourcesObject.idl: Added.
1538         * inspector/InspectorAuditResourcesObject.h: Added.
1539         (WebCore::InspectorAuditResourcesObject::create):
1540         (WebCore::InspectorAuditResourcesObject::Resource):
1541         (WebCore::InspectorAuditResourcesObject::ResourceContent):
1542         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient):
1543         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient):
1544         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient):
1545         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient):
1546         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient):
1547         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient):
1548         * inspector/InspectorAuditResourcesObject.cpp: Added.
1549         (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject):
1550         (WebCore::InspectorAuditResourcesObject::getResources):
1551         (WebCore::InspectorAuditResourcesObject::getResourceContent):
1552         (WebCore::InspectorAuditResourcesObject::clientForResource):
1553
1554         * inspector/agents/InspectorPageAgent.h:
1555         * inspector/agents/InspectorPageAgent.cpp:
1556         (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added.
1557         (WebCore::allResourcesURLsForFrame):
1558         Moved a file static function to be a class static function so it can be used elsewhere.
1559
1560         * CMakeLists.txt:
1561         * DerivedSources-input.xcfilelist:
1562         * DerivedSources-output.xcfilelist:
1563         * DerivedSources.make:
1564         * Sources.txt:
1565         * WebCore.xcodeproj/project.pbxproj:
1566
1567 2019-03-14  Devin Rousso  <drousso@apple.com>
1568
1569         Web Inspector: Console: getEventListeners should work for any EventTarget
1570         https://bugs.webkit.org/show_bug.cgi?id=195713
1571
1572         Reviewed by Joseph Pecoraro.
1573
1574         Test: inspector/console/command-line-api-getEventListeners.html
1575
1576         * dom/EventTarget.h:
1577         * dom/EventTarget.cpp:
1578         (WebCore::EventTarget::eventTypes): Added.
1579
1580         * inspector/CommandLineAPIHost.idl:
1581         * inspector/CommandLineAPIHost.h:
1582         (WebCore::CommandLineAPIHost::init):
1583         * inspector/CommandLineAPIHost.cpp:
1584         (WebCore::CommandLineAPIHost::disconnect):
1585         (WebCore::CommandLineAPIHost::getEventListeners):
1586         (WebCore::listenerEntriesFromListenerInfo): Deleted.
1587
1588         * inspector/CommandLineAPIModuleSource.js:
1589         (CommandLineAPIImpl.prototype.getEventListeners):
1590
1591         * inspector/InspectorController.cpp:
1592         (WebCore::InspectorController::InspectorController):
1593         * inspector/WorkerInspectorController.cpp:
1594         (WebCore::WorkerInspectorController::WorkerInspectorController):
1595
1596 2019-03-14  Devin Rousso  <drousso@apple.com>
1597
1598         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
1599         https://bugs.webkit.org/show_bug.cgi?id=195123
1600         <rdar://problem/48450148>
1601
1602         Reviewed by Joseph Pecoraro.
1603
1604         Test: inspector/css/getMatchedStylesForNode.html
1605
1606         * inspector/agents/InspectorCSSAgent.cpp:
1607         (WebCore::protocolValueForPseudoId): Added.
1608         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
1609
1610 2019-03-13  Benjamin Poulain  <benjamin@webkit.org>
1611
1612         Fix the argument type of RenderView::resumePausedImageAnimationsIfNeeded()
1613         https://bugs.webkit.org/show_bug.cgi?id=195659
1614
1615         Reviewed by Saam Barati.
1616
1617         The two callers of resumePausedImageAnimationsIfNeeded() both get the IntRect
1618         as a reference. The rect was going on the stack then used as a reference again.
1619
1620         * rendering/RenderView.cpp:
1621         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
1622         * rendering/RenderView.h:
1623
1624 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1625
1626         [ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
1627         https://bugs.webkit.org/show_bug.cgi?id=195724
1628         <rdar://problem/48873456>
1629
1630         Reviewed by Simon Fraser.
1631
1632         Call willNotProceedWithClick on preventDefault. This is very similar to the long press case.
1633
1634         * page/ios/ContentChangeObserver.cpp:
1635         (WebCore::willNotProceedWithClick):
1636         (WebCore::ContentChangeObserver::didRecognizeLongPress):
1637         (WebCore::ContentChangeObserver::didPreventDefaultForEvent):
1638         * page/ios/ContentChangeObserver.h:
1639
1640 2019-03-13  Justin Fan  <justin_fan@apple.com>
1641
1642         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue concept
1643         https://bugs.webkit.org/show_bug.cgi?id=195083
1644         <rdar://problem/48423591>
1645
1646         Reviewed by Dean Jackson.
1647
1648         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
1649         is now WebGPUCommandEncoder.
1650
1651         Affected Web GPU tests updated to match new API.
1652
1653         New files and symbols:
1654         * CMakeLists.txt:
1655         * DerivedSources.make:
1656         * Sources.txt:
1657         * WebCore.xcodeproj/project.pbxproj:
1658         * bindings/js/WebCoreBuiltinNames.h:
1659
1660         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
1661         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1662         (WebCore::WebGPUCommandBuffer::create):
1663         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
1664         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
1665         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
1666         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
1667         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
1668         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
1669         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
1670         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
1671         * Modules/webgpu/WebGPUCommandBuffer.h:
1672         (WebCore::WebGPUCommandBuffer::commandBuffer):
1673         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
1674         * Modules/webgpu/WebGPUCommandBuffer.idl:
1675
1676         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
1677         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
1678         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
1679         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
1680         (WebCore::WebGPUCommandEncoder::create):
1681         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
1682         (WebCore::WebGPUCommandEncoder::beginRenderPass):
1683         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
1684         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
1685         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
1686         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
1687         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
1688         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
1689         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
1690         * Modules/webgpu/WebGPUDevice.cpp:
1691         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
1692         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
1693         * Modules/webgpu/WebGPUDevice.h:
1694         * Modules/webgpu/WebGPUDevice.idl:
1695         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1696         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
1697         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
1698         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
1699         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
1700         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1701         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1702         * Modules/webgpu/WebGPUQueue.cpp:
1703         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
1704         * Modules/webgpu/WebGPUQueue.h:
1705         * Modules/webgpu/WebGPUQueue.idl:
1706         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1707         (WebCore::WebGPURenderPassEncoder::create):
1708         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
1709         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1710         (WebCore::WebGPURenderPassEncoder::draw):
1711         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
1712         * Modules/webgpu/WebGPURenderPassEncoder.h:
1713         * Modules/webgpu/WebGPUSwapChain.cpp:
1714         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
1715         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
1716         * platform/graphics/gpu/GPUDevice.cpp:
1717         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
1718         (WebCore::GPUDevice::createCommandBuffer): Deleted.
1719         * platform/graphics/gpu/GPUDevice.h:
1720         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1721         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
1722         (WebCore::GPUCommandBuffer::create): Deleted.
1723
1724 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1725
1726         [WeakPtr] RenderListMarker::m_listItem should be a WeakPtr
1727         https://bugs.webkit.org/show_bug.cgi?id=195704
1728         <rdar://problem/48486278>
1729
1730         Reviewed by Simon Fraser.
1731
1732         * rendering/RenderListMarker.cpp:
1733         (WebCore::RenderListMarker::RenderListMarker):
1734         (WebCore::RenderListMarker::paint):
1735         (WebCore::RenderListMarker::layout):
1736         (WebCore::RenderListMarker::updateContent):
1737         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1738         (WebCore::RenderListMarker::lineHeight const):
1739         (WebCore::RenderListMarker::baselinePosition const):
1740         (WebCore::RenderListMarker::suffix const):
1741         (WebCore::RenderListMarker::isInside const):
1742         (WebCore::RenderListMarker::getRelativeMarkerRect):
1743         * rendering/RenderListMarker.h:
1744
1745 2019-03-13  Dean Jackson  <dino@apple.com>
1746
1747         Block all plugins smaller than 5x5px
1748         https://bugs.webkit.org/show_bug.cgi?id=195702
1749         <rdar://problem/28435204>
1750
1751         Reviewed by Sam Weinig.
1752
1753         Block all plugins that are smaller than a threshold, in this case
1754         5px x 5px. Other browsers have implemented this for a while, and now
1755         that we have Intersection Observers, small plugins are no longer
1756         necessary.
1757
1758         Test: plugins/small-plugin-blocked.html
1759
1760         * en.lproj/Localizable.strings: New message for a small plugin.
1761         * platform/LocalizedStrings.cpp:
1762         (WebCore::pluginTooSmallText):
1763         * platform/LocalizedStrings.h:
1764
1765         * html/HTMLPlugInElement.cpp: Helper function for Internals testing.
1766         (WebCore::HTMLPlugInElement::isBelowSizeThreshold const):
1767         * html/HTMLPlugInElement.h:
1768
1769         * loader/EmptyClients.cpp: Removed an unused function.
1770         (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted.
1771         * loader/EmptyFrameLoaderClient.h:
1772         * loader/FrameLoaderClient.h:
1773
1774         * page/Settings.yaml: Add flag for new feature.
1775
1776         * rendering/RenderEmbeddedObject.cpp: New unavailability reason for
1777         embedded objects.
1778         (WebCore::unavailablePluginReplacementText):
1779         * rendering/RenderEmbeddedObject.h:
1780         (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const):
1781
1782         * testing/Internals.cpp: Helper function for testing.
1783         (WebCore::Internals::pluginIsBelowSizeThreshold):
1784         * testing/Internals.h:
1785         * testing/Internals.idl:
1786
1787 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1788
1789         Use RenderBox::previousSiblingBox/nextSiblingBox in RenderMultiColumnFlow
1790         https://bugs.webkit.org/show_bug.cgi?id=195701
1791         <rdar://problem/48448658>
1792
1793         Reviewed by Simon Fraser.
1794
1795         It's safer to use existing RenderBox functions to get sibling boxes.
1796
1797         Test: fast/ruby/crash-when-paginated-ruby.html
1798
1799         * rendering/RenderMultiColumnFlow.cpp:
1800         (WebCore::RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf):
1801         (WebCore::RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf):
1802
1803 2019-03-13  Keith Rollin  <krollin@apple.com>
1804
1805         Add support for new StagedFrameworks layout
1806         https://bugs.webkit.org/show_bug.cgi?id=195543
1807
1808         Reviewed by Alexey Proskuryakov.
1809
1810         When creating the WebKit layout for out-of-band Safari/WebKit updates,
1811         use an optional path prefix when called for.
1812
1813         No new tests since there should be no observable behavior difference.
1814
1815         * Configurations/WebCore.xcconfig:
1816
1817 2019-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1818
1819         Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element
1820         https://bugs.webkit.org/show_bug.cgi?id=195663
1821         <rdar://problem/48576391>
1822
1823         Reviewed by Ryosuke Niwa.
1824
1825         Currently, it's possible for HTMLFormControlElement's destructor to be reentrant. This may happen if the form
1826         control element is ref'd while carrying out its destructor's logic. This may happen in two places in
1827         HTMLFormControlElement (didChangeForm and resetDefaultButton), both of which actually don't require ensuring a
1828         protected reference to the form control element since they should never result in any script execution.
1829
1830         To fix the bug, convert these strong references into raw pointers, and add ScriptDisallowedScope to ensure that
1831         we don't change these codepaths in the future, such that they trigger arbitrary script execution.
1832
1833         Test: fast/forms/remove-associated-element-after-gc.html
1834
1835         * html/HTMLFormControlElement.cpp:
1836         (WebCore::HTMLFormControlElement::didChangeForm):
1837         * html/HTMLFormElement.cpp:
1838         (WebCore::HTMLFormElement::resetDefaultButton):
1839
1840 2019-03-13  Daniel Bates  <dabates@apple.com>
1841
1842         Remove some unnecessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards
1843         https://bugs.webkit.org/show_bug.cgi?id=195703
1844
1845         Reviewed by Tim Horton.
1846
1847         Remove out-of-date comment and unncessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards. Following
1848         r240604 we now make use of WebCore::windowsKeyCodeForCharCode() even for hardware key events
1849         when USE(UIKIT_KEYBOARD_ADDITIONS) is enabled.
1850
1851         No functionality changed. So, no new tests.
1852
1853         * platform/ios/KeyEventIOS.mm:
1854         (WebCore::windowsKeyCodeForCharCode):
1855         * platform/ios/WebEvent.mm:
1856         (normalizedStringWithAppKitCompatibilityMapping):
1857
1858 2019-03-13  Simon Fraser  <simon.fraser@apple.com>
1859
1860         Scrolling tree should reposition non-stacking order descendents of overflow:scroll
1861         https://bugs.webkit.org/show_bug.cgi?id=195608
1862
1863         Reviewed by Zalan Bujtas.
1864         
1865         Step 1: add scrolling tree positioning nodes classes (but don't create them yet).
1866
1867         Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
1868         an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
1869         the values of ScrollPositioningBehavior:
1870
1871         ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
1872             async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
1873             When the overflow scrolls, this layer has to move along with the overflow.
1874
1875         ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
1876             overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
1877             This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.
1878
1879         PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
1880         
1881         This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
1882         is just a stub so the new node types aren't created yet.
1883         
1884         RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
1885         role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
1886         the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.
1887
1888         Test: scrollingcoordinator/scrolling-tree/positioned-nodes.html
1889
1890         * Sources.txt:
1891         * SourcesCocoa.txt:
1892         * WebCore.xcodeproj/project.pbxproj:
1893         * page/scrolling/AsyncScrollingCoordinator.cpp:
1894         (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry):
1895         (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
1896         * page/scrolling/AsyncScrollingCoordinator.h:
1897         * page/scrolling/ScrollingConstraints.cpp:
1898         (WebCore::operator<<):
1899         * page/scrolling/ScrollingConstraints.h:
1900         (WebCore::LayoutConstraints::LayoutConstraints):
1901         (WebCore::LayoutConstraints::operator== const):
1902         (WebCore::LayoutConstraints::operator!= const):
1903         (WebCore::LayoutConstraints::alignmentOffset const):
1904         (WebCore::LayoutConstraints::setAlignmentOffset):
1905         (WebCore::LayoutConstraints::layerPositionAtLastLayout const):
1906         (WebCore::LayoutConstraints::setLayerPositionAtLastLayout):
1907         (WebCore::LayoutConstraints::scrollPositioningBehavior const):
1908         (WebCore::LayoutConstraints::setScrollPositioningBehavior):
1909         * page/scrolling/ScrollingCoordinator.cpp:
1910         (WebCore::operator<<):
1911         * page/scrolling/ScrollingCoordinator.h:
1912         (WebCore::ScrollingCoordinator::setPositionedNodeGeometry):
1913         (WebCore::ScrollingCoordinator::setRelatedOverflowScrollingNodes):
1914         * page/scrolling/ScrollingCoordinatorTypes.h:
1915         * page/scrolling/ScrollingStateNode.h:
1916         (WebCore::ScrollingStateNode::isPositionedNode const):
1917         * page/scrolling/ScrollingStatePositionedNode.cpp: Added.
1918         (WebCore::ScrollingStatePositionedNode::create):
1919         (WebCore::ScrollingStatePositionedNode::ScrollingStatePositionedNode):
1920         (WebCore::ScrollingStatePositionedNode::clone):
1921         (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged):
1922         (WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes):
1923         (WebCore::ScrollingStatePositionedNode::updateConstraints):
1924         (WebCore::ScrollingStatePositionedNode::dumpProperties const):
1925         * page/scrolling/ScrollingStatePositionedNode.h: Added.
1926         * page/scrolling/ScrollingStateTree.cpp:
1927         (WebCore::ScrollingStateTree::createNode):
1928         * page/scrolling/ScrollingTree.cpp:
1929         (WebCore::ScrollingTree::updateTreeFromStateNode):
1930         * page/scrolling/ScrollingTree.h:
1931         * page/scrolling/ScrollingTreeNode.h:
1932         (WebCore::ScrollingTreeNode::isPositionedNode const):
1933         * page/scrolling/cocoa/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h.
1934         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: Added.
1935         (WebCore::ScrollingTreePositionedNode::create):
1936         (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
1937         (WebCore::ScrollingTreePositionedNode::~ScrollingTreePositionedNode):
1938         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
1939         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1940         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
1941         (WebCore::ScrollingTreePositionedNode::dumpProperties const):
1942         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1943         * page/scrolling/mac/ScrollingTreeMac.cpp:
1944         (ScrollingTreeMac::createScrollingTreeNode):
1945         * platform/ScrollTypes.h:
1946         * rendering/RenderLayerBacking.cpp:
1947         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
1948         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1949         * rendering/RenderLayerBacking.h:
1950         * rendering/RenderLayerCompositor.cpp:
1951         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1952         (WebCore::scrollCoordinationRoleForNodeType):
1953         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
1954         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
1955         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1956         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
1957         * rendering/RenderLayerCompositor.h:
1958
1959 2019-03-13  Youenn Fablet  <youenn@apple.com>
1960
1961         Check IDB quota usage through QuotaManager
1962         https://bugs.webkit.org/show_bug.cgi?id=195302
1963
1964         Reviewed by Chris Dumez.
1965
1966         For every write operation, compute an estimate size and check for quota before proceeding.
1967         When proceeding, store the estimate size in a map.
1968         If size of the database is to be computed when the task is not done,
1969         the estimate size will be added to the current size of the databases.
1970         At the end of the task, the estimate size is removed from the map,
1971         and the databases size is refreshed.
1972
1973         This patch implements size estimation for write tasks.
1974         Put/add operations might overestimate the size
1975         when an old value will be replaced by a new value.
1976         In that case, we do not substract the old value size since we do not know it.
1977
1978         This patch implements database opening by adding a fixed small cost,
1979         as we do not know whether the database is new or not.
1980
1981         For the first IDB request, we have not computed the size of the database.
1982         To do so, we need to go to a background thread and do that file size computation.
1983         For that purpose, we add support for being-initialized quota user.
1984         Quota manager is calling whenInitialized on its quota user and will
1985         delay any quota check requests until its quota user is answering this callback.
1986
1987         For in process IDB, use the default storage quota per origin and do not increase it.
1988         Future work should move it to NetworkProcess and implement some quota checking.
1989
1990         Cache API and IDB quota management are not yet fully unified.
1991         If IDB is used on start-up, we should check for Cache API storage size.
1992         Conversely, on Cache API first wite task, even if IDB is not being used,
1993         we should compute the size of the IDB data for the given origin.
1994
1995         Test: http/tests/IndexedDB/storage-limit.https.html
1996
1997         * Modules/indexeddb/server/IDBBackingStore.h:
1998         * Modules/indexeddb/server/IDBServer.cpp:
1999         (WebCore::IDBServer::IDBServer::create):
2000         (WebCore::IDBServer::IDBServer::IDBServer):
2001         (WebCore::IDBServer::m_quotaManagerGetter):
2002         (WebCore::IDBServer::IDBServer::QuotaUser::QuotaUser):
2003         (WebCore::IDBServer::IDBServer::QuotaUser::~QuotaUser):
2004         (WebCore::IDBServer::IDBServer::QuotaUser::clearSpaceUsed):
2005         (WebCore::IDBServer::IDBServer::QuotaUser::whenInitialized):
2006         (WebCore::IDBServer::IDBServer::QuotaUser::initializeSpaceUsed):
2007         (WebCore::IDBServer::IDBServer::quotaUser):
2008         (WebCore::IDBServer::IDBServer::startComputingSpaceUsedForOrigin):
2009         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
2010         (WebCore::IDBServer::IDBServer::finishComputingSpaceUsedForOrigin):
2011         (WebCore::IDBServer::IDBServer::requestSpace):
2012         (WebCore::IDBServer::IDBServer::clearSpaceUsed):
2013         (WebCore::IDBServer::IDBServer::setSpaceUsed):
2014         (WebCore::IDBServer::IDBServer::increasePotentialSpaceUsed):
2015         (WebCore::IDBServer::IDBServer::decreasePotentialSpaceUsed):
2016         * Modules/indexeddb/server/IDBServer.h:
2017         (WebCore::IDBServer::IDBServer::create):
2018         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2019         (WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const):
2020         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2021         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2022         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder):
2023         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
2024         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
2025         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2026         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2027         (WebCore::IDBServer::estimateSize):
2028         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
2029         (WebCore::IDBServer::quotaErrorMessageName):
2030         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
2031         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
2032         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
2033         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
2034         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
2035         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
2036         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
2037         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
2038         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
2039         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
2040         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
2041         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
2042         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
2043         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
2044         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2045         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
2046         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
2047         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
2048         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2049         (WebCore::IDBServer::UniqueIDBDatabase::server):
2050         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2051         (WebCore::InProcessIDBServer::create):
2052         (WebCore::InProcessIDBServer::quotaManager):
2053         (WebCore::storageQuotaManagerGetter):
2054         (WebCore::InProcessIDBServer::InProcessIDBServer):
2055         * Modules/indexeddb/shared/InProcessIDBServer.h:
2056         * loader/EmptyClients.cpp:
2057         * storage/StorageQuotaManager.cpp:
2058         (WebCore::StorageQuotaManager::addUser):
2059         (WebCore::StorageQuotaManager::requestSpace):
2060         * storage/StorageQuotaManager.h:
2061         (WebCore::StorageQuotaManager::defaultQuota):
2062         (WebCore::StorageQuotaManager::removeUser):
2063         * storage/StorageQuotaUser.h:
2064         (WebCore::StorageQuotaUser::whenInitialized):
2065
2066 2019-03-13  Chris Dumez  <cdumez@apple.com>
2067
2068         Better build fix after r242901.
2069
2070         Reviewed by Jer Noble.
2071
2072         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2073         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
2074         (MediaSessionManagerCocoa::updateNowPlayingInfo):
2075
2076 2019-03-13  Timothy Hatcher  <timothy@apple.com>
2077
2078         Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
2079         https://bugs.webkit.org/show_bug.cgi?id=195636
2080         rdar://problem/45055697
2081
2082         Reviewed by Ryosuke Niwa.
2083
2084         * editing/DictionaryPopupInfo.h:
2085         (WebCore::DictionaryPopupInfo::encodingRequiresPlatformData const): Added.
2086         * editing/FontAttributes.h:
2087         (WebCore::FontAttributes::encodingRequiresPlatformData const): Added.
2088
2089 2019-03-13  Chris Dumez  <cdumez@apple.com>
2090
2091         Unreviewed build fix after r242901.
2092
2093         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2094         (MediaSessionManagerCocoa::updateNowPlayingInfo):
2095
2096 2019-03-13  Chris Dumez  <cdumez@apple.com>
2097
2098         Use a ServiceWorker process per registrable domain
2099         https://bugs.webkit.org/show_bug.cgi?id=195649
2100
2101         Reviewed by Youenn Fablet.
2102
2103         Use a ServiceWorker process per registrable domain instead of one per security origin. This is
2104         more in line with PSON and avoids launching too many processes.
2105
2106         * page/ClientOrigin.h:
2107         (WebCore::ClientOrigin::clientRegistrableDomain const):
2108         * workers/service/server/SWServer.cpp:
2109         (WebCore::SWServer::tryInstallContextData):
2110         (WebCore::SWServer::serverToContextConnectionCreated):
2111         (WebCore::SWServer::runServiceWorkerIfNecessary):
2112         (WebCore::SWServer::markAllWorkersForRegistrableDomainAsTerminated):
2113         (WebCore::SWServer::registerServiceWorkerClient):
2114         (WebCore::SWServer::unregisterServiceWorkerClient):
2115         (WebCore::SWServer::needsServerToContextConnectionForRegistrableDomain const):
2116         * workers/service/server/SWServer.h:
2117         * workers/service/server/SWServerToContextConnection.cpp:
2118         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
2119         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
2120         (WebCore::SWServerToContextConnection::connectionForRegistrableDomain):
2121         * workers/service/server/SWServerToContextConnection.h:
2122         (WebCore::SWServerToContextConnection::registrableDomain const):
2123         * workers/service/server/SWServerWorker.cpp:
2124         (WebCore::SWServerWorker::contextConnection):
2125         * workers/service/server/SWServerWorker.h:
2126         (WebCore::SWServerWorker::registrableDomain const):
2127
2128 2019-03-13  Chris Dumez  <cdumez@apple.com>
2129
2130         REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
2131         https://bugs.webkit.org/show_bug.cgi?id=195684
2132         <rdar://problem/48294714>
2133
2134         Reviewed by Antti Koivisto.
2135
2136         The issue was caused by us failing to suspend the current page on navigation because the source and
2137         target WebBackForwardListItem are identical. The source WebBackForwardListItem was wrong.
2138
2139         When a navigation is triggered by the WebContent process (and not the UIProcess), we create the Navigation
2140         object in WebPageProxy::decidePolicyForNavigationAction(). For the navigation's targetItem, we use the
2141         target item identifier provided by the WebContent process via the NavigationActionData. However,
2142         for the source item, we would use the WebBackForwardList's currentItem in the UIProcess. The issue
2143         is that the WebBackForwardList's currentItem usually has already been updated to be the target
2144         item via a WebPageProxy::BackForwardGoToItem() synchronous IPC.
2145
2146         To avoid raciness and given that the current history management is fragile (as it is managed by
2147         both the UIProcess and the WebProcess), I am now passing the source item identifier in
2148         addition to the target item identifier in the NavigationActionData that is sent by the WebProcess.
2149         This is a lot less error prone, the WebProcess knows more accurately which history items it is going
2150         from and to.
2151
2152         * loader/FrameLoader.cpp:
2153         (WebCore::FrameLoader::loadURLIntoChildFrame):
2154         (WebCore::FrameLoader::loadDifferentDocumentItem):
2155         (WebCore::FrameLoader::loadItem):
2156         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
2157         * loader/FrameLoader.h:
2158         * loader/HistoryController.cpp:
2159         (WebCore::HistoryController::recursiveGoToItem):
2160         * loader/NavigationAction.cpp:
2161         (WebCore::NavigationAction::setSourceBackForwardItem):
2162         * loader/NavigationAction.h:
2163         (WebCore::NavigationAction::sourceBackForwardItemIdentifier const):
2164
2165 2019-03-13  Jer Noble  <jer.noble@apple.com>
2166
2167         Add AggregateLogger, a Logger specialization for singleton classes.
2168         https://bugs.webkit.org/show_bug.cgi?id=195644
2169
2170         Reviewed by Eric Carlson.
2171
2172         Convert debug logging over to release logging through the use of AggregateLogger.
2173
2174         * platform/audio/PlatformMediaSession.h:
2175         (WebCore::PlatformMediaSession::client const):
2176         * platform/audio/PlatformMediaSessionManager.cpp:
2177         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
2178         (WebCore::PlatformMediaSessionManager::beginInterruption):
2179         (WebCore::PlatformMediaSessionManager::endInterruption):
2180         (WebCore::PlatformMediaSessionManager::addSession):
2181         (WebCore::PlatformMediaSessionManager::removeSession):
2182         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
2183         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
2184         (WebCore::PlatformMediaSessionManager::setCurrentSession):
2185         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
2186         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
2187         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
2188         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
2189         (WebCore::PlatformMediaSessionManager::logChannel const):
2190         * platform/audio/PlatformMediaSessionManager.h:
2191         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2192         (MediaSessionManagerCocoa::updateSessionState):
2193         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
2194         (MediaSessionManagerCocoa::removeSession):
2195         (MediaSessionManagerCocoa::sessionWillEndPlayback):
2196         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
2197         (MediaSessionManagerCocoa::updateNowPlayingInfo):
2198         * platform/audio/ios/MediaSessionManagerIOS.mm:
2199         (WebCore::MediaSessionManageriOS::resetRestrictions):
2200         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
2201
2202 2019-03-13  Chris Dumez  <cdumez@apple.com>
2203
2204         Drop legacy WebCore::toRegistrableDomain() utility function
2205         https://bugs.webkit.org/show_bug.cgi?id=195637
2206
2207         Reviewed by Geoffrey Garen.
2208
2209         Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
2210         Update call sites to use modern RegistrableDomain type instead.
2211
2212         * loader/CrossOriginAccessControl.cpp:
2213         (WebCore::shouldCrossOriginResourcePolicyCancelLoad):
2214         * loader/FrameLoader.cpp:
2215         (WebCore::FrameLoader::setFirstPartyForCookies):
2216         * page/DOMWindow.cpp:
2217         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
2218         * platform/RegistrableDomain.h:
2219         (WebCore::registrableDomainsAreEqual):
2220         * platform/network/ResourceRequestBase.h:
2221         * platform/network/cf/ResourceRequestCFNet.cpp:
2222         * platform/network/cocoa/ResourceRequestCocoa.mm:
2223
2224 2019-03-13  Alex Christensen  <achristensen@webkit.org>
2225
2226         Prevent checked_cf_cast crashes in ResourceResponse::platformCertificateInfo
2227         https://bugs.webkit.org/show_bug.cgi?id=195686
2228
2229         Reviewed by Tim Horton.
2230
2231         This covers up a type confusion bug on some OSes until rdar://problem/48853137 is resolved.
2232
2233         * SourcesCocoa.txt:
2234         * WebCore.xcodeproj/project.pbxproj:
2235         * platform/network/cocoa/ResourceResponseCocoa.mm:
2236
2237 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
2238
2239         [GStreamer][WebRTC] Add support for omxh264enc encoder
2240         https://bugs.webkit.org/show_bug.cgi?id=195676
2241
2242         Reviewed by Philippe Normand.
2243
2244         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
2245         (setup_omxh264enc):
2246         (set_bitrate_bit_per_sec):
2247         (gst_webrtc_video_encoder_class_init):
2248
2249 2019-03-13  Antoine Quint  <graouts@apple.com>
2250
2251         REGRESSION(r240634): Element::hasPointerCapture() passes a JS-controlled value directly into a HashMap as a key
2252         https://bugs.webkit.org/show_bug.cgi?id=195683
2253         <rdar://problem/48659950>
2254
2255         Reviewed by Alex Christensen.
2256
2257         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
2258         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
2259         lookup in this HashMap.
2260
2261         Test: pointerevents/pointer-id-crash.html
2262
2263         * page/PointerCaptureController.h:
2264
2265 2019-03-12  Brady Eidson  <beidson@apple.com>
2266
2267         Take UnboundedNetworking assertion when a file upload is in progress.
2268         https://bugs.webkit.org/show_bug.cgi?id=195497
2269
2270         Reviewed by Geoff Garen.
2271
2272         * platform/network/ResourceRequestBase.cpp:
2273         (WebCore::ResourceRequestBase::hasUpload const):
2274         * platform/network/ResourceRequestBase.h:
2275
2276 2019-03-13  Youenn Fablet  <youenn@apple.com>
2277
2278         Enable libwebrtc logging control through WebCore
2279         https://bugs.webkit.org/show_bug.cgi?id=195658
2280
2281         Reviewed by Eric Carlson.
2282
2283         Add support for WebCore logging of libwebrtc messages.
2284         This is controlled by WebRTC log channel state and level.
2285         In case of private browsing mode, any logging is disabled.
2286         This will stay for the lifetime of the process.
2287         No change of behavior.
2288
2289         * Modules/mediastream/RTCPeerConnection.cpp:
2290         (WebCore::RTCPeerConnection::create):
2291         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2292         (WebCore::doReleaseLogging):
2293         (WebCore::setLogging):
2294         (WebCore::computeLogLevel):
2295         (WebCore::initializePeerConnectionFactoryAndThreads):
2296         (WebCore::LibWebRTCProvider::setEnableLogging):
2297         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2298
2299 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
2300
2301         [GStreamer][WebRTC] Do not sync encoder on the clock
2302         https://bugs.webkit.org/show_bug.cgi?id=195673
2303
2304         we should encode as fast as possible and totally ignore timestamp while
2305         doing so.
2306
2307         Reviewed by Philippe Normand.
2308
2309         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2310         (WebCore::GStreamerVideoEncoder::InitEncode):
2311
2312 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
2313
2314         [GStreamer][WebRTC]: Use codec setting video height/width as fallback
2315         https://bugs.webkit.org/show_bug.cgi?id=195675
2316
2317         Reviewed by Philippe Normand.
2318
2319         In some cases the frame height and width is not set (not sure why/ in
2320         what conditions but it happens) so make sure to get the information from
2321         the VideoCodec when configuring the encoder.
2322
2323         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
2324         (WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
2325         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
2326
2327 2019-03-13  Miguel Gomez  <magomez@igalia.com>
2328
2329         [CoordinatedGraphics] Null dereference in CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded
2330         https://bugs.webkit.org/show_bug.cgi?id=195615
2331
2332         Reviewed by Carlos Garcia Campos.
2333
2334         Exit early if we don't receive a valid coordinator.
2335
2336         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2337         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
2338
2339 2019-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>
2340
2341         [Win][PlayStation] Remove WebCore::standardUserAgentForURL
2342         https://bugs.webkit.org/show_bug.cgi?id=195662
2343
2344         Reviewed by Ryosuke Niwa.
2345
2346         WebCore::standardUserAgentForURL is just a stub in Windows port.
2347
2348         No new tests because there is no behavior change.
2349
2350         * platform/win/UserAgentWin.cpp:
2351         (WebCore::standardUserAgentForURL): Deleted.
2352         * platform/playstation/UserAgentPlayStation.cpp:
2353         (WebCore::standardUserAgentForURL): Deleted.
2354
2355 2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
2356
2357         [Win] Fix a slew of simple clang-cl warnings.
2358         https://bugs.webkit.org/show_bug.cgi?id=195652
2359
2360         Reviewed by Don Olmstead.
2361
2362         * page/AutoscrollController.cpp:
2363         (WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
2364         * platform/network/curl/CurlContext.cpp:
2365         (WebCore::CurlHandle::willSetupSslCtx):
2366         (WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
2367         * platform/network/curl/CurlFormDataStream.cpp:
2368         (WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
2369         * platform/network/curl/CurlRequest.cpp:
2370         (WebCore::CurlRequest::CurlRequest): -Wreorder
2371         (WebCore::CurlRequest::setupTransfer): -Wunused-variable
2372         * platform/network/curl/CurlSSLVerifier.cpp:
2373         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
2374         * platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
2375         * platform/win/LoggingWin.cpp:
2376         (WebCore::logLevelString): -Wwritable-strings
2377         * rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
2378         (WebCore::RenderThemeWin::getThemeData): -Wswitch
2379
2380 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2381
2382         Move the code for determining the need for touch bar quirks to Quirks class
2383         https://bugs.webkit.org/show_bug.cgi?id=195654
2384
2385         Reviewed by Brent Fulgham.
2386
2387         Moved the code to determine whether the touch bar quirks are needed or not from WebKit2.
2388
2389         * WebCore.xcodeproj/project.pbxproj:
2390         * page/Quirks.cpp:
2391         (WebCore::Quirks::isTouchBarUpdateSupressedForHiddenContentEditable const):
2392         (WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
2393         * page/Quirks.h:
2394
2395 2019-03-12  Justin Fan  <justin_fan@apple.com>
2396
2397         [Web GPU] Update GPURenderPipelineDescriptor and add GPUColorStateDescriptor.format
2398         https://bugs.webkit.org/show_bug.cgi?id=195518
2399         <rdar://problem/46322356>
2400
2401         Reviewed by Myles C. Maxfield.
2402
2403         Upgrade the implementation of GPURenderPipelineDescriptor and GPURenderPipeline and match the updated Web GPU API.
2404         Add stubs for GPUColorStateDescriptor so attachment format can be provided by GPURenderPipelineDescriptor.
2405
2406         All affected Web GPU tests updated to cover existing behavior.
2407
2408         Update file names and symbols:
2409         * CMakeLists.txt:
2410         * DerivedSources-input.xcfilelist:
2411         * DerivedSources-output.xcfilelist:
2412         * DerivedSources.make:
2413         * Sources.txt:
2414         * WebCore.xcodeproj/project.pbxproj:
2415         * bindings/js/WebCoreBuiltinNames.h:
2416
2417         Updates to GPURenderPipeline, GPURenderPipelineDescriptor, and its components:
2418         * Modules/webgpu/GPUColorStateDescriptor.idl: Added. Provide the expected texture format of the render pipeline's color attachments.
2419         * Modules/webgpu/GPUInputStateDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUInputStateDescriptor.idl.
2420         * Modules/webgpu/GPUTextureFormat.idl: Update the existing values to match the new style.
2421         * Modules/webgpu/GPUVertexAttributeDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexAttributeDescriptor.idl.
2422         * Modules/webgpu/GPUVertexInputDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexInputDescriptor.idl.
2423         * Modules/webgpu/WebGPUDevice.cpp:
2424         (WebCore::WebGPUDevice::createPipelineLayout const): Remove unnecessary comment.
2425         (WebCore::WebGPUDevice::createRenderPipeline const): Descriptor validation and conversion moved into WebGPURenderPipelineDescriptor.
2426         (WebCore::validateAndConvertPipelineStage): Deleted.
2427         * Modules/webgpu/WebGPUDevice.h: create* functions should not return nullable.
2428         * Modules/webgpu/WebGPUIndexFormat.h: Removed. Moved into GPUInputStateDescriptor.idl.
2429         * Modules/webgpu/WebGPUInputStateDescriptor.h: Removed.
2430         * Modules/webgpu/WebGPUInputStepMode.idl: Removed. Moved into GPUVertexInputDescriptor.idl.
2431         * Modules/webgpu/WebGPUPipelineLayout.h:
2432         (WebCore::WebGPUPipelineLayout::pipelineLayout): Getters should return raw references.
2433         * Modules/webgpu/WebGPUPipelineStageDescriptor.h: Now shares a common base with GPUPipelineStageDescriptor.
2434         * Modules/webgpu/WebGPURenderPipeline.cpp:
2435         (WebCore::WebGPURenderPipeline::create):
2436         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
2437         * Modules/webgpu/WebGPURenderPipeline.h:  Now internally nullable.
2438         (WebCore::WebGPURenderPipeline::renderPipeline const):
2439         (WebCore::WebGPURenderPipeline::renderPipeline): Deleted.
2440         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
2441         (WebCore::WebGPUPipelineStageDescriptor::asGPUPipelineStageDescriptor const): Validate and convert a WebGPUPipelineStageDescriptor to GPU version.
2442         (WebCore::WebGPURenderPipelineDescriptor::asGPURenderPipelineDescriptor const): Ditto for WebGPURenderPipelineDescriptor.
2443         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Now shares a base class and some instance variables with GPURenderPipelineDescriptor.
2444         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Update GPUPrimitiveTopology for new style and add colorStates.
2445         * Modules/webgpu/WebGPUShaderModule.idl: Small pilot to test using InterfaceName to easily rename DOM-facing interfaces.
2446         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Removed.
2447         * Modules/webgpu/WebGPUVertexFormat.idl: Removed. Moved and updated in GPUVertexAttributeDescriptor.idl.
2448         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Removed.
2449         * platform/graphics/gpu/GPUInputStateDescriptor.h:
2450         * platform/graphics/gpu/GPUPipelineStageDescriptor.h:
2451         (WebCore::GPUPipelineStageDescriptor::GPUPipelineStageDescriptor):
2452         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Add shared base class for Web/GPURenderPipelineDescriptor.
2453         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
2454         * platform/graphics/gpu/GPUTextureFormat.h:
2455         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
2456         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
2457         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2458         (WebCore::setFunctionsForPipelineDescriptor): Make fragment required since descriptor validation fails if fragment function is not found right now.
2459         (WebCore::mtlVertexFormatForGPUVertexFormat): Renamed from validateAndConvertVertexFormatToMTLVertexFormat.
2460         (WebCore::mtlStepFunctionForGPUInputStepMode): Renamed from validateAndConvertStepModeToMTLStepFunction
2461         (WebCore::trySetInputStateForPipelineDescriptor):
2462         (WebCore::trySetColorStatesForColorAttachmentArray):
2463         (WebCore::tryCreateMtlRenderPipelineState):
2464         (WebCore::GPURenderPipeline::create):
2465         (WebCore::validateAndConvertVertexFormatToMTLVertexFormat): Deleted.
2466         (WebCore::validateAndConvertStepModeToMTLStepFunction): Deleted.
2467         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
2468         (WebCore::platformTextureFormatForGPUTextureFormat):
2469         * platform/graphics/gpu/GPUColorStateDescriptor.h: Added.
2470
2471         Misc:
2472         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2473         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
2474         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2475         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2476         * platform/graphics/gpu/GPURenderPassEncoder.h:
2477         * platform/graphics/gpu/GPURenderPipeline.h:
2478         (WebCore::GPURenderPipeline::primitiveTopology const):
2479         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2480         (WebCore::GPURenderPassEncoder::setPipeline):
2481         (WebCore::primitiveTypeForGPUPrimitiveTopology):
2482        
2483 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2484
2485         [ContentChangeObserver] Reset state when touchStart does not turn into click.
2486         https://bugs.webkit.org/show_bug.cgi?id=195603
2487         <rdar://problem/48796582>
2488
2489         Reviewed by Simon Fraser.
2490
2491         Add reset() function to assert and reset the current state.
2492
2493         * page/ios/ContentChangeObserver.cpp:
2494         (WebCore::ContentChangeObserver::willNotProceedWithClick):
2495         (WebCore::ContentChangeObserver::adjustObservedState):
2496         * page/ios/ContentChangeObserver.h:
2497
2498 2019-03-12  Timothy Hatcher  <timothy@apple.com>
2499
2500         Expose document attributes and body background color through HTMLConverter.
2501         https://bugs.webkit.org/show_bug.cgi?id=195636
2502         rdar://problem/45055697
2503
2504         Reviewed by Tim Horton.
2505
2506         * editing/cocoa/HTMLConverter.h:
2507         * editing/cocoa/HTMLConverter.mm:
2508         (HTMLConverter::convert):
2509         (WebCore::attributedStringFromRange):
2510         (WebCore::attributedStringFromSelection):
2511         (WebCore::attributedStringBetweenStartAndEnd):
2512
2513 2019-03-12  Antti Koivisto  <antti@apple.com>
2514
2515         Compositing layer that renders two positioned elements should not hit test
2516         https://bugs.webkit.org/show_bug.cgi?id=195371
2517         <rdar://problem/48649586>
2518
2519         Reviewed by Simon Fraser.
2520
2521         Followup to fix the test case (fast/scrolling/ios/overflow-scroll-overlap-2.html)
2522
2523         * platform/graphics/ca/GraphicsLayerCA.cpp:
2524         (WebCore::GraphicsLayerCA::setEventRegion):
2525
2526         Revert a last minute change (that was done to fix a Mac displaylist test).
2527
2528         * rendering/RenderLayerBacking.cpp:
2529         (WebCore::RenderLayerBacking::paintIntoLayer):
2530
2531         Compute the region on iOS only for now (it is not used on other platforms).
2532
2533 2019-03-12  Dean Jackson  <dino@apple.com>
2534
2535         [WebGL] WebGLBuffer can be too large
2536         https://bugs.webkit.org/show_bug.cgi?id=195068
2537         <rdar://problem/48414289>
2538
2539         Reviewed by Antoine Quint.
2540
2541         When creating an element array buffer, make sure to
2542         test against the maximum size of an ArrayBuffer, rather
2543         than just assume it can be created.
2544
2545         Test: fast/canvas/webgl/largeBuffer.html
2546
2547         * html/canvas/WebGLBuffer.cpp:
2548         (WebCore::WebGLBuffer::associateBufferDataImpl):
2549
2550 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
2551
2552         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-*-event-exception.html are failing
2553         https://bugs.webkit.org/show_bug.cgi?id=195581
2554
2555         Reviewed by Brady Eidson.
2556
2557         Uncaught exceptions should be handled after IDBRequest dispatches events so that IDBTransaction would stay 
2558         active during event dispatch.
2559
2560         * Modules/indexeddb/IDBRequest.cpp:
2561         (WebCore::IDBRequest::dispatchEvent):
2562         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
2563         * Modules/indexeddb/IDBRequest.h:
2564
2565 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
2566
2567         Layout Test imported/w3c/web-platform-tests/IndexedDB/transaction-abort-request-error.html is failing
2568         https://bugs.webkit.org/show_bug.cgi?id=195570
2569
2570         Reviewed by Brady Eidson.
2571
2572         IDBRequest result should be undefined if it is never set.
2573
2574         * Modules/indexeddb/IDBRequest.cpp:
2575         (WebCore::IDBRequest::IDBRequest):
2576
2577 2019-03-12  Youenn Fablet  <youenn@apple.com>
2578
2579         Rename originsMatch in originSerializationsMatch
2580         https://bugs.webkit.org/show_bug.cgi?id=195572
2581
2582         Reviewed by Jiewen Tan.
2583
2584         In addition to renaming, make use of SecurityOrigin::isSameOriginAs
2585         where it makes more sense than to compare origin serialization.
2586         The main difference is that isSameOriginAs will return false for two different unique origins
2587         while originsSerializationsMatch will not.
2588
2589         * Modules/credentialmanagement/CredentialsContainer.cpp:
2590         (WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
2591         * Modules/mediastream/RTCController.cpp:
2592         (WebCore::matchDocumentOrigin):
2593         * Modules/mediastream/RTCPeerConnection.cpp:
2594         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
2595         * loader/DocumentLoader.cpp:
2596         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const):
2597         * loader/cache/CachedResourceLoader.cpp:
2598         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2599         * page/SecurityOrigin.cpp:
2600         (WebCore::serializedOriginsMatch):
2601         (WebCore::originsMatch): Deleted.
2602         * page/SecurityOrigin.h:
2603
2604 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2605
2606         [Synthetic Click] Dispatch mouseout soon after mouseup
2607         https://bugs.webkit.org/show_bug.cgi?id=195575
2608         <rdar://problem/47093049>
2609
2610         Reviewed by Simon Fraser.
2611
2612         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
2613
2614         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
2615
2616         * page/EventHandler.h:
2617         * page/ios/EventHandlerIOS.mm:
2618         (WebCore::EventHandler::dispatchFakeMouseOut):
2619
2620 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2621
2622         In CachedFrame's constructor, release-assert that DOMWindow still has a frame after page-caching subframes
2623         https://bugs.webkit.org/show_bug.cgi?id=195609
2624
2625         Reviewed by Chris Dumez.
2626
2627         r242677 added release assertions to DOMWindow::suspendForPageCache. But when the first release assert in
2628         that function is hit, we still can't tell whether active DOM objects are detaching frames, or if creating
2629         CachedFrame's on one of subframes is causing the frame to go way.
2630
2631         Add a release assertion immediately after creating CachedFrame on subframes to detect this case.
2632
2633         * history/CachedFrame.cpp:
2634         (WebCore::CachedFrame::CachedFrame):
2635
2636 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2637
2638         [ContentChangeObserver] Stop content change observation when the touch event turns into long press
2639         https://bugs.webkit.org/show_bug.cgi?id=195601
2640         <rdar://problem/48796324>
2641
2642         Reviewed by Wenson Hsieh.
2643
2644         Cancel the ongoing content observation (started at touchStart) when the touch event does not turn into a tap gesture.
2645
2646         Not testable because any subsequent tap would reset the state anyway (though it might be measurable through some code triggering heavy content change).
2647
2648         * page/ios/ContentChangeObserver.cpp:
2649         (WebCore::ContentChangeObserver::didRecognizeLongPress):
2650         (WebCore::ContentChangeObserver::willNotProceedWithClick):
2651         * page/ios/ContentChangeObserver.h:
2652
2653 2019-03-12  Antti Koivisto  <antti@apple.com>
2654
2655         Compositing layer that renders two positioned elements should not hit test
2656         https://bugs.webkit.org/show_bug.cgi?id=195371
2657         <rdar://problem/48649586>
2658
2659         Reviewed by Simon Fraser.
2660
2661         Compute and pass an event region for layers if it differs from layer bounds.
2662
2663         This patch fixes various block overflow and layer expansion cases. It does not handle
2664         overflowing line boxes yet (it adds tests for those too).
2665
2666         Test: fast/scrolling/ios/overflow-scroll-overlap-2.html
2667
2668         * platform/graphics/GraphicsLayer.cpp:
2669         (WebCore::GraphicsLayer::setEventRegion):
2670         * platform/graphics/GraphicsLayer.h:
2671         (WebCore::GraphicsLayer::eventRegion):
2672         * platform/graphics/Region.h:
2673         * platform/graphics/ca/GraphicsLayerCA.cpp:
2674         (WebCore::GraphicsLayerCA::setEventRegion):
2675         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2676         (WebCore::GraphicsLayerCA::updateEventRegion):
2677
2678         Pass the region via the main platform layer of the graphics layer.
2679
2680         * platform/graphics/ca/GraphicsLayerCA.h:
2681         * platform/graphics/ca/PlatformCALayer.h:
2682         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2683         * rendering/PaintInfo.h:
2684         * rendering/PaintPhase.h:
2685
2686         Add EventRegion paint phase that computes the region instead of painting anything.
2687
2688         * rendering/RenderBlock.cpp:
2689         (WebCore::RenderBlock::paintObject):
2690         * rendering/RenderLayer.cpp:
2691         (WebCore::RenderLayer::paintForegroundForFragments):
2692         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2693
2694         Invoke EventRegion paint phase.
2695
2696         * rendering/RenderLayer.h:
2697         * rendering/RenderLayerBacking.cpp:
2698         (WebCore::RenderLayerBacking::paintIntoLayer):
2699
2700         Request event region when pointing a layer.
2701
2702 2019-03-12  Philippe Normand  <pnormand@igalia.com>
2703
2704         [GStreamer][v4l2] Synchronous video texture flushing support
2705         https://bugs.webkit.org/show_bug.cgi?id=195453
2706
2707         Reviewed by Xabier Rodriguez-Calvar.
2708
2709         The v4l2 video decoder currently requires that downstream users of
2710         the graphics resources complete any pending draw call and release
2711         resources before returning from the DRAIN query.
2712
2713         To accomplish this the player monitors the pipeline and whenever a
2714         v4l2 decoder is added, synchronous video texture flushing support
2715         is enabled. Additionally and for all decoder configurations, a
2716         flush is performed before disposing of the player.
2717
2718         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2719         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
2720         Monitor elements added to the decodebin bin.
2721         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
2722         a flag if a v4l2 decoder was added in decodebin.
2723         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
2724         to the deep-element-added signal so as to monitor pipeline
2725         topology updates.
2726         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2727         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2728         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2729         Flush video texture before disposing of the player.
2730         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2731         Synchronously flush if the pipeline contains a v4l2 decoder.
2732         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
2733         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2734         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2735         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
2736         boolean flag used mostly to trigger synchronous flush conditions.
2737         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2738         Optionally drop the current buffer in a synchronous manner. By
2739         default the method keeps operating asynchronously.
2740         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2741
2742 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2743
2744         Move the remaining code to decide whether site specific quirks are needed to Quirks class
2745         https://bugs.webkit.org/show_bug.cgi?id=195610
2746
2747         Reviewed by Antti Koivisto.
2748
2749         Moved the remaining code scattered across WebCore to decide whether a site specific quirk
2750         is needed or not to Quirks class introduced in r236818.
2751
2752         * Modules/fetch/FetchRequest.cpp:
2753         (WebCore::needsSignalQuirk): Deleted.
2754         (WebCore::processInvalidSignal):
2755         * html/HTMLFormControlElement.cpp:
2756         (WebCore::HTMLFormControlElement::needsMouseFocusableQuirk const):
2757         * html/HTMLMediaElement.cpp:
2758         (WebCore::needsAutoplayPlayPauseEventsQuirk): Deleted.
2759         (WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
2760         (WebCore::needsSeekingSupportQuirk): Deleted.
2761         (WebCore::HTMLMediaElement::supportsSeeking const):
2762         * html/MediaElementSession.cpp:
2763         (WebCore::needsArbitraryUserGestureAutoplayQuirk): Deleted.
2764         (WebCore::needsPerDocumentAutoplayBehaviorQuirk): Deleted.
2765         (WebCore::MediaElementSession::playbackPermitted const):
2766         * page/Quirks.cpp:
2767         (WebCore::allowedAutoplayQuirks): Added.
2768         (WebCore::Quirks::needsQuirks const): Added.
2769         (WebCore::Quirks::shouldIgnoreInvalidSignal const): Added.
2770         (WebCore::Quirks::needsFormControlToBeMouseFocusable const): Added.
2771         (WebCore::Quirks::needsAutoplayPlayPauseEvents const): Added.
2772         (WebCore::Quirks::needsSeekingSupportDisabled const): Addd.
2773         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const): Added.
2774         (WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const): Added.
2775         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): Added.
2776         (WebCore::Quirks::hasWebSQLSupportQuirk const): Fixed the coding style.
2777         * page/Quirks.h:
2778
2779 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
2780
2781         [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed
2782         https://bugs.webkit.org/show_bug.cgi?id=195454
2783
2784         Reviewed by Jer Noble.
2785
2786         This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy"
2787         and "27. HFRPausedAccuracy".
2788
2789         The first timeUpdate event after play() is omitted, because currentTime
2790         doesn't actually change in that scenario.
2791
2792         Tests 26 and 27 measure the time drift (real time vs. media time) on playback
2793         and start counting since the first timeUpdate event. In WebKit, that event
2794         happens at play(), before the pipeline has completed the transition to playing.
2795         Therefore, the real time inherits this startup delay and the test thinks that
2796         the player has drifted.
2797
2798         * html/HTMLMediaElement.cpp:
2799         (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed.
2800
2801 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
2802
2803         [EME][GStreamer] Speculative build fix
2804         https://bugs.webkit.org/show_bug.cgi?id=195614
2805
2806         Unreviewed speculative WPE build fix after r242776.
2807
2808         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added missing include.
2809
2810 2019-03-12  Philippe Normand  <pnormand@igalia.com>
2811
2812         [GStreamer] remove legacy GStreamer version checks
2813         https://bugs.webkit.org/show_bug.cgi?id=195552
2814
2815         Reviewed by Xabier Rodriguez-Calvar.
2816
2817         We require GStreamer 1.8.x so version checks below that make
2818         little sense. Also checks for odd minor version numbers make sense
2819         only for the latest GStreamer git development version.
2820
2821         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2822         (WebCore::initializeGStreamerAndRegisterWebKitElements):
2823         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2824         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
2825         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2826         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2827         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2828
2829 2019-03-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2830
2831         [EME] generateRequest was not using the sanitized init data
2832         https://bugs.webkit.org/show_bug.cgi?id=195555
2833
2834         Reviewed by Jer Noble.
2835
2836         * Modules/encryptedmedia/MediaKeySession.cpp:
2837         (WebCore::MediaKeySession::generateRequest): Use sanitized init
2838         data instead of the original one.
2839
2840 2019-03-12  Rob Buis  <rbuis@igalia.com>
2841
2842         Implement further CORS restrictions
2843         https://bugs.webkit.org/show_bug.cgi?id=188644
2844
2845         Reviewed by Darin Adler.
2846
2847         Verify that header value length is not greater than 128 [1]. Also implement
2848         Step 5 of [2] to append values to existing header value when calling
2849         Headers.append.
2850
2851         Tests: fetch/api/cors/cors-preflight-not-cors-safelisted.any.html
2852                fetch/api/cors/cors-preflight-not-cors-safelisted.any.worker.html
2853                fetch/api/headers/headers-no-cors.window.html
2854
2855         [1] https://fetch.spec.whatwg.org/#cors-safelisted-request-header
2856         [2] https://fetch.spec.whatwg.org/#concept-headers-append
2857
2858         * Modules/fetch/FetchHeaders.cpp:
2859         (WebCore::canWriteHeader):
2860         (WebCore::appendToHeaderMap):
2861         (WebCore::FetchHeaders::remove):
2862         (WebCore::FetchHeaders::set):
2863         (WebCore::FetchHeaders::filterAndFill):
2864         * platform/network/HTTPParsers.cpp:
2865         (WebCore::isCrossOriginSafeRequestHeader): verify that header length is not greater than 128
2866
2867 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2868
2869         Remove OS X Server QuickTime plugin quirks
2870         https://bugs.webkit.org/show_bug.cgi?id=195607
2871
2872         Reviewed by Brent Fulgham.
2873
2874         r87244 added a site specific quirk for Mac OS X Sever wiki pages.
2875         However, the issue has since been resolved as of OS X Mountain Lion,
2876         of which Apple has ended the support in September 2015.
2877
2878         Because the latest versions of Safari no longer supports non-Flash plugins,
2879         the only scenario in which this quirk comes into play is when a third party app
2880         which embeds WKWebView or WebKitLegacy loaded web pages on a OS X Server
2881         running OS X Mountain Lion or earlier.
2882
2883         Given these observations, it's probably safe to remove this quirk from WebKit.
2884
2885         * html/HTMLObjectElement.cpp:
2886         (WebCore::HTMLObjectElement::hasFallbackContent const):
2887         (WebCore::HTMLObjectElement::hasValidClassId):
2888         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Deleted.
2889         * html/HTMLObjectElement.h:
2890
2891 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
2892
2893         Unreviewed speculative WPE build fix after r195586.
2894
2895         * platform/encryptedmedia/CDMInstance.h:
2896
2897 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2898
2899         Remove MediaWiki site specific quirks
2900         https://bugs.webkit.org/show_bug.cgi?id=195597
2901
2902         Reviewed by Simon Fraser.
2903
2904         r47383 added a site specific quirk for the KHTML workaround in MediaWiki.
2905
2906         Blink since removed this workaround:
2907         https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0
2908
2909         Given Chrome has been shipping without this quirk for six years, it's safe to assume
2910         this site specific quirk is no longer neeed for Web compatibility.
2911
2912         * css/StyleSheetContents.cpp:
2913         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2914         * css/parser/CSSParserContext.cpp:
2915         (WebCore::CSSParserContext::CSSParserContext):
2916         (WebCore::operator==):
2917         * css/parser/CSSParserContext.h:
2918         (WebCore::CSSParserContextHash::hash):
2919
2920 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2921
2922         Remove OpenCube QuickMenu quirks from navigator.appVersion
2923         https://bugs.webkit.org/show_bug.cgi?id=195600
2924
2925         Reviewed by Simon Fraser.
2926
2927         Remove the site specific quirk added in r35050 for OpenCube QuickMenu library for nwa.com
2928
2929         Blink removed this code back in 2013. The fact Chrome has been shipping successfully without
2930         this quirk for six years is a good evidence that it's no longer needed for the Web compatibility.
2931
2932         * page/Navigator.cpp:
2933         (WebCore::Navigator::appVersion const):
2934         (WebCore::shouldHideFourDot): Deleted.
2935
2936 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
2937
2938         Unreviewed, rolling out r242763.
2939
2940         Causes layout test crashes on iOS simulator
2941
2942         Reverted changeset:
2943
2944         "[Synthetic Click] Dispatch mouseout soon after mouseup"
2945         https://bugs.webkit.org/show_bug.cgi?id=195575
2946         https://trac.webkit.org/changeset/242763
2947
2948 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
2949
2950         Add Optional to Forward.h.
2951         https://bugs.webkit.org/show_bug.cgi?id=195586
2952
2953         Reviewed by Darin Adler.
2954
2955         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
2956         * Modules/encryptedmedia/MediaKeyStatusMap.h:
2957         * Modules/webauthn/apdu/ApduCommand.cpp:
2958         * Modules/webauthn/apdu/ApduCommand.h:
2959         * Modules/webauthn/apdu/ApduResponse.cpp:
2960         * Modules/webauthn/apdu/ApduResponse.h:
2961         * Modules/webauthn/fido/FidoHidMessage.cpp:
2962         * Modules/webauthn/fido/FidoHidMessage.h:
2963         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2964         * Modules/webauthn/fido/U2fCommandConstructor.h:
2965         * Modules/webdatabase/SQLTransaction.cpp:
2966         * Modules/webdatabase/SQLTransaction.h:
2967         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2968         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2969         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
2970         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2971         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
2972         * Modules/webgpu/WebGPU.cpp:
2973         * Modules/webgpu/WebGPU.h:
2974         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2975         * Modules/webgpu/WebGPUCommandBuffer.h:
2976         * animation/WebAnimation.cpp:
2977         * animation/WebAnimation.h:
2978         * crypto/gcrypt/GCryptUtilities.cpp:
2979         * crypto/gcrypt/GCryptUtilities.h:
2980         * css/CSSStyleDeclaration.cpp:
2981         * css/CSSStyleDeclaration.h:
2982         * dom/TextDecoder.cpp:
2983         * dom/TextDecoder.h:
2984         * dom/UserGestureIndicator.cpp:
2985         * dom/UserGestureIndicator.h:
2986         * editing/ChangeListTypeCommand.cpp:
2987         * editing/ChangeListTypeCommand.h:
2988         * editing/EditingStyle.cpp:
2989         * editing/EditingStyle.h:
2990         * html/DOMFormData.cpp:
2991         * html/DOMFormData.h:
2992         * html/HTMLAllCollection.cpp:
2993         * html/HTMLAllCollection.h:
2994         * html/HTMLAnchorElement.cpp:
2995         * html/HTMLAnchorElement.h:
2996         * html/ImageBitmap.cpp:
2997         * html/ImageBitmap.h:
2998         * html/canvas/Path2D.h:
2999         * html/canvas/WebMetalEnums.cpp:
3000         * html/canvas/WebMetalEnums.h:
3001         * html/parser/HTMLParserIdioms.cpp:
3002         * html/parser/HTMLParserIdioms.h:
3003         * loader/ResourceCryptographicDigest.cpp:
3004         * loader/ResourceCryptographicDigest.h:
3005         * mathml/MathMLOperatorDictionary.cpp:
3006         * mathml/MathMLOperatorDictionary.h:
3007         * page/PerformanceEntry.cpp:
3008         * page/PerformanceEntry.h:
3009         * page/ResourceUsageData.h:
3010         * platform/ReferrerPolicy.cpp:
3011         * platform/ReferrerPolicy.h:
3012         * platform/Theme.cpp:
3013         * platform/Theme.h:
3014         * platform/encryptedmedia/CDMInstance.h:
3015         * platform/graphics/gpu/GPUDevice.cpp:
3016         * platform/graphics/gpu/GPUDevice.h:
3017         * platform/graphics/transforms/AffineTransform.cpp:
3018         * platform/graphics/transforms/AffineTransform.h:
3019         * platform/graphics/transforms/TransformState.cpp:
3020         * platform/graphics/transforms/TransformState.h:
3021         * platform/graphics/transforms/TransformationMatrix.cpp:
3022         * platform/graphics/transforms/TransformationMatrix.h:
3023         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3024         * platform/graphics/win/ImageDecoderDirect2D.h:
3025         * platform/mediacapabilities/AudioConfiguration.h:
3026         * platform/network/CacheValidation.cpp:
3027         * platform/network/CacheValidation.h:
3028         * platform/network/DataURLDecoder.cpp:
3029         * platform/network/DataURLDecoder.h:
3030         * platform/network/HTTPParsers.cpp:
3031         * platform/network/HTTPParsers.h:
3032         * platform/network/curl/CookieJarDB.cpp:
3033         * platform/network/curl/CookieJarDB.h:
3034         * platform/win/SearchPopupMenuDB.cpp:
3035         * platform/win/SearchPopupMenuDB.h:
3036         * rendering/ImageQualityController.cpp:
3037         * rendering/ImageQualityController.h:
3038         * svg/SVGToOTFFontConversion.cpp:
3039         * svg/SVGToOTFFontConversion.h:
3040         Remove unnecessary includes from headers.
3041
3042 2019-03-11  Jer Noble  <jer.noble@apple.com>
3043
3044         REGRESSION(r236281): YouTube Movies fail with "video format" error
3045         https://bugs.webkit.org/show_bug.cgi?id=195598
3046         <rdar://problem/48782842>
3047
3048         Reviewed by Jon Lee.
3049
3050         Partially revert r236281 for YouTube.com.
3051
3052         * page/Quirks.cpp:
3053         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
3054
3055 2019-03-11  Justin Fan  <justin_fan@apple.com>
3056
3057         [Web GPU] BindGroups/Argument buffers: Move MTLBuffer creation from and GPUBindGroup validation to GPUDevice.createBindGroup
3058         https://bugs.webkit.org/show_bug.cgi?id=195519
3059         <rdar://problem/48781297>
3060
3061         Reviewed by Myles C. Maxfield.
3062
3063         Metal's Argument Buffers should not be tied directly to GPUBindGroupLayout; rather, create the MTLBuffer 
3064         in GPUBindGroup creation process.
3065         Move GPUBindGroup validation out of setBindGroup and to GPUBindGroup creation for performance.
3066
3067         Covered by existing tests. No behavior change.
3068
3069         * Modules/webgpu/WebGPUDevice.cpp:
3070         (WebCore::WebGPUDevice::createBindGroup const):
3071         * Sources.txt:
3072         * SourcesCocoa.txt:
3073         * WebCore.xcodeproj/project.pbxproj:
3074         * platform/graphics/gpu/GPUBindGroup.cpp: Removed.
3075         * platform/graphics/gpu/GPUBindGroup.h:
3076         (WebCore::GPUBindGroup::vertexArgsBuffer): A buffer that arguments will be encoded into during setBindGroup.
3077         (WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
3078         (WebCore::GPUBindGroup::boundBuffers const): A list of resources that are bound by this GPUBindGroup.
3079         (WebCore::GPUBindGroup::boundTextures const): Ditto.
3080         (WebCore::GPUBindGroup::layout const): Deleted.
3081         (WebCore::GPUBindGroup::bindings const): Deleted.
3082         * platform/graphics/gpu/GPUBindGroupLayout.h: No longer creating and retaining MTLBuffers.
3083         (WebCore::GPUBindGroupLayout::vertexEncoder const):
3084         (WebCore::GPUBindGroupLayout::fragmentEncoder const):
3085         (WebCore::GPUBindGroupLayout::computeEncoder const):
3086         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::isValid const): Deleted.
3087         (WebCore::GPUBindGroupLayout::vertexArguments const): Deleted.
3088         (WebCore::GPUBindGroupLayout::fragmentArguments const): Deleted.
3089         (WebCore::GPUBindGroupLayout::computeArguments const): Deleted.
3090         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
3091         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3092         (WebCore::tryCreateMtlArgumentEncoder):
3093         (WebCore::GPUBindGroupLayout::tryCreate):
3094         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
3095         (WebCore::tryCreateArgumentEncoderAndBuffer): Deleted.
3096         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Added.
3097         (WebCore::tryCreateArgumentBuffer): Create and associate the MTLBuffer that backs the MTLArgumentEncoder.
3098         (WebCore::tryGetResourceAsBufferBinding): Validate a GPUBindingResource.
3099         (WebCore::trySetBufferOnEncoder): Encodes a GPUBufferBinding's MTLBuffer on a MTLArgumentEncoder.
3100         (WebCore::tryGetResourceAsSampler): Ditto, for GPUSamplers.
3101         (WebCore::trySetSamplerOnEncoder):
3102         (WebCore::tryGetResourceAsTexture): Ditto, for GPUTextures.
3103         (WebCore::trySetTextureOnEncoder):
3104         (WebCore::GPUBindGroup::tryCreate): Most setBindGroup validation moved here.
3105         (WebCore::GPUBindGroup::GPUBindGroup): Retains the resource references needed for setBindGroup. 
3106         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
3107         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Most validation moved to GPUBindGroup::tryCreate().
3108         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Deleted.
3109         (WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Deleted.
3110         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder): Deleted.
3111         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3112         (WebCore::GPURenderPassEncoder::useResource):
3113         (WebCore::GPURenderPassEncoder::setVertexBuffer):
3114         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
3115
3116         Misc:
3117         * platform/graphics/gpu/GPUCommandBuffer.cpp/h: Move missing includes to header.
3118
3119 2019-03-11  Zalan Bujtas  <zalan@apple.com>
3120
3121         [Synthetic Click] Dispatch mouseout soon after mouseup
3122         https://bugs.webkit.org/show_bug.cgi?id=195575
3123         <rdar://problem/47093049>
3124
3125         Reviewed by Simon Fraser.
3126
3127         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
3128
3129         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
3130
3131         * page/EventHandler.h:
3132         * page/ios/EventHandlerIOS.mm:
3133         (WebCore::EventHandler::dispatchFakeMouseOut):
3134
3135 2019-03-11  Youenn Fablet  <youenn@apple.com>
3136
3137         REGRESSION: (r242181) API test DragAndDropTests.ExternalSourcePlainTextToIFrame is Timing out
3138         https://bugs.webkit.org/show_bug.cgi?id=195362
3139
3140         Reviewed by Alexey Proskuryakov.
3141
3142         Covered by API test no longer crashing.
3143
3144         * page/SecurityOrigin.cpp:
3145         (WebCore::originsMatch):
3146         String representation should only match if originsMatch returns true.
3147
3148 2019-03-11  Justin Fan  <justin_fan@apple.com>
3149
3150         [Web GPU] Update GPUSwapChainDescriptor, GPUSwapChain and implement GPUCanvasContext
3151         https://bugs.webkit.org/show_bug.cgi?id=194406
3152         <rdar://problem/47892466>
3153
3154         Reviewed by Myles C. Maxfield.
3155
3156         GPUSwapChain no longer inherits from GPUBasedRenderingContext, and is now created from a GPUDevice. 
3157         WebGPURenderingContext is now GPUCanvasContext and delegates functionality to the GPUSwapChain, if it exists. 
3158         GPUQueue now implicitly presents the GPUSwapChain's current drawable at the task boundary, if one exists.
3159         Creating a new GPUSwapChain with the same GPUCanvasContext invalidates the previous one and its drawable and pipeline attachments.
3160         Calling GPUSwapChain::getCurrentTexture returns the same drawable within one task cycle. 
3161         Some mentions of "WebGPU" have been renamed to "Web GPU" and "gpu".
3162
3163         All Web GPU tests updated to match.
3164
3165         Add new files and symbols.
3166         * CMakeLists.txt:
3167         * DerivedSources-input.xcfilelist:
3168         * DerivedSources-output.xcfilelist:
3169         * DerivedSources.make:
3170         * Sources.txt:
3171         * WebCore.xcodeproj/project.pbxproj:
3172         * bindings/js/WebCoreBuiltinNames.h:
3173
3174         Rename some mentions of "webgpu" to "gpu".
3175         * Modules/webgpu/DOMWindowWebGPU.cpp:
3176         (WebCore::DOMWindowWebGPU::gpu):
3177         (WebCore::DOMWindowWebGPU::gpu const):
3178         * Modules/webgpu/DOMWindowWebGPU.h:
3179         * Modules/webgpu/DOMWindowWebGPU.idl:
3180
3181         Replace WebGPURenderingContext with GPUCanvasContext.
3182         * Modules/webgpu/GPUCanvasContext.cpp: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.cpp.
3183         (WebCore::GPUCanvasContext::create):
3184         (WebCore::GPUCanvasContext::GPUCanvasContext):
3185         (WebCore::GPUCanvasContext::replaceSwapChain):
3186         (WebCore::GPUCanvasContext::platformLayer const):
3187         (WebCore::GPUCanvasContext::reshape):
3188         (WebCore::GPUCanvasContext::markLayerComposited):
3189         * Modules/webgpu/GPUCanvasContext.h: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.h.
3190         * Modules/webgpu/GPUCanvasContext.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.idl.
3191         * dom/Document.cpp:
3192         (WebCore::Document::getCSSCanvasContext):
3193         * dom/Document.h:
3194         * dom/Document.idl:
3195         * html/HTMLCanvasElement.cpp:
3196         (WebCore::HTMLCanvasElement::getContext):
3197         (WebCore::HTMLCanvasElement::isWebGPUType):
3198         (WebCore::HTMLCanvasElement::createContextWebGPU):
3199         (WebCore::HTMLCanvasElement::getContextWebGPU):
3200         * html/HTMLCanvasElement.h:
3201         * html/HTMLCanvasElement.idl:
3202         * inspector/InspectorCanvas.cpp:
3203         (WebCore::InspectorCanvas::buildObjectForCanvas):
3204         * inspector/agents/InspectorCanvasAgent.cpp:
3205         (WebCore::contextAsScriptValue):
3206
3207         Update WebGPUSwapChain.
3208         * Modules/webgpu/GPUTextureDescriptor.idl:
3209         * Modules/webgpu/GPUTextureFormat.idl: Add the other two texture formats supported by CAMetalLayer.
3210         * Modules/webgpu/WebGPUDevice.cpp: Implement createSwapChain.
3211         (WebCore::WebGPUDevice::createSwapChain const):
3212         (WebCore::WebGPUDevice::getQueue const):
3213         (WebCore::WebGPUDevice::getQueue): Deleted.
3214         * Modules/webgpu/WebGPUDevice.h:
3215         * Modules/webgpu/WebGPUDevice.idl:
3216         * Modules/webgpu/WebGPUSwapChain.cpp:
3217         (WebCore::WebGPUSwapChain::create):
3218         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
3219         (WebCore::WebGPUSwapChain::getCurrentTexture): Renamed from getNextTexture. Only returns the next drawable if the last was presented.
3220         (WebCore::WebGPUSwapChain::destroy): Invalidate this GPUSwapChain and its textures and views.
3221         (WebCore::WebGPUSwapChain::configure): Deleted.
3222         (WebCore::WebGPUSwapChain::getNextTexture): Deleted.
3223         (WebCore::WebGPUSwapChain::present): Deleted.
3224         (WebCore::WebGPUSwapChain::reshape): Deleted.
3225         (WebCore::WebGPUSwapChain::markLayerComposited): Deleted.
3226         * Modules/webgpu/WebGPUSwapChain.h: Now a device-based object rather than a rendering context.
3227         (WebCore::WebGPUSwapChain::swapChain const):
3228         (WebCore::WebGPUSwapChain::WebGPUSwapChain): Deleted.
3229         * Modules/webgpu/WebGPUSwapChain.idl:
3230         * Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
3231         * platform/graphics/gpu/GPUDevice.cpp: Implement tryCreateSwapChain.
3232         (WebCore::GPUDevice::tryCreateSwapChain const):
3233         (WebCore::GPUDevice::getQueue const):
3234         (WebCore::GPUDevice::getQueue): Deleted.
3235         * platform/graphics/gpu/GPUDevice.h: Retain a reference to the current GPUSwapChain, if one exists.
3236         (WebCore::GPUDevice::swapChain const):
3237         * platform/graphics/gpu/GPUQueue.h:
3238         * platform/graphics/gpu/GPUSwapChain.h:
3239         (WebCore::GPUSwapChain::destroy):
3240         * platform/graphics/gpu/GPUSwapChainDescriptor.h: Added.
3241         * platform/graphics/gpu/GPUTextureFormat.h: Add the other two texture formats supported by CAMetalLayer.
3242         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3243         (WebCore::GPUBuffer::commandBufferCommitted):
3244         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3245         (WebCore::GPUQueue::tryCreate): Renamed from create to better fit functionality. Now retain a reference to the GPUDevice.
3246         (WebCore::GPUQueue::GPUQueue):
3247         (WebCore::GPUQueue::submit): Now checks state of all resources before marking them as committed or committing any resource.
3248                 In addition, schedules the current drawable to be presented after all commands have been submitted during this task cycle.
3249         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3250         (WebCore::useAttachments): Ensure that the command buffer is aware of any texture resources used as attachments.
3251         (WebCore::GPURenderPassEncoder::tryCreate):
3252         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
3253         (WebCore::tryGetSupportedPixelFormat): Supported texture formats are the intersection of Web GPU's texture formats and CAMetalLayer's.
3254         (WebCore::setLayerShape):
3255         (WebCore::tryCreateSwapLayer): Create and configure the CAMetalLayer backing the swap chain.
3256         (WebCore::GPUSwapChain::tryCreate):
3257         (WebCore::GPUSwapChain::GPUSwapChain):
3258         (WebCore::GPUSwapChain::tryGetCurrentTexture): Renamed from getNextTexture. Only returns a texture if the last one was presented.
3259         (WebCore::GPUSwapChain::present):
3260         (WebCore::GPUSwapChain::reshape):
3261         (WebCore::GPUSwapChain::takeDrawable): Swaps out the current drawable so that it can be presented. The GPUSwapChain thus releases its reference to it.
3262         (WebCore::GPUSwapChain::create): Deleted.
3263         (WebCore::GPUSwapChain::setDevice): Deleted.
3264         (WebCore::GPUSwapChain::setFormat): Deleted.
3265         (WebCore::GPUSwapChain::getNextTexture): Deleted.
3266         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
3267         (WebCore::platformTextureFormatForGPUTextureFormat):
3268
3269         Misc:
3270         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Missing include.
3271
3272 2019-03-11  Chris Dumez  <cdumez@apple.com>
3273
3274         Update device orientation & motion permission native SPI as per latest proposal
3275         https://bugs.webkit.org/show_bug.cgi?id=195567
3276
3277         Reviewed by Youenn Fablet.
3278
3279         * dom/DeviceOrientationAndMotionAccessController.cpp:
3280         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
3281         * page/ChromeClient.h:
3282
3283 2019-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3284
3285         [macOS] Dispatching reentrant "contextmenu" events may cause crashes
3286         https://bugs.webkit.org/show_bug.cgi?id=195571
3287         <rdar://problem/48086046>
3288
3289         Reviewed by Andy Estes.
3290
3291         Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag.
3292         As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a
3293         synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as
3294         a result of handling a context menu event.
3295
3296         Test: fast/events/contextmenu-reentrancy-crash.html
3297
3298         * page/ContextMenuController.cpp:
3299         (WebCore::ContextMenuController::handleContextMenuEvent):
3300         * page/ContextMenuController.h:
3301
3302 2019-03-11  Andy Estes  <aestes@apple.com>
3303
3304         [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
3305         https://bugs.webkit.org/show_bug.cgi?id=195530
3306         <rdar://problem/48747164>
3307
3308         Reviewed by Alex Christensen.
3309
3310         * Modules/applepay/PaymentCoordinatorClient.h: Defined isWebPaymentCoordinator.
3311         * page/Settings.yaml: Defined the applePayRemoteUIEnabled setting and reordered the other
3312         Apple Pay settings.
3313
3314 2019-03-11  Alex Christensen  <achristensen@webkit.org>
3315
3316         Soft linking to Reveal framework should be optional
3317         https://bugs.webkit.org/show_bug.cgi?id=195576
3318         <rdar://problem/46822452>
3319
3320         Reviewed by Megan Gardner.
3321
3322         Systems exist with ENABLE(REVEAL) true and the Reveal framework does not exist.
3323
3324         * editing/cocoa/DictionaryLookup.mm:
3325         (WebCore::showPopupOrCreateAnimationController):
3326
3327 2019-03-11  Yusuke Suzuki  <ysuzuki@apple.com>
3328
3329         [JSC] Reduce # of structures in JSGlobalObject initialization
3330         https://bugs.webkit.org/show_bug.cgi?id=195498
3331
3332         Reviewed by Darin Adler.
3333
3334         * bindings/js/SerializedScriptValue.cpp:
3335         (WebCore::CloneSerializer::serialize):
3336
3337 2019-03-11  Brent Fulgham  <bfulgham@apple.com>
3338
3339         Remove obsolete runtime flag for StorageAccess API Prompt
3340         https://bugs.webkit.org/show_bug.cgi?id=195564
3341         <rdar://problem/37279014>
3342
3343         Reviewed by Chris Dumez.
3344
3345         This bug tracks the work of removing the obsolete flag that had been used to optionally
3346         prevent display of the StorageAccess API prompt. We have since shipped the final version
3347         of this feature with an always-on prompt, and should have removed this runtime flag.
3348
3349         No test changes because this has no change in behavior. Tests already assume the prompt
3350         behavior, and did not test turning the flag off.
3351
3352         * page/RuntimeEnabledFeatures.h:
3353         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled): Deleted.
3354         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const): Deleted.
3355         * testing/InternalSettings.cpp:
3356         (WebCore::InternalSettings::Backup::Backup):
3357         (WebCore::InternalSettings::Backup::restoreTo):
3358         (WebCore::InternalSettings::setStorageAccessPromptsEnabled): Deleted.
3359         * testing/InternalSettings.h:
3360         (): Deleted.
3361         * testing/InternalSettings.idl:
3362
3363 2019-03-11  Eric Carlson  <eric.carlson@apple.com>
3364
3365         Add web audio release logging
3366         https://bugs.webkit.org/show_bug.cgi?id=195554
3367         <rdar://problem/48767211>
3368
3369         Reviewed by Jer Noble.
3370
3371         No new tests, no functional change.
3372
3373         * Modules/webaudio/AudioBasicInspectorNode.cpp:
3374         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
3375         * Modules/webaudio/AudioBufferSourceNode.cpp:
3376         (WebCore::AudioBufferSourceNode::setBuffer):
3377         (WebCore::AudioBufferSourceNode::startPlaying):
3378         * Modules/webaudio/AudioContext.cpp:
3379         (WebCore::nextLogIdentifier):
3380         (WebCore::AudioContext::AudioContext):
3381         (WebCore::AudioContext::uninitialize):
3382         (WebCore::AudioContext::stop):
3383         (WebCore::AudioContext::createBufferSource):
3384         (WebCore::AudioContext::createMediaElementSource):
3385         (WebCore::AudioContext::createMediaStreamSource):
3386         (WebCore::AudioContext::createScriptProcessor):
3387         (WebCore::AudioContext::createBiquadFilter):
3388         (WebCore::AudioContext::createWaveShaper):
3389         (WebCore::AudioContext::createPanner):
3390         (WebCore::AudioContext::createConvolver):
3391         (WebCore::AudioContext::createDynamicsCompressor):
3392         (WebCore::AudioContext::createAnalyser):
3393         (WebCore::AudioContext::createGain):
3394         (WebCore::AudioContext::createDelay):
3395         (WebCore::AudioContext::createChannelSplitter):
3396         (WebCore::AudioContext::createChannelMerger):
3397         (WebCore::AudioContext::