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