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