[GStreamer] Remove the HLS queue buffering query hack
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-27  Philippe Normand  <pnormand@igalia.com>
2
3         [GStreamer] Remove the HLS queue buffering query hack
4         https://bugs.webkit.org/show_bug.cgi?id=196244
5
6         Reviewed by Xabier Rodriguez-Calvar.
7
8         Because the http src element now provides network statistics to
9         the player we can now compute an estimation of the data loading in
10         case the buffering query isn't handled by any element of the
11         pipeline.
12
13         No new tests, existing HLS tests cover this change.
14
15         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
16         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
17         (WebCore::findHLSQueue): Deleted.
18         (WebCore::isHLSProgressing): Deleted.
19
20 2019-03-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
21
22         Unreviewed Windows build fix
23         https://bugs.webkit.org/show_bug.cgi?id=196083
24         <rdar://problem/49121836>
25
26         * svg/SVGAnimatorFactory.h:
27         (WebCore::SVGAnimatorFactory::isSupportedAttributeType):
28
29 2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
30
31         [Cocoa] Refactor some helper functions for building UserAgent strings
32         https://bugs.webkit.org/show_bug.cgi?id=195990
33
34         Reviewed by Brent Fulgham.
35
36         Add an optional argument to standardUserAgentWithApplicationName to request the desktop version of the user
37         agent in Cocoa platforms. Work towards refactoring some codepaths to make the implementation of the "Request
38         Desktop Site" feature in Safari a bit more straightforward.
39
40         No change in behavior.
41
42         * platform/UserAgent.h:
43         * platform/ios/UserAgentIOS.mm:
44         (WebCore::standardUserAgentWithApplicationName):
45
46         The corresponding macOS version is currently hard-coded — the followup bug webkit.org/b/196275 tracks making
47         this dynamically fetch the paired macOS version when building for iOS.
48
49         * platform/mac/UserAgentMac.mm:
50         (WebCore::standardUserAgentWithApplicationName):
51
52 2019-03-26  Said Abou-Hallawa  <said@apple.com>
53
54         Remove the SVG tear off objects for SVGLength, SVGLengthList and SVGAnimatedLengthList
55         https://bugs.webkit.org/show_bug.cgi?id=196083
56
57         Reviewed by Simon Fraser.
58
59         -- SVGLength will be a superclass of SVGValueProperty<SVGLengthValue>. It
60            is a wrapper of SVGLengthValue. It will be provide the DOM methods. It
61            can setValueAsString() and return valueAsString().
62
63         -- SVGLengthList will be a superclass of SVGValuePropertyList<SVGLength>.
64            The base class will provide all the DOM methods. SVGLengthList will be
65            responsible for parsing a String to a SVGLength items. It can also 
66            build a string representing the stored items.
67
68         -- SVGAnimatedLengthList will be defined as SVGAnimatedPropertyList<SVGLengthList>.
69            Like SVGAnimatedPointList, all the required methods and attributes
70            will be handled by SVGAnimatedPropertyList.
71
72         -- SVGAnimatedLengthAccessor and SVGAnimatedLengthListAccessor will be
73            added to access the members of types SVGAnimatedLength and 
74            SVGAnimatedLengthList.
75
76         -- SVGAnimatedLengthAnimator and SVGAnimatedLengthListAnimator will be
77            created by the the new accessors to animate attributes of types
78            SVGAnimatedLength and SVGAnimatedLengthList.
79
80         -- SVGAnimationLengthFunction and SVGAnimationLengthListFunction will be
81            responsible for progressing the animVal() of attributes of types
82            SVGAnimatedLength and SVGAnimatedLengthList.
83
84         -- SVGValuePropertyAnimator is a new template class which can animate a
85            none reflecting attribute which should be backed by a value property,
86            e.g. SVGLength.
87
88         -- SVGValuePropertyListAnimator is a new template class which can animate a
89            none reflecting attribute which should be backed by a value property
90            list, e.g. SVGLengthList.
91
92         Notes:
93
94             -- SVGElement::isAnimatedStyleAttribute() will return true if the
95                attribute is known by SVGPropertyAnimatorFactory. Or it's has 
96                a reflecting SVGAnimatedPropertyLength property and its name is
97                one of the names listed in isAnimatedStylePropertyAttribute() of
98                the propertyRegistry() of the SVGElement.
99
100             -- SVGElement::commitPropertyChange() has to handle the attributes
101                for which isAnimatedStylePropertyAttribute() returns true different
102                from the other ones. styleReclac() needs updated attributes since
103                it does not access the reflecting properties in the SVGELement.
104
105             -- SVGTextContentElement does not need a customized SVGAnimatedLength.
106                All SVGTextContentElement::textLengthAnimated() needs to know is
107                whether m_textLength->baseVal() holds an empty SVGLength. If it
108                does, it sets its value to getComputedTextLength().
109
110         * Sources.txt:
111         * WebCore.xcodeproj/project.pbxproj:
112         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
113         (WebCore::updateCharacterData):
114         (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
115         * svg/SVGAnimateElementBase.cpp:
116         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
117         * svg/SVGAnimatedLength.cpp: Removed.
118         * svg/SVGAnimatedLength.h: Removed.
119         * svg/SVGAnimatedLengthList.cpp: Removed.
120         * svg/SVGAnimatedLengthList.h: Removed.
121         * svg/SVGAnimatedType.h:
122         (WebCore::SVGAnimatedType::type const):
123         * svg/SVGAnimationElement.cpp:
124         (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty):
125         (WebCore::inheritsFromProperty):
126         * svg/SVGAnimatorFactory.h:
127         (WebCore::SVGAnimatorFactory::isSupportedAttribute):
128         (WebCore::SVGAnimatorFactory::create):
129         These changes were required because some of the tests were trying to
130         animated unsupported attributes. To differentiate between between the
131         these two cases:
132             1) the attribute is animate-able by the legacy controller.
133             2) animating the attribute or the attribute itself is not supported
134                by the element.
135
136         We want SVGAnimatorFactory tell us whether it can create an animator for
137         a given attribute or not.
138
139         * svg/SVGCircleElement.cpp:
140         (WebCore::SVGCircleElement::SVGCircleElement):
141         (WebCore::SVGCircleElement::parseAttribute):
142         (WebCore::SVGCircleElement::svgAttributeChanged):
143         (WebCore::SVGCircleElement::registerAttributes): Deleted.
144         * svg/SVGCircleElement.h:
145         * svg/SVGCursorElement.cpp:
146         (WebCore::SVGCursorElement::SVGCursorElement):
147         (WebCore::SVGCursorElement::parseAttribute):
148         (WebCore::SVGCursorElement::svgAttributeChanged):
149         (WebCore::SVGCursorElement::registerAttributes): Deleted.
150         * svg/SVGCursorElement.h:
151         * svg/SVGElement.cpp:
152         (WebCore::SVGElement::commitPropertyChange):
153         (WebCore::SVGElement::isAnimatedStyleAttribute const):
154         * svg/SVGElement.h:
155         * svg/SVGEllipseElement.cpp:
156         (WebCore::SVGEllipseElement::SVGEllipseElement):
157         (WebCore::SVGEllipseElement::parseAttribute):
158         (WebCore::SVGEllipseElement::svgAttributeChanged):
159         (WebCore::SVGEllipseElement::registerAttributes): Deleted.
160         * svg/SVGEllipseElement.h:
161         * svg/SVGFilterElement.cpp:
162         (WebCore::SVGFilterElement::SVGFilterElement):
163         (WebCore::SVGFilterElement::registerAttributes):
164         (WebCore::SVGFilterElement::parseAttribute):
165         * svg/SVGFilterElement.h:
166         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
167         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
168         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
169         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): Deleted.
170         * svg/SVGFilterPrimitiveStandardAttributes.h:
171         (WebCore::SVGFilterPrimitiveStandardAttributes::x const):
172         (WebCore::SVGFilterPrimitiveStandardAttributes::y const):
173         (WebCore::SVGFilterPrimitiveStandardAttributes::width const):
174         (WebCore::SVGFilterPrimitiveStandardAttributes::height const):
175         (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated):
176         (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated):
177         (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated):
178         (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated):
179         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute): Deleted.
180         * svg/SVGForeignObjectElement.cpp:
181         (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
182         (WebCore::SVGForeignObjectElement::parseAttribute):
183         (WebCore::SVGForeignObjectElement::registerAttributes): Deleted.
184         * svg/SVGForeignObjectElement.h:
185         * svg/SVGImageElement.cpp:
186         (WebCore::SVGImageElement::SVGImageElement):
187         (WebCore::SVGImageElement::parseAttribute):
188         (WebCore::SVGImageElement::registerAttributes): Deleted.
189         * svg/SVGImageElement.h:
190         * svg/SVGLength.h:
191         (WebCore::SVGLength::create):
192         (WebCore::SVGLength::clone const):
193         (WebCore::SVGLength::unitType):
194         (WebCore::SVGLength::valueForBindings):
195         (WebCore::SVGLength::setValueForBindings):
196         (WebCore::SVGLength::valueInSpecifiedUnits):
197         (WebCore::SVGLength::setValueInSpecifiedUnits):
198         (WebCore::SVGLength::setValueAsString):
199         (WebCore::SVGLength::newValueSpecifiedUnits):
200         (WebCore::SVGLength::convertToSpecifiedUnits):
201         (WebCore::SVGLength::valueAsString): Deleted.
202         (WebCore::SVGLength::SVGLength): Deleted.
203         * svg/SVGLengthList.h:
204         (WebCore::SVGLengthList::create):
205         (WebCore::SVGLengthList::lengthMode const):
206         (WebCore::SVGLengthList::parse):
207         (WebCore::SVGLengthList::SVGLengthList):
208         * svg/SVGLengthListValues.cpp: Removed.
209         * svg/SVGLengthListValues.h: Removed.
210         * svg/SVGLineElement.cpp:
211         (WebCore::SVGLineElement::SVGLineElement):
212         (WebCore::SVGLineElement::parseAttribute):
213         (WebCore::SVGLineElement::svgAttributeChanged):
214         (WebCore::SVGLineElement::registerAttributes): Deleted.
215         * svg/SVGLineElement.h:
216         * svg/SVGLinearGradientElement.cpp:
217         (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
218         (WebCore::SVGLinearGradientElement::parseAttribute):
219         (WebCore::SVGLinearGradientElement::svgAttributeChanged):
220         (WebCore::SVGLinearGradientElement::registerAttributes): Deleted.
221         * svg/SVGLinearGradientElement.h:
222         * svg/SVGMarkerElement.cpp:
223         (WebCore::SVGMarkerElement::SVGMarkerElement):
224         (WebCore::SVGMarkerElement::registerAttributes):
225         (WebCore::SVGMarkerElement::parseAttribute):
226         * svg/SVGMarkerElement.h:
227         * svg/SVGMaskElement.cpp:
228         (WebCore::SVGMaskElement::SVGMaskElement):
229         (WebCore::SVGMaskElement::registerAttributes):
230         (WebCore::SVGMaskElement::parseAttribute):
231         (WebCore::SVGMaskElement::svgAttributeChanged):
232         * svg/SVGMaskElement.h:
233         * svg/SVGPatternElement.cpp:
234         (WebCore::SVGPatternElement::SVGPatternElement):
235         (WebCore::SVGPatternElement::registerAttributes):
236         (WebCore::SVGPatternElement::parseAttribute):
237         * svg/SVGPatternElement.h:
238         * svg/SVGPoint.h:
239         * svg/SVGRadialGradientElement.cpp:
240         (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
241         (WebCore::SVGRadialGradientElement::parseAttribute):
242         (WebCore::SVGRadialGradientElement::svgAttributeChanged):
243         (WebCore::SVGRadialGradientElement::registerAttributes): Deleted.
244         * svg/SVGRadialGradientElement.h:
245         * svg/SVGRectElement.cpp:
246         (WebCore::SVGRectElement::SVGRectElement):
247         (WebCore::SVGRectElement::parseAttribute):
248         (WebCore::SVGRectElement::svgAttributeChanged):
249         (WebCore::SVGRectElement::registerAttributes): Deleted.
250         * svg/SVGRectElement.h:
251         * svg/SVGSVGElement.cpp:
252         (WebCore::SVGSVGElement::SVGSVGElement):
253         (WebCore::SVGSVGElement::parseAttribute):
254         (WebCore::SVGSVGElement::svgAttributeChanged):
255         (WebCore::SVGSVGElement::registerAttributes): Deleted.
256         * svg/SVGSVGElement.h:
257         * svg/SVGTextContentElement.cpp:
258         (WebCore::SVGTextContentElement::SVGTextContentElement):
259         (WebCore::SVGTextContentElement::registerAttributes):
260         (WebCore::SVGTextContentElement::parseAttribute):
261         (WebCore::SVGTextContentElement::svgAttributeChanged):
262         (WebCore::SVGTextContentElement::textLengthAnimated):
263         * svg/SVGTextContentElement.h:
264         (WebCore::SVGTextContentElement::specifiedTextLength const):
265         (WebCore::SVGTextContentElement::textLength const):
266         (WebCore::SVGTextContentElement::specifiedTextLength): Deleted.
267         (WebCore::SVGTextContentElement::textLengthAnimated): Deleted.
268         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute): Deleted.
269         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize): Deleted.
270         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty): Deleted.
271         * svg/SVGTextPathElement.cpp:
272         (WebCore::SVGTextPathElement::SVGTextPathElement):
273         (WebCore::SVGTextPathElement::registerAttributes):
274         (WebCore::SVGTextPathElement::parseAttribute):
275         * svg/SVGTextPathElement.h:
276         * svg/SVGTextPositioningElement.cpp:
277         (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
278         (WebCore::SVGTextPositioningElement::parseAttribute):
279         (WebCore::SVGTextPositioningElement::svgAttributeChanged):
280         (WebCore::SVGTextPositioningElement::registerAttributes): Deleted.
281         * svg/SVGTextPositioningElement.h:
282         (WebCore::SVGTextPositioningElement::x const):
283         (WebCore::SVGTextPositioningElement::y const):
284         (WebCore::SVGTextPositioningElement::dx const):
285         (WebCore::SVGTextPositioningElement::dy const):
286         (WebCore::SVGTextPositioningElement::xAnimated):
287         (WebCore::SVGTextPositioningElement::yAnimated):
288         (WebCore::SVGTextPositioningElement::dxAnimated):
289         (WebCore::SVGTextPositioningElement::dyAnimated):
290         (WebCore::SVGTextPositioningElement::isKnownAttribute): Deleted.
291         * svg/SVGUseElement.cpp:
292         (WebCore::SVGUseElement::SVGUseElement):
293         (WebCore::SVGUseElement::parseAttribute):
294         (WebCore::SVGUseElement::svgAttributeChanged):
295         (WebCore::SVGUseElement::registerAttributes): Deleted.
296         * svg/SVGUseElement.h:
297         * svg/SVGValue.h:
298         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
299         * svg/properties/SVGAnimatedPropertyAnimator.h:
300         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
301         * svg/properties/SVGAnimatedPropertyImpl.h:
302         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
303         (WebCore::SVGAnimationLengthListFunction::SVGAnimationLengthListFunction):
304         (WebCore::SVGAnimationLengthListFunction::progress):
305         (WebCore::SVGAnimationNumberListFunction::progress):
306         (WebCore::SVGAnimationPointListFunction::progress):
307         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
308         (WebCore::SVGAnimationLengthFunction::SVGAnimationLengthFunction):
309         (WebCore::SVGAnimationLengthFunction::progress):
310         * svg/properties/SVGAttributeAnimator.cpp:
311         (WebCore::SVGAttributeAnimator::isAnimatedStylePropertyAniamtor const):
312         * svg/properties/SVGAttributeAnimator.h:
313         * svg/properties/SVGAttributeRegistry.h:
314         * svg/properties/SVGPropertyAnimatorFactory.h:
315         (WebCore::SVGPropertyAnimatorFactory::createLengthAnimator):
316         (WebCore::SVGPropertyAnimatorFactory::createLengthListAnimator):
317         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
318         * svg/properties/SVGPropertyOwnerRegistry.h:
319         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
320         (WebCore::SVGPropertyOwnerRegistry::isAnimatedLengthAttribute):
321         * svg/properties/SVGPropertyRegistry.h:
322         * svg/properties/SVGValuePropertyAnimator.h: Added.
323         (WebCore::SVGValuePropertyAnimator::SVGValuePropertyAnimator):
324         * svg/properties/SVGValuePropertyAnimatorImpl.h: Added.
325         * svg/properties/SVGValuePropertyListAnimator.h: Added.
326         (WebCore::SVGValuePropertyListAnimator::SVGValuePropertyListAnimator):
327         * svg/properties/SVGValuePropertyListAnimatorImpl.h: Added.
328
329 2019-03-26  Simon Fraser  <simon.fraser@apple.com>
330
331         [iOS WK2] position:fixed inside oveflow:scroll is jumpy
332         https://bugs.webkit.org/show_bug.cgi?id=196238
333
334         Reviewed by Antti Koivisto.
335         
336         We were inadvertently making Positioned nodes for position:fixed, which is unnecessary because
337         Fixed nodes handle them, and harmful because they introduced unwanted layer movement.
338
339         Tests: scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html
340                scrollingcoordinator/ios/fixed-in-overflow-scroll.html
341
342         * rendering/RenderLayerCompositor.cpp:
343         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
344
345 2019-03-26  Dean Jackson  <dino@apple.com>
346
347         vertexAttribPointer must restrict offset parameter
348         https://bugs.webkit.org/show_bug.cgi?id=196261
349         <rdar://problem/48458086>
350
351         Reviewed by Antoine Quint.
352
353         This WebGL function should fail if the offset parameter is
354         not within [0, max 32-bit int].
355
356         Test: fast/canvas/webgl/vertexAttribPointer-with-bad-offset.html
357
358         * html/canvas/WebGLRenderingContextBase.cpp:
359         (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
360
361 2019-03-26  Antoine Quint  <graouts@apple.com>
362
363         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
364         https://bugs.webkit.org/show_bug.cgi?id=196254
365         <rdar://problem/49124334>
366
367         Unreviewed. Fix build broken by previous commit.
368
369         * dom/Event.cpp:
370         * dom/Event.h:
371         (WebCore::Event::hasEncounteredListener const): Deleted.
372         (WebCore::Event::setHasEncounteredListener): Deleted.
373         * dom/EventTarget.cpp:
374         (WebCore::EventTarget::innerInvokeEventListeners):
375
376 2019-03-26  Zalan Bujtas  <zalan@apple.com>
377
378         [ContentChangeObserver] Skip anonymous renderers when checking for "willRespondToMouseClickEvents"
379         https://bugs.webkit.org/show_bug.cgi?id=196259
380         <rdar://problem/49240029>
381
382         Reviewed by Dean Jackson.
383
384         Anonymous renderers don't have associated DOM nodes so they can't have event listeners either. Let's skip them.
385
386         Test: fast/events/touch/ios/content-observation/crash-on-anonymous-renderer.html
387
388         * page/ios/ContentChangeObserver.cpp:
389         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
390
391 2019-03-26  Antoine Quint  <graouts@apple.com>
392
393         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
394         https://bugs.webkit.org/show_bug.cgi?id=196254
395         <rdar://problem/49124334>
396
397         Reviewed by Dean Jackson.
398
399         * page/Quirks.cpp:
400         (WebCore::Quirks::shouldMousemoveEventHandlingPreventDefault const): Deleted.
401         * page/Quirks.h:
402         * page/RuntimeEnabledFeatures.h:
403         (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
404         (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const): Deleted.
405         (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled): Deleted.
406
407 2019-03-26  Commit Queue  <commit-queue@webkit.org>
408
409         Unreviewed, rolling out r243493.
410         https://bugs.webkit.org/show_bug.cgi?id=196257
411
412         broke the non-gst-gl build (Requested by philn on #webkit).
413
414         Reverted changeset:
415
416         "Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is
417         enabled"
418         https://bugs.webkit.org/show_bug.cgi?id=196178
419         https://trac.webkit.org/changeset/243493
420
421 2019-03-26  Mike Gorse  <mgorse@alum.wpi.edu>
422
423         Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is enabled
424         https://bugs.webkit.org/show_bug.cgi?id=196178
425
426         Reviewed by Philippe Normand.
427
428         No new tests (build fix).
429
430         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
431         Include gst/gl/gl.h before including GraphicsContext3D.h.
432
433 2019-03-26  Philippe Normand  <pnormand@igalia.com>
434
435         [GStreamer] Sound loop with Google Hangouts and WhatsApp notifications
436         https://bugs.webkit.org/show_bug.cgi?id=189471
437
438         Reviewed by Xabier Rodriguez-Calvar.
439
440         The media duration is now cached (again). The loop issue was
441         triggered by the previous version of the code returning positive
442         infinite duration in didEnd(), followed by the timeupdate event
443         propagation that would trick the HTMLMediaElement into a new call
444         to play(). Now the cached duration is updated to current position
445         at EOS (for forward playback direction only), so the media element
446         no longer triggers a new play call for those cases.
447
448         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
449         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
450         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
451         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
452         (WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
453         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
454         (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):
455         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
456         (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
457         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
458         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
459         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
460
461 2019-03-26  Antti Koivisto  <antti@apple.com>
462
463         Hit-testing on layers overlapping scrollers should hit-test on text boxes
464         https://bugs.webkit.org/show_bug.cgi?id=195373
465         <rdar://problem/48649865>
466
467         Reviewed by Simon Fraser.
468
469         * rendering/InlineFlowBox.cpp:
470         (WebCore::InlineFlowBox::paint):
471         * rendering/InlineTextBox.cpp:
472         (WebCore::InlineTextBox::paint):
473
474         Collect event region for overflowing line boxes.
475
476         * rendering/SimpleLineLayoutFunctions.cpp:
477         (WebCore::SimpleLineLayout::paintFlow):
478
479         Collect event region for overflowing simple lines.
480
481 2019-03-25  Alex Christensen  <achristensen@webkit.org>
482
483         Expected shouldn't assume its contained types are copyable
484         https://bugs.webkit.org/show_bug.cgi?id=195986
485
486         Reviewed by JF Bastien.
487
488         * contentextensions/ContentExtensionParser.cpp:
489         (WebCore::ContentExtensions::loadAction):
490
491 2019-03-20  Ryosuke Niwa  <rniwa@webkit.org>
492
493         Leak of SVGFontFaceElement when RenderStyle holds onto a FontRances which uses it
494         https://bugs.webkit.org/show_bug.cgi?id=196059
495
496         Reviewed by Zalan Bujtas.
497
498         SVGFontFaceElement keeps its RenderStyle alive via ElementRareData but RenderStyle can hold onto FontRanges
499         and therefore CSSFontSource, which in turn keeps SVGFontFaceElement alive, making a reference cycle.
500
501         More precisely, there are two reference cycles:
502         SVGFontFaceElement (1) -> ElementRareData -> StyleInheritedData -> FontCascade -> FontCascadeFonts (2)
503         FontCascadeFonts (2) -> FontRanges (3)
504         FontCascadeFonts (2) -> CSSFontSelector -> CSSFontFaceSet -> CSSSegmentedFontFace -> FontRanges (3)
505         FontRanges (3) -> CSSFontAccessor > CSSFontFace > CSSFontSource -> SVGFontFaceElement (1)
506
507         No new tests. Unfortunately, writing a test proved to be intractable. The leak can be reproduced by running
508         svg/text/text-text-05-t.svg then svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html consecutively.
509
510         * css/CSSFontFaceSource.cpp:
511         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
512         (WebCore::CSSFontFaceSource::load):
513         (WebCore::CSSFontFaceSource::font):
514         (WebCore::CSSFontFaceSource::isSVGFontFaceSource const):
515         * css/CSSFontFaceSource.h:
516
517 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
518
519         Unreviewed, rolling out r243450.
520
521         AppleWin and WinCairo port builds get broken.
522
523         Reverted changeset:
524
525         "Add test for fix of #196095"
526         https://bugs.webkit.org/show_bug.cgi?id=196097
527         https://trac.webkit.org/changeset/243450
528
529 2019-03-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
530
531         Remove the SVG tear off objects for SVGAngle, SVGAnimatedAngle and SVGAnimatedEnumeration
532         https://bugs.webkit.org/show_bug.cgi?id=196087
533
534         Reviewed by Simon Fraser.
535
536         In this patch, the tear off objects for SVGAnimatedEnumeration will be 
537         removed. Because the angle is paired with the orient type so its tear
538         off objects have to be removed as well. Here is what this patch does:
539
540         -- SVGAngle is now a superclass of SVGValueProperty<SVGAngleValue>. Its 
541         relationship with its owner will be managed by the owner of its base
542         class SVGProperty.
543
544         -- SVGAnimatedAngle is now defined to be SVGAnimatedValueProperty<
545         SVGAngle>. All the DOM interfaces will be handled by the base class
546         given its baseVal and animVal are of type SVGAngle.
547
548         -- SVGAnimatedEnumeration is now defined to be
549         SVGAnimatedDecoratedProperty<SVGDecoratedEnumeration, unsigned>.
550         This can be read: SVGAnimatedEnumeration is an SVGAnimatedProperty which
551         decorates the "SVGDecoratedEnumeration" type to "unsigned". The reason
552         for this complication is the IDL of SVGAnimatedEnumeration defines the
553         baseVal and animVal are of type unsigned. However SVGAnimatedEnumeration
554         should be able to convert a string to its enum value and vice versa.
555
556         -- SVGAnimatedDecoratedProperty is a template class which maps from
557         DecoratedProperty to DecorationType. The DecoratedProperty is actually
558         a template class which exposes a property of type DecorationType.
559
560         -- SVGDecoratedProperty is an abstract class which manages setting and
561         getting a property in DecorationType regardless of how it is actually
562         stored. 
563
564         -- SVGDecoratedPrimitive is a superclass of SVGDecoratedProperty which
565         stores a primitive property whose type is PropertyType but can decorate
566         it to the callers as DecorationType.
567
568         -- SVGDecoratedEnumeration is a superclass of SVGDecoratedPrimitive
569         which stores a primitive type DecorationType like "BlendMode" but
570         decorates it as "unsigned"
571
572         To get the mechanics of this change correct, new accessors, animators
573         and animation functions need to be added for SVGAnimatedAngle,
574         SVGAnimatedEnumeration and SVGAnimatedOrientType. But since angle and
575         the orient type are paired under a single attribute, a pair accessor and
576         animator are also needed for the pair { angle, orientType }.
577
578         * Sources.txt:
579         * WebCore.xcodeproj/project.pbxproj:
580         * svg/SVGAngle.h:
581         (WebCore::SVGAngle::create):
582         (WebCore::SVGAngle::unitType):
583         (WebCore::SVGAngle::setValueForBindings):
584         (WebCore::SVGAngle::valueForBindings):
585         (WebCore::SVGAngle::setValueInSpecifiedUnits):
586         (WebCore::SVGAngle::valueInSpecifiedUnits):
587         (WebCore::SVGAngle::setValueAsString):
588         (WebCore::SVGAngle::newValueSpecifiedUnits):
589         (WebCore::SVGAngle::convertToSpecifiedUnits):
590         (WebCore::SVGAngle::valueAsString): Deleted.
591         (WebCore::SVGAngle::SVGAngle): Deleted.
592         * svg/SVGAnimatedAngle.cpp: Removed.
593         * svg/SVGAnimatedAngle.h: Removed.
594         * svg/SVGAnimatedEnumeration.cpp: Removed.
595         * svg/SVGAnimatedEnumeration.h: Removed.
596         * svg/SVGAnimatedType.h:
597         (WebCore::SVGAnimatedType::type const):
598         * svg/SVGAnimatorFactory.h:
599         (WebCore::SVGAnimatorFactory::create):
600         * svg/SVGClipPathElement.cpp:
601         (WebCore::SVGClipPathElement::SVGClipPathElement):
602         (WebCore::SVGClipPathElement::parseAttribute):
603         (WebCore::SVGClipPathElement::svgAttributeChanged):
604         (WebCore::SVGClipPathElement::registerAttributes): Deleted.
605         * svg/SVGClipPathElement.h:
606         * svg/SVGComponentTransferFunctionElement.cpp:
607         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
608         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
609         (WebCore::SVGComponentTransferFunctionElement::registerAttributes): Deleted.
610         * svg/SVGComponentTransferFunctionElement.h:
611         (WebCore::SVGComponentTransferFunctionElement::type const):
612         (WebCore::SVGComponentTransferFunctionElement::typeAnimated):
613         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry): Deleted.
614         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute): Deleted.
615         * svg/SVGElement.cpp:
616         (WebCore::SVGElement::commitPropertyChange):
617         * svg/SVGFEBlendElement.cpp:
618         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
619         (WebCore::SVGFEBlendElement::parseAttribute):
620         (WebCore::SVGFEBlendElement::registerAttributes): Deleted.
621         * svg/SVGFEBlendElement.h:
622         (WebCore::SVGPropertyTraits<BlendMode>::fromString):
623         * svg/SVGFEColorMatrixElement.cpp:
624         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
625         (WebCore::SVGFEColorMatrixElement::parseAttribute):
626         (WebCore::SVGFEColorMatrixElement::registerAttributes): Deleted.
627         * svg/SVGFEColorMatrixElement.h:
628         * svg/SVGFECompositeElement.cpp:
629         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
630         (WebCore::SVGFECompositeElement::parseAttribute):
631         (WebCore::SVGFECompositeElement::registerAttributes): Deleted.
632         * svg/SVGFECompositeElement.h:
633         * svg/SVGFEConvolveMatrixElement.cpp:
634         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
635         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
636         (WebCore::SVGFEConvolveMatrixElement::registerAttributes): Deleted.
637         * svg/SVGFEConvolveMatrixElement.h:
638         * svg/SVGFEDisplacementMapElement.cpp:
639         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
640         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
641         (WebCore::SVGFEDisplacementMapElement::registerAttributes): Deleted.
642         * svg/SVGFEDisplacementMapElement.h:
643         * svg/SVGFEGaussianBlurElement.cpp:
644         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
645         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
646         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
647         (WebCore::SVGFEGaussianBlurElement::registerAttributes): Deleted.
648         * svg/SVGFEGaussianBlurElement.h:
649         * svg/SVGFEMorphologyElement.cpp:
650         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
651         (WebCore::SVGFEMorphologyElement::parseAttribute):
652         (WebCore::SVGFEMorphologyElement::registerAttributes): Deleted.
653         * svg/SVGFEMorphologyElement.h:
654         * svg/SVGFETurbulenceElement.cpp:
655         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
656         (WebCore::SVGFETurbulenceElement::parseAttribute):
657         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
658         (WebCore::SVGFETurbulenceElement::registerAttributes): Deleted.
659         * svg/SVGFETurbulenceElement.h:
660         * svg/SVGFilterElement.cpp:
661         (WebCore::SVGFilterElement::SVGFilterElement):
662         (WebCore::SVGFilterElement::registerAttributes):
663         (WebCore::SVGFilterElement::parseAttribute):
664         * svg/SVGFilterElement.h:
665         * svg/SVGGradientElement.cpp:
666         (WebCore::SVGGradientElement::SVGGradientElement):
667         (WebCore::SVGGradientElement::registerAttributes):
668         (WebCore::SVGGradientElement::parseAttribute):
669         * svg/SVGGradientElement.h:
670         (WebCore::SVGGradientElement::spreadMethod const):
671         (WebCore::SVGGradientElement::gradientUnits const):
672         (WebCore::SVGGradientElement::spreadMethodAnimated):
673         (WebCore::SVGGradientElement::gradientUnitsAnimated):
674         * svg/SVGMarkerElement.cpp:
675         (WebCore::SVGMarkerElement::SVGMarkerElement):
676         (WebCore::SVGMarkerElement::registerAttributes):
677         (WebCore::SVGMarkerElement::parseAttribute):
678         (WebCore::SVGMarkerElement::setOrient):
679         (WebCore::SVGMarkerElement::setOrientToAngle):
680         (WebCore::SVGMarkerElement::orientTypeIdentifier): Deleted.
681         (WebCore::SVGMarkerElement::orientAngleIdentifier): Deleted.
682         * svg/SVGMarkerElement.h:
683         * svg/SVGMarkerTypes.h:
684         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString):
685         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoStartReverseString):
686         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
687         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString):
688         * svg/SVGMaskElement.cpp:
689         (WebCore::SVGMaskElement::SVGMaskElement):
690         (WebCore::SVGMaskElement::registerAttributes):
691         (WebCore::SVGMaskElement::parseAttribute):
692         * svg/SVGMaskElement.h:
693         * svg/SVGPatternElement.cpp:
694         (WebCore::SVGPatternElement::SVGPatternElement):
695         (WebCore::SVGPatternElement::registerAttributes):
696         (WebCore::SVGPatternElement::parseAttribute):
697         * svg/SVGPatternElement.h:
698         * svg/SVGSVGElement.cpp:
699         * svg/SVGScriptElement.cpp:
700         * svg/SVGTextContentElement.cpp:
701         (WebCore::SVGTextContentElement::SVGTextContentElement):
702         (WebCore::SVGTextContentElement::registerAttributes):
703         (WebCore::SVGTextContentElement::parseAttribute):
704         * svg/SVGTextContentElement.h:
705         (WebCore::SVGTextContentElement::lengthAdjust const):
706         (WebCore::SVGTextContentElement::lengthAdjustAnimated):
707         * svg/SVGTextPathElement.cpp:
708         (WebCore::SVGTextPathElement::SVGTextPathElement):
709         (WebCore::SVGTextPathElement::registerAttributes):
710         (WebCore::SVGTextPathElement::parseAttribute):
711         * svg/SVGTextPathElement.h:
712         * svg/SVGValue.h:
713         * svg/properties/SVGAnimatedDecoratedProperty.h: Added.
714         (WebCore::SVGAnimatedDecoratedProperty::create):
715         (WebCore::SVGAnimatedDecoratedProperty::SVGAnimatedDecoratedProperty):
716         (WebCore::SVGAnimatedDecoratedProperty::setBaseVal):
717         (WebCore::SVGAnimatedDecoratedProperty::setBaseValInternal):
718         (WebCore::SVGAnimatedDecoratedProperty::baseVal const):
719         (WebCore::SVGAnimatedDecoratedProperty::setAnimVal):
720         (WebCore::SVGAnimatedDecoratedProperty::animVal const):
721         (WebCore::SVGAnimatedDecoratedProperty::currentValue const):
722         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: Removed.
723         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
724         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
725         * svg/properties/SVGAnimatedPropertyImpl.h:
726         (WebCore::SVGAnimatedOrientType::create):
727         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
728         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
729         (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
730         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
731         * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Removed.
732         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
733         (WebCore::SVGAnimationAngleFunction::progress):
734         * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
735         * svg/properties/SVGAttributeRegistry.h:
736         * svg/properties/SVGDecoratedEnumeration.h: Added.
737         (WebCore::SVGDecoratedEnumeration::create):
738         * svg/properties/SVGDecoratedPrimitive.h: Added.
739         (WebCore::SVGDecoratedPrimitive::SVGDecoratedPrimitive):
740         * svg/properties/SVGDecoratedProperty.h: Added.
741         (WebCore::SVGDecoratedProperty::setValue):
742         (WebCore::SVGDecoratedProperty::value const):
743         * svg/properties/SVGPropertyOwnerRegistry.h:
744         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
745         (WebCore::SVGPropertyOwnerRegistry::isAnimatedLengthAttribute):
746         * svg/properties/SVGPropertyRegistry.h:
747         * svg/properties/SVGStaticPropertyTearOff.h: Removed.
748
749 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
750
751         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
752         https://bugs.webkit.org/show_bug.cgi?id=194964
753
754         Unreviewed build fix for WinCairo port.
755
756         error C2504: 'CanMakeWeakPtr': base class undefined
757
758         * loader/ResourceLoader.h: Added #include <wtf/WeakPtr.h>.
759
760 2019-03-25  Andy Estes  <aestes@apple.com>
761
762         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
763         https://bugs.webkit.org/show_bug.cgi?id=194964
764         <rdar://problem/48279441>
765
766         Reviewed by Alex Christensen.
767
768         When a document's QuickLook preview is loaded, a reference cycle is created between
769         WebPreviewLoader and ResourceLoader. Break the cycle by changing WebPreviewLoader to hold a
770         WeakPtr to its ResourceLoader ResourceLoader::releaseResources().
771
772         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`. Also covered by
773         existing API tests.
774
775         * loader/ResourceLoader.h:
776         * loader/ios/PreviewLoader.mm:
777         (-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
778         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
779         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
780         (-[WebPreviewLoader connectionDidFinishLoading:]):
781         (-[WebPreviewLoader connection:didFailWithError:]):
782
783 2019-03-25  Alex Christensen  <achristensen@webkit.org>
784
785         Enable IPC sending and receiving non-default-constructible types
786         https://bugs.webkit.org/show_bug.cgi?id=196132
787
788         Reviewed by Geoff Garen.
789
790         This basically just requires the decoding of std::tuple to return an Optional<std::tuple> instead of
791         constructing a std::tuple then decoding into it.  I now decode synchronous replies into an Optional<std::tuple>
792         then move it into the tuple of references where the successfully decoded reply should go.  This required
793         the synchronous reply types be move constructible and move assignable.
794
795         * Modules/indexeddb/shared/IDBRequestData.h:
796         * Modules/indexeddb/shared/IDBTransactionInfo.h:
797         * platform/DragImage.h:
798         * platform/PasteboardWriterData.h:
799         * platform/audio/mac/CAAudioStreamDescription.h:
800         * platform/graphics/RemoteVideoSample.h:
801
802 2019-03-25  Alex Christensen  <achristensen@webkit.org>
803
804         Stop storing raw pointers to Documents
805         https://bugs.webkit.org/show_bug.cgi?id=196042
806
807         Reviewed by Geoff Garen.
808
809         Use WeakPtr instead!  This could change some UAF bugs into null dereference crashes.
810
811         * css/CSSFontSelector.cpp:
812         (WebCore::CSSFontSelector::CSSFontSelector):
813         (WebCore::CSSFontSelector::addFontFaceRule):
814         (WebCore::CSSFontSelector::fontRangesForFamily):
815         * css/CSSFontSelector.h:
816         * css/MediaQueryMatcher.cpp:
817         (WebCore::MediaQueryMatcher::MediaQueryMatcher):
818         (WebCore::MediaQueryMatcher::matchMedia):
819         * css/MediaQueryMatcher.h:
820         * css/StyleSheetList.cpp:
821         (WebCore::StyleSheetList::StyleSheetList):
822         (WebCore::StyleSheetList::ownerNode const):
823         * css/StyleSheetList.h:
824         * css/ViewportStyleResolver.cpp:
825         (WebCore::ViewportStyleResolver::ViewportStyleResolver):
826         * css/ViewportStyleResolver.h:
827         * dom/Document.h:
828         (WebCore::Document::setTemplateDocumentHost):
829         (WebCore::Document::templateDocumentHost):
830         * dom/DocumentParser.cpp:
831         (WebCore::DocumentParser::DocumentParser):
832         * dom/DocumentParser.h:
833         (WebCore::DocumentParser::document const):
834         * dom/ScriptedAnimationController.cpp:
835         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
836         * dom/ScriptedAnimationController.h:
837         * html/parser/HTMLScriptRunner.cpp:
838         (WebCore::HTMLScriptRunner::HTMLScriptRunner):
839         (WebCore::HTMLScriptRunner::runScript):
840         * html/parser/HTMLScriptRunner.h:
841         * loader/MediaResourceLoader.cpp:
842         (WebCore::MediaResourceLoader::MediaResourceLoader):
843         * loader/MediaResourceLoader.h:
844         * loader/cache/CachedResourceLoader.cpp:
845         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox const):
846         (WebCore::CachedResourceLoader::loadDone):
847         * loader/cache/CachedResourceLoader.h:
848         (WebCore::CachedResourceLoader::document const):
849         (WebCore::CachedResourceLoader::setDocument):
850
851 2019-03-25  Truitt Savell  <tsavell@apple.com>
852
853         Unreviewed, rolling out r243419.
854
855         Caused Mac WK2 testers to crash and become unresponsive.
856
857         Reverted changeset:
858
859         "[Web GPU] Prototype compute pipeline with MSL"
860         https://bugs.webkit.org/show_bug.cgi?id=196107
861         https://trac.webkit.org/changeset/243419
862
863 2019-03-25  Truitt Savell  <tsavell@apple.com>
864
865         Unreviewed, rolling out r243438.
866
867         243319 Caused Mac WK2 testers to crash and become
868         unresponsive.
869
870         Reverted changeset:
871
872         "Update WebGPU class names based on sketch.idl"
873         https://bugs.webkit.org/show_bug.cgi?id=194260
874         https://trac.webkit.org/changeset/243438
875
876 2019-03-25  Eric Carlson  <eric.carlson@apple.com>
877
878         Delete MetadataPreloadingNotPermitted, it is unused
879         https://bugs.webkit.org/show_bug.cgi?id=196202
880         <rdar://problem/49213611>
881
882         Reviewed by Jer Noble.
883
884         No new tests, the flat was unused except in an existing test that was removed.
885
886         * html/MediaElementSession.cpp:
887         (WebCore::restrictionNames):
888         (WebCore::MediaElementSession::effectivePreloadForElement const):
889         * html/MediaElementSession.h:
890         * platform/graphics/cg/UTIRegistry.cpp:
891         (WebCore::defaultSupportedImageTypes):
892         * testing/Internals.cpp:
893         (WebCore::Internals::setMediaElementRestrictions):
894
895 2019-03-25  Jer Noble  <jer.noble@apple.com>
896
897         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
898         https://bugs.webkit.org/show_bug.cgi?id=196097
899
900         Reviewed by Eric Carlson.
901
902         Test: media/track/track-in-band-metadata-display-order.html
903
904         Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
905         by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
906         TextTrackCueGeneric for testing.
907
908         Drive-by fixes:
909
910         Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
911         parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
912         a HTMLMediaElement*
913
914         TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
915         enable use of is<> and downcast<>.
916
917         * Source/WebCore/CMakeLists.txt:
918         * DerivedSources-input.xcfilelist:
919         * DerivedSources-output.xcfilelist:
920         * DerivedSources.make:
921         * WebCore.xcodeproj/project.pbxproj:
922         * html/shadow/MediaControlElementTypes.cpp:
923         (WebCore::parentMediaElement):
924         * html/shadow/MediaControlElementTypes.h:
925         * html/shadow/MediaControlElements.cpp:
926         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
927         (WebCore::MediaControlTextTrackContainerElement::logger const):
928         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
929         (WebCore::MediaControlTextTrackContainerElement::logChannel const):
930         * html/shadow/MediaControlElements.h:
931         * html/track/DataCue.h:
932         (isType):
933         * html/track/TextTrackCueGeneric.h:
934         (isType):
935         * html/track/TextTrackCueGeneric.idl: Added.
936         * html/track/VTTCue.h:
937         (isType):
938         * testing/Internals.cpp:
939         (WebCore::Internals::createGenericCue):
940         * testing/Internals.h:
941         * testing/Internals.idl:
942
943 2019-03-25  Antti Koivisto  <antti@apple.com>
944
945         Toggling "display: contents" to "display: none" fails to hide the element
946         https://bugs.webkit.org/show_bug.cgi?id=188259
947         <rdar://problem/42886896>
948
949         Reviewed by Simon Fraser.
950
951         Test: fast/css/display-contents-to-none.html
952
953         * style/StyleTreeResolver.cpp:
954         (WebCore::Style::affectsRenderedSubtree):
955
956         An element with 'display:contents' has a rendered subtree.
957
958 2019-03-25  Justin Fan  <justin_fan@apple.com>
959
960         Update WebGPU class names based on sketch.idl
961         https://bugs.webkit.org/show_bug.cgi?id=194260
962
963         Reviewed by Dean Jackson.
964
965         Update all exposed Web GPU interface names to GPU* prefix. 
966
967         Existing Web GPU tests updated to expect new names.
968
969         * Modules/webgpu/WebGPU.idl:
970         * Modules/webgpu/WebGPUAdapter.idl:
971         * Modules/webgpu/WebGPUBindGroup.idl:
972         * Modules/webgpu/WebGPUBindGroupLayout.idl:
973         * Modules/webgpu/WebGPUBuffer.idl:
974         * Modules/webgpu/WebGPUDevice.idl:
975         * Modules/webgpu/WebGPUInputStepMode.h: Removed.
976         * Modules/webgpu/WebGPUPipelineLayout.idl:
977         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
978         * Modules/webgpu/WebGPUQueue.idl:
979         * Modules/webgpu/WebGPURenderPassEncoder.idl:
980         * Modules/webgpu/WebGPURenderPipeline.idl:
981         * Modules/webgpu/WebGPUSampler.idl:
982         * Modules/webgpu/WebGPUTexture.idl:
983         * Modules/webgpu/WebGPUTextureView.idl:
984         * WebCore.xcodeproj/project.pbxproj:
985         * bindings/js/WebCoreBuiltinNames.h:
986
987 2019-03-25  Javier Fernandez  <jfernandez@igalia.com>
988
989         A single leading space is not considered as a word break even when word-break: break-all is set
990         https://bugs.webkit.org/show_bug.cgi?id=195361
991
992         Reviewed by Ryosuke Niwa.
993
994         We must consider leading white-spaces as potential soft-breaking
995         opportunities that may avoid breaking in the middle of the word.
996
997         However, 'break-word: break-all' [1] implies that we should ignore
998         previous opportunities and break at any character (among the ones
999         valid for 'break-all') that prevents the line to overflow. Note,
1000         that these breakable characters are different from the ones
1001         provided by 'line-break: anywhere' [2].
1002
1003         This change is covered by the already existent tests of the CSS
1004         Text 3 suite of the Web Platform Tests.
1005
1006         The word-break-break-all-010.html was precisely designed to cover
1007         the basic issue fixed with this change, verifying that the word is
1008         indeed broken even if a single leading space constitutes a
1009         previous soft-breaking opportunity.
1010
1011         There are other Web Platform Tests. which already pass before this
1012         change, to verify that such leading white-space must be used
1013         instead of breaking the word in any other case, including
1014         overflow-wrap: break-word and even the deprecated word-break:
1015         break-word.
1016
1017            - white-space/pre-wrap-008.html
1018            - white-space/pre-wrap-015.html
1019            - white-space/pre-wrap-016.html
1020            - overflow-wrap/overflow-wrap-break-word-004.html
1021            - overflow-wrap/overflow-wrap-break-word-005.html
1022            - overflow-wrap/overflow-wrap-break-word-007.html
1023            - word-break/word-break-break-all-011.html
1024            - word-break/word-break-break-all-014.html
1025
1026         The reason why the word-break-break-all-010.html passes in Mac
1027         platform is that for that case the SimpleLineLayout codepath is
1028         executed instead, which doesn't have this bug, present in the old
1029         line-breaking logic implemented in the BreakingContext class.
1030
1031         In order to verify the validity of this change, I've added several
1032         tests under fast/text with the SimpleLineLayout disabled.
1033
1034         Tests: fast/text/overflow-wrap-break-word-004.html
1035                fast/text/overflow-wrap-break-word-005.html
1036                fast/text/overflow-wrap-break-word-007.html
1037                fast/text/whitespace/pre-wrap-008.html
1038                fast/text/whitespace/pre-wrap-015.html
1039                fast/text/whitespace/pre-wrap-016.html
1040                fast/text/word-break-break-all-010.html
1041                fast/text/word-break-break-all-011.html
1042                fast/text/word-break-break-all-015.html
1043                imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html
1044                imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html
1045                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html
1046
1047         * rendering/line/BreakingContext.h:
1048         (WebCore::BreakingContext::handleText):
1049
1050 2019-03-25  Rob Buis  <rbuis@igalia.com>
1051
1052         Reflect HTMLLinkElement.as according to the spec
1053         https://bugs.webkit.org/show_bug.cgi?id=196189
1054
1055         Reviewed by Youenn Fablet.
1056
1057         The 'as' attribute is an enumerated attribute [1] and should
1058         reflect using a finite set of keywords, so lowercase the as getter
1059         to match the defined set of destinations [2].
1060
1061         Test: imported/w3c/web-platform-tests/preload/reflected-as-value.html
1062
1063         [1] https://html.spec.whatwg.org/#enumerated-attribute
1064         [2] https://fetch.spec.whatwg.org/#concept-request-destination
1065
1066         * html/HTMLLinkElement.cpp:
1067         (WebCore::HTMLLinkElement::as const):
1068
1069 2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1070
1071         Remove NavigatorContentUtils in WebCore/Modules
1072         https://bugs.webkit.org/show_bug.cgi?id=196070
1073
1074         Reviewed by Alex Christensen.
1075
1076         NavigatorContentUtils was to support the custom scheme spec [1].
1077         However, in WebKit side, no port has supported the feature in
1078         WebKit layer after EFL port was removed. So there has been the
1079         only IDL implementation of the NavigatorContentUtils in WebCore.
1080         So we don't need to keep the implementation in WebCore anymore.
1081
1082         [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
1083
1084         No new tests because this patch is just to remove the feature.
1085
1086         * CMakeLists.txt:
1087         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp: Removed.
1088         * Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed.
1089         * Modules/navigatorcontentutils/NavigatorContentUtils.idl: Removed.
1090         * Modules/navigatorcontentutils/NavigatorContentUtilsClient.h: Removed.
1091         * Sources.txt:
1092
1093 2019-03-25  Manuel Rego Casasnovas  <rego@igalia.com>
1094
1095         [css-grid] Fix grid container baseline alignment for orthogonal items
1096         https://bugs.webkit.org/show_bug.cgi?id=196141
1097
1098         Reviewed by Javier Fernandez.
1099
1100         Grid container baseline was wrongly computed when done in reference to an orthogonal item.
1101
1102         Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-001.html
1103
1104         * rendering/RenderGrid.cpp:
1105         (WebCore::RenderGrid::firstLineBaseline const): Simple change to use logicalTopForChild()
1106         so it takes into account grid container and item writing modes.
1107
1108 2019-03-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1109
1110         Unreviewed, fix -Wpessimizing-move warning
1111         https://bugs.webkit.org/show_bug.cgi?id=195905
1112         <rdar://problem/49121824>
1113
1114         * svg/properties/SVGPropertyList.h:
1115
1116 2019-03-23  Justin Fan  <justin_fan@apple.com>
1117
1118         [Web GPU] Prototype compute pipeline with MSL
1119         https://bugs.webkit.org/show_bug.cgi?id=196107
1120         <rdar://problem/46289650>
1121
1122         Reviewed by Myles Maxfield.
1123
1124         Add GPUComputePassEncoder, GPUComputePipeline, and GPUComputePipelineDescriptor.
1125         Implement everything needed to prototype a compute pipeline in Web GPU using Metal shaders and bound resources.
1126
1127         Test: webgpu/compute-squares.html
1128
1129         Add files and symbols:
1130         * CMakeLists.txt:
1131         * DerivedSources-input.xcfilelist:
1132         * DerivedSources-output.xcfilelist:
1133         * DerivedSources.make:
1134         * Sources.txt:
1135         * SourcesCocoa.txt:
1136         * WebCore.xcodeproj/project.pbxproj:
1137         * bindings/js/WebCoreBuiltinNames.h:
1138
1139         Misc fixes:
1140         * Modules/webgpu/WHLSL/WHLSLNameResolver.h: Missing include.
1141         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Missing include.
1142         * Modules/webgpu/WebGPUPipelineStageDescriptor.cpp: Added. Move pipeline stage validation logic here.
1143         (WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const):
1144         * Modules/webgpu/WebGPURenderPipeline.cpp: Remove unnecessary include.
1145         * Modules/webgpu/WebGPURenderPipeline.h:
1146         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp: Add missing inlcude.
1147         (WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const): Moved to WebGPUPipelineStageDescriptor.cpp.
1148         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Add missing include.
1149         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Add missing include.
1150         (WebCore::GPURenderPipeline::GPURenderPipeline): Remove unecessary ref of GPUPipelineLayout.
1151         * platform/text/mac/TextEncodingRegistryMac.mm: Carbon.h was causing ambiguous reference build errors in this file.
1152
1153         Enable creating a GPUComputePassEncoder from a GPUCommandEncoder:
1154         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1155         (WebCore::WebGPUCommandEncoder::beginRenderPass): No longer passing this WebGPUCommandEncoder to pass encoders.
1156         (WebCore::WebGPUCommandEncoder::beginComputePass): Added.
1157         * Modules/webgpu/WebGPUCommandEncoder.h:
1158         * Modules/webgpu/WebGPUCommandEncoder.idl:
1159
1160         Add GPUComputePassEncoder:
1161         * Modules/webgpu/WebGPUComputePassEncoder.cpp: Added.
1162         (WebCore::WebGPUComputePassEncoder::create):
1163         (WebCore::WebGPUComputePassEncoder::WebGPUComputePassEncoder):
1164         (WebCore::WebGPUComputePassEncoder::setPipeline):
1165         (WebCore::WebGPUComputePassEncoder::dispatch):
1166         (WebCore::WebGPUComputePassEncoder::passEncoder):
1167         (WebCore::WebGPUComputePassEncoder::passEncoder const):
1168         * Modules/webgpu/WebGPUComputePassEncoder.h: Added.
1169         * Modules/webgpu/WebGPUComputePassEncoder.idl: Added.
1170         * platform/graphics/gpu/GPUComputePassEncoder.h: Added.
1171         (WebCore::GPUComputePassEncoder::~GPUComputePassEncoder):
1172         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Added.
1173         (WebCore::GPUComputePassEncoder::tryCreate):
1174         (WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
1175         (WebCore::GPUComputePassEncoder::setPipeline):
1176         (WebCore::GPUComputePassEncoder::dispatch): Use a default calculation for threadsPerThreadgroup while MSL is still an accepted shader format.
1177         (WebCore::GPUComputePassEncoder::platformPassEncoder const):
1178         (WebCore::GPUComputePassEncoder::useResource):
1179         (WebCore::GPUComputePassEncoder::setComputeBuffer):
1180
1181         Add GPUComputePipeline:
1182         * Modules/webgpu/WebGPUComputePipeline.cpp: Added.
1183         (WebCore::WebGPUComputePipeline::create):
1184         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
1185         * Modules/webgpu/WebGPUComputePipeline.h: Added.
1186         (WebCore::WebGPUComputePipeline::computePipeline const):
1187         * Modules/webgpu/WebGPUComputePipeline.idl: Added.
1188         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp: Added.
1189         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
1190         * Modules/webgpu/WebGPUComputePipelineDescriptor.h: Added.
1191         * Modules/webgpu/WebGPUComputePipelineDescriptor.idl: Added.
1192         * platform/graphics/gpu/GPUComputePipeline.h: Added.
1193         (WebCore::GPUComputePipeline::platformComputePipeline const):
1194         * platform/graphics/gpu/GPUComputePipelineDescriptor.h: Added.
1195         (WebCore::GPUComputePipelineDescriptor::GPUComputePipelineDescriptor):
1196         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Added.
1197         (WebCore::tryCreateMtlComputeFunction):
1198         (WebCore::tryCreateMTLComputePipelineState):
1199         (WebCore::GPUComputePipeline::tryCreate):
1200         (WebCore::GPUComputePipeline::GPUComputePipeline):
1201
1202         Enable creating a GPUComputePipeline from a GPUDevice:
1203         * Modules/webgpu/WebGPUDevice.cpp:
1204         (WebCore::WebGPUDevice::createComputePipeline const):
1205         * Modules/webgpu/WebGPUDevice.h:
1206         * Modules/webgpu/WebGPUDevice.idl:
1207         * platform/graphics/gpu/GPUDevice.cpp:
1208         (WebCore::GPUDevice::tryCreateComputePipeline const):
1209         * platform/graphics/gpu/GPUDevice.h:
1210
1211         No longer unnecessarily ref the WebGPUCommandEncoder when creating pass encoder:
1212         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1213         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup):
1214         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): Deleted.
1215         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Deleted.
1216         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1217         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1218         (WebCore::WebGPURenderPassEncoder::create):
1219         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
1220         (WebCore::WebGPURenderPassEncoder::setPipeline):
1221         (WebCore::WebGPURenderPassEncoder::passEncoder):
1222         (WebCore::WebGPURenderPassEncoder::passEncoder const):
1223         * Modules/webgpu/WebGPURenderPassEncoder.h:
1224
1225         Updates to GPUBindGroup and *setBindGroup for compute function arguments:
1226         * platform/graphics/gpu/GPUBindGroup.h:
1227         (WebCore::GPUBindGroup::vertexArgsBuffer const):
1228         (WebCore::GPUBindGroup::fragmentArgsBuffer const):
1229         (WebCore::GPUBindGroup::computeArgsBuffer const):
1230         (WebCore::GPUBindGroup::vertexArgsBuffer): Deleted. Const-qualified.
1231         (WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
1232         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1233         (WebCore::tryGetResourceAsMTLSamplerState): Now just returns the MTLSamplerState to reduce reference churning.
1234         (WebCore::GPUBindGroup::tryCreate):
1235         (WebCore::GPUBindGroup::GPUBindGroup):
1236         (WebCore::tryGetResourceAsSampler): Renamed to tryGetResourceAsMTLSamplerState.
1237
1238         Updates to GPUProgrammablePassEncoder and GPURenderPassEncoder:
1239         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1240         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
1241         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
1242         (WebCore::GPUProgrammablePassEncoder::setComputeBuffer): Added.
1243         * platform/graphics/gpu/GPURenderPassEncoder.h:
1244         (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder):
1245         * platform/graphics/gpu/GPURenderPipeline.h:
1246         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Remove unecessary include.
1247         (WebCore::GPUProgrammablePassEncoder::endPass): No longer virtual. Delegates shared behavior for derived classes.
1248         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
1249         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1250         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
1251         (WebCore::GPURenderPassEncoder::setPipeline):
1252         (WebCore::GPURenderPassEncoder::draw):
1253         (WebCore::GPURenderPassEncoder::useResource): These private overrides are called only by base after checking for encoder existence.
1254         (WebCore::GPURenderPassEncoder::setVertexBuffer): Ditto.
1255         (WebCore::GPURenderPassEncoder::setFragmentBuffer): Ditto.
1256         (WebCore::GPURenderPassEncoder::endPass): Deleted. Now handled by base class.
1257
1258 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
1259
1260         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
1261         https://bugs.webkit.org/show_bug.cgi?id=137043
1262         rdar://problem/16595330
1263
1264         Reviewed by Zalan Bujtas.
1265
1266         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
1267         to the UI process, and use it to set UIScrollView indicators visible or not.
1268
1269         Tests: fast/scrolling/ios/scrollbar-hiding.html:
1270
1271         * page/scrolling/AsyncScrollingCoordinator.cpp:
1272         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
1273         * page/scrolling/ScrollingCoordinator.cpp:
1274         (WebCore::operator<<):
1275         * page/scrolling/ScrollingCoordinatorTypes.h:
1276         * page/scrolling/ScrollingTreeNode.h:
1277         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
1278         (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
1279         * page/scrolling/ScrollingTreeScrollingNode.h:
1280         * platform/ScrollableArea.h:
1281         (WebCore::ScrollableArea::horizontalScrollbarHiddenByStyle const):
1282         (WebCore::ScrollableArea::verticalScrollbarHiddenByStyle const):
1283         * rendering/RenderLayer.cpp:
1284         (WebCore::scrollbarHiddenByStyle):
1285         (WebCore::RenderLayer::horizontalScrollbarHiddenByStyle const):
1286         (WebCore::RenderLayer::verticalScrollbarHiddenByStyle const):
1287         * rendering/RenderLayer.h:
1288
1289 2019-03-23  Zalan Bujtas  <zalan@apple.com>
1290
1291         [ContentChangeObserver] Add support for observing opacity.
1292         https://bugs.webkit.org/show_bug.cgi?id=196172
1293
1294         Reviewed by Simon Fraser.
1295
1296         This patch adds support for observing opacity changes. At this point we only track one transition at a time.
1297         if the page registers transition on both left and opacity, the first is getting observed only.
1298
1299         Tests: fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html
1300                fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html
1301                fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html
1302                fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html
1303                fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html
1304
1305         * page/ios/ContentChangeObserver.cpp:
1306         (WebCore::isConsideredHidden):
1307         (WebCore::ContentChangeObserver::didAddTransition):
1308         * page/ios/ContentChangeObserver.h:
1309         (WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
1310
1311 2019-03-23  Zalan Bujtas  <zalan@apple.com>
1312
1313         [ContentChangeObserver] Check if the transitioned content is visible at onAnimationEnd
1314         https://bugs.webkit.org/show_bug.cgi?id=196171
1315
1316         Reviewed by Simon Fraser.
1317
1318         At onAnimationEnd we don't yet have the final computed style for the transitioned content.
1319         However the current state (before computing the final style) might already be qualified to be visible.
1320         Introduce "CompletedTransition" to indicate that the transition is all set as far observing is concerned
1321         (as opposed to "EndedTransition" where we still need to observe the content for the final style change).
1322
1323         Test: fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html
1324
1325         * page/ios/ContentChangeObserver.cpp:
1326         (WebCore::ContentChangeObserver::didFinishTransition):
1327         (WebCore::ContentChangeObserver::adjustObservedState):
1328         * page/ios/ContentChangeObserver.h:
1329
1330 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1331
1332         [GTK] Remove build time dependency on Geoclue2
1333         https://bugs.webkit.org/show_bug.cgi?id=195994
1334
1335         Reviewed by Michael Catanzaro.
1336
1337         Remove old Geoclue implementation.
1338
1339         * PlatformGTK.cmake:
1340         * SourcesGTK.txt:
1341         * platform/geoclue/GeolocationProviderGeoclue.cpp: Removed.
1342         * platform/geoclue/GeolocationProviderGeoclue.h: Removed.
1343         * platform/geoclue/GeolocationProviderGeoclueClient.h: Removed.
1344
1345 2019-03-22  Eric Carlson  <eric.carlson@apple.com>
1346
1347         Flaky AVEncoderBitRateKey symbol not found crash on imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
1348         https://bugs.webkit.org/show_bug.cgi?id=193724
1349         <rdar://problem/47483831>
1350
1351         Reviewed by Jer Noble.
1352
1353         The soft link macros occasionally fail to load constants from AVFoundation.framework
1354         which are actually in one of its sub-frameworks. While we investigate the cause
1355         cause of the failure, ise the SOFT_LINK_CONSTANT_MAY_FAIL so we can detect the failure
1356         and return a local copy of the string instead of crashing.
1357         
1358         No new tests, this should prevent existing tests from crashing.
1359
1360         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1361         (WebCore::myAVFormatIDKey):
1362         (WebCore::myAVNumberOfChannelsKey):
1363         (WebCore::myAVSampleRateKey):
1364         (WebCore::myAVEncoderBitRateKey):
1365
1366 2019-03-22  Youenn Fablet  <youenn@apple.com>
1367
1368         REGRESSION: Flaky ASSERTION FAILED: !m_killed seen with http/tests/security/cross-origin-worker-indexeddb.html
1369         https://bugs.webkit.org/show_bug.cgi?id=196024
1370         <rdar://problem/49117272>
1371
1372         Reviewed by Alexey Proskuryakov.
1373
1374         Do not proceed with opening the database if it is being closed.
1375         Speculative fix, this should stop making test crashing on bots.
1376
1377         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1378         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1379
1380 2019-03-22  Youenn Fablet  <youenn@apple.com>
1381
1382         storage/indexeddb/closed-cursor-private.html is crashing on debug
1383         https://bugs.webkit.org/show_bug.cgi?id=196101
1384
1385         Reviewed by Alex Christensen.
1386
1387         In case of immediate close for user delete, the transaction might be deleted.
1388         If the request for space is pending, it will be executed with an error as parameter.
1389         In that case, the call to didCommitTransaction will not find any existing transaction.
1390         Speculative fix, test should no longer crash.
1391
1392         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1393         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
1394
1395 2019-03-22  Devin Rousso  <drousso@apple.com>
1396
1397         Web Inspector: Safari Canvas Inspector seems to show the canvas being rendered twice per frame.
1398         https://bugs.webkit.org/show_bug.cgi?id=196082
1399         <rdar://problem/49113496>
1400
1401         Reviewed by Dean Jackson.
1402
1403         Tests: inspector/canvas/recording-2d.html
1404                inspector/canvas/recording-bitmaprenderer.html
1405                inspector/canvas/recording-html-2d.html
1406                inspector/canvas/recording-webgl.html
1407                inspector/canvas/setRecordingAutoCaptureFrameCount.html
1408
1409         WebGL `<canvas>` follow a different "rendering" path such that `HTMLCanvasElement::paint`
1410         isn't called. Previously, there was a 0s timer that was started after the first action of a
1411         frame was recorded (for the case that the `<canvas>` isn't attached to the DOM) that would
1412         automatically stop the recording. It was possible that actions in two different "frame"s
1413         were recorded as part of the same frame, because the WebGL `<canvas>` would instead fall
1414         back to the timer to know when the "frame" had ended.
1415
1416         Now, there is additional instrumentation for the WebGL specific rendering path.
1417         Additionally, replace the 0s timer with a microtask for more "immediate" calling.
1418
1419         * html/HTMLCanvasElement.cpp:
1420         (WebCore::HTMLCanvasElement::paint):
1421         Ensure that the `InspectorInstrumentation` call is last. This matches what we expect, as
1422         before we were instrumenting right before is it about to paint.
1423
1424         * platform/graphics/GraphicsContext3D.h:
1425         (WebCore::GraphicsContext3D::Client::~Client): Added.
1426         (WebCore::GraphicsContext3D::addClient): Added.
1427         (WebCore::GraphicsContext3D::removeClient): Added.
1428         (WebCore::GraphicsContext3D::setWebGLContext): Deleted.
1429         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1430         (WebCore::GraphicsContext3D::markLayerComposited):
1431         (WebCore::GraphicsContext3D::forceContextLost):
1432         (WebCore::GraphicsContext3D::recycleContext):
1433         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
1434         * html/canvas/WebGLRenderingContextBase.h:
1435         * html/canvas/WebGLRenderingContextBase.cpp:
1436         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
1437         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
1438         (WebCore::WebGLRenderingContextBase::didComposite): Added.
1439         (WebCore::WebGLRenderingContextBase::forceContextLost):
1440         (WebCore::WebGLRenderingContextBase::recycleContext):
1441         (WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification): Added.
1442         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Deleted.
1443         Introduce a `GraphicsContext3DClient` abstract class, rather than passing the
1444         `WebGLRenderingContextBase` directly to the `GraphicsContext3D` (layering violation).
1445         Notify the client whenever the `GraphicsContext3D` composites, which will in turn notify the
1446         `InspectorCanvasAgent` so that it knows that the "frame" is over.
1447
1448         * inspector/agents/InspectorCanvasAgent.h:
1449         * inspector/agents/InspectorCanvasAgent.cpp:
1450         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
1451         (WebCore::InspectorCanvasAgent::requestNode):
1452         (WebCore::InspectorCanvasAgent::requestContent):
1453         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
1454         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
1455         (WebCore::InspectorCanvasAgent::startRecording):
1456         (WebCore::InspectorCanvasAgent::stopRecording):
1457         (WebCore::InspectorCanvasAgent::requestShaderSource):
1458         (WebCore::InspectorCanvasAgent::updateShader):
1459         (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
1460         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
1461         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
1462         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
1463         (WebCore::InspectorCanvasAgent::recordCanvasAction):
1464         (WebCore::InspectorCanvasAgent::canvasDestroyed):
1465         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1466         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
1467         (WebCore::InspectorCanvasAgent::didEnableExtension):
1468         (WebCore::InspectorCanvasAgent::didCreateProgram):
1469         (WebCore::InspectorCanvasAgent::willDeleteProgram):
1470         (WebCore::InspectorCanvasAgent::isShaderProgramDisabled):
1471         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
1472         (WebCore::InspectorCanvasAgent::clearCanvasData):
1473         (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
1474         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
1475         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
1476         (WebCore::InspectorCanvasAgent::findInspectorProgram):
1477         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): Deleted.
1478         Replace raw pointers with `RefPtr`s. This is primarily used so that the microtask (instead
1479         of a timer) that is enqueued after the first action of each frame  is recorded can access a
1480         ref-counted instance of an `InspectorCanvas`, ensuring that it isn't destructed.
1481
1482         * inspector/InspectorCanvas.h:
1483         * inspector/InspectorCanvas.cpp:
1484         (WebCore::InspectorCanvas::canvasElement):
1485         (WebCore::InspectorCanvas::recordAction):
1486         (WebCore::InspectorCanvas::finalizeFrame):
1487         (WebCore::InspectorCanvas::releaseObjectForRecording): Added.
1488         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
1489         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
1490         (WebCore::InspectorCanvas::buildInitialState):
1491         (WebCore::InspectorCanvas::releaseInitialState): Deleted.
1492         (WebCore::InspectorCanvas::releaseFrames): Deleted.
1493         (WebCore::InspectorCanvas::releaseData): Deleted.
1494         Move the recording payload construction logic to `InspectorCanvas` so the actual data
1495         doesn't need to leave that class.
1496         Drive-by: unify the logic for getting the contents of a canvas from `InspectorCanvasAgent`.
1497
1498 2019-03-22  Keith Rollin  <krollin@apple.com>
1499
1500         Enable ThinLTO support in Production builds
1501         https://bugs.webkit.org/show_bug.cgi?id=190758
1502         <rdar://problem/45413233>
1503
1504         Reviewed by Daniel Bates.
1505
1506         Enable building with Thin LTO in Production when using Xcode 10.2 or
1507         later. This change results in a 1.45% progression in PLT5. Full
1508         Production build times increase about 2-3%. Incremental build times
1509         are more severely affected, and so LTO is not enabled for local
1510         engineering builds.
1511
1512         LTO is enabled only on macOS for now, until rdar://problem/49013399,
1513         which affects ARM builds, is fixed.
1514
1515         Removed the conditionals that disabled LTO on 32-bit systems since we
1516         no longer build for those.
1517
1518         To change the LTO setting when building locally:
1519
1520         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
1521           command line.
1522         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
1523           on the command line.
1524         - If building with `build-root`, specify --lto={none,thin,full} on the
1525           command line.
1526         - If building with Xcode, create a LocalOverrides.xcconfig file at the
1527           top level of your repository directory (if needed) and define
1528           WK_LTO_MODE to full, thin, or none.
1529
1530         No new tests since there should be no observable behavior difference.
1531
1532         * Configurations/Base.xcconfig:
1533
1534 2019-03-22  Ryan Haddad  <ryanhaddad@apple.com>
1535
1536         Unreviewed, rolling out r243356.
1537
1538         Causes assertion failures with WebGL layout tests on macOS and
1539         iOS.
1540
1541         Reverted changeset:
1542
1543         "Web Inspector: Safari Canvas Inspector seems to show the
1544         canvas being rendered twice per frame."
1545         https://bugs.webkit.org/show_bug.cgi?id=196082
1546         https://trac.webkit.org/changeset/243356
1547
1548 2019-03-22  Antti Koivisto  <antti@apple.com>
1549
1550         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
1551         https://bugs.webkit.org/show_bug.cgi?id=196100
1552         <rdar://problem/49117933>
1553
1554         Reviewed by Simon Fraser.
1555
1556         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
1557
1558         * page/scrolling/ScrollingTree.cpp:
1559         (WebCore::ScrollingTree::commitTreeState):
1560         * page/scrolling/ScrollingTree.h:
1561         (WebCore::ScrollingTree::positionedNodesWithRelatedOverflow):
1562
1563         Add a separate map of positioned node ids for easy access.
1564
1565         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
1566         (WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const):
1567         (WebCore::ScrollingTreePositionedNode::relatedOverflowScrollingNodes const):
1568         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
1569         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
1570
1571 2019-03-22  Antoine Quint  <graouts@apple.com>
1572
1573         [Web Animations] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::WebAnimation::timeToNextTick const + 757
1574         https://bugs.webkit.org/show_bug.cgi?id=196125
1575         <rdar://problem/46520059>
1576
1577         Reviewed by Dean Jackson.
1578
1579         Because of floating point math in playState() that wouldn't account for timeEpsilon, we would get into a state where the animation phase
1580         was "after" but the play state was "running" when the current time was about a microsecond away from the active time boundary. This meant
1581         that the early return statement in WebAnimation::timeToNextTick() would not be hit while we would not handle the possibility of being in
1582         the "after" phase in the rest of the function, therefore eventually hitting the ASSERT_NOT_REACHED() at the end of the function.
1583
1584         We now account for timeEpsilon in playState() and correctly report we're in the "finished" play state when in the "after" phase also.
1585
1586         * animation/WebAnimation.cpp:
1587         (WebCore::WebAnimation::playState const):
1588
1589 2019-03-22  Alicia Boya García  <aboya@igalia.com>
1590
1591         [MSE][GStreamer] Don't construct segments on PlaybackPipeline::flush
1592         https://bugs.webkit.org/show_bug.cgi?id=195867
1593
1594         Reviewed by Xabier Rodriguez-Calvar.
1595
1596         The previous approach did not really work for flushes on only one
1597         branch, as setting reset-time in FLUSH_STOP affects the running time
1598         of the entire pipeline, causing timing issues in the other branch.
1599
1600         Since it's preferable not to interfere with the other branch if
1601         possible, setting reset-time to FALSE fixes that problem.
1602
1603         Also, it's not necessary to fabricate a segment. Since we are not
1604         seeking, only the base needs to be adjusted, and gstbasesrc already
1605         handles this correctly by default.
1606
1607         This fixes an audio/video synchronization bug in YT when some
1608         automatic quality changes occur.
1609
1610         Tests: imported/w3c/web-platform-tests/media-source/mediasource-correct-frames-after-reappend.html
1611                imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html
1612
1613         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1614         (WebCore::PlaybackPipeline::flush):
1615
1616 2019-03-22  Frederic Wang  <fwang@igalia.com>
1617
1618         Move implementation of mathsize to a single place
1619         https://bugs.webkit.org/show_bug.cgi?id=196129
1620
1621         Reviewed by Ryosuke Niwa.
1622
1623         Currently, mathsize is partially implemented in the MathML UA stylesheet and partially
1624         implemented in the MathML DOM classes using addPropertyToPresentationAttributeStyle. This
1625         patch moves the whole implementation to the latter place, so that it's easier to understand.
1626         It will also allow to conditionally disable the mathsize values removed from MathML Core.
1627
1628         No new tests, already covered by existing tests.
1629
1630         * css/mathml.css: Remove mathsize rules.
1631         * mathml/MathMLElement.cpp:
1632         (WebCore::convertMathSizeIfNeeded): Convert "small", "normal" and "big" to the values that
1633         used to be in the UA stylesheet. Also add a comment that we don't support all MathML lengths.
1634         (WebCore::MathMLElement::collectStyleForPresentationAttribute): Don't skip "small", "normal"
1635         or "big".
1636         (WebCore::convertToPercentageIfNeeded): Renamed to convertMathSizeIfNeeded.
1637
1638 2019-03-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
1639
1640         Remove the SVG tear off objects for SVGNumber, SVGNumberList and SVGAnimatedNumberList
1641         https://bugs.webkit.org/show_bug.cgi?id=196084
1642
1643         Reviewed by Simon Fraser.
1644
1645         To remove the tear off objects for these interfaces, we need to do the
1646         following:
1647
1648         -- SVGNumber will be a superclass of SVGValueProperty<float>. It provides
1649            the DOM interface functions.
1650
1651         -- SVGNumberList will be a superclass of SVGValuePropertyList<SVGNumber>.
1652            It provides creation, parsing and converting to string functions.
1653
1654         -- SVGAnimatedNumberList will be defined as SVGAnimatedPropertyList<SVGNumberList>.
1655
1656         To make things work as expected:
1657
1658         -- Properties of type SVGAnimatedNumberList have to be registered with
1659            SVGPropertyOwnerRegistry.
1660         -- An accessor, an animator and an animation function should be defined
1661            for SVGAnimatedNumberList.
1662
1663         * Sources.txt:
1664         * WebCore.xcodeproj/project.pbxproj:
1665         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
1666         (WebCore::updateCharacterData):
1667         (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
1668         * svg/SVGAnimatedNumberList.cpp: Removed.
1669         * svg/SVGAnimatedNumberList.h: Removed.
1670         * svg/SVGAnimatedPointList.cpp: Removed.
1671         * svg/SVGAnimatedPointList.h: Removed.
1672         * svg/SVGAnimatedType.h:
1673         (WebCore::SVGAnimatedType::type const):
1674         * svg/SVGAnimatorFactory.h:
1675         (WebCore::SVGAnimatorFactory::create):
1676         * svg/SVGComponentTransferFunctionElement.cpp:
1677         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
1678         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
1679         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
1680         * svg/SVGComponentTransferFunctionElement.h:
1681         (WebCore::SVGComponentTransferFunctionElement::tableValues const):
1682         (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated):
1683         * svg/SVGFEColorMatrixElement.cpp:
1684         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
1685         (WebCore::SVGFEColorMatrixElement::registerAttributes):
1686         (WebCore::SVGFEColorMatrixElement::parseAttribute):
1687         (WebCore::SVGFEColorMatrixElement::build const):
1688         * svg/SVGFEColorMatrixElement.h:
1689         * svg/SVGFEConvolveMatrixElement.cpp:
1690         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
1691         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
1692         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1693         (WebCore::SVGFEConvolveMatrixElement::build const):
1694         * svg/SVGFEConvolveMatrixElement.h:
1695         * svg/SVGNumber.h:
1696         (WebCore::SVGNumber::create):
1697         (WebCore::SVGNumber::clone const):
1698         (WebCore::SVGNumber::valueForBindings):
1699         (WebCore::SVGNumber::setValueForBindings):
1700         (WebCore::SVGNumber::SVGNumber): Deleted.
1701         * svg/SVGNumberList.h:
1702         (WebCore::SVGNumberList::create):
1703         (WebCore::SVGNumberList::parse):
1704         (WebCore::SVGNumberList::SVGNumberList): Deleted.
1705         * svg/SVGNumberListValues.cpp: Removed.
1706         * svg/SVGNumberListValues.h: Removed.
1707         * svg/SVGTextPositioningElement.cpp:
1708         (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
1709         (WebCore::SVGTextPositioningElement::registerAttributes):
1710         (WebCore::SVGTextPositioningElement::parseAttribute):
1711         * svg/SVGTextPositioningElement.h:
1712         (WebCore::SVGTextPositioningElement::rotate const):
1713         (WebCore::SVGTextPositioningElement::rotateAnimated):
1714         * svg/SVGValue.h:
1715         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1716         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1717         * svg/properties/SVGAnimatedPropertyImpl.h:
1718         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
1719         (WebCore::SVGAnimationNumberListFunction::progress):
1720         * svg/properties/SVGAttributeRegistry.h:
1721         * svg/properties/SVGPropertyOwnerRegistry.h:
1722         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1723
1724 2019-03-21  Devin Rousso  <drousso@apple.com>
1725
1726         Web Inspector: Safari Canvas Inspector seems to show the canvas being rendered twice per frame.
1727         https://bugs.webkit.org/show_bug.cgi?id=196082
1728         <rdar://problem/49113496>
1729
1730         Reviewed by Dean Jackson.
1731
1732         Tests: inspector/canvas/recording-2d.html
1733                inspector/canvas/recording-bitmaprenderer.html
1734                inspector/canvas/recording-html-2d.html
1735                inspector/canvas/recording-webgl.html
1736                inspector/canvas/setRecordingAutoCaptureFrameCount.html
1737
1738         WebGL `<canvas>` follow a different "rendering" path such that `HTMLCanvasElement::paint`
1739         isn't called. Previously, there was a 0s timer that was started after the first action of a
1740         frame was recorded (for the case that the `<canvas>` isn't attached to the DOM) that would
1741         automatically stop the recording. It was possible that actions in two different "frame"s
1742         were recorded as part of the same frame, because the WebGL `<canvas>` would instead fall
1743         back to the timer to know when the "frame" had ended.
1744
1745         Now, there is additional instrumentation for the WebGL specific rendering path.
1746         Additionally, replace the 0s timer with a microtask for more "immediate" calling.
1747
1748         * html/HTMLCanvasElement.cpp:
1749         (WebCore::HTMLCanvasElement::paint):
1750         Ensure that the `InspectorInstrumentation` call is last. This matches what we expect, as
1751         before we were instrumenting right before is it about to paint.
1752
1753         * platform/graphics/GraphicsContext3D.h:
1754         (WebCore::GraphicsContext3D::Client::~Client): Added.
1755         (WebCore::GraphicsContext3D::addClient): Added.
1756         (WebCore::GraphicsContext3D::removeClient): Added.
1757         (WebCore::GraphicsContext3D::setWebGLContext): Deleted.
1758         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1759         (WebCore::GraphicsContext3D::markLayerComposited):
1760         (WebCore::GraphicsContext3D::forceContextLost):
1761         (WebCore::GraphicsContext3D::recycleContext):
1762         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
1763         * html/canvas/WebGLRenderingContextBase.h:
1764         * html/canvas/WebGLRenderingContextBase.cpp:
1765         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
1766         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
1767         (WebCore::WebGLRenderingContextBase::didComposite): Added.
1768         (WebCore::WebGLRenderingContextBase::forceContextLost):
1769         (WebCore::WebGLRenderingContextBase::recycleContext):
1770         (WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification): Added.
1771         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Deleted.
1772         Introduce a `GraphicsContext3DClient` abstract class, rather than passing the
1773         `WebGLRenderingContextBase` directly to the `GraphicsContext3D` (layering violation).
1774         Notify the client whenever the `GraphicsContext3D` composites, which will in turn notify the
1775         `InspectorCanvasAgent` so that it knows that the "frame" is over.
1776
1777         * inspector/agents/InspectorCanvasAgent.h:
1778         * inspector/agents/InspectorCanvasAgent.cpp:
1779         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
1780         (WebCore::InspectorCanvasAgent::requestNode):
1781         (WebCore::InspectorCanvasAgent::requestContent):
1782         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
1783         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
1784         (WebCore::InspectorCanvasAgent::startRecording):
1785         (WebCore::InspectorCanvasAgent::stopRecording):
1786         (WebCore::InspectorCanvasAgent::requestShaderSource):
1787         (WebCore::InspectorCanvasAgent::updateShader):
1788         (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
1789         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
1790         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
1791         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
1792         (WebCore::InspectorCanvasAgent::recordCanvasAction):
1793         (WebCore::InspectorCanvasAgent::canvasDestroyed):
1794         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1795         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
1796         (WebCore::InspectorCanvasAgent::didEnableExtension):
1797         (WebCore::InspectorCanvasAgent::didCreateProgram):
1798         (WebCore::InspectorCanvasAgent::willDeleteProgram):
1799         (WebCore::InspectorCanvasAgent::isShaderProgramDisabled):
1800         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
1801         (WebCore::InspectorCanvasAgent::clearCanvasData):
1802         (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
1803         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
1804         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
1805         (WebCore::InspectorCanvasAgent::findInspectorProgram):
1806         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): Deleted.
1807         Replace raw pointers with `RefPtr`s. This is primarily used so that the microtask (instead
1808         of a timer) that is enqueued after the first action of each frame  is recorded can access a
1809         ref-counted instance of an `InspectorCanvas`, ensuring that it isn't destructed.
1810
1811         * inspector/InspectorCanvas.h:
1812         * inspector/InspectorCanvas.cpp:
1813         (WebCore::InspectorCanvas::canvasElement):
1814         (WebCore::InspectorCanvas::recordAction):
1815         (WebCore::InspectorCanvas::finalizeFrame):
1816         (WebCore::InspectorCanvas::releaseObjectForRecording): Added.
1817         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
1818         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
1819         (WebCore::InspectorCanvas::buildInitialState):
1820         (WebCore::InspectorCanvas::releaseInitialState): Deleted.
1821         (WebCore::InspectorCanvas::releaseFrames): Deleted.
1822         (WebCore::InspectorCanvas::releaseData): Deleted.
1823         Move the recording payload construction logic to `InspectorCanvas` so the actual data
1824         doesn't need to leave that class.
1825         Drive-by: unify the logic for getting the contents of a canvas from `InspectorCanvasAgent`.
1826
1827 2019-03-21  Tim Horton  <timothy_horton@apple.com>
1828
1829         Adopt UIWKDocumentContext
1830         https://bugs.webkit.org/show_bug.cgi?id=196040
1831         <rdar://problem/48642440>
1832
1833         Reviewed by Ryosuke Niwa.
1834
1835         New API test: WebKit.DocumentEditingContext
1836
1837         * dom/Range.h:
1838         * editing/TextGranularity.h:
1839         Make TextGranularity encodable by providing EnumTraits.
1840
1841         * editing/TextIterator.cpp:
1842         (WebCore::plainTextReplacingNoBreakSpace):
1843         * editing/TextIterator.h:
1844         Expose an nbsp-replacing variant of plainText that takes Positions instead of Ranges.
1845
1846 2019-03-21  Sihui Liu  <sihui_liu@apple.com>
1847
1848         Fix key path extraction code in IndexedDB to check own property
1849         https://bugs.webkit.org/show_bug.cgi?id=196099
1850
1851         Reviewed by Ryosuke Niwa.
1852
1853         Covered by existing tests.
1854
1855         * Modules/indexeddb/IDBFactory.cpp:
1856         (WebCore::IDBFactory::cmp):
1857         We don't need to check the second parameters if the first is already invalid.
1858
1859         * Modules/indexeddb/IDBKeyRange.cpp:
1860         (WebCore::IDBKeyRange::bound):
1861         Ditto.
1862
1863         * Modules/indexeddb/IDBObjectStore.cpp:
1864         (WebCore::IDBObjectStore::putOrAdd):
1865         we should not clear the exception during serialization because the execeptions may be explicitly thrown by parameters.
1866
1867         * bindings/js/IDBBindingUtilities.cpp:
1868         (WebCore::get):
1869         Fix implementation according to https://www.w3.org/TR/IndexedDB-2/#extract-key-from-value.
1870
1871         (WebCore::canInjectNthValueOnKeyPath):
1872         Check the last identifier.
1873
1874 2019-03-21  Antoine Quint  <graouts@apple.com>
1875
1876         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
1877         https://bugs.webkit.org/show_bug.cgi?id=196118
1878         <rdar://problem/46614137>
1879
1880         Reviewed by Ryosuke Niwa.
1881
1882         Test: webanimations/js-wrapper-kept-alive.html
1883
1884         We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
1885
1886         * animation/WebAnimation.cpp:
1887         (WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
1888         (WebCore::WebAnimation::hasPendingActivity const):
1889         * animation/WebAnimation.h:
1890
1891 2019-03-21  Jer Noble  <jer.noble@apple.com>
1892
1893         Inband Text Track cues interspersed with Data cues can display out of order.
1894         https://bugs.webkit.org/show_bug.cgi?id=196095
1895
1896         Reviewed by Eric Carlson.
1897
1898         The compareCueIntervalForDisplay() comparator depends on a virtual function, isPositionedAbove(TextTrackCue* other),
1899         but this comparison returns inconsistent results for cueA->isPositionedAbove(cueB) and cueB->isPositionedAbove(cueA)
1900         if the two cues are different subclasses of TextTrackCue.
1901
1902         The underlying algorithm should be fixed in a future patch, but for now, remove all non-displaying cues from the array
1903         of activeCues before sorting, rather than after when iterating over the sorted list of activeCues.
1904
1905         * html/shadow/MediaControlElements.cpp:
1906         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1907
1908 2019-03-21  Youenn Fablet  <youenn@apple.com>
1909
1910         Cache API and IDB space usages should be initialized on first quota check
1911         https://bugs.webkit.org/show_bug.cgi?id=195707
1912
1913         Reviewed by Chris Dumez.
1914
1915         Add a way to require IDBServer to create a quota user for a given origin.
1916         Make sure that removing a user might kick-in processing of pending requests.
1917         In the case of processing pending requests, we should not decide on the first task
1918         except if it is triggered by a request space response.
1919         Update processPendingRequests accordingly.
1920
1921         Tests: http/tests/IndexedDB/storage-limit-1.https.html
1922                http/tests/IndexedDB/storage-limit-2.https.html
1923
1924         * Modules/indexeddb/server/IDBServer.h:
1925         (WebCore::IDBServer::IDBServer::initializeQuotaUser):
1926         * storage/StorageQuotaManager.cpp:
1927         (WebCore::StorageQuotaManager::removeUser):
1928         (WebCore::StorageQuotaManager::askForMoreSpace):
1929         (WebCore::StorageQuotaManager::processPendingRequests):
1930         * storage/StorageQuotaManager.h:
1931
1932 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1933
1934         Fix iOS build after r243337
1935         https://bugs.webkit.org/show_bug.cgi?id=195935
1936
1937         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1938         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
1939         (WebCore::playbackSessionModel const): Deleted.
1940
1941 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
1942
1943         Hardening: Use WeakPtrs in PlaybackSessionInterface{Mac,AVKit}
1944         https://bugs.webkit.org/show_bug.cgi?id=195935
1945         <rdar://problem/49007015>
1946
1947         Reviewed by Eric Carlson.
1948
1949         The PlaybackSessionInterface{Mac,AVKit} implementations store their playback session model
1950         and playback controls manager members as bare pointers, something we've been working
1951         to eliminate.
1952         
1953         This patch corrects this oversight.
1954
1955         No new tests since no changes in behavior.
1956
1957         * platform/cocoa/PlaybackSessionModel.h:
1958         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1959         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1960         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
1961         (WebCore::playbackSessionModel const): Moved to implementation since WEBCORE_EXPORT is not
1962         supposed to be used with inline methods.
1963         * platform/mac/PlaybackSessionInterfaceMac.h:
1964         * platform/mac/PlaybackSessionInterfaceMac.mm:
1965         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
1966         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
1967         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
1968         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
1969         (WebCore::PlaybackSessionInterfaceMac::playBackControlsManager):
1970         * platform/mac/VideoFullscreenInterfaceMac.mm:
1971         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
1972         * platform/mac/WebPlaybackControlsManager.mm:
1973         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1974         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
1975         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
1976
1977 2019-03-21  Said Abou-Hallawa  <said@apple.com>
1978
1979         Remove the SVG tear off objects for SVGPoint, SVGPointList and SVGAnimatedPointList
1980         https://bugs.webkit.org/show_bug.cgi?id=195905
1981
1982         Reviewed by Simon Fraser.
1983
1984         To remove the SVG tear off objects for SVGPoint, SVGPointList and 
1985         SVGAnimatedPointList, these changes are needed:
1986
1987         -- Define SVGPoint to be a superclass of SVGValueProperty<FloatPoint>.
1988
1989         -- Define SVGAnimatedPointList to be a superclass of SVGAnimatedPropertyList<SVGPointList>
1990
1991         -- Add SVGPropertyList which is a superclass of SVGList. Its items are
1992            defined to RefCounted. It is the base class of SVGValuePropertyList
1993            and it will be  the base class of SVGPathSegList in a later patch.
1994
1995         -- Add SVGValuePropertyList which is the base class of all the lists whose
1996            items are backed by a value objects like SVGPoint. The difference between
1997            SVGPropertyList and SVGValuePropertyList is the former class can store
1998            a Ref pointer of the base class like SVGPathSeg while the later type
1999            has to store the same type for all the items.
2000
2001         -- Add SVGAnimatedPropertyList which is the base class for all the animated
2002            lists. Note that:
2003            1) SVGElement owns SVGAnimatedPropertyList
2004            2) SVGAnimatedPropertyList owns m_baseVal whose type is SVGList
2005            3) m_baseVal owns the items whose type is a superclass of SVGProperty.
2006            When changing an item, it calls its owner which is an SVGList.
2007            SVGList calls its owner which is SVGAnimatedPropertyList.
2008            SVGAnimatedPropertyList calls its owner which SVGElement to commit
2009            the change. Later SVGAnimatedPropertyList::synchronize() is called 
2010            which returns the property valueAsString() to update the reflecting
2011            attribute.
2012
2013         -- New accessor, animator and animation function are added to access
2014            and animate a member of type SVGAnimatedPropertyList.
2015
2016         * Sources.txt:
2017         * WebCore.xcodeproj/project.pbxproj:
2018         * rendering/svg/SVGPathData.cpp:
2019         (WebCore::pathFromCircleElement):
2020         (WebCore::pathFromEllipseElement):
2021         (WebCore::pathFromLineElement):
2022         (WebCore::pathFromPathElement):
2023         (WebCore::pathFromPolygonElement):
2024         (WebCore::pathFromPolylineElement):
2025         (WebCore::pathFromRectElement):
2026         (WebCore::pathFromGraphicsElement):
2027         * rendering/svg/SVGPathData.h:
2028         The IDL of SVGPolyElement interface requires the following attribute:
2029             readonly attribute SVGPointList points;
2030         For which we return:
2031             SVGPointList& points() { return m_points->baseVal(); }
2032         But for all the other properties we return the currentValue(). So to have
2033         the two functions with the same name, the following function is added:
2034             const SVGPointList& points() const { return m_points->currentValue(); }
2035         This definition requires changing all callers to be const.
2036
2037         * rendering/svg/SVGRenderTreeAsText.cpp:
2038         (WebCore::operator<<):
2039         * svg/SVGAnimatedPointList.cpp: Removed.
2040         * svg/SVGAnimatedPointList.h: Removed.
2041         * svg/SVGAnimatedType.h:
2042         (WebCore::SVGAnimatedType::type const):
2043         This function had a bad design. It was designed to use the index of the
2044         variant as the AnimatedPropertyType. But when some of the types are removed
2045         from SVGValueVariant, this broke things. This fix is temporary till the 
2046         class SVGValueVariant is removed.
2047
2048         * svg/SVGAnimatorFactory.h:
2049         (WebCore::SVGAnimatorFactory::create):
2050         * svg/SVGExternalResourcesRequired.cpp:
2051         * svg/SVGParserUtilities.cpp:
2052         (WebCore::pointsListFromSVGData): Deleted.
2053         * svg/SVGParserUtilities.h:
2054         * svg/SVGPoint.h:
2055         (WebCore::SVGPoint::create):
2056         (WebCore::SVGPoint::clone const):
2057         (WebCore::SVGPoint::x):
2058         (WebCore::SVGPoint::setX):
2059         (WebCore::SVGPoint::y):
2060         (WebCore::SVGPoint::setY):
2061         (WebCore::SVGPoint::matrixTransform const):
2062         (WebCore::SVGPoint::matrixTransform): Deleted.
2063         (WebCore::SVGPoint::SVGPoint): Deleted.
2064         * svg/SVGPoint.idl:
2065         matrixTransform() should not throw an exception.
2066
2067         * svg/SVGPointList.h:
2068         (WebCore::SVGPointList::create):
2069         (WebCore::SVGPointList::parse):
2070         (WebCore::SVGPointList::SVGPointList): Deleted.
2071         Move the parse() and valueAsString() methods to SVGPointList. It is now
2072         a superclass of SVGValuePropertyList. Its items are of type Ref<SVGPoint>.
2073
2074         * svg/SVGPointListValues.cpp: Removed.
2075         * svg/SVGPointListValues.h: Removed.
2076         * svg/SVGPolyElement.cpp:
2077         (WebCore::SVGPolyElement::SVGPolyElement):
2078         (WebCore::SVGPolyElement::parseAttribute):
2079         (WebCore::SVGPolyElement::approximateMemoryCost const):
2080         (WebCore::SVGPolyElement::registerAttributes): Deleted.
2081         (WebCore::SVGPolyElement::points): Deleted.
2082         (WebCore::SVGPolyElement::animatedPoints): Deleted.
2083         * svg/SVGPolyElement.h:
2084         (WebCore::SVGPolyElement::points const):
2085         (WebCore::SVGPolyElement::points):
2086         (WebCore::SVGPolyElement::animatedPoints):
2087         (WebCore::SVGPolyElement::pointList const): Deleted.
2088         (WebCore::SVGPolyElement::attributeRegistry): Deleted.
2089         * svg/SVGSVGElement.cpp:
2090         (WebCore::SVGSVGElement::setCurrentTranslate):
2091         (WebCore::SVGSVGElement::currentTranslate): Deleted.
2092         * svg/SVGSVGElement.h:
2093         * svg/SVGSVGElement.idl:
2094         Define currentTranslate property to be of type Ref<SVGPoint>. When requesting
2095         it just return a reference to it.
2096
2097         * svg/SVGValue.h:
2098         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2099         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2100         * svg/properties/SVGAnimatedPropertyImpl.h:
2101         * svg/properties/SVGAnimatedPropertyList.h: Added.
2102         Define the accessor, the animator and the animated type of SVGPointList.
2103
2104         (WebCore::SVGAnimatedPropertyList::create):
2105         (WebCore::SVGAnimatedPropertyList::~SVGAnimatedPropertyList):
2106         (WebCore::SVGAnimatedPropertyList::baseVal const):
2107         (WebCore::SVGAnimatedPropertyList::baseVal):
2108         (WebCore::SVGAnimatedPropertyList::animVal const):
2109         (WebCore::SVGAnimatedPropertyList::animVal):
2110         (WebCore::SVGAnimatedPropertyList::currentValue const):
2111         (WebCore::SVGAnimatedPropertyList::SVGAnimatedPropertyList):
2112         (WebCore::SVGAnimatedPropertyList::ensureAnimVal):
2113         * svg/properties/SVGAnimationAdditiveListFunction.h: Added.
2114         (WebCore::SVGAnimationAdditiveListFunction::SVGAnimationAdditiveListFunction):
2115         (WebCore::SVGAnimationAdditiveListFunction::toAtEndOfDuration const):
2116         (WebCore::SVGAnimationAdditiveListFunction::adjustAnimatedList):
2117         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: Added.
2118         (WebCore::SVGAnimationPointListFunction::progress):
2119         Define the animation function for animating SVGPointList.
2120
2121         * svg/properties/SVGAttributeRegistry.h:
2122         * svg/properties/SVGPropertyList.h: Added.
2123         (WebCore::SVGPropertyList::SVGPropertyList):
2124         (WebCore::SVGPropertyList::~SVGPropertyList):
2125         * svg/properties/SVGPropertyOwnerRegistry.h:
2126         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2127         * svg/properties/SVGValuePropertyList.h: Added.
2128         (WebCore::SVGValuePropertyList::operator=):
2129         (WebCore::SVGValuePropertyList::operator Vector<typename PropertyType::ValueType> const):
2130         (WebCore::SVGValuePropertyList::resize):
2131         (WebCore::SVGValuePropertyList::SVGValuePropertyList):
2132
2133 2019-03-21  Said Abou-Hallawa  <said@apple.com>
2134
2135         Remove the SVG property tear off objects for SVGAnimatedString
2136         https://bugs.webkit.org/show_bug.cgi?id=196065
2137
2138         Reviewed by Simon Fraser.
2139
2140         -- Define SVGAnimatedString to be SVGAnimatedPrimitiveProperty<String>.
2141
2142         -- Add SVGAnimatedStringAccessor to associate an attribute name with a 
2143            pointer to an SVGAnimatedString member of an SVGElement. Given a 
2144            pointer to an SVGElement, this accessor will and create an animator
2145            for the animated property.
2146
2147         -- Add SVGAnimatedStringAnimator to animated an SVGAnimatedString.
2148
2149         -- Add SVGAnimationStringFunction which is a discrete function and is 
2150            responsible for progressing an animated String over a period of time.
2151
2152         -- Define SVGStringAnimator to be SVGPrimitivePropertyAnimator<String,
2153            SVGAnimationStringFunction>. SVGStringAnimator is responsible for
2154            animating attributes with no reflecting animated properties, e.g.
2155            "font-family".
2156
2157         * Sources.txt:
2158         * WebCore.xcodeproj/project.pbxproj:
2159         * svg/SVGAElement.cpp:
2160         (WebCore::SVGAElement::SVGAElement):
2161         (WebCore::SVGAElement::parseAttribute):
2162         (WebCore::SVGAElement::registerAttributes): Deleted.
2163         * svg/SVGAElement.h:
2164         * svg/SVGAnimateElementBase.cpp:
2165         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
2166         (WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
2167         * svg/SVGAnimateElementBase.h:
2168         * svg/SVGAnimatedString.cpp: Removed.
2169         * svg/SVGAnimatedString.h: Removed.
2170         * svg/SVGAnimationElement.cpp:
2171         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
2172         The animation controller has to tell whether the animator is discrete or
2173         not. The properties are now registered either in SVGAttributeRegistry which
2174         relies on the tear off objects to know the AnimatedPropertyType of the
2175         property. Or it is registered in SVGPropertyOwnerRegistry which creates
2176         the animators through the accessors. Each animator knows whether it is
2177         discrete or not.
2178
2179         * svg/SVGAnimatorFactory.h:
2180         (WebCore::SVGAnimatorFactory::create):
2181         * svg/SVGAttributeAnimationController.cpp:
2182         (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
2183         * svg/SVGAttributeAnimationController.h:
2184         * svg/SVGAttributeAnimationControllerBase.h:
2185         * svg/SVGCursorElement.h:
2186         * svg/SVGElement.cpp:
2187         (WebCore::SVGElement::SVGElement):
2188         (WebCore::SVGElement::parseAttribute):
2189         (WebCore::SVGElement::registerAttributes): Deleted.
2190         * svg/SVGElement.h:
2191         (WebCore::SVGElement::isKnownAttribute):
2192         (WebCore::SVGElement::className const):
2193         (WebCore::SVGElement::classNameAnimated):
2194         (WebCore::SVGElement::attributeRegistry): Deleted.
2195         * svg/SVGExternalResourcesRequired.cpp:
2196         * svg/SVGFEBlendElement.cpp:
2197         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
2198         (WebCore::SVGFEBlendElement::registerAttributes):
2199         (WebCore::SVGFEBlendElement::parseAttribute):
2200         * svg/SVGFEBlendElement.h:
2201         * svg/SVGFEColorMatrixElement.cpp:
2202         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
2203         (WebCore::SVGFEColorMatrixElement::registerAttributes):
2204         (WebCore::SVGFEColorMatrixElement::parseAttribute):
2205         * svg/SVGFEColorMatrixElement.h:
2206         * svg/SVGFEComponentTransferElement.cpp:
2207         (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
2208         (WebCore::SVGFEComponentTransferElement::parseAttribute):
2209         (WebCore::SVGFEComponentTransferElement::registerAttributes): Deleted.
2210         * svg/SVGFEComponentTransferElement.h:
2211         * svg/SVGFECompositeElement.cpp:
2212         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
2213         (WebCore::SVGFECompositeElement::registerAttributes):
2214         (WebCore::SVGFECompositeElement::parseAttribute):
2215         * svg/SVGFECompositeElement.h:
2216         * svg/SVGFEConvolveMatrixElement.cpp:
2217         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
2218         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
2219         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
2220         * svg/SVGFEConvolveMatrixElement.h:
2221         * svg/SVGFEDiffuseLightingElement.cpp:
2222         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
2223         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
2224         (WebCore::SVGFEDiffuseLightingElement::registerAttributes): Deleted.
2225         * svg/SVGFEDiffuseLightingElement.h:
2226         * svg/SVGFEDisplacementMapElement.cpp:
2227         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
2228         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
2229         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
2230         * svg/SVGFEDisplacementMapElement.h:
2231         * svg/SVGFEDropShadowElement.cpp:
2232         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
2233         (WebCore::SVGFEDropShadowElement::parseAttribute):
2234         (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
2235         (WebCore::SVGFEDropShadowElement::registerAttributes): Deleted.
2236         * svg/SVGFEDropShadowElement.h:
2237         * svg/SVGFEGaussianBlurElement.cpp:
2238         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
2239         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
2240         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
2241         * svg/SVGFEGaussianBlurElement.h:
2242         * svg/SVGFEMergeNodeElement.cpp:
2243         (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
2244         (WebCore::SVGFEMergeNodeElement::parseAttribute):
2245         (WebCore::SVGFEMergeNodeElement::registerAttributes): Deleted.
2246         * svg/SVGFEMergeNodeElement.h:
2247         * svg/SVGFEMorphologyElement.cpp:
2248         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
2249         (WebCore::SVGFEMorphologyElement::registerAttributes):
2250         (WebCore::SVGFEMorphologyElement::parseAttribute):
2251         * svg/SVGFEMorphologyElement.h:
2252         * svg/SVGFEOffsetElement.cpp:
2253         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
2254         (WebCore::SVGFEOffsetElement::parseAttribute):
2255         (WebCore::SVGFEOffsetElement::svgAttributeChanged):
2256         (WebCore::SVGFEOffsetElement::registerAttributes): Deleted.
2257         * svg/SVGFEOffsetElement.h:
2258         * svg/SVGFESpecularLightingElement.cpp:
2259         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
2260         (WebCore::SVGFESpecularLightingElement::parseAttribute):
2261         (WebCore::SVGFESpecularLightingElement::registerAttributes): Deleted.
2262         * svg/SVGFESpecularLightingElement.h:
2263         * svg/SVGFETileElement.cpp:
2264         (WebCore::SVGFETileElement::SVGFETileElement):
2265         (WebCore::SVGFETileElement::parseAttribute):
2266         (WebCore::SVGFETileElement::registerAttributes): Deleted.
2267         * svg/SVGFETileElement.h:
2268         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2269         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
2270         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
2271         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
2272         * svg/SVGFilterPrimitiveStandardAttributes.h:
2273         (WebCore::SVGFilterPrimitiveStandardAttributes::result const):
2274         (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
2275         * svg/SVGLegacyAttributeAnimationController.cpp:
2276         (WebCore::SVGLegacyAttributeAnimationController::isDiscreteAnimator const):
2277         * svg/SVGLegacyAttributeAnimationController.h:
2278         * svg/SVGMPathElement.h:
2279         * svg/SVGScriptElement.h:
2280         * svg/SVGURIReference.cpp:
2281         (WebCore::SVGURIReference::SVGURIReference):
2282         (WebCore::SVGURIReference::isKnownAttribute):
2283         (WebCore::SVGURIReference::parseAttribute):
2284         (WebCore::SVGURIReference::registerAttributes): Deleted.
2285         (WebCore::SVGURIReference::href const): Deleted.
2286         (WebCore::SVGURIReference::hrefAnimated): Deleted.
2287         * svg/SVGURIReference.h:
2288         (WebCore::SVGURIReference::href const):
2289         (WebCore::SVGURIReference::hrefAnimated):
2290         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2291         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2292         * svg/properties/SVGAnimatedPropertyImpl.h:
2293         * svg/properties/SVGAttributeRegistry.h:
2294         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
2295         * svg/properties/SVGPropertyAnimatorFactory.h:
2296         (WebCore::SVGPropertyAnimatorFactory::createStringAnimator):
2297         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
2298         * svg/properties/SVGPropertyOwnerRegistry.h:
2299         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2300
2301 2019-03-21  Zalan Bujtas  <zalan@apple.com>
2302
2303         Do not insert the first-letter anonymous container until after we've constructed the first-letter renderer.
2304         https://bugs.webkit.org/show_bug.cgi?id=195919
2305         <rdar://problem/48573434>
2306
2307         Reviewed by Brent Fulgham.
2308
2309         When the container is injected too early, we might end up removing it as part of the collapsing logic
2310         while the text renderer is being removed (replaced with the first letter + remaining text).
2311
2312         Test: fast/css/first-letter-and-float-crash.html
2313
2314         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2315         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2316
2317 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
2318
2319         Add UI process WebRTC runtime logging.
2320         https://bugs.webkit.org/show_bug.cgi?id=196020
2321         <rdar://problem/49071443>
2322
2323         Reviewed by Youenn Fablet.
2324
2325         * inspector/agents/WebConsoleAgent.cpp:
2326         (WebCore::WebConsoleAgent::getLoggingChannels): Deleted.
2327         (WebCore::channelConfigurationForString): Deleted.
2328         (WebCore::WebConsoleAgent::setLoggingChannelLevel): Deleted.
2329         * inspector/agents/WebConsoleAgent.h:
2330         * inspector/agents/page/PageConsoleAgent.cpp:
2331         (WebCore::PageConsoleAgent::PageConsoleAgent): Change 'context' parameter from 
2332         WebAgentContext to PageAgentContext. Store the inspected page for later use.
2333         (WebCore::PageConsoleAgent::getLoggingChannels): Moved from WebConsoleAgent.
2334         (WebCore::channelConfigurationForString): Ditto.
2335         (WebCore::PageConsoleAgent::setLoggingChannelLevel): Moved from WebConsoleAgent.
2336         Call the inspected page to actually change the log channel configuration.
2337         * inspector/agents/page/PageConsoleAgent.h:
2338         * page/ChromeClient.h:
2339         * page/Page.cpp:
2340         (WebCore::Page::configureLoggingChannel): New.
2341         * page/Page.h:
2342
2343 2019-03-21  Andy Estes  <aestes@apple.com>
2344
2345         [iOS] Apple Pay should be available in documents with no user agent scripts
2346         https://bugs.webkit.org/show_bug.cgi?id=196061
2347         <rdar://problem/48649391>
2348
2349         Reviewed by Brady Eidson.
2350
2351         On platforms that support APPLE_PAY_REMOTE_UI, we can enable Apple Pay JS and Payment Request
2352         by default in all WebKit clients.
2353
2354         In order to protect the privacy of Apple Pay transactions, this patch implements the
2355         following restrictions on API usage:
2356
2357         1. If user agent scripts have been evaluated in a document, Apple Pay APIs will no longer be
2358         available for the duration of the document's lifetime.
2359         2. If an Apple Pay transaction has started in a document, user agent scripts will no longer
2360         be evaluated for the duration of the document's lifetime.
2361
2362         These restrictions are disabled for clients with the
2363         com.apple.private.WebKit.UnrestrictedApplePay entitlement and platforms that do support
2364         Apple Pay but don't support APPLE_PAY_REMOTE_UI.
2365
2366         Added new API tests.
2367
2368         * Modules/applepay/ApplePayRequestBase.cpp:
2369         (WebCore::convertAndValidate):
2370         * Modules/applepay/ApplePayRequestBase.h:
2371         * Modules/applepay/ApplePaySession.cpp:
2372         (WebCore::convertAndValidate):
2373         (WebCore::ApplePaySession::create):
2374         (WebCore::ApplePaySession::supportsVersion):
2375         (WebCore::ApplePaySession::canMakePayments):
2376         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
2377         (WebCore::ApplePaySession::openPaymentSetup):
2378         (WebCore::ApplePaySession::begin):
2379         * Modules/applepay/ApplePaySession.h:
2380         * Modules/applepay/ApplePaySession.idl:
2381         * Modules/applepay/PaymentCoordinator.cpp:
2382         (WebCore::PaymentCoordinator::supportsVersion const):
2383         (WebCore::PaymentCoordinator::canMakePayments):
2384         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
2385         (WebCore::PaymentCoordinator::openPaymentSetup):
2386         (WebCore::PaymentCoordinator::beginPaymentSession):
2387         (WebCore::PaymentCoordinator::validatedPaymentNetwork const):
2388         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
2389         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
2390         * Modules/applepay/PaymentCoordinator.h:
2391         * Modules/applepay/PaymentCoordinatorClient.h:
2392         (WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const):
2393         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2394         (WebCore::ApplePayPaymentHandler::show):
2395         (WebCore::ApplePayPaymentHandler::canMakePayment):
2396         (WebCore::ApplePayPaymentHandler::version const):
2397         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2398         * Modules/paymentrequest/PaymentHandler.h:
2399         * Modules/paymentrequest/PaymentRequest.cpp:
2400         (WebCore::PaymentRequest::show):
2401         (WebCore::PaymentRequest::canMakePayment):
2402
2403         Plumbed a Document& through to the various places that call into PaymentCoordinator for use
2404         by shouldAllowApplePay and shouldAllowUserAgentScripts.
2405
2406         * bindings/js/ScriptController.cpp:
2407         (WebCore::ScriptController::executeUserAgentScriptInWorld):
2408         (WebCore::ScriptController::shouldAllowUserAgentScripts const):
2409         * bindings/js/ScriptController.h:
2410
2411         Added executeUserAgentScriptInWorld, which calls executeScriptInWorld if allowed.
2412
2413         * dom/Document.cpp:
2414         (WebCore::Document::ensurePlugInsInjectedScript):
2415
2416         Changed to only evaluate the chrome client's plug-in extra script if allowed, and to mark
2417         the document as having evaluated user agent scripts.
2418
2419         (WebCore::Document::hasEvaluatedUserAgentScripts const):
2420         (WebCore::Document::isRunningUserScripts const):
2421         (WebCore::Document::setAsRunningUserScripts):
2422         (WebCore::Document::setHasEvaluatedUserAgentScripts):
2423         (WebCore::Document::hasStartedApplePaySession const):
2424         (WebCore::Document::setHasStartedApplePaySession):
2425         * dom/Document.h:
2426
2427         Added helper functions to set state on the top document.
2428
2429         * loader/DocumentThreadableLoader.cpp:
2430         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2431
2432         Removed call to topDocument() now that isRunningUserScripts() always checks the top document.
2433
2434         * page/Frame.cpp:
2435         (WebCore::Frame::injectUserScriptImmediately):
2436
2437         Changed to only inject the user script if allowed.
2438
2439         * page/Settings.yaml:
2440         * page/SettingsDefaultValues.h:
2441
2442         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
2443
2444         * testing/Internals.cpp:
2445         (WebCore::Internals::setAsRunningUserScripts):
2446         (WebCore::Internals::setHasStartedApplePaySession):
2447         * testing/Internals.h:
2448         * testing/Internals.idl:
2449         * testing/MockPaymentCoordinator.h:
2450         * testing/MockPaymentCoordinator.idl:
2451
2452         Added some internal interfaces for use by TestWebKitAPI.
2453
2454 2019-03-21  Alex Christensen  <achristensen@webkit.org>
2455
2456         Add SPI to inform applications of WKContentRuleList actions
2457         https://bugs.webkit.org/show_bug.cgi?id=195965
2458         <rdar://problem/42664365>
2459
2460         Reviewed by Geoff Garen.
2461
2462         We already had SPI to inform the application of notifications.
2463         In order to inform it about other actions, I needed to put them in a different structure.
2464         Basically, instead of a Vector<Action> I use a Vector<Vector<Action>> that contains the same actions.
2465         That way we can give one callback per WKContentRuleList.
2466
2467         * Modules/websockets/WebSocketChannel.cpp:
2468         (WebCore::WebSocketChannel::connect):
2469         * WebCore.xcodeproj/project.pbxproj:
2470         * contentextensions/ContentExtensionActions.h:
2471         * contentextensions/ContentExtensionParser.cpp:
2472         (WebCore::ContentExtensions::loadEncodedRules):
2473         * contentextensions/ContentExtensionRule.cpp:
2474         (WebCore::ContentExtensions::Action::isolatedCopy const):
2475         * contentextensions/ContentExtensionRule.h:
2476         (WebCore::ContentExtensions::Action::operator== const):
2477         (WebCore::ContentExtensions::Action::setExtensionIdentifier): Deleted.
2478         (WebCore::ContentExtensions::Action::extensionIdentifier const): Deleted.
2479         * contentextensions/ContentExtensionsBackend.cpp:
2480         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
2481         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
2482         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForPingLoad):
2483         (WebCore::ContentExtensions::applyResultsToRequest):
2484         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
2485         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad): Deleted.
2486         (WebCore::ContentExtensions::applyBlockedStatusToRequest): Deleted.
2487         * contentextensions/ContentExtensionsBackend.h:
2488         * contentextensions/ContentRuleListResults.h: Added.
2489         (WebCore::ContentRuleListResults::Result::shouldNotifyApplication const):
2490         (WebCore::ContentRuleListResults::shouldNotifyApplication const):
2491         (WebCore::ContentRuleListResults::encode const):
2492         (WebCore::ContentRuleListResults::decode):
2493         (WebCore::ContentRuleListResults::Result::encode const):
2494         (WebCore::ContentRuleListResults::Result::decode):
2495         (WebCore::ContentRuleListResults::Summary::encode const):
2496         (WebCore::ContentRuleListResults::Summary::decode):
2497         * css/StyleSheetContents.cpp:
2498         (WebCore::StyleSheetContents::subresourcesAllowReuse const):
2499         * html/HTMLMediaElement.cpp:
2500         (WebCore::HTMLMediaElement::loadResource):
2501         * loader/FrameLoader.cpp:
2502         (WebCore::FrameLoader::loadResourceSynchronously):
2503         * loader/PingLoader.cpp:
2504         (WebCore::processContentRuleListsForLoad):
2505         (WebCore::PingLoader::loadImage):
2506         (WebCore::PingLoader::sendPing):
2507         (WebCore::PingLoader::sendViolationReport):
2508         (WebCore::processContentExtensionRulesForLoad): Deleted.
2509         * loader/ResourceLoader.cpp:
2510         (WebCore::ResourceLoader::willSendRequestInternal):
2511         * loader/cache/CachedResourceLoader.cpp:
2512         (WebCore::CachedResourceLoader::requestResource):
2513         * loader/cache/CachedResourceRequest.cpp:
2514         (WebCore::CachedResourceRequest::applyResults):
2515         (WebCore::CachedResourceRequest::applyBlockedStatus): Deleted.
2516         * loader/cache/CachedResourceRequest.h:
2517         * page/ChromeClient.h:
2518         (WebCore::ChromeClient::contentRuleListNotification):
2519         * page/DOMWindow.cpp:
2520         (WebCore::DOMWindow::open):
2521         * page/UserContentProvider.cpp:
2522         (WebCore::UserContentProvider::processContentRuleListsForLoad):
2523         (WebCore::UserContentProvider::actionsForResourceLoad):
2524         (WebCore::UserContentProvider::processContentExtensionRulesForLoad): Deleted.
2525         * page/UserContentProvider.h:
2526
2527 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2528
2529         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
2530         https://bugs.webkit.org/show_bug.cgi?id=196058
2531         rdar://problem/49078202
2532
2533         Reviewed by Antti Koivisto.
2534
2535         Add an internal setting called "legacyOverflowScrollingTouchEnabled", initially
2536         on by default.
2537
2538         When disabled, it makes the -webkit-overflow-scrolling property be unsupported.
2539
2540         Tests: fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html
2541                fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html
2542
2543         * css/parser/CSSParserContext.cpp:
2544         (WebCore::CSSParserContext::CSSParserContext):
2545         (WebCore::operator==):
2546         * css/parser/CSSParserContext.h:
2547         (WebCore::CSSParserContextHash::hash):
2548         * css/parser/CSSParserFastPaths.cpp:
2549         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2550         * css/parser/CSSParserFastPaths.h:
2551         * css/parser/CSSPropertyParser.cpp:
2552         (WebCore::CSSPropertyParser::parseSingleValue):
2553         * page/Settings.yaml:
2554
2555 2019-03-21  Antti Koivisto  <antti@apple.com>
2556
2557         UI-process hit-testing needs to know about containing block relationships
2558         https://bugs.webkit.org/show_bug.cgi?id=195845
2559         <rdar://problem/48949633>
2560
2561         Reviewed by Simon Fraser.
2562
2563         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
2564
2565         * page/scrolling/ScrollingTree.h:
2566         * page/scrolling/ScrollingTreeScrollingNode.h:
2567         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
2568         (WebCore::ScrollingTreePositionedNode::layer const):
2569
2570 2019-03-21  Zalan Bujtas  <zalan@apple.com>
2571
2572         [ContentChangeObserver] Cleanup reset state.
2573         https://bugs.webkit.org/show_bug.cgi?id=196076
2574         <rdar://problem/49107931>
2575
2576         Reviewed by Simon Fraser.
2577
2578         stopObservingPendingActivities() is a subset of reset() and call it when we've observed a visible change.
2579
2580         * page/ios/ContentChangeObserver.cpp:
2581         (WebCore::ContentChangeObserver::willNotProceedWithClick):
2582         (WebCore::ContentChangeObserver::stopObservingPendingActivities):
2583         (WebCore::ContentChangeObserver::reset):
2584         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
2585         (WebCore::ContentChangeObserver::willDetachPage):
2586         (WebCore::ContentChangeObserver::adjustObservedState):
2587         (WebCore::ContentChangeObserver::cancelPendingActivities): Deleted.
2588         * page/ios/ContentChangeObserver.h:
2589
2590 2019-03-21  Zalan Bujtas  <zalan@apple.com>
2591
2592         Unreviewed build fix.
2593
2594         * page/ios/ContentChangeObserver.h:
2595
2596 2019-03-21  Zalan Bujtas  <zalan@apple.com>
2597
2598         [ContentChangeObserver] Start tracking implicit transitions at mousemove
2599         https://bugs.webkit.org/show_bug.cgi?id=196054
2600         <rdar://problem/49093840>
2601
2602         Reviewed by Simon Fraser.
2603
2604         This patch fixes the hover menu issue on seriouseats.com. After tapping on the menu items, the submenus show up now.
2605
2606         1. Start observing at mousemove
2607         2. Check if the style change is synchronous or not and start observing it accordingly.
2608
2609         Tests: fast/events/touch/ios/content-observation/0ms-delay-0ms-transition-on-mousemove.html
2610                fast/events/touch/ios/content-observation/100ms-delay-10ms-transition-on-mousemove.html
2611                fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-mousemove.html
2612                fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-touch-start.html
2613
2614         * page/ios/ContentChangeObserver.cpp:
2615         (WebCore::ContentChangeObserver::adjustObservedState):
2616
2617 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2618
2619         Absolute in stacking-context scroller jiggles when scrolled
2620         https://bugs.webkit.org/show_bug.cgi?id=196010
2621
2622         Reviewed by Zalan Bujtas.
2623
2624         Updating compositing layers after a scroll (in a compositing update on the main thread)
2625         failed to traverse to an absolute layer inside a stacking-context overflow:scroll,
2626         because the overflow's layer didn't have the "hasCompositingAncestor" bit set on it.
2627
2628         This happened because childState.subtreeIsCompositing wasn't being set when indirect
2629         reasons trigger compositing. So clean up RenderLayerCompositor::computeCompositingRequirements()
2630         to set childState.subtreeIsCompositing for "late" compositing decisions, and move the
2631         "Subsequent layers in the parent stacking context also need to composite" chunk
2632         down to after the last compositing decision has been made.
2633
2634         Test: compositing/overflow/absolute-in-overflow.html
2635
2636         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2637         (WebCore::ScrollingTreeScrollingNode::scrollTo):
2638         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2639         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
2640         * rendering/RenderLayerCompositor.cpp:
2641         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2642
2643 2019-03-21  Zalan Bujtas  <zalan@apple.com>
2644
2645         [ContentChangeObserver] Start tracking implicit transitions at touchStart
2646         https://bugs.webkit.org/show_bug.cgi?id=196051
2647         <rdar://problem/49092952>
2648
2649         Reviewed by Simon Fraser.
2650
2651         This patch enables transition tracking on touchStart.
2652
2653         1. Start observing for new transitions at touchStart
2654         2. Stop observing at touchEnd
2655         3. Check the next style recalc when the transition is finished (at onAnimationEnd we don't yet have the final computed style).
2656         4. Remove the tracked transition when it is canceled.
2657
2658         Tests: fast/events/touch/ios/content-observation/0ms-transition-on-touch-start.html
2659                fast/events/touch/ios/content-observation/100ms-transition-on-touch-start.html
2660                fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start.html
2661                fast/events/touch/ios/content-observation/transition-on-touch-start-and-remove.html
2662
2663         * page/ios/ContentChangeObserver.cpp:
2664         (WebCore::ContentChangeObserver::didAddTransition):
2665         (WebCore::ContentChangeObserver::didFinishTransition):
2666         (WebCore::ContentChangeObserver::didRemoveTransition):
2667         (WebCore::ContentChangeObserver::adjustObservedState):
2668         * page/ios/ContentChangeObserver.h:
2669         (WebCore::ContentChangeObserver::setShouldObserveTransitions):
2670         (WebCore::ContentChangeObserver::clearObservedTransitions):
2671         (WebCore::ContentChangeObserver::hasObservedTransition const):
2672         (WebCore::ContentChangeObserver::hasPendingActivity const):
2673
2674 2019-03-21  Zalan Bujtas  <zalan@apple.com>
2675
2676         [ContentChangeObserver] Track hidden elements only while transitioning.
2677         https://bugs.webkit.org/show_bug.cgi?id=196050
2678         <rdar://problem/49092037>
2679
2680         Reviewed by Simon Fraser.
2681
2682         Use the existing isConsideredHidden() logic to decide whether the current transition should be tracked.
2683
2684         * page/ios/ContentChangeObserver.cpp:
2685         (WebCore::isConsideredHidden):
2686         (WebCore::ContentChangeObserver::didAddTransition):
2687         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
2688         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
2689         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Deleted.
2690         * page/ios/ContentChangeObserver.h:
2691
2692 2019-03-21  Zalan Bujtas  <zalan@apple.com>
2693
2694         [ContentChangeObserver] Add support for observing implicit transitions
2695         https://bugs.webkit.org/show_bug.cgi?id=195914
2696         <rdar://problem/49091959>
2697
2698         Reviewed by Simon Fraser.
2699
2700         This patch is in preparation for observing elements with property "left" implicit transitions.
2701
2702         This is not a continuous tracking, we are only interested in the start and the end state.
2703         The idea here is to register hidden elements only and check if they become visible by
2704         the end of the transition (and ignore if the transition gets "canceled").
2705
2706         * page/animation/AnimationBase.h:
2707         * page/animation/ImplicitAnimation.cpp:
2708         (WebCore::ImplicitAnimation::ImplicitAnimation):
2709         (WebCore::ImplicitAnimation::~ImplicitAnimation):
2710         (WebCore::ImplicitAnimation::clear):
2711         (WebCore::ImplicitAnimation::onAnimationEnd):
2712         * page/animation/ImplicitAnimation.h:
2713         * page/ios/ContentChangeObserver.cpp:
2714         (WebCore::ContentChangeObserver::didAddTransition):
2715         (WebCore::ContentChangeObserver::removeTransitionIfNeeded):
2716         (WebCore::ContentChangeObserver::didFinishTransition):
2717         (WebCore::ContentChangeObserver::didRemoveTransition):
2718         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2719         * page/ios/ContentChangeObserver.h:
2720         (WebCore::ContentChangeObserver::isObservingTransitions const):
2721         (WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
2722
2723 2019-03-21  Devin Rousso  <drousso@apple.com>
2724
2725         Web Inspector: Page: lazily create the agent
2726         https://bugs.webkit.org/show_bug.cgi?id=195592
2727         <rdar://problem/48791916>
2728
2729         Reviewed by Timothy Hatcher.
2730
2731         No change in functionality.
2732
2733         Have more agents save the inspected `Page` so they don't need to access it via the
2734         `InspectorPageAgent`. Make some of `InspectorPageAgent`'s functions `static` so other
2735         agents can use them without needing to have access to an enabled `InspectorPageAgent`.
2736
2737         * inspector/InspectorController.cpp:
2738         (WebCore::InspectorController::InspectorController):
2739         (WebCore::InspectorController::createLazyAgents):
2740
2741         * inspector/agents/InspectorPageAgent.h:
2742         (WebCore::InspectorPageAgent::page): Deleted.
2743         * inspector/agents/InspectorPageAgent.cpp:
2744         (WebCore::InspectorPageAgent::InspectorPageAgent):
2745         (WebCore::InspectorPageAgent::enable):
2746         (WebCore::InspectorPageAgent::disable):
2747         (WebCore::InspectorPageAgent::reload):
2748         (WebCore::InspectorPageAgent::navigate):
2749         (WebCore::InspectorPageAgent::overrideSetting):
2750         (WebCore::InspectorPageAgent::getCookies):
2751         (WebCore::InspectorPageAgent::deleteCookie):
2752         (WebCore::InspectorPageAgent::getResourceTree):
2753         (WebCore::InspectorPageAgent::searchInResources):
2754         (WebCore::InspectorPageAgent::didPaint):
2755         (WebCore::InspectorPageAgent::didLayout):
2756         (WebCore::InspectorPageAgent::didScroll):
2757         (WebCore::InspectorPageAgent::didRecalculateStyle):
2758         (WebCore::InspectorPageAgent::setEmulatedMedia):
2759         (WebCore::InspectorPageAgent::setForcedAppearance):
2760         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
2761         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
2762         (WebCore::InspectorPageAgent::snapshotNode):
2763         (WebCore::InspectorPageAgent::snapshotRect):
2764         (WebCore::InspectorPageAgent::archive):
2765         (WebCore::InspectorPageAgent::mainFrame): Deleted.
2766         (WebCore::InspectorPageAgent::hasIdForFrame const): Deleted.
2767
2768         * inspector/agents/InspectorApplicationCacheAgent.h:
2769         * inspector/agents/InspectorApplicationCacheAgent.cpp:
2770         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
2771         (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
2772         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
2773         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
2774
2775         * inspector/agents/InspectorCanvasAgent.h:
2776         * inspector/agents/InspectorCanvasAgent.cpp:
2777         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
2778         (WebCore::InspectorCanvasAgent::enable):
2779
2780         * inspector/agents/InspectorDOMStorageAgent.h:
2781         * inspector/agents/InspectorDOMStorageAgent.cpp:
2782         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
2783         (WebCore::InspectorDOMStorageAgent::findStorageArea):
2784
2785         * inspector/agents/InspectorIndexedDBAgent.h:
2786         * inspector/agents/InspectorIndexedDBAgent.cpp:
2787         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
2788         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2789         (WebCore::InspectorIndexedDBAgent::requestDatabase):
2790         (WebCore::InspectorIndexedDBAgent::requestData):
2791         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
2792
2793         * inspector/agents/page/PageDebuggerAgent.h:
2794         * inspector/agents/page/PageDebuggerAgent.cpp:
2795         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2796         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
2797         (WebCore::PageDebuggerAgent::breakpointActionLog):
2798         (WebCore::PageDebuggerAgent::injectedScriptForEval):
2799
2800         * inspector/agents/page/PageNetworkAgent.h:
2801         * inspector/agents/page/PageNetworkAgent.cpp:
2802         (WebCore::PageNetworkAgent::PageNetworkAgent):
2803         (WebCore::PageNetworkAgent::loaderIdentifier):
2804         (WebCore::PageNetworkAgent::frameIdentifier):
2805         (WebCore::PageNetworkAgent::setResourceCachingDisabled):
2806         (WebCore::PageNetworkAgent::scriptExecutionContext):
2807
2808         * inspector/InspectorInstrumentation.cpp:
2809         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
2810
2811 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
2812
2813         Hardening: Use WeakPtrs in VideoFullscreenInterface{Mac,AVKit}
2814         https://bugs.webkit.org/show_bug.cgi?id=196052
2815         <rdar://problem/48778571>
2816
2817         Reviewed by Eric Carlson.
2818
2819         The VideoFullscreenInterface{Mac,AVKit} implementations store their fullscreen model
2820         and fullscreen change observer members as bare pointers, something we've been working
2821         to eliminate.
2822         
2823         This patch corrects this oversight.
2824
2825         No new tests since no changes in behavior.
2826
2827         * platform/cocoa/VideoFullscreenChangeObserver.h:
2828         * platform/cocoa/VideoFullscreenModel.h:
2829         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2830         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2831         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
2832         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
2833         (VideoFullscreenInterfaceAVKit::presentingViewController):
2834         (VideoFullscreenInterfaceAVKit::invalidate):
2835         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
2836         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2837         (VideoFullscreenInterfaceAVKit::doSetup):
2838         * platform/mac/VideoFullscreenInterfaceMac.h:
2839         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
2840         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
2841         * platform/mac/VideoFullscreenInterfaceMac.mm:
2842         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel):
2843         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
2844         (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
2845         (WebCore::VideoFullscreenInterfaceMac::invalidate):
2846
2847 2019-03-21  Megan Gardner  <megan_gardner@apple.com>
2848
2849         Smart delete for paragraphs.
2850         https://bugs.webkit.org/show_bug.cgi?id=195837
2851
2852         Reviewed by Ryosuke Niwa.
2853
2854         Remove additional newlines to maintain spacing around paragraphs.
2855
2856         Tests: editing/pasteboard/smart-delete-paragraph-001.html
2857                editing/pasteboard/smart-delete-paragraph-002.html
2858                editing/pasteboard/smart-delete-paragraph-003.html
2859                editing/pasteboard/smart-delete-paragraph-004.html
2860
2861         * editing/DeleteSelectionCommand.cpp:
2862         (WebCore::isBlankLine):
2863         (WebCore::DeleteSelectionCommand::initializePositionData):
2864
2865 2019-03-21  Cathie Chen  <cathiechen@igalia.com>
2866
2867         Fixed ContentChangeObserver build error.
2868         https://bugs.webkit.org/show_bug.cgi?id=195993
2869
2870         Reviewed by Rob Buis.
2871
2872         EWS IOS compiler complains after adding new files in Bug 157743.
2873         ContentChangeObserver.h should have forward declaration for Element.
2874
2875         * page/ios/ContentChangeObserver.cpp:
2876         * page/ios/ContentChangeObserver.h:
2877
2878 2019-03-21  Charlie Turner  <cturner@igalia.com>
2879
2880         [GStreamer][EME][Clearkey] Take a lock in keys() method
2881         https://bugs.webkit.org/show_bug.cgi?id=195900
2882
2883         Reviewed by Xabier Rodriguez-Calvar.
2884
2885         This isn't ideal, since we're taking a lock for every frame to
2886         decode. But there's no good way around it when keys can be
2887         made unavailable at any time via an update() call, so we can't
2888         cache key IDs in the decryptor.
2889
2890         Covered by test imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.https.html
2891
2892         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2893         (WebCore::CDMInstanceClearKey::keys const): This method is called
2894         from GStreamer's decode() method, which runs off the main thread,
2895         therefore we need to take a lock.
2896         * platform/encryptedmedia/clearkey/CDMClearKey.h:
2897
2898 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2899
2900         [GTK][WPE] Add API to provide geolocation information
2901         https://bugs.webkit.org/show_bug.cgi?id=195940
2902
2903         Reviewed by Michael Catanzaro.
2904
2905         Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).
2906
2907         * PlatformGTK.cmake:
2908         * platform/geoclue/GeolocationProviderGeoclue.cpp:
2909         * platform/geoclue/GeolocationProviderGeoclue.h:
2910         * platform/geoclue/GeolocationProviderGeoclueClient.h:
2911
2912 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2913
2914         [WPE] Confusing messages in stderr when surfaceless context is not supported
2915         https://bugs.webkit.org/show_bug.cgi?id=195742
2916
2917         Reviewed by Žan Doberšek.
2918
2919         The messages shown are:
2920
2921         Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
2922         Cannot create EGL WPE context: EGL_SUCCESS
2923
2924         It seems like there's anything wrong, while there isn't. It's also confusing an error message where the error is
2925         EGL_SUCCESS. I think we should not show those messages at all, not suporting surfaceless contexts is not an
2926         error and it's correctly handled. Failing to get a native window handle from render backend offscreen egl target
2927         is not an error either, since most of the backends don't implement the interface (they actually have an empty
2928         implementation).
2929
2930         * platform/graphics/egl/GLContextEGL.cpp:
2931         (WebCore::GLContextEGL::createSurfacelessContext): Remove the message when extensions are not present
2932         * platform/graphics/egl/GLContextEGLLibWPE.cpp:
2933         (WebCore::GLContextEGL::createWPEContext): Handle the case of wpe_renderer_backend_egl_offscreen_target_create()
2934         returning nullptr, which can happen if the backend doesn't implement the interface. Move the context creation
2935         after the target initialization, to avoid leaking the context when the target doesn't have a native window.
2936
2937 2019-03-20  Yusuke Suzuki  <ysuzuki@apple.com>
2938
2939         [JSC] Use finalizer in JSGlobalLexicalEnvironment and JSGlobalObject
2940         https://bugs.webkit.org/show_bug.cgi?id=195992
2941
2942         Reviewed by Keith Miller and Mark Lam.
2943
2944         Use cellHeapCellType since JSSegmentedVariableObject already set finalizer.
2945
2946         * bindings/js/WebCoreJSClientData.cpp:
2947         (WebCore::JSVMClientData::JSVMClientData):
2948
2949 2019-03-20  Youenn Fablet  <youenn@apple.com>
2950
2951         Compute quota after network process restart based on default quota and space used
2952         https://bugs.webkit.org/show_bug.cgi?id=195804
2953
2954         Reviewed by Chris Dumez.
2955
2956         At creation of quota manager, a default quota will be assigned.
2957         This value is the same for all origins.
2958         Some origins may have been granted a bigger quota by the user.
2959         In that case, the space used might be greater for these origins.
2960         Update at initialization time the quota according the space used as follows:
2961         - If space used is below default quota, stick with default quota.
2962         - If space used is above, set quota to space used rounded by one tenth of the default quota.
2963         The rounding ensures that quota requests will not happen too quickly after a page is loaded.
2964
2965         Test: http/wpt/cache-storage/cache-quota-after-restart.any.html
2966
2967         * Modules/cache/CacheStorageConnection.h:
2968         (WebCore::CacheStorageConnection::setQuotaBasedOnSpaceUsage):
2969         * storage/StorageQuotaManager.cpp:
2970         (WebCore::StorageQuotaManager::setQuotaBasedOnSpaceUsage):
2971         (WebCore::StorageQuotaManager::addUser):
2972         * storage/StorageQuotaManager.h:
2973         * testing/Internals.cpp:
2974         (WebCore::Internals::updateQuotaBasedOnSpaceUsage):
2975         * testing/Internals.h:
2976         * testing/Internals.idl:
2977
2978 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
2979
2980         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
2981         https://bugs.webkit.org/show_bug.cgi?id=196049
2982
2983         Reviewed by Tim Horton.
2984
2985         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
2986         overflow scrolling in general, so rename it.
2987
2988         * Configurations/FeatureDefines.xcconfig:
2989         * css/CSSComputedStyleDeclaration.cpp:
2990         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2991         * css/CSSProperties.json:
2992         * css/CSSValueKeywords.in:
2993         * css/StyleBuilderConverter.h:
2994         * css/StyleResolver.cpp:
2995         (WebCore::StyleResolver::adjustRenderStyle):
2996         * css/parser/CSSParserFastPaths.cpp:
2997         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2998         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2999         * dom/Element.cpp:
3000         * dom/Element.h:
3001         * rendering/RenderLayer.cpp:
3002         (WebCore::RenderLayer::canUseCompositedScrolling const):
3003         * rendering/style/RenderStyle.cpp:
3004         (WebCore::rareInheritedDataChangeRequiresLayout):
3005         * rendering/style/RenderStyle.h:
3006         * rendering/style/StyleRareInheritedData.cpp:
3007         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3008         (WebCore::StyleRareInheritedData::operator== const):
3009         * rendering/style/StyleRareInheritedData.h:
3010         * rendering/style/WillChangeData.cpp:
3011         (WebCore::WillChangeData::propertyCreatesStackingContext):
3012
3013 2019-03-20  Devin Rousso  <drousso@apple.com>
3014
3015         Web Inspector: DOM: lazily create the agent
3016         https://bugs.webkit.org/show_bug.cgi?id=195589
3017         <rdar://problem/48791742>
3018
3019         Reviewed by Timothy Hatcher.
3020
3021         No change in functionality.
3022
3023         * inspector/agents/InspectorDOMAgent.h:
3024         (WebCore::InspectorDOMAgent::DOMListener): Deleted.
3025         (WebCore::InspectorDOMAgent::pageAgent): Deleted.
3026         * inspector/agents/InspectorDOMAgent.cpp:
3027         (WebCore::InspectorDOMAgent):
3028         (WebCore::InspectorDOMAgent::unbind):
3029         (WebCore::InspectorDOMAgent::setSearchingForNode):
3030         (WebCore::InspectorDOMAgent::highlightSelector):
3031         (WebCore::InspectorDOMAgent::highlightFrame):
3032         (WebCore::InspectorDOMAgent::buildObjectForNode):
3033         (WebCore::InspectorDOMAgent::didModifyDOMAttr):
3034         (WebCore::InspectorDOMAgent::didRemoveDOMAttr):
3035         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
3036         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
3037         (WebCore::InspectorDOMAgent::setDOMListener): Deleted.
3038
3039         * inspector/agents/InspectorCSSAgent.h:
3040         * inspector/agents/InspectorCSSAgent.cpp:
3041         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
3042         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
3043         (WebCore::InspectorCSSAgent::reset):
3044         (WebCore::InspectorCSSAgent::enable):
3045         (WebCore::InspectorCSSAgent::disable):
3046         (WebCore::InspectorCSSAgent::forcePseudoState):
3047         (WebCore::InspectorCSSAgent::collectAllStyleSheets):
3048         (WebCore::InspectorCSSAgent::setStyleSheetText):
3049         (WebCore::InspectorCSSAgent::setStyleText):
3050         (WebCore::InspectorCSSAgent::setRuleSelector):
3051         (WebCore::InspectorCSSAgent::createStyleSheet):
3052         (WebCore::InspectorCSSAgent::addRule):
3053         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
3054         (WebCore::InspectorCSSAgent::elementForId):
3055         (WebCore::InspectorCSSAgent::bindStyleSheet):
3056         (WebCore::InspectorCSSAgent::~InspectorCSSAgent): Deleted.
3057         (WebCore::InspectorCSSAgent::discardAgent): Deleted.
3058         (WebCore::InspectorCSSAgent::resetNonPersistentData): Deleted.
3059         * inspector/InspectorStyleSheet.cpp:
3060
3061         * inspector/agents/InspectorDOMDebuggerAgent.h:
3062         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
3063         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
3064         (WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint):
3065         (WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint):
3066         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
3067         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
3068
3069         * inspector/agents/page/PageConsoleAgent.h:
3070         * inspector/agents/page/PageConsoleAgent.cpp:
3071         (WebCore::PageConsoleAgent::PageConsoleAgent):
3072         (WebCore::PageConsoleAgent::clearMessages):
3073
3074         * inspector/InspectorController.h:
3075         * inspector/InspectorController.cpp:
3076         (WebCore::InspectorController::InspectorController):
3077         (WebCore::InspectorController::createLazyAgents):
3078         (WebCore::InspectorController::inspect):
3079         (WebCore::InspectorController::hideHighlight):
3080
3081 2019-03-20  Youenn Fablet  <youenn@apple.com>
3082
3083         Include WAL and SHM file size in IDB database size computation
3084         https://bugs.webkit.org/show_bug.cgi?id=195688
3085
3086         Reviewed by Brady Eidson.
3087
3088         Count WAL and SHM files as part of IDB quota checks.
3089         This makes some IDB tests go over the testing quota which then
3090         triggers some IDB tasks to happen sooner than other write IDB tasks.
3091         The IDB implementation requires these tasks to remain ordered.
3092         In case a write task is pending quota check, queue all tasks,
3093         write or read, to keep the order.
3094
3095         This patch specials case aborting a transaction.
3096         In case it is called as part of clearing a database,
3097         the task should not be queued and all pending tasks are errored.
3098         When transaction is aborted by the web page, queue the task.
3099
3100         When we can make a decision to run tasks with size 0,
3101         do not check quota. This ensures that read operations
3102         succeed even if we are above quota.
3103
3104         Covered by existing tests.
3105
3106         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3107         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
3108         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
3109         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
3110         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
3111         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
3112         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
3113         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
3114         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
3115         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
3116         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
3117         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
3118         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3119         * Modules/webdatabase/DatabaseTracker.cpp:
3120         (WebCore::DatabaseTracker::usage):
3121         * platform/sql/SQLiteFileSystem.cpp:
3122         (WebCore::SQLiteFileSystem::getDatabaseFileSize):
3123         * storage/StorageQuotaManager.h:
3124         * storage/StorageQuotaManager.cpp:
3125         (WebCore::StorageQuotaManager::requestSpace):
3126
3127 2019-03-20  Devin Rousso  <drousso@apple.com>
3128
3129         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
3130         https://bugs.webkit.org/show_bug.cgi?id=176824
3131         <rdar://problem/34290931>
3132
3133         Reviewed by Timothy Hatcher.
3134
3135         Original patch by Joseph Pecoraro <pecoraro@apple.com>.
3136
3137         Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
3138                inspector/timeline/timeline-event-EventDispatch.html
3139                inspector/timeline/timeline-event-FireAnimationFrame.html
3140                inspector/timeline/timeline-event-RequestAnimationFrame.html
3141                inspector/timeline/timeline-event-TimerFire.html
3142                inspector/timeline/timeline-event-TimerInstall.html
3143                inspector/timeline/timeline-event-TimerRemove.html
3144
3145         * dom/EventTarget.cpp:
3146         (WebCore::EventTarget::innerInvokeEventListeners):
3147         * page/DOMWindow.cpp:
3148         (WebCore::DOMWindow::dispatchEvent):
3149         Include `defaultPrevented` when notifying inspector.
3150
3151         * inspector/InspectorInstrumentation.h:
3152         (WebCore::InspectorInstrumentation::didDispatchEvent):
3153         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
3154         * inspector/InspectorInstrumentation.cpp:
3155         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
3156         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
3157         Pass `defaultPrevented` on to agent.
3158
3159         * inspector/agents/InspectorTimelineAgent.h:
3160         * inspector/agents/InspectorTimelineAgent.cpp:
3161         (WebCore::InspectorTimelineAgent::didDispatchEvent):
3162         Append a boolean `defaultPrevented` property on the `EventDispatch` timeline record's data.
3163
3164 2019-03-20  Antoine Quint  <graouts@apple.com>
3165
3166         DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
3167         https://bugs.webkit.org/show_bug.cgi?id=196028
3168         <rdar://problem/46842707>
3169
3170         Reviewed by Dean Jackson.
3171
3172         Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.
3173
3174         * animation/AnimationTimeline.cpp:
3175         (WebCore::AnimationTimeline::forgetAnimation):
3176         (WebCore::AnimationTimeline::animationTimingDidChange):
3177         (WebCore::AnimationTimeline::cancelDeclarativeAnimation):
3178         * animation/AnimationTimeline.h:
3179         * animation/DocumentTimeline.cpp:
3180         (WebCore::DocumentTimeline::getAnimations const):
3181
3182 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3183
3184         Remove the SVG property tear off objects for SVGAnimatedNumber
3185         https://bugs.webkit.org/show_bug.cgi?id=196037
3186
3187         Reviewed by Simon Fraser.
3188
3189         -- Define SVGAnimatedNumber to be SVGAnimatedPrimitiveProperty<float>.
3190
3191         -- Add SVGAnimatedNumberAccessor to associate an attribute name with a 
3192            pointer to an SVGAnimatedNumber. Given a pointer to an SVGElement,
3193            this accessor will and create an animator for the animated property.
3194
3195         -- Add SVGAnimatedNumberPairAccessor to associate an attribute name
3196            with a pair of pointers to SVGAnimatedNumbers. Given a pointer to an
3197            SVGElement, this accessor will and create an animator for these
3198            animated properties.
3199
3200         -- Add SVGAnimatedNumberAnimator to animated an SVGAnimatedNumber.
3201
3202         -- Add SVGAnimatedNumberPairAnimator to animated a pair of SVGAnimatedNumbers.
3203
3204         -- Add SVGAnimationNumberFunction which will be responsible for progressing
3205            a float over a period of time.
3206
3207         -- Define SVGNumberAnimator to be SVGPrimitivePropertyAnimator<float,
3208            SVGAnimationNumberFunction>. SVGNumberAnimator will be responsible 
3209            for animating attributes with no reflecting animated properties, e.g.
3210            "fill-opacity".
3211
3212         * Sources.txt:
3213         * WebCore.xcodeproj/project.pbxproj:
3214         * svg/SVGAnimatedLength.cpp:
3215         * svg/SVGAnimatedLengthList.cpp:
3216         * svg/SVGAnimatedNumber.cpp: Removed.
3217         * svg/SVGAnimatedNumber.h: Removed.
3218         * svg/SVGAnimatedNumberList.cpp:
3219         * svg/SVGAnimatedNumberOptionalNumber.cpp: Removed.
3220         * svg/SVGAnimatedNumberOptionalNumber.h: Removed.
3221         * svg/SVGAnimatedTransformList.cpp:
3222         * svg/SVGAnimatorFactory.h:
3223         (WebCore::SVGAnimatorFactory::create):
3224         * svg/SVGComponentTransferFunctionElement.cpp:
3225         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
3226         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
3227         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
3228         * svg/SVGComponentTransferFunctionElement.h:
3229         (WebCore::SVGComponentTransferFunctionElement::slope const):
3230         (WebCore::SVGComponentTransferFunctionElement::intercept const):
3231         (WebCore::SVGComponentTransferFunctionElement::amplitude const):
3232         (WebCore::SVGComponentTransferFunctionElement::exponent const):
3233         (WebCore::SVGComponentTransferFunctionElement::offset const):
3234         (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
3235         (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
3236         (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
3237         (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
3238         (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
3239         * svg/SVGFECompositeElement.cpp:
3240         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
3241         (WebCore::SVGFECompositeElement::registerAttributes):
3242         (WebCore::SVGFECompositeElement::parseAttribute):
3243         * svg/SVGFECompositeElement.h:
3244         * svg/SVGFEConvolveMatrixElement.cpp:
3245         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
3246         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
3247         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
3248         (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
3249         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted.
3250         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted.
3251         * svg/SVGFEConvolveMatrixElement.h:
3252         * svg/SVGFEDiffuseLightingElement.cpp:
3253         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
3254         (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
3255         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
3256         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted.
3257         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted.
3258         * svg/SVGFEDiffuseLightingElement.h:
3259         * svg/SVGFEDisplacementMapElement.cpp:
3260         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
3261         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
3262         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
3263         * svg/SVGFEDisplacementMapElement.h:
3264         * svg/SVGFEDropShadowElement.cpp:
3265         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
3266         (WebCore::SVGFEDropShadowElement::setStdDeviation):
3267         (WebCore::SVGFEDropShadowElement::registerAttributes):
3268         (WebCore::SVGFEDropShadowElement::parseAttribute):
3269         (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted.
3270         (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted.
3271         * svg/SVGFEDropShadowElement.h:
3272         * svg/SVGFEGaussianBlurElement.cpp:
3273         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
3274         (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
3275         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
3276         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
3277         (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted.
3278         (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted.
3279         * svg/SVGFEGaussianBlurElement.h:
3280         * svg/SVGFELightElement.cpp:
3281         (WebCore::SVGFELightElement::SVGFELightElement):
3282         (WebCore::SVGFELightElement::parseAttribute):
3283         (WebCore::SVGFELightElement::svgAttributeChanged):
3284         (WebCore::SVGFELightElement::registerAttributes): Deleted.
3285         * svg/SVGFELightElement.h:
3286         (WebCore::SVGFELightElement::azimuth const):
3287         (WebCore::SVGFELightElement::elevation const):
3288         (WebCore::SVGFELightElement::x const):
3289         (WebCore::SVGFELightElement::y const):
3290         (WebCore::SVGFELightElement::z const):
3291         (WebCore::SVGFELightElement::pointsAtX const):
3292         (WebCore::SVGFELightElement::pointsAtY const):
3293         (WebCore::SVGFELightElement::pointsAtZ const):
3294         (WebCore::SVGFELightElement::specularExponent const):
3295         (WebCore::SVGFELightElement::limitingConeAngle const):
3296         (WebCore::SVGFELightElement::azimuthAnimated):
3297         (WebCore::SVGFELightElement::elevationAnimated):
3298         (WebCore::SVGFELightElement::xAnimated):
3299         (WebCore::SVGFELightElement::yAnimated):
3300         (WebCore::SVGFELightElement::zAnimated):
3301         (WebCore::SVGFELightElement::pointsAtXAnimated):
3302         (WebCore::SVGFELightElement::pointsAtYAnimated):
3303         (WebCore::SVGFELightElement::pointsAtZAnimated):
3304         (WebCore::SVGFELightElement::specularExponentAnimated):
3305         (WebCore::SVGFELightElement::limitingConeAngleAnimated):
3306         (WebCore::SVGFELightElement::attributeRegistry): Deleted.
3307         (WebCore::SVGFELightElement::isKnownAttribute): Deleted.
3308         * svg/SVGFEMorphologyElement.cpp:
3309         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
3310         (WebCore::SVGFEMorphologyElement::setRadius):
3311         (WebCore::SVGFEMorphologyElement::registerAttributes):
3312         (WebCore::SVGFEMorphologyElement::parseAttribute):
3313         (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted.
3314         (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted.
3315         * svg/SVGFEMorphologyElement.h:
3316         * svg/SVGFEOffsetElement.cpp:
3317         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
3318         (WebCore::SVGFEOffsetElement::registerAttributes):
3319         (WebCore::SVGFEOffsetElement::parseAttribute):
3320         * svg/SVGFEOffsetElement.h:
3321         * svg/SVGFESpecularLightingElement.cpp:
3322         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
3323         (WebCore::SVGFESpecularLightingElement::registerAttributes):
3324         (WebCore::SVGFESpecularLightingElement::parseAttribute):
3325         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted.
3326         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted.
3327         * svg/SVGFESpecularLightingElement.h:
3328         * svg/SVGFETurbulenceElement.cpp:
3329         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
3330         (WebCore::SVGFETurbulenceElement::registerAttributes):
3331         (WebCore::SVGFETurbulenceElement::parseAttribute):
3332         (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted.
3333         (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted.
3334         * svg/SVGFETurbulenceElement.h:
3335         * svg/SVGGeometryElement.cpp:
3336         (WebCore::SVGGeometryElement::SVGGeometryElement):
3337         (WebCore::SVGGeometryElement::parseAttribute):
3338         (WebCore::SVGGeometryElement::registerAttributes): Deleted.
3339         * svg/SVGGeometryElement.h:
3340         (WebCore::SVGGeometryElement::pathLength const):
3341         (WebCore::SVGGeometryElement::pathLengthAnimated):
3342         (WebCore::SVGGeometryElement::attributeRegistry): Deleted.
3343         (WebCore::SVGGeometryElement::isKnownAttribute): Deleted.
3344         * svg/SVGPathElement.h:
3345         * svg/SVGStopElement.cpp:
3346         (WebCore::SVGStopElement::SVGStopElement):
3347         (WebCore::SVGStopElement::parseAttribute):
3348         (WebCore::SVGStopElement::registerAttributes): Deleted.
3349         * svg/SVGStopElement.h:
3350         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
3351         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
3352         * svg/properties/SVGAnimatedPropertyImpl.h:
3353         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
3354         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
3355         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
3356         (WebCore::SVGAnimationNumberFunction::progress):
3357         * svg/properties/SVGAttributeRegistry.h:
3358         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
3359         * svg/properties/SVGPropertyAnimatorCreator.h:
3360         (WebCore::SVGPropertyAnimatorCreator::createNumberAnimator):
3361         (WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator):
3362         * svg/properties/SVGPropertyOwnerRegistry.h:
3363         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
3364
3365 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3366
3367         Remove the SVG tear off objects for SVGColorAnimator
3368         https://bugs.webkit.org/show_bug.cgi?id=196025
3369
3370         Reviewed by Simon Fraser.
3371
3372         SVG attributes like "fill" and "stroke" do not have reflecting properties
3373         in SVGElement but they are animatable by SMIL. Animating such attributes
3374         is different from animating the SVG animated properties. These new classes
3375         will be added to handle the first type of this kind of attribute: the Color:
3376
3377         -- SVGPropertyAnimatorCreator is added to SVGElement. It is responsible 
3378            for creating SVGPropertyAnimators for the attribute which do not have
3379            reflecting animated properties stored by SVGElement. It will maintain
3380            a HashMap for the animated values for these attributes which is indexed
3381            by the attribute name. The animated values has to be RefCounted because
3382            the same attribute can be animated by multiple animators. So the values
3383            of this HashMap will be of type Ref<SVGProperty>, e.g.
3384             <circle cx="8