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