Cache API and IDB space usages should be initialized on first quota check
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-21  Youenn Fablet  <youenn@apple.com>
2
3         Cache API and IDB space usages should be initialized on first quota check
4         https://bugs.webkit.org/show_bug.cgi?id=195707
5
6         Reviewed by Chris Dumez.
7
8         Add a way to require IDBServer to create a quota user for a given origin.
9         Make sure that removing a user might kick-in processing of pending requests.
10         In the case of processing pending requests, we should not decide on the first task
11         except if it is triggered by a request space response.
12         Update processPendingRequests accordingly.
13
14         Tests: http/tests/IndexedDB/storage-limit-1.https.html
15                http/tests/IndexedDB/storage-limit-2.https.html
16
17         * Modules/indexeddb/server/IDBServer.h:
18         (WebCore::IDBServer::IDBServer::initializeQuotaUser):
19         * storage/StorageQuotaManager.cpp:
20         (WebCore::StorageQuotaManager::removeUser):
21         (WebCore::StorageQuotaManager::askForMoreSpace):
22         (WebCore::StorageQuotaManager::processPendingRequests):
23         * storage/StorageQuotaManager.h:
24
25 2019-03-21  Alex Christensen  <achristensen@webkit.org>
26
27         Fix iOS build after r243337
28         https://bugs.webkit.org/show_bug.cgi?id=195935
29
30         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
31         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
32         (WebCore::playbackSessionModel const): Deleted.
33
34 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
35
36         Hardening: Use WeakPtrs in PlaybackSessionInterface{Mac,AVKit}
37         https://bugs.webkit.org/show_bug.cgi?id=195935
38         <rdar://problem/49007015>
39
40         Reviewed by Eric Carlson.
41
42         The PlaybackSessionInterface{Mac,AVKit} implementations store their playback session model
43         and playback controls manager members as bare pointers, something we've been working
44         to eliminate.
45         
46         This patch corrects this oversight.
47
48         No new tests since no changes in behavior.
49
50         * platform/cocoa/PlaybackSessionModel.h:
51         * platform/ios/PlaybackSessionInterfaceAVKit.h:
52         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
53         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
54         (WebCore::playbackSessionModel const): Moved to implementation since WEBCORE_EXPORT is not
55         supposed to be used with inline methods.
56         * platform/mac/PlaybackSessionInterfaceMac.h:
57         * platform/mac/PlaybackSessionInterfaceMac.mm:
58         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
59         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
60         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
61         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
62         (WebCore::PlaybackSessionInterfaceMac::playBackControlsManager):
63         * platform/mac/VideoFullscreenInterfaceMac.mm:
64         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
65         * platform/mac/WebPlaybackControlsManager.mm:
66         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
67         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
68         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
69
70 2019-03-21  Said Abou-Hallawa  <said@apple.com>
71
72         Remove the SVG tear off objects for SVGPoint, SVGPointList and SVGAnimatedPointList
73         https://bugs.webkit.org/show_bug.cgi?id=195905
74
75         Reviewed by Simon Fraser.
76
77         To remove the SVG tear off objects for SVGPoint, SVGPointList and 
78         SVGAnimatedPointList, these changes are needed:
79
80         -- Define SVGPoint to be a superclass of SVGValueProperty<FloatPoint>.
81
82         -- Define SVGAnimatedPointList to be a superclass of SVGAnimatedPropertyList<SVGPointList>
83
84         -- Add SVGPropertyList which is a superclass of SVGList. Its items are
85            defined to RefCounted. It is the base class of SVGValuePropertyList
86            and it will be  the base class of SVGPathSegList in a later patch.
87
88         -- Add SVGValuePropertyList which is the base class of all the lists whose
89            items are backed by a value objects like SVGPoint. The difference between
90            SVGPropertyList and SVGValuePropertyList is the former class can store
91            a Ref pointer of the base class like SVGPathSeg while the later type
92            has to store the same type for all the items.
93
94         -- Add SVGAnimatedPropertyList which is the base class for all the animated
95            lists. Note that:
96            1) SVGElement owns SVGAnimatedPropertyList
97            2) SVGAnimatedPropertyList owns m_baseVal whose type is SVGList
98            3) m_baseVal owns the items whose type is a superclass of SVGProperty.
99            When changing an item, it calls its owner which is an SVGList.
100            SVGList calls its owner which is SVGAnimatedPropertyList.
101            SVGAnimatedPropertyList calls its owner which SVGElement to commit
102            the change. Later SVGAnimatedPropertyList::synchronize() is called 
103            which returns the property valueAsString() to update the reflecting
104            attribute.
105
106         -- New accessor, animator and animation function are added to access
107            and animate a member of type SVGAnimatedPropertyList.
108
109         * Sources.txt:
110         * WebCore.xcodeproj/project.pbxproj:
111         * rendering/svg/SVGPathData.cpp:
112         (WebCore::pathFromCircleElement):
113         (WebCore::pathFromEllipseElement):
114         (WebCore::pathFromLineElement):
115         (WebCore::pathFromPathElement):
116         (WebCore::pathFromPolygonElement):
117         (WebCore::pathFromPolylineElement):
118         (WebCore::pathFromRectElement):
119         (WebCore::pathFromGraphicsElement):
120         * rendering/svg/SVGPathData.h:
121         The IDL of SVGPolyElement interface requires the following attribute:
122             readonly attribute SVGPointList points;
123         For which we return:
124             SVGPointList& points() { return m_points->baseVal(); }
125         But for all the other properties we return the currentValue(). So to have
126         the two functions with the same name, the following function is added:
127             const SVGPointList& points() const { return m_points->currentValue(); }
128         This definition requires changing all callers to be const.
129
130         * rendering/svg/SVGRenderTreeAsText.cpp:
131         (WebCore::operator<<):
132         * svg/SVGAnimatedPointList.cpp: Removed.
133         * svg/SVGAnimatedPointList.h: Removed.
134         * svg/SVGAnimatedType.h:
135         (WebCore::SVGAnimatedType::type const):
136         This function had a bad design. It was designed to use the index of the
137         variant as the AnimatedPropertyType. But when some of the types are removed
138         from SVGValueVariant, this broke things. This fix is temporary till the 
139         class SVGValueVariant is removed.
140
141         * svg/SVGAnimatorFactory.h:
142         (WebCore::SVGAnimatorFactory::create):
143         * svg/SVGExternalResourcesRequired.cpp:
144         * svg/SVGParserUtilities.cpp:
145         (WebCore::pointsListFromSVGData): Deleted.
146         * svg/SVGParserUtilities.h:
147         * svg/SVGPoint.h:
148         (WebCore::SVGPoint::create):
149         (WebCore::SVGPoint::clone const):
150         (WebCore::SVGPoint::x):
151         (WebCore::SVGPoint::setX):
152         (WebCore::SVGPoint::y):
153         (WebCore::SVGPoint::setY):
154         (WebCore::SVGPoint::matrixTransform const):
155         (WebCore::SVGPoint::matrixTransform): Deleted.
156         (WebCore::SVGPoint::SVGPoint): Deleted.
157         * svg/SVGPoint.idl:
158         matrixTransform() should not throw an exception.
159
160         * svg/SVGPointList.h:
161         (WebCore::SVGPointList::create):
162         (WebCore::SVGPointList::parse):
163         (WebCore::SVGPointList::SVGPointList): Deleted.
164         Move the parse() and valueAsString() methods to SVGPointList. It is now
165         a superclass of SVGValuePropertyList. Its items are of type Ref<SVGPoint>.
166
167         * svg/SVGPointListValues.cpp: Removed.
168         * svg/SVGPointListValues.h: Removed.
169         * svg/SVGPolyElement.cpp:
170         (WebCore::SVGPolyElement::SVGPolyElement):
171         (WebCore::SVGPolyElement::parseAttribute):
172         (WebCore::SVGPolyElement::approximateMemoryCost const):
173         (WebCore::SVGPolyElement::registerAttributes): Deleted.
174         (WebCore::SVGPolyElement::points): Deleted.
175         (WebCore::SVGPolyElement::animatedPoints): Deleted.
176         * svg/SVGPolyElement.h:
177         (WebCore::SVGPolyElement::points const):
178         (WebCore::SVGPolyElement::points):
179         (WebCore::SVGPolyElement::animatedPoints):
180         (WebCore::SVGPolyElement::pointList const): Deleted.
181         (WebCore::SVGPolyElement::attributeRegistry): Deleted.
182         * svg/SVGSVGElement.cpp:
183         (WebCore::SVGSVGElement::setCurrentTranslate):
184         (WebCore::SVGSVGElement::currentTranslate): Deleted.
185         * svg/SVGSVGElement.h:
186         * svg/SVGSVGElement.idl:
187         Define currentTranslate property to be of type Ref<SVGPoint>. When requesting
188         it just return a reference to it.
189
190         * svg/SVGValue.h:
191         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
192         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
193         * svg/properties/SVGAnimatedPropertyImpl.h:
194         * svg/properties/SVGAnimatedPropertyList.h: Added.
195         Define the accessor, the animator and the animated type of SVGPointList.
196
197         (WebCore::SVGAnimatedPropertyList::create):
198         (WebCore::SVGAnimatedPropertyList::~SVGAnimatedPropertyList):
199         (WebCore::SVGAnimatedPropertyList::baseVal const):
200         (WebCore::SVGAnimatedPropertyList::baseVal):
201         (WebCore::SVGAnimatedPropertyList::animVal const):
202         (WebCore::SVGAnimatedPropertyList::animVal):
203         (WebCore::SVGAnimatedPropertyList::currentValue const):
204         (WebCore::SVGAnimatedPropertyList::SVGAnimatedPropertyList):
205         (WebCore::SVGAnimatedPropertyList::ensureAnimVal):
206         * svg/properties/SVGAnimationAdditiveListFunction.h: Added.
207         (WebCore::SVGAnimationAdditiveListFunction::SVGAnimationAdditiveListFunction):
208         (WebCore::SVGAnimationAdditiveListFunction::toAtEndOfDuration const):
209         (WebCore::SVGAnimationAdditiveListFunction::adjustAnimatedList):
210         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: Added.
211         (WebCore::SVGAnimationPointListFunction::progress):
212         Define the animation function for animating SVGPointList.
213
214         * svg/properties/SVGAttributeRegistry.h:
215         * svg/properties/SVGPropertyList.h: Added.
216         (WebCore::SVGPropertyList::SVGPropertyList):
217         (WebCore::SVGPropertyList::~SVGPropertyList):
218         * svg/properties/SVGPropertyOwnerRegistry.h:
219         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
220         * svg/properties/SVGValuePropertyList.h: Added.
221         (WebCore::SVGValuePropertyList::operator=):
222         (WebCore::SVGValuePropertyList::operator Vector<typename PropertyType::ValueType> const):
223         (WebCore::SVGValuePropertyList::resize):
224         (WebCore::SVGValuePropertyList::SVGValuePropertyList):
225
226 2019-03-21  Said Abou-Hallawa  <said@apple.com>
227
228         Remove the SVG property tear off objects for SVGAnimatedString
229         https://bugs.webkit.org/show_bug.cgi?id=196065
230
231         Reviewed by Simon Fraser.
232
233         -- Define SVGAnimatedString to be SVGAnimatedPrimitiveProperty<String>.
234
235         -- Add SVGAnimatedStringAccessor to associate an attribute name with a 
236            pointer to an SVGAnimatedString member of an SVGElement. Given a 
237            pointer to an SVGElement, this accessor will and create an animator
238            for the animated property.
239
240         -- Add SVGAnimatedStringAnimator to animated an SVGAnimatedString.
241
242         -- Add SVGAnimationStringFunction which is a discrete function and is 
243            responsible for progressing an animated String over a period of time.
244
245         -- Define SVGStringAnimator to be SVGPrimitivePropertyAnimator<String,
246            SVGAnimationStringFunction>. SVGStringAnimator is responsible for
247            animating attributes with no reflecting animated properties, e.g.
248            "font-family".
249
250         * Sources.txt:
251         * WebCore.xcodeproj/project.pbxproj:
252         * svg/SVGAElement.cpp:
253         (WebCore::SVGAElement::SVGAElement):
254         (WebCore::SVGAElement::parseAttribute):
255         (WebCore::SVGAElement::registerAttributes): Deleted.
256         * svg/SVGAElement.h:
257         * svg/SVGAnimateElementBase.cpp:
258         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
259         (WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
260         * svg/SVGAnimateElementBase.h:
261         * svg/SVGAnimatedString.cpp: Removed.
262         * svg/SVGAnimatedString.h: Removed.
263         * svg/SVGAnimationElement.cpp:
264         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
265         The animation controller has to tell whether the animator is discrete or
266         not. The properties are now registered either in SVGAttributeRegistry which
267         relies on the tear off objects to know the AnimatedPropertyType of the
268         property. Or it is registered in SVGPropertyOwnerRegistry which creates
269         the animators through the accessors. Each animator knows whether it is
270         discrete or not.
271
272         * svg/SVGAnimatorFactory.h:
273         (WebCore::SVGAnimatorFactory::create):
274         * svg/SVGAttributeAnimationController.cpp:
275         (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
276         * svg/SVGAttributeAnimationController.h:
277         * svg/SVGAttributeAnimationControllerBase.h:
278         * svg/SVGCursorElement.h:
279         * svg/SVGElement.cpp:
280         (WebCore::SVGElement::SVGElement):
281         (WebCore::SVGElement::parseAttribute):
282         (WebCore::SVGElement::registerAttributes): Deleted.
283         * svg/SVGElement.h:
284         (WebCore::SVGElement::isKnownAttribute):
285         (WebCore::SVGElement::className const):
286         (WebCore::SVGElement::classNameAnimated):
287         (WebCore::SVGElement::attributeRegistry): Deleted.
288         * svg/SVGExternalResourcesRequired.cpp:
289         * svg/SVGFEBlendElement.cpp:
290         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
291         (WebCore::SVGFEBlendElement::registerAttributes):
292         (WebCore::SVGFEBlendElement::parseAttribute):
293         * svg/SVGFEBlendElement.h:
294         * svg/SVGFEColorMatrixElement.cpp:
295         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
296         (WebCore::SVGFEColorMatrixElement::registerAttributes):
297         (WebCore::SVGFEColorMatrixElement::parseAttribute):
298         * svg/SVGFEColorMatrixElement.h:
299         * svg/SVGFEComponentTransferElement.cpp:
300         (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
301         (WebCore::SVGFEComponentTransferElement::parseAttribute):
302         (WebCore::SVGFEComponentTransferElement::registerAttributes): Deleted.
303         * svg/SVGFEComponentTransferElement.h:
304         * svg/SVGFECompositeElement.cpp:
305         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
306         (WebCore::SVGFECompositeElement::registerAttributes):
307         (WebCore::SVGFECompositeElement::parseAttribute):
308         * svg/SVGFECompositeElement.h:
309         * svg/SVGFEConvolveMatrixElement.cpp:
310         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
311         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
312         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
313         * svg/SVGFEConvolveMatrixElement.h:
314         * svg/SVGFEDiffuseLightingElement.cpp:
315         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
316         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
317         (WebCore::SVGFEDiffuseLightingElement::registerAttributes): Deleted.
318         * svg/SVGFEDiffuseLightingElement.h:
319         * svg/SVGFEDisplacementMapElement.cpp:
320         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
321         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
322         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
323         * svg/SVGFEDisplacementMapElement.h:
324         * svg/SVGFEDropShadowElement.cpp:
325         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
326         (WebCore::SVGFEDropShadowElement::parseAttribute):
327         (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
328         (WebCore::SVGFEDropShadowElement::registerAttributes): Deleted.
329         * svg/SVGFEDropShadowElement.h:
330         * svg/SVGFEGaussianBlurElement.cpp:
331         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
332         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
333         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
334         * svg/SVGFEGaussianBlurElement.h:
335         * svg/SVGFEMergeNodeElement.cpp:
336         (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
337         (WebCore::SVGFEMergeNodeElement::parseAttribute):
338         (WebCore::SVGFEMergeNodeElement::registerAttributes): Deleted.
339         * svg/SVGFEMergeNodeElement.h:
340         * svg/SVGFEMorphologyElement.cpp:
341         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
342         (WebCore::SVGFEMorphologyElement::registerAttributes):
343         (WebCore::SVGFEMorphologyElement::parseAttribute):
344         * svg/SVGFEMorphologyElement.h:
345         * svg/SVGFEOffsetElement.cpp:
346         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
347         (WebCore::SVGFEOffsetElement::parseAttribute):
348         (WebCore::SVGFEOffsetElement::svgAttributeChanged):
349         (WebCore::SVGFEOffsetElement::registerAttributes): Deleted.
350         * svg/SVGFEOffsetElement.h:
351         * svg/SVGFESpecularLightingElement.cpp:
352         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
353         (WebCore::SVGFESpecularLightingElement::parseAttribute):
354         (WebCore::SVGFESpecularLightingElement::registerAttributes): Deleted.
355         * svg/SVGFESpecularLightingElement.h:
356         * svg/SVGFETileElement.cpp:
357         (WebCore::SVGFETileElement::SVGFETileElement):
358         (WebCore::SVGFETileElement::parseAttribute):
359         (WebCore::SVGFETileElement::registerAttributes): Deleted.
360         * svg/SVGFETileElement.h:
361         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
362         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
363         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
364         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
365         * svg/SVGFilterPrimitiveStandardAttributes.h:
366         (WebCore::SVGFilterPrimitiveStandardAttributes::result const):
367         (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
368         * svg/SVGLegacyAttributeAnimationController.cpp:
369         (WebCore::SVGLegacyAttributeAnimationController::isDiscreteAnimator const):
370         * svg/SVGLegacyAttributeAnimationController.h:
371         * svg/SVGMPathElement.h:
372         * svg/SVGScriptElement.h:
373         * svg/SVGURIReference.cpp:
374         (WebCore::SVGURIReference::SVGURIReference):
375         (WebCore::SVGURIReference::isKnownAttribute):
376         (WebCore::SVGURIReference::parseAttribute):
377         (WebCore::SVGURIReference::registerAttributes): Deleted.
378         (WebCore::SVGURIReference::href const): Deleted.
379         (WebCore::SVGURIReference::hrefAnimated): Deleted.
380         * svg/SVGURIReference.h:
381         (WebCore::SVGURIReference::href const):
382         (WebCore::SVGURIReference::hrefAnimated):
383         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
384         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
385         * svg/properties/SVGAnimatedPropertyImpl.h:
386         * svg/properties/SVGAttributeRegistry.h:
387         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
388         * svg/properties/SVGPropertyAnimatorFactory.h:
389         (WebCore::SVGPropertyAnimatorFactory::createStringAnimator):
390         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
391         * svg/properties/SVGPropertyOwnerRegistry.h:
392         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
393
394 2019-03-21  Zalan Bujtas  <zalan@apple.com>
395
396         Do not insert the first-letter anonymous container until after we've constructed the first-letter renderer.
397         https://bugs.webkit.org/show_bug.cgi?id=195919
398         <rdar://problem/48573434>
399
400         Reviewed by Brent Fulgham.
401
402         When the container is injected too early, we might end up removing it as part of the collapsing logic
403         while the text renderer is being removed (replaced with the first letter + remaining text).
404
405         Test: fast/css/first-letter-and-float-crash.html
406
407         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
408         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
409
410 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
411
412         Add UI process WebRTC runtime logging.
413         https://bugs.webkit.org/show_bug.cgi?id=196020
414         <rdar://problem/49071443>
415
416         Reviewed by Youenn Fablet.
417
418         * inspector/agents/WebConsoleAgent.cpp:
419         (WebCore::WebConsoleAgent::getLoggingChannels): Deleted.
420         (WebCore::channelConfigurationForString): Deleted.
421         (WebCore::WebConsoleAgent::setLoggingChannelLevel): Deleted.
422         * inspector/agents/WebConsoleAgent.h:
423         * inspector/agents/page/PageConsoleAgent.cpp:
424         (WebCore::PageConsoleAgent::PageConsoleAgent): Change 'context' parameter from 
425         WebAgentContext to PageAgentContext. Store the inspected page for later use.
426         (WebCore::PageConsoleAgent::getLoggingChannels): Moved from WebConsoleAgent.
427         (WebCore::channelConfigurationForString): Ditto.
428         (WebCore::PageConsoleAgent::setLoggingChannelLevel): Moved from WebConsoleAgent.
429         Call the inspected page to actually change the log channel configuration.
430         * inspector/agents/page/PageConsoleAgent.h:
431         * page/ChromeClient.h:
432         * page/Page.cpp:
433         (WebCore::Page::configureLoggingChannel): New.
434         * page/Page.h:
435
436 2019-03-21  Andy Estes  <aestes@apple.com>
437
438         [iOS] Apple Pay should be available in documents with no user agent scripts
439         https://bugs.webkit.org/show_bug.cgi?id=196061
440         <rdar://problem/48649391>
441
442         Reviewed by Brady Eidson.
443
444         On platforms that support APPLE_PAY_REMOTE_UI, we can enable Apple Pay JS and Payment Request
445         by default in all WebKit clients.
446
447         In order to protect the privacy of Apple Pay transactions, this patch implements the
448         following restrictions on API usage:
449
450         1. If user agent scripts have been evaluated in a document, Apple Pay APIs will no longer be
451         available for the duration of the document's lifetime.
452         2. If an Apple Pay transaction has started in a document, user agent scripts will no longer
453         be evaluated for the duration of the document's lifetime.
454
455         These restrictions are disabled for clients with the
456         com.apple.private.WebKit.UnrestrictedApplePay entitlement and platforms that do support
457         Apple Pay but don't support APPLE_PAY_REMOTE_UI.
458
459         Added new API tests.
460
461         * Modules/applepay/ApplePayRequestBase.cpp:
462         (WebCore::convertAndValidate):
463         * Modules/applepay/ApplePayRequestBase.h:
464         * Modules/applepay/ApplePaySession.cpp:
465         (WebCore::convertAndValidate):
466         (WebCore::ApplePaySession::create):
467         (WebCore::ApplePaySession::supportsVersion):
468         (WebCore::ApplePaySession::canMakePayments):
469         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
470         (WebCore::ApplePaySession::openPaymentSetup):
471         (WebCore::ApplePaySession::begin):
472         * Modules/applepay/ApplePaySession.h:
473         * Modules/applepay/ApplePaySession.idl:
474         * Modules/applepay/PaymentCoordinator.cpp:
475         (WebCore::PaymentCoordinator::supportsVersion const):
476         (WebCore::PaymentCoordinator::canMakePayments):
477         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
478         (WebCore::PaymentCoordinator::openPaymentSetup):
479         (WebCore::PaymentCoordinator::beginPaymentSession):
480         (WebCore::PaymentCoordinator::validatedPaymentNetwork const):
481         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
482         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
483         * Modules/applepay/PaymentCoordinator.h:
484         * Modules/applepay/PaymentCoordinatorClient.h:
485         (WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const):
486         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
487         (WebCore::ApplePayPaymentHandler::show):
488         (WebCore::ApplePayPaymentHandler::canMakePayment):
489         (WebCore::ApplePayPaymentHandler::version const):
490         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
491         * Modules/paymentrequest/PaymentHandler.h:
492         * Modules/paymentrequest/PaymentRequest.cpp:
493         (WebCore::PaymentRequest::show):
494         (WebCore::PaymentRequest::canMakePayment):
495
496         Plumbed a Document& through to the various places that call into PaymentCoordinator for use
497         by shouldAllowApplePay and shouldAllowUserAgentScripts.
498
499         * bindings/js/ScriptController.cpp:
500         (WebCore::ScriptController::executeUserAgentScriptInWorld):
501         (WebCore::ScriptController::shouldAllowUserAgentScripts const):
502         * bindings/js/ScriptController.h:
503
504         Added executeUserAgentScriptInWorld, which calls executeScriptInWorld if allowed.
505
506         * dom/Document.cpp:
507         (WebCore::Document::ensurePlugInsInjectedScript):
508
509         Changed to only evaluate the chrome client's plug-in extra script if allowed, and to mark
510         the document as having evaluated user agent scripts.
511
512         (WebCore::Document::hasEvaluatedUserAgentScripts const):
513         (WebCore::Document::isRunningUserScripts const):
514         (WebCore::Document::setAsRunningUserScripts):
515         (WebCore::Document::setHasEvaluatedUserAgentScripts):
516         (WebCore::Document::hasStartedApplePaySession const):
517         (WebCore::Document::setHasStartedApplePaySession):
518         * dom/Document.h:
519
520         Added helper functions to set state on the top document.
521
522         * loader/DocumentThreadableLoader.cpp:
523         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
524
525         Removed call to topDocument() now that isRunningUserScripts() always checks the top document.
526
527         * page/Frame.cpp:
528         (WebCore::Frame::injectUserScriptImmediately):
529
530         Changed to only inject the user script if allowed.
531
532         * page/Settings.yaml:
533         * page/SettingsDefaultValues.h:
534
535         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
536
537         * testing/Internals.cpp:
538         (WebCore::Internals::setAsRunningUserScripts):
539         (WebCore::Internals::setHasStartedApplePaySession):
540         * testing/Internals.h:
541         * testing/Internals.idl:
542         * testing/MockPaymentCoordinator.h:
543         * testing/MockPaymentCoordinator.idl:
544
545         Added some internal interfaces for use by TestWebKitAPI.
546
547 2019-03-21  Alex Christensen  <achristensen@webkit.org>
548
549         Add SPI to inform applications of WKContentRuleList actions
550         https://bugs.webkit.org/show_bug.cgi?id=195965
551         <rdar://problem/42664365>
552
553         Reviewed by Geoff Garen.
554
555         We already had SPI to inform the application of notifications.
556         In order to inform it about other actions, I needed to put them in a different structure.
557         Basically, instead of a Vector<Action> I use a Vector<Vector<Action>> that contains the same actions.
558         That way we can give one callback per WKContentRuleList.
559
560         * Modules/websockets/WebSocketChannel.cpp:
561         (WebCore::WebSocketChannel::connect):
562         * WebCore.xcodeproj/project.pbxproj:
563         * contentextensions/ContentExtensionActions.h:
564         * contentextensions/ContentExtensionParser.cpp:
565         (WebCore::ContentExtensions::loadEncodedRules):
566         * contentextensions/ContentExtensionRule.cpp:
567         (WebCore::ContentExtensions::Action::isolatedCopy const):
568         * contentextensions/ContentExtensionRule.h:
569         (WebCore::ContentExtensions::Action::operator== const):
570         (WebCore::ContentExtensions::Action::setExtensionIdentifier): Deleted.
571         (WebCore::ContentExtensions::Action::extensionIdentifier const): Deleted.
572         * contentextensions/ContentExtensionsBackend.cpp:
573         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
574         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
575         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForPingLoad):
576         (WebCore::ContentExtensions::applyResultsToRequest):
577         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
578         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad): Deleted.
579         (WebCore::ContentExtensions::applyBlockedStatusToRequest): Deleted.
580         * contentextensions/ContentExtensionsBackend.h:
581         * contentextensions/ContentRuleListResults.h: Added.
582         (WebCore::ContentRuleListResults::Result::shouldNotifyApplication const):
583         (WebCore::ContentRuleListResults::shouldNotifyApplication const):
584         (WebCore::ContentRuleListResults::encode const):
585         (WebCore::ContentRuleListResults::decode):
586         (WebCore::ContentRuleListResults::Result::encode const):
587         (WebCore::ContentRuleListResults::Result::decode):
588         (WebCore::ContentRuleListResults::Summary::encode const):
589         (WebCore::ContentRuleListResults::Summary::decode):
590         * css/StyleSheetContents.cpp:
591         (WebCore::StyleSheetContents::subresourcesAllowReuse const):
592         * html/HTMLMediaElement.cpp:
593         (WebCore::HTMLMediaElement::loadResource):
594         * loader/FrameLoader.cpp:
595         (WebCore::FrameLoader::loadResourceSynchronously):
596         * loader/PingLoader.cpp:
597         (WebCore::processContentRuleListsForLoad):
598         (WebCore::PingLoader::loadImage):
599         (WebCore::PingLoader::sendPing):
600         (WebCore::PingLoader::sendViolationReport):
601         (WebCore::processContentExtensionRulesForLoad): Deleted.
602         * loader/ResourceLoader.cpp:
603         (WebCore::ResourceLoader::willSendRequestInternal):
604         * loader/cache/CachedResourceLoader.cpp:
605         (WebCore::CachedResourceLoader::requestResource):
606         * loader/cache/CachedResourceRequest.cpp:
607         (WebCore::CachedResourceRequest::applyResults):
608         (WebCore::CachedResourceRequest::applyBlockedStatus): Deleted.
609         * loader/cache/CachedResourceRequest.h:
610         * page/ChromeClient.h:
611         (WebCore::ChromeClient::contentRuleListNotification):
612         * page/DOMWindow.cpp:
613         (WebCore::DOMWindow::open):
614         * page/UserContentProvider.cpp:
615         (WebCore::UserContentProvider::processContentRuleListsForLoad):
616         (WebCore::UserContentProvider::actionsForResourceLoad):
617         (WebCore::UserContentProvider::processContentExtensionRulesForLoad): Deleted.
618         * page/UserContentProvider.h:
619
620 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
621
622         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
623         https://bugs.webkit.org/show_bug.cgi?id=196058
624         rdar://problem/49078202
625
626         Reviewed by Antti Koivisto.
627
628         Add an internal setting called "legacyOverflowScrollingTouchEnabled", initially
629         on by default.
630
631         When disabled, it makes the -webkit-overflow-scrolling property be unsupported.
632
633         Tests: fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html
634                fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html
635
636         * css/parser/CSSParserContext.cpp:
637         (WebCore::CSSParserContext::CSSParserContext):
638         (WebCore::operator==):
639         * css/parser/CSSParserContext.h:
640         (WebCore::CSSParserContextHash::hash):
641         * css/parser/CSSParserFastPaths.cpp:
642         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
643         * css/parser/CSSParserFastPaths.h:
644         * css/parser/CSSPropertyParser.cpp:
645         (WebCore::CSSPropertyParser::parseSingleValue):
646         * page/Settings.yaml:
647
648 2019-03-21  Antti Koivisto  <antti@apple.com>
649
650         UI-process hit-testing needs to know about containing block relationships
651         https://bugs.webkit.org/show_bug.cgi?id=195845
652         <rdar://problem/48949633>
653
654         Reviewed by Simon Fraser.
655
656         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
657
658         * page/scrolling/ScrollingTree.h:
659         * page/scrolling/ScrollingTreeScrollingNode.h:
660         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
661         (WebCore::ScrollingTreePositionedNode::layer const):
662
663 2019-03-21  Zalan Bujtas  <zalan@apple.com>
664
665         [ContentChangeObserver] Cleanup reset state.
666         https://bugs.webkit.org/show_bug.cgi?id=196076
667         <rdar://problem/49107931>
668
669         Reviewed by Simon Fraser.
670
671         stopObservingPendingActivities() is a subset of reset() and call it when we've observed a visible change.
672
673         * page/ios/ContentChangeObserver.cpp:
674         (WebCore::ContentChangeObserver::willNotProceedWithClick):
675         (WebCore::ContentChangeObserver::stopObservingPendingActivities):
676         (WebCore::ContentChangeObserver::reset):
677         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
678         (WebCore::ContentChangeObserver::willDetachPage):
679         (WebCore::ContentChangeObserver::adjustObservedState):
680         (WebCore::ContentChangeObserver::cancelPendingActivities): Deleted.
681         * page/ios/ContentChangeObserver.h:
682
683 2019-03-21  Zalan Bujtas  <zalan@apple.com>
684
685         Unreviewed build fix.
686
687         * page/ios/ContentChangeObserver.h:
688
689 2019-03-21  Zalan Bujtas  <zalan@apple.com>
690
691         [ContentChangeObserver] Start tracking implicit transitions at mousemove
692         https://bugs.webkit.org/show_bug.cgi?id=196054
693         <rdar://problem/49093840>
694
695         Reviewed by Simon Fraser.
696
697         This patch fixes the hover menu issue on seriouseats.com. After tapping on the menu items, the submenus show up now.
698
699         1. Start observing at mousemove
700         2. Check if the style change is synchronous or not and start observing it accordingly.
701
702         Tests: fast/events/touch/ios/content-observation/0ms-delay-0ms-transition-on-mousemove.html
703                fast/events/touch/ios/content-observation/100ms-delay-10ms-transition-on-mousemove.html
704                fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-mousemove.html
705                fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-touch-start.html
706
707         * page/ios/ContentChangeObserver.cpp:
708         (WebCore::ContentChangeObserver::adjustObservedState):
709
710 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
711
712         Absolute in stacking-context scroller jiggles when scrolled
713         https://bugs.webkit.org/show_bug.cgi?id=196010
714
715         Reviewed by Zalan Bujtas.
716
717         Updating compositing layers after a scroll (in a compositing update on the main thread)
718         failed to traverse to an absolute layer inside a stacking-context overflow:scroll,
719         because the overflow's layer didn't have the "hasCompositingAncestor" bit set on it.
720
721         This happened because childState.subtreeIsCompositing wasn't being set when indirect
722         reasons trigger compositing. So clean up RenderLayerCompositor::computeCompositingRequirements()
723         to set childState.subtreeIsCompositing for "late" compositing decisions, and move the
724         "Subsequent layers in the parent stacking context also need to composite" chunk
725         down to after the last compositing decision has been made.
726
727         Test: compositing/overflow/absolute-in-overflow.html
728
729         * page/scrolling/ScrollingTreeScrollingNode.cpp:
730         (WebCore::ScrollingTreeScrollingNode::scrollTo):
731         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
732         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
733         * rendering/RenderLayerCompositor.cpp:
734         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
735
736 2019-03-21  Zalan Bujtas  <zalan@apple.com>
737
738         [ContentChangeObserver] Start tracking implicit transitions at touchStart
739         https://bugs.webkit.org/show_bug.cgi?id=196051
740         <rdar://problem/49092952>
741
742         Reviewed by Simon Fraser.
743
744         This patch enables transition tracking on touchStart.
745
746         1. Start observing for new transitions at touchStart
747         2. Stop observing at touchEnd
748         3. Check the next style recalc when the transition is finished (at onAnimationEnd we don't yet have the final computed style).
749         4. Remove the tracked transition when it is canceled.
750
751         Tests: fast/events/touch/ios/content-observation/0ms-transition-on-touch-start.html
752                fast/events/touch/ios/content-observation/100ms-transition-on-touch-start.html
753                fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start.html
754                fast/events/touch/ios/content-observation/transition-on-touch-start-and-remove.html
755
756         * page/ios/ContentChangeObserver.cpp:
757         (WebCore::ContentChangeObserver::didAddTransition):
758         (WebCore::ContentChangeObserver::didFinishTransition):
759         (WebCore::ContentChangeObserver::didRemoveTransition):
760         (WebCore::ContentChangeObserver::adjustObservedState):
761         * page/ios/ContentChangeObserver.h:
762         (WebCore::ContentChangeObserver::setShouldObserveTransitions):
763         (WebCore::ContentChangeObserver::clearObservedTransitions):
764         (WebCore::ContentChangeObserver::hasObservedTransition const):
765         (WebCore::ContentChangeObserver::hasPendingActivity const):
766
767 2019-03-21  Zalan Bujtas  <zalan@apple.com>
768
769         [ContentChangeObserver] Track hidden elements only while transitioning.
770         https://bugs.webkit.org/show_bug.cgi?id=196050
771         <rdar://problem/49092037>
772
773         Reviewed by Simon Fraser.
774
775         Use the existing isConsideredHidden() logic to decide whether the current transition should be tracked.
776
777         * page/ios/ContentChangeObserver.cpp:
778         (WebCore::isConsideredHidden):
779         (WebCore::ContentChangeObserver::didAddTransition):
780         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
781         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
782         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Deleted.
783         * page/ios/ContentChangeObserver.h:
784
785 2019-03-21  Zalan Bujtas  <zalan@apple.com>
786
787         [ContentChangeObserver] Add support for observing implicit transitions
788         https://bugs.webkit.org/show_bug.cgi?id=195914
789         <rdar://problem/49091959>
790
791         Reviewed by Simon Fraser.
792
793         This patch is in preparation for observing elements with property "left" implicit transitions.
794
795         This is not a continuous tracking, we are only interested in the start and the end state.
796         The idea here is to register hidden elements only and check if they become visible by
797         the end of the transition (and ignore if the transition gets "canceled").
798
799         * page/animation/AnimationBase.h:
800         * page/animation/ImplicitAnimation.cpp:
801         (WebCore::ImplicitAnimation::ImplicitAnimation):
802         (WebCore::ImplicitAnimation::~ImplicitAnimation):
803         (WebCore::ImplicitAnimation::clear):
804         (WebCore::ImplicitAnimation::onAnimationEnd):
805         * page/animation/ImplicitAnimation.h:
806         * page/ios/ContentChangeObserver.cpp:
807         (WebCore::ContentChangeObserver::didAddTransition):
808         (WebCore::ContentChangeObserver::removeTransitionIfNeeded):
809         (WebCore::ContentChangeObserver::didFinishTransition):
810         (WebCore::ContentChangeObserver::didRemoveTransition):
811         (WebCore::ContentChangeObserver::didInstallDOMTimer):
812         * page/ios/ContentChangeObserver.h:
813         (WebCore::ContentChangeObserver::isObservingTransitions const):
814         (WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
815
816 2019-03-21  Devin Rousso  <drousso@apple.com>
817
818         Web Inspector: Page: lazily create the agent
819         https://bugs.webkit.org/show_bug.cgi?id=195592
820         <rdar://problem/48791916>
821
822         Reviewed by Timothy Hatcher.
823
824         No change in functionality.
825
826         Have more agents save the inspected `Page` so they don't need to access it via the
827         `InspectorPageAgent`. Make some of `InspectorPageAgent`'s functions `static` so other
828         agents can use them without needing to have access to an enabled `InspectorPageAgent`.
829
830         * inspector/InspectorController.cpp:
831         (WebCore::InspectorController::InspectorController):
832         (WebCore::InspectorController::createLazyAgents):
833
834         * inspector/agents/InspectorPageAgent.h:
835         (WebCore::InspectorPageAgent::page): Deleted.
836         * inspector/agents/InspectorPageAgent.cpp:
837         (WebCore::InspectorPageAgent::InspectorPageAgent):
838         (WebCore::InspectorPageAgent::enable):
839         (WebCore::InspectorPageAgent::disable):
840         (WebCore::InspectorPageAgent::reload):
841         (WebCore::InspectorPageAgent::navigate):
842         (WebCore::InspectorPageAgent::overrideSetting):
843         (WebCore::InspectorPageAgent::getCookies):
844         (WebCore::InspectorPageAgent::deleteCookie):
845         (WebCore::InspectorPageAgent::getResourceTree):
846         (WebCore::InspectorPageAgent::searchInResources):
847         (WebCore::InspectorPageAgent::didPaint):
848         (WebCore::InspectorPageAgent::didLayout):
849         (WebCore::InspectorPageAgent::didScroll):
850         (WebCore::InspectorPageAgent::didRecalculateStyle):
851         (WebCore::InspectorPageAgent::setEmulatedMedia):
852         (WebCore::InspectorPageAgent::setForcedAppearance):
853         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
854         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
855         (WebCore::InspectorPageAgent::snapshotNode):
856         (WebCore::InspectorPageAgent::snapshotRect):
857         (WebCore::InspectorPageAgent::archive):
858         (WebCore::InspectorPageAgent::mainFrame): Deleted.
859         (WebCore::InspectorPageAgent::hasIdForFrame const): Deleted.
860
861         * inspector/agents/InspectorApplicationCacheAgent.h:
862         * inspector/agents/InspectorApplicationCacheAgent.cpp:
863         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
864         (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
865         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
866         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
867
868         * inspector/agents/InspectorCanvasAgent.h:
869         * inspector/agents/InspectorCanvasAgent.cpp:
870         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
871         (WebCore::InspectorCanvasAgent::enable):
872
873         * inspector/agents/InspectorDOMStorageAgent.h:
874         * inspector/agents/InspectorDOMStorageAgent.cpp:
875         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
876         (WebCore::InspectorDOMStorageAgent::findStorageArea):
877
878         * inspector/agents/InspectorIndexedDBAgent.h:
879         * inspector/agents/InspectorIndexedDBAgent.cpp:
880         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
881         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
882         (WebCore::InspectorIndexedDBAgent::requestDatabase):
883         (WebCore::InspectorIndexedDBAgent::requestData):
884         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
885
886         * inspector/agents/page/PageDebuggerAgent.h:
887         * inspector/agents/page/PageDebuggerAgent.cpp:
888         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
889         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
890         (WebCore::PageDebuggerAgent::breakpointActionLog):
891         (WebCore::PageDebuggerAgent::injectedScriptForEval):
892
893         * inspector/agents/page/PageNetworkAgent.h:
894         * inspector/agents/page/PageNetworkAgent.cpp:
895         (WebCore::PageNetworkAgent::PageNetworkAgent):
896         (WebCore::PageNetworkAgent::loaderIdentifier):
897         (WebCore::PageNetworkAgent::frameIdentifier):
898         (WebCore::PageNetworkAgent::setResourceCachingDisabled):
899         (WebCore::PageNetworkAgent::scriptExecutionContext):
900
901         * inspector/InspectorInstrumentation.cpp:
902         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
903
904 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
905
906         Hardening: Use WeakPtrs in VideoFullscreenInterface{Mac,AVKit}
907         https://bugs.webkit.org/show_bug.cgi?id=196052
908         <rdar://problem/48778571>
909
910         Reviewed by Eric Carlson.
911
912         The VideoFullscreenInterface{Mac,AVKit} implementations store their fullscreen model
913         and fullscreen change observer members as bare pointers, something we've been working
914         to eliminate.
915         
916         This patch corrects this oversight.
917
918         No new tests since no changes in behavior.
919
920         * platform/cocoa/VideoFullscreenChangeObserver.h:
921         * platform/cocoa/VideoFullscreenModel.h:
922         * platform/ios/VideoFullscreenInterfaceAVKit.h:
923         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
924         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
925         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
926         (VideoFullscreenInterfaceAVKit::presentingViewController):
927         (VideoFullscreenInterfaceAVKit::invalidate):
928         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
929         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
930         (VideoFullscreenInterfaceAVKit::doSetup):
931         * platform/mac/VideoFullscreenInterfaceMac.h:
932         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
933         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
934         * platform/mac/VideoFullscreenInterfaceMac.mm:
935         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel):
936         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
937         (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
938         (WebCore::VideoFullscreenInterfaceMac::invalidate):
939
940 2019-03-21  Megan Gardner  <megan_gardner@apple.com>
941
942         Smart delete for paragraphs.
943         https://bugs.webkit.org/show_bug.cgi?id=195837
944
945         Reviewed by Ryosuke Niwa.
946
947         Remove additional newlines to maintain spacing around paragraphs.
948
949         Tests: editing/pasteboard/smart-delete-paragraph-001.html
950                editing/pasteboard/smart-delete-paragraph-002.html
951                editing/pasteboard/smart-delete-paragraph-003.html
952                editing/pasteboard/smart-delete-paragraph-004.html
953
954         * editing/DeleteSelectionCommand.cpp:
955         (WebCore::isBlankLine):
956         (WebCore::DeleteSelectionCommand::initializePositionData):
957
958 2019-03-21  Cathie Chen  <cathiechen@igalia.com>
959
960         Fixed ContentChangeObserver build error.
961         https://bugs.webkit.org/show_bug.cgi?id=195993
962
963         Reviewed by Rob Buis.
964
965         EWS IOS compiler complains after adding new files in Bug 157743.
966         ContentChangeObserver.h should have forward declaration for Element.
967
968         * page/ios/ContentChangeObserver.cpp:
969         * page/ios/ContentChangeObserver.h:
970
971 2019-03-21  Charlie Turner  <cturner@igalia.com>
972
973         [GStreamer][EME][Clearkey] Take a lock in keys() method
974         https://bugs.webkit.org/show_bug.cgi?id=195900
975
976         Reviewed by Xabier Rodriguez-Calvar.
977
978         This isn't ideal, since we're taking a lock for every frame to
979         decode. But there's no good way around it when keys can be
980         made unavailable at any time via an update() call, so we can't
981         cache key IDs in the decryptor.
982
983         Covered by test imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.https.html
984
985         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
986         (WebCore::CDMInstanceClearKey::keys const): This method is called
987         from GStreamer's decode() method, which runs off the main thread,
988         therefore we need to take a lock.
989         * platform/encryptedmedia/clearkey/CDMClearKey.h:
990
991 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
992
993         [GTK][WPE] Add API to provide geolocation information
994         https://bugs.webkit.org/show_bug.cgi?id=195940
995
996         Reviewed by Michael Catanzaro.
997
998         Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).
999
1000         * PlatformGTK.cmake:
1001         * platform/geoclue/GeolocationProviderGeoclue.cpp:
1002         * platform/geoclue/GeolocationProviderGeoclue.h:
1003         * platform/geoclue/GeolocationProviderGeoclueClient.h:
1004
1005 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1006
1007         [WPE] Confusing messages in stderr when surfaceless context is not supported
1008         https://bugs.webkit.org/show_bug.cgi?id=195742
1009
1010         Reviewed by Žan Doberšek.
1011
1012         The messages shown are:
1013
1014         Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
1015         Cannot create EGL WPE context: EGL_SUCCESS
1016
1017         It seems like there's anything wrong, while there isn't. It's also confusing an error message where the error is
1018         EGL_SUCCESS. I think we should not show those messages at all, not suporting surfaceless contexts is not an
1019         error and it's correctly handled. Failing to get a native window handle from render backend offscreen egl target
1020         is not an error either, since most of the backends don't implement the interface (they actually have an empty
1021         implementation).
1022
1023         * platform/graphics/egl/GLContextEGL.cpp:
1024         (WebCore::GLContextEGL::createSurfacelessContext): Remove the message when extensions are not present
1025         * platform/graphics/egl/GLContextEGLLibWPE.cpp:
1026         (WebCore::GLContextEGL::createWPEContext): Handle the case of wpe_renderer_backend_egl_offscreen_target_create()
1027         returning nullptr, which can happen if the backend doesn't implement the interface. Move the context creation
1028         after the target initialization, to avoid leaking the context when the target doesn't have a native window.
1029
1030 2019-03-20  Yusuke Suzuki  <ysuzuki@apple.com>
1031
1032         [JSC] Use finalizer in JSGlobalLexicalEnvironment and JSGlobalObject
1033         https://bugs.webkit.org/show_bug.cgi?id=195992
1034
1035         Reviewed by Keith Miller and Mark Lam.
1036
1037         Use cellHeapCellType since JSSegmentedVariableObject already set finalizer.
1038
1039         * bindings/js/WebCoreJSClientData.cpp:
1040         (WebCore::JSVMClientData::JSVMClientData):
1041
1042 2019-03-20  Youenn Fablet  <youenn@apple.com>
1043
1044         Compute quota after network process restart based on default quota and space used
1045         https://bugs.webkit.org/show_bug.cgi?id=195804
1046
1047         Reviewed by Chris Dumez.
1048
1049         At creation of quota manager, a default quota will be assigned.
1050         This value is the same for all origins.
1051         Some origins may have been granted a bigger quota by the user.
1052         In that case, the space used might be greater for these origins.
1053         Update at initialization time the quota according the space used as follows:
1054         - If space used is below default quota, stick with default quota.
1055         - If space used is above, set quota to space used rounded by one tenth of the default quota.
1056         The rounding ensures that quota requests will not happen too quickly after a page is loaded.
1057
1058         Test: http/wpt/cache-storage/cache-quota-after-restart.any.html
1059
1060         * Modules/cache/CacheStorageConnection.h:
1061         (WebCore::CacheStorageConnection::setQuotaBasedOnSpaceUsage):
1062         * storage/StorageQuotaManager.cpp:
1063         (WebCore::StorageQuotaManager::setQuotaBasedOnSpaceUsage):
1064         (WebCore::StorageQuotaManager::addUser):
1065         * storage/StorageQuotaManager.h:
1066         * testing/Internals.cpp:
1067         (WebCore::Internals::updateQuotaBasedOnSpaceUsage):
1068         * testing/Internals.h:
1069         * testing/Internals.idl:
1070
1071 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1072
1073         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
1074         https://bugs.webkit.org/show_bug.cgi?id=196049
1075
1076         Reviewed by Tim Horton.
1077
1078         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
1079         overflow scrolling in general, so rename it.
1080
1081         * Configurations/FeatureDefines.xcconfig:
1082         * css/CSSComputedStyleDeclaration.cpp:
1083         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1084         * css/CSSProperties.json:
1085         * css/CSSValueKeywords.in:
1086         * css/StyleBuilderConverter.h:
1087         * css/StyleResolver.cpp:
1088         (WebCore::StyleResolver::adjustRenderStyle):
1089         * css/parser/CSSParserFastPaths.cpp:
1090         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1091         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1092         * dom/Element.cpp:
1093         * dom/Element.h:
1094         * rendering/RenderLayer.cpp:
1095         (WebCore::RenderLayer::canUseCompositedScrolling const):
1096         * rendering/style/RenderStyle.cpp:
1097         (WebCore::rareInheritedDataChangeRequiresLayout):
1098         * rendering/style/RenderStyle.h:
1099         * rendering/style/StyleRareInheritedData.cpp:
1100         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1101         (WebCore::StyleRareInheritedData::operator== const):
1102         * rendering/style/StyleRareInheritedData.h:
1103         * rendering/style/WillChangeData.cpp:
1104         (WebCore::WillChangeData::propertyCreatesStackingContext):
1105
1106 2019-03-20  Devin Rousso  <drousso@apple.com>
1107
1108         Web Inspector: DOM: lazily create the agent
1109         https://bugs.webkit.org/show_bug.cgi?id=195589
1110         <rdar://problem/48791742>
1111
1112         Reviewed by Timothy Hatcher.
1113
1114         No change in functionality.
1115
1116         * inspector/agents/InspectorDOMAgent.h:
1117         (WebCore::InspectorDOMAgent::DOMListener): Deleted.
1118         (WebCore::InspectorDOMAgent::pageAgent): Deleted.
1119         * inspector/agents/InspectorDOMAgent.cpp:
1120         (WebCore::InspectorDOMAgent):
1121         (WebCore::InspectorDOMAgent::unbind):
1122         (WebCore::InspectorDOMAgent::setSearchingForNode):
1123         (WebCore::InspectorDOMAgent::highlightSelector):
1124         (WebCore::InspectorDOMAgent::highlightFrame):
1125         (WebCore::InspectorDOMAgent::buildObjectForNode):
1126         (WebCore::InspectorDOMAgent::didModifyDOMAttr):
1127         (WebCore::InspectorDOMAgent::didRemoveDOMAttr):
1128         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
1129         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
1130         (WebCore::InspectorDOMAgent::setDOMListener): Deleted.
1131
1132         * inspector/agents/InspectorCSSAgent.h:
1133         * inspector/agents/InspectorCSSAgent.cpp:
1134         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
1135         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
1136         (WebCore::InspectorCSSAgent::reset):
1137         (WebCore::InspectorCSSAgent::enable):
1138         (WebCore::InspectorCSSAgent::disable):
1139         (WebCore::InspectorCSSAgent::forcePseudoState):
1140         (WebCore::InspectorCSSAgent::collectAllStyleSheets):
1141         (WebCore::InspectorCSSAgent::setStyleSheetText):
1142         (WebCore::InspectorCSSAgent::setStyleText):
1143         (WebCore::InspectorCSSAgent::setRuleSelector):
1144         (WebCore::InspectorCSSAgent::createStyleSheet):
1145         (WebCore::InspectorCSSAgent::addRule):
1146         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
1147         (WebCore::InspectorCSSAgent::elementForId):
1148         (WebCore::InspectorCSSAgent::bindStyleSheet):
1149         (WebCore::InspectorCSSAgent::~InspectorCSSAgent): Deleted.
1150         (WebCore::InspectorCSSAgent::discardAgent): Deleted.
1151         (WebCore::InspectorCSSAgent::resetNonPersistentData): Deleted.
1152         * inspector/InspectorStyleSheet.cpp:
1153
1154         * inspector/agents/InspectorDOMDebuggerAgent.h:
1155         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1156         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
1157         (WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint):
1158         (WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint):
1159         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
1160         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
1161
1162         * inspector/agents/page/PageConsoleAgent.h:
1163         * inspector/agents/page/PageConsoleAgent.cpp:
1164         (WebCore::PageConsoleAgent::PageConsoleAgent):
1165         (WebCore::PageConsoleAgent::clearMessages):
1166
1167         * inspector/InspectorController.h:
1168         * inspector/InspectorController.cpp:
1169         (WebCore::InspectorController::InspectorController):
1170         (WebCore::InspectorController::createLazyAgents):
1171         (WebCore::InspectorController::inspect):
1172         (WebCore::InspectorController::hideHighlight):
1173
1174 2019-03-20  Youenn Fablet  <youenn@apple.com>
1175
1176         Include WAL and SHM file size in IDB database size computation
1177         https://bugs.webkit.org/show_bug.cgi?id=195688
1178
1179         Reviewed by Brady Eidson.
1180
1181         Count WAL and SHM files as part of IDB quota checks.
1182         This makes some IDB tests go over the testing quota which then
1183         triggers some IDB tasks to happen sooner than other write IDB tasks.
1184         The IDB implementation requires these tasks to remain ordered.
1185         In case a write task is pending quota check, queue all tasks,
1186         write or read, to keep the order.
1187
1188         This patch specials case aborting a transaction.
1189         In case it is called as part of clearing a database,
1190         the task should not be queued and all pending tasks are errored.
1191         When transaction is aborted by the web page, queue the task.
1192
1193         When we can make a decision to run tasks with size 0,
1194         do not check quota. This ensures that read operations
1195         succeed even if we are above quota.
1196
1197         Covered by existing tests.
1198
1199         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1200         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
1201         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
1202         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
1203         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
1204         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
1205         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
1206         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
1207         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
1208         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
1209         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
1210         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1211         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1212         * Modules/webdatabase/DatabaseTracker.cpp:
1213         (WebCore::DatabaseTracker::usage):
1214         * platform/sql/SQLiteFileSystem.cpp:
1215         (WebCore::SQLiteFileSystem::getDatabaseFileSize):
1216         * storage/StorageQuotaManager.h:
1217         * storage/StorageQuotaManager.cpp:
1218         (WebCore::StorageQuotaManager::requestSpace):
1219
1220 2019-03-20  Devin Rousso  <drousso@apple.com>
1221
1222         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
1223         https://bugs.webkit.org/show_bug.cgi?id=176824
1224         <rdar://problem/34290931>
1225
1226         Reviewed by Timothy Hatcher.
1227
1228         Original patch by Joseph Pecoraro <pecoraro@apple.com>.
1229
1230         Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
1231                inspector/timeline/timeline-event-EventDispatch.html
1232                inspector/timeline/timeline-event-FireAnimationFrame.html
1233                inspector/timeline/timeline-event-RequestAnimationFrame.html
1234                inspector/timeline/timeline-event-TimerFire.html
1235                inspector/timeline/timeline-event-TimerInstall.html
1236                inspector/timeline/timeline-event-TimerRemove.html
1237
1238         * dom/EventTarget.cpp:
1239         (WebCore::EventTarget::innerInvokeEventListeners):
1240         * page/DOMWindow.cpp:
1241         (WebCore::DOMWindow::dispatchEvent):
1242         Include `defaultPrevented` when notifying inspector.
1243
1244         * inspector/InspectorInstrumentation.h:
1245         (WebCore::InspectorInstrumentation::didDispatchEvent):
1246         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
1247         * inspector/InspectorInstrumentation.cpp:
1248         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
1249         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
1250         Pass `defaultPrevented` on to agent.
1251
1252         * inspector/agents/InspectorTimelineAgent.h:
1253         * inspector/agents/InspectorTimelineAgent.cpp:
1254         (WebCore::InspectorTimelineAgent::didDispatchEvent):
1255         Append a boolean `defaultPrevented` property on the `EventDispatch` timeline record's data.
1256
1257 2019-03-20  Antoine Quint  <graouts@apple.com>
1258
1259         DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
1260         https://bugs.webkit.org/show_bug.cgi?id=196028
1261         <rdar://problem/46842707>
1262
1263         Reviewed by Dean Jackson.
1264
1265         Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.
1266
1267         * animation/AnimationTimeline.cpp:
1268         (WebCore::AnimationTimeline::forgetAnimation):
1269         (WebCore::AnimationTimeline::animationTimingDidChange):
1270         (WebCore::AnimationTimeline::cancelDeclarativeAnimation):
1271         * animation/AnimationTimeline.h:
1272         * animation/DocumentTimeline.cpp:
1273         (WebCore::DocumentTimeline::getAnimations const):
1274
1275 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
1276
1277         Remove the SVG property tear off objects for SVGAnimatedNumber
1278         https://bugs.webkit.org/show_bug.cgi?id=196037
1279
1280         Reviewed by Simon Fraser.
1281
1282         -- Define SVGAnimatedNumber to be SVGAnimatedPrimitiveProperty<float>.
1283
1284         -- Add SVGAnimatedNumberAccessor to associate an attribute name with a 
1285            pointer to an SVGAnimatedNumber. Given a pointer to an SVGElement,
1286            this accessor will and create an animator for the animated property.
1287
1288         -- Add SVGAnimatedNumberPairAccessor to associate an attribute name
1289            with a pair of pointers to SVGAnimatedNumbers. Given a pointer to an
1290            SVGElement, this accessor will and create an animator for these
1291            animated properties.
1292
1293         -- Add SVGAnimatedNumberAnimator to animated an SVGAnimatedNumber.
1294
1295         -- Add SVGAnimatedNumberPairAnimator to animated a pair of SVGAnimatedNumbers.
1296
1297         -- Add SVGAnimationNumberFunction which will be responsible for progressing
1298            a float over a period of time.
1299
1300         -- Define SVGNumberAnimator to be SVGPrimitivePropertyAnimator<float,
1301            SVGAnimationNumberFunction>. SVGNumberAnimator will be responsible 
1302            for animating attributes with no reflecting animated properties, e.g.
1303            "fill-opacity".
1304
1305         * Sources.txt:
1306         * WebCore.xcodeproj/project.pbxproj:
1307         * svg/SVGAnimatedLength.cpp:
1308         * svg/SVGAnimatedLengthList.cpp:
1309         * svg/SVGAnimatedNumber.cpp: Removed.
1310         * svg/SVGAnimatedNumber.h: Removed.
1311         * svg/SVGAnimatedNumberList.cpp:
1312         * svg/SVGAnimatedNumberOptionalNumber.cpp: Removed.
1313         * svg/SVGAnimatedNumberOptionalNumber.h: Removed.
1314         * svg/SVGAnimatedTransformList.cpp:
1315         * svg/SVGAnimatorFactory.h:
1316         (WebCore::SVGAnimatorFactory::create):
1317         * svg/SVGComponentTransferFunctionElement.cpp:
1318         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
1319         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
1320         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
1321         * svg/SVGComponentTransferFunctionElement.h:
1322         (WebCore::SVGComponentTransferFunctionElement::slope const):
1323         (WebCore::SVGComponentTransferFunctionElement::intercept const):
1324         (WebCore::SVGComponentTransferFunctionElement::amplitude const):
1325         (WebCore::SVGComponentTransferFunctionElement::exponent const):
1326         (WebCore::SVGComponentTransferFunctionElement::offset const):
1327         (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
1328         (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
1329         (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
1330         (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
1331         (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
1332         * svg/SVGFECompositeElement.cpp:
1333         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
1334         (WebCore::SVGFECompositeElement::registerAttributes):
1335         (WebCore::SVGFECompositeElement::parseAttribute):
1336         * svg/SVGFECompositeElement.h:
1337         * svg/SVGFEConvolveMatrixElement.cpp:
1338         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
1339         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
1340         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1341         (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
1342         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted.
1343         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted.
1344         * svg/SVGFEConvolveMatrixElement.h:
1345         * svg/SVGFEDiffuseLightingElement.cpp:
1346         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
1347         (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
1348         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
1349         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted.
1350         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted.
1351         * svg/SVGFEDiffuseLightingElement.h:
1352         * svg/SVGFEDisplacementMapElement.cpp:
1353         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
1354         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
1355         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
1356         * svg/SVGFEDisplacementMapElement.h:
1357         * svg/SVGFEDropShadowElement.cpp:
1358         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
1359         (WebCore::SVGFEDropShadowElement::setStdDeviation):
1360         (WebCore::SVGFEDropShadowElement::registerAttributes):
1361         (WebCore::SVGFEDropShadowElement::parseAttribute):
1362         (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted.
1363         (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted.
1364         * svg/SVGFEDropShadowElement.h:
1365         * svg/SVGFEGaussianBlurElement.cpp:
1366         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
1367         (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
1368         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
1369         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
1370         (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted.
1371         (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted.
1372         * svg/SVGFEGaussianBlurElement.h:
1373         * svg/SVGFELightElement.cpp:
1374         (WebCore::SVGFELightElement::SVGFELightElement):
1375         (WebCore::SVGFELightElement::parseAttribute):
1376         (WebCore::SVGFELightElement::svgAttributeChanged):
1377         (WebCore::SVGFELightElement::registerAttributes): Deleted.
1378         * svg/SVGFELightElement.h:
1379         (WebCore::SVGFELightElement::azimuth const):
1380         (WebCore::SVGFELightElement::elevation const):
1381         (WebCore::SVGFELightElement::x const):
1382         (WebCore::SVGFELightElement::y const):
1383         (WebCore::SVGFELightElement::z const):
1384         (WebCore::SVGFELightElement::pointsAtX const):
1385         (WebCore::SVGFELightElement::pointsAtY const):
1386         (WebCore::SVGFELightElement::pointsAtZ const):
1387         (WebCore::SVGFELightElement::specularExponent const):
1388         (WebCore::SVGFELightElement::limitingConeAngle const):
1389         (WebCore::SVGFELightElement::azimuthAnimated):
1390         (WebCore::SVGFELightElement::elevationAnimated):
1391         (WebCore::SVGFELightElement::xAnimated):
1392         (WebCore::SVGFELightElement::yAnimated):
1393         (WebCore::SVGFELightElement::zAnimated):
1394         (WebCore::SVGFELightElement::pointsAtXAnimated):
1395         (WebCore::SVGFELightElement::pointsAtYAnimated):
1396         (WebCore::SVGFELightElement::pointsAtZAnimated):
1397         (WebCore::SVGFELightElement::specularExponentAnimated):
1398         (WebCore::SVGFELightElement::limitingConeAngleAnimated):
1399         (WebCore::SVGFELightElement::attributeRegistry): Deleted.
1400         (WebCore::SVGFELightElement::isKnownAttribute): Deleted.
1401         * svg/SVGFEMorphologyElement.cpp:
1402         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
1403         (WebCore::SVGFEMorphologyElement::setRadius):
1404         (WebCore::SVGFEMorphologyElement::registerAttributes):
1405         (WebCore::SVGFEMorphologyElement::parseAttribute):
1406         (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted.
1407         (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted.
1408         * svg/SVGFEMorphologyElement.h:
1409         * svg/SVGFEOffsetElement.cpp:
1410         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
1411         (WebCore::SVGFEOffsetElement::registerAttributes):
1412         (WebCore::SVGFEOffsetElement::parseAttribute):
1413         * svg/SVGFEOffsetElement.h:
1414         * svg/SVGFESpecularLightingElement.cpp:
1415         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
1416         (WebCore::SVGFESpecularLightingElement::registerAttributes):
1417         (WebCore::SVGFESpecularLightingElement::parseAttribute):
1418         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted.
1419         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted.
1420         * svg/SVGFESpecularLightingElement.h:
1421         * svg/SVGFETurbulenceElement.cpp:
1422         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
1423         (WebCore::SVGFETurbulenceElement::registerAttributes):
1424         (WebCore::SVGFETurbulenceElement::parseAttribute):
1425         (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted.
1426         (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted.
1427         * svg/SVGFETurbulenceElement.h:
1428         * svg/SVGGeometryElement.cpp:
1429         (WebCore::SVGGeometryElement::SVGGeometryElement):
1430         (WebCore::SVGGeometryElement::parseAttribute):
1431         (WebCore::SVGGeometryElement::registerAttributes): Deleted.
1432         * svg/SVGGeometryElement.h:
1433         (WebCore::SVGGeometryElement::pathLength const):
1434         (WebCore::SVGGeometryElement::pathLengthAnimated):
1435         (WebCore::SVGGeometryElement::attributeRegistry): Deleted.
1436         (WebCore::SVGGeometryElement::isKnownAttribute): Deleted.
1437         * svg/SVGPathElement.h:
1438         * svg/SVGStopElement.cpp:
1439         (WebCore::SVGStopElement::SVGStopElement):
1440         (WebCore::SVGStopElement::parseAttribute):
1441         (WebCore::SVGStopElement::registerAttributes): Deleted.
1442         * svg/SVGStopElement.h:
1443         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1444         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1445         * svg/properties/SVGAnimatedPropertyImpl.h:
1446         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
1447         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
1448         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
1449         (WebCore::SVGAnimationNumberFunction::progress):
1450         * svg/properties/SVGAttributeRegistry.h:
1451         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
1452         * svg/properties/SVGPropertyAnimatorCreator.h:
1453         (WebCore::SVGPropertyAnimatorCreator::createNumberAnimator):
1454         (WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator):
1455         * svg/properties/SVGPropertyOwnerRegistry.h:
1456         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1457
1458 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
1459
1460         Remove the SVG tear off objects for SVGColorAnimator
1461         https://bugs.webkit.org/show_bug.cgi?id=196025
1462
1463         Reviewed by Simon Fraser.
1464
1465         SVG attributes like "fill" and "stroke" do not have reflecting properties
1466         in SVGElement but they are animatable by SMIL. Animating such attributes
1467         is different from animating the SVG animated properties. These new classes
1468         will be added to handle the first type of this kind of attribute: the Color:
1469
1470         -- SVGPropertyAnimatorCreator is added to SVGElement. It is responsible 
1471            for creating SVGPropertyAnimators for the attribute which do not have
1472            reflecting animated properties stored by SVGElement. It will maintain
1473            a HashMap for the animated values for these attributes which is indexed
1474            by the attribute name. The animated values has to be RefCounted because
1475            the same attribute can be animated by multiple animators. So the values
1476            of this HashMap will be of type Ref<SVGProperty>, e.g.
1477             <circle cx="80" cy="120" r="35">
1478                 <animate attributeName="fill" values="#080" begin="2s" />
1479                 <animate attributeName="fill" values="#602;#004" begin="4s" dur="5s"/>
1480             </circle>
1481
1482         -- SVGPropertyAnimator is the a new type which animates an attribute with
1483            no reflecting animated property.
1484
1485         -- SVGPrimitivePropertyAnimator is a template class which is responsible
1486            for animating attributes with primitive types, e.g. Color, string and 
1487            float. It is derived form SVGPropertyAnimator and it is initialized 
1488            with a Ref<SVGValueProperty<PropertyType>> which is created and maintained
1489            by SVGPropertyAnimatorFactory.
1490
1491         -- SVGAnimationColorFunction is the animation function that animates the
1492            attributes whose type are Color. Note the conversion form String to 
1493            Color in this class has to handle the case when its value is "attributeName="
1494            e.g. <animate attributeName="fill" from="attributeName="r"/>
1495
1496         -- SVGColorAnimator will be defined to be
1497            SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>.
1498
1499         The life cycle of the RefCounted properties can be explained as follows:
1500
1501         -- SVGPropertyAnimatorFactory checks whether its HashMap has an entry
1502            for the given attribute name. If it does not have, it will create a
1503            new value through the value creation method for this attribute.
1504
1505         -- SVGPropertyAnimatorFactory passes the shared animated value to the
1506            animator creation method. So multiple animators will be accessing the
1507            same value through their RefCounted pointers.
1508
1509         -- When the animator is about to be deleted, it will notify the target
1510            SVGElement which will notify its SVGPropertyAnimatorFactory.
1511            SVGPropertyAnimatorFactory will check its HashMap and retrieves the
1512            entry for the given attribute name. If the refCount is 2, it is going
1513            to remove the entry form the HashMap.
1514
1515         * Sources.txt:
1516         * WebCore.xcodeproj/project.pbxproj:
1517         * svg/SVGAnimateColorElement.cpp:
1518         (WebCore::attributeValueIsCurrentColor): Deleted.
1519         (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): Deleted.
1520         * svg/SVGAnimateColorElement.h:
1521         * svg/SVGAnimateElementBase.cpp:
1522         (WebCore::SVGAnimateElementBase::attributeAnimationController):
1523         * svg/SVGAnimatedColor.cpp: Removed.
1524         * svg/SVGAnimatedColor.h: Removed.
1525         * svg/SVGAnimatorFactory.h:
1526         (WebCore::SVGAnimatorFactory::create):
1527         * svg/SVGAttributeAnimationController.cpp:
1528         (WebCore::SVGAttributeAnimationController::~SVGAttributeAnimationController):
1529         * svg/SVGAttributeAnimationController.h:
1530         * svg/SVGElement.cpp:
1531         (WebCore::SVGElement::SVGElement):
1532         (WebCore::SVGElement::isAnimatedAttribute const):
1533         (WebCore::SVGElement::createAnimator):
1534         (WebCore::SVGElement::animatorWillBeDeleted):
1535         * svg/SVGElement.h:
1536         (WebCore::SVGElement::propertyAnimatorFactory):
1537         * svg/SVGFitToViewBox.h:
1538         * svg/SVGMPathElement.cpp:
1539         * svg/graphics/filters/SVGFEImage.h:
1540         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp: Added.
1541         (WebCore::SVGAnimationColorFunction::colorFromString):
1542         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
1543         (WebCore::SVGAnimationColorFunction::progress):
1544         * svg/properties/SVGAnimationFunction.h:
1545         * svg/properties/SVGAttributeAnimator.cpp:
1546         (WebCore::SVGAttributeAnimator::applyAnimatedStylePropertyChange):
1547         (WebCore::SVGAttributeAnimator::removeAnimatedStyleProperty):
1548         * svg/properties/SVGAttributeAnimator.h:
1549         * svg/properties/SVGPrimitivePropertyAnimator.h: Added.
1550         (WebCore::SVGPrimitivePropertyAnimator::create):
1551         (WebCore::SVGPrimitivePropertyAnimator::SVGPrimitivePropertyAnimator):
1552         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h: Added.
1553         * svg/properties/SVGPropertyAnimator.h: Added.
1554         (WebCore::SVGPropertyAnimator::SVGPropertyAnimator):
1555         (WebCore::SVGPropertyAnimator::adjustForInheritance const):
1556         (WebCore::SVGPropertyAnimator::computeCSSPropertyValue const):
1557         (WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):
1558         * svg/properties/SVGPropertyAnimatorFactory.h: Added.
1559         (WebCore::SVGPropertyAnimatorFactory::isKnownAttribute):
1560         (WebCore::SVGPropertyAnimatorFactory::createAnimator):
1561         (WebCore::SVGPropertyAnimatorFactory::animatorWillBeDeleted):
1562         (WebCore::SVGPropertyAnimatorFactory::createColorAnimator):
1563         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
1564
1565 2019-03-20  Alex Christensen  <achristensen@webkit.org>
1566
1567         Use WeakPtr instead of storing raw pointers in WebSocket code
1568         https://bugs.webkit.org/show_bug.cgi?id=196034
1569
1570         Reviewed by Geoff Garen.
1571
1572         This could prevent using freed memory if we forget to reset a pointer somewhere.
1573
1574         * Modules/websockets/WebSocketChannel.cpp:
1575         (WebCore::WebSocketChannel::WebSocketChannel):
1576         (WebCore::WebSocketChannel::connect):
1577         (WebCore::WebSocketChannel::fail):
1578         (WebCore::WebSocketChannel::disconnect):
1579         (WebCore::WebSocketChannel::didOpenSocketStream):
1580         (WebCore::WebSocketChannel::didCloseSocketStream):
1581         (WebCore::WebSocketChannel::didFailSocketStream):
1582         (WebCore::WebSocketChannel::processBuffer):
1583         (WebCore::WebSocketChannel::processFrame):
1584         (WebCore::WebSocketChannel::processOutgoingFrameQueue):
1585         (WebCore::WebSocketChannel::sendFrame):
1586         * Modules/websockets/WebSocketChannel.h:
1587         * Modules/websockets/WebSocketChannelClient.h:
1588         * Modules/websockets/WebSocketHandshake.cpp:
1589         (WebCore::WebSocketHandshake::WebSocketHandshake):
1590         * Modules/websockets/WebSocketHandshake.h:
1591
1592 2019-03-20  Dean Jackson  <dino@apple.com>
1593
1594         [iOS] Crash in WebCore::Node::renderRect
1595         https://bugs.webkit.org/show_bug.cgi?id=196035
1596         <rdar://problem/49076783>
1597
1598         Reviewed by Antoine Quint.
1599
1600         When renderRect was called on an HTMLAreaElement, it would
1601         ASSERT because it doesn't have a renderer. We hadn't noticed
1602         this before because none of our tests were hitting this in
1603         debug mode.
1604
1605         The fix is to ask the corresponding HTMLImageElement for
1606         its renderer, and use that for the returned rectangle.
1607
1608         Covered by these tests that had become flakey:
1609             fast/images/imagemap-in-shadow-tree.html
1610             http/tests/download/area-download.html
1611
1612         * dom/Node.cpp:
1613         (WebCore::Node::renderRect):
1614
1615 2019-03-20  Youenn Fablet  <youenn@apple.com>
1616
1617         Have smaller default quotas for third party frames
1618         https://bugs.webkit.org/show_bug.cgi?id=195841
1619
1620         Reviewed by Geoffrey Garen.
1621
1622         Test: http/wpt/cache-storage/quota-third-party.https.html
1623
1624         * storage/StorageQuotaManager.h:
1625         (WebCore::StorageQuotaManager::defaultQuota):
1626         Change default quota to 1GB.
1627
1628 2019-03-20  Devin Rousso  <drousso@apple.com>
1629
1630         Web Inspector: DOM: include window as part of any event listener chain
1631         https://bugs.webkit.org/show_bug.cgi?id=195730
1632         <rdar://problem/48916872>
1633
1634         Reviewed by Timothy Hatcher.
1635
1636         Test: inspector/dom/getEventListenersForNode.html
1637
1638         * inspector/agents/InspectorDOMAgent.h:
1639         (WebCore::EventListenerInfo::EventListenerInfo): Deleted.
1640         * inspector/agents/InspectorDOMAgent.cpp:
1641         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1642         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1643         (WebCore::InspectorDOMAgent::getEventListeners): Deleted.
1644
1645 2019-03-20  Devin Rousso  <drousso@apple.com>
1646
1647         Web Inspector: Runtime: lazily create the agent
1648         https://bugs.webkit.org/show_bug.cgi?id=195972
1649         <rdar://problem/49039655>
1650
1651         Reviewed by Timothy Hatcher.
1652
1653         No change in functionality.
1654
1655         * inspector/InspectorController.cpp:
1656         (WebCore::InspectorController::InspectorController):
1657         (WebCore::InspectorController::createLazyAgents):
1658
1659         * inspector/WorkerInspectorController.cpp:
1660         (WebCore::WorkerInspectorController::WorkerInspectorController):
1661         (WebCore::WorkerInspectorController::createLazyAgents):
1662
1663         * inspector/agents/page/PageRuntimeAgent.h:
1664         * inspector/agents/page/PageRuntimeAgent.cpp:
1665         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
1666         (WebCore::PageRuntimeAgent::enable):
1667         (WebCore::PageRuntimeAgent::disable):
1668         (WebCore::PageRuntimeAgent::didCreateMainWorldContext):
1669         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
1670         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend): Deleted.
1671         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
1672
1673         * inspector/agents/worker/WorkerRuntimeAgent.h:
1674         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
1675         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend): Deleted.
1676         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
1677
1678 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
1679
1680         [CSS OM] StyledElementInlineStylePropertyMap creates a Ref cycle with its owner element
1681         https://bugs.webkit.org/show_bug.cgi?id=195987
1682
1683         Reviewed by Simon Fraser.
1684
1685         StyledElementInlineStylePropertyMap was leaking every element for which it was created because due to
1686         a reference cycle. The StyledElementInlineStylePropertyMap holds onto its element using Ref and
1687         the element also stores StyledElementInlineStylePropertyMap in ElementRareData using RefPtr.
1688
1689         Fixed the cycle by making the reference from StyledElementInlineStylePropertyMap weak. For now we use
1690         a raw pointer because we can't create a WeakPtr of an element yet.
1691
1692         Test: css-typedom/attribute-style-map-should-not-leak-every-element.html
1693
1694         * css/typedom/StylePropertyMap.h:
1695         (WebCore::StylePropertyMap): Added clearElement as a virtual function.
1696         * dom/Element.cpp:
1697         (WebCore::Element::~Element): Clear the element pointer in StyledElementInlineStylePropertyMap.
1698         * dom/StyledElement.cpp:
1699         (WebCore::StyledElementInlineStylePropertyMap::get): Added a null check for m_element.
1700         (WebCore::StyledElementInlineStylePropertyMap::StyledElementInlineStylePropertyMap):
1701         (WebCore::StyledElementInlineStylePropertyMap::clearElement): Added.
1702         (WebCore::StyledElementInlineStylePropertyMap): Use a raw pointer instead of Ref to StyledElement
1703         to avoid the leak.
1704         * platform/graphics/CustomPaintImage.cpp:
1705         (WebCore::HashMapStylePropertyMap::clearElement): Added.
1706
1707 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
1708
1709         appendChild should throw when inserting an ancestor of a template into its content adopted to another document
1710         https://bugs.webkit.org/show_bug.cgi?id=195984
1711
1712         Reviewed by Darin Adler.
1713
1714         The WPT test caught a bug that appendChild and other DOM insertion functions were incorrectly assuming that
1715         any node that's in a HTML template element has the current document's template document as its owner.
1716         The assumption is wrong when the template element's content DocumentFragment is adopted to another document.
1717
1718         Fixed the bug by always checking the ancestor host elements in checkAcceptChild. Also
1719
1720         Test: fast/dom/insert-template-parent-into-adopted-content.html
1721
1722         * dom/ContainerNode.cpp:
1723         (WebCore::isInTemplateContent): Deleted. This code is simply wrong.
1724         (WebCore::containsConsideringHostElements): Deleted. Call sites are updated to use containsIncludingHostElements.
1725         (WebCore::containsIncludingHostElements): Moved from Node.cpp and optimized this code a bit. It's more efficient
1726         to get the parent node and check for ShadowRoot and DocumentFragment only when the parent is null than to check
1727         for those two node types before getting the parent node.
1728         (WebCore::checkAcceptChild): Merged two code paths to call containsIncludingHostElements. The early return for
1729         a pseudo element is there only to prevent tree corruption in release build even in the presence of a major bug
1730         so it shouldn't be an spec compliance issue.
1731         * dom/Node.cpp:
1732         (WebCore::Node::containsIncludingHostElements const): Deleted.
1733         * dom/Node.h:
1734
1735 2019-03-20  Timothy Hatcher  <timothy@apple.com>
1736
1737         Unreviewed followup to r243169 to fix test failures.
1738
1739         * DerivedSources.make: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_AND_PLATFORM_DEFINES.
1740
1741 2019-03-20  Keith Rollin  <krollin@apple.com>
1742
1743         Update the location for XProtect.meta.plist file
1744         https://bugs.webkit.org/show_bug.cgi?id=195764
1745
1746         Reviewed by Alexey Proskuryakov.
1747
1748         The location of this file is changing in the future, so adjust for
1749         that.
1750
1751         No new tests since there should be no observable behavior difference.
1752
1753         * platform/mac/BlacklistUpdater.mm:
1754
1755 2019-03-20  Devin Rousso  <drousso@apple.com>
1756
1757         Web Inspector: Database: lazily create the agent
1758         https://bugs.webkit.org/show_bug.cgi?id=195587
1759         <rdar://problem/48791735>
1760
1761         Reviewed by Timothy Hatcher.
1762
1763         No change in functionality.
1764
1765         * inspector/agents/InspectorDatabaseAgent.h:
1766         * inspector/agents/InspectorDatabaseAgent.cpp:
1767         (WebCore::InspectorDatabaseAgent::didCommitLoad): Added.
1768         (WebCore::InspectorDatabaseAgent::didOpenDatabase):
1769         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
1770         (WebCore::InspectorDatabaseAgent::enable):
1771         (WebCore::InspectorDatabaseAgent::disable):
1772         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
1773         (WebCore::InspectorDatabaseAgent::executeSQL):
1774         (WebCore::InspectorDatabaseAgent::databaseId):
1775         (WebCore::InspectorDatabaseAgent::findByFileName):
1776         (WebCore::InspectorDatabaseAgent::databaseForId):
1777         (WebCore::InspectorDatabaseAgent::clearResources): Deleted.
1778         (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent): Deleted.
1779         * inspector/InspectorDatabaseResource.h:
1780         (WebCore::InspectorDatabaseResource::database const):
1781         (WebCore::InspectorDatabaseResource::setDatabase):
1782         (WebCore::InspectorDatabaseResource::database): Deleted.
1783         * inspector/InspectorDatabaseResource.cpp:
1784         (WebCore::InspectorDatabaseResource::create):
1785         (WebCore::InspectorDatabaseResource::InspectorDatabaseResource):
1786         (WebCore::InspectorDatabaseResource::bind):
1787         * inspector/InspectorInstrumentation.h:
1788         (WebCore::InspectorInstrumentation::didOpenDatabase):
1789         * inspector/InspectorInstrumentation.cpp:
1790         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1791         (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
1792         Pass the `Database` as a reference instead of a pointer. Retrieve any information directly
1793         from the `Database`, rather than using the arguments that were used to create it.
1794
1795         * Modules/webdatabase/Database.h:
1796         (WebCore::Database::expectedVersion const): Deleted.
1797         * Modules/webdatabase/Database.cpp:
1798         (WebCore::Database::expectedVersion const): Added.
1799         * Modules/webdatabase/DatabaseManager.cpp:
1800         (WebCore::DatabaseManager::openDatabase):
1801         * Modules/webdatabase/DatabaseTracker.h:
1802         * Modules/webdatabase/DatabaseTracker.cpp:
1803         (WebCore::DatabaseTracker::closeAllDatabases):
1804         (WebCore::DatabaseTracker::openDatabases): Added.
1805         Expose various values used by `InspectorDatabaseAgent` and `InspectorDatabaseResource`.
1806
1807         * inspector/InspectorController.cpp:
1808         (WebCore::InspectorController::InspectorController):
1809         (WebCore::InspectorController::createLazyAgents):
1810         * inspector/WorkerInspectorController.cpp:
1811         (WebCore::WorkerInspectorController::WorkerInspectorController):
1812
1813         * inspector/CommandLineAPIHost.h:
1814         (WebCore::CommandLineAPIHost::init):
1815         * inspector/CommandLineAPIHost.cpp:
1816         (WebCore::CommandLineAPIHost::disconnect):
1817         (WebCore::CommandLineAPIHost::inspect):
1818         (WebCore::CommandLineAPIHost::clearConsoleMessages):
1819         (WebCore::CommandLineAPIHost::databaseId):
1820         (WebCore::CommandLineAPIHost::storageId):
1821         Rather than pass each agent individually, pass the entire `InstrumentingAgents` so that the
1822         current agent can be used instead of whatever was initially created.
1823
1824 2019-03-20  Oriol Brufau  <obrufau@igalia.com>
1825
1826         [css-grid] Always consider baseline shim for the minimum contribution
1827         https://bugs.webkit.org/show_bug.cgi?id=195964
1828
1829         Reviewed by Javier Fernandez.
1830
1831         Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-lr.html
1832                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-rl.html
1833                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim.html
1834
1835         Before this patch, the shim used for baseline alignment is not taken
1836         into consideration when calculating the minimum contribution of a grid
1837         item if its preferred size is auto, its minimum size is auto, and the
1838         max track sizing function is a fixed small value. In this case, the
1839         auto minimum size can produce a smaller track than if it was 0.
1840
1841         The specification needs to clarify how baseline shims interact with
1842         minimum contributions (https://github.com/w3c/csswg-drafts/issues/3660),
1843         but the above doesn't make sense.
1844
1845         * rendering/GridTrackSizingAlgorithm.cpp:
1846         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1847
1848 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1849
1850         Some elements lag behind async overflow scrolling on palace-games.com
1851         https://bugs.webkit.org/show_bug.cgi?id=195934
1852
1853         Reviewed by Zalan Bujtas.
1854
1855         The logic added in r242997 was wrong for an absolutely-positioned layer whose containig block was
1856         inside an overflow:scroll, but whose compositing ancestor was outside. This is a case where
1857         we need to make a Positioning node for the absolute layer, because it needs to move along
1858         with the scrolled content.
1859         
1860         There are six permutations of overflow, containing block and compositing ancestor that we care about.
1861         Showing renderer (aka DOM) order, they are (where <- indicates child <- parent):
1862         
1863         layer <- cb <- ca <- os -- no positioned node required
1864         layer <- cb <- os <- ca -- compositing parent skips overflow, need a "Moved" Positioned node.
1865         layer <- ov <- cb <- ca -- no positioned node required
1866         layer <- ov <- ca <- cb -- no positioned node required
1867         layer <- ca <- cb <- ov -- no positioned node required
1868         layer <- ca <- ov <- cb -- containing block skips overflow, need a "Stationary" Positioned node.
1869         
1870         [cb = containing block, ca = compositing ancestor, ov = overflow scroll]
1871
1872         Test: scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html
1873
1874         * rendering/RenderLayer.cpp:
1875         (WebCore::outputPaintOrderTreeRecursive):
1876         * rendering/RenderLayerCompositor.cpp:
1877         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
1878         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1879
1880 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1881
1882         Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes
1883         https://bugs.webkit.org/show_bug.cgi?id=195710
1884         <rdar://problem/48867502>
1885
1886         Reviewed by Zalan Bujtas.
1887
1888         A position:absolute layer whose containing block is outside an enclosing overflow:scroll, but
1889         whose compositing ancestor is the overflow or is inside it, needs to be composited so that
1890         we can make a Positioning scrolling tree node for it.
1891
1892         Handle this case as a "OverflowScrollPositioning" indirect compositing reason.
1893
1894         Test: compositing/layer-creation/absolute-in-async-overflow-scroll.html
1895
1896         * inspector/agents/InspectorLayerTreeAgent.cpp:
1897         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
1898         * rendering/RenderLayer.h:
1899         * rendering/RenderLayerCompositor.cpp:
1900         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1901         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1902         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1903         (WebCore::RenderLayerCompositor::logReasonsForCompositing):
1904         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1905         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
1906         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
1907         * rendering/RenderLayerCompositor.h: Generalize OverflowScrollingTouch to OverflowScrolling.
1908
1909 2019-03-20  Devin Rousso  <drousso@apple.com>
1910
1911         Web Inspector: Search: allow DOM searches to be case sensitive
1912         https://bugs.webkit.org/show_bug.cgi?id=194673
1913         <rdar://problem/48087577>
1914
1915         Reviewed by Timothy Hatcher.
1916
1917         Tests: inspector/dom/dom-search.html
1918                inspector/dom/dom-search-caseSensitive.html
1919
1920         Since `DOM.performSearch` also searches by selector and XPath, some results may appear
1921         as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
1922         as although the literal node name ("BODY") didn't match, it did match via selector/XPath.
1923
1924         * inspector/agents/InspectorDOMAgent.h:
1925         * inspector/agents/InspectorDOMAgent.cpp:
1926         (WebCore::InspectorDOMAgent::performSearch):
1927
1928         * inspector/InspectorNodeFinder.h:
1929         * inspector/InspectorNodeFinder.cpp:
1930         (WebCore::InspectorNodeFinder::InspectorNodeFinder):
1931         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
1932         (WebCore::InspectorNodeFinder::checkEquals): Added.
1933         (WebCore::InspectorNodeFinder::checkContains): Added.
1934         (WebCore::InspectorNodeFinder::checkStartsWith): Added.
1935         (WebCore::InspectorNodeFinder::checkEndsWith): Added.
1936         (WebCore::InspectorNodeFinder::matchesAttribute):
1937         (WebCore::InspectorNodeFinder::matchesElement):
1938         (WebCore::InspectorNodeFinder::searchUsingXPath):
1939         (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
1940
1941 2019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1942
1943         Remove copyRef() calls added in r243163
1944         https://bugs.webkit.org/show_bug.cgi?id=195962
1945
1946         Reviewed by Chris Dumez.
1947
1948         The first two cases here can just directly return the RefPtr.
1949
1950         In the third case, we have to work around a GCC 6 bug because GCC 6 is unable to pick the
1951         right constructor to use, unlike modern compilers.
1952
1953         * Modules/fetch/FetchBody.cpp:
1954         (WebCore::FetchBody::bodyAsFormData const):
1955         (WebCore::FetchBody::take):
1956
1957 2019-03-20  Alicia Boya García  <aboya@igalia.com>
1958
1959         [MSE][GStreamer] Fix handling of resolution changes in AppendPipeline
1960         https://bugs.webkit.org/show_bug.cgi?id=195855
1961
1962         Reviewed by Xabier Rodriguez-Calvar.
1963
1964         MediaSample instances produced by the AppendPipeline were not
1965         accounting for resolution changes. The causes of this are twofold:
1966
1967         1) m_presentationSize is set by connectDemuxerSrcPadToAppsink() (by
1968         calling parseDemuxerSrcPadCaps()), but not by appsinkCapsChanged().
1969
1970         2) appsinkCapsChanged() was being called in the main thread as an
1971         asynchronous task. In consequence, even if m_presentationSize is set
1972         there, many samples with the new resolution would still be wrapped in
1973         a MediaSampleGStreamer using the old resolution by the main thread
1974         running consumeAppsinkAvailableSamples() before appsinkCapsChanged()
1975         is dispatched.
1976
1977         This patch fixes these problems by updating m_presentationSize in
1978         appsinkCapsChanged() and making the streaming thread block until the
1979         main thread has dispatched appsinkCapsChanged(). This way the handling
1980         of caps changes is serialized with the handling of frames.
1981
1982         Test: media/media-source/media-source-samples-resolution-change.html
1983
1984         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1985         (WebCore::AppendPipeline::AppendPipeline):
1986         (WebCore::AppendPipeline::appsinkCapsChanged):
1987
1988 2019-03-20  Joanmarie Diggs  <jdiggs@igalia.com>
1989
1990         AX: Implement support for new meter ARIA role
1991         https://bugs.webkit.org/show_bug.cgi?id=195966
1992
1993         Reviewed by Chris Fleizach.
1994
1995         Add the new ARIA role to the internal rolemap so that it is treated
1996         in the same fashion as its HTML element counterpart.
1997
1998         No new tests. Instead add the role to the existing role-exposure tests.
1999
2000         * accessibility/AccessibilityObject.cpp:
2001         (WebCore::AccessibilityObject::isMeter const):
2002         (WebCore::initializeRoleMap):
2003         (WebCore::AccessibilityObject::computedRoleString const):
2004         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2005         (atkRole):
2006
2007 2019-03-20  Philippe Normand  <pnormand@igalia.com>
2008
2009         [GStreamer] Switch back to webkitwebsrc for adaptive streaming fragments downloading
2010         https://bugs.webkit.org/show_bug.cgi?id=195948
2011
2012         Reviewed by Xabier Rodriguez-Calvar.
2013
2014         The webkitwebsrc element now behaves much better when used through
2015         GStreamer's adaptivedemux, so use it for all WebKit media
2016         downloads. The MediaPlayer needed by the webkitwebsrc element now
2017         travels through GstContext messages and queries so that it can be
2018         shared by multiple elements, typically the first webkitwebsrc
2019         element downloads the HLS manifest and then adaptivedemux, through
2020         uridownloader, will create new webkitwebsrc elements for fragments
2021         downloading. Those new elements will query the first webkitwebsrc
2022         element for its context.
2023
2024         The previous hack used to check SecurityOrigins can
2025         also be cleaned-up. The origins are now cached upon reception of
2026         the HTTP headers message from webkitwebsrc.
2027
2028         No new tests, existing http/tests/media/hls tests cover this change.
2029
2030         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2031         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
2032         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2033         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2034         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2035         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
2036         (WebCore::convertToInternalProtocol): Deleted.
2037         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2038         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2039         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
2040         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2041         (webkit_web_src_class_init):
2042         (webKitWebSrcSetContext):
2043         (webKitWebSrcStart):
2044         (webKitWebSrcGetProtocols):
2045         (webKitWebSrcSetUri):
2046         (CachedResourceStreamingClient::responseReceived):
2047         (convertPlaybinURI): Deleted.
2048         (webKitSrcWouldTaintOrigin): Deleted.
2049         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2050
2051 2019-03-20  Thibault Saunier  <tsaunier@igalia.com>
2052
2053         [GStreamer][WebRTC]: Refactor to make the encoding happen synchronously
2054         https://bugs.webkit.org/show_bug.cgi?id=195674
2055
2056         This simplifies the code and make sure that everything is called from the right
2057         thread. It also makes it so we follow the same way of doing things as other libwebrtc
2058         encoders.
2059
2060         Also "s/codecSpecifiInfos/codecSpecificInfos/"
2061
2062         Reviewed by Philippe Normand.
2063
2064         No new test as this is just a refactoring
2065
2066         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2067         (WebCore::GStreamerVideoEncoder::InitEncode):
2068         (WebCore::GStreamerVideoEncoder::returnFromFlowReturn):
2069
2070 2019-03-20  Tim Horton  <timothy_horton@apple.com>
2071
2072         Add an platform-driven spell-checking mechanism
2073         https://bugs.webkit.org/show_bug.cgi?id=195795
2074
2075         Reviewed by Ryosuke Niwa.
2076
2077         * dom/Document.cpp:
2078         (WebCore::Document::textInserted):
2079         PlatformTextChecking markers are not expected
2080         to propagate to newly inserted text, so remove them.
2081
2082         * dom/DocumentMarker.h:
2083         (WebCore::DocumentMarker::allMarkers):
2084         Add a new type of DocumentMarker, PlatformTextChecking,
2085         and a new data variant that stores a key value pair of strings.
2086
2087         * dom/DocumentMarkerController.cpp:
2088         (WebCore::DocumentMarkerController::addPlatformTextCheckingMarker):
2089         (WebCore::DocumentMarkerController::removeMarkers):
2090         (WebCore::DocumentMarkerController::filterMarkers):
2091         (WebCore::shouldInsertAsSeparateMarker):
2092         * dom/DocumentMarkerController.h:
2093         Export some things.
2094         Add addPlatformTextCheckingMarker, like the others.
2095         Make it possible to filter out markers of a particular type
2096         in a range with a predicate function.
2097
2098         * editing/CompositeEditCommand.cpp:
2099         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
2100         Propagate PlatformTextChecking data.
2101         A future change should probably make it possible for
2102         any DocumentMarker to copy its data here, instead of
2103         special-casing each type that is important.
2104
2105         * editing/Editor.cpp:
2106         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2107         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
2108         (WebCore::Editor::markMisspellingsAndBadGrammar):
2109         * editing/TextCheckingHelper.cpp:
2110         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2111         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
2112         (WebCore::platformDrivenTextCheckerEnabled):
2113         * editing/TextCheckingHelper.h:
2114         Bail from traditional spell checking if this mechanism is
2115         enabled. (I wrote it this way to make it runtime switchable
2116         in the near future, and to be similar to unifiedTextCheckerEnabled).
2117
2118 2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>
2119
2120         [WebAuthN] Implement FIDO AppID extension
2121         https://bugs.webkit.org/show_bug.cgi?id=143491
2122         <rdar://problem/48298273>
2123
2124         Reviewed by Brent Fulgham.
2125
2126         This patch adds support for FIDO AppID extension: https://www.w3.org/TR/webauthn/#sctn-appid-extension.
2127         To be noticed, this implementation follows what spec suggested in the 'Note' session and what Chrome/Firefox
2128         do in practice to avoid some unnecessary steps of
2129         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-appid-and-facets-v2.0-id-20180227.html#determining-if-a-caller-s-facetid-is-authorized-for-an-appid.
2130
2131         In fido::convertToU2fSignCommand, the checkOnly flag is deleted as it is never used.
2132
2133         Covered by new tests in existing files.
2134
2135         * CMakeLists.txt:
2136         * DerivedSources-input.xcfilelist:
2137         * DerivedSources-output.xcfilelist:
2138         * DerivedSources.make:
2139         * Modules/webauthn/AuthenticationExtensionsClientInputs.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2140         (WebCore::AuthenticationExtensionsClientInputs::encode const):
2141         (WebCore::AuthenticationExtensionsClientInputs::decode):
2142         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
2143         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2144         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
2145         (WebCore::AuthenticatorCoordinator::create const):
2146         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
2147         * Modules/webauthn/PublicKeyCredential.cpp:
2148         (WebCore::PublicKeyCredential::tryCreate):
2149         (WebCore::PublicKeyCredential::PublicKeyCredential):
2150         (WebCore::PublicKeyCredential::getClientExtensionResults const):
2151         (WebCore::PublicKeyCredential::create): Deleted.
2152         * Modules/webauthn/PublicKeyCredential.h:
2153         * Modules/webauthn/PublicKeyCredential.idl:
2154         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2155         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
2156         * Modules/webauthn/PublicKeyCredentialData.h:
2157         (WebCore::PublicKeyCredentialData::encode const):
2158         (WebCore::PublicKeyCredentialData::decode):
2159         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
2160         (WebCore::PublicKeyCredentialRequestOptions::encode const):
2161         (WebCore::PublicKeyCredentialRequestOptions::decode):
2162         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
2163         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2164         (fido::readCTAPMakeCredentialResponse):
2165         (fido::readCTAPGetAssertionResponse):
2166         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2167         (fido::convertToU2fSignCommand):
2168         * Modules/webauthn/fido/U2fCommandConstructor.h:
2169         * Modules/webauthn/fido/U2fResponseConverter.cpp:
2170         (fido::readU2fRegisterResponse):
2171         (fido::readU2fSignResponse):
2172         * Sources.txt:
2173         * WebCore.xcodeproj/project.pbxproj:
2174
2175 2019-03-19  Devin Rousso  <drousso@apple.com>
2176
2177         Web Inspector: Debugger: lazily create the agent
2178         https://bugs.webkit.org/show_bug.cgi?id=195973
2179         <rdar://problem/49039674>
2180
2181         Reviewed by Joseph Pecoraro.
2182
2183         No change in functionality.
2184
2185         * inspector/WorkerInspectorController.cpp:
2186         (WebCore::WorkerInspectorController::WorkerInspectorController):
2187         (WebCore::WorkerInspectorController::createLazyAgents):
2188
2189         * inspector/agents/WebDebuggerAgent.cpp:
2190         (WebCore::WebDebuggerAgent::disable):
2191
2192         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2193         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
2194         (WebCore::InspectorDOMDebuggerAgent::discardAgent):
2195
2196 2019-03-18  Maciej Stachowiak  <mjs@apple.com>
2197
2198         Simplify Cocoa platform user agent logic by using string constants instead of function calls for the frozen parts
2199         https://bugs.webkit.org/show_bug.cgi?id=195936
2200
2201         Reviewed by Dean Jackson.
2202
2203         No new tests because no behavior changes. Existing behavior is tested by fast/dom/navigator-userAgent-frozen.html
2204
2205         * platform/UserAgent.h: Remove prototype of removed function.
2206         * platform/cocoa/UserAgentCocoa.mm:
2207         (WebCore::userAgentBundleVersion): Deleted.
2208         * platform/ios/UserAgentIOS.mm:
2209         * platform/ios/UserAgentIOS.mm:
2210         (WebCore::osNameForUserAgent): Use WTF String instead of NSString
2211         (WebCore::deviceNameForUserAgent): dutto
2212         (WebCore::standardUserAgentWithApplicationName): Simplify this
2213         function to account for WebKit version now being frozen. Also
2214         use String instead of NSString.
2215         * platform/mac/UserAgentMac.mm:
2216         (WebCore::standardUserAgentWithApplicationName): Simplify this
2217         function to account for CPU and WEbKit version now being
2218         frozen. Also avoid two separate but very similar calls to
2219         makeString().
2220
2221 2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>
2222
2223         Unreviewed adjustment to r242842 per Darin's request.
2224
2225         * platform/win/LoggingWin.cpp:
2226         (WebCore::logLevelString):
2227
2228 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2229
2230         Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
2231         https://bugs.webkit.org/show_bug.cgi?id=195960
2232
2233         Reviewed by Simon Fraser.
2234
2235         -- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<
2236            SVGPreserveAspectRatio>.
2237
2238         -- Make SVGPreserveAspectRatio be derived form SVGValueProperty<
2239            SVGPreserveAspectRatioValue>.
2240
2241         -- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated 
2242            property.
2243
2244         -- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated
2245            property of the target element and all its instances.
2246
2247         -- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of
2248            animated property in a period of time.
2249
2250         SVGFilterPrimitiveStandardAttributes::build() should be const function.
2251         This is required for this patch because SVGFEImageElement::build() calls
2252         SVGFEImageElement::preserveAspectRatio() which is const.
2253
2254         * Sources.txt:
2255         * WebCore.xcodeproj/project.pbxproj:
2256         * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
2257         * svg/SVGAnimatedPreserveAspectRatio.h: Removed.
2258         * svg/SVGAnimatorFactory.h:
2259         (WebCore::SVGAnimatorFactory::create):
2260         * svg/SVGFEBlendElement.cpp:
2261         (WebCore::SVGFEBlendElement::build const):
2262         (WebCore::SVGFEBlendElement::build): Deleted.
2263         * svg/SVGFEBlendElement.h:
2264         * svg/SVGFEColorMatrixElement.cpp:
2265         (WebCore::SVGFEColorMatrixElement::build const):
2266         (WebCore::SVGFEColorMatrixElement::build): Deleted.
2267         * svg/SVGFEColorMatrixElement.h:
2268         * svg/SVGFEComponentTransferElement.cpp:
2269         (WebCore::SVGFEComponentTransferElement::build const):
2270         (WebCore::SVGFEComponentTransferElement::build): Deleted.
2271         * svg/SVGFEComponentTransferElement.h:
2272         * svg/SVGFECompositeElement.cpp:
2273         (WebCore::SVGFECompositeElement::build const):
2274         (WebCore::SVGFECompositeElement::build): Deleted.
2275         * svg/SVGFECompositeElement.h:
2276         * svg/SVGFEConvolveMatrixElement.cpp:
2277         (WebCore::SVGFEConvolveMatrixElement::build const):
2278         (WebCore::SVGFEConvolveMatrixElement::build): Deleted.
2279         * svg/SVGFEConvolveMatrixElement.h:
2280         * svg/SVGFEDiffuseLightingElement.cpp:
2281         (WebCore::SVGFEDiffuseLightingElement::build const):
2282         (WebCore::SVGFEDiffuseLightingElement::build): Deleted.
2283         * svg/SVGFEDiffuseLightingElement.h:
2284         * svg/SVGFEDisplacementMapElement.cpp:
2285         (WebCore::SVGFEDisplacementMapElement::build const):
2286         (WebCore::SVGFEDisplacementMapElement::build): Deleted.
2287         * svg/SVGFEDisplacementMapElement.h:
2288         * svg/SVGFEDropShadowElement.cpp:
2289         (WebCore::SVGFEDropShadowElement::build const):
2290         (WebCore::SVGFEDropShadowElement::build): Deleted.
2291         * svg/SVGFEDropShadowElement.h:
2292         * svg/SVGFEFloodElement.cpp:
2293         (WebCore::SVGFEFloodElement::build const):
2294         (WebCore::SVGFEFloodElement::build): Deleted.
2295         * svg/SVGFEFloodElement.h:
2296         * svg/SVGFEGaussianBlurElement.cpp:
2297         (WebCore::SVGFEGaussianBlurElement::build const):
2298         (WebCore::SVGFEGaussianBlurElement::build): Deleted.
2299         * svg/SVGFEGaussianBlurElement.h:
2300         * svg/SVGFEImageElement.cpp:
2301         (WebCore::SVGFEImageElement::SVGFEImageElement):
2302         (WebCore::SVGFEImageElement::parseAttribute):
2303         (WebCore::SVGFEImageElement::build const):
2304         (WebCore::SVGFEImageElement::registerAttributes): Deleted.
2305         (WebCore::SVGFEImageElement::build): Deleted.
2306         * svg/SVGFEImageElement.h:
2307         * svg/SVGFEMergeElement.cpp:
2308         (WebCore::SVGFEMergeElement::build const):
2309         (WebCore::SVGFEMergeElement::build): Deleted.
2310         * svg/SVGFEMergeElement.h:
2311         * svg/SVGFEMorphologyElement.cpp:
2312         (WebCore::SVGFEMorphologyElement::build const):
2313         (WebCore::SVGFEMorphologyElement::build): Deleted.
2314         * svg/SVGFEMorphologyElement.h:
2315         * svg/SVGFEOffsetElement.cpp:
2316         (WebCore::SVGFEOffsetElement::build const):
2317         (WebCore::SVGFEOffsetElement::build): Deleted.
2318         * svg/SVGFEOffsetElement.h:
2319         * svg/SVGFESpecularLightingElement.cpp:
2320         (WebCore::SVGFESpecularLightingElement::build const):
2321         (WebCore::SVGFESpecularLightingElement::build): Deleted.
2322         * svg/SVGFESpecularLightingElement.h:
2323         * svg/SVGFETileElement.cpp:
2324         (WebCore::SVGFETileElement::build const):
2325         (WebCore::SVGFETileElement::build): Deleted.
2326         * svg/SVGFETileElement.h:
2327         * svg/SVGFETurbulenceElement.cpp:
2328         (WebCore::SVGFETurbulenceElement::build const):
2329         (WebCore::SVGFETurbulenceElement::build): Deleted.
2330         * svg/SVGFETurbulenceElement.h:
2331         * svg/SVGFilterPrimitiveStandardAttributes.h:
2332         * svg/SVGFitToViewBox.cpp:
2333         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
2334         (WebCore::SVGFitToViewBox::parseViewBox):
2335         (WebCore::SVGFitToViewBox::registerAttributes): Deleted.
2336         * svg/SVGFitToViewBox.h:
2337         (WebCore::SVGFitToViewBox::preserveAspectRatio const):
2338         (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
2339         (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
2340         (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
2341         (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
2342         * svg/SVGImageElement.cpp:
2343         (WebCore::SVGImageElement::SVGImageElement):
2344         (WebCore::SVGImageElement::registerAttributes):
2345         (WebCore::SVGImageElement::parseAttribute):
2346         * svg/SVGImageElement.h:
2347         * svg/SVGMarkerElement.h:
2348         * svg/SVGPatternElement.h:
2349         * svg/SVGPreserveAspectRatio.h:
2350         (WebCore::SVGPreserveAspectRatio::create):
2351         (WebCore::SVGPreserveAspectRatio::align const):
2352         (WebCore::SVGPreserveAspectRatio::setAlign):
2353         (WebCore::SVGPreserveAspectRatio::meetOrSlice const):
2354         (WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
2355         (WebCore::SVGPreserveAspectRatio::align): Deleted.
2356         (WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
2357         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.
2358         * svg/SVGSVGElement.h:
2359         * svg/SVGStringList.h:
2360         * svg/SVGSymbolElement.h:
2361         * svg/SVGViewSpec.h:
2362         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2363         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2364         * svg/properties/SVGAnimatedPropertyImpl.h:
2365         * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
2366         * svg/properties/SVGAttributeRegistry.h:
2367         * svg/properties/SVGPropertyOwnerRegistry.h:
2368         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2369
2370 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2371
2372         Remove the SVG property tear off objects of SVGAnimatedRect
2373         https://bugs.webkit.org/show_bug.cgi?id=195949
2374
2375         Reviewed by Simon Fraser.
2376
2377         SVGRect is an SVG type, so we need to introduce two classes to represent
2378         it and its animated property SVGAnimatedRect.
2379
2380         -- SVGValueProperty: It is derived from SVGProperty and it will be the 
2381            base class of all the SVG type based properties. It is basically a
2382            RefCounted object with m_value member. For SVGRect, m_value will be
2383            of type FloatRect.
2384
2385         -- SVGAnimatedValueProperty: It is derived from SVGAnimatedProperty and
2386            it will be the base class of all the animated SVG type based properties.
2387            It is RefCounted object with two RefCounted members: baseVal and animVal.
2388            These two members are of type SVGValueProperty. For SVGAnimatedRect,
2389            baseVal and animVal will be of type SVGRect.
2390
2391         SVGAnimatedValueProperty will be responsible for:
2392
2393         1) Providing access to its baseVal and animVal. Note the same interface
2394            is used internally and used by the DOM.
2395
2396         2) Managing the animation of the property by starting and stopping it.
2397
2398         3) Coordinating the changes in its baseVal and animVal with the owner
2399            element.
2400
2401         * Sources.txt:
2402         * WebCore.xcodeproj/project.pbxproj:
2403         * svg/SVGAnimatedRect.cpp: Removed.
2404         * svg/SVGAnimatedRect.h: Removed.
2405         * svg/SVGAnimatorFactory.h:
2406         (WebCore::SVGAnimatorFactory::create):
2407         * svg/SVGAttributeAnimationController.cpp:
2408         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
2409         This is a bug from r243036. The <set> can be the tag of m_animationElement
2410         not m_targetElement.
2411         * svg/SVGAttributeAnimationController.h:
2412         * svg/SVGAttributeAnimationControllerBase.h:
2413         * svg/SVGFitToViewBox.cpp:
2414         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
2415         (WebCore::SVGFitToViewBox::registerAttributes):
2416         (WebCore::SVGFitToViewBox::setViewBox):
2417         (WebCore::SVGFitToViewBox::resetViewBox):
2418         * svg/SVGFitToViewBox.h:
2419         (WebCore::SVGFitToViewBox::viewBox const):
2420         (WebCore::SVGFitToViewBox::viewBoxAnimated):
2421         (WebCore::SVGFitToViewBox::viewBoxString const):
2422         * svg/SVGMarkerElement.h:
2423         * svg/SVGPatternElement.h:
2424         * svg/SVGRect.h:
2425         (WebCore::SVGRect::create):
2426         (WebCore::SVGRect::x):
2427         (WebCore::SVGRect::setX):
2428         (WebCore::SVGRect::y):
2429         (WebCore::SVGRect::setY):
2430         (WebCore::SVGRect::width):
2431         (WebCore::SVGRect::setWidth):
2432         (WebCore::SVGRect::height):
2433         (WebCore::SVGRect::setHeight):
2434         (WebCore::SVGRect::SVGRect): Deleted.
2435         * svg/SVGSVGElement.cpp:
2436         (WebCore::checkIntersectionWithoutUpdatingLayout):
2437         (WebCore::checkEnclosureWithoutUpdatingLayout):
2438         * svg/SVGSVGElement.h:
2439         * svg/SVGSymbolElement.h:
2440         * svg/SVGViewSpec.cpp:
2441         (WebCore::SVGViewSpec::SVGViewSpec):
2442         * svg/SVGViewSpec.h:
2443         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2444         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2445         * svg/properties/SVGAnimatedPropertyImpl.h:
2446         * svg/properties/SVGAnimatedValueProperty.h: Added.
2447         (WebCore::SVGAnimatedValueProperty::create):
2448         (WebCore::SVGAnimatedValueProperty::~SVGAnimatedValueProperty):
2449         (WebCore::SVGAnimatedValueProperty::setBaseValInternal):
2450         (WebCore::SVGAnimatedValueProperty::baseVal const):
2451         (WebCore::SVGAnimatedValueProperty::baseVal):
2452         (WebCore::SVGAnimatedValueProperty::setAnimVal):
2453         (WebCore::SVGAnimatedValueProperty::animVal const):
2454         (WebCore::SVGAnimatedValueProperty::animVal):
2455         (WebCore::SVGAnimatedValueProperty::currentValue const):
2456         (WebCore::SVGAnimatedValueProperty::SVGAnimatedValueProperty):
2457         (WebCore::SVGAnimatedValueProperty::ensureAnimVal):
2458         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2459         (WebCore::SVGAnimationRectFunction::progress):
2460         * svg/properties/SVGAttributeRegistry.h:
2461         * svg/properties/SVGPropertyOwnerRegistry.h:
2462         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2463         * svg/properties/SVGValueProperty.h: Added.
2464         (WebCore::SVGValueProperty::create):
2465         (WebCore::SVGValueProperty::value const):
2466         (WebCore::SVGValueProperty::setValue):
2467         (WebCore::SVGValueProperty::value):
2468         (WebCore::SVGValueProperty::SVGValueProperty):
2469
2470 2019-03-19  John Wilander  <wilander@apple.com>
2471
2472         Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
2473         https://bugs.webkit.org/show_bug.cgi?id=195923
2474         <rdar://problem/49001272>
2475
2476         Reviewed by Alex Christensen.
2477
2478         Adds a new experimental feature.
2479
2480         Test: http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
2481
2482         * page/RuntimeEnabledFeatures.h:
2483         (WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled):
2484         (WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const):
2485
2486 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
2487
2488         Reparenting during a mutation event inside appendChild could result in a circular DOM tree
2489         https://bugs.webkit.org/show_bug.cgi?id=192825
2490
2491         Reviewed by Zalan Bujtas.
2492
2493         The bug was caused by appendChildWithoutPreInsertionValidityCheck, insertBefore and replaceChild
2494         checking the circular dependency against newChild instead of targets even though when newChild
2495         is a document fragment, appendChildWithoutPreInsertionValidityCheck inserts the children of
2496         the document fragment. Fixed the bug by checking the circular dependency against each target child.
2497
2498         Also fixed the bug that checkAcceptChildGuaranteedNodeTypes was not considering shadow inclusive
2499         ancestors or template host elements.
2500
2501         Tests: fast/dom/append-child-with-mutation-event-removal-and-circular-insertion.html
2502                fast/dom/append-child-with-mutation-event-removal-and-circular-shadow-insertion.html
2503                fast/dom/append-child-with-mutation-event-removal-and-circular-template-insertion.html
2504                fast/dom/insert-child-with-mutation-event-removal-and-circular-insertion.html
2505                fast/dom/insert-child-with-mutation-event-removal-and-circular-shadow-insertion.html
2506                fast/dom/insert-child-with-mutation-event-removal-and-circular-template-insertion.html
2507                fast/dom/replace-child-with-mutation-event-removal-and-circular-insertion.html
2508                fast/dom/replace-child-with-mutation-event-removal-and-circular-shadow-insertion.html
2509                fast/dom/replace-child-with-mutation-event-removal-and-circular-template-insertion.html
2510
2511         * dom/ContainerNode.cpp:
2512         (WebCore::checkAcceptChildGuaranteedNodeTypes):
2513         (WebCore::ContainerNode::insertBefore):
2514         (WebCore::ContainerNode::replaceChild):
2515         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
2516
2517 2019-03-19  Brent Fulgham  <bfulgham@apple.com>
2518
2519         Add default prompt implementation for the Storage Access API
2520         https://bugs.webkit.org/show_bug.cgi?id=195866
2521         <rdar://problem/45150009>
2522
2523         Reviewed by Chris Dumez.
2524
2525         * en.lproj/Localizable.strings: Update with new strings used by the
2526         Storage Access API dialog.
2527
2528 2019-03-19  Thibault Saunier  <tsaunier@igalia.com>
2529
2530         [GStreamer][WebRTC] Create sps/pps for all frames to please libwebrtc
2531         https://bugs.webkit.org/show_bug.cgi?id=195677
2532
2533         Reviewed by Xabier Rodriguez-Calvar.
2534
2535         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
2536         (gst_webrtc_video_encoder_set_format):
2537         (register_known_encoder):
2538         (setup_x264enc):
2539         (setup_openh264enc):
2540         (setup_omxh264enc):
2541         (set_bitrate_bit_per_sec):
2542         (gst_webrtc_video_encoder_class_init):
2543
2544 2019-03-19  Timothy Hatcher  <timothy@apple.com>
2545
2546         REGRESSION (r239904): Update dark mode defines in a few places that got missed.
2547         https://bugs.webkit.org/show_bug.cgi?id=195958
2548
2549         Reviewed by Megan Gardner.
2550
2551         * DerivedSources.make: Support HAVE_OS_DARK_MODE_SUPPORT in html.css.
2552         * css/html.css: Update dark mode defines.
2553         * page/FrameView.cpp:
2554         (WebCore::FrameView::updateBackgroundRecursively): Ditto.
2555
2556 2019-03-19  Chris Dumez  <cdumez@apple.com>
2557
2558         media/track/track-in-band-style.html is flaky
2559         https://bugs.webkit.org/show_bug.cgi?id=195922
2560
2561         Reviewed by Eric Carlson.
2562
2563         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2564         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
2565         Small optimization: some of the if checks were missing their "continue;"
2566         statement. This would cause us to keep checking following keys even though
2567         we already got a match.
2568
2569 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2570
2571         Build cleanly with GCC 9
2572         https://bugs.webkit.org/show_bug.cgi?id=195920
2573
2574         Reviewed by Chris Dumez.
2575
2576         WebKit triggers three new GCC 9 warnings:
2577
2578         """
2579         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
2580         declared copy constructor and assignment operator if one of them is user-provided.
2581         """
2582
2583         Solution is to either add a copy constructor or copy assignment operator, if required, or
2584         else remove one if it is redundant.
2585
2586         """
2587         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
2588         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
2589         """
2590
2591         These account for most of this patch. Solution is to just remove the bad WTFMove().
2592
2593         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
2594         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
2595         would be safer to not use memcpy on nontrivial types, but that's too complex for this
2596         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
2597
2598         * Modules/encryptedmedia/CDM.cpp:
2599         (WebCore::CDM::getSupportedConfiguration):
2600         * Modules/encryptedmedia/MediaKeys.cpp:
2601         (WebCore::MediaKeys::createSession):
2602         * Modules/entriesapi/DOMFileSystem.cpp:
2603         (WebCore::listDirectoryWithMetadata):
2604         (WebCore::toFileSystemEntries):
2605         * Modules/fetch/FetchBody.cpp:
2606         (WebCore::FetchBody::fromFormData):
2607         (WebCore::FetchBody::bodyAsFormData const):
2608         (WebCore::FetchBody::take):
2609         * Modules/fetch/FetchRequest.cpp:
2610         (WebCore::FetchRequest::create):
2611         (WebCore::FetchRequest::clone):
2612         * Modules/fetch/FetchResponse.cpp:
2613         (WebCore::FetchResponse::create):
2614         (WebCore::FetchResponse::redirect):
2615         (WebCore::FetchResponse::clone):
2616         * Modules/indexeddb/IDBCursor.cpp:
2617         (WebCore::IDBCursor::update):
2618         (WebCore::IDBCursor::deleteFunction):
2619         * Modules/indexeddb/IDBDatabase.cpp:
2620         (WebCore::IDBDatabase::transaction):
2621         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2622         (WebCore::IDBDatabaseIdentifier::decode):
2623         * Modules/indexeddb/IDBKeyData.h:
2624         (WebCore::IDBKeyData::decode):
2625         * Modules/indexeddb/IDBObjectStore.cpp:
2626         (WebCore::IDBObjectStore::createIndex):
2627         (WebCore::IDBObjectStore::index):
2628         * Modules/indexeddb/IDBValue.h:
2629         (WebCore::IDBValue::decode):
2630         * Modules/indexeddb/shared/IDBError.cpp:
2631         (WebCore::IDBError::operator=): Deleted.
2632         * Modules/indexeddb/shared/IDBError.h:
2633         * Modules/indexeddb/shared/IDBResultData.h:
2634         (WebCore::IDBResultData::decode):
2635         * Modules/mediarecorder/MediaRecorder.cpp:
2636         (WebCore::MediaRecorder::create):
2637         * Modules/mediasource/MediaSource.cpp:
2638         (WebCore::MediaSource::addSourceBuffer):
2639         * Modules/mediastream/RTCPeerConnection.cpp:
2640         (WebCore::iceServersFromConfiguration):
2641         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
2642         (WebCore::certificateTypeFromAlgorithmIdentifier):
2643         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2644         (WebCore::LibWebRTCMediaEndpoint::getStats):
2645         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2646         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2647         (WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
2648         * Modules/webaudio/AudioBuffer.cpp:
2649         (WebCore::AudioBuffer::create):
2650         * Modules/webaudio/AudioContext.cpp:
2651         (WebCore::AudioContext::createMediaElementSource):
2652         (WebCore::AudioContext::createMediaStreamSource):
2653         (WebCore::AudioContext::createScriptProcessor):
2654         * Modules/webaudio/OfflineAudioContext.cpp:
2655         (WebCore::OfflineAudioContext::create):
2656         * Modules/webdatabase/DatabaseManager.cpp:
2657         (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
2658         * Modules/webdatabase/DatabaseTracker.cpp:
2659         (WebCore::DatabaseTracker::canEstablishDatabase):
2660         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
2661         * Modules/webdatabase/SQLResultSetRowList.cpp:
2662         (WebCore::SQLResultSetRowList::item const):
2663         * Modules/websockets/WebSocket.cpp:
2664         (WebCore::WebSocket::create):
2665         * accessibility/AXObjectCache.cpp:
2666         (WebCore::AXObjectCache::rangeForNodeContents):
2667         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
2668         * animation/KeyframeEffect.cpp:
2669         (WebCore::KeyframeEffect::create):
2670         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
2671         * bindings/js/JSCustomElementInterface.cpp:
2672         (WebCore::JSCustomElementInterface::constructElementWithFallback):
2673         * bindings/js/JSDOMConvertVariadic.h:
2674         (WebCore::VariadicConverter::convert):
2675         (WebCore::convertVariadicArguments):
2676         * bindings/js/SerializedScriptValue.cpp:
2677         (WebCore::CloneDeserializer::readDOMPointInit):
2678         (WebCore::transferArrayBuffers):
2679         * bindings/scripts/CodeGeneratorJS.pm:
2680         (GenerateCallbackImplementationContent):
2681         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2682         (WebCore::JSTestCallbackFunction::handleEvent):
2683         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
2684         (WebCore::JSTestCallbackFunctionRethrow::handleEvent):
2685         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2686         (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
2687         (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
2688         (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
2689         (WebCore::JSTestCallbackInterface::callbackWithThisObject):
2690         * contentextensions/ContentExtensionParser.cpp:
2691         (WebCore::ContentExtensions::getStringList):
2692         (WebCore::ContentExtensions::loadTrigger):
2693         (WebCore::ContentExtensions::loadEncodedRules):
2694         (WebCore::ContentExtensions::parseRuleList):
2695         * crypto/SubtleCrypto.cpp:
2696         (WebCore::normalizeCryptoAlgorithmParameters):
2697         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2698         (WebCore::calculateSignature):
2699         * crypto/keys/CryptoKeyEC.cpp:
2700         (WebCore::CryptoKeyEC::exportJwk const):
2701         * css/CSSComputedStyleDeclaration.cpp:
2702         (WebCore::computedTransform):
2703         (WebCore::ComputedStyleExtractor::valueForShadow):
2704         (WebCore::ComputedStyleExtractor::valueForFilter):
2705         (WebCore::specifiedValueForGridTrackSize):
2706         (WebCore::valueForGridTrackList):
2707         (WebCore::valueForGridPosition):
2708         (WebCore::willChangePropertyValue):
2709         (WebCore::fontVariantLigaturesPropertyValue):
2710         (WebCore::fontVariantNumericPropertyValue):
2711         (WebCore::fontVariantEastAsianPropertyValue):
2712         (WebCore::touchActionFlagsToCSSValue):
2713         (WebCore::renderTextDecorationFlagsToCSSValue):
2714         (WebCore::renderEmphasisPositionFlagsToCSSValue):
2715         (WebCore::speakAsToCSSValue):
2716         (WebCore::hangingPunctuationToCSSValue):
2717         (WebCore::fillRepeatToCSSValue):
2718         (WebCore::fillSizeToCSSValue):
2719         (WebCore::counterToCSSValue):
2720         (WebCore::fontVariantFromStyle):
2721         (WebCore::fontSynthesisFromStyle):
2722         (WebCore::shapePropertyValue):
2723         (WebCore::paintOrder):
2724         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2725         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
2726         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
2727         * css/CSSFontFaceSet.cpp:
2728         (WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
2729         * css/CSSGradientValue.cpp:
2730         (WebCore::CSSGradientValue::image):
2731         * css/CSSStyleSheet.cpp:
2732         (WebCore::CSSStyleSheet::rules):
2733         * css/DOMMatrixReadOnly.cpp:
2734         (WebCore::DOMMatrixReadOnly::parseStringIntoAbstractMatrix):
2735         * css/FontFace.cpp:
2736         (WebCore::FontFace::create):
2737         * css/FontVariantBuilder.cpp:
2738         (WebCore::computeFontVariant):
2739         * css/PropertySetCSSStyleDeclaration.cpp:
2740         (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
2741         * css/SVGCSSComputedStyleDeclaration.cpp:
2742         (WebCore::strokeDashArrayToCSSValueList):
2743         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
2744         * css/StyleBuilderConverter.h:
2745         (WebCore::StyleBuilderConverter::convertReflection):
2746         * css/WebKitCSSMatrix.cpp:
2747         (WebCore::WebKitCSSMatrix::create):
2748         (WebCore::WebKitCSSMatrix::multiply const):
2749         * css/parser/CSSPropertyParser.cpp:
2750         (WebCore::consumeFontVariationSettings):
2751         (WebCore::consumeBasicShapePath):
2752         (WebCore::consumeImplicitGridAutoFlow):
2753         * cssjit/StackAllocator.h:
2754         * dom/DOMImplementation.cpp:
2755         (WebCore::DOMImplementation::createDocument):
2756         * dom/Document.cpp:
2757         (WebCore::Document::cloneNodeInternal):
2758         * dom/DocumentFragment.cpp:
2759         (WebCore::DocumentFragment::cloneNodeInternal):
2760         * dom/Element.cpp:
2761         (WebCore::Element::setAttributeNode):
2762         (WebCore::Element::setAttributeNodeNS):
2763         (WebCore::Element::removeAttributeNode):
2764         (WebCore::Element::parseAttributeName):
2765         (WebCore::Element::animate):
2766         * dom/MessagePort.cpp:
2767         (WebCore::MessagePort::disentanglePorts):
2768         * dom/NodeIterator.cpp:
2769         (WebCore::NodeIterator::nextNode):
2770         (WebCore::NodeIterator::previousNode):
2771         * dom/Range.cpp:
2772         (WebCore::Range::processContents):
2773         (WebCore::processContentsBetweenOffsets):
2774         (WebCore::processAncestorsAndTheirSiblings):
2775         * dom/RangeBoundaryPoint.h:
2776         * dom/ScriptDisallowedScope.h:
2777         (WebCore::ScriptDisallowedScope::operator=):
2778         * dom/Text.cpp:
2779         (WebCore::Text::splitText):
2780         * dom/TextDecoder.cpp:
2781         (WebCore::TextDecoder::create):
2782         (WebCore::TextDecoder::decode):
2783         * editing/CompositeEditCommand.cpp:
2784         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
2785         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2786         * editing/Editing.cpp:
2787         (WebCore::createTabSpanElement):
2788         * editing/EditingStyle.cpp:
2789         (WebCore::EditingStyle::styleAtSelectionStart):
2790         * editing/TextIterator.cpp:
2791         (WebCore::TextIterator::rangeFromLocationAndLength):
2792         * editing/VisibleSelection.cpp:
2793         (WebCore::makeSearchRange):
2794         * editing/markup.cpp:
2795         (WebCore::styleFromMatchedRulesAndInlineDecl):
2796         (WebCore::createFragmentForInnerOuterHTML):
2797         (WebCore::createContextualFragment):
2798         * html/FormController.cpp:
2799         (WebCore::deserializeFormControlState):
2800         * html/HTMLCanvasElement.cpp:
2801         (WebCore::HTMLCanvasElement::captureStream):
2802         * html/HTMLMediaElement.cpp:
2803         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
2804         * html/HTMLOptionElement.cpp:
2805         (WebCore::HTMLOptionElement::createForJSConstructor):
2806         * html/HTMLPlugInImageElement.cpp:
2807         (WebCore::HTMLPlugInImageElement::createElementRenderer):
2808         * html/HTMLTableElement.cpp:
2809         (WebCore::HTMLTableElement::createSharedCellStyle):
2810         * html/HTMLTableRowElement.cpp:
2811         (WebCore::HTMLTableRowElement::insertCell):
2812         * html/ImageData.cpp:
2813         (WebCore::ImageData::create):
2814         * html/OffscreenCanvas.cpp:
2815         (WebCore::OffscreenCanvas::transferToImageBitmap):
2816         * html/canvas/CanvasRenderingContext2DBase.cpp:
2817         (WebCore::CanvasRenderingContext2DBase::createLinearGradient):
2818         (WebCore::CanvasRenderingContext2DBase::createRadialGradient):
2819         * html/canvas/OESVertexArrayObject.cpp:
2820         (WebCore::OESVertexArrayObject::createVertexArrayOES):
2821         * html/canvas/WebGLRenderingContextBase.cpp:
2822         (WebCore::WebGLRenderingContextBase::createBuffer):
2823         (WebCore::WebGLRenderingContextBase::createFramebuffer):
2824         (WebCore::WebGLRenderingContextBase::createTexture):
2825         (WebCore::WebGLRenderingContextBase::createProgram):
2826         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
2827         (WebCore::WebGLRenderingContextBase::createShader):
2828         (WebCore::WebGLRenderingContextBase::getContextAttributes):
2829         (WebCore::WebGLRenderingContextBase::getUniform):
2830         * html/shadow/TextControlInnerElements.cpp:
2831         (WebCore::TextControlInnerContainer::resolveCustomStyle):
2832         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
2833         * html/track/BufferedLineReader.cpp:
2834         (WebCore::BufferedLineReader::nextLine):
2835         * html/track/VTTCue.cpp:
2836         (WebCore::VTTCue::getCueAsHTML):
2837         (WebCore::VTTCue::createCueRenderingTree):
2838         * html/track/WebVTTElement.cpp:
2839         (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
2840         * inspector/InspectorStyleSheet.cpp:
2841         (WebCore::asCSSRuleList):
2842         (WebCore::InspectorStyle::buildObjectForStyle const):
2843         (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
2844         (WebCore::InspectorStyleSheet::buildObjectForRule):
2845         * inspector/agents/InspectorCSSAgent.cpp:
2846         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2847         * inspector/agents/InspectorDOMAgent.cpp:
2848         (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
2849         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2850         * inspector/agents/InspectorNetworkAgent.cpp:
2851         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2852         * loader/FetchOptions.h:
2853         (WebCore::FetchOptions::decode):
2854         * loader/MediaResourceLoader.cpp:
2855         (WebCore::MediaResourceLoader::requestResource):
2856         * loader/appcache/ApplicationCacheStorage.cpp:
2857         (WebCore::ApplicationCacheStorage::loadCache):
2858         (WebCore::ApplicationCacheStorage::manifestURLs):
2859         * loader/archive/mhtml/MHTMLParser.cpp:
2860         (WebCore::MHTMLParser::parseArchiveWithHeader):
2861         * loader/cache/CachedResourceLoader.cpp:
2862         (WebCore::CachedResourceLoader::requestResource):
2863         * page/DOMWindow.cpp:
2864         (WebCore::DOMWindow::getMatchedCSSRules const):
2865         * page/DragController.cpp:
2866         (WebCore::documentFragmentFromDragData):
2867         * page/EventSource.cpp:
2868         (WebCore::EventSource::create):
2869         * page/PerformanceUserTiming.cpp:
2870         (WebCore::UserTiming::mark):
2871         (WebCore::UserTiming::measure):
2872         * page/SecurityOrigin.h:
2873         (WebCore::SecurityOrigin::decode):
2874         * page/scrolling/ScrollingConstraints.h:
2875         (WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints):
2876         (WebCore::LayoutConstraints::LayoutConstraints): Deleted.
2877         * platform/Length.h:
2878         (WebCore::Length::Length):
2879         * platform/animation/TimingFunction.cpp:
2880         (WebCore::TimingFunction::createFromCSSText):
2881         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2882         (WebCore::parseLicenseFormat):
2883         * platform/graphics/FloatPoint3D.h:
2884         * platform/graphics/Font.cpp:
2885         (WebCore::createAndFillGlyphPage):
2886         * platform/graphics/GLContext.cpp:
2887         (WebCore::GLContext::createContextForWindow):
2888         (WebCore::GLContext::createSharingContext):
2889         * platform/graphics/GraphicsContext.cpp:
2890         * platform/graphics/HEVCUtilities.cpp:
2891         (WebCore::parseHEVCCodecParameters):
2892         * platform/graphics/gtk/ImageGtk.cpp:
2893         (WebCore::loadImageFromGResource):
2894         (WebCore::loadMissingImageIconFromTheme):
2895         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2896         (WebCore::PlatformDisplayWayland::create):
2897         * platform/mediastream/MediaConstraints.h:
2898         (WebCore::MediaTrackConstraintSetMap::decode):
2899         * platform/mediastream/MediaStreamRequest.h:
2900         (WebCore::MediaStreamRequest::decode):
2901         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
2902         (WebCore::GStreamerSampleFromLibWebRTCVideoFrame):
2903         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
2904         (WebCore::RealtimeIncomingAudioSource::create):
2905         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
2906         (WebCore::RealtimeIncomingVideoSource::create):
2907         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2908         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
2909         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2910         (WebCore::MockMediaSample::createNonDisplayingCopy const):
2911         * platform/network/BlobRegistryImpl.cpp:
2912         (WebCore::BlobRegistryImpl::createResourceHandle):
2913         * platform/network/CookieRequestHeaderFieldProxy.h:
2914         (WebCore::CookieRequestHeaderFieldProxy::decode):
2915         * platform/network/FormData.h:
2916         (WebCore::FormData::decode):
2917         * platform/network/MIMEHeader.cpp:
2918         (WebCore::MIMEHeader::parseHeader):
2919         * platform/network/ResourceHandle.cpp:
2920         (WebCore::ResourceHandle::create):
2921         * platform/network/soup/DNSResolveQueueSoup.cpp:
2922         (WebCore::DNSResolveQueueSoup::takeCompletionAndCancelHandlers):
2923         * rendering/RenderElement.cpp:
2924         (WebCore::RenderElement::createFor):
2925         * rendering/shapes/Shape.cpp:
2926         (WebCore::Shape::createRasterShape):
2927         (WebCore::Shape::createBoxShape):
2928         * rendering/style/BasicShapes.cpp:
2929         (WebCore::BasicShapeCircle::blend const):
2930         (WebCore::BasicShapeEllipse::blend const):
2931         (WebCore::BasicShapePolygon::blend const):
2932         (WebCore::BasicShapePath::blend const):
2933         (WebCore::BasicShapeInset::blend const):
2934         * rendering/style/BasicShapes.h:
2935         (WebCore::BasicShapeRadius::BasicShapeRadius):
2936         * rendering/style/ContentData.cpp:
2937         (WebCore::ImageContentData::createContentRenderer const):
2938         (WebCore::TextContentData::createContentRenderer const):
2939         (WebCore::QuoteContentData::createContentRenderer const):
2940         * rendering/style/ContentData.h:
2941         * rendering/svg/RenderSVGInline.cpp:
2942         (WebCore::RenderSVGInline::createInlineFlowBox):
2943         * rendering/svg/RenderSVGInlineText.cpp:
2944         (WebCore::RenderSVGInlineText::createTextBox):
2945         * rendering/svg/RenderSVGText.cpp:
2946         (WebCore::RenderSVGText::createRootInlineBox):
2947         * svg/SVGFEBlendElement.cpp:
2948         (WebCore::SVGFEBlendElement::build):
2949         * svg/SVGFEColorMatrixElement.cpp:
2950         (WebCore::SVGFEColorMatrixElement::build):
2951         * svg/SVGFEComponentTransferElement.cpp:
2952         (WebCore::SVGFEComponentTransferElement::build):
2953         * svg/SVGFECompositeElement.cpp:
2954         (WebCore::SVGFECompositeElement::build):
2955         * svg/SVGFEConvolveMatrixElement.cpp:
2956         (WebCore::SVGFEConvolveMatrixElement::build):
2957         * svg/SVGFEDiffuseLightingElement.cpp:
2958         (WebCore::SVGFEDiffuseLightingElement::build):
2959         * svg/SVGFEDisplacementMapElement.cpp:
2960         (WebCore::SVGFEDisplacementMapElement::build):
2961         * svg/SVGFEDropShadowElement.cpp:
2962         (WebCore::SVGFEDropShadowElement::build):
2963         * svg/SVGFEGaussianBlurElement.cpp:
2964         (WebCore::SVGFEGaussianBlurElement::build):
2965         * svg/SVGFEMergeElement.cpp:
2966         (WebCore::SVGFEMergeElement::build):
2967         * svg/SVGFEMorphologyElement.cpp:
2968         (WebCore::SVGFEMorphologyElement::build):
2969         * svg/SVGFEOffsetElement.cpp:
2970         (WebCore::SVGFEOffsetElement::build):
2971         * svg/SVGFESpecularLightingElement.cpp:
2972         (WebCore::SVGFESpecularLightingElement::build):
2973         * svg/SVGFETileElement.cpp:
2974         (WebCore::SVGFETileElement::build):
2975         * svg/SVGTransformList.h:
2976         * svg/properties/SVGList.h:
2977         (WebCore::SVGList::initialize):
2978         (WebCore::SVGList::insertItemBefore):
2979         (WebCore::SVGList::replaceItem):
2980         (WebCore::SVGList::removeItem):
2981         (WebCore::SVGList::appendItem):
2982         * svg/properties/SVGListProperty.h:
2983         (WebCore::SVGListProperty::initializeValuesAndWrappers):
2984         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2985         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2986         (WebCore::SVGListProperty::removeItemValues):
2987         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
2988         * svg/properties/SVGPrimitiveList.h:
2989         * testing/Internals.cpp:
2990         (WebCore::Internals::elementRenderTreeAsText):
2991         (WebCore::parseFindOptions):
2992         * workers/AbstractWorker.cpp:
2993         (WebCore::AbstractWorker::resolveURL):
2994         * workers/Worker.cpp:
2995         (WebCore::Worker::create):
2996         * workers/service/ServiceWorkerJobData.h:
2997         (WebCore::ServiceWorkerJobData::decode):
2998         * xml/DOMParser.cpp:
2999         (WebCore::DOMParser::parseFromString):
3000         * xml/XPathExpression.cpp:
3001         (WebCore::XPathExpression::evaluate):
3002
3003 2019-03-19  Devin Rousso  <drousso@apple.com>
3004
3005         Web Inspector: Provide $event in the console when paused on an event listener
3006         https://bugs.webkit.org/show_bug.cgi?id=188672
3007
3008         Reviewed by Timothy Hatcher.
3009
3010         Implement similiar methods/logic as to the way that `$exception` is set.
3011
3012         * inspector/CommandLineAPIModuleSource.js:
3013         (CommandLineAPI):
3014
3015         * inspector/InspectorInstrumentation.h:
3016         (WebCore::InspectorInstrumentation::willHandleEvent):
3017         * inspector/InspectorInstrumentation.cpp:
3018         (WebCore::InspectorInstrumentation::willHandleEventImpl):
3019         (WebCore::InspectorInstrumentation::didHandleEventImpl):
3020
3021         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
3022         * inspector/agents/InspectorDOMDebuggerAgent.h:
3023         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
3024         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
3025         (WebCore::InspectorDOMDebuggerAgent::didHandleEvent): Added.
3026
3027 2019-03-19  Devin Rousso  <drousso@apple.com>
3028
3029         Web Inspector: ScriptProfiler: lazily create the agent
3030         https://bugs.webkit.org/show_bug.cgi?id=195591
3031         <rdar://problem/48791756>
3032
3033         Reviewed by Joseph Pecoraro.
3034
3035         No change in functionality.
3036
3037         * inspector/InspectorController.cpp:
3038         (WebCore::InspectorController::InspectorController):
3039         (WebCore::InspectorController::createLazyAgents):
3040
3041 2019-03-19  Devin Rousso  <drousso@apple.com>
3042
3043         Web Inspector: DOMStorage: lazily create the agent
3044         https://bugs.webkit.org/show_bug.cgi?id=195588
3045         <rdar://problem/48791878>
3046
3047         Reviewed by Joseph Pecoraro.
3048
3049         No change in functionality.
3050
3051         Make functions used by `CommandLineAPIHost` static so that an `InspectorDOMStorageAgent`
3052         doesn't need to be created to call them.
3053
3054         * inspector/agents/InspectorDOMStorageAgent.h:
3055         * inspector/agents/InspectorDOMStorageAgent.cpp:
3056         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
3057         (WebCore::InspectorDOMStorageAgent::enable):
3058         (WebCore::InspectorDOMStorageAgent::disable):
3059         (WebCore::InspectorDOMStorageAgent::storageId):
3060         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
3061         (WebCore::InspectorDOMStorageAgent::findStorageArea):
3062         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent): Deleted.
3063
3064         * inspector/CommandLineAPIHost.h:
3065         (WebCore::CommandLineAPIHost::init):
3066         * inspector/CommandLineAPIHost.cpp:
3067         (WebCore::CommandLineAPIHost::disconnect):
3068         (WebCore::CommandLineAPIHost::storageId):
3069
3070         * inspector/InspectorController.cpp:
3071         (WebCore::InspectorController::InspectorController):
3072         (WebCore::InspectorController::createLazyAgents):
3073         * inspector/WorkerInspectorController.cpp:
3074         (WebCore::WorkerInspectorController::WorkerInspectorController):
3075
3076 2019-03-19  Youenn Fablet  <youenn@apple.com>
3077
3078         REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
3079         https://bugs.webkit.org/show_bug.cgi?id=195779
3080
3081         Reviewed by Chris Dumez.
3082
3083         When requesting space, we might delay execution of the task.
3084         In such a case, a task to close the database might be done before the task continues.
3085         Check that the database is not closing to continue the task.
3086         This should ensure that the cross thread queue is not already killed.
3087
3088         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3089         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
3090
3091 2019-03-19  Zalan Bujtas  <zalan@apple.com>
3092
3093         RenderElement::startAnimation should take const Animation&
3094         https://bugs.webkit.org/show_bug.cgi?id=195929
3095
3096         Reviewed by Daniel Bates.
3097
3098         * animation/KeyframeEffect.cpp:
3099         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
3100         * page/animation/KeyframeAnimation.cpp:
3101         (WebCore::KeyframeAnimation::startAnimation):
3102         (WebCore::KeyframeAnimation::endAnimation):
3103         * rendering/RenderElement.h:
3104         (WebCore::RenderElement::startAnimation):
3105         (WebCore::RenderElement::animationFinished):
3106         * rendering/RenderLayerBacking.cpp:
3107         (WebCore::RenderLayerBacking::startAnimation):
3108         * rendering/RenderLayerBacking.h:
3109         * rendering/RenderLayerModelObject.cpp:
3110         (WebCore::RenderLayerModelObject::startAnimation):
3111         (WebCore::RenderLayerModelObject::animationFinished):
3112         * rendering/RenderLayerModelObject.h:
3113
3114 2019-03-19  Devin Rousso  <drousso@apple.com>
3115
3116         Web Inspector: Heap: lazily create the agent
3117         https://bugs.webkit.org/show_bug.cgi?id=195590
3118         <rdar://problem/48791750>
3119
3120         Reviewed by Joseph Pecoraro.
3121
3122         No change in functionality.
3123
3124         * inspector/agents/page/PageHeapAgent.cpp:
3125         (WebCore::PageHeapAgent::disable):
3126         * inspector/agents/WebHeapAgent.h:
3127         * inspector/agents/WebHeapAgent.cpp:
3128         (WebCore::WebHeapAgent::WebHeapAgent):
3129         (WebCore::WebHeapAgent::enable): Added.
3130         (WebCore::WebHeapAgent::disable):
3131
3132         * inspector/agents/page/PageConsoleAgent.h:
3133         * inspector/agents/page/PageConsoleAgent.cpp:
3134         (WebCore::PageConsoleAgent::PageConsoleAgent):
3135         * inspector/agents/WebConsoleAgent.h:
3136         * inspector/agents/WebConsoleAgent.cpp:
3137         (WebCore::WebConsoleAgent::WebConsoleAgent):
3138         * inspector/agents/worker/WorkerConsoleAgent.h:
3139         * inspector/agents/worker/WorkerConsoleAgent.cpp:
3140         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
3141
3142         * inspector/InspectorController.cpp:
3143         (WebCore::InspectorController::InspectorController):
3144         (WebCore::InspectorController::createLazyAgents):
3145         * inspector/WorkerInspectorController.cpp:
3146         (WebCore::WorkerInspectorController::WorkerInspectorController):
3147         (WebCore::WorkerInspectorController::createLazyAgents):
3148
3149 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
3150
3151         Fix GraphicsLayer-related crashes after r243129
3152         https://bugs.webkit.org/show_bug.cgi?id=195953
3153
3154         Reviewed by Dean Jackson.
3155
3156         Extending the lifetime of GraphicsLayers by referencing them in the scrolling tree (r243129)
3157         revealed a bug where RenderLayerCompositor was failing to clear itself as the client of
3158         GraphicsLayers that it owned, causing crashes.
3159
3160         Fix by using the GraphicsLayer::unparentAndClear() helper to clean up all the GraphicsLayers
3161         owned by RenderLayerCompositor.
3162
3163         * rendering/RenderLayerCompositor.cpp:
3164         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
3165         * rendering/RenderLayerCompositor.h:
3166
3167 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
3168
3169         [Async overflow] Handle positioned nodes in a few more places
3170         https://bugs.webkit.org/show_bug.cgi?id=195946
3171
3172         Reviewed by Zalan Bujtas.
3173
3174         When I added support for positioned nodes in the scrolling tree I missed handling
3175         the ScrollCoordinationRole::Positioning in a few places.
3176
3177         I wasn't able to come up with a test for this; when a positioned node toggles between
3178         tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
3179         update the node with the new layer.
3180
3181         * rendering/RenderLayer.cpp:
3182         (WebCore::outputPaintOrderTreeRecursive): Logging.
3183         * rendering/RenderLayerBacking.cpp:
3184         (WebCore::operator<<): Logging.
3185         * rendering/RenderLayerCompositor.cpp:
3186         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
3187         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.
3188
3189 2019-03-19  Alex Christensen  <achristensen@webkit.org>
3190
3191         Make WTFLogChannelState and WTFLogLevel enum classes
3192         https://bugs.webkit.org/show_bug.cgi?id=195904
3193
3194         Reviewed by Eric Carlson.
3195
3196         * Modules/mediasource/SourceBuffer.cpp:
3197         (WebCore::removeSamplesFromTrackBuffer):
3198         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3199         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
3200         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
3201         * dom/Document.cpp:
3202         (WebCore::messageLevelFromWTFLogLevel):
3203         * html/FTPDirectoryDocument.cpp:
3204         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
3205         * html/HTMLMediaElement.cpp:
3206         (WebCore::HTMLMediaElement::seekTask):
3207         (WebCore::HTMLMediaElement::selectNextSourceChild):
3208         (WebCore::HTMLMediaElement::sourceWasAdded):
3209         (WebCore::HTMLMediaElement::sourceWasRemoved):
3210         * inspector/agents/WebConsoleAgent.cpp:
3211         (WebCore::WebConsoleAgent::getLoggingChannels):
3212         (WebCore::channelConfigurationForString):
3213         * platform/Logging.cpp:
3214         (WebCore::isLogChannelEnabled):
3215         (WebCore::setLogChannelToAccumulate):
3216         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3217         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3218         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3219         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3220         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3221         (WebCore::initializePeerConnectionFactoryAndThreads):
3222         * rendering/RenderLayerCompositor.cpp:
3223         (WebCore::compositingLogEnabled):
3224
3225 2019-03-19  Philippe Normand  <pnormand@igalia.com>
3226
3227         REGRESSION(r243058): [GStreamer] 3 tests now timing out
3228         https://bugs.webkit.org/show_bug.cgi?id=195888
3229
3230         Reviewed by Xabier Rodriguez-Calvar.
3231
3232         A breaking change was introduced in r243058. Now on-disk-buffering
3233         is disabled when the reported Content-Length is 0 or not present
3234         at all. This broke the progress event logic in didLoadProgress()
3235         because leading to progress events not being fired as expected.
3236
3237         The proposed solution is to make webkitwebsrc notify the player
3238         every time the network process receives data from the network. So
3239         the player can now easily determine if the load progressed by
3240         checking the reported statistics.
3241
3242         No new tests, existing media tests cover this change.
3243
3244         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3245         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3246         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
3247         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3248         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3249         (CachedResourceStreamingClient::dataReceived):
3250
3251 2019-03-19  Alicia Boya García  <aboya@igalia.com>
3252
3253         [MSE] Use tolerance in eraseBeginTime
3254         https://bugs.webkit.org/show_bug.cgi?id=195911
3255
3256         Reviewed by Jer Noble.
3257
3258         https://bugs.webkit.org/show_bug.cgi?id=190085 introduced tolerance
3259         when erasing frames during the Coded Frame Processing algorithm in
3260         such a way that, in files with less than perfect timestamps, a frame
3261         existing before after the current append is not erased accidentally
3262         due to small overlaps.
3263
3264         This patch takes care of the opposite problem: we don't want an old
3265         frame being accidentally NOT erased by a new one with the same
3266         timestamps just because these overlaps make
3267         highestPresentationTimestamp very slightly higher than the frame PTS.
3268
3269         This bug in practice causes some frames of the old quality to not be
3270         erased when the new quality is appended, resulting in some seemingly
3271         still frames from a different quality appearing at some points during
3272         WebM video in presence of quality changes.
3273
3274         This bug can be reduced to this minimal test case that illustrates the
3275         timestamp imprecission of a typical WebM file:
3276
3277         function sampleRun(generation) {
3278             return concatenateSamples([
3279                 makeASample(     0,      0, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation),
3280                 makeASample(167000, 167000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
3281                 makeASample(333000, 333000, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation), // overlaps previous frame
3282                 makeASample(500000, 500000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
3283             ]);
3284         }
3285
3286         After appending this twice it would be expected that the second
3287         generation takes fully over the first, since the timestamps are
3288         completely the same. Due to the bug, sync frames with an overlap, like
3289         the third one in that list, actually persist from the first
3290         generation, due to lack of tolerance when comparing the start of a new
3291         frame with highestPresentationTimestamp.
3292
3293         This patch introduces the tolerance in that case too to fix this
3294         problem.
3295
3296         Test: media/media-source/media-source-append-twice-overlapping-sync-frame.html
3297
3298         * Modules/mediasource/SourceBuffer.cpp:
3299         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3300
3301 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3302
3303         Unreviewed GTK build fix
3304         https://bugs.webkit.org/show_bug.cgi?id=195863
3305         <rdar://problem/49006248>
3306
3307         Patch by Diego Pino.
3308
3309         * svg/SVGTests.h:
3310
3311 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3312
3313         Unreviewed, rolling out r243132.
3314
3315         Broke GTK build
3316
3317         Reverted changeset:
3318
3319         "Make WTFLogChannelState and WTFLogLevel enum classes"
3320         https://bugs.webkit.org/show_bug.cgi?id=195904
3321         https://trac.webkit.org/changeset/243132
3322
3323 2019-03-19  Antti Koivisto  <antti@apple.com>
3324
3325         Layer with no backing store should still hit-test over a scroller
3326         https://bugs.webkit.org/show_bug.cgi?id=195378
3327         <rdar://problem/48652078>
3328
3329         Reviewed by Simon Fraser.
3330
3331         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
3332                fast/scrolling/ios/overflow-scroll-overlap-4.html
3333
3334         Move collecting event region from paint to compositing update time.
3335         This solves a number of problems including regions for non-painting layers.
3336
3337         * platform/graphics/GraphicsLayer.h:
3338         * rendering/RenderBlock.cpp:
3339         (WebCore::RenderBlock::paintObject):
3340
3341         Use the existing visibleToHitTesting() helper.
3342
3343         * rendering/RenderLayer.cpp:
3344         (WebCore::RenderLayer::paintLayerContents):
3345
3346         Use flag for event region collecting, don't paint content.
3347
3348         (WebCore::RenderLayer::paintList):
3349
3350         We can bail out immediately if there is no overflow.
3351
3352         (WebCore::RenderLayer::paintForegroundForFragments):
3353         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
3354         (WebCore::RenderLayer::collectEventRegionForFragments):
3355
3356         Move to a separate function.
3357
3358         * rendering/RenderLayer.h:
3359         * rendering/RenderLayerBacking.cpp:
3360         (WebCore::RenderLayerBacking::updateConfiguration):
3361
3362         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
3363
3364         (WebCore::RenderLayerBacking::updateEventRegion):
3365         (WebCore::RenderLayerBacking::paintIntoLayer):
3366         * rendering/RenderLayerBacking.h:
3367
3368 2019-03-18  Alex Christensen  <achristensen@webkit.org>
3369
3370         Make WTFLogChannelState and WTFLogLevel enum classes
3371         https://bugs.webkit.org/show_bug.cgi?id=195904
3372
3373         Reviewed by Eric Carlson.
3374
3375         * Modules/mediasource/SourceBuffer.cpp:
3376         (WebCore::removeSamplesFromTrackBuffer):
3377         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3378         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
3379         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
3380         * dom/Document.cpp:
3381         (WebCore::messageLevelFromWTFLogLevel):
3382         * html/FTPDirectoryDocument.cpp:
3383         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
3384         * html/HTMLMediaElement.cpp:
3385         (WebCore::HTMLMediaElement::seekTask):
3386         (WebCore::HTMLMediaElement::selectNextSourceChild):
3387         (WebCore::HTMLMediaElement::sourceWasAdded):
3388         (WebCore::HTMLMediaElement::sourceWasRemoved):
3389         * inspector/agents/WebConsoleAgent.cpp:
3390         (WebCore::WebConsoleAgent::getLoggingChannels):
3391         (WebCore::channelConfigurationForString):
3392         * platform/Logging.cpp:
3393         (WebCore::isLogChannelEnabled):
3394         (WebCore::setLogChannelToAccumulate):
3395         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3396         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3397         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3398         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3399         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3400         (WebCore::initializePeerConnectionFactoryAndThreads):
3401         * rendering/RenderLayerCompositor.cpp:
3402         (WebCore::compositingLogEnabled):
3403
3404 2019-03-18  Said Abou-Hallawa  <sabouhalla