Attr nodes are not cloned properly
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-01  Chris Dumez  <cdumez@apple.com>
2
3         Attr nodes are not cloned properly
4         https://bugs.webkit.org/show_bug.cgi?id=196466
5
6         Reviewed by Ryosuke Niwa.
7
8         Attr nodes are not cloned properly according to:
9         - https://dom.spec.whatwg.org/#concept-node-clone
10
11         A cloned Attr node should retain its prefix and namespace.
12
13         Both Gecko and Blink agree with the DOM specification here.
14
15         No new tests, rebaselined existing test.
16
17         * dom/Document.cpp:
18         (WebCore::Document::importNode):
19
20 2019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
21
22         Remove the SVG tear off objects for SVGMatrix, SVGTransfrom, SVGTransformList and SVGAnimatedTransformList
23         https://bugs.webkit.org/show_bug.cgi?id=196086
24
25         Reviewed by Simon Fraser.
26
27         The IDL changes:
28
29         SVGTransform.idl:
30             Remove the NewObject qualifier from matrix attribute. This matches 
31             the specs: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGTransform.
32             SVGTransform will internally hold an SVGMatrix. A change in this
33             SVGMatrix will affect the container SVGTransform.
34
35         SVGTransformList.idl:
36             Remove the NewObject qualifier from consolidate() method. This matches
37             the specs:
38             https://www.w3.org/TR/SVG11/coords.html#__svg__SVGTransformList__consolidate
39             The method consolidate() should return a reference to the first item
40             in the list after consolidating it.
41
42         Code changes:
43
44         -- SVGMatrix is now a superclass of SVGValueProperty<AffineTransform>.
45            No need for SVGMatrixValue since it was wrapper of AffineTransform.
46
47         -- SVGTransformValue now holds a Ref<SVGMatrix> member in addition to the
48            angle and the rotationCenter. Ref<SVGMatrix> is what SVGTransform.matrix
49            will return. So a change in this matrix will change the owner SVGTransform.
50
51         -- SVGTransform is now the owner of SVGMatrix via its SVGTransformValue.
52
53         -- SVGTransformList is now a superclass of SVGValuePropertyList<SVGTransform>.
54            It is responsible for parsing a String to items of SVGTransform.
55
56         -- SVGAnimatedTransformList is now defined as SVGAnimatedPropertyList<
57            SVGTransformList>.
58
59         Note the ownership chain of these objects is the following:
60
61         -- SVGAnimatedTransformList owns the SVGTransformList via its baseVal 
62            and animVal members.
63
64         -- SVGTransformList owns SVGTransform via its list of items
65
66         -- SVGTransform owns SVGMatrix via its SVGTransformValue.
67
68            So a change in SVGMatrix will propagate to the owner SVGElement through
69            the following ownership chain:
70
71            SVGMatrix
72              |_ SVGTransfrom
73                   |_ SVGTransformList
74                        |_ SVGAmimatedTransformList
75                             |_ SVGElement
76
77         To get the mechanics of this change right, a new accessor, a new animator
78         and animation functions are added for the SVGAnimatedTransformList.
79
80         -- SVGViewSpec used to hold an SVGAnimatedTransformListAttribute for the
81         member m_transform although this member should not be animated. See the
82         comment in the old SVGViewSpec::transform(). This has been changed in this
83         patch. SVGViewSpec now holds Ref<SVGTransformList> which matches the specs:
84         https://www.w3.org/TR/SVG11/types.html#InterfaceSVGViewSpec.
85
86         * Sources.txt:
87         * WebCore.xcodeproj/project.pbxproj:
88         * svg/SVGAnimateElementBase.cpp:
89         (WebCore::SVGAnimateElementBase::attributeAnimationController):
90         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
91         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
92         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
93         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
94         * svg/SVGAnimateElementBase.h:
95         (WebCore::SVGAnimateElementBase::animateRangeString const):
96         * svg/SVGAnimateTransformElement.cpp:
97         (WebCore::SVGAnimateTransformElement::animateRangeString const):
98         * svg/SVGAnimateTransformElement.h:
99                 This change is needed because animating the transform attribute can be
100         written as
101             <animate ... from="translate(100)" to="translate(200)"/>
102         or
103             <animateTransform type="translate" from="100" to="200"/>"
104         So we need to surround the animation range string with the type qualifier
105         for animateTransform.
106
107         * svg/SVGAnimatedTransformList.cpp: Removed.
108         * svg/SVGAnimatedTransformList.h: Removed.
109         * svg/SVGAnimatedType.h: Removed.
110         * svg/SVGAnimatedTypeAnimator.cpp: Removed.
111         * svg/SVGAnimatedTypeAnimator.h: Removed.
112         * svg/SVGAnimationElement.cpp:
113         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
114         * svg/SVGAnimationElement.h:
115         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
116         (WebCore::SVGAnimationElement::adjustFromToListValues): Deleted.
117         (WebCore::SVGAnimationElement::animateDiscreteType): Deleted.
118         These functions were used by SVGLegacyAttributeAnimationController.
119
120         * svg/SVGAnimatorFactory.h: Removed.
121         * svg/SVGExternalResourcesRequired.h:
122         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
123         * svg/SVGFEImageElement.h:
124         * svg/SVGFEMorphologyElement.h:
125         * svg/SVGFETileElement.h:
126         * svg/SVGFitToViewBox.h:
127         (WebCore::SVGFitToViewBox::isKnownAttribute):
128         * svg/SVGGradientElement.cpp:
129         (WebCore::SVGGradientElement::SVGGradientElement):
130         (WebCore::SVGGradientElement::parseAttribute):
131         (WebCore::SVGGradientElement::registerAttributes): Deleted.
132         * svg/SVGGradientElement.h:
133         (WebCore::SVGGradientElement::gradientTransform const):
134         (WebCore::SVGGradientElement::gradientTransformAnimated):
135         (WebCore::SVGGradientElement::isKnownAttribute):
136         * svg/SVGGraphicsElement.cpp:
137         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
138         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
139         (WebCore::SVGGraphicsElement::parseAttribute):
140         (WebCore::SVGGraphicsElement::svgAttributeChanged):
141         There is one attribute for this element which is "SVGNames::transformAttr"
142         So there is no need to check for it twice.
143
144         (WebCore::SVGGraphicsElement::registerAttributes): Deleted.
145         * svg/SVGGraphicsElement.h:
146         (WebCore::SVGGraphicsElement::transform const):
147         (WebCore::SVGGraphicsElement::transformAnimated):
148         (WebCore::SVGGraphicsElement::isKnownAttribute): Deleted.
149         * svg/SVGLangSpace.cpp:
150         (WebCore::SVGLangSpace::SVGLangSpace):
151         (WebCore::SVGLangSpace::xmlspace const):
152         (WebCore::SVGLangSpace::isKnownAttribute):
153         (WebCore::SVGLangSpace::svgAttributeChanged):
154         (WebCore::SVGLangSpace::registerAttributes): Deleted.
155         * svg/SVGLangSpace.h:
156         (WebCore::SVGLangSpace::xmllang const):
157         (WebCore::SVGLangSpace::setXmllang):
158         (WebCore::SVGLangSpace::setXmlspace):
159         (WebCore::SVGLangSpace::attributeRegistry): Deleted.
160         (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
161         * svg/SVGLegacyAttributeAnimationController.cpp: Removed.
162         * svg/SVGLegacyAttributeAnimationController.h: Removed.
163         * svg/SVGLinearGradientElement.cpp:
164         (WebCore::setGradientAttributes):
165         * svg/SVGMaskElement.h:
166         * svg/SVGMatrix.h:
167         (WebCore::SVGMatrix::create):
168         (WebCore::SVGMatrix::a const):
169         (WebCore::SVGMatrix::setA):
170         (WebCore::SVGMatrix::b const):
171         (WebCore::SVGMatrix::setB):
172         (WebCore::SVGMatrix::c const):
173         (WebCore::SVGMatrix::setC):
174         (WebCore::SVGMatrix::d const):
175         (WebCore::SVGMatrix::setD):
176         (WebCore::SVGMatrix::e const):
177         (WebCore::SVGMatrix::setE):
178         (WebCore::SVGMatrix::f const):
179         (WebCore::SVGMatrix::setF):
180         (WebCore::SVGMatrix::multiply const):
181         (WebCore::SVGMatrix::inverse const):
182         (WebCore::SVGMatrix::translate const):
183         (WebCore::SVGMatrix::scale const):
184         (WebCore::SVGMatrix::scaleNonUniform const):
185         (WebCore::SVGMatrix::rotate const):
186         (WebCore::SVGMatrix::rotateFromVector const):
187         (WebCore::SVGMatrix::flipX const):
188         (WebCore::SVGMatrix::flipY const):
189         (WebCore::SVGMatrix::skewX const):
190         (WebCore::SVGMatrix::skewY const):
191         * svg/SVGPatternElement.cpp:
192         (WebCore::SVGPatternElement::SVGPatternElement):
193         (WebCore::SVGPatternElement::parseAttribute):
194         (WebCore::SVGPatternElement::svgAttributeChanged):
195         (WebCore::SVGPatternElement::collectPatternAttributes const):
196         (WebCore::SVGPatternElement::localCoordinateSpaceTransform const):
197         (WebCore::SVGPatternElement::registerAttributes): Deleted.
198         * svg/SVGPatternElement.h:
199         * svg/SVGPoint.h:
200         (WebCore::SVGPoint::matrixTransform const):
201         * svg/SVGPolyElement.h:
202         (WebCore::SVGPolyElement::isKnownAttribute): Deleted.
203         * svg/SVGRadialGradientElement.cpp:
204         (WebCore::setGradientAttributes):
205         * svg/SVGSVGElement.cpp:
206         (WebCore::SVGSVGElement::createSVGTransform):
207         (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
208         (WebCore::SVGSVGElement::viewBoxToViewTransform const):
209         * svg/SVGTextElement.cpp:
210         (WebCore::SVGTextElement::animatedLocalTransform const):
211         * svg/SVGTransform.cpp: Removed.
212         * svg/SVGTransform.h:
213         (WebCore::SVGTransform::create):
214         (WebCore::SVGTransform::~SVGTransform):
215         (WebCore::SVGTransform::clone const):
216         (WebCore::SVGTransform::type):
217         (WebCore::SVGTransform::angle):
218         (WebCore::SVGTransform::matrix):
219         (WebCore::SVGTransform::setMatrix):
220         (WebCore::SVGTransform::setTranslate):
221         (WebCore::SVGTransform::setScale):
222         (WebCore::SVGTransform::setRotate):
223         (WebCore::SVGTransform::setSkewX):
224         (WebCore::SVGTransform::setSkewY):
225         (WebCore::SVGTransform::SVGTransform):
226         * svg/SVGTransform.idl:
227         * svg/SVGTransformList.h:
228         * svg/SVGTransformList.idl:
229         * svg/SVGTransformListValues.cpp: Removed.
230         * svg/SVGTransformListValues.h: Removed.
231         * svg/SVGTransformValue.cpp: Removed.
232         * svg/SVGTransformValue.h:
233         (WebCore::SVGTransformValue::SVGTransformValue):
234         (WebCore::SVGTransformValue::operator=):
235         (WebCore::SVGTransformValue::matrix const):
236         (WebCore::SVGTransformValue::rotationCenter const):
237         (WebCore::SVGTransformValue::isValid const):
238         (WebCore::SVGTransformValue::setMatrix):
239         (WebCore::SVGTransformValue::matrixDidChange):
240         (WebCore::SVGTransformValue::translate const):
241         (WebCore::SVGTransformValue::setTranslate):
242         (WebCore::SVGTransformValue::scale const):
243         (WebCore::SVGTransformValue::setScale):
244         (WebCore::SVGTransformValue::setRotate):
245         (WebCore::SVGTransformValue::setSkewX):
246         (WebCore::SVGTransformValue::setSkewY):
247         (WebCore::SVGTransformValue::valueAsString const):
248         (WebCore::SVGTransformValue::prefixForTransfromType):
249         (WebCore::SVGTransformValue::appendNumbers const):
250         (WebCore::SVGTransformValue::appendMatrix const):
251         (WebCore::SVGTransformValue::appendTranslate const):
252         (WebCore::SVGTransformValue::appendScale const):
253         (WebCore::SVGTransformValue::appendRotate const):
254         (WebCore::SVGTransformValue::appendSkewX const):
255         (WebCore::SVGTransformValue::appendSkewY const):
256         (WebCore::SVGTransformValue::matrix): Deleted.
257         * svg/SVGTransformable.cpp:
258         (WebCore::SVGTransformable::parseAndSkipType):
259         (WebCore::parseAndSkipType): Deleted.
260         (WebCore::SVGTransformable::parseTransformAttribute): Deleted.
261         The code of this function was moved to SVGTransformList::parse().
262
263         * svg/SVGTransformable.h:
264         There is no need for enum TransformParsingMode. It was used by 
265         SVGViewSpec::parseViewSpec() to tell SVGTransformable::parseTransformAttribute()
266         not to clear the list. SVGTransfromList now has two parse() functions:
267         one public and the second is private. The public one clear the list
268         before parsing the input String. The private one just does the parsing.
269         SVGViewSpec::parseViewSpec() calls the private once since it is a friend
270         of SVGTransfromList.
271
272         * svg/SVGValue.h: Removed.
273         * svg/SVGViewSpec.cpp:
274         (WebCore::SVGViewSpec::SVGViewSpec):
275         (WebCore::SVGViewSpec::reset):
276         (WebCore::SVGViewSpec::parseViewSpec):
277         (WebCore::SVGViewSpec::registerAttributes): Deleted.
278         (WebCore::SVGViewSpec::transform): Deleted.
279         * svg/SVGViewSpec.h:
280         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
281         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
282         * svg/properties/SVGAnimatedPropertyImpl.h:
283         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Removed.
284         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
285         (WebCore::SVGAnimationTransformListFunction::progress):
286         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
287         * svg/properties/SVGAttributeRegistry.h:
288         * svg/properties/SVGMatrixTearOff.h: Removed.
289         * svg/properties/SVGPropertyAccessorImpl.h:
290         * svg/properties/SVGPropertyOwnerRegistry.h:
291         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
292
293 2019-04-01  Devin Rousso  <drousso@apple.com>
294
295         Web Inspector: DOMDebugger: breakpoints for attribute modifications still fire when breakpoints are disabled
296         https://bugs.webkit.org/show_bug.cgi?id=196456
297         <rdar://problem/49489747>
298
299         Reviewed by Joseph Pecoraro.
300
301         Test: inspector/dom-debugger/dom-breakpoints.html
302
303         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
304         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
305         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
306
307 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
308
309         Unable to copy and paste a PDF from Notes into Mail compose body
310         https://bugs.webkit.org/show_bug.cgi?id=196442
311         <rdar://problem/48573098>
312
313         Reviewed by Tim Horton.
314
315         Refactor some logic for inserting attachment elements upon paste or drop. Currently, we only prefer inserting
316         content as attachment elements if the items are annotated with UIPreferredPresentationStyleAttachment. However,
317         many data sources around the system (both first and third party) have not adopted this API, which makes it
318         difficult to determine whether a given item provider should be treated as a file or not. In this bug in
319         particular, no preferred presentation style is set, so we fail to handle the paste command by inserting an
320         attachment element.
321
322         However, most apps around the system that write file or attachment-like data to the pasteboard will at least
323         offer a suggested name for the file, in the form of -[NSItemProvider suggestedName]. To address this, instead of
324         relying solely on the preferredPresentationStyle, additionally take a suggested name as an indicator that the
325         item is probably a file.
326
327         In fact, Pasteboard::fileContentState already has similar logic to check for either a suggested file name or
328         explicitly specified presentation style. We pull this out into a separate helper method on PasteboardItemInfo,
329         and use it for both Pasteboard::fileContentState and prefersAttachmentRepresentation.
330
331         Tests:  WKAttachmentTestsIOS.InsertPastedContactAsAttachment
332                 WKAttachmentTestsIOS.InsertPastedMapItemAsAttachment
333
334         * editing/cocoa/WebContentReaderCocoa.mm:
335         (WebCore::mimeTypeFromContentType):
336
337         Work around <rdar://problem/49478229> by using the "text/vcard" MIME type to handle "public.vcard". CoreServices
338         currently maps "public.vcard" to "text/directory" when using UTTypeCopyPreferredTagWithClass, despite the SPI
339         -[NSURLFileTypeMappings MIMETypeForExtension:] returning "text/vcard" for a ".vcf" file.
340
341         * platform/PasteboardItemInfo.h:
342         (WebCore::PasteboardItemInfo::canBeTreatedAsAttachmentOrFile const):
343
344         Add a helper method to determine whether the PasteboardItemInfo prefers to be represented as inline data, or an
345         attachment, or neither. This differs slightly from the existing value of preferredPresentationStyle in that we
346         consider having a suggested file name as a strong indicator that the item should be treated as an attachment,
347         even if the presentation style is unspecified.
348
349         * platform/cocoa/PasteboardCocoa.mm:
350         (WebCore::Pasteboard::fileContentState):
351
352         Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
353
354         * platform/ios/PasteboardIOS.mm:
355         (WebCore::prefersAttachmentRepresentation):
356
357         Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
358
359 2019-04-01  Tim Horton  <timothy_horton@apple.com>
360
361         Make UIWKDocumentContext rects per-character instead of per-word
362         https://bugs.webkit.org/show_bug.cgi?id=196459
363
364         Reviewed by Wenson Hsieh.
365
366         No new tests; adjusted expected results of WebKit.DocumentEditingContext.
367
368         * editing/TextIterator.cpp:
369         (WebCore::CharacterIterator::CharacterIterator):
370         * editing/TextIterator.h:
371         (WebCore::CharacterIterator::atEnd const):
372         (WebCore::CharacterIterator::text const):
373         Add WEBCORE_EXPORT to some things.
374         Introduce a CharacterIterator constructor that takes Positions, like one that TextIterator has.
375         Move initializers to the header.
376
377 2019-04-01  Antti Koivisto  <antti@apple.com>
378
379         Update event region when toggling pointer-events:none
380         https://bugs.webkit.org/show_bug.cgi?id=195902
381         <rdar://problem/48988384>
382
383         Reviewed by Simon Fraser.
384
385         Test: fast/scrolling/ios/event-region-pointer-events.html
386
387         Normally paint invalidation requests compositing configuration update whenever anything that would
388         affect event region changes. However mutating 'pointer-events' property does not cause paint invalidation.
389
390         * rendering/RenderElement.cpp:
391         (WebCore::RenderElement::styleWillChange):
392
393         Request compositing update explicitly from the containing layer.
394
395         * rendering/RenderLayer.cpp:
396         (WebCore::RenderLayer::invalidateEventRegion):
397         * rendering/RenderLayer.h:
398
399 2019-04-01  Chris Dumez  <cdumez@apple.com>
400
401         Support "noreferrer" for window.open()
402         https://bugs.webkit.org/show_bug.cgi?id=194533
403
404         Reviewed by Geoffrey Garen.
405
406         Support "noreferrer" for window.open() as per:
407         - https://github.com/whatwg/html/pull/4331
408
409         Tests: imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer.html
410                http/wpt/html/browsers/the-window-object/window-open-noopener-webkit.html
411
412         * page/DOMWindow.cpp:
413         (WebCore::DOMWindow::createWindow):
414         * page/WindowFeatures.cpp:
415         (WebCore::setWindowFeature):
416         * page/WindowFeatures.h:
417
418 2019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
419
420         SVGMatrix.IDL methods do not conform to the specs
421         https://bugs.webkit.org/show_bug.cgi?id=196263
422
423         Reviewed by Simon Fraser.
424
425         I think there was a misconception about these functions. The specs link
426         is: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGMatrix.
427
428         Notice that the specs does not state that the SVGMethod methods should
429         raise the exception NO_MODIFICATION_ALLOWED_ERR if the object is read
430         only. Notice setting the attribute 'a' for example may raise this
431         exception. Therefore, I think the specs wanted to make these operations
432         read-only. None of the methods should raise the exception
433         NO_MODIFICATION_ALLOWED_ERR.
434
435         In fact the SVG code was doing the right thing. For example SVGMatrix::scale()
436         was calling SVGMatrixValue::scale() which was making a copy of itself,
437         applying the scale on the copy and then returning the copy. When 
438         SVGMatrix::scale() receives the copy of the SVGMatrixValue it creates and
439         returns a new SVGMatrix object.
440
441         * WebCore.xcodeproj/project.pbxproj:
442         * svg/SVGMatrix.h:
443         (WebCore::SVGMatrix::create):
444         (WebCore::SVGMatrix::a const):
445         (WebCore::SVGMatrix::b const):
446         (WebCore::SVGMatrix::c const):
447         (WebCore::SVGMatrix::d const):
448         (WebCore::SVGMatrix::e const):
449         (WebCore::SVGMatrix::f const):
450         (WebCore::SVGMatrix::multiply const):
451         (WebCore::SVGMatrix::inverse const):
452         (WebCore::SVGMatrix::translate const):
453         (WebCore::SVGMatrix::scale const):
454         (WebCore::SVGMatrix::scaleNonUniform const):
455         (WebCore::SVGMatrix::rotate const):
456         (WebCore::SVGMatrix::rotateFromVector const):
457         (WebCore::SVGMatrix::flipX const):
458         (WebCore::SVGMatrix::flipY const):
459         (WebCore::SVGMatrix::skewX const):
460         (WebCore::SVGMatrix::skewY const):
461         (WebCore::SVGMatrix::a): Deleted.
462         (WebCore::SVGMatrix::b): Deleted.
463         (WebCore::SVGMatrix::c): Deleted.
464         (WebCore::SVGMatrix::d): Deleted.
465         (WebCore::SVGMatrix::e): Deleted.
466         (WebCore::SVGMatrix::f): Deleted.
467         (WebCore::SVGMatrix::multiply): Deleted.
468         (WebCore::SVGMatrix::inverse): Deleted.
469         (WebCore::SVGMatrix::translate): Deleted.
470         (WebCore::SVGMatrix::scale): Deleted.
471         (WebCore::SVGMatrix::scaleNonUniform): Deleted.
472         (WebCore::SVGMatrix::rotate): Deleted.
473         (WebCore::SVGMatrix::rotateFromVector): Deleted.
474         (WebCore::SVGMatrix::flipX): Deleted.
475         (WebCore::SVGMatrix::flipY): Deleted.
476         (WebCore::SVGMatrix::skewX): Deleted.
477         (WebCore::SVGMatrix::skewY): Deleted.
478         (WebCore::SVGMatrix::SVGMatrix): Deleted.
479         * svg/SVGMatrix.idl:
480         * svg/SVGMatrixValue.h: Removed.
481         * svg/SVGTransform.cpp:
482         (WebCore::SVGTransform::matrix):
483         * svg/SVGTransformDistance.cpp:
484         (WebCore::SVGTransformDistance::addToSVGTransform const):
485         * svg/SVGTransformValue.h:
486         (WebCore::SVGTransformValue::matrix const):
487         (WebCore::SVGTransformValue::matrix):
488         (WebCore::SVGTransformValue::svgMatrix): Deleted.
489         (WebCore::operator==): Deleted.
490         (WebCore::operator!=): Deleted.
491         * svg/properties/SVGMatrixTearOff.h:
492         * svg/properties/SVGPropertyTearOff.h:
493         (WebCore::SVGPropertyTearOff::propertyReference const):
494
495 2019-04-01  Simon Fraser  <simon.fraser@apple.com>
496
497         Plumb through a ScrollType value that indicates whether a scroll was a user or programmatic scroll
498         https://bugs.webkit.org/show_bug.cgi?id=196424
499
500         Reviewed by Zalan Bujtas.
501
502         In preparation for fixing webkit.org/b/195584, we need to know if an overflow scroll
503         is programmatic, so plumb through an enum value. The functions touched by this patch are
504         only ever called for programmatic scrolls.
505
506         * dom/Element.cpp:
507         (WebCore::Element::scrollTo):
508         (WebCore::Element::setScrollLeft):
509         (WebCore::Element::setScrollTop):
510         * platform/ScrollTypes.h:
511         * rendering/RenderBox.cpp:
512         (WebCore::RenderBox::setScrollLeft):
513         (WebCore::RenderBox::setScrollTop):
514         * rendering/RenderBox.h:
515         * rendering/RenderLayer.cpp:
516         (WebCore::RenderLayer::scrollToXPosition):
517         (WebCore::RenderLayer::scrollToYPosition):
518         * rendering/RenderLayer.h:
519         * rendering/RenderListBox.cpp:
520         (WebCore::RenderListBox::setScrollLeft):
521         (WebCore::RenderListBox::setScrollTop):
522         * rendering/RenderListBox.h:
523         * rendering/RenderTextControlSingleLine.cpp:
524         (WebCore::RenderTextControlSingleLine::setScrollLeft):
525         (WebCore::RenderTextControlSingleLine::setScrollTop):
526         * rendering/RenderTextControlSingleLine.h:
527
528 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
529
530         [iOS] Refactor some logic for inserting pasted or dropped virtual card files as attachment elements
531         https://bugs.webkit.org/show_bug.cgi?id=196435
532         Work towards <rdar://problem/48573098>
533
534         Reviewed by Darin Adler.
535
536         Refactor some existing codepaths on iOS for inserting VCard files as attachment elements. Instead of using a
537         separate readVirtualContactFile method for converting a vcard file or data into an attachment element (possibly
538         accompanied by a link), use the existing readFilePaths WebContentReader method.
539
540         To handle links which may accompany the attachment element, add a helper method in PasteboardIOS that reads a
541         titled URL prior to inserting an attachment element, in the case of pasting or dropping a VCF.
542
543         This means we no longer need to handle attachment reading in readPasteboardWebContentDataForType, so we can
544         simply bail before reading "public.vcard" here and defer to reading other data types.
545
546         Covered by existing API tests in WKAttachmentTests and DragAndDropTestsIOS.
547
548         * editing/WebContentReader.h:
549         * editing/cocoa/WebContentReaderCocoa.mm:
550         (WebCore::WebContentReader::readVirtualContactFile): Deleted.
551         * platform/Pasteboard.h:
552         * platform/ios/PasteboardIOS.mm:
553         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
554         (WebCore::readURLAlongsideAttachmentIfNecessary):
555         (WebCore::prefersAttachmentRepresentation):
556         (WebCore::Pasteboard::read):
557         (WebCore::Pasteboard::readRespectingUTIFidelities):
558
559 2019-04-01  Antti Koivisto  <antti@apple.com>
560
561         Trying to scroll the compose pane on gmail.com scrolls the message list behind
562         https://bugs.webkit.org/show_bug.cgi?id=196426
563         <rdar://problem/49402667>
564
565         Reviewed by Darin Adler.
566
567         Test: fast/scrolling/ios/event-region-visibility-hidden.html
568
569         We fail to gather event region from desdendants of non-overflowing elements with 'visibility:hidden'.
570
571         * rendering/RenderBlock.cpp:
572         (WebCore::RenderBlock::paintObject):
573
574         Skip the subtree walk only if the current region covers the box already.
575
576         * rendering/RenderLayer.cpp:
577         (WebCore::RenderLayer::paintList):
578
579         Remove the (wrong) optimization, we bail out quickly on first renderer if possible so this is not high value.
580
581 2019-04-01  Emilio Cobos Álvarez  <emilio@crisal.io>
582
583         Be less strict about closing blocks in attribute and functional pseudo-element selectors.
584         https://bugs.webkit.org/show_bug.cgi?id=142167
585
586         Reviewed by Antti Koivisto.
587
588         This was also an issue for, e.g., "::slotted(foo", turns out.
589
590         This matches Chromium, Firefox, and the spec:
591
592         https://drafts.csswg.org/css-syntax/#parse-error:
593
594         > Certain points in the parsing algorithm are said to be parse errors. The error
595         > handling for parse errors is well-defined: user agents must either act as
596         > described below when encountering such problems, or must abort processing at
597         > the first error that they encounter for which they do not wish to apply the
598         > rules described below.
599
600         https://drafts.csswg.org/css-syntax/#consume-simple-block:
601
602         > <EOF-token>
603         >   This is a parse error. Return the block.
604
605         Tests: web-platform-tests/dom/nodes/selectors.js (and probably others)
606
607         * css/parser/CSSSelectorParser.cpp:
608         (WebCore::CSSSelectorParser::consumeAttribute):
609         (WebCore::CSSSelectorParser::consumePseudo):
610
611 2019-04-01  Pablo Saavedra  <psaavedra@igalia.com>
612
613         Build failure after r243644 in GTK Linux 64-bit stable builds
614         https://bugs.webkit.org/show_bug.cgi?id=196440
615
616         Reviewed by Philippe Normand.
617
618         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
619         (WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
620
621 2019-03-31  Manuel Rego Casasnovas  <rego@igalia.com>
622
623         Scroll position gets reset when overflow:scroll is inside grid
624         https://bugs.webkit.org/show_bug.cgi?id=196337
625         <rdar://problem/49385784>
626
627         Reviewed by Simon Fraser.
628
629         Fix scroll position when there are changes inside a grid item with "overflow: scroll".
630
631         Test: fast/css-grid-layout/grid-item-content-scroll-position.html
632
633         * rendering/RenderGrid.cpp:
634         (WebCore::RenderGrid::layoutBlock): Use beginUpdateScrollInfoAfterLayoutTransaction()
635         and endAndCommitUpdateScrollInfoAfterLayoutTransaction().
636
637 2019-03-31  Ryosuke Niwa  <rniwa@webkit.org>
638
639         Reduce the size of Node::deref by eliminating an explicit parentNode check
640         https://bugs.webkit.org/show_bug.cgi?id=195776
641
642         Reviewed by Darin Adler.
643
644         Address post-commit review comments.
645
646         * dom/Document.cpp:
647         (WebCore::Document::removedLastRef):
648         * dom/Node.cpp:
649         (WebCore::Node::~Node):
650         (WebCore::Node::removedLastRef):
651         * dom/Node.h:
652         (WebCore::Node::deref):
653         (WebCore::Node::setParentNode):
654
655 2019-03-31  Sam Weinig  <weinig@apple.com>
656
657         Remove more i386 specific configurations
658         https://bugs.webkit.org/show_bug.cgi?id=196430
659
660         Reviewed by Alexey Proskuryakov.
661
662         * Configurations/FeatureDefines.xcconfig:
663         ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
664
665 2019-03-31  Andy Estes  <aestes@apple.com>
666
667         [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
668         https://bugs.webkit.org/show_bug.cgi?id=196433
669         <rdar://problem/49293305>
670
671         Reviewed by Tim Horton.
672
673         When ResourceLoader would encounter a response with a MIME type that QuickLook supports, the
674         response would be implicitly allowed and a QuickLook preview would be generated. After
675         generating, the client's navigation response policy delegate would be notified of the
676         preview response, but not the underlying response. Notably, the preview response has a URL
677         scheme of "x-apple-ql-id", does not include any underlying HTTP headers, and usually has a
678         MIME type of "text/html" or "application/pdf" rather than the underlying response MIME type.
679
680         To allow clients to make better navigation response policy decisions, this patch changes the
681         above behavior for WKWebView clients that have linked against a version of WebKit that
682         includes this change. Rather than notifying the client's navigation response policy delegate
683         of the preview response, we notify the client of the underlying response. Only if the client
684         responds with a policy of "allow" will the QuickLook preview response be loaded (without
685         another call to the navigation response policy delegate).
686
687         Non-WKWebView clients and clients that have linked against a version of WebKit that does not
688         include this change will retain the original behavior.
689
690         Covered by existing layout tests and new and existing API tests.
691
692         * WebCore.xcodeproj/project.pbxproj:
693         * loader/SubresourceLoader.cpp:
694         (WebCore::SubresourceLoader::shouldCreatePreviewLoaderForResponse const):
695         (WebCore::SubresourceLoader::didReceiveResponse):
696         * loader/ios/PreviewLoader.h:
697         * loader/ios/PreviewLoader.mm:
698         (-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
699         (-[WebPreviewLoader _loadPreviewIfNeeded]):
700         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
701         (-[WebPreviewLoader connectionDidFinishLoading:]):
702         (-[WebPreviewLoader connection:didFailWithError:]):
703         (WebCore::PreviewLoader::create):
704         (WebCore::PreviewLoader::didReceiveResponse):
705         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]): Deleted.
706         (WebCore::PreviewLoader::shouldCreateForMIMEType): Deleted.
707         * page/Settings.yaml:
708         * platform/MIMETypeRegistry.cpp:
709         (WebCore::MIMETypeRegistry::canShowMIMEType):
710         * platform/network/ios/PreviewConverter.h:
711         * platform/network/ios/PreviewConverter.mm:
712         (WebCore::PreviewConverter::supportsMIMEType):
713
714 2019-03-29  Dean Jackson  <dino@apple.com>
715
716         gl.readPixels with type gl.FLOAT does not work
717         https://bugs.webkit.org/show_bug.cgi?id=171432
718         <rdar://problem/31905150>
719
720         Reviewed by Antoine Quint.
721
722         Our validation code was identifying readPixels of
723         type FLOAT as invalid, for three reasons:
724         - we didn't support the FLOAT type at all.
725         - we only allowed the combination of RGBA and
726         UNSIGNED_BYTE in WebGL 1 [*].
727         - if we had a framebuffer of format RGBA, we assumed
728         we could only read into a Uint8 ArrayBuffer.
729
730         [*] This bug isn't completely fixed, so I opened
731         https://bugs.webkit.org/show_bug.cgi?id=196418
732
733         Test: fast/canvas/webgl/readPixels-float.html
734
735         * html/canvas/WebGLRenderingContextBase.cpp:
736         (WebCore::WebGLRenderingContextBase::readPixels):
737         - flip the logic in a conditional that was clearly wrong yet
738           thankfully had no impact.
739         - support type FLOAT when the relevant extension is enabled.
740         - allow FLOAT as a valid type (see new bug above)
741         - create a new macro for CHECK_COMPONENT_COUNT
742         - update the existing macros to not be case statements,
743           so that we can put logic in the switch.
744
745 2019-03-30  Antti Koivisto  <antti@apple.com>
746
747         Try to fix Windows build.
748
749         * platform/graphics/RoundedRect.cpp:
750         (WebCore::approximateAsRegion):
751
752 2019-03-30  Joseph Pecoraro  <pecoraro@apple.com>
753
754         Web Inspector: JSC Sampling Profiler thread not getting subtracted in CPU Usage Timeline
755         https://bugs.webkit.org/show_bug.cgi?id=196419
756         <rdar://problem/49444023>
757
758         Reviewed by Devin Rousso.
759
760         * page/ResourceUsageThread.cpp:
761         (WebCore::ResourceUsageThread::addObserver):
762         We forgot to call the function that would setup platform state
763         allowing us to subtract out the sampling profiler thread.
764
765 2019-03-30  Zalan Bujtas  <zalan@apple.com>
766
767         [ContentChangeObserver] Add iFrame elements to the list of "considered clickable" elements.
768         https://bugs.webkit.org/show_bug.cgi?id=196410
769         <rdar://problem/49436828>
770
771         Reviewed by Simon Fraser.
772
773         163.com constructs an iFrame to display the login pane on hover. This patch ensures that we take iFrames into account while observing for visible content change by considering iFrame elements "clickable".
774         (While iFrames don't necessarily have clickable content, we can't just sit and wait until they are fully loaded.)
775
776         Test: fast/events/touch/ios/content-observation/iframe-is-shown-on-hover.html
777
778         * page/ios/ContentChangeObserver.cpp:
779         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
780
781 2019-03-30  Antti Koivisto  <antti@apple.com>
782
783         Try to fix Windows build.
784
785         * platform/graphics/Region.cpp:
786         * platform/graphics/RoundedRect.cpp:
787
788 2019-03-30  Antti Koivisto  <antti@apple.com>
789
790         Hit-testing of boxes over scrollers should account for border-radius
791         https://bugs.webkit.org/show_bug.cgi?id=195374
792         <rdar://problem/48649993>
793
794         Reviewed by Simon Fraser.
795
796         Test: fast/scrolling/ios/border-radious-event-region.html
797
798         * page/Frame.h:
799         * platform/graphics/GraphicsLayer.cpp:
800         (WebCore::GraphicsLayer::dumpProperties const):
801
802         Testing support.
803
804         * platform/graphics/GraphicsLayerClient.h:
805         * platform/graphics/RoundedRect.cpp:
806         (WebCore::approximateAsRegion):
807
808         Add a function to approximate RoundedRects as Regions.
809         It cuts away rectangles from the corners following the corner shapes.
810         More rectangles are cut for larger radii.
811
812         * platform/graphics/RoundedRect.h:
813         * rendering/RenderBlock.cpp:
814         (WebCore::RenderBlock::paintObject):
815
816         Use the new interface to get rounded corners right.
817         In rectangle case this takes optimized paths.
818
819         * rendering/RenderLayerCompositor.cpp:
820         (WebCore::RenderLayerCompositor::layerTreeAsText):
821         * testing/Internals.cpp:
822         (WebCore::toLayerTreeFlags):
823         * testing/Internals.h:
824         * testing/Internals.idl:
825
826 2019-03-29  Zalan Bujtas  <zalan@apple.com>
827
828         [ContentChangeObserver] Expand DOM timer observation to 350ms
829         https://bugs.webkit.org/show_bug.cgi?id=196411
830         <rdar://problem/49391144>
831
832         Reviewed by Simon Fraser.
833
834         imdb.com main page has 350ms hover intent timer to bring up the hover menus around the search bar.
835
836         Test: fast/events/touch/ios/content-observation/350ms-hover-intent.html
837
838         * page/ios/ContentChangeObserver.cpp:
839
840 2019-03-29  John Wilander  <wilander@apple.com>
841
842         Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
843         https://bugs.webkit.org/show_bug.cgi?id=196407
844         <rdar://problem/47859936>
845
846         Reviewed by Brent Fulgham.
847
848         Test: http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html
849
850         This patch removes old code for the batching into "statistics updated" calls.
851         Since the move of Resource Load Statistics to the network process, all such
852         collection is done directly through dedicated calls to the network process.
853
854         The remaining functionality was renamed to make it more clear, i.e.
855         ResourceLoadObserver::notifyObserver() renamed to
856         ResourceLoadObserver::updateCentralStatisticsStore().
857
858         * loader/ResourceLoadObserver.cpp:
859         (WebCore::ResourceLoadObserver::setStatisticsUpdatedCallback):
860         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
861         (WebCore::ResourceLoadObserver::logSubresourceLoading):
862         (WebCore::ResourceLoadObserver::logWebSocketLoading):
863         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
864         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
865         (WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
866         (WebCore::ResourceLoadObserver::clearState):
867         (WebCore::ResourceLoadObserver::setNotificationCallback): Deleted.
868         (WebCore::ResourceLoadObserver::ResourceLoadObserver): Deleted.
869         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Deleted.
870         (WebCore::ResourceLoadObserver::notifyObserver): Deleted.
871         * loader/ResourceLoadObserver.h:
872         * testing/Internals.cpp:
873         (WebCore::Internals::notifyResourceLoadObserver):
874
875 2019-03-29  Chris Dumez  <cdumez@apple.com>
876
877         Make someWindow.frames, .self, .window always return someWindow
878         https://bugs.webkit.org/show_bug.cgi?id=195406
879
880         Reviewed by Alex Christensen.
881
882         Make someWindow.frames, .self, .window always return someWindow. Previously, they
883         would return null when the window would lose its browsing context.
884
885         This aligns our behavior with Firefox and the HTML specification:
886         - https://github.com/whatwg/html/pull/4410
887
888         Chrome has also recently aligned with Firefox and the HTML specification here so
889         it makes sense for WebKit to follow.
890
891         No new tests, rebaselined existing tests.
892
893         * bindings/js/JSDOMWindowCustom.cpp:
894         (WebCore::JSDOMWindow::self const):
895         (WebCore::JSDOMWindow::window const):
896         (WebCore::JSDOMWindow::frames const):
897         * page/DOMWindow.cpp:
898         (WebCore::DOMWindow::focus):
899         * page/DOMWindow.h:
900         * page/DOMWindow.idl:
901
902 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
903
904         Delete WebMetal implementation in favor of WebGPU
905         https://bugs.webkit.org/show_bug.cgi?id=195418
906
907         Reviewed by Dean Jackson.
908
909         WebMetal was only ever intended to be a proof-of-concept, and was never intended to be shipped.
910         Now that our WebGPU implementation is achieving good functionality, we're hitting conflicts
911         because we have both implementations. We should delete the non-standard implementation in favor
912         of the standards-based implementation.
913
914         Deletes relevant tests.
915
916         * CMakeLists.txt:
917         * Configurations/FeatureDefines.xcconfig:
918         * DerivedSources-input.xcfilelist:
919         * DerivedSources-output.xcfilelist:
920         * DerivedSources.make:
921         * Sources.txt:
922         * SourcesCocoa.txt:
923         * WebCore.xcodeproj/project.pbxproj:
924         * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Removed.
925         * bindings/js/JSWebMetalRenderingContextCustom.cpp: Removed.
926         * bindings/js/WebCoreBuiltinNames.h:
927         * dom/Document.cpp:
928         (WebCore::Document::getCSSCanvasContext):
929         * dom/Document.h:
930         * dom/Document.idl:
931         * html/HTMLCanvasElement.cpp:
932         (WebCore::HTMLCanvasElement::getContext):
933         (WebCore::HTMLCanvasElement::isWebMetalType): Deleted.
934         (WebCore::HTMLCanvasElement::createContextWebMetal): Deleted.
935         (WebCore::HTMLCanvasElement::getContextWebMetal): Deleted.
936         * html/HTMLCanvasElement.h:
937         * html/HTMLCanvasElement.idl:
938         * html/canvas/CanvasRenderingContext.h:
939         (WebCore::CanvasRenderingContext::isWebGPU const):
940         (WebCore::CanvasRenderingContext::isWebMetal const): Deleted.
941         * html/canvas/WebMetalBuffer.cpp: Removed.
942         * html/canvas/WebMetalBuffer.h: Removed.
943         * html/canvas/WebMetalBuffer.idl: Removed.
944         * html/canvas/WebMetalCommandBuffer.cpp: Removed.
945         * html/canvas/WebMetalCommandBuffer.h: Removed.
946         * html/canvas/WebMetalCommandBuffer.idl: Removed.
947         * html/canvas/WebMetalCommandQueue.cpp: Removed.
948         * html/canvas/WebMetalCommandQueue.h: Removed.
949         * html/canvas/WebMetalCommandQueue.idl: Removed.
950         * html/canvas/WebMetalComputeCommandEncoder.cpp: Removed.
951         * html/canvas/WebMetalComputeCommandEncoder.h: Removed.
952         * html/canvas/WebMetalComputeCommandEncoder.idl: Removed.
953         * html/canvas/WebMetalComputePipelineState.cpp: Removed.
954         * html/canvas/WebMetalComputePipelineState.h: Removed.
955         * html/canvas/WebMetalComputePipelineState.idl: Removed.
956         * html/canvas/WebMetalDepthStencilDescriptor.cpp: Removed.
957         * html/canvas/WebMetalDepthStencilDescriptor.h: Removed.
958         * html/canvas/WebMetalDepthStencilDescriptor.idl: Removed.
959         * html/canvas/WebMetalDepthStencilState.cpp: Removed.
960         * html/canvas/WebMetalDepthStencilState.h: Removed.
961         * html/canvas/WebMetalDepthStencilState.idl: Removed.
962         * html/canvas/WebMetalDrawable.cpp: Removed.
963         * html/canvas/WebMetalDrawable.h: Removed.
964         * html/canvas/WebMetalDrawable.idl: Removed.
965         * html/canvas/WebMetalEnums.cpp: Removed.
966         * html/canvas/WebMetalEnums.h: Removed.
967         * html/canvas/WebMetalEnums.idl: Removed.
968         * html/canvas/WebMetalFunction.cpp: Removed.
969         * html/canvas/WebMetalFunction.h: Removed.
970         * html/canvas/WebMetalFunction.idl: Removed.
971         * html/canvas/WebMetalLibrary.cpp: Removed.
972         * html/canvas/WebMetalLibrary.h: Removed.
973         * html/canvas/WebMetalLibrary.idl: Removed.
974         * html/canvas/WebMetalRenderCommandEncoder.cpp: Removed.
975         * html/canvas/WebMetalRenderCommandEncoder.h: Removed.
976         * html/canvas/WebMetalRenderCommandEncoder.idl: Removed.
977         * html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Removed.
978         * html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Removed.
979         * html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Removed.
980         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Removed.
981         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Removed.
982         * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Removed.
983         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Removed.
984         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Removed.
985         * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Removed.
986         * html/canvas/WebMetalRenderPassDescriptor.cpp: Removed.
987         * html/canvas/WebMetalRenderPassDescriptor.h: Removed.
988         * html/canvas/WebMetalRenderPassDescriptor.idl: Removed.
989         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Removed.
990         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Removed.
991         * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Removed.
992         * html/canvas/WebMetalRenderPipelineDescriptor.cpp: Removed.
993         * html/canvas/WebMetalRenderPipelineDescriptor.h: Removed.
994         * html/canvas/WebMetalRenderPipelineDescriptor.idl: Removed.
995         * html/canvas/WebMetalRenderPipelineState.cpp: Removed.
996         * html/canvas/WebMetalRenderPipelineState.h: Removed.
997         * html/canvas/WebMetalRenderPipelineState.idl: Removed.
998         * html/canvas/WebMetalRenderingContext.cpp: Removed.
999         * html/canvas/WebMetalRenderingContext.h: Removed.
1000         * html/canvas/WebMetalRenderingContext.idl: Removed.
1001         * html/canvas/WebMetalSize.h: Removed.
1002         * html/canvas/WebMetalSize.idl: Removed.
1003         * html/canvas/WebMetalTexture.cpp: Removed.
1004         * html/canvas/WebMetalTexture.h: Removed.
1005         * html/canvas/WebMetalTexture.idl: Removed.
1006         * html/canvas/WebMetalTextureDescriptor.cpp: Removed.
1007         * html/canvas/WebMetalTextureDescriptor.h: Removed.
1008         * html/canvas/WebMetalTextureDescriptor.idl: Removed.
1009         * inspector/InspectorCanvas.cpp:
1010         (WebCore::InspectorCanvas::buildObjectForCanvas):
1011         * inspector/agents/InspectorCanvasAgent.cpp:
1012         (WebCore::InspectorCanvasAgent::requestContent):
1013         (WebCore::contextAsScriptValue):
1014         * page/RuntimeEnabledFeatures.h:
1015         (WebCore::RuntimeEnabledFeatures::setWebMetalEnabled): Deleted.
1016         (WebCore::RuntimeEnabledFeatures::webMetalEnabled const): Deleted.
1017         * platform/Logging.h:
1018         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1019         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
1020         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1021         * platform/graphics/cocoa/WebMetalLayer.h: Removed.
1022         * platform/graphics/cocoa/WebMetalLayer.mm: Removed.
1023         * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Removed.
1024         * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Removed.
1025         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Removed.
1026         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Removed.
1027         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Removed.
1028         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Removed.
1029         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Removed.
1030         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Removed.
1031         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Removed.
1032         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Removed.
1033         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Removed.
1034         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Removed.
1035         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Removed.
1036         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Removed.
1037         * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Removed.
1038         * platform/graphics/gpu/legacy/GPULegacyDevice.h: Removed.
1039         * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Removed.
1040         * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Removed.
1041         * platform/graphics/gpu/legacy/GPULegacyEnums.h: Removed.
1042         * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Removed.
1043         * platform/graphics/gpu/legacy/GPULegacyFunction.h: Removed.
1044         * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Removed.
1045         * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Removed.
1046         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Removed.
1047         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Removed.
1048         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Removed.
1049         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Removed.
1050         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Removed.
1051         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Removed.
1052         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Removed.
1053         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Removed.
1054         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Removed.
1055         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Removed.
1056         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Removed.
1057         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Removed.
1058         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Removed.
1059         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Removed.
1060         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Removed.
1061         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Removed.
1062         * platform/graphics/gpu/legacy/GPULegacySize.h: Removed.
1063         * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Removed.
1064         * platform/graphics/gpu/legacy/GPULegacyTexture.h: Removed.
1065         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Removed.
1066         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Removed.
1067         * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Removed.
1068         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Removed.
1069         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Removed.
1070         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Removed.
1071         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Removed.
1072         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Removed.
1073         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Removed.
1074         * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Removed.
1075         * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Removed.
1076         * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Removed.
1077         * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Removed.
1078         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Removed.
1079         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Removed.
1080         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Removed.
1081         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Removed.
1082         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Removed.
1083         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Removed.
1084         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Removed.
1085         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Removed.
1086         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Removed.
1087         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Removed.
1088         * testing/InternalSettings.cpp:
1089         (WebCore::InternalSettings::Backup::Backup):
1090         (WebCore::InternalSettings::Backup::restoreTo):
1091         (WebCore::InternalSettings::setWebMetalEnabled): Deleted.
1092         * testing/InternalSettings.h:
1093         * testing/InternalSettings.idl:
1094
1095 2019-03-29  Devin Rousso  <drousso@apple.com>
1096
1097         Web Inspector: add fast returns for instrumentation hooks that have no affect before a frontend is connected
1098         https://bugs.webkit.org/show_bug.cgi?id=196382
1099         <rdar://problem/49403417>
1100
1101         Reviewed by Joseph Pecoraro.
1102
1103         Ensure that all instrumentation hooks use `FAST_RETURN_IF_NO_FRONTENDS` or check that
1104         `developerExtrasEnabled`. There should be no activity to/from any inspector objects until
1105         developer extras are enabled.
1106
1107         * inspector/InspectorInstrumentation.h:
1108         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
1109         (WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSP):
1110         (WebCore::InspectorInstrumentation::domContentLoadedEventFired):
1111         (WebCore::InspectorInstrumentation::loadEventFired):
1112         (WebCore::InspectorInstrumentation::frameDetachedFromParent):
1113         (WebCore::InspectorInstrumentation::loaderDetachedFromFrame):
1114         (WebCore::InspectorInstrumentation::frameStartedLoading):
1115         (WebCore::InspectorInstrumentation::frameStoppedLoading):
1116         (WebCore::InspectorInstrumentation::frameScheduledNavigation):
1117         (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
1118         * inspector/InspectorInstrumentation.cpp:
1119         (WebCore::InspectorInstrumentation::frameWindowDiscardedImpl):
1120         (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
1121         (WebCore::InspectorInstrumentation::didFailLoadingImpl):
1122         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
1123         (WebCore::InspectorInstrumentation::consoleCountImpl):
1124         (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
1125         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
1126
1127         * inspector/agents/WebConsoleAgent.cpp:
1128         (WebCore::WebConsoleAgent::frameWindowDiscarded):
1129
1130 2019-03-29  Chris Dumez  <cdumez@apple.com>
1131
1132         Set window.closed immediately when close() is invoked
1133         https://bugs.webkit.org/show_bug.cgi?id=195409
1134
1135         Reviewed by Alex Christensen.
1136
1137         Window.closed should return true if it is closing:
1138         - https://html.spec.whatwg.org/#dom-window-closed
1139
1140         Window.close() sets the 'is closing' flag to true synchronously, as per:
1141         - https://html.spec.whatwg.org/#dom-window-close (step 3.1)
1142
1143         No new tests, rebaselined existing tests.
1144
1145         * page/DOMWindow.cpp:
1146         (WebCore::DOMWindow::closed const):
1147
1148 2019-03-29  Zalan Bujtas  <zalan@apple.com>
1149
1150         [Simple line layout] Turn off inline boxtree generation for multiline content
1151         https://bugs.webkit.org/show_bug.cgi?id=196404
1152         <rdar://problem/49234033>
1153
1154         Reviewed by Simon Fraser.
1155
1156         Currently simple line layout can't provide the correct line breaking context to the inline tree when the boxtree is
1157         generated using the simple line runs. This patch limits the generation of such trees to single lines. Multiline content will
1158         go through the "let's layout this content again" codepath.
1159         This patch fixes disappearing content on Questar.
1160
1161         Test: fast/text/simple-line-layout-and-multiline-inlineboxtree.html
1162
1163         * rendering/SimpleLineLayoutFunctions.cpp:
1164         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
1165
1166 2019-03-29  Justin Fan  <justin_fan@apple.com>
1167
1168         [Web GPU] Replace unsigned longs in WebGPU with uint64_t
1169         https://bugs.webkit.org/show_bug.cgi?id=196401
1170
1171         Reviewed by Myles C. Maxfield.
1172
1173         Unsigned long is not guaranteed to be 64 bits on all platforms. In addition, rowPitch is updated
1174         to u32 in the API and the implementation to match.
1175
1176         No new tests. No new behavior.
1177
1178         * Modules/webgpu/WebGPUBuffer.cpp:
1179         (WebCore::WebGPUBuffer::setSubData):
1180         * Modules/webgpu/WebGPUBuffer.h:
1181         * Modules/webgpu/WebGPUBufferBinding.h:
1182         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1183         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
1184         * Modules/webgpu/WebGPUCommandEncoder.h:
1185         * Modules/webgpu/WebGPUCommandEncoder.idl:
1186         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1187         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1188         * Modules/webgpu/WebGPURenderPassEncoder.h:
1189         * platform/graphics/gpu/GPUBindGroupLayout.h:
1190         * platform/graphics/gpu/GPUBuffer.h:
1191         (WebCore::GPUBuffer::byteLength const):
1192         * platform/graphics/gpu/GPUBufferBinding.h:
1193         * platform/graphics/gpu/GPUBufferDescriptor.h:
1194         * platform/graphics/gpu/GPUCommandBuffer.h:
1195         * platform/graphics/gpu/GPURenderPassEncoder.h:
1196         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
1197         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1198         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1199         (WebCore::GPUBuffer::GPUBuffer):
1200         (WebCore::GPUBuffer::setSubData):
1201         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1202         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
1203         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1204         (WebCore::GPURenderPassEncoder::setVertexBuffers):
1205
1206 2019-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1207
1208         REGRESSION (r243250): Text interactions are no longer suppressed when editing in some websites
1209         https://bugs.webkit.org/show_bug.cgi?id=196378
1210         <rdar://problem/49231299>
1211
1212         Reviewed by Simon Fraser.
1213
1214         Enabling async overflow scrolling by default in r243250 exposed an issue with hidden editable area detection
1215         heuristics. Currently, an empty value for RenderLayer::selfClipRect is used to determine whether the layer
1216         enclosing the editable element or form control is completely clipped by a parent (in other words, the clip rect
1217         is empty). With async overflow scrolling, the enclosing layer of the editable element (as seen in the websites
1218         affected by this bug) will now be a clipping root for painting, since it is composited. This means selfClipRect
1219         returns a non-empty rect despite the layer being entirely clipped, which negates the heuristic.
1220
1221         To address this, we adjust the clipping heuristic to instead walk up the layer tree (crossing frame boundaries)
1222         and look for enclosing ancestors with overflow clip. For each layer we find with an overflow clip, compute the
1223         clip rect of the previous layer relative to the ancestor with overflow clip. If the clipping rect is empty, we
1224         know that the layer is hidden.
1225
1226         This isn't a perfect strategy, since it may still report false negatives (reporting a layer as visible when it
1227         is not) in some cases. One such edge case is a series of overflow hidden containers, nested in such a way that
1228         each container is only partially clipped relative to its ancestor, but the deepest layer is completely clipped
1229         relative to the topmost layer. However, this heuristic is relatively cheap (entailing a layer tree walk at
1230         worst) and works for common use cases on the web without risking scenarios in which text selection that
1231         shouldn't be suppressed ends up becoming suppressed.
1232
1233         Test: editing/selection/ios/hide-selection-in-textarea-with-transform.html
1234
1235         * rendering/RenderLayer.cpp:
1236         (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
1237
1238 2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>
1239
1240         [Curl] Add Server Trust Evaluation Support.
1241         https://bugs.webkit.org/show_bug.cgi?id=191646
1242
1243         Reviewed by Fujii Hironori.
1244
1245         Tests: http/tests/ssl/iframe-upgrade.https.html
1246                http/tests/ssl/mixedContent/insecure-websocket.html
1247                http/tests/ssl/upgrade-origin-usage.html
1248
1249         * platform/network/curl/AuthenticationChallenge.h:
1250         * platform/network/curl/AuthenticationChallengeCurl.cpp:
1251         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
1252         (WebCore::AuthenticationChallenge::protectionSpaceForPasswordBased):
1253         (WebCore::AuthenticationChallenge::protectionSpaceForServerTrust):
1254         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle): Deleted.
1255         * platform/network/curl/CurlContext.cpp:
1256         (WebCore::CurlHandle::disableServerTrustEvaluation):
1257         * platform/network/curl/CurlContext.h:
1258         * platform/network/curl/CurlRequest.cpp:
1259         (WebCore::CurlRequest::setupTransfer):
1260         * platform/network/curl/CurlRequest.h:
1261         (WebCore::CurlRequest::disableServerTrustEvaluation):
1262
1263 2019-03-29  Ryosuke Niwa  <rniwa@webkit.org>
1264
1265         Pasting a table from Confluence strip of table cell content
1266         https://bugs.webkit.org/show_bug.cgi?id=196390
1267
1268         Reviewed by Antti Koivisto.
1269
1270         The bug was ultimately caused by FrameView of the document we use to sanitize the pasteboard content
1271         having 0px by 0px dimension. This caused div with `overflow-x: auto` surrounding a table to have
1272         the height of 0px. Because StyledMarkupAccumulator::renderedTextRespectingRange uses TextIterator
1273         to serialize a text node and this div was an ancestor of the text node, TextIterator::handleTextNode
1274         ended up exiting early.
1275
1276         Fixed the bug by giving FrameView, which is used to sanitize the content, a dimension of 800px by 600px.
1277
1278         Using TextIteratorIgnoresStyleVisibility is not a great alternative since removing invisible content
1279         during paste is an important privacy feature.
1280
1281         Test: editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin.html
1282
1283         * editing/markup.cpp:
1284         (WebCore::createPageForSanitizingWebContent):
1285
1286 2019-03-29  Antoine Quint  <graouts@apple.com>
1287
1288         WebKitTestRunner crashes when running pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
1289         https://bugs.webkit.org/show_bug.cgi?id=196345
1290
1291         Reviewed by Dean Jackson.
1292
1293         An enum used within a WTF::OptionSet needs to have only power-of-two values that are larger than 0.
1294
1295         * platform/TouchAction.h:
1296         * rendering/style/StyleRareNonInheritedData.h:
1297
1298 2019-03-29  Michael Catanzaro  <mcatanzaro@igalia.com>
1299
1300         HTMLInputElement::setEditingValue should not fail if renderer doesn't exist
1301         https://bugs.webkit.org/show_bug.cgi?id=195708
1302
1303         Reviewed by Wenson Hsieh.
1304
1305         HTMLInputElement::setEditingValue currently returns early if the element's renderer() is
1306         null. This is causing the Epiphany password manager to fail to remember passwords on
1307         https://www.geico.com/ except for navigations through page cache.
1308
1309         This check was originally added to avoid some assertion, but I don't know which one, and
1310         there's definitely not any assertion hit nowadays in this case. Probably there are more
1311         guards checking if renderer() is null elsewhere in the code nowadays, closer to where it's
1312         really needed.
1313
1314         Test: fast/forms/editing-value-null-renderer.html
1315
1316         * html/HTMLInputElement.cpp:
1317         (WebCore::HTMLInputElement::setEditingValue):
1318
1319 2019-03-29  Chris Dumez  <cdumez@apple.com>
1320
1321         Unreviewed, rebaseline WPT test after r243638.
1322
1323         * DerivedSources-input.xcfilelist:
1324         * DerivedSources-output.xcfilelist:
1325
1326 2019-03-28  Antoine Quint  <graouts@apple.com>
1327
1328         All PointerEvent.isTrusted is always false.
1329         https://bugs.webkit.org/show_bug.cgi?id=196075
1330         <rdar://problem/49158778>
1331
1332         Reviewed by Chris Dumez.
1333
1334         Test: pointerevents/ios/pointer-events-is-trusted.html
1335
1336         The constructors we were using for some PointerEvent::create() methods were using initializers which are expected to be used with JS APIs
1337         and thus generate untrusted events. We switch to using constructors using dedicated parameters which will set isTrusted to true.
1338
1339         * dom/PointerEvent.cpp:
1340         (WebCore::PointerEvent::create):
1341         (WebCore::PointerEvent::createPointerCancelEvent):
1342         (WebCore::PointerEvent::PointerEvent):
1343         (WebCore::m_isPrimary):
1344         (WebCore::m_pointerType):
1345         * dom/PointerEvent.h:
1346         * page/PointerCaptureController.cpp:
1347         (WebCore::PointerCaptureController::cancelPointer):
1348
1349 2019-03-29  Philippe Normand  <pnormand@igalia.com>
1350
1351         [GStreamer] imxvpudecoder detection and handling
1352         https://bugs.webkit.org/show_bug.cgi?id=196346
1353
1354         Reviewed by Xabier Rodriguez-Calvar.
1355
1356         When the imxvpudecoder is used, the texture sampling of the
1357         directviv-uploaded texture returns an RGB value, so there's no need
1358         to convert it. This patch also includes a refactoring of the
1359         ImageRotation flag handling. The flag is now computed once only
1360         and stored in an instance variable.
1361
1362         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1363         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1364         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1365         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
1366         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1367         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1368         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1369         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1370         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
1371         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
1372         (WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
1373         (WebCore::texMapFlagFromOrientation): Deleted.
1374         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1375
1376 2019-03-29  Cathie Chen  <cathiechen@igalia.com>
1377
1378         Implement ResizeObserver.
1379         https://bugs.webkit.org/show_bug.cgi?id=157743
1380
1381         Reviewed by Simon Fraser.
1382
1383         Tests: resize-observer/modify-frametree-in-callback.html
1384                resize-observer/multi-frames.html
1385                resize-observer/observe-element-from-other-frame.html
1386                Imported from WPT by https://bugs.webkit.org/show_bug.cgi?id=193821
1387
1388         The data structure: Document has a ResizeObserver slot. ResizeObserver has a ResizeObservation slot.
1389         ResizeObservation is related to one Element and the last reported size.
1390         On the other hand, Element has a ResizeObservation slot.
1391
1392         At the beginning of willDisplayPage, it will check resize observations for current page if:
1393         1. There is FrameView be layout and there are ResizeObservers in this page.
1394         2. m_resizeObserverTimer has been started by observe() or hasSkippedResizeObservers().
1395         During checkResizeObservations(), we'll gatherDocumentsNeedingResizeObservationCheck() first,
1396         then notifyResizeObservers() for each document. During notifyResizeObservers(), it will gather
1397         the m_activeObservations whose size changed and target element deeper than require depth.
1398         The size changed shallower observations are skipped observations which will be delivered
1399         in the next time. And an ErrorEvent will be reported.
1400         After gathering, deliverResizeObservations create entries and invoke the callbacks with them.
1401
1402         The Element from other document could be observed.
1403
1404         * CMakeLists.txt:
1405         * Configurations/FeatureDefines.xcconfig:
1406         * DerivedSources.make:
1407         * Sources.txt:
1408         * WebCore.xcodeproj/project.pbxproj:
1409         * bindings/js/WebCoreBuiltinNames.h:
1410         * dom/Document.cpp:
1411         (WebCore::Document::getParserLocation const):
1412         (WebCore::Document::addResizeObserver):
1413         (WebCore::Document::removeResizeObserver):
1414         (WebCore::Document::hasResizeObservers):
1415         (WebCore::Document::gatherResizeObservations): Gather m_activeObservations at depth and return the shallowest depth.
1416         (WebCore::Document::deliverResizeObservations): Deliver m_activeObservations, generate ResizeObserverEntries, and invoke the m_callbacks.
1417         (WebCore::Document::hasSkippedResizeObservations const): To determine if Document has the size changed but not delivered observations.
1418         (WebCore::Document::setHasSkippedResizeObservations):
1419         (WebCore::Document::scheduleResizeObservations):
1420         * dom/Document.h:
1421         * dom/Element.cpp:
1422         (WebCore::Element::~Element):
1423         (WebCore::Element::disconnectFromResizeObservers):
1424         (WebCore::Element::ensureResizeObserverData):
1425         (WebCore::Element::resizeObserverData):
1426         * dom/Element.h:
1427         * dom/ElementRareData.cpp:
1428         * dom/ElementRareData.h:
1429         (WebCore::ElementRareData::resizeObserverData):
1430         (WebCore::ElementRareData::setResizeObserverData):
1431         (WebCore::ElementRareData::useTypes const):
1432         * page/FrameView.cpp:
1433         (WebCore::FrameView::didLayout):
1434         * page/FrameViewLayoutContext.cpp:
1435         (WebCore::FrameViewLayoutContext::layoutTimerFired): We need to start a ResizeObserver timer here, because for WK1 this might not trigger flushCompositingChanges.
1436         * page/Page.cpp:
1437         (WebCore::Page::Page):
1438         (WebCore::Page::willDisplayPage):
1439         (WebCore::Page::hasResizeObservers const):
1440         (WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Gather the documents with resize observers.
1441         (WebCore::Page::checkResizeObservations): Gather documents then notifyResizeObservers for each document.
1442         (WebCore::Page::scheduleResizeObservations):
1443         (WebCore::Page::notifyResizeObservers): Gather m_activeObservations and deliver them. Report ErrorEvent if it has skipped observations.
1444         * page/Page.h:
1445         (WebCore::Page::setNeedsCheckResizeObservations): Page needs to check ResizeObservations if FrameView layout or m_resizeObserverTimer has been started.
1446         (WebCore::Page::needsCheckResizeObservations const):
1447         * page/PageConsoleClient.cpp:
1448         (WebCore::PageConsoleClient::addMessage):
1449         (WebCore::getParserLocationForConsoleMessage): Deleted.
1450         * page/ResizeObservation.cpp: Added.
1451         (WebCore::ResizeObservation::create):
1452         (WebCore::ResizeObservation::ResizeObservation):
1453         (WebCore::ResizeObservation::~ResizeObservation):
1454         (WebCore::ResizeObservation::updateObservationSize):
1455         (WebCore::ResizeObservation::computeObservedSize const):
1456         (WebCore::ResizeObservation::computeTargetLocation const):
1457         (WebCore::ResizeObservation::computeContentRect const):
1458         (WebCore::ResizeObservation::elementSizeChanged const):
1459         (WebCore::ResizeObservation::targetElementDepth const):
1460         * page/ResizeObservation.h: Copied from Tools/DumpRenderTree/TestOptions.h.
1461         (WebCore::ResizeObservation::target const):
1462         * page/ResizeObserver.cpp: Added.
1463         (WebCore::ResizeObserver::create):
1464         (WebCore::ResizeObserver::ResizeObserver):
1465         (WebCore::ResizeObserver::~ResizeObserver):
1466         (WebCore::ResizeObserver::scheduleObservations):
1467         (WebCore::ResizeObserver::observe):
1468         (WebCore::ResizeObserver::unobserve):
1469         (WebCore::ResizeObserver::disconnect):
1470         (WebCore::ResizeObserver::targetDestroyed):
1471         (WebCore::ResizeObserver::gatherObservations):
1472         (WebCore::ResizeObserver::deliverObservations):
1473         (WebCore::ResizeObserver::removeTarget):
1474         (WebCore::ResizeObserver::removeAllTargets):
1475         (WebCore::ResizeObserver::removeObservation):
1476         (WebCore::ResizeObserver::hasPendingActivity const):
1477         (WebCore::ResizeObserver::activeDOMObjectName const):
1478         (WebCore::ResizeObserver::canSuspendForDocumentSuspension const):
1479         (WebCore::ResizeObserver::stop):
1480         * page/ResizeObserver.h: Added.
1481         (WebCore::ResizeObserver::hasObservations const):
1482         (WebCore::ResizeObserver::hasActiveObservations const):
1483         (WebCore::ResizeObserver::maxElementDepth):
1484         (WebCore::ResizeObserver::hasSkippedObservations const):
1485         (WebCore::ResizeObserver::setHasSkippedObservations):
1486         * page/ResizeObserver.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
1487         * page/ResizeObserverCallback.h: Copied from Tools/DumpRenderTree/TestOptions.h.
1488         * page/ResizeObserverCallback.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
1489         * page/ResizeObserverEntry.h: Copied from Tools/DumpRenderTree/TestOptions.h.
1490         (WebCore::ResizeObserverEntry::create):
1491         (WebCore::ResizeObserverEntry::target const):
1492         (WebCore::ResizeObserverEntry::contentRect const):
1493         (WebCore::ResizeObserverEntry::ResizeObserverEntry):
1494         * page/ResizeObserverEntry.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
1495         * page/Settings.yaml:
1496
1497 2019-03-28  Chris Dumez  <cdumez@apple.com>
1498
1499         Support <object>.contentWindow
1500         https://bugs.webkit.org/show_bug.cgi?id=195562
1501
1502         Reviewed by Sam Weinig.
1503
1504         Support <object>.contentWindow as per:
1505         - https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-object-contentwindow
1506
1507         No new tests, updated / rebaselined existing tests.
1508
1509         * html/HTMLObjectElement.idl:
1510
1511 2019-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
1512
1513         FontFace constructor throws an exception when there is a name which starts with a number
1514         https://bugs.webkit.org/show_bug.cgi?id=196232
1515         <rdar://problem/49293978>
1516
1517         Reviewed by Ryosuke Niwa.
1518
1519         We were technically following the spec, but Chrome and Firefox are both consistent and it was making a website break.
1520         This is just a short-term fix until the underlying https://bugs.webkit.org/show_bug.cgi?id=196381 is fixed.
1521
1522         Test: fast/text/font-face-family.html
1523
1524         * css/FontFace.cpp:
1525         (WebCore::FontFace::setFamily):
1526
1527 2019-03-28  Justin Fan  <justin_fan@apple.com>
1528
1529         [Web GPU] Replace 'unsigned long' with 'unsigned' when implementing u32 variables
1530         https://bugs.webkit.org/show_bug.cgi?id=194618
1531         <rdar://problem/48055796>
1532
1533         Reviewed by Myles C. Maxfield.
1534
1535         WebIDL for "unsigned" on 64-bit is "unsigned long". Update Web GPU to match.
1536
1537         No new tests; no change in behavior.
1538
1539         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
1540         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp:
1541         (WebCore::WHLSL::Metal::calculateVertexBufferIndex):
1542         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h:
1543         * Modules/webgpu/WebGPUBindGroupBinding.h:
1544         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
1545         (WebCore::validateBufferBindingType):
1546         (WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const):
1547         * Modules/webgpu/WebGPUBuffer.cpp:
1548         (WebCore::WebGPUBuffer::setSubData):
1549         * Modules/webgpu/WebGPUBuffer.h:
1550         * Modules/webgpu/WebGPUBufferBinding.h:
1551         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1552         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1553         (WebCore::WebGPURenderPassEncoder::draw):
1554         * Modules/webgpu/WebGPURenderPassEncoder.h:
1555         * platform/graphics/gpu/GPUBindGroupBinding.h:
1556         * platform/graphics/gpu/GPUBindGroupLayout.h:
1557         * platform/graphics/gpu/GPUBufferBinding.h:
1558         * platform/graphics/gpu/GPUExtent3D.h:
1559         * platform/graphics/gpu/GPULimits.h:
1560         * platform/graphics/gpu/GPURenderPassEncoder.h:
1561         * platform/graphics/gpu/GPUTextureDescriptor.h:
1562         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1563         (WebCore::GPUBindGroupLayout::tryCreate):
1564         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1565         (WebCore::GPUBindGroup::tryCreate):
1566         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1567         (WebCore::GPURenderPassEncoder::setVertexBuffers):
1568         (WebCore::GPURenderPassEncoder::draw):
1569         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1570         (WebCore::trySetInputStateForPipelineDescriptor):
1571         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
1572         (WebCore::storageModeForPixelFormatAndSampleCount):
1573
1574 2019-03-28  Ryosuke Niwa  <rniwa@webkit.org>
1575
1576         getBoundingClientRect always returns empty rect on a collapsed range
1577         https://bugs.webkit.org/show_bug.cgi?id=196380
1578
1579         Reviewed by Wenson Hsieh.
1580
1581         The bug was caused by Range::boundingRect merging rects via FloatRect::unite which ignores empty rects.
1582         Use uniteIfNonZero instead to fix the bug. Note that we can't use uniteEvenIfEmpty because that would
1583         set x, y to always 0, 0 as we would end up merging any rect with the initial empty rect.
1584
1585         Test: fast/dom/Range/getBoundingClientRect-on-collapsed-selection-range.html
1586
1587         * dom/Range.cpp:
1588         (WebCore::Range::boundingRect const):
1589
1590 2019-03-28  Justin Fan  <justin_fan@apple.com>
1591
1592         [Web GPU] Prototype compute pipeline with MSL
1593         https://bugs.webkit.org/show_bug.cgi?id=196107
1594         <rdar://problem/46289650>
1595
1596         Reviewed by Myles Maxfield.
1597
1598         Add GPUComputePassEncoder, GPUComputePipeline, and GPUComputePipelineDescriptor.
1599         Implement everything needed to prototype a compute pipeline in Web GPU using Metal shaders and bound resources.
1600
1601         Test: webgpu/compute-squares.html
1602
1603         Add files and symbols:
1604         * CMakeLists.txt:
1605         * DerivedSources-input.xcfilelist:
1606         * DerivedSources-output.xcfilelist:
1607         * DerivedSources.make:
1608         * Sources.txt:
1609         * SourcesCocoa.txt:
1610         * WebCore.xcodeproj/project.pbxproj:
1611         * bindings/js/WebCoreBuiltinNames.h:
1612
1613         Misc fixes:
1614         * Modules/webgpu/WHLSL/WHLSLNameResolver.h: Missing include.
1615         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Missing include.
1616         * Modules/webgpu/WebGPUPipelineStageDescriptor.cpp: Added. Move pipeline stage validation logic here.
1617         (WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const):
1618         * Modules/webgpu/WebGPURenderPipeline.cpp: Remove unnecessary include.
1619         * Modules/webgpu/WebGPURenderPipeline.h:
1620         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp: Add missing inlcude.
1621         (WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const): Moved to WebGPUPipelineStageDescriptor.cpp.
1622         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Add missing include.
1623         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Add missing include.
1624         (WebCore::GPURenderPipeline::GPURenderPipeline): Remove unecessary ref of GPUPipelineLayout.
1625         * platform/text/mac/TextEncodingRegistryMac.mm: Carbon.h was causing ambiguous reference build errors in this file.
1626
1627         Enable creating a GPUComputePassEncoder from a GPUCommandEncoder:
1628         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1629         (WebCore::WebGPUCommandEncoder::beginRenderPass): No longer passing this WebGPUCommandEncoder to pass encoders.
1630         (WebCore::WebGPUCommandEncoder::beginComputePass): Added.
1631         * Modules/webgpu/WebGPUCommandEncoder.h:
1632         * Modules/webgpu/WebGPUCommandEncoder.idl:
1633
1634         Add GPUComputePassEncoder:
1635         * Modules/webgpu/WebGPUComputePassEncoder.cpp: Added.
1636         (WebCore::WebGPUComputePassEncoder::create):
1637         (WebCore::WebGPUComputePassEncoder::WebGPUComputePassEncoder):
1638         (WebCore::WebGPUComputePassEncoder::setPipeline):
1639         (WebCore::WebGPUComputePassEncoder::dispatch):
1640         (WebCore::WebGPUComputePassEncoder::passEncoder):
1641         (WebCore::WebGPUComputePassEncoder::passEncoder const):
1642         * Modules/webgpu/WebGPUComputePassEncoder.h: Added.
1643         * Modules/webgpu/WebGPUComputePassEncoder.idl: Added.
1644         * platform/graphics/gpu/GPUComputePassEncoder.h: Added.
1645         (WebCore::GPUComputePassEncoder::~GPUComputePassEncoder):
1646         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Added.
1647         (WebCore::GPUComputePassEncoder::tryCreate):
1648         (WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
1649         (WebCore::GPUComputePassEncoder::setPipeline):
1650         (WebCore::GPUComputePassEncoder::dispatch): Use a default calculation for threadsPerThreadgroup while MSL is still an accepted shader format.
1651         (WebCore::GPUComputePassEncoder::platformPassEncoder const):
1652         (WebCore::GPUComputePassEncoder::useResource):
1653         (WebCore::GPUComputePassEncoder::setComputeBuffer):
1654
1655         Add GPUComputePipeline:
1656         * Modules/webgpu/WebGPUComputePipeline.cpp: Added.
1657         (WebCore::WebGPUComputePipeline::create):
1658         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
1659         * Modules/webgpu/WebGPUComputePipeline.h: Added.
1660         (WebCore::WebGPUComputePipeline::computePipeline const):
1661         * Modules/webgpu/WebGPUComputePipeline.idl: Added.
1662         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp: Added.
1663         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
1664         * Modules/webgpu/WebGPUComputePipelineDescriptor.h: Added.
1665         * Modules/webgpu/WebGPUComputePipelineDescriptor.idl: Added.
1666         * platform/graphics/gpu/GPUComputePipeline.h: Added.
1667         (WebCore::GPUComputePipeline::platformComputePipeline const):
1668         * platform/graphics/gpu/GPUComputePipelineDescriptor.h: Added.
1669         (WebCore::GPUComputePipelineDescriptor::GPUComputePipelineDescriptor):
1670         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Added.
1671         (WebCore::tryCreateMtlComputeFunction):
1672         (WebCore::tryCreateMTLComputePipelineState):
1673         (WebCore::GPUComputePipeline::tryCreate):
1674         (WebCore::GPUComputePipeline::GPUComputePipeline):
1675
1676         Enable creating a GPUComputePipeline from a GPUDevice:
1677         * Modules/webgpu/WebGPUDevice.cpp:
1678         (WebCore::WebGPUDevice::createComputePipeline const):
1679         * Modules/webgpu/WebGPUDevice.h:
1680         * Modules/webgpu/WebGPUDevice.idl:
1681         * platform/graphics/gpu/GPUDevice.cpp:
1682         (WebCore::GPUDevice::tryCreateComputePipeline const):
1683         * platform/graphics/gpu/GPUDevice.h:
1684
1685         No longer unnecessarily ref the WebGPUCommandEncoder when creating pass encoder:
1686         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1687         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup):
1688         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): Deleted.
1689         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Deleted.
1690         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1691         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1692         (WebCore::WebGPURenderPassEncoder::create):
1693         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
1694         (WebCore::WebGPURenderPassEncoder::setPipeline):
1695         (WebCore::WebGPURenderPassEncoder::passEncoder):
1696         (WebCore::WebGPURenderPassEncoder::passEncoder const):
1697         * Modules/webgpu/WebGPURenderPassEncoder.h:
1698
1699         Updates to GPUBindGroup and *setBindGroup for compute function arguments:
1700         * platform/graphics/gpu/GPUBindGroup.h:
1701         (WebCore::GPUBindGroup::vertexArgsBuffer const):
1702         (WebCore::GPUBindGroup::fragmentArgsBuffer const):
1703         (WebCore::GPUBindGroup::computeArgsBuffer const):
1704         (WebCore::GPUBindGroup::vertexArgsBuffer): Deleted. Const-qualified.
1705         (WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
1706         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1707         (WebCore::tryGetResourceAsMTLSamplerState): Now just returns the MTLSamplerState to reduce reference churning.
1708         (WebCore::GPUBindGroup::tryCreate):
1709         (WebCore::GPUBindGroup::GPUBindGroup):
1710         (WebCore::tryGetResourceAsSampler): Renamed to tryGetResourceAsMTLSamplerState.
1711
1712         Updates to GPUProgrammablePassEncoder and GPURenderPassEncoder:
1713         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1714         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
1715         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
1716         (WebCore::GPUProgrammablePassEncoder::setComputeBuffer): Added.
1717         * platform/graphics/gpu/GPURenderPassEncoder.h:
1718         (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder):
1719         * platform/graphics/gpu/GPURenderPipeline.h:
1720         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Remove unecessary include.
1721         (WebCore::GPUProgrammablePassEncoder::endPass): No longer virtual. Delegates shared behavior for derived classes.
1722         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
1723         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1724         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
1725         (WebCore::GPURenderPassEncoder::setPipeline):
1726         (WebCore::GPURenderPassEncoder::draw):
1727         (WebCore::GPURenderPassEncoder::useResource): These private overrides are called only by base after checking for encoder existence.
1728         (WebCore::GPURenderPassEncoder::setVertexBuffer): Ditto.
1729         (WebCore::GPURenderPassEncoder::setFragmentBuffer): Ditto.
1730         (WebCore::GPURenderPassEncoder::endPass): Deleted. Now handled by base class.
1731
1732 2019-03-27  Jiewen Tan  <jiewen_tan@apple.com>
1733
1734         IDBRequest::dispatchEvent should check nullability of m_transaction before operations that rely on it to be non null
1735         https://bugs.webkit.org/show_bug.cgi?id=196319
1736         <rdar://problem/49355279>
1737
1738         Reviewed by Alex Christensen.
1739
1740         The test that triggers this crash is on Bug 196276.
1741
1742         * Modules/indexeddb/IDBRequest.cpp:
1743         (WebCore::IDBRequest::dispatchEvent):
1744
1745 2019-03-28  Ryosuke Niwa  <rniwa@webkit.org>
1746
1747         Debug assert in DOMSelection::containsNode when node belongs to a different tree
1748         https://bugs.webkit.org/show_bug.cgi?id=196342
1749
1750         Reviewed by Antti Koivisto.
1751
1752         The assertion was wrong. It's possible for Range::compareBoundaryPoints to return WRONG_DOCUMENT_ERR
1753         when the node and the start container belong to two different trees.
1754
1755         Return false in such a case for now since it's unclear (unspecified) what these methods on Selection
1756         should do with respect to shadow trees, preserving the current behavior of release builds.
1757
1758         Test: editing/selection/containsNode-with-no-common-ancestor.html
1759
1760         * page/DOMSelection.cpp:
1761         (WebCore::DOMSelection::containsNode const):
1762
1763 2019-03-28  Tim Horton  <timothy_horton@apple.com>
1764
1765         Fix the !ENABLE(APPLE_PAY) build
1766
1767         * bindings/js/ScriptController.cpp:
1768         (WebCore::ScriptController::shouldAllowUserAgentScripts const):
1769
1770 2019-03-28  Sihui Liu  <sihui_liu@apple.com>
1771
1772         Crash at IDBDatabaseInfo::infoForExistingObjectStore and IDBDatabaseInfo::infoForExistingObjectStore
1773         https://bugs.webkit.org/show_bug.cgi?id=196120
1774         <rdar://problem/39869767>
1775
1776         Reviewed by Ryosuke Niwa.
1777
1778         No new tests because it is unclear how the crash happens. Added release logging to help debug.
1779
1780         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1781         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1782         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1783         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
1784         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
1785
1786 2019-03-28  Devin Rousso  <drousso@apple.com>
1787
1788         Web Inspector: Canvas: unbinding a canvas should always remove the agent as an observer
1789         https://bugs.webkit.org/show_bug.cgi?id=196324
1790         <rdar://problem/49357109>
1791
1792         Reviewed by Matt Baker.
1793
1794         No change in functionality.
1795
1796         * html/CanvasBase.cpp:
1797         (WebCore::CanvasBase::notifyObserversCanvasChanged):
1798         (WebCore::CanvasBase::notifyObserversCanvasResized):
1799         (WebCore::CanvasBase::notifyObserversCanvasDestroyed):
1800
1801         * inspector/agents/InspectorCanvasAgent.cpp:
1802         (WebCore::InspectorCanvasAgent::frameNavigated):
1803         (WebCore::InspectorCanvasAgent::bindCanvas):
1804         (WebCore::InspectorCanvasAgent::unbindCanvas):
1805
1806 2019-03-28  Alicia Boya García  <aboya@igalia.com>
1807
1808         [MSE][GStreamer] Remove dead code in MediaPlayerPrivateGStreamer::doSeek()
1809         https://bugs.webkit.org/show_bug.cgi?id=196352
1810
1811         Reviewed by Xabier Rodriguez-Calvar.
1812
1813         MediaPlayerPrivateGStreamerMSE overrides doSeek() and seek(), so this
1814         branch is never reached.
1815
1816         This patch does not introduce behavior changes.
1817
1818         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1819         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
1820
1821 2019-03-28  Simon Fraser  <simon.fraser@apple.com>
1822
1823         [macOS WK2] Overlays on instagram.com are shifted if you click on a photo after scrolling
1824         https://bugs.webkit.org/show_bug.cgi?id=196330
1825         rdar://problem/49100304
1826
1827         Reviewed by Antti Koivisto.
1828
1829         When we call ScrollingTree::applyLayerPositions() on the main thread after a flush,
1830         we need to ensure that the most recent version of the scrolling tree has been committed,
1831         because it has to have state (like requested scroll position and layout viewport rect)
1832         that match the layer flush.
1833
1834         To fix this we have to have the main thread wait for the commit to complete, so
1835         ThreadedScrollingTree keeps track of a pending commit count, and uses a condition
1836         variable to allow the main thread to safely wait for it to reach zero.
1837
1838         Tracing shows that this works as expected, and the main thread is never blocked for
1839         more than a few tens of microseconds.
1840
1841         Also lock the tree mutex in ScrollingTree::handleWheelEvent(), since we enter the
1842         scrolling tree here and we don't want that racing with applyLayerPositions() on the
1843         main thread.
1844
1845         Test: scrollingcoordinator/mac/fixed-scrolled-body.html
1846
1847         * page/scrolling/ScrollingTree.cpp:
1848         (WebCore::ScrollingTree::handleWheelEvent):
1849         (WebCore::ScrollingTree::applyLayerPositions):
1850         * page/scrolling/ScrollingTree.h:
1851         * page/scrolling/ThreadedScrollingTree.cpp:
1852         (WebCore::ThreadedScrollingTree::commitTreeState):
1853         (WebCore::ThreadedScrollingTree::incrementPendingCommitCount):
1854         (WebCore::ThreadedScrollingTree::decrementPendingCommitCount):
1855         (WebCore::ThreadedScrollingTree::waitForPendingCommits):
1856         (WebCore::ThreadedScrollingTree::applyLayerPositions):
1857         * page/scrolling/ThreadedScrollingTree.h:
1858         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1859         (WebCore::ScrollingCoordinatorMac::commitTreeState):
1860
1861 2019-03-28  Zalan Bujtas  <zalan@apple.com>
1862
1863         [SimpleLineLayout] Disable SLL when text-underline-position is not auto.
1864         https://bugs.webkit.org/show_bug.cgi?id=196338
1865         <rdar://problem/47975167>
1866
1867         Reviewed by Daniel Bates.
1868
1869         Disable simple line layout unconditionally on non-auto text-underline-position content. We don't support it yet.
1870
1871         Test: fast/text/simple-line-layout-with-text-underline-position.html
1872
1873         * rendering/SimpleLineLayout.cpp:
1874         (WebCore::SimpleLineLayout::canUseForStyle):
1875
1876 2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1877
1878         Silence lot of warnings when compiling with clang
1879         https://bugs.webkit.org/show_bug.cgi?id=196310
1880
1881         Reviewed by Michael Catanzaro.
1882
1883         No change in behavior.
1884
1885         * accessibility/AccessibilityObject.h: add missing override
1886         clause.
1887         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1888         (webKitWebSrcChangeState): add missing format string to log.
1889         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: add
1890         missing virtual destructor.
1891         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1892         add missing override clause and remove unused private member.
1893
1894 2019-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1895
1896         [FreeType] Incorrect application of glyph positioning in the Y direction
1897         https://bugs.webkit.org/show_bug.cgi?id=161493
1898
1899         Reviewed by Michael Catanzaro.
1900
1901         Use the first glyph origin as the initial advance of every complex text run.
1902
1903         * platform/graphics/cairo/FontCairo.cpp:
1904         (WebCore::FontCascade::drawGlyphs): Update the yOffset using the height advance.
1905         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1906         (WebCore::GraphicsContextImplCairo::drawGlyphs): Ditto.
1907         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1908         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Set the initial advance.
1909
1910 2019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
1911
1912         [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
1913         https://bugs.webkit.org/show_bug.cgi?id=196336
1914
1915         Reviewed by Tim Horton.
1916
1917         * rendering/RenderMenuList.cpp:
1918         (RenderMenuList::popupDidHide): Added a comment.
1919
1920 2019-03-27  Justin Fan  <justin_fan@apple.com>
1921
1922         [Web GPU] Standardize Web GPU object reference counting and creation logic
1923         https://bugs.webkit.org/show_bug.cgi?id=196183
1924
1925         Reviewed by Dean Jackson.
1926
1927         Make getters return raw refs/pointers and provide const versions if necessary.
1928         All Web GPU objects are non-nullable, but become no-op if invalid, and descriptors are not moved unless needed.
1929
1930         No new tests; no change in behavior.
1931
1932         Getter updates and const qualifications:
1933         * Modules/webgpu/WebGPUAdapter.h:
1934         (WebCore::WebGPUAdapter::options const):
1935         * Modules/webgpu/WebGPUBindGroup.h:
1936         (WebCore::WebGPUBindGroup::bindGroup):
1937         (WebCore::WebGPUBindGroup::bindGroup const): Deleted.
1938         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
1939         (WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const):
1940         * Modules/webgpu/WebGPUBindGroupDescriptor.h:
1941         * Modules/webgpu/WebGPUBindGroupLayout.h:
1942         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
1943         * Modules/webgpu/WebGPUBuffer.h:
1944         (WebCore::WebGPUBuffer::buffer):
1945         (WebCore::WebGPUBuffer::buffer const):
1946         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
1947         (WebCore::WebGPURenderPassDescriptor::tryCreateGPURenderPassDescriptor const):
1948         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1949         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1950         * Modules/webgpu/WebGPUSampler.h:
1951         (WebCore::WebGPUSampler::sampler const):
1952         * Modules/webgpu/WebGPUSwapChain.h:
1953         (WebCore::WebGPUSwapChain::swapChain):
1954         (WebCore::WebGPUSwapChain::swapChain const): Deleted.
1955         * Modules/webgpu/WebGPUTexture.h:
1956         (WebCore::WebGPUTexture::texture):
1957         (WebCore::WebGPUTexture::texture const): Deleted.
1958         * Modules/webgpu/WebGPUTextureView.h:
1959         (WebCore::WebGPUTextureView::texture):
1960         (WebCore::WebGPUTextureView::texture const): Deleted.
1961         * platform/graphics/gpu/GPUBindGroupBinding.h:
1962         * platform/graphics/gpu/GPUBindGroupDescriptor.h:
1963         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1964         (WebCore::tryGetResourceAsMTLSamplerState):
1965
1966         Web GPU object creation logic:
1967         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1968         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
1969         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
1970         (WebCore::WebGPUCommandEncoder::beginRenderPass):
1971         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
1972         * Modules/webgpu/WebGPUCommandEncoder.h:
1973         * Modules/webgpu/WebGPUDevice.cpp:
1974         (WebCore::WebGPUDevice::createBuffer const):
1975         (WebCore::WebGPUDevice::createTexture const):
1976         (WebCore::WebGPUDevice::createPipelineLayout const):
1977         (WebCore::WebGPUDevice::createBindGroup const):
1978         (WebCore::WebGPUDevice::createShaderModule const):
1979         (WebCore::WebGPUDevice::createRenderPipeline const):
1980         (WebCore::WebGPUDevice::getQueue const):
1981         * Modules/webgpu/WebGPUDevice.h:
1982         * Modules/webgpu/WebGPUPipelineLayout.cpp:
1983         (WebCore::WebGPUPipelineLayout::create):
1984         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
1985         * Modules/webgpu/WebGPUPipelineLayout.h:
1986         (WebCore::WebGPUPipelineLayout::pipelineLayout):
1987         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.cpp: 
1988         (WebCore::WebGPUPipelineLayoutDescriptor::tryCreateGPUPipelineLayoutDescriptor const):
1989         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h:
1990         * Modules/webgpu/WebGPUQueue.cpp:
1991         (WebCore::WebGPUQueue::create):
1992         (WebCore::WebGPUQueue::WebGPUQueue):
1993         (WebCore::WebGPUQueue::submit):
1994         * Modules/webgpu/WebGPUQueue.h:
1995         * Modules/webgpu/WebGPUShaderModule.cpp:
1996         (WebCore::WebGPUShaderModule::create):
1997         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
1998         * Modules/webgpu/WebGPUShaderModule.h:
1999         (WebCore::WebGPUShaderModule::module const):
2000         * platform/graphics/gpu/GPUBuffer.h:
2001         * platform/graphics/gpu/GPUDevice.cpp:
2002         (WebCore::GPUDevice::tryCreateBuffer):
2003         (WebCore::GPUDevice::tryCreateTexture const):
2004         (WebCore::GPUDevice::tryCreateShaderModule const):
2005         (WebCore::GPUDevice::tryCreateRenderPipeline const):
2006         (WebCore::GPUDevice::tryGetQueue const):
2007         (WebCore::GPUDevice::createShaderModule const): Deleted.
2008         (WebCore::GPUDevice::createRenderPipeline const): Deleted.
2009         (WebCore::GPUDevice::getQueue const): Deleted.
2010         * platform/graphics/gpu/GPUDevice.h:
2011         * platform/graphics/gpu/GPUPipelineLayout.cpp:
2012         (WebCore::GPUPipelineLayout::create):
2013         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
2014         * platform/graphics/gpu/GPUPipelineLayout.h:
2015         (WebCore::GPUPipelineLayout::bindGroupLayouts const):
2016         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h:
2017         * platform/graphics/gpu/GPURenderPipeline.h:
2018         * platform/graphics/gpu/GPUShaderModule.h:
2019         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2020         (WebCore::GPUBuffer::tryCreate):
2021         (WebCore::GPUBuffer::GPUBuffer):
2022         (WebCore::GPUBuffer::setSubData):
2023         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2024         (WebCore::GPUCommandBuffer::tryCreate):
2025         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2026         (WebCore::GPUDevice::tryCreate):
2027         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2028         (WebCore::GPURenderPipeline::tryCreate):
2029         (WebCore::GPURenderPipeline::GPURenderPipeline):
2030         (WebCore::GPURenderPipeline::create): Deleted.
2031         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
2032         (WebCore::GPUShaderModule::tryCreate):
2033         (WebCore::GPUShaderModule::create): Deleted.
2034
2035         Add WebGPUPipelineLayoutDescriptor.cpp to project:
2036         * Sources.txt:
2037         * WebCore.xcodeproj/project.pbxproj:
2038         
2039 2019-03-27  Shawn Roberts  <sroberts@apple.com>
2040
2041         Unreviewed, rolling out r243346.
2042
2043         Causing timeouts in animation tests across 10 builds
2044
2045         Reverted changeset:
2046
2047         "[Web Animations] JS wrapper may be deleted while animation is
2048         yet to dispatch its finish event"
2049         https://bugs.webkit.org/show_bug.cgi?id=196118
2050         https://trac.webkit.org/changeset/243346
2051
2052 2019-03-27  Zalan Bujtas  <zalan@apple.com>
2053
2054         [ContentChangeObserver] Stop using the global _WKContentChange
2055         https://bugs.webkit.org/show_bug.cgi?id=196288
2056         <rdar://problem/49228081>
2057
2058         Reviewed by Simon Fraser.
2059
2060         This patch ensures that activities on frames don't overwrite the observed state on other frames.  
2061         (Unfortunately the global variable is still used in WebKitLegacy (see webkit.org/b/196286)).
2062
2063         Tests: fast/events/touch/ios/content-observation/remove-subframe-while-observing.html
2064                fast/events/touch/ios/content-observation/subframe.html
2065
2066         * page/ios/ContentChangeObserver.cpp:
2067         (WebCore::ContentChangeObserver::observedContentChange const): Deleted.
2068         * page/ios/ContentChangeObserver.h:
2069         (WebCore::ContentChangeObserver::observedContentChange const):
2070         (WebCore::ContentChangeObserver::setHasNoChangeState):
2071         (WebCore::ContentChangeObserver::setHasIndeterminateState):
2072         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
2073         (WebCore::ContentChangeObserver::setObservedContentState):
2074
2075 2019-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
2076
2077         Remove the SVG tear off objects for SVGPathSeg, SVGPathSegList and SVGAnimatedPathSegList
2078         https://bugs.webkit.org/show_bug.cgi?id=196085
2079
2080         Reviewed by Simon Fraser.
2081
2082         The SVGPathSegList is similar to the other SVGLists, e.g. SVGNUmberList
2083         and SVGPointList except in two things:
2084
2085         1. Its items can be different but they are derived from the same base 
2086            class SVGPathSeg.
2087
2088         2. The SVGPathSeg items are only used for DOM. When drawing or animating
2089            we have to have an SVGPathByteStream and convert it to a Path. Converting
2090            an SVGPathByteStream to SVGPathSeg items and vice versa is expensive.
2091            Building a Path from an SVGPathByteStream is also expensive. So an extra
2092            care needs to be taken for when these conversions happen.
2093
2094         In addition to handling the SVGPathSeg items, SVGPathSegList will manage
2095         the associated SVGPathByteStream and Path objects. SVGPathSegList will be
2096         lazy in getting updated objects when a change happens. For example, when
2097         the byte stream changes, SVGPathSegList will clear its items and nullify
2098         the Path object. But it will not build any of them until they are explicitly
2099         requested.
2100
2101         Like what was done for other SVG properties when removing their tear off
2102         objects, a new accessor, a new animator and a new animation function will
2103         be added for the SVGAnimatedPathSegList.
2104
2105         All the header files of the concrete classes of SVGPathSeg will be removed
2106         because they are small structures which hold some data items and they provide
2107         setters and getters for these items. Here is the new file structures and
2108         their contents:
2109
2110         -- SVGPathSeg.h still has the class SVGPathSeg which is now a superclass
2111            of SVGProperty. 
2112
2113         -- SVGPathSegValue.h will have the template class SVGPathSegValue which 
2114            holds an std::tuple of packed arguments. It provides setters and getters
2115            for these arguments. SVGPathSegValue.h will also have specialized 
2116            classed derived from SVGPathSegValue and hold different arguments.
2117
2118         -- SVGPathSegImpl.h will have the final concrete SVGPathSeg classes.
2119
2120         Note SVGPathSeg concrete classes do not need to have a reference to the
2121         the context SVGPathElement. SVGPathSeg will be owned by its SVGPathSegList
2122         which will be owned by the SVGAnimatedPathSegList which will be owned by
2123         the SVGPathElement.
2124
2125         * Sources.txt:
2126         * WebCore.xcodeproj/project.pbxproj:
2127         * bindings/js/JSSVGPathSegCustom.cpp:
2128         * bindings/scripts/CodeGenerator.pm:
2129         (IsSVGPathSegTypeName):
2130         (IsSVGPathSegType):
2131         * bindings/scripts/CodeGeneratorJS.pm:
2132         (GenerateHeader):
2133         * rendering/svg/SVGPathData.cpp:
2134         (WebCore::pathFromPathElement):
2135         * svg/SVGAnimatedPath.cpp: Removed.
2136         * svg/SVGAnimatedPath.h: Removed.
2137         * svg/SVGAnimatedType.h:
2138         (WebCore::SVGAnimatedType::type const):
2139         * svg/SVGAnimatorFactory.h:
2140         (WebCore::SVGAnimatorFactory::create):
2141         * svg/SVGPathByteStream.h:
2142         (WebCore::SVGPathByteStream::SVGPathByteStream):
2143         This constructor is used by SVGAnimationPathSegListFunction to convert
2144         the 'form', 'to' and 'toAtEndOfDuration' strings to SVGPathByteStreams.
2145
2146         (WebCore::SVGPathByteStream::resize): Deleted.
2147         (WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): Deleted.
2148         (WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Deleted.
2149         (WebCore::SVGPropertyTraits<SVGPathByteStream>::parse): Deleted.
2150         (WebCore::SVGPropertyTraits<SVGPathByteStream>::toString): Deleted.
2151         * svg/SVGPathElement.cpp:
2152         (WebCore::SVGPathElement::SVGPathElement):
2153         (WebCore::SVGPathElement::parseAttribute):
2154         (WebCore::SVGPathElement::svgAttributeChanged):
2155         (WebCore::SVGPathElement::getTotalLength const):
2156         (WebCore::SVGPathElement::getPointAtLength const):
2157         (WebCore::SVGPathElement::getPathSegAtLength const):
2158         (WebCore::SVGPathElement::createSVGPathSegClosePath): Deleted.
2159         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Deleted.
2160         (WebCore::SVGPathElement::createSVGPathSegMovetoRel): Deleted.
2161         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Deleted.
2162         (WebCore::SVGPathElement::createSVGPathSegLinetoRel): Deleted.
2163         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Deleted.
2164         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Deleted.
2165         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Deleted.
2166         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Deleted.
2167         (WebCore::SVGPathElement::createSVGPathSegArcAbs): Deleted.
2168         (WebCore::SVGPathElement::createSVGPathSegArcRel): Deleted.
2169         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Deleted.
2170         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Deleted.
2171         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Deleted.
2172         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Deleted.
2173         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Deleted.
2174         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Deleted.
2175         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Deleted.
2176         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Deleted.
2177         The SVGPathSeg creation functions are moved to the header file.
2178
2179         (WebCore::SVGPathElement::registerAttributes): Deleted.
2180         (WebCore::SVGPathElement::pathByteStream const): Deleted.
2181         (WebCore::SVGPathElement::pathForByteStream const): Deleted.
2182         (WebCore::SVGPathElement::lookupOrCreateDWrapper): Deleted.
2183         (WebCore::SVGPathElement::animatedPropertyWillBeDeleted): Deleted.
2184         (WebCore::SVGPathElement::pathSegList): Deleted.
2185         (WebCore::SVGPathElement::normalizedPathSegList): Deleted.
2186         (WebCore::SVGPathElement::animatedPathSegList): Deleted.
2187         (WebCore::SVGPathElement::animatedNormalizedPathSegList): Deleted.
2188         (WebCore::SVGPathElement::approximateMemoryCost const): Deleted.
2189         (WebCore::SVGPathElement::pathSegListChanged): Deleted.
2190         Managing the SVGPathByteStream and the drawing Path objects will be the
2191         responsibility of SVGPathSegList.
2192
2193         * svg/SVGPathElement.h:
2194         * svg/SVGPathSeg.h:
2195         * svg/SVGPathSegArc.h: Removed.
2196         * svg/SVGPathSegArcAbs.h: Removed.
2197         * svg/SVGPathSegArcRel.h: Removed.
2198         * svg/SVGPathSegClosePath.h: Removed.
2199         * svg/SVGPathSegCurvetoCubic.h: Removed.
2200         * svg/SVGPathSegCurvetoCubicAbs.h: Removed.
2201         * svg/SVGPathSegCurvetoCubicRel.h: Removed.
2202         * svg/SVGPathSegCurvetoCubicSmooth.h: Removed.
2203         * svg/SVGPathSegCurvetoCubicSmoothAbs.h: Removed.
2204         * svg/SVGPathSegCurvetoCubicSmoothRel.h: Removed.
2205         * svg/SVGPathSegCurvetoQuadratic.h: Removed.
2206         * svg/SVGPathSegCurvetoQuadraticAbs.h: Removed.
2207         * svg/SVGPathSegCurvetoQuadraticRel.h: Removed.
2208         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h: Removed.
2209         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h: Removed.
2210         * svg/SVGPathSegImpl.h: Added.
2211         * svg/SVGPathSegLinetoAbs.h: Removed.
2212         * svg/SVGPathSegLinetoHorizontal.h: Removed.
2213         * svg/SVGPathSegLinetoHorizontalAbs.h: Removed.
2214         * svg/SVGPathSegLinetoHorizontalRel.h: Removed.
2215         * svg/SVGPathSegLinetoRel.h: Removed.
2216         * svg/SVGPathSegLinetoVertical.h: Removed.
2217         * svg/SVGPathSegLinetoVerticalAbs.h: Removed.
2218         * svg/SVGPathSegLinetoVerticalRel.h: Removed.
2219         The definition of these classes are now in SVGPathSegImpl.h.
2220
2221         * svg/SVGPathSegList.cpp: Removed.
2222         * svg/SVGPathSegList.h:
2223         * svg/SVGPathSegListBuilder.cpp:
2224         (WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder):
2225         (WebCore::SVGPathSegListBuilder::moveTo):
2226         (WebCore::SVGPathSegListBuilder::lineTo):
2227         (WebCore::SVGPathSegListBuilder::lineToHorizontal):
2228         (WebCore::SVGPathSegListBuilder::lineToVertical):
2229         (WebCore::SVGPathSegListBuilder::curveToCubic):
2230         (WebCore::SVGPathSegListBuilder::curveToCubicSmooth):
2231         (WebCore::SVGPathSegListBuilder::curveToQuadratic):
2232         (WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth):
2233         (WebCore::SVGPathSegListBuilder::arcTo):
2234         (WebCore::SVGPathSegListBuilder::closePath):        
2235         * svg/SVGPathSegListBuilder.h:
2236         The concrete SVGPathSeg classes can now create instances of their classes
2237         without having to go through the SVGPathElement.
2238
2239         * svg/SVGPathSegListSource.cpp:
2240         (WebCore::SVGPathSegListSource::SVGPathSegListSource):
2241         * svg/SVGPathSegListSource.h:
2242         * svg/SVGPathSegListValues.cpp: Removed.
2243         * svg/SVGPathSegListValues.h: Removed.
2244         * svg/SVGPathSegMovetoAbs.h: Removed.
2245         * svg/SVGPathSegMovetoRel.h: Removed.
2246         * svg/SVGPathSegValue.h: Added.
2247         (WebCore::SVGPathSegValue::create):
2248         (WebCore::SVGPathSegValue::clone const):
2249         (WebCore::SVGPathSegValue::SVGPathSegValue):
2250         (WebCore::SVGPathSegValue::argument const):
2251         (WebCore::SVGPathSegValue::setArgument):
2252         (WebCore::SVGPathSegLinetoHorizontal::x const):
2253         (WebCore::SVGPathSegLinetoHorizontal::setX):
2254         (WebCore::SVGPathSegLinetoVertical::y const):
2255         (WebCore::SVGPathSegLinetoVertical::setY):
2256         (WebCore::SVGPathSegSingleCoordinate::x const):
2257         (WebCore::SVGPathSegSingleCoordinate::setX):
2258         (WebCore::SVGPathSegSingleCoordinate::y const):
2259         (WebCore::SVGPathSegSingleCoordinate::setY):
2260         (WebCore::SVGPathSegCurvetoQuadratic::x const):
2261         (WebCore::SVGPathSegCurvetoQuadratic::setX):
2262         (WebCore::SVGPathSegCurvetoQuadratic::y const):
2263         (WebCore::SVGPathSegCurvetoQuadratic::setY):
2264         (WebCore::SVGPathSegCurvetoQuadratic::x1 const):
2265         (WebCore::SVGPathSegCurvetoQuadratic::setX1):
2266         (WebCore::SVGPathSegCurvetoQuadratic::y1 const):
2267         (WebCore::SVGPathSegCurvetoQuadratic::setY1):
2268         (WebCore::SVGPathSegCurvetoCubicSmooth::x const):
2269         (WebCore::SVGPathSegCurvetoCubicSmooth::setX):
2270         (WebCore::SVGPathSegCurvetoCubicSmooth::y const):
2271         (WebCore::SVGPathSegCurvetoCubicSmooth::setY):
2272         (WebCore::SVGPathSegCurvetoCubicSmooth::x2 const):
2273         (WebCore::SVGPathSegCurvetoCubicSmooth::setX2):
2274         (WebCore::SVGPathSegCurvetoCubicSmooth::y2 const):
2275         (WebCore::SVGPathSegCurvetoCubicSmooth::setY2):
2276         (WebCore::SVGPathSegCurvetoCubic::x const):
2277         (WebCore::SVGPathSegCurvetoCubic::setX):
2278         (WebCore::SVGPathSegCurvetoCubic::y const):
2279         (WebCore::SVGPathSegCurvetoCubic::setY):
2280         (WebCore::SVGPathSegCurvetoCubic::x1 const):
2281         (WebCore::SVGPathSegCurvetoCubic::setX1):
2282         (WebCore::SVGPathSegCurvetoCubic::y1 const):
2283         (WebCore::SVGPathSegCurvetoCubic::setY1):
2284         (WebCore::SVGPathSegCurvetoCubic::x2 const):
2285         (WebCore::SVGPathSegCurvetoCubic::setX2):
2286         (WebCore::SVGPathSegCurvetoCubic::y2 const):
2287         (WebCore::SVGPathSegCurvetoCubic::setY2):
2288         (WebCore::SVGPathSegArc::x const):
2289         (WebCore::SVGPathSegArc::setX):
2290         (WebCore::SVGPathSegArc::y const):
2291         (WebCore::SVGPathSegArc::setY):
2292         (WebCore::SVGPathSegArc::r1 const):
2293         (WebCore::SVGPathSegArc::setR1):
2294         (WebCore::SVGPathSegArc::r2 const):
2295         (WebCore::SVGPathSegArc::setR2):
2296         (WebCore::SVGPathSegArc::angle const):
2297         (WebCore::SVGPathSegArc::setAngle):
2298         (WebCore::SVGPathSegArc::largeArcFlag const):
2299         (WebCore::SVGPathSegArc::setLargeArcFlag):
2300         (WebCore::SVGPathSegArc::sweepFlag const):
2301         (WebCore::SVGPathSegArc::setSweepFlag):
2302         * svg/SVGPathSegWithContext.h: Removed.
2303
2304         * svg/SVGPathUtilities.cpp:
2305         (WebCore::buildSVGPathByteStreamFromSVGPathSegList):
2306         (WebCore::buildSVGPathSegListFromByteStream):
2307         (WebCore::buildStringFromByteStream):
2308         (WebCore::buildSVGPathByteStreamFromSVGPathSegListValues): Deleted.
2309         (WebCore::appendSVGPathByteStreamFromSVGPathSeg): Deleted.
2310         (WebCore::buildSVGPathSegListValuesFromByteStream): Deleted.
2311         (WebCore::buildStringFromSVGPathSegListValues): Deleted.
2312         * svg/SVGPathUtilities.h:
2313         Since the class SVGPathSegListValues is removed, all the parsing functions
2314         have now to deal with SVGPathSegList directly.
2315
2316         * svg/SVGPoint.h:
2317         * svg/SVGValue.h:
2318         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Removed.
2319         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Removed.
2320         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2321         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2322         * svg/properties/SVGAnimatedPropertyImpl.h:
2323         (WebCore::SVGAnimatedPathSegList::create):
2324         (WebCore::SVGAnimatedPathSegList::currentPathByteStream):
2325         (WebCore::SVGAnimatedPathSegList::currentPath):
2326         (WebCore::SVGAnimatedPathSegList::approximateMemoryCost const):
2327         Provides an easy way to access the current SVGPathByteStream and Path
2328         objects from the SVGAnimatedPathSegList.
2329
2330         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2331         (WebCore::SVGAnimationPathSegListFunction::progress):
2332         * svg/properties/SVGPropertyOwnerRegistry.h:
2333         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2334
2335 2019-03-27  Ryan Haddad  <ryanhaddad@apple.com>
2336
2337         AVAudioSessionRouteSharingPolicyLongForm has been deprecated
2338         https://bugs.webkit.org/show_bug.cgi?id=196301
2339
2340         Unrereivewed build fix.
2341
2342         * platform/audio/ios/AudioSessionIOS.mm:
2343         (WebCore::AudioSession::setCategory):
2344         (WebCore::AudioSession::routeSharingPolicy const):
2345
2346 2019-03-27  Chris Dumez  <cdumez@apple.com>
2347
2348         XMLHttpRequestUpload's loadstart event not correct initialized
2349         https://bugs.webkit.org/show_bug.cgi?id=196174
2350         <rdar://problem/49191412>
2351
2352         Reviewed by Alex Christensen.
2353
2354         Align progress event firing with the XHR specification.
2355
2356         No new tests, rebaselined existing tests.
2357
2358         * xml/XMLHttpRequest.cpp:
2359         (WebCore::XMLHttpRequest::createRequest):
2360         As per [1], the loadstart event fired on the XMLHttpRequestUpload object should use
2361         loaded=0 and total=`req’s body’s total bytes`.
2362         [1] https://xhr.spec.whatwg.org/#the-send()-method (step 11.2.)
2363
2364         (WebCore::XMLHttpRequest::didSendData):
2365         As per [2], the progress / load / loadend should use loaded=transmitted and total=length.
2366         [2] https://xhr.spec.whatwg.org/#ref-for-process-request-end-of-body (steps 5, 6 and 7)
2367
2368         (WebCore::XMLHttpRequest::didReceiveData):
2369         As per [3], we should fire the readystatechange event *before* the progress event.
2370         This is covered by web-platform-tests/xhr/send-response-event-order.htm which was failing
2371         differently after the other changes in this patch.
2372         [3] https://xhr.spec.whatwg.org/#ref-for-process-response (steps 9.4 and 9.5)
2373
2374         (WebCore::XMLHttpRequest::dispatchErrorEvents):
2375         As per [4], in case of an error, we should fire the provided 'event' and 'loadend' with
2376         loaded=0 and total=0.
2377         [4] https://xhr.spec.whatwg.org/#request-error-steps (steps 7 and 8)
2378
2379         * xml/XMLHttpRequestUpload.cpp:
2380         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
2381         * xml/XMLHttpRequestUpload.h:
2382         Simplify XMLHttpRequestUpload. It no longer needs to store loaded / total as data
2383         members now that they are always passed by the call site. lengthComputable is set
2384         to !!total as [5] says to set it to true if length/total is not 0. 
2385         [5] https://xhr.spec.whatwg.org/#concept-event-fire-progress
2386
2387 2019-03-27  Simon Fraser  <simon.fraser@apple.com>
2388
2389         REGRESSION (r242687): Fullscreen YouTube videos show blank white space at top
2390         https://bugs.webkit.org/show_bug.cgi?id=196304
2391         rdar://problem/49175760
2392
2393         Reviewed by Zalan Bujtas.
2394
2395         repositionRelatedLayers() should not short-circuit when topContentInset is zero,
2396         because topContentInset might be changing from non-zero to zero, and then we need
2397         to move layers around.
2398
2399         Test: scrollingcoordinator/mac/top-content-inset-to-zero.html
2400
2401         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2402         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
2403
2404 2019-03-26  Simon Fraser  <simon.fraser@apple.com>
2405
2406         [iOS WK2] Fixed elements in frames can be misplaced sometimes
2407         https://bugs.webkit.org/show_bug.cgi?id=196290
2408
2409         Reviewed by Frédéric Wang.
2410
2411         In a page containing position:fixed inside an async-scrolling iframe, if the 
2412         main page is scrolled down, and you reload, then the fixed element in the iframe can
2413         get misplaced or disappear.
2414
2415         The bug was that the reconcileViewportConstrainedLayerPositions() recursive state node
2416         walk would cross frame boundaries, hitting subframe ScrollingStateFixedNodes with a viewport rect
2417         for the main page.
2418
2419         Fix by giving ScrollingStateTree the responsibility for the recursive tree walk, and
2420         have it bail at at frame boundaries.
2421
2422         Test: scrollingcoordinator/ios/fixed-in-frame-layer-reconcile-layer-position.html
2423
2424         * page/scrolling/AsyncScrollingCoordinator.cpp:
2425         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
2426         * page/scrolling/ScrollingStateFixedNode.cpp:
2427         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
2428         * page/scrolling/ScrollingStateNode.cpp:
2429         (WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect): Deleted.
2430         * page/scrolling/ScrollingStateNode.h:
2431         (WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect):
2432         * page/scrolling/ScrollingStateStickyNode.cpp:
2433         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
2434         * page/scrolling/ScrollingStateTree.cpp:
2435         (WebCore::ScrollingStateTree::reconcileLayerPositionsRecursive):
2436         (WebCore::ScrollingStateTree::reconcileViewportConstrainedLayerPositions):
2437         * page/scrolling/ScrollingStateTree.h:
2438
2439 2019-03-27  Philippe Normand  <pnormand@igalia.com>
2440
2441         Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is enabled
2442         https://bugs.webkit.org/show_bug.cgi?id=196178
2443
2444         Reviewed by Xabier Rodriguez-Calvar.
2445
2446         The gst/gl/gl.h header needs to be included before
2447         GraphicsContext3D.h to avoid declaration conflicts with
2448         OpenGLShims.
2449
2450         Based on a patch from Mike Gorse <mgorse@suse.com>
2451
2452         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2453         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
2454
2455 2019-03-27  Philippe Normand  <pnormand@igalia.com>
2456
2457         [GStreamer] Remove the HLS queue buffering query hack
2458         https://bugs.webkit.org/show_bug.cgi?id=196244
2459
2460         Reviewed by Xabier Rodriguez-Calvar.
2461
2462         Because the http src element now provides network statistics to
2463         the player we can now compute an estimation of the data loading in
2464         case the buffering query isn't handled by any element of the
2465         pipeline.
2466
2467         No new tests, existing HLS tests cover this change.
2468
2469         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2470         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2471         (WebCore::findHLSQueue): Deleted.
2472         (WebCore::isHLSProgressing): Deleted.
2473
2474 2019-03-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2475
2476         Unreviewed Windows build fix
2477         https://bugs.webkit.org/show_bug.cgi?id=196083
2478         <rdar://problem/49121836>
2479
2480         * svg/SVGAnimatorFactory.h:
2481         (WebCore::SVGAnimatorFactory::isSupportedAttributeType):
2482
2483 2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2484
2485         [Cocoa] Refactor some helper functions for building UserAgent strings
2486         https://bugs.webkit.org/show_bug.cgi?id=195990
2487
2488         Reviewed by Brent Fulgham.
2489
2490         Add an optional argument to standardUserAgentWithApplicationName to request the desktop version of the user
2491         agent in Cocoa platforms. Work towards refactoring some codepaths to make the implementation of the "Request
2492         Desktop Site" feature in Safari a bit more straightforward.
2493
2494         No change in behavior.
2495
2496         * platform/UserAgent.h:
2497         * platform/ios/UserAgentIOS.mm:
2498         (WebCore::standardUserAgentWithApplicationName):
2499
2500         The corresponding macOS version is currently hard-coded — the followup bug webkit.org/b/196275 tracks making
2501         this dynamically fetch the paired macOS version when building for iOS.
2502
2503         * platform/mac/UserAgentMac.mm:
2504         (WebCore::standardUserAgentWithApplicationName):
2505
2506 2019-03-26  Said Abou-Hallawa  <said@apple.com>
2507
2508         Remove the SVG tear off objects for SVGLength, SVGLengthList and SVGAnimatedLengthList
2509         https://bugs.webkit.org/show_bug.cgi?id=196083
2510
2511         Reviewed by Simon Fraser.
2512
2513         -- SVGLength will be a superclass of SVGValueProperty<SVGLengthValue>. It
2514            is a wrapper of SVGLengthValue. It will be provide the DOM methods. It
2515            can setValueAsString() and return valueAsString().
2516
2517         -- SVGLengthList will be a superclass of SVGValuePropertyList<SVGLength>.
2518            The base class will provide all the DOM methods. SVGLengthList will be
2519            responsible for parsing a String to a SVGLength items. It can also 
2520            build a string representing the stored items.
2521
2522         -- SVGAnimatedLengthList will be defined as SVGAnimatedPropertyList<SVGLengthList>.
2523            Like SVGAnimatedPointList, all the required methods and attributes
2524            will be handled by SVGAnimatedPropertyList.
2525
2526         -- SVGAnimatedLengthAccessor and SVGAnimatedLengthListAccessor will be
2527            added to access the members of types SVGAnimatedLength and 
2528            SVGAnimatedLengthList.
2529
2530         -- SVGAnimatedLengthAnimator and SVGAnimatedLengthListAnimator will be
2531            created by the the new accessors to animate attributes of types
2532            SVGAnimatedLength and SVGAnimatedLengthList.
2533
2534         -- SVGAnimationLengthFunction and SVGAnimationLengthListFunction will be
2535            responsible for progressing the animVal() of attributes of types
2536            SVGAnimatedLength and SVGAnimatedLengthList.
2537
2538         -- SVGValuePropertyAnimator is a new template class which can animate a
2539            none reflecting attribute which should be backed by a value property,
2540            e.g. SVGLength.
2541
2542         -- SVGValuePropertyListAnimator is a new template class which can animate a
2543            none reflecting attribute which should be backed by a value property
2544            list, e.g. SVGLengthList.
2545
2546         Notes:
2547
2548             -- SVGElement::isAnimatedStyleAttribute() will return true if the
2549                attribute is known by SVGPropertyAnimatorFactory. Or it's has 
2550                a reflecting SVGAnimatedPropertyLength property and its name is
2551                one of the names listed in isAnimatedStylePropertyAttribute() of
2552                the propertyRegistry() of the SVGElement.
2553
2554             -- SVGElement::commitPropertyChange() has to handle the attributes
2555                for which isAnimatedStylePropertyAttribute() returns true different
2556                from the other ones. styleReclac() needs updated attributes since
2557                it does not access the reflecting properties in the SVGELement.
2558
2559             -- SVGTextContentElement does not need a customized SVGAnimatedLength.
2560                All SVGTextContentElement::textLengthAnimated() needs to know is
2561                whether m_textLength->baseVal() holds an empty SVGLength. If it
2562                does, it sets its value to getComputedTextLength().
2563
2564         * Sources.txt:
2565         * WebCore.xcodeproj/project.pbxproj:
2566         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
2567         (WebCore::updateCharacterData):
2568         (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
2569         * svg/SVGAnimateElementBase.cpp:
2570         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
2571         * svg/SVGAnimatedLength.cpp: Removed.
2572         * svg/SVGAnimatedLength.h: Removed.
2573         * svg/SVGAnimatedLengthList.cpp: Removed.
2574         * svg/SVGAnimatedLengthList.h: Removed.
2575         * svg/SVGAnimatedType.h:
2576         (WebCore::SVGAnimatedType::type const):
2577         * svg/SVGAnimationElement.cpp:
2578         (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty):
2579         (WebCore::inheritsFromProperty):
2580         * svg/SVGAnimatorFactory.h:
2581         (WebCore::SVGAnimatorFactory::isSupportedAttribute):
2582         (WebCore::SVGAnimatorFactory::create):
2583         These changes were required because some of the tests were trying to
2584         animated unsupported attributes. To differentiate between between the
2585         these two cases:
2586             1) the attribute is animate-able by the legacy controller.
2587             2) animating the attribute or the attribute itself is not supported
2588                by the element.
2589
2590         We want SVGAnimatorFactory tell us whether it can create an animator for
2591         a given attribute or not.
2592
2593         * svg/SVGCircleElement.cpp:
2594         (WebCore::SVGCircleElement::SVGCircleElement):
2595         (WebCore::SVGCircleElement::parseAttribute):
2596         (WebCore::SVGCircleElement::svgAttributeChanged):
2597         (WebCore::SVGCircleElement::registerAttributes): Deleted.
2598         * svg/SVGCircleElement.h:
2599         * svg/SVGCursorElement.cpp:
2600         (WebCore::SVGCursorElement::SVGCursorElement):
2601         (WebCore::SVGCursorElement::parseAttribute):
2602         (WebCore::SVGCursorElement::svgAttributeChanged):
2603         (WebCore::SVGCursorElement::registerAttributes): Deleted.
2604         * svg/SVGCursorElement.h:
2605         * svg/SVGElement.cpp:
2606         (WebCore::SVGElement::commitPropertyChange):
2607         (WebCore::SVGElement::isAnimatedStyleAttribute const):
2608         * svg/SVGElement.h:
2609         * svg/SVGEllipseElement.cpp:
2610         (WebCore::SVGEllipseElement::SVGEllipseElement):
2611         (WebCore::SVGEllipseElement::parseAttribute):
2612         (WebCore::SVGEllipseElement::svgAttributeChanged):
2613         (WebCore::SVGEllipseElement::registerAttributes): Deleted.
2614         * svg/SVGEllipseElement.h:
2615         * svg/SVGFilterElement.cpp:
2616         (WebCore::SVGFilterElement::SVGFilterElement):
2617         (WebCore::SVGFilterElement::registerAttributes):
2618         (WebCore::SVGFilterElement::parseAttribute):
2619         * svg/SVGFilterElement.h:
2620         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2621         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
2622         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
2623         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): Deleted.
2624         * svg/SVGFilterPrimitiveStandardAttributes.h:
2625         (WebCore::SVGFilterPrimitiveStandardAttributes::x const):
2626         (WebCore::SVGFilterPrimitiveStandardAttributes::y const):
2627         (WebCore::SVGFilterPrimitiveStandardAttributes::width const):
2628         (WebCore::SVGFilterPrimitiveStandardAttributes::height const):
2629         (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated):
2630         (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated):
2631         (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated):
2632         (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated):
2633         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute): Deleted.
2634         * svg/SVGForeignObjectElement.cpp:
2635         (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
2636         (WebCore::SVGForeignObjectElement::parseAttribute):
2637         (WebCore::SVGForeignObjectElement::registerAttributes): Deleted.
2638         * svg/SVGForeignObjectElement.h:
2639         * svg/SVGImageElement.cpp:
2640         (WebCore::SVGImageElement::SVGImageElement):
2641         (WebCore::SVGImageElement::parseAttribute):
2642         (WebCore::SVGImageElement::registerAttributes): Deleted.
2643         * svg/SVGImageElement.h:
2644         * svg/SVGLength.h:
2645         (WebCore::SVGLength::create):
2646         (WebCore::SVGLength::clone const):
2647         (WebCore::SVGLength::unitType):
2648         (WebCore::SVGLength::valueForBindings):
2649         (WebCore::SVGLength::setValueForBindings):
2650         (WebCore::SVGLength::valueInSpecifiedUnits):
2651         (WebCore::SVGLength::setValueInSpecifiedUnits):
2652         (WebCore::SVGLength::setValueAsString):
2653         (WebCore::SVGLength::newValueSpecifiedUnits):
2654         (WebCore::SVGLength::convertToSpecifiedUnits):
2655         (WebCore::SVGLength::valueAsString): Deleted.
2656         (WebCore::SVGLength::SVGLength): Deleted.
2657         * svg/SVGLengthList.h:
2658         (WebCore::SVGLengthList::create):
2659         (WebCore::SVGLengthList::lengthMode const):
2660         (WebCore::SVGLengthList::parse):
2661         (WebCore::SVGLengthList::SVGLengthList):
2662         * svg/SVGLengthListValues.cpp: Removed.
2663         * svg/SVGLengthListValues.h: Removed.
2664         * svg/SVGLineElement.cpp:
2665         (WebCore::SVGLineElement::SVGLineElement):
2666         (WebCore::SVGLineElement::parseAttribute):
2667         (WebCore::SVGLineElement::svgAttributeChanged):
2668         (WebCore::SVGLineElement::registerAttributes): Deleted.
2669         * svg/SVGLineElement.h:
2670         * svg/SVGLinearGradientElement.cpp:
2671         (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
2672         (WebCore::SVGLinearGradientElement::parseAttribute):
2673         (WebCore::SVGLinearGradientElement::svgAttributeChanged):
2674         (WebCore::SVGLinearGradientElement::registerAttributes): Deleted.
2675         * svg/SVGLinearGradientElement.h:
2676         * svg/SVGMarkerElement.cpp:
2677         (WebCore::SVGMarkerElement::SVGMarkerElement):
2678         (WebCore::SVGMarkerElement::registerAttributes):
2679         (WebCore::SVGMarkerElement::parseAttribute):
2680         * svg/SVGMarkerElement.h:
2681         * svg/SVGMaskElement.cpp:
2682         (WebCore::SVGMaskElement::SVGMaskElement):
2683         (WebCore::SVGMaskElement::registerAttributes):
2684         (WebCore::SVGMaskElement::parseAttribute):
2685         (WebCore::SVGMaskElement::svgAttributeChanged):
2686         * svg/SVGMaskElement.h:
2687         * svg/SVGPatternElement.cpp:
2688         (WebCore::SVGPatternElement::SVGPatternElement):
2689         (WebCore::SVGPatternElement::registerAttributes):
2690         (WebCore::SVGPatternElement::parseAttribute):
2691         * svg/SVGPatternElement.h:
2692         * svg/SVGPoint.h:
2693         * svg/SVGRadialGradientElement.cpp:
2694         (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
2695         (WebCore::SVGRadialGradientElement::parseAttribute):
2696         (WebCore::SVGRadialGradientElement::svgAttributeChanged):
2697         (WebCore::SVGRadialGradientElement::registerAttributes): Deleted.
2698         * svg/SVGRadialGradientElement.h:
2699         * svg/SVGRectElement.cpp:
2700         (WebCore::SVGRectElement::SVGRectElement):
2701         (WebCore::SVGRectElement::parseAttribute):
2702         (WebCore::SVGRectElement::svgAttributeChanged):
2703         (WebCore::SVGRectElement::registerAttributes): Deleted.
2704         * svg/SVGRectElement.h:
2705         * svg/SVGSVGElement.cpp:
2706         (WebCore::SVGSVGElement::SVGSVGElement):
2707         (WebCore::SVGSVGElement::parseAttribute):
2708         (WebCore::SVGSVGElement::svgAttributeChanged):
2709         (WebCore::SVGSVGElement::registerAttributes): Deleted.
2710         * svg/SVGSVGElement.h:
2711         * svg/SVGTextContentElement.cpp:
2712         (WebCore::SVGTextContentElement::SVGTextContentElement):
2713         (WebCore::SVGTextContentElement::registerAttributes):
2714         (WebCore::SVGTextContentElement::parseAttribute):
2715         (WebCore::SVGTextContentElement::svgAttributeChanged):
2716         (WebCore::SVGTextContentElement::textLengthAnimated):
2717         * svg/SVGTextContentElement.h:
2718         (WebCore::SVGTextContentElement::specifiedTextLength const):
2719         (WebCore::SVGTextContentElement::textLength const):
2720         (WebCore::SVGTextContentElement::specifiedTextLength): Deleted.
2721         (WebCore::SVGTextContentElement::textLengthAnimated): Deleted.
2722         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute): Deleted.
2723         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize): Deleted.
2724         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty): Deleted.
2725         * svg/SVGTextPathElement.cpp:
2726         (WebCore::SVGTextPathElement::SVGTextPathElement):
2727         (WebCore::SVGTextPathElement::registerAttributes):
2728         (WebCore::SVGTextPathElement::parseAttribute):
2729         * svg/SVGTextPathElement.h:
2730         * svg/SVGTextPositioningElement.cpp:
2731         (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
2732         (WebCore::SVGTextPositioningElement::parseAttribute):
2733         (WebCore::SVGTextPositioningElement::svgAttributeChanged):
2734         (WebCore::SVGTextPositioningElement::registerAttributes): Deleted.
2735         * svg/SVGTextPositioningElement.h:
2736         (WebCore::SVGTextPositioningElement::x const):
2737         (WebCore::SVGTextPositioningElement::y const):
2738         (WebCore::SVGTextPositioningElement::dx const):
2739         (WebCore::SVGTextPositioningElement::dy const):
2740         (WebCore::SVGTextPositioningElement::xAnimated):
2741         (WebCore::SVGTextPositioningElement::yAnimated):
2742         (WebCore::SVGTextPositioningElement::dxAnimated):
2743         (WebCore::SVGTextPositioningElement::dyAnimated):
2744         (WebCore::SVGTextPositioningElement::isKnownAttribute): Deleted.
2745         * svg/SVGUseElement.cpp:
2746         (WebCore::SVGUseElement::SVGUseElement):
2747         (WebCore::SVGUseElement::parseAttribute):
2748         (WebCore::SVGUseElement::svgAttributeChanged):
2749         (WebCore::SVGUseElement::registerAttributes): Deleted.
2750         * svg/SVGUseElement.h:
2751         * svg/SVGValue.h:
2752         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2753         * svg/properties/SVGAnimatedPropertyAnimator.h:
2754         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2755         * svg/properties/SVGAnimatedPropertyImpl.h:
2756         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
2757         (WebCore::SVGAnimationLengthListFunction::SVGAnimationLengthListFunction):
2758         (WebCore::SVGAnimationLengthListFunction::progress):
2759         (WebCore::SVGAnimationNumberListFunction::progress):
2760         (WebCore::SVGAnimationPointListFunction::progress):
2761         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2762         (WebCore::SVGAnimationLengthFunction::SVGAnimationLengthFunction):
2763         (WebCore::SVGAnimationLengthFunction::progress):
2764         * svg/properties/SVGAttributeAnimator.cpp:
2765         (WebCore::SVGAttributeAnimator::isAnimatedStylePropertyAniamtor const):
2766         * svg/properties/SVGAttributeAnimator.h:
2767         * svg/properties/SVGAttributeRegistry.h:
2768         * svg/properties/SVGPropertyAnimatorFactory.h:
2769         (WebCore::SVGPropertyAnimatorFactory::createLengthAnimator):
2770         (WebCore::SVGPropertyAnimatorFactory::createLengthListAnimator):
2771         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
2772         * svg/properties/SVGPropertyOwnerRegistry.h:
2773         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2774         (WebCore::SVGPropertyOwnerRegistry::isAnimatedLengthAttribute):
2775         * svg/properties/SVGPropertyRegistry.h:
2776         * svg/properties/SVGValuePropertyAnimator.h: Added.
2777         (WebCore::SVGValuePropertyAnimator::SVGValuePropertyAnimator):
2778         * svg/properties/SVGValuePropertyAnimatorImpl.h: Added.
2779         * svg/properties/SVGValuePropertyListAnimator.h: Added.
2780         (WebCore::SVGValuePropertyListAnimator::SVGValuePropertyListAnimator):
2781         * svg/properties/SVGValuePropertyListAnimatorImpl.h: Added.
2782
2783 2019-03-26  Simon Fraser  <simon.fraser@apple.com>
2784
2785         [iOS WK2] position:fixed inside oveflow:scroll is jumpy
2786         https://bugs.webkit.org/show_bug.cgi?id=196238
2787
2788         Reviewed by Antti Koivisto.
2789         
2790         We were inadvertently making Positioned nodes for position:fixed, which is unnecessary because
2791         Fixed nodes handle them, and harmful because they introduced unwanted layer movement.
2792
2793         Tests: scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html
2794                scrollingcoordinator/ios/fixed-in-overflow-scroll.html
2795
2796         * rendering/RenderLayerCompositor.cpp:
2797         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2798
2799 2019-03-26  Dean Jackson  <dino@apple.com>
2800
2801         vertexAttribPointer must restrict offset parameter
2802         https://bugs.webkit.org/show_bug.cgi?id=196261
2803         <rdar://problem/48458086>
2804
2805         Reviewed by Antoine Quint.
2806
2807         This WebGL function should fail if the offset parameter is
2808         not within [0, max 32-bit int].
2809
2810         Test: fast/canvas/webgl/vertexAttribPointer-with-bad-offset.html
2811
2812         * html/canvas/WebGLRenderingContextBase.cpp:
2813         (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
2814
2815 2019-03-26  Antoine Quint  <graouts@apple.com>
2816
2817         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
2818         https://bugs.webkit.org/show_bug.cgi?id=196254
2819         <rdar://problem/49124334>
2820
2821         Unreviewed. Fix build broken by previous commit.
2822
2823         * dom/Event.cpp:
2824         * dom/Event.h:
2825         (WebCore::Event::hasEncounteredListener const): Deleted.
2826         (WebCore::Event::setHasEncounteredListener): Deleted.
2827         * dom/EventTarget.cpp:
2828         (WebCore::EventTarget::innerInvokeEventListeners):
2829
2830 2019-03-26  Zalan Bujtas  <zalan@apple.com>
2831
2832         [ContentChangeObserver] Skip anonymous renderers when checking for "willRespondToMouseClickEvents"
2833         https://bugs.webkit.org/show_bug.cgi?id=196259
2834         <rdar://problem/49240029>
2835
2836         Reviewed by Dean Jackson.
2837
2838         Anonymous renderers don't have associated DOM nodes so they can't have event listeners either. Let's skip them.
2839
2840         Test: fast/events/touch/ios/content-observation/crash-on-anonymous-renderer.html
2841
2842         * page/ios/ContentChangeObserver.cpp:
2843         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
2844
2845 2019-03-26  Antoine Quint  <graouts@apple.com>
2846
2847         Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
2848         https://bugs.webkit.org/show_bug.cgi?id=196254
2849         <rdar://problem/49124334>
2850
2851         Reviewed by Dean Jackson.
2852
2853         * page/Quirks.cpp:
2854         (WebCore::Quirks::shouldMousemoveEventHandlingPreventDefault const): Deleted.
2855         * page/Quirks.h:
2856         * page/RuntimeEnabledFeatures.h:
2857         (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
2858         (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const): Deleted.
2859         (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled): Deleted.
2860
2861 2019-03-26  Commit Queue  <commit-queue@webkit.org>
2862
2863         Unreviewed, rolling out r243493.
2864         https://bugs.webkit.org/show_bug.cgi?id=196257
2865
2866         broke the non-gst-gl build (Requested by philn on #webkit).
2867
2868         Reverted changeset:
2869
2870         "Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is
2871         enabled"
2872         https://bugs.webkit.org/show_bug.cgi?id=196178
2873         https://trac.webkit.org/changeset/243493
2874
2875 2019-03-26  Mike Gorse  <mgorse@alum.wpi.edu>
2876
2877         Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is enabled
2878         https://bugs.webkit.org/show_bug.cgi?id=196178
2879
2880         Reviewed by Philippe Normand.
2881
2882         No new tests (build fix).
2883
2884         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2885         Include gst/gl/gl.h before including GraphicsContext3D.h.
2886
2887 2019-03-26  Philippe Normand  <pnormand@igalia.com>
2888
2889         [GStreamer] Sound loop with Google Hangouts and WhatsApp notifications
2890         https://bugs.webkit.org/show_bug.cgi?id=189471
2891
2892         Reviewed by Xabier Rodriguez-Calvar.
2893
2894         The media duration is now cached (again). The loop issue was
2895         triggered by the previous version of the code returning positive
2896         infinite duration in didEnd(), followed by the timeupdate event
2897         propagation that would trick the HTMLMediaElement into a new call
2898         to play(). Now the cached duration is updated to current position
2899         at EOS (for forward playback direction only), so the media element
2900         no longer triggers a new play call for those cases.
2901
2902         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2903         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2904         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2905         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
2906         (WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
2907         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
2908         (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):
2909         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
2910         (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
2911         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2912         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2913         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
2914
2915 2019-03-26  Antti Koivisto  <antti@apple.com>
2916
2917         Hit-testing on layers overlapping scrollers should hit-test on text boxes
2918         https://bugs.webkit.org/show_bug.cgi?id=195373
2919         <rdar://problem/48649865>
2920
2921         Reviewed by Simon Fraser.
2922
2923         * rendering/InlineFlowBox.cpp:
2924         (WebCore::InlineFlowBox::paint):
2925         * rendering/InlineTextBox.cpp:
2926         (WebCore::InlineTextBox::paint):
2927
2928         Collect event region for overflowing line boxes.
2929
2930         * rendering/SimpleLineLayoutFunctions.cpp:
2931         (WebCore::SimpleLineLayout::paintFlow):
2932
2933         Collect event region for overflowing simple lines.
2934
2935 2019-03-25  Alex Christensen  <achristensen@webkit.org>
2936
2937         Expected shouldn't assume its contained types are copyable
2938         https://bugs.webkit.org/show_bug.cgi?id=195986
2939
2940         Reviewed by JF Bastien.
2941
2942         * contentextensions/ContentExtensionParser.cpp:
2943         (WebCore::ContentExtensions::loadAction):
2944
2945 2019-03-20  Ryosuke Niwa  <rniwa@webkit.org>
2946
2947         Leak of SVGFontFaceElement when RenderStyle holds onto a FontRances which uses it
2948         https://bugs.webkit.org/show_bug.cgi?id=196059
2949
2950         Reviewed by Zalan Bujtas.
2951
2952         SVGFontFaceElement keeps its RenderStyle alive via ElementRareData but RenderStyle can hold onto FontRanges
2953         and therefore CSSFontSource, which in turn keeps SVGFontFaceElement alive, making a reference cycle.
2954
2955         More precisely, there are two reference cycles:
2956         SVGFontFaceElement (1) -> ElementRareData -> StyleInheritedData -> FontCascade -> FontCascadeFonts (2)
2957         FontCascadeFonts (2) -> FontRanges (3)
2958         FontCascadeFonts (2) -> CSSFontSelector -> CSSFontFaceSet -> CSSSegmentedFontFace -> FontRanges (3)
2959         FontRanges (3) -> CSSFontAccessor > CSSFontFace > CSSFontSource -> SVGFontFaceElement (1)
2960
2961         No new tests. Unfortunately, writing a test proved to be intractable. The leak can be reproduced by running
2962         svg/text/text-text-05-t.svg then svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html consecutively.
2963
2964         * css/CSSFontFaceSource.cpp:
2965         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
2966         (WebCore::CSSFontFaceSource::load):
2967         (WebCore::CSSFontFaceSource::font):
2968         (WebCore::CSSFontFaceSource::isSVGFontFaceSource const):
2969         * css/CSSFontFaceSource.h:
2970
2971 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2972
2973         Unreviewed, rolling out r243450.
2974
2975         AppleWin and WinCairo port builds get broken.
2976
2977         Reverted changeset:
2978
2979         "Add test for fix of #196095"
2980         https://bugs.webkit.org/show_bug.cgi?id=196097
2981         https://trac.webkit.org/changeset/243450
2982
2983 2019-03-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2984
2985         Remove the SVG tear off objects for SVGAngle, SVGAnimatedAngle and SVGAnimatedEnumeration
2986         https://bugs.webkit.org/show_bug.cgi?id=196087
2987
2988         Reviewed by Simon Fraser.
2989
2990         In this patch, the tear off objects for SVGAnimatedEnumeration will be 
2991         removed. Because the angle is paired with the orient type so its tear
2992         off objects have to be removed as well. Here is what this patch does:
2993
2994         -- SVGAngle is now a superclass of SVGValueProperty<SVGAngleValue>. Its 
2995         relationship with its owner will be managed by the owner of its base
2996         class SVGProperty.
2997
2998         -- SVGAnimatedAngle is now defined to be SVGAnimatedValueProperty<
2999         SVGAngle>. All the DOM interfaces will be handled by the base class
3000         given its baseVal and animVal are of type SVGAngle.
3001
3002         -- SVGAnimatedEnumeration is now defined to be
3003         SVGAnimatedDecoratedProperty<SVGDecoratedEnumeration, unsigned>.
3004         This can be read: SVGAnimatedEnumeration is an SVGAnimatedProperty which
3005         decorates the "SVGDecoratedEnumeration" type to "unsigned". The reason
3006         for this complication is the IDL of SVGAnimatedEnumeration defines the
3007         baseVal and animVal are of type unsigned. However SVGAnimatedEnumeration
3008         should be able to convert a string to its enum value and vice versa.
3009
3010         -- SVGAnimatedDecoratedProperty is a template class which maps from
3011         DecoratedProperty to DecorationType. The DecoratedProperty is actually
3012         a template class which exposes a property of type DecorationType.
3013
3014         -- SVGDecoratedProperty is an abstract class which manages setting and
3015         getting a property in DecorationType regardless of how it is actually
3016         stored. 
3017
3018         -- SVGDecoratedPrimitive is a superclass of SVGDecoratedProperty which
3019         stores a primitive property whose type is PropertyType but can decorate
3020         it to the callers as DecorationType.
3021
3022         -- SVGDecoratedEnumeration is a superclass of SVGDecoratedPrimitive
3023         which stores a primitive type DecorationType like "BlendMode" but
3024         decorates it as "unsigned"
3025
3026         To get the mechanics of this change correct, new accessors, animators
3027         and animation functions need to be added for SVGAnimatedAngle,
3028         SVGAnimatedEnumeration and SVGAnimatedOrientType. But since angle and
3029         the orient type are paired under a single attribute, a pair accessor and
3030         animator are also needed for the pair { angle, orientType }.
3031
3032         * Sources.txt:
3033         * WebCore.xcodeproj/project.pbxproj:
3034         * svg/SVGAngle.h:
3035         (WebCore::SVGAngle::create):
3036         (WebCore::SVGAngle::unitType):
3037         (WebCore::SVGAngle::setValueForBindings):
3038         (WebCore::SVGAngle::valueForBindings):
3039         (WebCore::SVGAngle::setValueInSpecifiedUnits):
3040         (WebCore::SVGAngle::valueInSpecifiedUnits):
3041         (WebCore::SVGAngle::setValueAsString):
3042         (WebCore::SVGAngle::newValueSpecifiedUnits):
3043         (WebCore::SVGAngle::convertToSpecifiedUnits):
3044         (WebCore::SVGAngle::valueAsString): Deleted.
3045         (WebCore::SVGAngle::SVGAngle): Deleted.
3046         * svg/SVGAnimatedAngle.cpp: Removed.
3047         * svg/SVGAnimatedAngle.h: Removed.
3048         * svg/SVGAnimatedEnumeration.cpp: Removed.
3049         * svg/SVGAnimatedEnumeration.h: Removed.
3050         * svg/SVGAnimatedType.h:
3051         (WebCore::SVGAnimatedType::type const):
3052         * svg/SVGAnimatorFactory.h:
3053         (WebCore::SVGAnimatorFactory::create):
3054         * svg/SVGClipPathElement.cpp:
3055         (WebCore::SVGClipPathElement::SVGClipPathElement):
3056         (WebCore::SVGClipPathElement::parseAttribute):
3057         (WebCore::SVGClipPathElement::svgAttributeChanged):
3058         (WebCore::SVGClipPathElement::registerAttributes): Deleted.
3059         * svg/SVGClipPathElement.h:
3060         * svg/SVGComponentTransferFunctionElement.cpp:
3061         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
3062         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
3063         (WebCore::SVGComponentTransferFunctionElement::registerAttributes): Deleted.
3064         * svg/SVGComponentTransferFunctionElement.h:
3065         (WebCore::SVGComponentTransferFunctionElement::type const):
3066         (WebCore::SVGComponentTransferFunctionElement::typeAnimated):
3067         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry): Deleted.
3068         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute): Deleted.
3069         * svg/SVGElement.cpp:
3070         (WebCore::SVGElement::commitPropertyChange):
3071         * svg/SVGFEBlendElement.cpp:
3072         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
3073         (WebCore::SVGFEBlendElement::parseAttribute):
3074         (WebCore::SVGFEBlendElement::registerAttributes): Deleted.
3075         * svg/SVGFEBlendElement.h:
3076         (WebCore::SVGPropertyTraits<BlendMode>::fromString):
3077         * svg/SVGFEColorMatrixElement.cpp:
3078         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
3079         (WebCore::SVGFEColorMatrixElement::parseAttribute):
3080         (WebCore::SVGFEColorMatrixElement::registerAttributes): Deleted.
3081         * svg/SVGFEColorMatrixElement.h:
3082         * svg/SVGFECompositeElement.cpp:
3083         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
3084         (WebCore::SVGFECompositeElement::parseAttribute):
3085         (WebCore::SVGFECompositeElement::registerAttributes): Deleted.
3086         * svg/SVGFECompositeElement.h:
3087         * svg/SVGFEConvolveMatrixElement.cpp:
3088         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
3089         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
3090         (WebCore::SVGFEConvolveMatrixElement::registerAttributes): Deleted.
3091         * svg/SVGFEConvolveMatrixElement.h:
3092         * svg/SVGFEDisplacementMapElement.cpp:
3093         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
3094         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
3095         (WebCore::SVGFEDisplacementMapElement::registerAttributes): Deleted.
3096         * svg/SVGFEDisplacementMapElement.h:
3097         * svg/SVGFEGaussianBlurElement.cpp:
3098         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
3099         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
3100         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
3101         (WebCore::SVGFEGaussianBlurElement::registerAttributes): Deleted.
3102         * svg/SVGFEGaussianBlurElement.h:
3103         * svg/SVGFEMorphologyElement.cpp:
3104         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
3105         (WebCore::SVGFEMorphologyElement::parseAttribute):
3106         (WebCore::SVGFEMorphologyElement::registerAttributes): Deleted.
3107         * svg/SVGFEMorphologyElement.h:
3108         * svg/SVGFETurbulenceElement.cpp:
3109         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
3110         (WebCore::SVGFETurbulenceElement::parseAttribute):
3111         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
3112         (WebCore::SVGFETurbulenceElement::registerAttributes): Deleted.
3113         * svg/SVGFETurbulenceElement.h:
3114         * svg/SVGFilterElement.cpp:
3115         (WebCore::SVGFilterElement::SVGFilterElement):
3116         (WebCore::SVGFilterElement::registerAttributes):
3117         (WebCore::SVGFilterElement::parseAttribute):
3118         * svg/SVGFilterElement.h:
3119         * svg/SVGGradientElement.cpp:
3120         (WebCore::SVGGradientElement::SVGGradientElement):
3121         (WebCore::SVGGradientElement::registerAttributes):
3122         (WebCore::SVGGradientElement::parseAttribute):
3123         * svg/SVGGradientElement.h:
3124         (WebCore::SVGGradientElement::spreadMethod const):
3125         (WebCore::SVGGradientElement::gradientUnits const):
3126         (WebCore::SVGGradientElement::spreadMethodAnimated):
3127         (WebCore::SVGGradientElement::gradientUnitsAnimated):
3128         * svg/SVGMarkerElement.cpp:
3129         (WebCore::SVGMarkerElement::SVGMarkerElement):
3130         (WebCore::SVGMarkerElement::registerAttributes):
3131         (WebCore::SVGMarkerElement::parseAttribute):
3132         (WebCore::SVGMarkerElement::setOrient):
3133         (WebCore::SVGMarkerElement::setOrientToAngle):
3134         (WebCore::SVGMarkerElement::orientTypeIdentifier): Deleted.
3135         (WebCore::SVGMarkerElement::orientAngleIdentifier): Deleted.
3136         * svg/SVGMarkerElement.h:
3137         * svg/SVGMarkerTypes.h:
3138         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString):
3139         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoStartReverseString):
3140         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
3141         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString):
3142         * svg/SVGMaskElement.cpp:
3143         (WebCore::SVGMaskElement::SVGMaskElement):
3144         (WebCore::SVGMaskElement::registerAttributes):
3145         (WebCore::SVGMaskElement::parseAttribute):
3146         * svg/SVGMaskElement.h:
3147         * svg/SVGPatternElement.cpp:
3148         (WebCore::SVGPatternElement::SVGPatternElement):
3149         (WebCore::SVGPatternElement::registerAttributes):
3150         (WebCore::SVGPatternElement::parseAttribute):
3151         * svg/SVGPatternElement.h:
3152         * svg/SVGSVGElement.cpp:
3153         * svg/SVGScriptElement.cpp:
3154         * svg/SVGTextContentElement.cpp:
3155         (WebCore::SVGTextContentElement::SVGTextContentElement):
3156         (WebCore::SVGTextContentElement::registerAttributes):
3157         (WebCore::SVGTextContentElement::parseAttribute):
3158         * svg/SVGTextContentElement.h:
3159         (WebCore::SVGTextContentElement::lengthAdjust const):
3160         (WebCore::SVGTextContentElement::lengthAdjustAnimated):
3161         * svg/SVGTextPathElement.cpp:
3162         (WebCore::SVGTextPathElement::SVGTextPathElement):
3163         (WebCore::SVGTextPathElement::registerAttributes):
3164         (WebCore::SVGTextPathElement::parseAttribute):
3165         * svg/SVGTextPathElement.h:
3166         * svg/SVGValue.h:
3167         * svg/properties/SVGAnimatedDecoratedProperty.h: Added.
3168         (WebCore::SVGAnimatedDecoratedProperty::create):
3169         (WebCore::SVGAnimatedDecoratedProperty::SVGAnimatedDecoratedProperty):
3170         (WebCore::SVGAnimatedDecoratedProperty::setBaseVal):
3171         (WebCore::SVGAnimatedDecoratedProperty::setBaseValInternal):
3172         (WebCore::SVGAnimatedDecoratedProperty::baseVal const):
3173         (WebCore::SVGAnimatedDecoratedProperty::setAnimVal):
3174         (WebCore::SVGAnimatedDecoratedProperty::animVal const):
3175         (WebCore::SVGAnimatedDecoratedProperty::currentValue const):
3176         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: Removed.
3177         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
3178         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
3179         * svg/properties/SVGAnimatedPropertyImpl.h:
3180         (WebCore::SVGAnimatedOrientType::create):
3181         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
3182         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
3183         (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
3184         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
3185         * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Removed.
3186         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
3187         (WebCore::SVGAnimationAngleFunction::progress):
3188         * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
3189         * svg/properties/SVGAttributeRegistry.h:
3190         * svg/properties/SVGDecoratedEnumeration.h: Added.
3191         (WebCore::SVGDecoratedEnumeration::create):
3192         * svg/properties/SVGDecoratedPrimitive.h: Added.
3193         (WebCore::SVGDecoratedPrimitive::SVGDecoratedPrimitive):
3194         * svg/properties/SVGDecoratedProperty.h: Added.
3195         (WebCore::SVGDecoratedProperty::setValue):
3196         (WebCore::SVGDecoratedProperty::value const):
3197         * svg/properties/SVGPropertyOwnerRegistry.h:
3198         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
3199         (WebCore::SVGPropertyOwnerRegistry::isAnimatedLengthAttribute):
3200         * svg/properties/SVGPropertyRegistry.h:
3201         * svg/properties/SVGStaticPropertyTearOff.h: Removed.
3202
3203 2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
3204
3205         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
3206         https://bugs.webkit.org/show_bug.cgi?id=194964
3207
3208         Unreviewed build fix for WinCairo port.
3209
3210         error C2504: 'CanMakeWeakPtr': base class undefined
3211
3212         * loader/ResourceLoader.h: Added #include <wtf/WeakPtr.h>.
3213
3214 2019-03-25  Andy Estes  <aestes@apple.com>
3215
3216         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
3217         https://bugs.webkit.org/show_bug.cgi?id=194964
3218         <rdar://problem/48279441>
3219
3220         Reviewed by Alex Christensen.
3221
3222         When a document's QuickLook preview is loaded, a reference cycle is created between
3223         WebPreviewLoader and ResourceLoader. Break the cycle by changing WebPreviewLoader to hold a
3224         WeakPtr to its ResourceLoader ResourceLoader::releaseResources().
3225
3226         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`. Also covered by
3227         existing API tests.
3228
3229         * loader/ResourceLoader.h:
3230         * loader/ios/PreviewLoader.mm:
3231         (-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
3232         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
3233         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
3234         (-[WebPreviewLoader connectionDidFinishLoading:]):
3235         (-[WebPreviewLoader connection:didFailWithError:]):
3236
3237 2019-03-25  Alex Christensen  <achristensen@webkit.org>
3238
3239         Enable IPC sending and receiving non-default-constructible types
3240         https://bugs.webkit.org/show_bug.cgi?id=196132
3241
3242         Reviewed by Geoff Garen.
3243
3244         This basically just requires the decoding of std::tuple to return an Optional<std::tuple> instead of
3245         constructing a std::tuple then decoding into it.  I now decode synchronous replies into an Optional<std::tuple>
3246         then move it into the tuple of references where the successfully decoded reply should go.  This required
3247         the synchronous reply types be move constructible and move assignable.
3248
3249         * Modules/indexeddb/shared/IDBRequestData.h:
3250         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3251         * platform/DragImage.h:
3252         * platform/PasteboardWriterData.h:
3253         * platform/audio/mac/CAAudioStreamDescription.h:
3254         * platform/graphics/RemoteVideoSample.h:
3255
3256 2019-03-25  Alex Christensen  <achristensen@webkit.org>
3257
3258         Stop storing raw pointers to Documents
3259         https://bugs.webkit.org/show_bug.cgi?id=196042
3260
3261         Reviewed by Geoff Garen.
3262
3263         Use WeakPtr instead!  This could change some UAF bugs into null dereference crashes.
3264
3265         * css/CSSFontSelector.cpp:
3266         (WebCore::CSSFontSelector::CSSFontSelector):
3267         (WebCore::CSSFontSelector::addFontFaceRule):
3268         (WebCore::CSSFontSelector::fontRangesForFamily):
3269         * css/CSSFontSelector.h:
3270         * css/MediaQueryMatcher.cpp:
3271         (WebCore::MediaQueryMatcher::MediaQueryMatcher):
3272         (WebCore::MediaQueryMatcher::matchMedia):
3273         * css/MediaQueryMatcher.h:
3274         * css/StyleSheetList.cpp:
3275         (WebCore::StyleSheetList::StyleSheetList):
3276         (WebCore::StyleSheetList::ownerNode const):
3277         * css/StyleSheetList.h:
3278         * css/ViewportStyleResolver.cpp:
3279         (WebCore::ViewportStyleResolver::ViewportStyleResolver):
3280         * css/ViewportStyleResolver.h:
3281         * dom/Document.h:
3282         (WebCore::Document::setTemplateDocumentHost):
3283         (WebCore::Document::templateDocumentHost):
3284         * dom/DocumentParser.cpp:
3285         (WebCore::DocumentParser::DocumentParser):
3286         * dom/DocumentParser.h:
3287         (WebCore::DocumentParser::document const):
3288         * dom/ScriptedAnimationController.cpp:
3289         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
3290         * dom/ScriptedAnimationController.h:
3291         * html/parser/HTMLScriptRunner.cpp:
3292         (WebCore::HTMLScriptRunner::HTMLScriptRunner):
3293         (WebCore::HTMLScriptRunner::runScript):
3294         * html/parser/HTMLScriptRunner.h:
3295         * loader/MediaResourceLoader.cpp:
3296         (WebCore::MediaResourceLoader::MediaResourceLoader):
3297         * loader/MediaResourceLoader.h:
3298         * loader/cache/CachedResourceLoader.cpp:
3299         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox const):
3300         (WebCore::CachedResourceLoader::loadDone):
3301         * loader/cache/CachedResourceLoader.h:
3302         (WebCore::CachedResourceLoader::document const):
3303         (WebCore::CachedResourceLoader::setDocument):
3304
3305 2019-03-25  Truitt Savell  <tsavell@apple.com>
3306
3307         Unreviewed, rolling out r243419.
3308
3309         Caused Mac WK2 testers to crash and become unresponsive.
3310
3311         Reverted changeset:
3312
3313         "[Web GPU] Prototype compute pipeline with MSL"
3314         https://bugs.webkit.org/show_bug.cgi?id=196107
3315         https://trac.webkit.org/changeset/243419
3316
3317 2019-03-25  Truitt Savell  <tsavell@apple.com>
3318
3319         Unreviewed, rolling out r243438.
3320
3321         243319 Caused Mac WK2 testers to crash and become
3322         unresponsive.
3323
3324         Reverted changeset:
3325
3326         "Update WebGPU class names based on sketch.idl"
3327         https://bugs.webkit.org/show_bug.cgi?id=194260
3328         https://trac.webkit.org/changeset/243438
3329
3330 2019-03-25  Eric Carlson  <eric.carlson@apple.com>
3331
3332         Delete MetadataPreloadingNotPermitted, it is unused
3333         https://bugs.webkit.org/show_bug.cgi?id=196202
3334         <rdar://problem/49213611>
3335
3336         Reviewed by Jer Noble.
3337
3338         No new tests, the flat was unused except in an existing test that was removed.
3339
3340         * html/MediaElementSession.cpp:
3341         (WebCore::restrictionNames):
3342         (WebCore::MediaElementSession::effectivePreloadForElement const):
3343         * html/MediaElementSession.h:
3344         * platform/graphics/cg/UTIRegistry.cpp:
3345         (WebCore::defaultSupportedImageTypes):
3346         * testing/Internals.cpp:
3347         (WebCore::Internals::setMediaElementRestrictions):
3348
3349 2019-03-25  Jer Noble  <jer.noble@apple.com>
3350
3351         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
3352         https://bugs.webkit.org/show_bug.cgi?id=196097
3353
3354         Reviewed by Eric Carlson.
3355
3356         Test: media/track/track-in-band-metadata-display-order.html
3357
3358         Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
3359         by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
3360         TextTrackCueGeneric for testing.
3361
3362         Drive-by fixes:
3363
3364         Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
3365         parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
3366         a HTMLMediaElement*
3367
3368         TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
3369         enable use of is<> and downcast<>.
3370
3371         * Source/WebCore/CMakeLists.txt:
3372         * DerivedSources-input.xcfilelist:
3373         * DerivedSources-output.xcfilelist:
3374         * DerivedSources.make:
3375         * WebCore.xcodeproj/project.pbxproj:
3376         * html/shadow/MediaControlElementTypes.cpp:
3377         (WebCore::parentMediaElement):
3378         * html/shadow/MediaControlElementTypes.h:
3379         * html/shadow/MediaControlElements.cpp:
3380         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
3381         (WebCore::MediaControlTextTrackContainerElement::logger const):
3382         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
3383         (WebCore::MediaControlTextTrackContainerElement::logChannel const):
3384         * html/shadow/MediaControlElements.h:
3385         * html/track/DataCue.h:
3386         (isType):