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