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