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