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