Remove the SVG elements' attributes macros
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
3         Remove the SVG elements' attributes macros
4         https://bugs.webkit.org/show_bug.cgi?id=186751
5
6         Reviewed by Simon Fraser.
7
8         This is how the SVG attributes are implemented after removing the SVG macros:
9
10         1) The SVG attribute is defined as a super class of SVGAttribute. The super
11            classes of SVGAttribute are template classes. The type of these template
12            are the property type or the TearOff type.
13
14         2) To unify accessing attributes of the SVGElements and its super classes
15            an SVGAttributeAccessor template class is added. It is inherited by other
16            template classes. The types of these templates are the owner and the
17            attributes types. The main functions of these classes is to synchronize 
18            the new property value with the document attributes pool and to create
19            and cache the TearOff objects.
20
21         3) To make code shorter and more readable, attribute types and attribute
22            accessors are defined for every SVG TearOff type, e.g. 
23            -- SVGLength: 
24                 SVGAnimatedLengthAttribute and SVGAnimatedLengthAttributeAccessor
25            -- SVGAnimatedNumber: 
26                 SVGAnimatedNumberAttribute and SVGAnimatedNumberAttributeAccessor
27
28         4) A special accessor is defined for animated pair and optional attributes:
29            SVGAnimatedPairAttributeAccessor, e.g.
30            -- SVGMarkerElement:
31                 orient attribute: "angle" or "type"
32            -- SVGFEGaussianBlurElement:
33                 stdDeviation attribute: "x" and "y"
34
35         5) The SVG attributes have to be registered into an singleton SVGAttributeRegistry.
36            The SVGAttributeRegistry is a template class. The types of this template
37            class are the the type of the owner and the base classes of this owner.
38            This registry holds a map from "attribute name" to  "attribute accessor".
39
40         6) To make the code easier to read, the SVGAttributeRegistry implements
41            registerAttribute() for different attribute types. The owner needs only
42            to provide the attribute name and a pointer to the class member of this
43            attribute to the same function "registerAttribute()". The compiler will
44            pick the right function to call based on the type of the attribute.
45
46         7) Given a reference to the owner element, SVGAttributeRegistry can loop
47            through the attributes of this owner and through the attributes of its
48            base classes as well to do operations like synchronizing all the attributes
49            or creating the TearOff object of a certain attribute.
50
51         8) To make the base class SVGElement have the ability to access the attributes
52            of any of its super classes, SVGAttributeOwnerProxy will be used.
53            SVGAttributeOwnerProxy is a base class which have all the functions that
54            SVGElement needs as pure virtual functions.
55
56         9) SVGAttributeOwnerProxyImpl is a template class which implements 
57            SVGAttributeOwnerProxy and whose types are the owner and its base classes.
58            SVGAttributeOwnerProxyImpl keeps a reference to the owner and the context
59            SVGElement.
60
61         10) All the SVG attribute owners have to implement the virtual function
62             attributeOwnerProxy() which returns a reference to SVGAttributeOwnerProxy.
63             The local attributeOwnerProxy() returns a reference to a local
64             SVGAttributeOwnerProxyImpl. Its type and base types are the class
65             hierarchy of this element.
66
67         All the attributes of the non-SVGElement-based classes are moved as members
68         of these classes instead of adding them to all the super classes. These
69         classes are:
70            -- SVGExternalResourcesRequired
71            -- SVGURIReference
72            -- SVGFitToViewBox
73            -- SVGZoomAndPan
74            -- SVGLangSpace
75
76         The svgAttributeChanged() of all the SVGElement-based classes are now 
77         simplified by distributing the responsibilities of changing an attribute
78         to the base classes. One exception is the SVGURIReference since the action
79         to be taken when changing the "href" is different for every super class.
80
81         Other work will be done in separate patches.
82            -- Shrinking the memory of the SVGElements.
83            -- Making all the attributes RefCounted objects.
84
85         * Sources.txt:
86         * WebCore.xcodeproj/project.pbxproj:
87         * rendering/svg/RenderSVGResourceMarker.cpp:
88         (WebCore::RenderSVGResourceMarker::draw):
89         * svg/SVGAElement.cpp:
90         (WebCore::SVGAElement::SVGAElement):
91         (WebCore::SVGAElement::registerAttributes):
92         (WebCore::SVGAElement::parseAttribute):
93         (WebCore::SVGAElement::svgAttributeChanged):
94         * svg/SVGAElement.h:
95         * svg/SVGAElement.idl:
96         * svg/SVGAltGlyphElement.cpp:
97         (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
98         * svg/SVGAltGlyphElement.h:
99         * svg/SVGAnimatedAngle.h:
100         * svg/SVGAnimatedBoolean.h:
101         * svg/SVGAnimatedEnumeration.h:
102         * svg/SVGAnimatedInteger.h:
103         * svg/SVGAnimatedLength.h:
104         * svg/SVGAnimatedLengthList.h:
105         * svg/SVGAnimatedNumber.h:
106         * svg/SVGAnimatedNumberList.h:
107         * svg/SVGAnimatedPath.h:
108         * svg/SVGAnimatedPointList.h:
109         * svg/SVGAnimatedPreserveAspectRatio.h:
110         * svg/SVGAnimatedRect.h:
111         * svg/SVGAnimatedString.h:
112         * svg/SVGAnimatedTransformList.h:
113         * svg/SVGAnimatedTypeAnimator.cpp:
114         (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
115         * svg/SVGAnimationElement.cpp:
116         (WebCore::SVGAnimationElement::SVGAnimationElement):
117         (WebCore::SVGAnimationElement::requiredFeatures): Deleted.
118         (WebCore::SVGAnimationElement::requiredExtensions): Deleted.
119         (WebCore::SVGAnimationElement::systemLanguage): Deleted.
120         * svg/SVGAnimationElement.h:
121         (WebCore::SVGAnimationElement::attributeRegistry):
122         * svg/SVGCircleElement.cpp:
123         (WebCore::SVGCircleElement::SVGCircleElement):
124         (WebCore::SVGCircleElement::registerAttributes):
125         (WebCore::SVGCircleElement::parseAttribute):
126         (WebCore::SVGCircleElement::svgAttributeChanged):
127         * svg/SVGCircleElement.h:
128         * svg/SVGClipPathElement.cpp:
129         (WebCore::SVGClipPathElement::SVGClipPathElement):
130         (WebCore::SVGClipPathElement::registerAttributes):
131         (WebCore::SVGClipPathElement::parseAttribute):
132         (WebCore::SVGClipPathElement::svgAttributeChanged):
133         (WebCore::SVGClipPathElement::isSupportedAttribute): Deleted.
134         * svg/SVGClipPathElement.h:
135         * svg/SVGComponentTransferFunctionElement.cpp:
136         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
137         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
138         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
139         (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
140         (WebCore::SVGComponentTransferFunctionElement::transferFunction const):
141         (WebCore::SVGComponentTransferFunctionElement::isSupportedAttribute): Deleted.
142         * svg/SVGComponentTransferFunctionElement.h:
143         (WebCore::SVGComponentTransferFunctionElement::type const):
144         (WebCore::SVGComponentTransferFunctionElement::tableValues const):
145         (WebCore::SVGComponentTransferFunctionElement::slope const):
146         (WebCore::SVGComponentTransferFunctionElement::intercept const):
147         (WebCore::SVGComponentTransferFunctionElement::amplitude const):
148         (WebCore::SVGComponentTransferFunctionElement::exponent const):
149         (WebCore::SVGComponentTransferFunctionElement::offset const):
150         (WebCore::SVGComponentTransferFunctionElement::typeAnimated):
151         (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated):
152         (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
153         (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
154         (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
155         (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
156         (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
157         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
158         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
159         * svg/SVGCursorElement.cpp:
160         (WebCore::SVGCursorElement::SVGCursorElement):
161         (WebCore::SVGCursorElement::registerAttributes):
162         (WebCore::SVGCursorElement::parseAttribute):
163         (WebCore::SVGCursorElement::svgAttributeChanged):
164         (WebCore::SVGCursorElement::isSupportedAttribute): Deleted.
165         (WebCore::SVGCursorElement::requiredFeatures): Deleted.
166         (WebCore::SVGCursorElement::requiredExtensions): Deleted.
167         (WebCore::SVGCursorElement::systemLanguage): Deleted.
168         * svg/SVGCursorElement.h:
169         * svg/SVGDefsElement.cpp:
170         (WebCore::SVGDefsElement::SVGDefsElement):
171         * svg/SVGDefsElement.h:
172         * svg/SVGElement.cpp:
173         (WebCore::SVGElement::SVGElement):
174         (WebCore::SVGElement::registerAttributes):
175         (WebCore::SVGElement::parseAttribute):
176         (WebCore::SVGElement::animatedPropertyTypesForAttribute):
177         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
178         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
179         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM):
180         (WebCore::SVGElement::svgAttributeChanged):
181         (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
182         (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
183         (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
184         (WebCore::SVGElement::isKnownAttribute): Deleted.
185         * svg/SVGElement.h:
186         (WebCore::SVGElement::attributeRegistry):
187         (WebCore::SVGElement::isKnownAttribute):
188         (WebCore::SVGElement::attributeOwnerProxy const):
189         (WebCore::SVGElement::synchronizeAttribute):
190         (WebCore::SVGElement::synchronizeAttributes):
191         (WebCore::SVGElement::animatedTypes const):
192         (WebCore::SVGElement::lookupAnimatedProperty const):
193         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
194         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
195         (WebCore::SVGElement::className const):
196         (WebCore::SVGElement::classNameAnimated):
197         (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
198         (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
199         (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
200         * svg/SVGEllipseElement.cpp:
201         (WebCore::SVGEllipseElement::SVGEllipseElement):
202         (WebCore::SVGEllipseElement::registerAttributes):
203         (WebCore::SVGEllipseElement::parseAttribute):
204         (WebCore::SVGEllipseElement::svgAttributeChanged):
205         * svg/SVGEllipseElement.h:
206         * svg/SVGExternalResourcesRequired.cpp:
207         (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
208         (WebCore::SVGExternalResourcesRequired::registerAttributes):
209         (WebCore::SVGExternalResourcesRequired::parseAttribute):
210         (WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
211         (WebCore::SVGExternalResourcesRequired::addSupportedAttributes):
212         (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent):
213         (WebCore::SVGExternalResourcesRequired::insertedIntoDocument):
214         (WebCore::SVGExternalResourcesRequired::finishParsingChildren):
215         (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const):
216         (WebCore::SVGExternalResourcesRequired::isKnownAttribute): Deleted.
217         (WebCore::SVGExternalResourcesRequired::handleAttributeChange): Deleted.
218         * svg/SVGExternalResourcesRequired.h:
219         (WebCore::SVGExternalResourcesRequired::attributeRegistry):
220         (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
221         (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
222         (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired):
223         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
224         (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy):
225         * svg/SVGFEBlendElement.cpp:
226         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
227         (WebCore::SVGFEBlendElement::registerAttributes):
228         (WebCore::SVGFEBlendElement::parseAttribute):
229         * svg/SVGFEBlendElement.h:
230         * svg/SVGFEColorMatrixElement.cpp:
231         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
232         (WebCore::SVGFEColorMatrixElement::registerAttributes):
233         (WebCore::SVGFEColorMatrixElement::parseAttribute):
234         * svg/SVGFEColorMatrixElement.h:
235         * svg/SVGFEComponentTransferElement.cpp:
236         (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
237         (WebCore::SVGFEComponentTransferElement::registerAttributes):
238         (WebCore::SVGFEComponentTransferElement::parseAttribute):
239         * svg/SVGFEComponentTransferElement.h:
240         * svg/SVGFECompositeElement.cpp:
241         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
242         (WebCore::SVGFECompositeElement::registerAttributes):
243         (WebCore::SVGFECompositeElement::parseAttribute):
244         * svg/SVGFECompositeElement.h:
245         * svg/SVGFEConvolveMatrixElement.cpp:
246         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
247         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
248         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
249         (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute):
250         (WebCore::SVGFEConvolveMatrixElement::setOrder):
251         (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
252         * svg/SVGFEConvolveMatrixElement.h:
253         (WebCore::SVGPropertyTraits<EdgeModeType>::initialValue):
254         * svg/SVGFEDiffuseLightingElement.cpp:
255         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
256         (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
257         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
258         * svg/SVGFEDiffuseLightingElement.h:
259         * svg/SVGFEDisplacementMapElement.cpp:
260         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
261         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
262         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
263         * svg/SVGFEDisplacementMapElement.h:
264         * svg/SVGFEDropShadowElement.cpp:
265         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
266         (WebCore::SVGFEDropShadowElement::setStdDeviation):
267         (WebCore::SVGFEDropShadowElement::registerAttributes):
268         (WebCore::SVGFEDropShadowElement::parseAttribute):
269         (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
270         * svg/SVGFEDropShadowElement.h:
271         * svg/SVGFEGaussianBlurElement.cpp:
272         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
273         (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
274         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
275         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
276         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
277         * svg/SVGFEGaussianBlurElement.h:
278         * svg/SVGFEImageElement.cpp:
279         (WebCore::SVGFEImageElement::SVGFEImageElement):
280         (WebCore::SVGFEImageElement::registerAttributes):
281         (WebCore::SVGFEImageElement::parseAttribute):
282         * svg/SVGFEImageElement.h:
283         * svg/SVGFELightElement.cpp:
284         (WebCore::SVGFELightElement::SVGFELightElement):
285         (WebCore::SVGFELightElement::registerAttributes):
286         (WebCore::SVGFELightElement::parseAttribute):
287         (WebCore::SVGFELightElement::svgAttributeChanged):
288         * svg/SVGFELightElement.h:
289         (WebCore::SVGFELightElement::azimuth const):
290         (WebCore::SVGFELightElement::elevation const):
291         (WebCore::SVGFELightElement::x const):
292         (WebCore::SVGFELightElement::y const):
293         (WebCore::SVGFELightElement::z const):
294         (WebCore::SVGFELightElement::pointsAtX const):
295         (WebCore::SVGFELightElement::pointsAtY const):
296         (WebCore::SVGFELightElement::pointsAtZ const):
297         (WebCore::SVGFELightElement::specularExponent const):
298         (WebCore::SVGFELightElement::limitingConeAngle const):
299         (WebCore::SVGFELightElement::azimuthAnimated):
300         (WebCore::SVGFELightElement::elevationAnimated):
301         (WebCore::SVGFELightElement::xAnimated):
302         (WebCore::SVGFELightElement::yAnimated):
303         (WebCore::SVGFELightElement::zAnimated):
304         (WebCore::SVGFELightElement::pointsAtXAnimated):
305         (WebCore::SVGFELightElement::pointsAtYAnimated):
306         (WebCore::SVGFELightElement::pointsAtZAnimated):
307         (WebCore::SVGFELightElement::specularExponentAnimated):
308         (WebCore::SVGFELightElement::limitingConeAngleAnimated):
309         (WebCore::SVGFELightElement::attributeRegistry):
310         (WebCore::SVGFELightElement::isKnownAttribute):
311         * svg/SVGFEMergeNodeElement.cpp:
312         (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
313         (WebCore::SVGFEMergeNodeElement::registerAttributes):
314         (WebCore::SVGFEMergeNodeElement::parseAttribute):
315         * svg/SVGFEMergeNodeElement.h:
316         * svg/SVGFEMorphologyElement.cpp:
317         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
318         (WebCore::SVGFEMorphologyElement::setRadius):
319         (WebCore::SVGFEMorphologyElement::registerAttributes):
320         (WebCore::SVGFEMorphologyElement::parseAttribute):
321         * svg/SVGFEMorphologyElement.h:
322         * svg/SVGFEOffsetElement.cpp:
323         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
324         (WebCore::SVGFEOffsetElement::registerAttributes):
325         (WebCore::SVGFEOffsetElement::parseAttribute):
326         (WebCore::SVGFEOffsetElement::svgAttributeChanged):
327         * svg/SVGFEOffsetElement.h:
328         * svg/SVGFESpecularLightingElement.cpp:
329         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
330         (WebCore::SVGFESpecularLightingElement::registerAttributes):
331         (WebCore::SVGFESpecularLightingElement::parseAttribute):
332         * svg/SVGFESpecularLightingElement.h:
333         * svg/SVGFETileElement.cpp:
334         (WebCore::SVGFETileElement::SVGFETileElement):
335         (WebCore::SVGFETileElement::registerAttributes):
336         (WebCore::SVGFETileElement::parseAttribute):
337         * svg/SVGFETileElement.h:
338         * svg/SVGFETurbulenceElement.cpp:
339         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
340         (WebCore::SVGFETurbulenceElement::registerAttributes):
341         (WebCore::SVGFETurbulenceElement::parseAttribute):
342         (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute):
343         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
344         * svg/SVGFETurbulenceElement.h:
345         * svg/SVGFilterElement.cpp:
346         (WebCore::SVGFilterElement::SVGFilterElement):
347         (WebCore::SVGFilterElement::setFilterRes):
348         (WebCore::SVGFilterElement::registerAttributes):
349         (WebCore::SVGFilterElement::parseAttribute):
350         (WebCore::SVGFilterElement::svgAttributeChanged):
351         (WebCore::SVGFilterElement::isSupportedAttribute): Deleted.
352         * svg/SVGFilterElement.h:
353         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
354         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
355         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
356         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
357         (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
358         (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): Deleted.
359         * svg/SVGFilterPrimitiveStandardAttributes.h:
360         (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry):
361         (WebCore::SVGFilterPrimitiveStandardAttributes::x const):
362         (WebCore::SVGFilterPrimitiveStandardAttributes::y const):
363         (WebCore::SVGFilterPrimitiveStandardAttributes::width const):
364         (WebCore::SVGFilterPrimitiveStandardAttributes::height const):
365         (WebCore::SVGFilterPrimitiveStandardAttributes::result const):
366         (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated):
367         (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated):
368         (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated):
369         (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated):
370         (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
371         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
372         * svg/SVGFitToViewBox.cpp:
373         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
374         (WebCore::SVGFitToViewBox::registerAttributes):
375         (WebCore::SVGFitToViewBox::setViewBox):
376         (WebCore::SVGFitToViewBox::resetViewBox):
377         (WebCore::SVGFitToViewBox::reset):
378         (WebCore::SVGFitToViewBox::parseAttribute):
379         (WebCore::SVGFitToViewBox::parseViewBox):
380         (WebCore::SVGFitToViewBox::isKnownAttribute): Deleted.
381         (WebCore::SVGFitToViewBox::addSupportedAttributes): Deleted.
382         * svg/SVGFitToViewBox.h:
383         (WebCore::SVGFitToViewBox::attributeRegistry):
384         (WebCore::SVGFitToViewBox::viewBox const):
385         (WebCore::SVGFitToViewBox::preserveAspectRatio const):
386         (WebCore::SVGFitToViewBox::viewBoxAnimated):
387         (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
388         (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
389         (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
390         (WebCore::SVGFitToViewBox::viewBoxString const):
391         (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
392         (WebCore::SVGFitToViewBox::hasValidViewBox const):
393         (WebCore::SVGFitToViewBox::hasEmptyViewBox const):
394         (WebCore::SVGFitToViewBox::isKnownAttribute):
395         (WebCore::SVGFitToViewBox::parseAttribute): Deleted.
396         * svg/SVGFontElement.cpp:
397         (WebCore::SVGFontElement::SVGFontElement):
398         * svg/SVGFontElement.h:
399         * svg/SVGForeignObjectElement.cpp:
400         (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
401         (WebCore::SVGForeignObjectElement::registerAttributes):
402         (WebCore::SVGForeignObjectElement::parseAttribute):
403         (WebCore::SVGForeignObjectElement::svgAttributeChanged):
404         (WebCore::SVGForeignObjectElement::isSupportedAttribute): Deleted.
405         * svg/SVGForeignObjectElement.h:
406         * svg/SVGGElement.cpp:
407         (WebCore::SVGGElement::SVGGElement):
408         (WebCore::SVGGElement::svgAttributeChanged):
409         (WebCore::SVGGElement::isSupportedAttribute): Deleted.
410         * svg/SVGGElement.h:
411         * svg/SVGGeometryElement.cpp:
412         (WebCore::SVGGeometryElement::SVGGeometryElement):
413         (WebCore::SVGGeometryElement::registerAttributes):
414         (WebCore::SVGGeometryElement::parseAttribute):
415         (WebCore::SVGGeometryElement::svgAttributeChanged):
416         (WebCore::SVGGeometryElement::isSupportedAttribute): Deleted.
417         * svg/SVGGeometryElement.h:
418         (WebCore::SVGGeometryElement::attributeRegistry):
419         (WebCore::SVGGeometryElement::pathLengthAnimated):
420         (WebCore::SVGGeometryElement::isKnownAttribute):
421         * svg/SVGGlyphRefElement.cpp:
422         (WebCore::SVGGlyphRefElement::SVGGlyphRefElement):
423         * svg/SVGGlyphRefElement.h:
424         * svg/SVGGradientElement.cpp:
425         (WebCore::SVGGradientElement::SVGGradientElement):
426         (WebCore::SVGGradientElement::registerAttributes):
427         (WebCore::SVGGradientElement::parseAttribute):
428         (WebCore::SVGGradientElement::svgAttributeChanged):
429         (WebCore::SVGGradientElement::isSupportedAttribute): Deleted.
430         * svg/SVGGradientElement.h:
431         (WebCore::SVGGradientElement::attributeRegistry):
432         (WebCore::SVGGradientElement::spreadMethod const):
433         (WebCore::SVGGradientElement::gradientUnits const):
434         (WebCore::SVGGradientElement::gradientTransform const):
435         (WebCore::SVGGradientElement::spreadMethodAnimated):
436         (WebCore::SVGGradientElement::gradientUnitsAnimated):
437         (WebCore::SVGGradientElement::gradientTransformAnimated):
438         (WebCore::SVGGradientElement::isKnownAttribute):
439         * svg/SVGGraphicsElement.cpp:
440         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
441         (WebCore::SVGGraphicsElement::registerAttributes):
442         (WebCore::SVGGraphicsElement::parseAttribute):
443         (WebCore::SVGGraphicsElement::svgAttributeChanged):
444         (WebCore::SVGGraphicsElement::isSupportedAttribute): Deleted.
445         (WebCore::SVGGraphicsElement::requiredFeatures): Deleted.
446         (WebCore::SVGGraphicsElement::requiredExtensions): Deleted.
447         (WebCore::SVGGraphicsElement::systemLanguage): Deleted.
448         * svg/SVGGraphicsElement.h:
449         (WebCore::SVGGraphicsElement::attributeRegistry):
450         (WebCore::SVGGraphicsElement::transform const):
451         (WebCore::SVGGraphicsElement::transformAnimated):
452         (WebCore::SVGGraphicsElement::isKnownAttribute):
453         * svg/SVGImageElement.cpp:
454         (WebCore::SVGImageElement::SVGImageElement):
455         (WebCore::SVGImageElement::registerAttributes):
456         (WebCore::SVGImageElement::parseAttribute):
457         (WebCore::SVGImageElement::svgAttributeChanged):
458         (WebCore::SVGImageElement::haveLoadedRequiredResources):
459         (WebCore::SVGImageElement::isSupportedAttribute): Deleted.
460         * svg/SVGImageElement.h:
461         * svg/SVGImageLoader.cpp:
462         (WebCore::SVGImageLoader::dispatchLoadEvent):
463         * svg/SVGLangSpace.cpp:
464         (WebCore::SVGLangSpace::SVGLangSpace):
465         (WebCore::SVGLangSpace::registerAttributes):
466         (WebCore::SVGLangSpace::xmlspace const):
467         (WebCore::SVGLangSpace::svgAttributeChanged):
468         (WebCore::SVGLangSpace::setXmllang): Deleted.
469         (WebCore::SVGLangSpace::setXmlspace): Deleted.
470         (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
471         (WebCore::addWithAndWithoutXMLPrefix): Deleted.
472         (WebCore::SVGLangSpace::addSupportedAttributes): Deleted.
473         * svg/SVGLangSpace.h:
474         (WebCore::SVGLangSpace::xmllang const):
475         (WebCore::SVGLangSpace::setXmllang):
476         (WebCore::SVGLangSpace::setXmlspace):
477         (WebCore::SVGLangSpace::attributeRegistry):
478         (WebCore::SVGLangSpace::isKnownAttribute):
479         * svg/SVGLineElement.cpp:
480         (WebCore::SVGLineElement::SVGLineElement):
481         (WebCore::SVGLineElement::registerAttributes):
482         (WebCore::SVGLineElement::parseAttribute):
483         (WebCore::SVGLineElement::svgAttributeChanged):
484         (WebCore::SVGLineElement::isSupportedAttribute): Deleted.
485         * svg/SVGLineElement.h:
486         * svg/SVGLinearGradientElement.cpp:
487         (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
488         (WebCore::SVGLinearGradientElement::registerAttributes):
489         (WebCore::SVGLinearGradientElement::parseAttribute):
490         (WebCore::SVGLinearGradientElement::svgAttributeChanged):
491         (WebCore::SVGLinearGradientElement::isSupportedAttribute): Deleted.
492         * svg/SVGLinearGradientElement.h:
493         * svg/SVGMPathElement.cpp:
494         (WebCore::SVGMPathElement::SVGMPathElement):
495         (WebCore::SVGMPathElement::svgAttributeChanged):
496         * svg/SVGMPathElement.h:
497         * svg/SVGMarkerElement.cpp:
498         (WebCore::SVGMarkerElement::SVGMarkerElement):
499         (WebCore::SVGMarkerElement::registerAttributes):
500         (WebCore::SVGMarkerElement::parseAttribute):
501         (WebCore::SVGMarkerElement::svgAttributeChanged):
502         (WebCore::SVGMarkerElement::setOrient):
503         (WebCore::SVGMarkerElement::orientTypePropertyInfo): Deleted.
504         (WebCore::SVGMarkerElement::isSupportedAttribute): Deleted.
505         (WebCore::SVGMarkerElement::synchronizeOrientType): Deleted.
506         (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper): Deleted.
507         (WebCore::SVGMarkerElement::orientType const): Deleted.
508         (WebCore::SVGMarkerElement::orientTypeAnimated): Deleted.
509         * svg/SVGMarkerElement.h:
510         * svg/SVGMaskElement.cpp:
511         (WebCore::SVGMaskElement::SVGMaskElement):
512         (WebCore::SVGMaskElement::registerAttributes):
513         (WebCore::SVGMaskElement::parseAttribute):
514         (WebCore::SVGMaskElement::svgAttributeChanged):
515         (WebCore::SVGMaskElement::isSupportedAttribute): Deleted.
516         (WebCore::SVGMaskElement::requiredFeatures): Deleted.
517         (WebCore::SVGMaskElement::requiredExtensions): Deleted.
518         (WebCore::SVGMaskElement::systemLanguage): Deleted.
519         * svg/SVGMaskElement.h:
520         * svg/SVGPathElement.cpp:
521         (WebCore::SVGPathElement::SVGPathElement):
522         (WebCore::SVGPathElement::registerAttributes):
523         (WebCore::SVGPathElement::parseAttribute):
524         (WebCore::SVGPathElement::svgAttributeChanged):
525         (WebCore::SVGPathElement::pathByteStream const):
526         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
527         (WebCore::SVGPathElement::animatedPropertyWillBeDeleted):
528         (WebCore::SVGPathElement::pathSegList):
529         (WebCore::SVGPathElement::animatedPathSegList):
530         (WebCore::SVGPathElement::pathSegListChanged):
531         (WebCore::SVGPathElement::dPropertyInfo): Deleted.
532         (WebCore::SVGPathElement::isSupportedAttribute): Deleted.
533         (WebCore::SVGPathElement::synchronizeD): Deleted.
534         * svg/SVGPathElement.h:
535         * svg/SVGPathSegListValues.h:
536         (WebCore::SVGPropertyTraits<SVGPathSegListValues>::toString):
537         * svg/SVGPathSegWithContext.h:
538         (WebCore::SVGPathSegWithContext::animatedProperty const):
539         * svg/SVGPatternElement.cpp:
540         (WebCore::SVGPatternElement::SVGPatternElement):
541         (WebCore::SVGPatternElement::registerAttributes):
542         (WebCore::SVGPatternElement::parseAttribute):
543         (WebCore::SVGPatternElement::svgAttributeChanged):
544         (WebCore::SVGPatternElement::collectPatternAttributes const):
545         (WebCore::SVGPatternElement::isSupportedAttribute): Deleted.
546         (WebCore::SVGPatternElement::requiredFeatures): Deleted.
547         (WebCore::SVGPatternElement::requiredExtensions): Deleted.
548         (WebCore::SVGPatternElement::systemLanguage): Deleted.
549         * svg/SVGPatternElement.h:
550         * svg/SVGPointListValues.h:
551         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
552         * svg/SVGPolyElement.cpp:
553         (WebCore::SVGPolyElement::SVGPolyElement):
554         (WebCore::SVGPolyElement::registerAttributes):
555         (WebCore::SVGPolyElement::parseAttribute):
556         (WebCore::SVGPolyElement::svgAttributeChanged):
557         (WebCore::SVGPolyElement::points):
558         (WebCore::SVGPolyElement::animatedPoints):
559         (WebCore::SVGPolyElement::pointsPropertyInfo): Deleted.
560         (WebCore::SVGPolyElement::synchronizePoints): Deleted.
561         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper): Deleted.
562         * svg/SVGPolyElement.h:
563         (WebCore::SVGPolyElement::pointList const):
564         (WebCore::SVGPolyElement::attributeRegistry):
565         (WebCore::SVGPolyElement::isKnownAttribute):
566         * svg/SVGPreserveAspectRatioValue.cpp:
567         (WebCore::SVGPreserveAspectRatioValue::transformRect const):
568         (WebCore::SVGPreserveAspectRatioValue::transformRect): Deleted.
569         * svg/SVGPreserveAspectRatioValue.h:
570         * svg/SVGRadialGradientElement.cpp:
571         (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
572         (WebCore::SVGRadialGradientElement::registerAttributes):
573         (WebCore::SVGRadialGradientElement::parseAttribute):
574         (WebCore::SVGRadialGradientElement::svgAttributeChanged):
575         (WebCore::SVGRadialGradientElement::isSupportedAttribute): Deleted.
576         * svg/SVGRadialGradientElement.h:
577         * svg/SVGRectElement.cpp:
578         (WebCore::SVGRectElement::SVGRectElement):
579         (WebCore::SVGRectElement::registerAttributes):
580         (WebCore::SVGRectElement::parseAttribute):
581         (WebCore::SVGRectElement::svgAttributeChanged):
582         * svg/SVGRectElement.h:
583         * svg/SVGSVGElement.cpp:
584         (WebCore::SVGSVGElement::SVGSVGElement):
585         (WebCore::SVGSVGElement::registerAttributes):
586         (WebCore::SVGSVGElement::parseAttribute):
587         (WebCore::SVGSVGElement::svgAttributeChanged):
588         (WebCore::SVGSVGElement::viewBoxToViewTransform const):
589         (WebCore::SVGSVGElement::resetScrollAnchor):
590         (WebCore::SVGSVGElement::inheritViewAttributes):
591         * svg/SVGSVGElement.h:
592         (WebCore::SVGSVGElement::useCurrentView const): Deleted.
593         (WebCore::SVGSVGElement::currentTranslateValue): Deleted.
594         (WebCore::SVGSVGElement::zoomAndPan const): Deleted.
595         (WebCore::SVGSVGElement::setZoomAndPan): Deleted.
596         (WebCore::SVGSVGElement::timeContainer): Deleted.
597         (WebCore::SVGSVGElement::hasEmptyViewBox const): Deleted.
598         * svg/SVGScriptElement.cpp:
599         (WebCore::SVGScriptElement::SVGScriptElement):
600         (WebCore::SVGScriptElement::svgAttributeChanged):
601         (WebCore::SVGScriptElement::insertedIntoAncestor):
602         (WebCore::SVGScriptElement::addSubresourceAttributeURLs const):
603         (WebCore::SVGScriptElement::isURLAttribute const): Deleted.
604         (WebCore::SVGScriptElement::sourceAttributeValue const): Deleted.
605         (WebCore::SVGScriptElement::charsetAttributeValue const): Deleted.
606         (WebCore::SVGScriptElement::typeAttributeValue const): Deleted.
607         (WebCore::SVGScriptElement::languageAttributeValue const): Deleted.
608         (WebCore::SVGScriptElement::forAttributeValue const): Deleted.
609         (WebCore::SVGScriptElement::eventAttributeValue const): Deleted.
610         (WebCore::SVGScriptElement::hasAsyncAttribute const): Deleted.
611         (WebCore::SVGScriptElement::hasDeferAttribute const): Deleted.
612         (WebCore::SVGScriptElement::hasNoModuleAttribute const): Deleted.
613         (WebCore::SVGScriptElement::hasSourceAttribute const): Deleted.
614         (WebCore::SVGScriptElement::filterOutAnimatableAttribute const): Deleted.
615         * svg/SVGScriptElement.h:
616         * svg/SVGStopElement.cpp:
617         (WebCore::SVGStopElement::SVGStopElement):
618         (WebCore::SVGStopElement::registerAttributes):
619         (WebCore::SVGStopElement::parseAttribute):
620         * svg/SVGStopElement.h:
621         * svg/SVGStringListValues.h:
622         (WebCore::SVGPropertyTraits<SVGStringListValues>::toString):
623         * svg/SVGSwitchElement.cpp:
624         (WebCore::SVGSwitchElement::SVGSwitchElement):
625         * svg/SVGSwitchElement.h:
626         * svg/SVGSymbolElement.cpp:
627         (WebCore::SVGSymbolElement::SVGSymbolElement):
628         (WebCore::SVGSymbolElement::parseAttribute):
629         (WebCore::SVGSymbolElement::svgAttributeChanged):
630         * svg/SVGSymbolElement.h:
631         * svg/SVGTRefElement.cpp:
632         (WebCore::SVGTRefElement::SVGTRefElement):
633         * svg/SVGTRefElement.h:
634         * svg/SVGTests.cpp:
635         (WebCore::SVGTests::SVGTests):
636         (WebCore::SVGTests::registerAttributes):
637         (WebCore::SVGTests::attributeRegistry):
638         (WebCore::SVGTests::isKnownAttribute):
639         (WebCore::SVGTests::isValid const):
640         (WebCore::SVGTests::parseAttribute):
641         (WebCore::SVGTests::svgAttributeChanged):
642         (WebCore::SVGTests::requiredFeatures):
643         (WebCore::SVGTests::requiredExtensions):
644         (WebCore::SVGTests::systemLanguage):
645         (WebCore::createSVGTestPropertyInfo): Deleted.
646         (WebCore::createSVGTextAttributeToPropertyMap): Deleted.
647         (WebCore::SVGTests::attributeToPropertyMap): Deleted.
648         (WebCore::SVGTests::handleAttributeChange): Deleted.
649         (WebCore::SVGTests::synchronizeAttribute): Deleted.
650         (WebCore::SVGTests::synchronizeRequiredFeatures): Deleted.
651         (WebCore::SVGTests::synchronizeRequiredExtensions): Deleted.
652         (WebCore::SVGTests::synchronizeSystemLanguage): Deleted.
653         * svg/SVGTests.h:
654         * svg/SVGTextContentElement.cpp:
655         (WebCore::SVGTextContentElement::SVGTextContentElement):
656         (WebCore::SVGTextContentElement::registerAttributes):
657         (WebCore::SVGTextContentElement::parseAttribute):
658         (WebCore::SVGTextContentElement::svgAttributeChanged):
659         (WebCore::SVGTextContentElement::textLengthPropertyInfo): Deleted.
660         (WebCore::SVGTextContentElement::synchronizeTextLength): Deleted.
661         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper): Deleted.
662         (WebCore::SVGTextContentElement::textLengthAnimated): Deleted.
663         (WebCore::SVGTextContentElement::isSupportedAttribute): Deleted.
664         * svg/SVGTextContentElement.h:
665         (WebCore::SVGTextContentElement::specifiedTextLength):
666         (WebCore::SVGTextContentElement::attributeRegistry):
667         (WebCore::SVGTextContentElement::textLength const):
668         (WebCore::SVGTextContentElement::lengthAdjust const):
669         (WebCore::SVGTextContentElement::textLengthAnimated):
670         (WebCore::SVGTextContentElement::lengthAdjustAnimated):
671         (WebCore::SVGTextContentElement::isKnownAttribute):
672         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute):
673         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize):
674         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty):
675         * svg/SVGTextPathElement.cpp:
676         (WebCore::SVGTextPathElement::SVGTextPathElement):
677         (WebCore::SVGTextPathElement::registerAttributes):
678         (WebCore::SVGTextPathElement::parseAttribute):
679         (WebCore::SVGTextPathElement::svgAttributeChanged):
680         (WebCore::SVGTextPathElement::isSupportedAttribute): Deleted.
681         * svg/SVGTextPathElement.h:
682         * svg/SVGTextPositioningElement.cpp:
683         (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
684         (WebCore::SVGTextPositioningElement::registerAttributes):
685         (WebCore::SVGTextPositioningElement::parseAttribute):
686         (WebCore::SVGTextPositioningElement::svgAttributeChanged):
687         * svg/SVGTextPositioningElement.h:
688         (WebCore::SVGTextPositioningElement::attributeRegistry):
689         (WebCore::SVGTextPositioningElement::x const):
690         (WebCore::SVGTextPositioningElement::y const):
691         (WebCore::SVGTextPositioningElement::dx const):
692         (WebCore::SVGTextPositioningElement::dy const):
693         (WebCore::SVGTextPositioningElement::rotate const):
694         (WebCore::SVGTextPositioningElement::xAnimated):
695         (WebCore::SVGTextPositioningElement::yAnimated):
696         (WebCore::SVGTextPositioningElement::dxAnimated):
697         (WebCore::SVGTextPositioningElement::dyAnimated):
698         (WebCore::SVGTextPositioningElement::rotateAnimated):
699         (WebCore::SVGTextPositioningElement::isKnownAttribute):
700         * svg/SVGURIReference.cpp:
701         (WebCore::SVGURIReference::SVGURIReference):
702         (WebCore::SVGURIReference::registerAttributes):
703         (WebCore::SVGURIReference::attributeRegistry):
704         (WebCore::SVGURIReference::isKnownAttribute):
705         (WebCore::SVGURIReference::parseAttribute):
706         (WebCore::SVGURIReference::href const):
707         (WebCore::SVGURIReference::hrefAnimated):
708         (WebCore::SVGURIReference::addSupportedAttributes): Deleted.
709         * svg/SVGURIReference.h:
710         * svg/SVGUseElement.cpp:
711         (WebCore::SVGUseElement::SVGUseElement):
712         (WebCore::SVGUseElement::registerAttributes):
713         (WebCore::SVGUseElement::parseAttribute):
714         (WebCore::SVGUseElement::insertedIntoAncestor):
715         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
716         (WebCore::SVGUseElement::svgAttributeChanged):
717         (WebCore::SVGUseElement::notifyFinished):
718         * svg/SVGUseElement.h:
719         * svg/SVGValue.h:
720         * svg/SVGViewElement.cpp:
721         (WebCore::SVGViewElement::SVGViewElement):
722         (WebCore::SVGViewElement::parseAttribute):
723         * svg/SVGViewElement.h:
724         * svg/SVGViewSpec.cpp:
725         (WebCore::SVGViewSpec::SVGViewSpec):
726         (WebCore::SVGViewSpec::registerAttributes):
727         (WebCore::SVGViewSpec::transform):
728         (WebCore::SVGViewSpec::reset):
729         (WebCore::SVGViewSpec::parseViewSpec):
730         (WebCore::SVGViewSpec::viewBoxPropertyInfo): Deleted.
731         (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo): Deleted.
732         (WebCore::SVGViewSpec::transformPropertyInfo): Deleted.
733         (WebCore::SVGViewSpec::viewBoxIdentifier): Deleted.
734         (WebCore::SVGViewSpec::preserveAspectRatioIdentifier): Deleted.
735         (WebCore::SVGViewSpec::transformIdentifier): Deleted.
736         (WebCore::SVGViewSpec::setZoomAndPan): Deleted.
737         (WebCore::SVGViewSpec::transformString const): Deleted.
738         (WebCore::SVGViewSpec::viewBoxString const): Deleted.
739         (WebCore::SVGViewSpec::preserveAspectRatioString const): Deleted.
740         (WebCore::SVGViewSpec::viewBoxAnimated): Deleted.
741         (WebCore::SVGViewSpec::preserveAspectRatioAnimated): Deleted.
742         (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Deleted.
743         (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper): Deleted.
744         (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Deleted.
745         * svg/SVGViewSpec.h:
746         * svg/SVGViewSpec.idl:
747         * svg/SVGZoomAndPan.cpp:
748         (WebCore::SVGZoomAndPan::SVGZoomAndPan):
749         (WebCore::SVGZoomAndPan::registerAttributes):
750         (WebCore::SVGZoomAndPan::parseZoomAndPan):
751         (WebCore::SVGZoomAndPan::parseAttribute):
752         (WebCore::SVGZoomAndPan::parse): Deleted.
753         (WebCore::SVGZoomAndPan::parseAttributeValue): Deleted.
754         * svg/SVGZoomAndPan.h:
755         (WebCore::SVGZoomAndPan::zoomAndPan const):
756         (WebCore::SVGZoomAndPan::setZoomAndPan):
757         (WebCore::SVGZoomAndPan::reset):
758         (WebCore::SVGZoomAndPan::attributeRegistry):
759         (WebCore::SVGZoomAndPan::isKnownAttribute):
760         (WebCore::SVGZoomAndPan::parseFromNumber): Deleted.
761         (WebCore::SVGZoomAndPan::parseAttribute): Deleted.
762         * svg/SVGZoomAndPanType.h: Copied from Source/WebCore/svg/SVGValue.h.
763         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::initialValue):
764         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::toString):
765         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::fromString):
766         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
767         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Copied from Source/WebCore/svg/SVGValue.h.
768         (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff):
769         (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff):
770         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange):
771         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
772         * svg/properties/SVGAnimatedProperty.cpp:
773         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
774         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
775         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
776         * svg/properties/SVGAnimatedProperty.h:
777         (WebCore::SVGAnimatedProperty::isAnimating const):
778         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
779         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty):
780         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty):
781         (WebCore::SVGAnimatedProperty::animatedPropertyCache):
782         (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper): Deleted.
783         (WebCore::SVGAnimatedProperty::lookupWrapper): Deleted.
784         * svg/properties/SVGAnimatedPropertyMacros.h: Removed.
785         * svg/properties/SVGAnimatedPropertyType.h: Copied from Source/WebCore/svg/SVGAElement.idl.
786         * svg/properties/SVGAttribute.h: Added.
787         (WebCore::SVGPropertyAttribute::SVGPropertyAttribute):
788         (WebCore::SVGPropertyAttribute::value):
789         (WebCore::SVGPropertyAttribute::value const):
790         (WebCore::SVGPropertyAttribute::setValue):
791         (WebCore::SVGPropertyAttribute::resetValue):
792         (WebCore::SVGPropertyAttribute::toString const):
793         (WebCore::SVGPropertyAttribute::setShouldSynchronize):
794         (WebCore::SVGPropertyAttribute::shouldSynchronize const):
795         (WebCore::SVGPropertyAttribute::synchronize):
796         (WebCore::SVGAnimatedAttribute::SVGAnimatedAttribute):
797         (WebCore::SVGAnimatedAttribute::currentValue const):
798         (WebCore::SVGAnimatedAttribute::animatedProperty):
799         (WebCore::SVGAnimatedAttributeList::SVGAnimatedAttributeList):
800         (WebCore::SVGAnimatedAttributeList::detachAnimatedListWrappers):
801         * svg/properties/SVGAttributeAccessor.h: Added.
802         (WebCore::SVGAttributeAccessor::SVGAttributeAccessor):
803         (WebCore::SVGAttributeAccessor::attributeName const):
804         (WebCore::SVGAttributeAccessor::isAnimatedLengthAttribute const):
805         (WebCore::SVGAttributeAccessor::animatedType const):
806         (WebCore::SVGAttributeAccessor::animatedTypes const):
807         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
808         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
809         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
810         (WebCore::SVGPropertyAttributeAccessor::singleton):
811         (WebCore::SVGPropertyAttributeAccessor::SVGPropertyAttributeAccessor):
812         (WebCore::SVGPropertyAttributeAccessor::attribute const):
813         (WebCore::SVGAnimatedAttributeAccessor::singleton):
814         (WebCore::SVGAnimatedAttributeAccessor::SVGAnimatedAttributeAccessor):
815         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
816         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
817         (WebCore::SVGAnimatedPairAttributeAccessor::SVGAnimatedPairAttributeAccessor):
818         (WebCore::SVGAnimatedPairAttributeAccessor::secondAttribute const):
819         * svg/properties/SVGAttributeOwnerProxy.h: Copied from Source/WebCore/svg/SVGValue.h.
820         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy):
821         (WebCore::SVGAttributeOwnerProxy::element const):
822         * svg/properties/SVGAttributeOwnerProxyImpl.h: Added.
823         (WebCore::SVGAttributeOwnerProxyImpl::SVGAttributeOwnerProxyImpl):
824         (WebCore::SVGAttributeOwnerProxyImpl::attributeRegistry):
825         (WebCore::SVGAttributeOwnerProxyImpl::isKnownAttribute):
826         (WebCore::SVGAttributeOwnerProxyImpl::isAnimatedLengthAttribute):
827         * svg/properties/SVGAttributeRegistry.h: Added.
828         (WebCore::SVGAttributeRegistry::registerAttribute):
829         (WebCore::SVGAttributeRegistry::isEmpty const):
830         (WebCore::SVGAttributeRegistry::isKnownAttribute const):
831         (WebCore::SVGAttributeRegistry::isAnimatedLengthAttribute const):
832         (WebCore::SVGAttributeRegistry::animatedTypes const):
833         (WebCore::SVGAttributeRegistry::synchronizeAttributes const):
834         (WebCore::SVGAttributeRegistry::synchronizeAttribute const):
835         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
836         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
837         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
838         (WebCore::SVGAttributeRegistry::animatedTypesBaseTypes):
839         (WebCore::SVGAttributeRegistry::synchronizeAttributesBaseTypes):
840         (WebCore::SVGAttributeRegistry::synchronizeAttributeBaseTypes):
841         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
842         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
843         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
844         (WebCore::SVGAttributeRegistry::findAttributeAccessor const):
845         * svg/properties/SVGAttributeToPropertyMap.cpp: Removed.
846         * svg/properties/SVGAttributeToPropertyMap.h: Removed.
847         * svg/properties/SVGPropertyInfo.cpp: Removed.
848         * svg/properties/SVGPropertyInfo.h: Removed.
849
850 2018-08-06  Alex Christensen  <achristensen@webkit.org>
851
852         Use enum classes and OptionSets for PaintPhase and PaintBehavior
853         https://bugs.webkit.org/show_bug.cgi?id=188323
854
855         Reviewed by Simon Fraser.
856
857         No change in behaviour.
858
859         * html/shadow/MediaControlElements.cpp:
860         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
861         * page/FrameSnapshotting.cpp:
862         (WebCore::snapshotFrameRectWithClip):
863         * page/FrameView.cpp:
864         (WebCore::FrameView::reset):
865         (WebCore::FrameView::willPaintContents):
866         (WebCore::FrameView::paintContents):
867         (WebCore::FrameView::setPaintBehavior):
868         (WebCore::FrameView::paintBehavior const):
869         (WebCore::FrameView::paintContentsForSnapshot):
870         * page/FrameView.h:
871         * rendering/InlineElementBox.cpp:
872         (WebCore::InlineElementBox::paint):
873         * rendering/InlineFlowBox.cpp:
874         (WebCore::InlineFlowBox::paint):
875         (WebCore::InlineFlowBox::paintBoxDecorations):
876         (WebCore::InlineFlowBox::paintMask):
877         * rendering/InlineTextBox.cpp:
878         (WebCore::InlineTextBox::paint):
879         * rendering/PaintInfo.h:
880         (WebCore::PaintInfo::PaintInfo):
881         (WebCore::PaintInfo::forceBlackText const):
882         (WebCore::PaintInfo::forceWhiteText const):
883         (WebCore::PaintInfo::skipRootBackground const):
884         (WebCore::PaintInfo::paintRootBackgroundOnly const):
885         * rendering/PaintPhase.h:
886         (): Deleted.
887         * rendering/RenderBlock.cpp:
888         (WebCore::RenderBlock::paint):
889         (WebCore::RenderBlock::paintContents):
890         (WebCore::RenderBlock::paintObject):
891         (WebCore::RenderBlock::paintSelection):
892         * rendering/RenderBlockFlow.cpp:
893         (WebCore::RenderBlockFlow::paintFloats):
894         * rendering/RenderBox.cpp:
895         (WebCore::RenderBox::paintMask):
896         (WebCore::RenderBox::paintClippingMask):
897         (WebCore::RenderBox::paintMaskImages):
898         (WebCore::RenderBox::pushContentsClip):
899         (WebCore::RenderBox::popContentsClip):
900         * rendering/RenderBox.h:
901         * rendering/RenderBoxModelObject.cpp:
902         (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
903         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
904         (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const):
905         * rendering/RenderDetailsMarker.cpp:
906         (WebCore::RenderDetailsMarker::paint):
907         * rendering/RenderElement.cpp:
908         (WebCore::RenderElement::paintAsInlineBlock):
909         (WebCore::RenderElement::selectionColor const):
910         * rendering/RenderEmbeddedObject.cpp:
911         (WebCore::RenderEmbeddedObject::paint):
912         (WebCore::RenderEmbeddedObject::paintReplaced):
913         * rendering/RenderFileUploadControl.cpp:
914         (WebCore::RenderFileUploadControl::paintObject):
915         * rendering/RenderFrameSet.cpp:
916         (WebCore::RenderFrameSet::paint):
917         * rendering/RenderHTMLCanvas.cpp:
918         (WebCore::RenderHTMLCanvas::paintReplaced):
919         * rendering/RenderImage.cpp:
920         (WebCore::RenderImage::paintReplaced):
921         (WebCore::RenderImage::paint):
922         * rendering/RenderLayer.cpp:
923         (WebCore::RenderLayer::renderableTransform const):
924         (WebCore::transparencyClipBox):
925         (WebCore::expandClipRectForDescendantsAndReflection):
926         (WebCore::paintingExtent):
927         (WebCore::RenderLayer::paint):
928         (WebCore::RenderLayer::paintOverlayScrollbars):
929         (WebCore::RenderLayer::paintLayer):
930         (WebCore::RenderLayer::paintLayerContents):
931         (WebCore::RenderLayer::paintBackgroundForFragments):
932         (WebCore::RenderLayer::paintForegroundForFragments):
933         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
934         (WebCore::RenderLayer::paintOutlineForFragments):
935         (WebCore::RenderLayer::paintMaskForFragments):
936         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
937         (WebCore::RenderLayer::calculateClipRects const):
938         * rendering/RenderLayer.h:
939         * rendering/RenderLayerBacking.cpp:
940         (WebCore::RenderLayerBacking::paintIntoLayer):
941         (WebCore::RenderLayerBacking::paintContents):
942         * rendering/RenderLayerBacking.h:
943         * rendering/RenderLineBoxList.cpp:
944         (WebCore::RenderLineBoxList::paint const):
945         * rendering/RenderListBox.cpp:
946         (WebCore::RenderListBox::paintObject):
947         * rendering/RenderListMarker.cpp:
948         (WebCore::RenderListMarker::paint):
949         * rendering/RenderReplaced.cpp:
950         (WebCore::RenderReplaced::paint):
951         (WebCore::RenderReplaced::shouldPaint):
952         * rendering/RenderReplica.cpp:
953         (WebCore::RenderReplica::paint):
954         * rendering/RenderScrollbarPart.cpp:
955         (WebCore::RenderScrollbarPart::paintIntoRect):
956         * rendering/RenderSnapshottedPlugIn.cpp:
957         (WebCore::RenderSnapshottedPlugIn::paint):
958         * rendering/RenderTable.cpp:
959         (WebCore::RenderTable::paintObject):
960         (WebCore::RenderTable::paintMask):
961         (WebCore::RenderTable::overflowClipRect):
962         * rendering/RenderTable.h:
963         * rendering/RenderTableCell.cpp:
964         (WebCore::RenderTableCell::paint):
965         (WebCore::RenderTableCell::paintCollapsedBorders):
966         (WebCore::RenderTableCell::paintMask):
967         * rendering/RenderTableRow.cpp:
968         (WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
969         (WebCore::RenderTableRow::paint):
970         * rendering/RenderTableSection.cpp:
971         (WebCore::RenderTableSection::paint):
972         (WebCore::RenderTableSection::paintCell):
973         (WebCore::RenderTableSection::paintObject):
974         * rendering/RenderThemeMac.mm:
975         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
976         (WebCore::RenderThemeMac::paintImageControlsButton):
977         * rendering/RenderVideo.cpp:
978         (WebCore::RenderVideo::paintReplaced):
979         * rendering/RenderWidget.cpp:
980         (WebCore::RenderWidget::paintContents):
981         (WebCore::RenderWidget::paint):
982         * rendering/RootInlineBox.cpp:
983         (WebCore::RootInlineBox::paintEllipsisBox const):
984         * rendering/SimpleLineLayoutFunctions.cpp:
985         (WebCore::SimpleLineLayout::paintFlow):
986         * rendering/mathml/MathOperator.cpp:
987         (WebCore::MathOperator::paint):
988         * rendering/mathml/RenderMathMLBlock.cpp:
989         (WebCore::RenderMathMLBlock::paint):
990         * rendering/mathml/RenderMathMLFraction.cpp:
991         (WebCore::RenderMathMLFraction::paint):
992         * rendering/mathml/RenderMathMLMenclose.cpp:
993         (WebCore::RenderMathMLMenclose::paint):
994         * rendering/mathml/RenderMathMLToken.cpp:
995         (WebCore::RenderMathMLToken::paint):
996         * rendering/svg/RenderSVGContainer.cpp:
997         (WebCore::RenderSVGContainer::paint):
998         * rendering/svg/RenderSVGForeignObject.cpp:
999         (WebCore::RenderSVGForeignObject::paint):
1000         * rendering/svg/RenderSVGImage.cpp:
1001         (WebCore::RenderSVGImage::paint):
1002         * rendering/svg/RenderSVGResource.cpp:
1003         (WebCore::requestPaintingResource):
1004         * rendering/svg/RenderSVGResourceClipper.cpp:
1005         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
1006         * rendering/svg/RenderSVGResourceSolidColor.cpp:
1007         (WebCore::RenderSVGResourceSolidColor::applyResource):
1008         * rendering/svg/RenderSVGRoot.cpp:
1009         (WebCore::RenderSVGRoot::paintReplaced):
1010         * rendering/svg/RenderSVGShape.cpp:
1011         (WebCore::RenderSVGShape::paint):
1012         * rendering/svg/RenderSVGText.cpp:
1013         (WebCore::RenderSVGText::paint):
1014         * rendering/svg/SVGInlineFlowBox.cpp:
1015         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
1016         (WebCore::SVGInlineFlowBox::paint):
1017         * rendering/svg/SVGInlineTextBox.cpp:
1018         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1019         (WebCore::SVGInlineTextBox::paint):
1020         * rendering/svg/SVGRenderingContext.cpp:
1021         (WebCore::isRenderingMaskImage):
1022         (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer):
1023         * rendering/svg/SVGRootInlineBox.cpp:
1024         (WebCore::SVGRootInlineBox::paint):
1025
1026 2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>
1027
1028         Unreviewed, rolling out r234569.
1029
1030         Breaks internal builds.
1031
1032         Reverted changeset:
1033
1034         "We should cache the compiled sandbox profile in a data vault"
1035         https://bugs.webkit.org/show_bug.cgi?id=184991
1036         https://trac.webkit.org/changeset/234569
1037
1038 2018-08-06  Alex Christensen  <achristensen@webkit.org>
1039
1040         Make BlendMode an enum class
1041         https://bugs.webkit.org/show_bug.cgi?id=188325
1042
1043         Reviewed by Darin Adler.
1044
1045         No change in behavior.
1046
1047         * css/CSSPrimitiveValueMappings.h:
1048         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1049         (WebCore::CSSPrimitiveValue::operator BlendMode const):
1050         * html/HTMLImageElement.cpp:
1051         (WebCore::HTMLImageElement::parseAttribute):
1052         * html/canvas/CanvasRenderingContext2DBase.cpp:
1053         (WebCore::CanvasRenderingContext2DBase::State::State):
1054         (WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation):
1055         (WebCore::CanvasRenderingContext2DBase::drawImageFromRect):
1056         * platform/graphics/BitmapImage.h:
1057         * platform/graphics/GraphicsContext.h:
1058         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
1059         * platform/graphics/GraphicsContextImpl.h:
1060         * platform/graphics/GraphicsLayer.cpp:
1061         (WebCore::GraphicsLayer::dumpProperties const):
1062         * platform/graphics/GraphicsLayer.h:
1063         * platform/graphics/GraphicsTypes.cpp:
1064         (WebCore::parseBlendMode):
1065         (WebCore::parseCompositeAndBlendOperator):
1066         (WebCore::compositeOperatorName):
1067         (WebCore::blendModeName):
1068         (WebCore::operator<<):
1069         * platform/graphics/GraphicsTypes.h:
1070         * platform/graphics/Image.cpp:
1071         (WebCore::Image::drawTiled):
1072         * platform/graphics/Image.h:
1073         * platform/graphics/ImageBuffer.h:
1074         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
1075         (PlatformCAFilters::setBlendingFiltersOnLayer):
1076         * platform/graphics/cg/GraphicsContextCG.cpp:
1077         (WebCore::selectCGBlendMode):
1078         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
1079         (WebCore::FEBlend::platformApplyNEON):
1080         * platform/graphics/displaylists/DisplayListItems.h:
1081         * platform/graphics/displaylists/DisplayListRecorder.h:
1082         * platform/graphics/filters/FEBlend.cpp:
1083         (WebCore::FEBlend::externalRepresentation const):
1084         * rendering/RenderBox.cpp:
1085         (WebCore::RenderBox::paintFillLayers):
1086         * rendering/RenderImage.cpp:
1087         (WebCore::RenderImage::paintIntoRect):
1088         * rendering/RenderLayer.cpp:
1089         (WebCore::RenderLayer::RenderLayer):
1090         (WebCore::RenderLayer::updateBlendMode):
1091         (WebCore::RenderLayer::beginTransparencyLayers):
1092         * rendering/RenderLayerBacking.cpp:
1093         (WebCore::RenderLayerBacking::updateBlendMode):
1094         * rendering/style/FillLayer.cpp:
1095         (WebCore::FillLayer::FillLayer):
1096         (WebCore::FillLayer::hasOpaqueImage const):
1097         * rendering/style/FillLayer.h:
1098         (WebCore::FillLayer::initialFillBlendMode):
1099         * rendering/style/RenderStyle.h:
1100         (WebCore::RenderStyle::setBlendMode):
1101         (WebCore::RenderStyle::hasBlendMode const):
1102         (WebCore::RenderStyle::blendMode const):
1103         (WebCore::RenderStyle::initialBlendMode):
1104         * rendering/style/StyleRareNonInheritedData.cpp:
1105         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1106         * rendering/svg/SVGRenderingContext.cpp:
1107         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1108         * svg/SVGAnimatedEnumeration.cpp:
1109         (WebCore::enumerationValueForTargetAttribute):
1110         * svg/SVGFEBlendElement.cpp:
1111         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
1112         (WebCore::SVGFEBlendElement::parseAttribute):
1113         * svg/SVGFEBlendElement.h:
1114         (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
1115         (WebCore::SVGPropertyTraits<BlendMode>::toString):
1116         * svg/graphics/SVGImage.cpp:
1117         (WebCore::SVGImage::nativeImageForCurrentFrame):
1118         (WebCore::SVGImage::nativeImage):
1119         (WebCore::SVGImage::drawPatternForContainer):
1120         (WebCore::SVGImage::draw):
1121
1122 2018-08-06  Aditya Keerthi  <akeerthi@apple.com>
1123
1124         [iOS] Indeterminate checkboxes appear unchecked
1125         https://bugs.webkit.org/show_bug.cgi?id=160484
1126         <rdar://problem/31143185>
1127
1128         Reviewed by Wenson Hsieh.
1129
1130         Add support for rendering indeterminate checkboxes on iOS.
1131
1132         We now paint the unchecked appearance only if the checkbox is not checked and is
1133         not indeterminate. Otherwise, we draw a checkmark if the checkbox is in the
1134         checked state and a dash if the checkbox is in the indeterminate state. Both of
1135         these states share the same dark background.
1136
1137         Test: fast/forms/ios/render-indeterminate-checkbox.html
1138
1139         * css/html.css:
1140         (input[type="checkbox"]:indeterminate):
1141         (input[type="checkbox"]:indeterminate:disabled):
1142         * rendering/RenderThemeIOS.mm:
1143         (WebCore::drawJoinedLines):
1144         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
1145
1146 2018-08-06  Ryosuke Niwa  <rniwa@webkit.org>
1147
1148         HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element
1149         https://bugs.webkit.org/show_bug.cgi?id=188336
1150
1151         Reviewed by Frédéric Wang.
1152
1153         Push and pop an element queue from the custom element reactions stack when constructing a custom element:
1154         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
1155
1156         To do this, we instantiate CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder
1157         where we synchronously construct a custom element. We don't have to worry about whether *will execute script*
1158         is set or not since the presence of an element queue should not be observable in the case where we're constructing
1159         a fallback element (since it would not enqueue any new custom element reaction).
1160
1161         Tests: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html
1162
1163         * html/parser/HTMLDocumentParser.cpp:
1164         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate CustomElementReactionStack. Note that we
1165         don't insert the custom element into the parser until we finish processing the custom element reactions.
1166
1167 2018-08-06  Charlie Turner  <cturner@igalia.com>
1168
1169         Return extracted key ids as an optional
1170         https://bugs.webkit.org/show_bug.cgi?id=188303
1171
1172         Reviewed by Darin Adler.
1173
1174         An empty list of extracted key ids was being considered a failure
1175         case before this patch. In the PSSH boxes from the CENC standard,
1176         it's not uncommon for the box to be version 0, meaning it has no
1177         embedded key ids, so the case when there's an empty list should
1178         not be treated as an error. Given this, the interface should be
1179         more general and allow for a sentinel value indicating a parsing
1180         error rather than an absence of key ids.
1181
1182         Covered by existing tests.
1183
1184         * Modules/encryptedmedia/InitDataRegistry.cpp:
1185         (WebCore::extractKeyIDsKeyids): Change return type to be wrapped
1186         in an optional, and make parsing errors return a nullopt rather
1187         than an empty vector.
1188         (WebCore::sanitizeKeyids): Use the new optional interface, return
1189         a null RefPtr in the case of a parsing error, this method may now
1190         return an empty vector.
1191         (WebCore::extractKeyIDsCenc): Not implemented, so return an error
1192         value rather than an empty vector.
1193         (WebCore::extractKeyIDsWebM): Ditto.
1194         (WebCore::InitDataRegistry::extractKeyIDs): Ditto.
1195         * Modules/encryptedmedia/InitDataRegistry.h: Update the interface
1196         to use an optional return type.
1197         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
1198         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf): Update
1199         to use the new interface.
1200         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd): Ditto.
1201         * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Ditto.
1202         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1203         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Convert
1204         the optional value into a vector, since it is assumed you can not
1205         have an empty vector of key ids in the init datas FPS supports.
1206         * testing/MockCDMFactory.cpp:
1207         (WebCore::MockCDMInstance::requestLicense): Only return an error
1208         if there really was a parsing error, rather than the case of there
1209         being zero key ids in the init data payload.
1210
1211 2018-08-06  Frederic Wang  <fwang@igalia.com>
1212
1213         Make two-arguments versions of scrollBy/scrollTo depend on the one-argument versions
1214         https://bugs.webkit.org/show_bug.cgi?id=188300
1215
1216         Reviewed by Darin Adler.
1217
1218         This patch refactors a bit the scrollBy/scrollTo code, so that the two-arguments versions
1219         share the same code path as the more generic one-argument versions. In particular, this
1220         helps to implement the ScrollBehavior option (bug 188043) since the one-argument versions
1221         will require to distinguish between smooth and instant scrolling. The logic to normalize
1222         non finite left/right values or to use a fallback when they are absent is also factored out
1223         into ScrollToOptions.
1224
1225         References:
1226         https://drafts.csswg.org/cssom-view/#dom-element-scroll
1227         https://drafts.csswg.org/cssom-view/#dom-element-scrollby
1228         https://drafts.csswg.org/cssom-view/#dom-window-scroll
1229         https://drafts.csswg.org/cssom-view/#dom-window-scrollby
1230
1231         No new tests, behavior is unchanged.
1232
1233         * dom/Element.cpp:
1234         (WebCore::Element::scrollBy): Make two-parameter version depends on one-parameter version
1235         and rewrite the normalize / fallback logic.
1236         (WebCore::Element::scrollTo): Rewrite the normalize / fallback logic.
1237         (WebCore::normalizeNonFiniteValue): Deleted. The logic is moved to ScrollToOptions.
1238         * page/DOMWindow.cpp:
1239         (WebCore::DOMWindow::scrollBy const): Make two-parameter version depends on one-parameter
1240         version and rewrite the normalize / fallback logic.
1241         (WebCore::DOMWindow::scrollTo const): Make two-parameter version depends on one-parameter
1242         version and rewrite the normalize / fallback logic.
1243         * page/ScrollToOptions.h: Add <cmath> to use std::isfinite
1244         (WebCore::ScrollToOptions::normalizeNonFiniteCoordinatesOrFallBackTo): New function to
1245         normalize left/right values or fallback to the specified value if it is missing.
1246
1247 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
1248
1249         Unreviewed follow-up to r234594.
1250
1251         Add missing constructor and destructor definitions for the bunch of new
1252         classes that were added in that revision.
1253
1254         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
1255         (Nicosia::ContentLayer::ContentLayer):
1256         (Nicosia::BackingStore::BackingStore):
1257         (Nicosia::ImageBacking::ImageBacking):
1258
1259 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
1260
1261         [Nicosia] Add additional layer state classes, use impl-based approach to make them extendable
1262         https://bugs.webkit.org/show_bug.cgi?id=188341
1263
1264         Reviewed by Carlos Garcia Campos.
1265
1266         Add the ContentLayer, BackingStore and ImageBacking classes in the
1267         Nicosia namespace. State objects of CompositionLayer instances keep
1268         references to objects of these classes depending on the content that's
1269         presented in the associated GraphicsLayer.
1270
1271         ContentLayer derives from the PlatformLayer class. It's used for layers
1272         that display things like WebGL and HTML5 canvas and media content in a
1273         platform-specific way. In case of TextureMapper the hardware-accelerated
1274         content is piped into that rendering pipeline.
1275
1276         BackingStore is meant to represent the painted contents of a layer. The
1277         equivalent current functionality is using a tiled backing store that
1278         has its contents copied into the CoordinatedBackingStore instance.
1279
1280         ImageBacking is used for a layer whose content is a simple Image object.
1281         Image's pixel data is rasterized and again managed through
1282         CoordinatedBackingStore for rendering.
1283
1284         All these classes, along with the CompositionLayer class, should now be
1285         constructed with a factory function that returns an object that derives
1286         the class-specific Impl interface. This will allow for simpler
1287         implementation of different approaches in parallel. The TextureMapper
1288         variants will be the first ones, replicating the current behavior as it
1289         is implemented across classes in the CoordinatedGraphics and
1290         TextureMapper layers.
1291
1292         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
1293         (Nicosia::CompositionLayer::CompositionLayer):
1294         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
1295         (Nicosia::PlatformLayer::isContentLayer const):
1296         (Nicosia::CompositionLayer::Impl::isTextureMapperImpl const):
1297         (Nicosia::CompositionLayer::create):
1298         (Nicosia::CompositionLayer::impl const):
1299         (Nicosia::ContentLayer::Impl::isTextureMapperImpl const):
1300         (Nicosia::ContentLayer::create):
1301         (Nicosia::ContentLayer::impl const):
1302         (Nicosia::BackingStore::Impl::isTextureMapperImpl const):
1303         (Nicosia::BackingStore::create):
1304         (Nicosia::BackingStore::impl const):
1305         (Nicosia::ImageBacking::Impl::isTextureMapperImpl const):
1306         (Nicosia::ImageBacking::create):
1307         (Nicosia::ImageBacking::impl const):
1308         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1309         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
1310
1311 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
1312
1313         [Nicosia] Add Nicosia::Scene
1314         https://bugs.webkit.org/show_bug.cgi?id=188340
1315
1316         Reviewed by Carlos Garcia Campos.
1317
1318         Add the Nicosia::Scene class that controls the scene's state and enables
1319         thread-safe updates to that state.
1320
1321         The State struct itself holds a set of all the layers in the scene, and
1322         separates out the root layer specifically. An ID counter is also present
1323         there, allowing consumers of this state to easily check for any updates.
1324
1325         A reference to the Nicosia::Scene object now replaces the
1326         HashSet-and-root-layer pair in the CoordinatedGraphicsState struct.
1327
1328         * platform/TextureMapper.cmake:
1329         * platform/graphics/nicosia/NicosiaScene.cpp: Added.
1330         * platform/graphics/nicosia/NicosiaScene.h: Added.
1331         (Nicosia::Scene::create):
1332         (Nicosia::Scene::accessState):
1333         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1334
1335 2018-08-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1336
1337         [GTK] Buttons are drawn too large, text not centered
1338         https://bugs.webkit.org/show_bug.cgi?id=185854
1339
1340         Reviewed by Carlos Garcia Campos.
1341
1342         Some pages require small buttons and the GTK theme was
1343         drawing only down to a minimum size.
1344
1345         No new tests required. Current layout tests and ManualTests/gtk/theme.html
1346         already cover it.
1347
1348         * platform/gtk/RenderThemeGadget.cpp:
1349         (WebCore::RenderThemeGadget::create):
1350         (WebCore::RenderThemeButtonGadget::RenderThemeButtonGadget): Added
1351         (WebCore::RenderThemeButtonGadget::minimumSize const):
1352         Allow sizes smaller than the minimum size.
1353         * platform/gtk/RenderThemeGadget.h:
1354         * platform/gtk/RenderThemeWidget.cpp:
1355         (WebCore::RenderThemeButton::RenderThemeButton):
1356
1357 2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1358
1359         Implement self.queueMicrotask in Workers
1360         https://bugs.webkit.org/show_bug.cgi?id=188247
1361
1362         Reviewed by Ryosuke Niwa.
1363
1364         This patch adds support for self.queueMicrotask to workers.
1365
1366         Tests: http/wpt/workers/queue-microtask.any.html
1367                http/wpt/workers/queue-microtask.any.worker.html
1368
1369         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1370         (WebCore::JSWorkerGlobalScope::queueMicrotask):
1371         * page/DOMWindow.idl:
1372         Move queueMicrotask declaration to WindowOrWorkerGlobalScope.idl.
1373         * page/WindowOrWorkerGlobalScope.idl:
1374
1375 2018-08-05  Rob Buis  <rbuis@igalia.com>
1376
1377         [GTK][WPE] Fetch tests assert in SubresourceLoader::didReceiveResponse()
1378         https://bugs.webkit.org/show_bug.cgi?id=188163
1379
1380         Reviewed by Frédéric Wang.
1381
1382         Fetch in manual redirect mode uses didReceiveResponse instead of
1383         willSendRequestInternal, so update the ASSERT.
1384
1385         * loader/SubresourceLoader.cpp:
1386         (WebCore::SubresourceLoader::didReceiveResponse):
1387
1388 2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1389
1390         Add support for microtasks in workers
1391         https://bugs.webkit.org/show_bug.cgi?id=188246
1392
1393         Reviewed by Darin Adler.
1394
1395         This patch adds the microtask mechanism to workers. To adopt the existing microtask mechanism from the main thread,
1396         we extend JSMainThreadExecState for non-main-threads. We rename it to JSExecState, and store stacked
1397         ExecState* data in thread local storage in ThreadGlobalData instead of a static variable s_mainThreadState.
1398
1399         We add MicrotaskQueue to WorkerGlobalScope since each worker has its own thread and it should have its
1400         own microtask queue.
1401
1402         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
1403         * Sources.txt:
1404         * WebCore.xcodeproj/project.pbxproj:
1405         * bindings/js/JSBindingsAllInOne.cpp:
1406         * bindings/js/JSCallbackData.cpp:
1407         (WebCore::JSCallbackData::invokeCallback):
1408         * bindings/js/JSCustomElementInterface.cpp:
1409         (WebCore::constructCustomElementSynchronously):
1410         (WebCore::JSCustomElementInterface::upgradeElement):
1411         (WebCore::JSCustomElementInterface::invokeCallback):
1412         * bindings/js/JSCustomXPathNSResolver.cpp:
1413         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1414         * bindings/js/JSDOMGlobalObjectTask.cpp:
1415         * bindings/js/JSDOMWindowBase.cpp:
1416         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
1417         Queue a microtask to MicrotaskQueue instead of posting a macrotask.
1418
1419         (WebCore::JSDOMWindowMicrotaskCallback::create): Deleted.
1420         (WebCore::JSDOMWindowMicrotaskCallback::call): Deleted.
1421         (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback): Deleted.
1422         (): Deleted.
1423         Extract JSDOMWindowMicrotaskCallback as JSMicrotaskCallback and create a new file for it.
1424
1425         * bindings/js/JSErrorHandler.cpp:
1426         (WebCore::JSErrorHandler::handleEvent):
1427         * bindings/js/JSEventListener.cpp:
1428         (WebCore::JSEventListener::handleEvent):
1429         * bindings/js/JSExecState.cpp: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.cpp.
1430         (WebCore::JSExecState::didLeaveScriptContext):
1431         If we are in a main thread, we consume main thread microtask queue. If we are in worker thread,
1432         we consume a microtask queue per worker.
1433
1434         (WebCore::functionCallHandlerFromAnyThread):
1435         (WebCore::evaluateHandlerFromAnyThread):
1436         * bindings/js/JSExecState.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.h.
1437         (WebCore::JSExecState::currentState):
1438         (WebCore::JSExecState::call):
1439         (WebCore::JSExecState::evaluate):
1440         (WebCore::JSExecState::profiledCall):
1441         (WebCore::JSExecState::profiledEvaluate):
1442         (WebCore::JSExecState::runTask):
1443         (WebCore::JSExecState::loadModule):
1444         (WebCore::JSExecState::linkAndEvaluateModule):
1445         (WebCore::JSExecState::JSExecState):
1446         (WebCore::JSExecState::~JSExecState):
1447         (WebCore::JSExecState::setCurrentState):
1448         Store and load ExecState in thread local storage, ThreadGlobalData. This allows us to use it for workers.
1449
1450         (WebCore::JSMainThreadNullState::JSMainThreadNullState):
1451         (WebCore::JSMainThreadNullState::~JSMainThreadNullState):
1452         We keep this name "JSMainThreadNullState" since CustomElementReactionStack should be stick to the main thread.
1453         And this class is only used in the main thread.
1454
1455         * bindings/js/JSExecStateInstrumentation.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h.
1456         (WebCore::JSExecState::instrumentFunctionInternal):
1457         (WebCore::JSExecState::instrumentFunctionCall):
1458         (WebCore::JSExecState::instrumentFunctionConstruct):
1459         * bindings/js/JSMicrotaskCallback.h: Copied from Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm.
1460         (WebCore::JSMicrotaskCallback::create):
1461         (WebCore::JSMicrotaskCallback::call):
1462         (WebCore::JSMicrotaskCallback::JSMicrotaskCallback):
1463         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1464         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
1465         * bindings/js/ScheduledAction.cpp:
1466         (WebCore::ScheduledAction::executeFunctionInContext):
1467         * bindings/js/ScriptController.cpp:
1468         (WebCore::ScriptController::evaluateInWorld):
1469         (WebCore::ScriptController::loadModuleScriptInWorld):
1470         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
1471         (WebCore::ScriptController::canAccessFromCurrentOrigin):
1472         * bindings/js/WorkerScriptController.cpp:
1473         (WebCore::WorkerScriptController::evaluate):
1474         * bridge/objc/WebScriptObject.mm:
1475         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1476         (-[WebScriptObject evaluateWebScript:]):
1477         * html/canvas/WebGLRenderingContextBase.cpp:
1478         (WebCore::WebGLRenderingContextBase::compileShader):
1479         (WebCore::WebGLRenderingContextBase::printToConsole):
1480         * inspector/InspectorCanvas.cpp:
1481         (WebCore::InspectorCanvas::buildObjectForCanvas):
1482         (WebCore::InspectorCanvas::buildAction):
1483         * inspector/InspectorController.cpp:
1484         * inspector/InspectorFrontendHost.cpp:
1485         * inspector/TimelineRecordFactory.cpp:
1486         (WebCore::TimelineRecordFactory::createGenericRecord):
1487         * inspector/WorkerInspectorController.cpp:
1488         * inspector/agents/InspectorCanvasAgent.cpp:
1489         * inspector/agents/InspectorNetworkAgent.cpp:
1490         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
1491         * page/DOMWindow.cpp:
1492         (WebCore::DOMWindow::postMessage):
1493         * page/PageConsoleClient.cpp:
1494         (WebCore::PageConsoleClient::addMessage):
1495         * page/csp/ContentSecurityPolicy.cpp:
1496         (WebCore::ContentSecurityPolicy::reportViolation const):
1497         * platform/ThreadGlobalData.h:
1498         (WebCore::ThreadGlobalData::ThreadGlobalData::currentState const):
1499         (WebCore::ThreadGlobalData::ThreadGlobalData::setCurrentState):
1500         * workers/WorkerGlobalScope.cpp:
1501         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1502         (WebCore::WorkerGlobalScope::removeMicrotaskQueue):
1503         * workers/WorkerGlobalScope.h:
1504         (WebCore::WorkerGlobalScope::microtaskQueue const):
1505         * workers/WorkerThread.cpp:
1506         (WebCore::WorkerThread::stop):
1507         * workers/service/ExtendableEvent.cpp:
1508         (WebCore::ExtendableEvent::addExtendLifetimePromise):
1509         When dispatching an "install" event from service worker, we first create an event,
1510         dispatch it, and set a handler which is called when a pending promise count becomes zero.
1511         However, the old code checked pending promise count in a queued microtask. It worked
1512         previously because microtask is actually a macrotask in the service worker. So this check
1513         is done after a handler is set. But this patch introduces real microtask, and this check
1514         happens before a handler is set because dispatching an event can exhaust microtask queue.
1515         According to the spec, this check should not be done in microtask[1]. We make this checking
1516         part as a macrotask. We note that algorithm noted as FIXMEs should be done in this
1517         microtask while the checking part should not be done.
1518
1519         [1]: https://w3c.github.io/ServiceWorker/#installation-algorithm
1520
1521 2018-08-05  Ryosuke Niwa  <rniwa@webkit.org>
1522
1523         Properties set on window.customElements can disappear due to GC
1524         https://bugs.webkit.org/show_bug.cgi?id=172575
1525
1526         Lexicologically sort the IDL attributes per Darin's comment.
1527
1528         * dom/CustomElementRegistry.idl:
1529
1530 2018-08-05  Zalan Bujtas  <zalan@apple.com>
1531
1532         [LFC][BFC] contentHeightForFormattingContextRoot uses the wrong coordinate system to compute the height.
1533         https://bugs.webkit.org/show_bug.cgi?id=188319
1534
1535         Reviewed by Antti Koivisto.
1536
1537         Display::Box::marginBox() is in the coordinate system of the box itself (8px top margin translates to y = -8px).
1538         What we need instead to compute the content height is the top/bottom position in the containing block's coordinate system (rect and rectWithMargin).
1539
1540         * layout/FormattingContextGeometry.cpp:
1541         (WebCore::Layout::contentHeightForFormattingContextRoot):
1542
1543 2018-08-05  Ms2ger  <Ms2ger@igalia.com>
1544
1545         [GStreamer] Remove unsound assertions in MediaPlayerPrivateGStreamerBase.
1546         https://bugs.webkit.org/show_bug.cgi?id=188162
1547
1548         Reviewed by Philippe Normand.
1549
1550         These assertions sometimes fail, and there's a runtime check right
1551         after them anyway.
1552
1553         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
1554                fast/canvas/webgl/texImage2D-video-flipY-true.html
1555
1556         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1557         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1558         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
1559
1560 2018-08-05  Philippe Normand  <pnormand@igalia.com>
1561
1562         [MediaCapabilities] Platform integration
1563         https://bugs.webkit.org/show_bug.cgi?id=187850
1564
1565         Reviewed by Eric Carlson.
1566
1567         Mock platform support for the MediaCapabilities specification.
1568
1569         Test: media/mediacapabilities/mock-decodingInfo.html
1570               media/mediacapabilities/mock-encodingInfo.html
1571
1572         * Modules/mediacapabilities/MediaCapabilities.cpp:
1573         (WebCore::MediaCapabilities::decodingInfo):
1574         (WebCore::MediaCapabilities::encodingInfo):
1575         * Modules/mediacapabilities/MediaCapabilitiesInfo.h:
1576         (WebCore::MediaCapabilitiesInfo::create):
1577         * PlatformGTK.cmake:
1578         * PlatformMac.cmake:
1579         * PlatformWPE.cmake:
1580         * Sources.txt:
1581         * WebCore.xcodeproj/project.pbxproj:
1582         * platform/mediacapabilities/MediaEngineConfiguration.cpp: Added.
1583         (WebCore::MediaEngineVideoConfiguration::MediaEngineVideoConfiguration):
1584         (WebCore::MediaEngineAudioConfiguration::MediaEngineAudioConfiguration):
1585         (WebCore::MediaEngineConfiguration::MediaEngineConfiguration):
1586         * platform/mediacapabilities/MediaEngineConfiguration.h: Added.
1587         (WebCore::MediaEngineVideoConfiguration::create):
1588         (WebCore::MediaEngineVideoConfiguration::contentType const):
1589         (WebCore::MediaEngineVideoConfiguration::size const):
1590         (WebCore::MediaEngineVideoConfiguration::bitrate const):
1591         (WebCore::MediaEngineVideoConfiguration::framerate const):
1592         (WebCore::MediaEngineAudioConfiguration::create):
1593         (WebCore::MediaEngineAudioConfiguration::contentType const):
1594         (WebCore::MediaEngineAudioConfiguration::channels const):
1595         (WebCore::MediaEngineAudioConfiguration::bitrate const):
1596         (WebCore::MediaEngineAudioConfiguration::samplerate const):
1597         (WebCore::MediaEngineConfiguration::audioConfiguration const):
1598         (WebCore::MediaEngineConfiguration::videoConfiguration const):
1599         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: Added.
1600         (WebCore::mockEnabled):
1601         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
1602         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
1603         (WebCore::MediaEngineConfigurationFactory::enableMock):
1604         (WebCore::MediaEngineConfigurationFactory::disableMock):
1605         * platform/mediacapabilities/MediaEngineConfigurationFactory.h: Added.
1606         * platform/mediacapabilities/MediaEngineDecodingConfiguration.h: Added.
1607         (WebCore::MediaEngineDecodingConfiguration::MediaEngineDecodingConfiguration):
1608         (WebCore::MediaEngineDecodingConfiguration::canDecodeMedia):
1609         (WebCore::MediaEngineDecodingConfiguration::canSmoothlyDecodeMedia):
1610         (WebCore::MediaEngineDecodingConfiguration::canPowerEfficientlyDecodeMedia):
1611         (WebCore::MediaEngineDecodingConfiguration::decodingType const):
1612         * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Added.
1613         (WebCore::MediaEngineEncodingConfiguration::MediaEngineEncodingConfiguration):
1614         (WebCore::MediaEngineEncodingConfiguration::canEncodeMedia):
1615         (WebCore::MediaEngineEncodingConfiguration::canSmoothlyEncodeMedia):
1616         (WebCore::MediaEngineEncodingConfiguration::canPowerEfficientlyEncodeMedia):
1617         (WebCore::MediaEngineEncodingConfiguration::encodingType const):
1618         * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Added.
1619         (WebCore::MediaEngineDecodingConfigurationMock::canDecodeMedia):
1620         (WebCore::MediaEngineDecodingConfigurationMock::canSmoothlyDecodeMedia):
1621         (WebCore::MediaEngineDecodingConfigurationMock::canPowerEfficientlyDecodeMedia):
1622         * platform/mock/MediaEngineDecodingConfigurationMock.h: Added.
1623         * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Added.
1624         (WebCore::MediaEngineEncodingConfigurationMock::canEncodeMedia):
1625         (WebCore::MediaEngineEncodingConfigurationMock::canSmoothlyEncodeMedia):
1626         (WebCore::MediaEngineEncodingConfigurationMock::canPowerEfficientlyEncodeMedia):
1627         * platform/mock/MediaEngineEncodingConfigurationMock.h: Added.
1628         * testing/Internals.cpp:
1629         (WebCore::Internals::resetToConsistentState):
1630         (WebCore::Internals::enableMockMediaCapabilities):
1631         * testing/Internals.h:
1632         * testing/Internals.idl:
1633
1634 2018-08-04  Simon Fraser  <simon.fraser@apple.com>
1635
1636         Make WebCore::Timer more space-efficient
1637         https://bugs.webkit.org/show_bug.cgi?id=187455
1638
1639         Reviewed by Brent Fulgham.
1640
1641         Steal a bit from m_heapIndex for m_wasDeleted to eliminate padding in Timer.
1642         This reduces the size of Document, which has 8 Timers, from 3360 to 3296 bytes (saving 64 bytes).
1643
1644         * platform/Timer.cpp:
1645         (WebCore::TimerBase::TimerBase):
1646         * platform/Timer.h:
1647
1648 2018-08-04  Ryosuke Niwa  <rniwa@webkit.org>
1649
1650         Properties set on window.customElements can disappear due to GC
1651         https://bugs.webkit.org/show_bug.cgi?id=172575
1652         <rdar://problem/32440668>
1653
1654         Reviewed by Saam Barati.
1655
1656         Fixed the bug that JS wrapper of CustomElementsRegistry can erroneously get collected during GC
1657         by keeping it alive as long as the global object is alive.
1658
1659         Test: fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html
1660
1661         * dom/CustomElementRegistry.cpp:
1662         (WebCore::CustomElementRegistry::create):
1663         (WebCore::CustomElementRegistry::CustomElementRegistry):
1664         * dom/CustomElementRegistry.h:
1665         (WebCore::CustomElementRegistry): Make this inherited from ContextDestructionObserver.
1666         * dom/CustomElementRegistry.idl: Set GenerateIsReachable=ImplScriptExecutionContext in IDL. This will
1667         make CustomElementRegistry reachable from the global object.
1668         * page/DOMWindow.cpp:
1669         (WebCore::DOMWindow::ensureCustomElementRegistry):
1670
1671 2018-08-03  Ryosuke Niwa  <rniwa@webkit.org>
1672
1673         innerHTML should not synchronously create a custom element
1674         https://bugs.webkit.org/show_bug.cgi?id=188327
1675         <rdar://problem/42923114>
1676
1677         Reviewed by Daniel Bates.
1678
1679         Fixed the bug that the fragment parsing algorithm was synchronously constructing a custom element instead of
1680         enqueuing an element to upgrade.
1681
1682         The fragment parsing algorithm creates an element for a token with *will execute script* flag set to false:
1683         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
1684         which results in creating an element with synchronous custom elements flag *not* set:
1685         https://dom.spec.whatwg.org/#concept-create-element
1686
1687         When synchronous custom elements flag is false, we're supposed to create an element and enqueue a custom element
1688         upgrade reaction. createHTMLElementOrFindCustomElementInterface was missing this last logic. 
1689
1690         Also fixed a bug that Element::enqueueToUpgrade would hit a debug assertion when a custom element which has been
1691         enqueued to upgrade is enqueued to upgrade for the second time. In this case, we need to put the element into the
1692         current element queue (https://html.spec.whatwg.org/multipage/custom-elements.html#current-element-queue) again.
1693
1694         While the specification simply enqueues another upgrade reaction and bails out immediately in the first step of
1695         the upgrade, WebKit's implementation simply avoids this redundancy in the first place:
1696         https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element
1697
1698         Existing tests such as imported/w3c/web-platform-tests/custom-elements/reactions/Document.html exercises this
1699         code path after the fragment parsing algorithm fix.
1700
1701         Tests: imported/w3c/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html
1702
1703         * dom/CustomElementReactionQueue.cpp:
1704         (WebCore::CustomElementReactionQueueItem::type const): Added for an assertion.
1705         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Enqueue this element to the current element queue
1706         by calling ensureCurrentQueue and avoid inserting a redundant upgrade reaction.
1707         * dom/CustomElementReactionQueue.h:
1708         * dom/Element.cpp:
1709         (WebCore::Element::enqueueToUpgrade): Handle the case when a custom element is enqueued to upgrade for the second
1710         time while it had been waiting in some element queue. In this case, the reaction queue for this element has
1711         already been created and we simply need to put this element back into the current element queue (i.e. this element
1712         now belongs to both element queues).
1713         * html/parser/HTMLConstructionSite.cpp:
1714         (WebCore::findCustomElementInterface): Extracted out of createHTMLElementOrFindCustomElementInterface.
1715         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Fixed the bug that the HTML parser
1716         was synchronously constructing a custom element even for the fragment parsing algorithm.
1717
1718 2018-08-03  Ben Richards  <benton_richards@apple.com>
1719
1720         We should cache the compiled sandbox profile in a data vault
1721         https://bugs.webkit.org/show_bug.cgi?id=184991
1722
1723         Reviewed by Ryosuke Niwa.
1724
1725         Added functionality to FileHandle so that it can lock a file while open.
1726         Added a function to FileSystem to delete non empty directories.
1727
1728         * platform/FileHandle.cpp:
1729         (WebCore::FileHandle::FileHandle):
1730         (WebCore::FileHandle::open):
1731         (WebCore::FileHandle::close):
1732         * platform/FileHandle.h:
1733         * platform/FileSystem.h:
1734         * platform/cocoa/FileSystemCocoa.mm:
1735         (WebCore::FileSystem::deleteNonEmptyDirectory):
1736
1737 2018-08-03  Justin Fan  <justin_fan@apple.com>
1738
1739         WebGL 2 conformance: vertex_arrays/vertex_array_object.html
1740         https://bugs.webkit.org/show_bug.cgi?id=188291
1741         <rdar://problem/42792709>
1742
1743         Reviewed by Dean Jackson.
1744
1745         Get https://www.khronos.org/registry/webgl/conformance-suites/2.0.0/conformance2/vertex_arrays/vertex-array-object.html 
1746         working on Mac OS and iOS, and check in the new test expectations.
1747
1748         Existing test: webgl/2.0.0/conformance2/vertex_arrays/vertex-array-object.html
1749
1750         * html/canvas/WebGL2RenderingContext.cpp:
1751         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
1752         (WebCore::WebGL2RenderingContext::deleteVertexArray):
1753         * html/canvas/WebGLRenderingContextBase.cpp:
1754         (WebCore::WebGLRenderingContextBase::deleteObject):
1755         * html/canvas/WebGLVertexArrayObject.cpp:
1756         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject):
1757         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1758         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
1759         (WebCore::GraphicsContext3D::createVertexArray):
1760         (WebCore::GraphicsContext3D::deleteVertexArray):
1761         (WebCore::GraphicsContext3D::isVertexArray):
1762         (WebCore::GraphicsContext3D::bindVertexArray):
1763
1764 2018-08-03  Sam Weinig  <sam@webkit.org>
1765
1766         Remove WebGPUObject
1767         https://bugs.webkit.org/show_bug.cgi?id=188114
1768
1769         Reviewed by Darin Adler.
1770
1771         This removes the unecessary WebGPUObject base class and updates the classes
1772         that were inheriting from it to instead inherit directly from RefCounted. This
1773         shrinks the size of all the classes that were inheriting from it, as they no
1774         longer store a RefPtr<WebGPURenderingContext> member, which is unused. Most
1775         of the classes also shrink because they can be devirtualized.
1776
1777         This also updates most of the create functions and constructors for the classes
1778         that were inheriting from WebGPUObject to no longer require the WebGPURenderingContext
1779         to be passed in. 
1780         - For WebGPUBuffer, WebGPUCommandQueue, WebGPUComputeCommandEncoder, WebGPUComputePipelineState, 
1781         WebGPUDepthStencilState, WebGPUDrawable, WebGPUFunction, WebGPULibrary, WebGPURenderCommandEncoder, 
1782         WebGPURenderPassDepthAttachmentDescriptor, WebGPURenderPipelineColorAttachmentDescriptor, 
1783         WebGPURenderPipelineState, and WebGPUTexture the WebGPURenderingContext and any other additional 
1784         parameters needed for initialization were replaced with the underlying type (e.g. WebGPUBuffer 
1785         now gets passed a GPUBuffer).
1786         - WebGPUCommandBuffer is passed a GPUCommandQueue, since it needs to construct the underlying
1787         GPUCommandBuffer itself so it can pass in the completion handler.
1788         - For WebGPUDepthStencilDescriptor, WebGPURenderPassAttachmentDescriptor, 
1789         WebGPURenderPassColorAttachmentDescriptor, WebGPURenderPassDescriptor and WebGPURenderPipelineDescriptor
1790         the create and constructor functions are empty.        
1791
1792         * Sources.txt:
1793         * WebCore.xcodeproj/project.pbxproj:
1794         Remove WebGPUObject.h/cpp
1795
1796         * html/canvas/WebGPUBuffer.cpp:
1797         (WebCore::WebGPUBuffer::WebGPUBuffer):
1798         * html/canvas/WebGPUBuffer.h:
1799         * html/canvas/WebGPUBuffer.idl:
1800         Switch from inheriting from WebGPUObject to directly inheriting from 
1801         RefCounted<WebGPUBuffer>. Since this de-virtualizes it, also add 
1802         ImplementationLacksVTable to the IDL file. Also update create 
1803         and constructor to take a GPUBuffer directly, rather than the context.
1804
1805         * html/canvas/WebGPUCommandBuffer.cpp:
1806         (WebCore::WebGPUCommandBuffer::create):
1807         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
1808         Update create and constructor to no longer require a context, as it would
1809         now be unused, as it no longer inherits from WebGPUObject nor needs to hold
1810         onto the context for any reason.
1811
1812         (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
1813         Update to call the new WebGPURenderCommandEncoder::create, which no longer
1814         requires a context.
1815
1816         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
1817         Update to call the new WebGPUComputeCommandEncoder::create, which no longer
1818         requires a context.
1819
1820         * html/canvas/WebGPUCommandBuffer.h:
1821         * html/canvas/WebGPUCommandBuffer.idl:
1822         Switch from inheriting from GPUObject to directly inheriting from 
1823         RefCounted<WebGPUCommandBuffer>. Since this de-virtualizes it, also add 
1824         ImplementationLacksVTable to the IDL file. Also update create and constructor 
1825         to no longer take a context, and just take a GPUCommandQueue. We can't directly
1826         pass a GPUCommandBuffer as WebGPUCommandBuffer needs to pass in a completion handler
1827         on construction of the underlying GPUCommandBuffer.
1828         
1829         * html/canvas/WebGPUCommandQueue.cpp:
1830         (WebCore::WebGPUCommandQueue::WebGPUCommandQueue):
1831         (WebCore::WebGPUCommandQueue::createCommandBuffer):
1832         Update to call the new WebGPUCommandBuffer::create, which no longer
1833         requires a context.
1834     
1835         * html/canvas/WebGPUCommandQueue.h:
1836         * html/canvas/WebGPUCommandQueue.idl:
1837         Switch from inheriting from GPUObject to directly inheriting from 
1838         RefCounted<WebGPUCommandQueue>. Since this de-virtualizes it, also add 
1839         ImplementationLacksVTable to the IDL file. Also update create and
1840         constructor to take a GPUCommandQueue directly.
1841
1842         * html/canvas/WebGPUComputeCommandEncoder.cpp:
1843         (WebCore::WebGPUComputeCommandEncoder::create):
1844         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
1845         * html/canvas/WebGPUComputeCommandEncoder.h:
1846         * html/canvas/WebGPUComputeCommandEncoder.idl:
1847         Switch from inheriting from GPUObject to directly inheriting from 
1848         RefCounted<WebGPUComputeCommandEncoder>. Since this de-virtualizes it, 
1849         also add ImplementationLacksVTable to the IDL file. Also update create and
1850         constructor to take a GPUComputeCommandEncoder directly
1851
1852         * html/canvas/WebGPUComputePipelineState.cpp:
1853         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
1854         * html/canvas/WebGPUComputePipelineState.h:
1855         * html/canvas/WebGPUComputePipelineState.idl:
1856         Switch from inheriting from WebGPUObject to directly inheriting from 
1857         RefCounted<WebGPUComputePipelineState>. Since this de-virtualizes it, also add 
1858         ImplementationLacksVTable to the IDL file. Also update create and
1859         constructor to take a GPUComputePipelineState directly.
1860
1861         * html/canvas/WebGPUDepthStencilDescriptor.cpp:
1862         Remove unneeded include of include "WebGPURenderingContext.h".
1863
1864         * html/canvas/WebGPUDepthStencilDescriptor.h:
1865         * html/canvas/WebGPUDepthStencilDescriptor.idl:
1866         Switch from inheriting from WebGPUObject to directly inheriting from 
1867         RefCounted<WebGPUDepthStencilDescriptor>. Since this de-virtualizes it, also add 
1868         ImplementationLacksVTable to the IDL file.
1869
1870         * html/canvas/WebGPUDepthStencilState.cpp:
1871         (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState):
1872         * html/canvas/WebGPUDepthStencilState.h:
1873         * html/canvas/WebGPUDepthStencilState.idl:
1874         Switch from inheriting from WebGPUObject to directly inheriting from 
1875         RefCounted<WebGPUDepthStencilState>. Since this de-virtualizes it, also add 
1876         ImplementationLacksVTable to the IDL file. Also update create and
1877         constructor to take a GPUDepthStencilState directly.
1878
1879         * html/canvas/WebGPUDrawable.cpp:
1880         (WebCore::WebGPUDrawable::WebGPUDrawable):
1881         * html/canvas/WebGPUDrawable.h:
1882         * html/canvas/WebGPUDrawable.idl:
1883         Switch from inheriting from WebGPUObject to directly inheriting from 
1884         RefCounted<WebGPUDrawable>. Since this de-virtualizes it, also add 
1885         ImplementationLacksVTable to the IDL file. Also update create and
1886         constructor to take a GPUDrawable directly.
1887
1888         * html/canvas/WebGPUFunction.cpp:
1889         (WebCore::WebGPUFunction::create):
1890         (WebCore::WebGPUFunction::WebGPUFunction):
1891         * html/canvas/WebGPUFunction.h:
1892         * html/canvas/WebGPUFunction.idl:
1893         Switch from inheriting from GPUObject to directly inheriting from 
1894         RefCounted<WebGPUFunction>. Since this de-virtualizes it, also add 
1895         ImplementationLacksVTable to the IDL file. Also update create and
1896         constructor to take a GPUFunction directly.
1897
1898         * html/canvas/WebGPULibrary.cpp:
1899         (WebCore::WebGPULibrary::WebGPULibrary):
1900         (WebCore::WebGPULibrary::functionWithName const):
1901         Update for new WebGPUFunction::create, which no longer requires a
1902         context.
1903
1904         * html/canvas/WebGPULibrary.h:
1905         * html/canvas/WebGPULibrary.idl:
1906         Switch from inheriting from WebGPUObject to directly inheriting from 
1907         RefCounted<WebGPULibrary>. Since this de-virtualizes it, also add 
1908         ImplementationLacksVTable to the IDL file. Also update create and
1909         constructor to take a GPULibrary directly, rather than the context.
1910         Unlike the other create functions that take their underlying type, this
1911         one also continues to need the sourceCode String to be passed, as that
1912         is not available from the underlying GPULibrary and must be stored
1913         seperately.
1914
1915         * html/canvas/WebGPUObject.cpp: Removed.
1916         * html/canvas/WebGPUObject.h: Removed.
1917         Deleted.
1918
1919         * html/canvas/WebGPURenderCommandEncoder.cpp:
1920         (WebCore::WebGPURenderCommandEncoder::create):
1921         (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder):
1922         * html/canvas/WebGPURenderCommandEncoder.h:
1923         * html/canvas/WebGPURenderCommandEncoder.idl:
1924         Switch from inheriting from GPUObject to directly inheriting from
1925         RefCounted<WebGPURenderCommandEncoder>. Since this de-virtualizes it, also add
1926         ImplementationLacksVTable to the IDL file. Also update create and
1927         constructor to take a GPURenderCommandEncoder directly.
1928
1929         * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
1930         (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
1931         * html/canvas/WebGPURenderPassAttachmentDescriptor.h:
1932         Switch from inheriting from GPUObject to directly inheriting from 
1933         RefCounted<WebGPURenderPassAttachmentDescriptor>. Also update create and 
1934         constructor to no longer take a context, as it is now not used. This remains virtual
1935         as it is inherited from by WebGPURenderPassColorAttachmentDescriptor and WebGPURenderPassDepthAttachmentDescriptor.
1936
1937         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
1938         (WebCore::WebGPURenderPassColorAttachmentDescriptor::create):
1939         (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor):
1940         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h:
1941         Update create and constructor to no longer take a context, as it is now not used. Declare final
1942         as this is not inherited by anything.
1943
1944         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
1945         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create):
1946         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor):
1947         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h:
1948         Update create and constructor to no longer take a context, as it is now not used. Declare final
1949         as this is not inherited by anything.
1950
1951         * html/canvas/WebGPURenderPassDescriptor.cpp:
1952         (WebCore::WebGPURenderPassDescriptor::depthAttachment):
1953         Update for new WebGPURenderPassDepthAttachmentDescriptor::create function which no longer requires
1954         a context. 
1955         
1956         Semi-interesting note: This function was previously calling "*context()" to pass a WebGPURenderingContext&
1957         to WebGPURenderPassDepthAttachmentDescriptor::create. However, "context()" was always returning null, as
1958         the constructor of WebGPURenderPassDescriptor was not initializing the WebGPUObject with a WebGPURenderingContext.
1959         Now, one might think that this would cause a null-deref, but, because it was being assigned into a 
1960         WebGPURenderingContext&, no dereference happens right away (it essentially just passes a pointer) and since
1961         the function it is being passed to does not use it, it never actually gets dereferenced.
1962
1963         (WebCore::WebGPURenderPassDescriptor::colorAttachments):
1964         Update for new WebGPURenderPassColorAttachmentDescriptor::create function which no longer requires
1965         a context. 
1966
1967         * html/canvas/WebGPURenderPassDescriptor.h:
1968         * html/canvas/WebGPURenderPassDescriptor.idl:
1969         Switch from inheriting from GPUObject to directly inheriting from
1970         RefCounted<WebGPURenderPassDescriptor>. Since this de-virtualizes it, also add
1971         ImplementationLacksVTable to the IDL file.
1972
1973         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
1974         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create):
1975         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor):
1976         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h:
1977         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl:
1978         Switch from inheriting from GPUObject to directly inheriting from
1979         RefCounted<WebGPURenderPipelineColorAttachmentDescriptor>. Since this de-virtualizes it, also add
1980         ImplementationLacksVTable to the IDL file. Also update create and constructor to
1981         no longer take a context, as it is now not used.
1982
1983         * html/canvas/WebGPURenderPipelineDescriptor.cpp:
1984         (WebCore::WebGPURenderPipelineDescriptor::colorAttachments):
1985         Update for new WebGPURenderPipelineColorAttachmentDescriptor::create which no longer requires
1986         a context.
1987
1988         * html/canvas/WebGPURenderPipelineDescriptor.h:
1989         * html/canvas/WebGPURenderPipelineDescriptor.idl:
1990         Switch from inheriting from GPUObject to directly inheriting from
1991         RefCounted<WebGPURenderPipelineDescriptor>. Since this de-virtualizes it, also add
1992         ImplementationLacksVTable to the IDL file.
1993
1994         * html/canvas/WebGPURenderPipelineState.cpp:
1995         (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState):
1996         * html/canvas/WebGPURenderPipelineState.h:
1997         * html/canvas/WebGPURenderPipelineState.idl:
1998         Switch from inheriting from GPUObject to directly inheriting from
1999         RefCounted<WebGPURenderPipelineState>. Since this de-virtualizes it, also add
2000         ImplementationLacksVTable to the IDL file. Also update create and
2001         constructor to take a GPURenderPipelineState directly.
2002
2003         * html/canvas/WebGPURenderingContext.cpp:
2004         (WebCore::WebGPURenderingContext::createLibrary):
2005         (WebCore::WebGPURenderingContext::createRenderPipelineState):
2006         (WebCore::WebGPURenderingContext::createDepthStencilState):
2007         (WebCore::WebGPURenderingContext::createComputePipelineState):
2008         (WebCore::WebGPURenderingContext::createCommandQueue):
2009         (WebCore::WebGPURenderingContext::nextDrawable):
2010         (WebCore::WebGPURenderingContext::createBuffer):
2011         (WebCore::WebGPURenderingContext::createTexture):
2012         Update for new create functions which require the caller to pass
2013         the underlying type.
2014
2015         * html/canvas/WebGPUTexture.cpp:
2016         (WebCore::WebGPUTexture::createFromDrawableTexture):
2017         Renamed to create.
2018
2019         (WebCore::WebGPUTexture::create): Deleted
2020         All callers now pass a GPUTexture directly.
2021
2022         * html/canvas/WebGPUTexture.h:
2023         * html/canvas/WebGPUTexture.idl:
2024         Switch from inheriting from GPUObject to directly inheriting from
2025         RefCounted<WebGPUTexture>. Since this de-virtualizes it, also add
2026         ImplementationLacksVTable to the IDL file. 
2027
2028         * html/canvas/WebGPUTextureDescriptor.h:
2029         * html/canvas/WebGPUTextureDescriptor.idl:
2030         Switch from inheriting from GPUObject to directly inheriting from
2031         RefCounted<WebGPUTextureDescriptor>. Since this de-virtualizes it, also add
2032         ImplementationLacksVTable to the IDL file.
2033
2034 2018-08-03  Alex Christensen  <achristensen@webkit.org>
2035
2036         Fix spelling of "overridden"
2037         https://bugs.webkit.org/show_bug.cgi?id=188315
2038
2039         Reviewed by Darin Adler.
2040
2041         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2042         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
2043         (-[WebAccessibilityObjectWrapper accessibilityValue]):
2044         * contentextensions/ContentExtensionsBackend.h:
2045         * editing/EditingStyle.cpp:
2046         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
2047         * inspector/CommandLineAPIModuleSource.js:
2048         * platform/ScrollView.h:
2049         * platform/ScrollableArea.h:
2050         * platform/mediasession/MediaSessionInterruptionProvider.h:
2051         * rendering/RenderFragmentedFlow.cpp:
2052         (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
2053         * rendering/RenderLayer.h:
2054         * rendering/RenderListBox.h:
2055         * rendering/svg/RenderSVGResourceClipper.cpp:
2056         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2057         * svg/SVGElement.cpp:
2058         (WebCore::SVGElement::localCoordinateSpaceTransform const):
2059         * svg/SVGLengthContext.cpp:
2060         (WebCore::SVGLengthContext::SVGLengthContext):
2061         (WebCore::SVGLengthContext::convertValueToUserUnits const):
2062         (WebCore::SVGLengthContext::determineViewport const):
2063         * svg/SVGLengthContext.h:
2064
2065 2018-08-03  Zalan Bujtas  <zalan@apple.com>
2066
2067         [LFC][BFC] Special case the document renderer when computing the height and margin
2068         https://bugs.webkit.org/show_bug.cgi?id=188313
2069
2070         Reviewed by Antti Koivisto.
2071
2072         The document renderer is certainly special and its geometry is likely to be computed as part of "10.6.6 Complicated cases" (spec is unclear) but probably not by
2073         making the it a formatting root. Let's just special case it at contentHeightForFormattingContextRoot(), since having the document renderer as a context root has unwanted side effect. 
2074
2075         * layout/FormattingContextGeometry.cpp:
2076         (WebCore::Layout::contentHeightForFormattingContextRoot):
2077         * layout/layouttree/LayoutBox.cpp:
2078         (WebCore::Layout::Box::establishesBlockFormattingContext const):
2079
2080 2018-08-03  Zalan Bujtas  <zalan@apple.com>
2081
2082         [LFC][BFC] Layout out-of-flow descendants only on the formatting context root.
2083         https://bugs.webkit.org/show_bug.cgi?id=188312
2084
2085         Reviewed by Antti Koivisto.
2086
2087         Collect out-of-flow descendants on the formatting root container instead of the containing block and run layout on them on the root level. It's more efficient this way.
2088
2089         * layout/blockformatting/BlockFormattingContext.cpp:
2090         (WebCore::Layout::BlockFormattingContext::layout const):
2091         * layout/layouttree/LayoutTreeBuilder.cpp:
2092         (WebCore::Layout::TreeBuilder::createSubTree):
2093
2094 2018-08-03  Andy Estes  <aestes@apple.com>
2095
2096         ContentFilterUnblockHandler's constructors access moved-from variables
2097         https://bugs.webkit.org/show_bug.cgi?id=188308
2098         <rdar://problem/42882758>
2099
2100         Reviewed by Alex Christensen.
2101
2102         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2103
2104 2018-08-03  Zalan Bujtas  <zalan@apple.com>
2105
2106         [LFC][Floating] Now that the document renderer belongs to "complicated cases", adjust viewport stretching.
2107         https://bugs.webkit.org/show_bug.cgi?id=188306
2108
2109         Reviewed by Antti Koivisto.
2110
2111         And add passing cases for floats.
2112
2113         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2114         (WebCore::Layout::initialContainingBlock):
2115         (WebCore::Layout::isStretchedToInitialContainingBlock):
2116         (WebCore::Layout::stretchHeightToInitialContainingBlock):
2117         (WebCore::Layout::stretchWidthToInitialContainingBlock):
2118         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2119         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2120         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2121         (WebCore::Layout::isStretchedToViewport): Deleted.
2122
2123 2018-08-03  Zalan Bujtas  <zalan@apple.com>
2124
2125         [LFC] Do not check margin box while validating geometry.
2126         https://bugs.webkit.org/show_bug.cgi?id=188297
2127
2128         Reviewed by Antti Koivisto.
2129
2130         The current RenderBox::marginBox implementation is not spec compliant. Ignore it for now.
2131
2132         * layout/Verification.cpp:
2133         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2134
2135 2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2136
2137         [WPE] Use WPE key symbols and new API instead of xkbcommon and the key mapper
2138         https://bugs.webkit.org/show_bug.cgi?id=188093
2139
2140         Reviewed by Žan Doberšek.
2141
2142         Add helper functions to get key code, hardware key code, key identifier and windows key code from a WPE key symbol.
2143
2144         * platform/PlatformKeyboardEvent.h:
2145         * platform/wpe/PlatformKeyboardEventWPE.cpp:
2146         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
2147         (WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode):
2148         (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode):
2149         (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode):
2150         (WebCore::PlatformKeyboardEvent::singleCharacterString):
2151
2152 2018-08-02  Ryosuke Niwa  <rniwa@webkit.org>
2153
2154         Release assert when throwing exceptions in custom element reactions
2155         https://bugs.webkit.org/show_bug.cgi?id=187805
2156         <rdar://problem/42432714>
2157
2158         Reviewed by Saam Barati.
2159
2160         The release assertion was hit because we were not catching & re-throwing the exception thrown by DOM API
2161         before trying to execute custom elements reactions in ~CustomElementReactionStack as specified here:
2162         https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions
2163         Fixed the bug by capturing the exception and re-throwing the exception as specified.
2164
2165         Tests: imported/w3c/web-platform-tests/custom-elements/reactions/with-exceptions.html
2166
2167         * bindings/js/JSMainThreadExecState.h:
2168         (WebCore::JSMainThreadNullState::JSMainThreadNullState): Use the previous JS state.
2169         * bindings/scripts/CodeGeneratorJS.pm:
2170         (GeneratePut): Pass in the exec state to CustomElementReactionStack.
2171         (GeneratePutByIndex): Ditto.
2172         (GenerateDefineOwnProperty): Ditto.
2173         (GenerateDeletePropertyCommon): Ditto.
2174         (GenerateAttributeSetterBodyDefinition): Ditto.
2175         (GenerateOperationBodyDefinition): Ditto.
2176         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2177         (WebCore::setJSTestCEReactionsAttributeWithCEReactionsSetter):
2178         (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsSetter):
2179         (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody):
2180         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2181         (WebCore::setJSTestCEReactionsStringifierValueSetter):
2182         * dom/CustomElementReactionQueue.cpp:
2183         (WebCore::CustomElementReactionQueue::ElementQueue::processQueue): Added. If there is a script running
2184         in the stack (i.e. ExecState is not null), catch any exception before executing custom element reactions,
2185         then re-throw the exception afterwards. ExecState is null when DOM API is invoked via Objective-C bindings
2186         or when custom element reactions are executed in the backup queue (e.g. for editing operations).
2187         (WebCore::CustomElementReactionStack::processQueue):
2188         (WebCore::CustomElementReactionQueue::processBackupQueue):
2189         * dom/CustomElementReactionQueue.h:
2190         (WebCore::CustomElementReactionStack::CustomElementReactionStack):
2191         (WebCore::CustomElementReactionStack::~CustomElementReactionStack):
2192
2193 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2194
2195         [LFC][BFC] Apply the "10.6.6 Complicated cases" when computing height and margin for the document renderer
2196         https://bugs.webkit.org/show_bug.cgi?id=188296
2197
2198         Reviewed by Simon Fraser.
2199
2200         The spec is not clear about what to do with the document renderer. It behaves as if it was a formatting context root when
2201         it comes to computing the content height. Let's apply "10.6.6 Complicated cases" for now.
2202
2203         * layout/FormattingContext.h:
2204         * layout/FormattingContextGeometry.cpp:
2205         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2206         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2207         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin): Deleted.
2208         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2209         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2210         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2211         * layout/layouttree/LayoutBox.cpp:
2212         (WebCore::Layout::Box::establishesBlockFormattingContext const):
2213         * layout/layouttree/LayoutBox.h:
2214
2215 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2216
2217         [LFC][Floating] Add FloatingState::bottom() to enable content height computation for formatting roots.
2218         https://bugs.webkit.org/show_bug.cgi?id=188294
2219
2220         Reviewed by Simon Fraser.
2221
2222         "10.6.7 'Auto' heights for block formatting context roots
2223         ...
2224         In addition, if the element has any floating descendants whose bottom margin edge is below the element's bottom content edge,
2225         then the height is increased to include those edges. Only floats that participate in this block formatting context are taken into
2226         account, e.g., floats inside absolutely positioned descendants or other floats are not..."
2227
2228         * layout/FloatingState.cpp:
2229         (WebCore::Layout::FloatingState::bottom const):
2230         * layout/FloatingState.h:
2231         * layout/FormattingContextGeometry.cpp:
2232         (WebCore::Layout::contentHeightForFormattingContextRoot):
2233
2234 2018-08-02  Jer Noble  <jer.noble@apple.com>
2235
2236         Control center controls disappear when pausing, locking device.
2237         https://bugs.webkit.org/show_bug.cgi?id=188282
2238         <rdar://problem/42497809>
2239
2240         Reviewed by Eric Carlson.
2241
2242         Test: platform/mac/media/audio-session-category-video-paused.html
2243
2244         MediaRemote will set any app whose audio session category changes from MediaPlayback to
2245         Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of
2246         events, we never moved from MediaPlayback to Ambient when pausing <video>, even though that
2247         was the intention. Now that that bug is fixed, it exposed this new issue with MediaRemote.
2248
2249         To solve the new issue, make our audio session category policy more explicit: once we are in
2250         MediaPlayback category, we will remain so as long as the media element in queston stays
2251         loaded, has played, and is never interrupted by the system.
2252
2253         Make MediaSessionManagerCocoa a proper subclass of PlatformMediaSessionManager, and make
2254         MediaSessionManageriOS and -Mac subclasses of the -Cocoa class. Add a new
2255         m_hasPlayedSinceLastInterruption ivar to PlatformMediaSession, set when the state() changes
2256         to Playing, and cleared during an interruption. Check this flag when deciding what audio 
2257         sessino category to set in MediaSessionManagerCocoa.
2258
2259         * WebCore.xcodeproj/project.pbxproj:
2260         * platform/audio/PlatformMediaSession.cpp:
2261         (WebCore::PlatformMediaSession::setState):
2262         * platform/audio/PlatformMediaSession.h:
2263         (WebCore::PlatformMediaSession::hasPlayedSinceLastInterruption const):
2264         (WebCore::PlatformMediaSession::clearHasPlayedSinceLastInterruption):
2265         * platform/audio/PlatformMediaSessionManager.cpp:
2266         (WebCore::PlatformMediaSessionManager::updateSessionState): Deleted.
2267         * platform/audio/PlatformMediaSessionManager.h:
2268         (WebCore::PlatformMediaSessionManager::audioHardwareListener):
2269         (WebCore::PlatformMediaSessionManager::updateSessionState):
2270         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
2271         (MediaSessionManagerCocoa::updateSessionState):
2272         (MediaSessionManagerCocoa::beginInterruption):
2273         (PlatformMediaSessionManager::updateSessionState): Deleted.
2274         * platform/audio/cocoa/MediaSessionManagerCocoa.h: Added.
2275         * platform/audio/ios/MediaSessionManagerIOS.h:
2276         * platform/audio/ios/MediaSessionManagerIOS.mm:
2277         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
2278         * platform/audio/mac/MediaSessionManagerMac.h:
2279         * platform/audio/mac/MediaSessionManagerMac.mm:
2280         (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
2281
2282 2018-08-02  Nan Wang  <n_wang@apple.com>
2283
2284         AX: [iOS] add support to return the attributed string under the element
2285         https://bugs.webkit.org/show_bug.cgi?id=188276
2286         <rdar://problem/42872357>
2287
2288         Reviewed by Chris Fleizach.
2289
2290         Provided a way on iOS to return the attributed string under the element for 
2291         better performance.
2292
2293         Test: accessibility/ios-simulator/attributed-string-for-element.html
2294
2295         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2296         (-[WebAccessibilityObjectWrapper _stringFromStartMarker:toEndMarker:attributed:]):
2297         (-[WebAccessibilityObjectWrapper _stringForRange:attributed:]):
2298         (-[WebAccessibilityObjectWrapper attributedStringForElement]):
2299
2300 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2301
2302         [LFC][Floating] Remove redundant LayoutContext member variable.
2303         https://bugs.webkit.org/show_bug.cgi?id=188286
2304
2305         Reviewed by Simon Fraser.
2306
2307         * layout/FloatingContext.cpp:
2308         (WebCore::Layout::begin):
2309         (WebCore::Layout::end):
2310         (WebCore::Layout::FloatingContext::floatingPosition const):
2311         (WebCore::Layout::FloatingPair::FloatingPair):
2312         (WebCore::Layout::Iterator::Iterator):
2313
2314 2018-08-02  Ryosuke Niwa  <rniwa@webkit.org>
2315
2316         Move queue processing logic from CustomElementReactionStack to CustomElementReactionQueue
2317         https://bugs.webkit.org/show_bug.cgi?id=188277
2318
2319         Reviewed by Wenson Hsieh.
2320
2321         Moved ensureCurrentQueue, processBackupQueue, ElementQueue, ensureBackupQueue, and backupElementQueue
2322         from CustomElementReactionStack to CustomElementReactionQueue to simplify CustomElementReactionStack.
2323
2324         No new tests since there is no behavior change.
2325
2326         * dom/CustomElementReactionQueue.cpp:
2327         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
2328         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
2329         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
2330         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
2331         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
2332         (WebCore::CustomElementReactionQueue::ElementQueue::add): Moved from CustomElementReactionStack.
2333         (WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Ditto.
2334         (WebCore::CustomElementReactionQueue::ensureCurrentQueue): Ditto.
2335         (WebCore::CustomElementReactionQueue::ensureBackupQueue): Ditto.
2336         (WebCore::CustomElementReactionQueue::processBackupQueue): Ditto.
2337         (WebCore::CustomElementReactionQueue::backupElementQueue): Ditto.
2338         * dom/CustomElementReactionQueue.h:
2339         (WebCore::CustomElementReactionStack::hasCurrentProcessingStack): Deleted. It was never called.
2340
2341 2018-08-02  Timothy Hatcher  <timothy@apple.com>
2342
2343         Text selection color is hard to see in dark mode web views.
2344         https://bugs.webkit.org/show_bug.cgi?id=188260
2345         rdar://problem/42721294
2346
2347         Reviewed by Simon Fraser.
2348
2349         Stop using blendWithWhite() to transform the AppKit selection color in dark mode.
2350         Using an alpha of 80% gives good contrast, and still works good for selections over images.
2351
2352         * platform/graphics/Color.cpp:
2353         (WebCore::Color::blendWithWhite const): Mark new colors as semantic if the original is.
2354         (WebCore::Color::colorWithAlpha const): Ditto.
2355         * rendering/RenderElement.cpp:
2356         (WebCore::RenderElement::selectionBackgroundColor const): Use transformSelectionBackgroundColor.
2357         * rendering/RenderTheme.cpp:
2358         (WebCore::RenderTheme::activeSelectionBackgroundColor const): Use transformSelectionBackgroundColor.
2359         (WebCore::RenderTheme::inactiveSelectionBackgroundColor const): Ditto.
2360         (WebCore::RenderTheme::transformSelectionBackgroundColor const): Added. Just blend with white.
2361         * rendering/RenderTheme.h:
2362         * rendering/RenderThemeMac.h:
2363         * rendering/RenderThemeMac.mm:
2364         (WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Added. Use an alpha with the color
2365         in dark mode, otherwise fallback to RenderTheme.
2366         (WebCore::RenderThemeMac::systemColor const): Use activeListBoxSelectionBackgroundColor()
2367         and activeSelectionBackgroundColor() instead of caching the colors again. Update hardcoded color.
2368
2369 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2370
2371         [LFC][Floating] Use displayBox.rectWithMargin().bottom instead of displayBox.bottom() to where applicable.
2372         https://bugs.webkit.org/show_bug.cgi?id=188274
2373
2374         Reviewed by Antti Koivisto.
2375
2376         Float placement uses the margin box.
2377
2378         * layout/FloatingContext.cpp:
2379         (WebCore::Layout::FloatingPair::bottom const):
2380         (WebCore::Layout::Iterator::operator++):
2381         (WebCore::Layout::Iterator::set):
2382
2383 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2384
2385         [LFC][Floating] Right aligned float's horizontal candidate position is miscomputed.
2386         https://bugs.webkit.org/show_bug.cgi?id=188273
2387
2388         Reviewed by Antti Koivisto.
2389
2390         rightAlignedBoxLeft is already shifted with the size of the margin box.
2391
2392         * layout/FloatingContext.cpp:
2393         (WebCore::Layout::FloatingContext::alignWithFloatings const):
2394
2395 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2396
2397         [LFC] Display:Box::rectWithMargin()'s width and height don't include margin left/top.
2398         https://bugs.webkit.org/show_bug.cgi?id=188272
2399
2400         Reviewed by Antti Koivisto.
2401
2402         * layout/displaytree/DisplayBox.h:
2403         (WebCore::Display::Box::rectWithMargin const):
2404
2405 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2406
2407         [LFC][Floating] Containing block of a float could push the candidate position beyond the current float.
2408         https://bugs.webkit.org/show_bug.cgi?id=188264
2409
2410         Reviewed by Antti Koivisto.
2411
2412         <div id=first style="float: left; width: 100px; height: 10px;"></div>
2413         <div id=second style="float: left; width: 10px; height: 10px;"></div>
2414         <div style="width: 50px; height: 50px;>
2415             <div id=third style="float: left; width: 10px; height: 10px;"></div>
2416         </div>
2417         In the example above by the time the "third" float comes in, we are already at 110px horizontally. However the containing block of the "third" float forces
2418         the candidate position at 0px. In such cases intersecting won't work since the candidate position is beyond the last(second) float (horizontally).
2419         We could either keep going back to the previous floats on this vertical position and eventually intersect with "first" or just compare the horizontal
2420         positions and ensure that the left/right float is not going to be placed to the left/right of the last float on the current vertical position.
2421
2422         * layout/FloatingContext.cpp:
2423         (WebCore::Layout::FloatingPair::intersects const):
2424
2425 2018-08-01  Ryosuke Niwa  <rniwa@webkit.org>
2426
2427         Implement customElements.upgrade()
2428         https://bugs.webkit.org/show_bug.cgi?id=183397
2429
2430         Reviewed by Frédéric Wang.
2431
2432         Added the support to upgrade custom elements directly. Ordinarily, custom elements get upgraded as they are
2433         inserted / connected into a document but some script libraries and authors want to be able to upgrade them before that.
2434         Also see https://github.com/w3c/webcomponents/issues/710
2435
2436         Implemented the method as specified at:
2437         https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-upgrade
2438
2439             When invoked, the upgrade(root) method must run these steps:
2440             1. Let candidates be a list of all of root's shadow-including inclusive descendant elements,
2441                in shadow-including tree order.
2442             2. For each candidate of candidates, try to upgrade candidate.
2443
2444         Tests: imported/w3c/web-platform-tests/custom-elements/custom-element-registry/upgrade.html
2445
2446         * dom/CustomElementReactionQueue.cpp:
2447         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Removed the assertion that the upgraded element
2448         is connected since the whole point of this API is to upgrade a disconnected element.
2449         * dom/CustomElementRegistry.cpp:
2450         (WebCore::upgradeElementsInShadowIncludingdescendants): Added.
2451         (WebCore::CustomElementRegistry::upgrade): Added.
2452         * dom/CustomElementRegistry.h: Forward declare DeferredPromise instead of unnecessarily including JSDOMPromiseDeferred.h.
2453         * dom/CustomElementRegistry.idl:
2454         * dom/Element.cpp:
2455         (WebCore::Element::insertedIntoAncestor): Moved the assertion here.
2456
2457 2018-08-02  Simon Fraser  <simon.fraser@apple.com>
2458
2459         Convert calc-related enums to 8-bit enum classes
2460         https://bugs.webkit.org/show_bug.cgi?id=188215
2461
2462         Reviewed by Zalan Bujtas.
2463
2464         This shrinks CSSCalcOperation from 48 to 32 bytes.
2465
2466         * css/CSSCalculationValue.cpp:
2467         (WebCore::unitCategory):
2468         (WebCore::determineCategory):
2469         (WebCore::resolvedTypeForMinOrMax):
2470         (WebCore::isIntegerResult):
2471         (WebCore::CSSCalcExpressionNodeParser::parseValue):
2472         (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
2473         (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
2474         (WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
2475         (WebCore::createBlendHalf):
2476         (WebCore::createCSS):
2477         * css/CSSCalculationValue.h:
2478         * css/CSSPrimitiveValue.cpp:
2479         (WebCore::CSSPrimitiveValue::primitiveType const):
2480         * css/StyleBuilderConverter.h:
2481         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
2482         * css/parser/CSSPropertyParserHelpers.cpp:
2483         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumberRaw):
2484         (WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
2485         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2486         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
2487         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
2488         (WebCore::CSSPropertyParserHelpers::consumeNumber):
2489         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2490         (WebCore::CSSPropertyParserHelpers::consumeLength):
2491         (WebCore::CSSPropertyParserHelpers::consumePercent):
2492         (WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
2493         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
2494         (WebCore::CSSPropertyParserHelpers::consumeAngle):
2495         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2496         (WebCore::CSSPropertyParserHelpers::consumeTime):
2497         * platform/CalculationValue.cpp:
2498         (WebCore::CalcExpressionNumber::operator== const):
2499         (WebCore::CalcExpressionOperation::evaluate const):
2500         (WebCore::CalcExpressionOperation::operator== const):
2501         (WebCore::CalcExpressionOperation::dump const):
2502         (WebCore::CalcExpressionLength::operator== const):
2503         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
2504         (WebCore::CalcExpressionBlendLength::operator== const):
2505         (WebCore::operator<<):
2506         * platform/CalculationValue.h:
2507         (WebCore::CalcExpressionNumber::CalcExpressionNumber):
2508         (WebCore::toCalcExpressionNumber):
2509         (WebCore::CalcExpressionLength::CalcExpressionLength):
2510         (WebCore::toCalcExpressionLength):
2511         (WebCore::CalcExpressionOperation::CalcExpressionOperation):
2512         (WebCore::toCalcExpressionOperation):
2513         (WebCore::toCalcExpressionBlendLength):
2514         * platform/Length.cpp:
2515         (WebCore::convertTo100PercentMinusLength):
2516
2517 2018-08-02  Charlie Turner  <cturner@igalia.com>
2518
2519         Handle zero-sized ISOMP4 boxes appropriately
2520         https://bugs.webkit.org/show_bug.cgi?id=188256
2521
2522         Reviewed by Jer Noble.
2523
2524         According to ISO/IEC 14496-12:2012(E), when the Box classes' size
2525         field is zero, the implied size of the box extends to the end of
2526         the file. If this detail is not taken into account, CENC
2527         sanitization can incorrectly report an invalid box size, since 0
2528         != the number of bytes in this box, specifically, the data layout
2529         of Box is as follows,
2530
2531         aligned(8) class Box (unsigned int(32) boxtype,
2532               optional unsigned int(8)[16] extended_type) {
2533            unsigned int(32) size;
2534            unsigned int(32) type = boxtype;
2535            if (size==1) {
2536              unsigned int(64) largesize;
2537            } else if (size==0) { // This is the case now handled.
2538              // box extends to end of file
2539            }
2540            if (boxtype==‘uuid’) {
2541              unsigned int(8)[16] usertype = extended_type;
2542            }
2543         }
2544
2545         Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
2546
2547         * platform/graphics/iso/ISOBox.cpp:
2548         (WebCore::ISOBox::peekBox): Check if the parsed size is zero, and
2549         if it is, the size is calculated as the total number of bytes in
2550         the incoming DataView.
2551         (WebCore::ISOBox::parse): Ditto.
2552
2553 2018-08-01  Dan Bernstein  <mitz@apple.com>
2554
2555         Optionally expose Attr::style to JavaScript
2556         https://bugs.webkit.org/show_bug.cgi?id=188226
2557         <rdar://problem/42818113>
2558
2559         Reviewed by Darin Adler.
2560
2561         Test: TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm
2562
2563         * dom/Attr.cpp: Update comment.
2564         * dom/Attr.idl: Define the style attribute, enabled at runtime by the AttrStyle feature.
2565
2566         * page/RuntimeEnabledFeatures.h:
2567         (WebCore::RuntimeEnabledFeatures::setAttrStyleEnabled): Added this accessor.
2568         (WebCore::RuntimeEnabledFeatures::attrStyleEnabled const): Ditto.
2569
2570 2018-08-02  David Fenton  <david_fenton@apple.com>
2571
2572         Unreviewed, rolling out r234489.
2573
2574         Caused 50+ crashes and 60+ API failures on iOS
2575
2576         Reverted changeset:
2577
2578         "[WTF] Rename String::format to String::deprecatedFormat"
2579         https://bugs.webkit.org/show_bug.cgi?id=188191
2580         https://trac.webkit.org/changeset/234489
2581
2582 2018-08-02  Zalan Bujtas  <zalan@apple.com>
2583
2584         [LFC][Floating] Do not pass formatting root to FloatingContext
2585         https://bugs.webkit.org/show_bug.cgi?id=188257
2586
2587         Reviewed by Antti Koivisto.
2588
2589         If we ever need it, we can get it from FloatingState.
2590
2591         * layout/FloatingContext.cpp:
2592         (WebCore::Layout::FloatingContext::FloatingContext):
2593         * layout/FloatingContext.h:
2594         * layout/blockformatting/BlockFormattingContext.cpp:
2595         (WebCore::Layout::BlockFormattingContext::layout const):
2596
2597 2018-08-01  Zalan Bujtas  <zalan@apple.com>
2598
2599         [LFC][Floating] Convert all coordinates relative to the formatting context root.
2600         https://bugs.webkit.org/show_bug.cgi?id=188249
2601
2602         Reviewed by Antti Koivisto.
2603
2604         The idea here is that all the float related computation should be happening in the same coordinate system.
2605         FloatItem holds the transformed Display::Box for both the layout box and its containing block. 
2606
2607         * layout/FloatingContext.cpp:
2608         (WebCore::Layout::begin):
2609         (WebCore::Layout::end):
2610         (WebCore::Layout::FloatingContext::computePosition const):
2611         (WebCore::Layout::FloatingContext::floatingPosition const):
2612         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
2613         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
2614         (WebCore::Layout::FloatingContext::alignWithFloatings const):
2615         (WebCore::Layout::FloatingContext::toContainingBlock const):
2616         (WebCore::Layout::FloatingPair::FloatingPair):
2617         (WebCore::Layout::FloatingPair::left const):
2618         (WebCore::Layout::FloatingPair::right const):
2619         (WebCore::Layout::Iterator::Iterator):
2620         (WebCore::Layout::previousFloatingIndex):
2621         (WebCore::Layout::Iterator::operator++):
2622         (WebCore::Layout::Iterator::set):
2623         * layout/FloatingContext.h:
2624         * layout/FloatingState.cpp:
2625         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
2626         (WebCore::Layout::FloatingState::remove):
2627         (WebCore::Layout::FloatingState::append):
2628         * layout/FloatingState.h:
2629         (WebCore::Layout::FloatingState::isEmpty const):
2630         (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
2631         (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
2632         (WebCore::Layout::FloatingState::FloatItem::displayBox const):
2633         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
2634         (WebCore::Layout::FloatingState::floats const):
2635         (WebCore::Layout::FloatingState::last const):
2636         (WebCore::Layout::FloatingState::root const):
2637         (WebCore::Layout::FloatingState::floatings const): Deleted.
2638         * layout/displaytree/DisplayBox.h:
2639
2640 2018-08-02  Charlie Turner  <cturner@igalia.com>
2641
2642         [GStreamer] Dynamically adjust blocksize
2643         https://bugs.webkit.org/show_bug.cgi?id=188194
2644
2645         Reviewed by Xabier Rodriguez-Calvar.
2646
2647         Update the blocksize depending on how much is obtained from a read
2648         of the input stream. This avoids doing too many reads in small
2649         chunks when larger amounts of data are available and also prevents
2650         using a very large memory area to read a small chunk of data.
2651
2652         Adapted from https://bugzilla.gnome.org/show_bug.cgi?id=767833
2653
2654         No tests new tests since no change in functionality.
2655
2656         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2657         (webkit_web_src_init):
2658         (CachedResourceStreamingClient::checkUpdateBlocksize):
2659         (CachedResourceStreamingClient::dataReceived):
2660
2661 2018-08-02  Charlie Turner  <cturner@igalia.com>
2662
2663         [GStreamer] Stop pushing buffers when seeking status changes
2664         https://bugs.webkit.org/show_bug.cgi?id=188193
2665
2666         Reviewed by Xabier Rodriguez-Calvar.
2667
2668         After switching to splitting buffers into smaller block sizes in
2669
2670             https://bugs.webkit.org/show_bug.cgi?id=182829
2671
2672         It was found that during the individual buffer pushes, the seeking
2673         status could change behind our backs from another thread. When
2674         this happens, buffers from incorrect offsets would find their way
2675         into appsrc and eventually the demuxer itself, which would start
2676         parsing from a random place and at best give a confusing error
2677         message.
2678
2679         The solution here is break from pushing buffers when the seeking
2680         status has been has changed. Flushes will clear out what we've
2681         already delivered into the appsrc, then we must make sure to not
2682         continue sending buffers in there after the flush.
2683
2684         No new tests since this is a timing bug.
2685
2686         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2687         (CachedResourceStreamingClient::dataReceived):
2688
2689 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2690
2691         Unreviewed, revert TransformationMatrix::operator== change
2692         https://bugs.webkit.org/show_bug.cgi?id=188197
2693
2694         This change partially revert cleaning up of TransformationMatrix since memcmp does not
2695         follow double comparison algorithm. So semantics was accidentally changed.
2696
2697         * platform/graphics/transforms/TransformationMatrix.h:
2698         (WebCore::TransformationMatrix::operator== const):
2699
2700 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2701
2702         Unreviewed, rename TransformationMatrix::Identity to TransformationMatrix::identity
2703         https://bugs.webkit.org/show_bug.cgi?id=188204
2704
2705         Follow the coding style.
2706
2707         * platform/graphics/GraphicsLayer.cpp:
2708         (WebCore::GraphicsLayer::transform const):
2709         (WebCore::GraphicsLayer::childrenTransform const):
2710         * platform/graphics/transforms/TransformationMatrix.cpp:
2711         * platform/graphics/transforms/TransformationMatrix.h:
2712
2713 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2714
2715         Add self.queueMicrotask(f) on DOMWindow
2716         https://bugs.webkit.org/show_bug.cgi?id=188212
2717
2718         Reviewed by Ryosuke Niwa.
2719
2720         This patch adds self.queueMicrotask(f) in DOMWindow, which takes a function and enqueue it into microtask queue.
2721         We do not add this to Worker's global scope since our worker does not support microtasks correctly.
2722
2723         Tests: js/dom/queue-microtask-window.html
2724
2725         * bindings/js/JSDOMWindowCustom.cpp:
2726         (WebCore::JSDOMWindow::queueMicrotask):
2727         Post a microtask to JSC's microtask mechanism. This will eventually go to WebCore's MicrotaskQueue code.
2728
2729         * page/DOMWindow.idl:
2730
2731 2018-08-01  Tomas Popela  <tpopela@redhat.com>
2732
2733         [WTF] Rename String::format to String::deprecatedFormat
2734         https://bugs.webkit.org/show_bug.cgi?id=188191
2735
2736         Reviewed by Darin Adler.
2737
2738         It should be replaced with string concatenation.
2739
2740         * Modules/indexeddb/IDBKeyData.cpp:
2741         (WebCore::IDBKeyData::loggingString const):
2742         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2743         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2744         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
2745         (WebCore::IDBCursorInfo::loggingString const):
2746         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
2747         (WebCore::IDBGetAllRecordsData::loggingString const):
2748         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
2749         (WebCore::IDBGetRecordData::loggingString const):
2750         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
2751         (WebCore::IDBIndexInfo::loggingString const):
2752         (WebCore::IDBIndexInfo::condensedLoggingString const):
2753         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
2754         (WebCore::IDBIterateCursorData::loggingString const):
2755         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
2756         (WebCore::IDBObjectStoreInfo::condensedLoggingString const):
2757         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2758         (WebCore::IDBResourceIdentifier::loggingString const):
2759         * Modules/webdatabase/Database.cpp:
2760         (WebCore::formatErrorMessage):
2761         * Modules/webdatabase/SQLError.h:
2762         (WebCore::SQLError::create):
2763         * Modules/websockets/WebSocket.cpp:
2764         (WebCore::encodeProtocolString):
2765         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
2766         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
2767         * css/CSSUnicodeRangeValue.cpp:
2768         (WebCore::CSSUnicodeRangeValue::customCSSText const):
2769         * css/MediaQueryEvaluator.cpp:
2770         (WebCore::aspectRatioValueAsString):
2771         * css/parser/CSSParserToken.cpp:
2772         (WebCore::CSSParserToken::serialize const):
2773         * css/parser/CSSPropertyParserHelpers.cpp:
2774         (WebCore::CSSPropertyParserHelpers::parseHexColor):
2775         * dom/Document.cpp:
2776         (WebCore::Document::lastModified):
2777         * html/FTPDirectoryDocument.cpp:
2778         (WebCore::processFilesizeString):
2779         (WebCore::processFileDateString):
2780         * html/HTMLMediaElement.h:
2781         (WTF::ValueToString<WebCore::TextTrackCue::string):
2782         * html/HTMLSelectElement.cpp:
2783         (WebCore::HTMLSelectElement::setLength):
2784         * html/ImageDocument.cpp:
2785         (WebCore::ImageDocument::imageUpdated):
2786         * html/canvas/WebGLRenderingContextBase.cpp:
2787         * html/parser/XSSAuditor.cpp:
2788         (WebCore::XSSAuditor::init):
2789         * html/track/VTTCue.cpp:
2790         (WebCore::VTTCueBox::applyCSSProperties):
2791         * inspector/InspectorFrontendClientLocal.cpp:
2792         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable):
2793         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
2794         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled):
2795         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled):
2796         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
2797         * inspector/agents/InspectorCSSAgent.cpp:
2798         * inspector/agents/InspectorIndexedDBAgent.cpp:
2799         * page/CaptionUserPreferencesMediaAF.cpp:
2800         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const):
2801         * page/History.cpp:
2802         (WebCore::History::stateObjectAdded):
2803         * page/MemoryRelease.cpp:
2804         (WebCore::logMemoryStatisticsAtTimeOfDeath):
2805         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2806         (WebCore::formatByteNumber):
2807         (WebCore::gcTimerString):
2808         (WebCore::ResourceUsageOverlay::platformDraw):
2809         * page/cocoa/ResourceUsageThreadCocoa.mm:
2810         (WebCore::logFootprintComparison):
2811         * page/linux/ResourceUsageOverlayLinux.cpp:
2812         (WebCore::cpuUsageString):
2813         (WebCore::formatByteNumber):
2814         (WebCore::gcTimerString):
2815         * page/scrolling/AxisScrollSnapOffsets.cpp:
2816         (WebCore::snapOffsetsToString):
2817         (WebCore::snapOffsetRangesToString):
2818         (WebCore::snapPortOrAreaToString):
2819         * platform/DateComponents.cpp:
2820         (WebCore::DateComponents::toStringForTime const):
2821         (WebCore::DateComponents::toString const):
2822         * platform/LocalizedStrings.cpp:
2823         * platform/animation/TimingFunction.cpp:
2824         (WebCore::TimingFunction::cssText const):
2825         * platform/audio/HRTFElevation.cpp:
2826         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2827         * platform/cocoa/KeyEventCocoa.mm:
2828         (WebCore::keyIdentifierForCharCode):
2829         * platform/gamepad/mac/HIDGamepad.cpp:
2830         (WebCore::HIDGamepad::HIDGamepad):
2831         * platform/glib/UserAgentGLib.cpp:
2832         (WebCore::platformVersionForUAString):
2833         * platform/graphics/Color.cpp:
2834         (WebCore::Color::nameForRenderTreeAsText const):
2835         * platform/graphics/FloatPolygon.h:
2836         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
2837         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2838         (WebCore::AVTrackPrivateAVFObjCImpl::id const):
2839         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
2840         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
2841         * platform/graphics/ca/GraphicsLayerCA.cpp:
2842         (WebCore::GraphicsLayerCA::setName):
2843         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
2844         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2845         (WebCore::GraphicsLayerCA::updateContentsImage):
2846         (WebCore::GraphicsLayerCA::updateContentsRects):
2847         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2848         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2849         (WebCore::simpleBusMessageCallback):
2850         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2851         (WebCore::MediaPlayerPrivateGStreamer::load):
2852         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2853         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2854         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2855         (WebCore::AppendPipeline::handleStateChangeMessage):
2856         (WebCore::AppendPipeline::resetPipeline):
2857         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2858         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
2859         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
2860         * platform/graphics/gtk/ImageBufferGtk.cpp:
2861         (WebCore::encodeImage):
2862         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2863         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
2864         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2865         (WebCore::GStreamerAudioCaptureSource::create):
2866         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
2867         (WebCore::webkitMediaStreamSrcAddPad):
2868         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2869         (WebCore::GStreamerVideoCaptureSource::create):
2870         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2871         (WebCore::GStreamerVideoEncoder::makeElement):
2872         * platform/mock/MockRealtimeVideoSource.cpp:
2873         (WebCore::MockRealtimeVideoSource::drawText):
2874         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2875         * platform/network/ParsedContentRange.cpp:
2876         (WebCore::ParsedContentRange::headerValue const):
2877         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2878         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2879         * platform/sql/SQLiteDatabase.cpp:
2880         (WebCore::unauthorizedSQLFunction):
2881         * platform/text/PlatformLocale.cpp:
2882         (WebCore::DateTimeStringBuilder::visitField):
2883         * platform/win/GDIObjectCounter.cpp:
2884         (WebCore::GDIObjectCounter::GDIObjectCounter):
2885         * platform/win/KeyEventWin.cpp:
2886         (WebCore::keyIdentifierForWindowsKeyCode):
2887         * rendering/FloatingObjects.h:
2888         (WTF::ValueToString<WebCore::FloatingObject::string):
2889         * rendering/RenderFragmentedFlow.h:
2890         (WTF::ValueToString<WebCore::RenderFragmentContainer::string):
2891         * rendering/RenderLayerCompositor.cpp:
2892         (WebCore::RenderLayerCompositor::logLayerInfo):
2893         * rendering/RenderTheme.cpp:
2894         (WebCore::RenderTheme::formatMediaControlsTime const):
2895         * testing/Internals.cpp:
2896         (WebCore::Internals::address):
2897         * workers/service/server/RegistrationDatabase.cpp:
2898         (WebCore::RegistrationDatabase::ensureValidRecordsTable):
2899         (WebCore::RegistrationDatabase::importRecords):
2900
2901 2018-08-01  Alex Christensen  <achristensen@webkit.org>
2902
2903         Move all calls to ResourceLoader::start to WebKitLegacy
2904         https://bugs.webkit.org/show_bug.cgi?id=184946
2905
2906         Reviewed by Andy Estes.
2907
2908         This is in preparation for moving ResourceLoader::start to WebKitLegacy along with all ResourceHandle code.
2909         I move the code that moves m_deferredRequest into m_request into WebKitLegacy, which won't change behavior for
2910         modern WebKit because modern WebKit never calls ResourceLoader::start, the only place where m_deferredRequest
2911         is ever set.  This won't change behavior for WebKitLegacy because the same operations happen in the same order.
2912
2913         * loader/LoaderStrategy.h:
2914         * loader/ResourceLoader.cpp:
2915         (WebCore::ResourceLoader::setDefersLoading):
2916         * loader/ResourceLoader.h:
2917         (WebCore::ResourceLoader::setRequest):
2918         (WebCore::ResourceLoader::deferredRequest const):
2919         (WebCore::ResourceLoader::takeDeferredRequest):
2920
2921 2018-08-01  Nan Wang  <n_wang@apple.com>
2922
2923         AX: AOM: Add ARIA IDL Attribute Reflection
2924         https://bugs.webkit.org/show_bug.cgi?id=184676
2925         <rdar://problem/39476882>
2926
2927         Reviewed by Chris Fleizach.
2928
2929         Test: accessibility/ARIA-reflection.html
2930
2931         * CMakeLists.txt:
2932         * DerivedSources.make:
2933         * WebCore.xcodeproj/project.pbxproj:
2934         * accessibility/AccessibilityRole.idl: Added.
2935         * accessibility/AriaAttributes.idl: Added.
2936         * dom/Element.idl:
2937         * page/RuntimeEnabledFeatures.h:
2938         (WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled):
2939         (WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const):
2940
2941 2018-08-01  Zalan Bujtas  <zalan@apple.com>
2942
2943         [LFC][Floating] Revert back to only one list for the all the floatings.
2944         https://bugs.webkit.org/show_bug.cgi?id=188232
2945
2946         Reviewed by Antti Koivisto.
2947
2948         If the combined floating list turns out to be a performance bottleneck, we can still split it into left and right. However at this point
2949         having 2 dedicated lists just makes the implementation more complicated.
2950
2951         * layout/FloatingContext.cpp:
2952         (WebCore::Layout::begin):
2953         (WebCore::Layout::end):
2954         (WebCore::Layout::FloatingPair::FloatingPair):
2955         (WebCore::Layout::FloatingPair::left const):
2956         (WebCore::Layout::FloatingPair::right const):
2957         (WebCore::Layout::Iterator::Iterator):
2958         (WebCore::Layout::previousFloatingIndex):
2959         (WebCore::Layout::Iterator::operator++):
2960         (WebCore::Layout::Iterator::set):
2961         (WebCore::Layout::floatingDisplayBox): Deleted.
2962         * layout/FloatingState.cpp:
2963         (WebCore::Layout::FloatingState::remove):
2964         (WebCore::Layout::FloatingState::append):
2965         * layout/FloatingState.h:
2966         (WebCore::Layout::FloatingState::isEmpty const):
2967         (WebCore::Layout::FloatingState::floatings const):
2968         (WebCore::Layout::FloatingState::last const):
2969
2970 2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2971
2972         [Curl] Change synchronous request logic using MessageQueue to match with Mac port.
2973         https://bugs.webkit.org/show_bug.cgi?id=188206
2974
2975         Reviewed by Alex Christensen.
2976
2977         Port synchronous request logic from ResourceHandleMac to use MessageQueue for
2978         client callback invocation. This makes simplify the logic of CurlRequest because
2979         now every requests are handled in Curl thread and there's no difference between
2980         sync and async requests.
2981
2982         Test: Covered by these tests:
2983         - http\tests\xmlhttprequest\simple-sync.html
2984         - http\tests\xmlhttprequest\xmlhttprequest-unsafe-redirect.html
2985
2986         * platform/network/ResourceHandleInternal.h:
2987         * platform/network/curl/CurlRequest.cpp: Remove synchronous request logics.
2988         (WebCore::CurlRequest::CurlRequest):
2989         (WebCore::CurlRequest::invalidateClient):
2990         (WebCore::CurlRequest::start):
2991         (WebCore::CurlRequest::cancel):
2992         (WebCore::CurlRequest::runOnMainThread): Added message queue handling.
2993         (WebCore::CurlRequest::runOnWorkerThreadIfRequired):
2994         (WebCore::CurlRequest::didReceiveData):
2995         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2996         (WebCore::CurlRequest::completeDidReceiveResponse):
2997         (WebCore::CurlRequest::updateHandlePauseState):
2998         (WebCore::CurlRequest::isHandlePaused const):
2999         * platform/network/curl/CurlRequest.h:
3000         (WebCore::CurlRequest::create):
3001         (WebCore::CurlRequest::resourceRequest const):
3002         * platform/network/curl/ResourceHandleCurl.cpp:
3003         (WebCore::ResourceHandle::createCurlRequest):
3004         (WebCore::ResourceHandle::restartRequestWithCredential):
3005         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
3006         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
3007         (WebCore::ResourceHandle::continueAfterDidReceiveResponse):
3008         (WebCore::ResourceHandle::continueAfterWillSendRequest):
3009         (WebCore::ResourceHandle::handleDataURL):
3010
3011 2018-08-01  Zalan Bujtas  <zalan@apple.com>
3012
3013         [LFC][Floating] Use margin box consistently while placing a floating.
3014         https://bugs.webkit.org/show_bug.cgi?id=188222
3015
3016         Reviewed by Antti Koivisto.
3017
3018         The floating box fits when its margin box fits.
3019
3020         * layout/FloatingContext.cpp:
3021         (WebCore::Layout::FloatingContext::computePosition const):
3022         (WebCore::Layout::FloatingContext::floatingPosition const):
3023         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
3024         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
3025         (WebCore::Layout::FloatingContext::alignWithFloatings const):
3026         (WebCore::Layout::FloatingPair::intersects const):
3027         * layout/displaytree/DisplayBox.h:
3028         (WebCore::Display::Box::rectWithMargin const):
3029
3030 2018-08-01  Zalan Bujtas  <zalan@apple.com>
3031
3032         [LFC] Add FormattingContext::mapToAncestor geometry mapping function
3033         https://bugs.webkit.org/show_bug.cgi?id=188188
3034
3035         Reviewed by Antti Koivisto.
3036
3037         * layout/FormattingContext.cpp:
3038         (WebCore::Layout::FormattingContext::mapToAncestor):
3039         * layout/FormattingContext.h:
3040         * layout/displaytree/DisplayBox.cpp:
3041         (WebCore::Display::Box::clone const):
3042         * layout/displaytree/DisplayBox.h:
3043
3044 2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3045
3046         [Curl] Bugfix on ResourceHandle::cancel()
3047         https://bugs.webkit.org/show_bug.cgi?id=188234
3048
3049         Reviewed by Darin Adler.
3050         Trivial bug. The actual request was not cancelled correctly.
3051
3052         * platform/network/curl/ResourceHandleCurl.cpp:
3053         (WebCore::ResourceHandle::cancel):
3054
3055 2018-08-01  Zalan Bujtas  <zalan@apple.com>
3056
3057         [LFC][Floating] FloatingState should take the formatting root box.
3058         https://bugs.webkit.org/show_bug.cgi?id=188214
3059
3060         Reviewed by Antti Koivisto.
3061
3062         This will be taken into use when FormattingContext takes all boxes in the coordinate system of the formatting root.
3063
3064         * layout/FloatingState.cpp:
3065         (WebCore::Layout::FloatingState::FloatingState):
3066         (WebCore::Layout::belongsToThisFloatingContext):
3067         (WebCore::Layout::FloatingState::append):
3068         * layout/FloatingState.h:
3069         (WebCore::Layout::FloatingState::create):
3070         * layout/LayoutContext.cpp:
3071         (WebCore::Layout::LayoutContext::establishedFormattingState):
3072
3073 2018-08-01  Zalan Bujtas  <zalan@apple.com>
3074
3075         [LFC][Floating] Align new floating with the bottom of the existing floatings.
3076         https://bugs.webkit.org/show_bug.cgi?id=188213
3077
3078         Reviewed by Antti Koivisto.
3079
3080         When the incoming floating does not fit at all, align its top with the bottom of the existing floatings.
3081
3082         * layout/FloatingContext.cpp:
3083         (WebCore::Layout::FloatingContext::floatingPosition const):
3084         (WebCore::Layout::FloatingPair::bottom const):
3085
3086 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
3087
3088         Always use MediaPlayback audio category when playing to AppleTV
3089         https://bugs.webkit.org/show_bug.cgi?id=188230
3090         <rdar://problem/42497809>
3091
3092         Reviewed by Jer Noble.
3093
3094         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
3095         (PlatformMediaSessionManager::updateSessionState): Check session.isPlayingToWirelessPlaybackTarget().
3096
3097 2018-08-01  Timothy Hatcher  <timothy@apple.com>
3098
3099         Hardcode some system colors to avoid fingerprinting exposure.
3100         https://bugs.webkit.org/show_bug.cgi?id=188203
3101         rdar://problem/42781630
3102
3103         Reviewed by Tim Horton.
3104
3105         Passes existing tests with the hardcoded blue system appearance.
3106
3107         * rendering/RenderTheme.h:
3108         * rendering/RenderThemeMac.mm:
3109         (WebCore::RenderThemeMac::systemColor const):
3110         Adds special handling for some system colors. Fixes -apple-system-selected-text-background
3111         to match the real selection color by using blendWithWhite().
3112
3113 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
3114
3115         [iOS] Remove the delay before setting audio session category added in r233535
3116         https://bugs.webkit.org/show_bug.cgi?id=188225
3117
3118         Reviewed by Jer Noble.
3119
3120         * platform/audio/PlatformMediaSessionManager.cpp:
3121         (WebCore::PlatformMediaSessionManager::beginInterruption): scheduleUpdateSessionState -> updateSessionState.
3122         (WebCore::PlatformMediaSessionManager::addSession): Ditto.
3123         (WebCore::PlatformMediaSessionManager::removeSession): Ditto.
3124         (WebCore::PlatformMediaSessionManager::sessionStateChanged): Ditto.
3125         (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Ditto.
3126         (WebCore::PlatformMediaSessionManager::updateSessionState): Ditto.
3127         (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged): Ditto.
3128         (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
3129         * platform/audio/PlatformMediaSessionManager.h:
3130
3131         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
3132         (PlatformMediaSessionManager::updateSessionState):
3133         (PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
3134         * rendering/RenderLayer.cpp:
3135         (WebCore::RenderLayer::updateClipRects):
3136
3137 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
3138
3139         Add TransformationMatrix::Identity
3140         https://bugs.webkit.org/show_bug.cgi?id=188204
3141
3142         Reviewed by Simon Fraser.
3143
3144         This patch adds TransformationMatrix::Identity, which is a static const variable holding an identity matrix.
3145
3146         No behavior change.
3147
3148         * platform/graphics/GraphicsLayer.cpp:
3149         (WebCore::GraphicsLayer::transform const):
3150         (WebCore::GraphicsLayer::childrenTransform const):
3151         (): Deleted.
3152         * platform/graphics/transforms/TransformationMatrix.cpp:
3153         * platform/graphics/transforms/TransformationMatrix.h:
3154
3155 2018-08-01  Thibault Saunier  <tsaunier@igalia.com>
3156
3157         [GStreamer] Make sure that first buffer running time is 0 in GStreamerMediaStreamSource
3158         https://bugs.webkit.org/show_bug.cgi?id=188210
3159
3160         This is a live source and the first frame is the beginning of the stream,
3161         but that doesn't mean that the incoming stream from the camera didn't start
3162         before. We need to set a pad offset on each srcpad of the source to compensate
3163         for that. This is the exact same logic as in webrtc GStreamerVideo/Enc/Dec/oder.
3164
3165         Reviewed by Alejandro G. Castro.
3166
3167         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
3168         (WebCore::webkit_media_stream_src_init):
3169         (WebCore::webkitMediaStreamSrcPushVideoSample):
3170         (WebCore::webkitMediaStreamSrcPushAudioSample):
3171
3172 2018-08-01  Zan Dobersek  <zdobersek@igalia.com>
3173
3174         [CoordGraphics] Move CoordinatedBackingStore to WebCore
3175         https://bugs.webkit.org/show_bug.cgi?id=188158
3176
3177         Reviewed by Carlos Garcia Campos.
3178
3179         Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
3180         dependency on anything in the WebKit layer, and it's more suitable to
3181         future needs to keep it in the WebCore layer.
3182
3183         * platform/TextureMapper.cmake:
3184         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp.
3185         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h.
3186         (WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
3187         (WebCore::CoordinatedBackingStore::rect const):
3188
3189 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
3190
3191         [WIN] Fix tests for text with initial advances
3192         https://bugs.webkit.org/show_bug.cgi?id=188099
3193
3194         Reviewed by Darin Adler.
3195
3196         Fixup after r234318.
3197
3198         Tests: fast/text/complex-first-glyph-with-initial-advance.html
3199                fast/text/initial-advance-in-intermediate-run-complex.html
3200
3201         * platform/graphics/ComplexTextController.cpp:
3202         * platform/graphics/FontCascade.cpp:
3203         (WebCore::FontCascade::drawGlyphBuffer const):
3204
3205 2018-07-31  Alex Christensen  <achristensen@webkit.org>
3206
3207         REGRESSION (r231107): MoviStar+ launches to a blank black screen
3208         https://bugs.webkit.org/show_bug.cgi?id=188139
3209
3210         Reviewed by Brent Fulgham.
3211
3212         For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
3213         r231107 increased our fetch spec conformance, which we intend to keep.  This makes a low-risk
3214         targeted fix that will fix the affected app until they update.  
3215
3216         I manually verified this fixes the app.
3217
3218         * loader/DocumentThreadableLoader.cpp:
3219         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
3220         * platform/RuntimeApplicationChecks.h:
3221         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3222         (WebCore::applicationSDKVersionOverride):
3223         (WebCore::setApplicationSDKVersion):
3224         (WebCore::applicationSDKVersion):
3225         (WebCore::IOSApplication::isMoviStarPlus):
3226
3227 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
3228
3229         [Cocoa] Addressing post-review comments on r234158
3230         https://bugs.webkit.org/show_bug.cgi?id=188202
3231
3232         Reviewed by Darin Adler.
3233
3234         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3235         (WebCore::FontCache::lastResortFallbackFont):
3236
3237 2018-07-31  John Wilander  <wilander@apple.com>
3238
3239         Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
3240         https://bugs.webkit.org/show_bug.cgi?id=188109
3241         <rdar://problem/42664391>
3242
3243         Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.
3244
3245         Tests: http/tests/resourceLoadStatistics/cookie-deletion.html
3246                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html
3247                http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-user-interaction.html
3248                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe-pop-window.html
3249                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe.html
3250                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html
3251                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-but-access-from-wrong-frame.html
3252                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
3253                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
3254                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe.html
3255                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html
3256
3257         This patch removes cookie partitioning which reduces the model to just
3258         blocked cookies (in third-party contexts) and first-party cookie access.
3259
3260         Several of the changes are renaming to reflect that there are no more
3261         cookie partitions. However, the compile-time check remains for now since
3262         this change is not ready to ship.
3263
3264         The test cases mentioned about are not new. They are just renamed to
3265         reflect the code changes and to shorten their names (as requested by
3266         non-Cocoa platforms).
3267
3268         * loader/ResourceLoadStatistics.cpp:
3269         (WebCore::ResourceLoadStatistics::toString const):
3270         (WebCore::ResourceLoadStatistics::merge):
3271             Removed the use of isMarkedForCookiePartitioning.
3272         * loader/ResourceLoadStatistics.h:
3273             Removed isMarkedForCookiePartitioning.
3274         * platform/network/NetworkStorageSession.h:
3275         * platform/network/ResourceHandle.h:
3276             Renamed applySniffingPoliciesAndStoragePartitionIfNeeded() to
3277             applySniffingPoliciesIfNeeded().
3278         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3279         (WebCore::getPartitioningDomain):
3280         (WebCore::NetworkStorageSession::shouldBlockCookies const):
3281             Now takes a frame ID and a page ID to be able to support
3282             the Storage Access API. This was previously handled by
3283             shouldPartitionCookies() which is now deleted.
3284         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
3285             Renamed from setPrevalentDomainsToPartitionOrBlockCookies().
3286         (WebCore::NetworkStorageSession::removePrevalentDomains):
3287             No longer needs to clear the member variable for partitioned cookie domains.
3288         (WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Deleted.
3289         (WebCore::NetworkStorageSession::cookieStoragePartition const): Deleted.
3290         (WebCore::NetworkStorageSession::shouldPartitionCookies const): Deleted.
3291         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies): Deleted.
3292             Renamed to setPrevalentDomainsToBlockCookiesFor().
3293         * platform/network/mac/CookieJarMac.mm:
3294         (WebCore::cookiesForURL):
3295             Now calls session.shouldBlockCookies() instead of the
3296             wrapper cookiesAreBlockedForURL().
3297         (WebCore::setCookiesFromDOM):
3298             No longer checks for partition.
3299         (WebCore::applyPartitionToCookies): Deleted.
3300         (WebCore::cookiesAreBlockedForURL): Deleted.
3301             This was just a wrapper for session.shouldBlockCookies().
3302         (WebCore::cookiesInPartitionForURL): Deleted.
3303         * platform/network/mac/ResourceHandleMac.mm:
3304         (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
3305             Renamed from applySniffingPoliciesAndStoragePartitionIfNeeded().
3306         (WebCore::ResourceHandle::createNSURLConnection):
3307             Consequence of function name change.
3308         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Deleted.
3309             Renamed to applySniffingPoliciesIfNeeded().
3310
3311 2018-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3312
3313         [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
3314         https://bugs.webkit.org/show_bug.cgi?id=188107
3315         <rdar://problem/42354250>
3316
3317         Reviewed by Tim Horton.
3318
3319         After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element,
3320         which allows the page to handle click events inside editable content. However, this means that codepaths in
3321         EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now
3322         active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing
3323         mechanism for modifying the selection on iOS.
3324
3325         To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the
3326         default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is
3327         similar to r233311, but in a different codepath that specifically handles selection changes when clicking on
3328         content that is already selected.
3329
3330         Test: fast/forms/ios/click-should-not-suppress-misspelling.html
3331
3332         * page/EventHandler.cpp:
3333         (WebCore::EventHandler::handleMouseReleaseEvent):
3334
3335 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3336
3337         Clean up TransformationMatrix implementation
3338         https://bugs.webkit.org/show_bug.cgi?id=188197
3339
3340         Reviewed by Simon Fraser.
3341
3342         We perform cleaning up of TransformationMatrix.
3343
3344         1. We drop user-defined operator= and copy constructor. Default ones works well for TransformationMatrix.
3345         2. Remove unused setMatrix. We explicitly use memcpy in TransformationMatrix.cpp (only one place).
3346         3. Use memcmp for implementing operator==.
3347
3348         In (2) and (3), we use `memcpy(&matrix[0][0], &tmp[0][0], sizeof(Matrix4))` instead of `memcpy(matrix, tmp, sizeof(Matrix4))`,
3349         since they both are non nullptr and the former is easier to understand.
3350
3351         * platform/graphics/transforms/TransformationMatrix.cpp: