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