Unreviewed, fix -Wpessimizing-move warning
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         Unreviewed, fix -Wpessimizing-move warning
4         https://bugs.webkit.org/show_bug.cgi?id=195905
5         <rdar://problem/49121824>
6
7         * svg/properties/SVGPropertyList.h:
8
9 2019-03-23  Justin Fan  <justin_fan@apple.com>
10
11         [Web GPU] Prototype compute pipeline with MSL
12         https://bugs.webkit.org/show_bug.cgi?id=196107
13         <rdar://problem/46289650>
14
15         Reviewed by Myles Maxfield.
16
17         Add GPUComputePassEncoder, GPUComputePipeline, and GPUComputePipelineDescriptor.
18         Implement everything needed to prototype a compute pipeline in Web GPU using Metal shaders and bound resources.
19
20         Test: webgpu/compute-squares.html
21
22         Add files and symbols:
23         * CMakeLists.txt:
24         * DerivedSources-input.xcfilelist:
25         * DerivedSources-output.xcfilelist:
26         * DerivedSources.make:
27         * Sources.txt:
28         * SourcesCocoa.txt:
29         * WebCore.xcodeproj/project.pbxproj:
30         * bindings/js/WebCoreBuiltinNames.h:
31
32         Misc fixes:
33         * Modules/webgpu/WHLSL/WHLSLNameResolver.h: Missing include.
34         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Missing include.
35         * Modules/webgpu/WebGPUPipelineStageDescriptor.cpp: Added. Move pipeline stage validation logic here.
36         (WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const):
37         * Modules/webgpu/WebGPURenderPipeline.cpp: Remove unnecessary include.
38         * Modules/webgpu/WebGPURenderPipeline.h:
39         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp: Add missing inlcude.
40         (WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const): Moved to WebGPUPipelineStageDescriptor.cpp.
41         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Add missing include.
42         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Add missing include.
43         (WebCore::GPURenderPipeline::GPURenderPipeline): Remove unecessary ref of GPUPipelineLayout.
44         * platform/text/mac/TextEncodingRegistryMac.mm: Carbon.h was causing ambiguous reference build errors in this file.
45
46         Enable creating a GPUComputePassEncoder from a GPUCommandEncoder:
47         * Modules/webgpu/WebGPUCommandEncoder.cpp:
48         (WebCore::WebGPUCommandEncoder::beginRenderPass): No longer passing this WebGPUCommandEncoder to pass encoders.
49         (WebCore::WebGPUCommandEncoder::beginComputePass): Added.
50         * Modules/webgpu/WebGPUCommandEncoder.h:
51         * Modules/webgpu/WebGPUCommandEncoder.idl:
52
53         Add GPUComputePassEncoder:
54         * Modules/webgpu/WebGPUComputePassEncoder.cpp: Added.
55         (WebCore::WebGPUComputePassEncoder::create):
56         (WebCore::WebGPUComputePassEncoder::WebGPUComputePassEncoder):
57         (WebCore::WebGPUComputePassEncoder::setPipeline):
58         (WebCore::WebGPUComputePassEncoder::dispatch):
59         (WebCore::WebGPUComputePassEncoder::passEncoder):
60         (WebCore::WebGPUComputePassEncoder::passEncoder const):
61         * Modules/webgpu/WebGPUComputePassEncoder.h: Added.
62         * Modules/webgpu/WebGPUComputePassEncoder.idl: Added.
63         * platform/graphics/gpu/GPUComputePassEncoder.h: Added.
64         (WebCore::GPUComputePassEncoder::~GPUComputePassEncoder):
65         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Added.
66         (WebCore::GPUComputePassEncoder::tryCreate):
67         (WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
68         (WebCore::GPUComputePassEncoder::setPipeline):
69         (WebCore::GPUComputePassEncoder::dispatch): Use a default calculation for threadsPerThreadgroup while MSL is still an accepted shader format.
70         (WebCore::GPUComputePassEncoder::platformPassEncoder const):
71         (WebCore::GPUComputePassEncoder::useResource):
72         (WebCore::GPUComputePassEncoder::setComputeBuffer):
73
74         Add GPUComputePipeline:
75         * Modules/webgpu/WebGPUComputePipeline.cpp: Added.
76         (WebCore::WebGPUComputePipeline::create):
77         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
78         * Modules/webgpu/WebGPUComputePipeline.h: Added.
79         (WebCore::WebGPUComputePipeline::computePipeline const):
80         * Modules/webgpu/WebGPUComputePipeline.idl: Added.
81         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp: Added.
82         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
83         * Modules/webgpu/WebGPUComputePipelineDescriptor.h: Added.
84         * Modules/webgpu/WebGPUComputePipelineDescriptor.idl: Added.
85         * platform/graphics/gpu/GPUComputePipeline.h: Added.
86         (WebCore::GPUComputePipeline::platformComputePipeline const):
87         * platform/graphics/gpu/GPUComputePipelineDescriptor.h: Added.
88         (WebCore::GPUComputePipelineDescriptor::GPUComputePipelineDescriptor):
89         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Added.
90         (WebCore::tryCreateMtlComputeFunction):
91         (WebCore::tryCreateMTLComputePipelineState):
92         (WebCore::GPUComputePipeline::tryCreate):
93         (WebCore::GPUComputePipeline::GPUComputePipeline):
94
95         Enable creating a GPUComputePipeline from a GPUDevice:
96         * Modules/webgpu/WebGPUDevice.cpp:
97         (WebCore::WebGPUDevice::createComputePipeline const):
98         * Modules/webgpu/WebGPUDevice.h:
99         * Modules/webgpu/WebGPUDevice.idl:
100         * platform/graphics/gpu/GPUDevice.cpp:
101         (WebCore::GPUDevice::tryCreateComputePipeline const):
102         * platform/graphics/gpu/GPUDevice.h:
103
104         No longer unnecessarily ref the WebGPUCommandEncoder when creating pass encoder:
105         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
106         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup):
107         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): Deleted.
108         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Deleted.
109         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
110         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
111         (WebCore::WebGPURenderPassEncoder::create):
112         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
113         (WebCore::WebGPURenderPassEncoder::setPipeline):
114         (WebCore::WebGPURenderPassEncoder::passEncoder):
115         (WebCore::WebGPURenderPassEncoder::passEncoder const):
116         * Modules/webgpu/WebGPURenderPassEncoder.h:
117
118         Updates to GPUBindGroup and *setBindGroup for compute function arguments:
119         * platform/graphics/gpu/GPUBindGroup.h:
120         (WebCore::GPUBindGroup::vertexArgsBuffer const):
121         (WebCore::GPUBindGroup::fragmentArgsBuffer const):
122         (WebCore::GPUBindGroup::computeArgsBuffer const):
123         (WebCore::GPUBindGroup::vertexArgsBuffer): Deleted. Const-qualified.
124         (WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
125         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
126         (WebCore::tryGetResourceAsMTLSamplerState): Now just returns the MTLSamplerState to reduce reference churning.
127         (WebCore::GPUBindGroup::tryCreate):
128         (WebCore::GPUBindGroup::GPUBindGroup):
129         (WebCore::tryGetResourceAsSampler): Renamed to tryGetResourceAsMTLSamplerState.
130
131         Updates to GPUProgrammablePassEncoder and GPURenderPassEncoder:
132         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
133         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
134         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
135         (WebCore::GPUProgrammablePassEncoder::setComputeBuffer): Added.
136         * platform/graphics/gpu/GPURenderPassEncoder.h:
137         (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder):
138         * platform/graphics/gpu/GPURenderPipeline.h:
139         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Remove unecessary include.
140         (WebCore::GPUProgrammablePassEncoder::endPass): No longer virtual. Delegates shared behavior for derived classes.
141         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
142         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
143         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
144         (WebCore::GPURenderPassEncoder::setPipeline):
145         (WebCore::GPURenderPassEncoder::draw):
146         (WebCore::GPURenderPassEncoder::useResource): These private overrides are called only by base after checking for encoder existence.
147         (WebCore::GPURenderPassEncoder::setVertexBuffer): Ditto.
148         (WebCore::GPURenderPassEncoder::setFragmentBuffer): Ditto.
149         (WebCore::GPURenderPassEncoder::endPass): Deleted. Now handled by base class.
150
151 2019-03-23  Simon Fraser  <simon.fraser@apple.com>
152
153         REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
154         https://bugs.webkit.org/show_bug.cgi?id=137043
155         rdar://problem/16595330
156
157         Reviewed by Zalan Bujtas.
158
159         Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
160         to the UI process, and use it to set UIScrollView indicators visible or not.
161
162         Tests: fast/scrolling/ios/scrollbar-hiding.html:
163
164         * page/scrolling/AsyncScrollingCoordinator.cpp:
165         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
166         * page/scrolling/ScrollingCoordinator.cpp:
167         (WebCore::operator<<):
168         * page/scrolling/ScrollingCoordinatorTypes.h:
169         * page/scrolling/ScrollingTreeNode.h:
170         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
171         (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
172         * page/scrolling/ScrollingTreeScrollingNode.h:
173         * platform/ScrollableArea.h:
174         (WebCore::ScrollableArea::horizontalScrollbarHiddenByStyle const):
175         (WebCore::ScrollableArea::verticalScrollbarHiddenByStyle const):
176         * rendering/RenderLayer.cpp:
177         (WebCore::scrollbarHiddenByStyle):
178         (WebCore::RenderLayer::horizontalScrollbarHiddenByStyle const):
179         (WebCore::RenderLayer::verticalScrollbarHiddenByStyle const):
180         * rendering/RenderLayer.h:
181
182 2019-03-23  Zalan Bujtas  <zalan@apple.com>
183
184         [ContentChangeObserver] Add support for observing opacity.
185         https://bugs.webkit.org/show_bug.cgi?id=196172
186
187         Reviewed by Simon Fraser.
188
189         This patch adds support for observing opacity changes. At this point we only track one transition at a time.
190         if the page registers transition on both left and opacity, the first is getting observed only.
191
192         Tests: fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html
193                fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html
194                fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html
195                fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html
196                fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html
197
198         * page/ios/ContentChangeObserver.cpp:
199         (WebCore::isConsideredHidden):
200         (WebCore::ContentChangeObserver::didAddTransition):
201         * page/ios/ContentChangeObserver.h:
202         (WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
203
204 2019-03-23  Zalan Bujtas  <zalan@apple.com>
205
206         [ContentChangeObserver] Check if the transitioned content is visible at onAnimationEnd
207         https://bugs.webkit.org/show_bug.cgi?id=196171
208
209         Reviewed by Simon Fraser.
210
211         At onAnimationEnd we don't yet have the final computed style for the transitioned content.
212         However the current state (before computing the final style) might already be qualified to be visible.
213         Introduce "CompletedTransition" to indicate that the transition is all set as far observing is concerned
214         (as opposed to "EndedTransition" where we still need to observe the content for the final style change).
215
216         Test: fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html
217
218         * page/ios/ContentChangeObserver.cpp:
219         (WebCore::ContentChangeObserver::didFinishTransition):
220         (WebCore::ContentChangeObserver::adjustObservedState):
221         * page/ios/ContentChangeObserver.h:
222
223 2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
224
225         [GTK] Remove build time dependency on Geoclue2
226         https://bugs.webkit.org/show_bug.cgi?id=195994
227
228         Reviewed by Michael Catanzaro.
229
230         Remove old Geoclue implementation.
231
232         * PlatformGTK.cmake:
233         * SourcesGTK.txt:
234         * platform/geoclue/GeolocationProviderGeoclue.cpp: Removed.
235         * platform/geoclue/GeolocationProviderGeoclue.h: Removed.
236         * platform/geoclue/GeolocationProviderGeoclueClient.h: Removed.
237
238 2019-03-22  Eric Carlson  <eric.carlson@apple.com>
239
240         Flaky AVEncoderBitRateKey symbol not found crash on imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
241         https://bugs.webkit.org/show_bug.cgi?id=193724
242         <rdar://problem/47483831>
243
244         Reviewed by Jer Noble.
245
246         The soft link macros occasionally fail to load constants from AVFoundation.framework
247         which are actually in one of its sub-frameworks. While we investigate the cause
248         cause of the failure, ise the SOFT_LINK_CONSTANT_MAY_FAIL so we can detect the failure
249         and return a local copy of the string instead of crashing.
250         
251         No new tests, this should prevent existing tests from crashing.
252
253         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
254         (WebCore::myAVFormatIDKey):
255         (WebCore::myAVNumberOfChannelsKey):
256         (WebCore::myAVSampleRateKey):
257         (WebCore::myAVEncoderBitRateKey):
258
259 2019-03-22  Youenn Fablet  <youenn@apple.com>
260
261         REGRESSION: Flaky ASSERTION FAILED: !m_killed seen with http/tests/security/cross-origin-worker-indexeddb.html
262         https://bugs.webkit.org/show_bug.cgi?id=196024
263         <rdar://problem/49117272>
264
265         Reviewed by Alexey Proskuryakov.
266
267         Do not proceed with opening the database if it is being closed.
268         Speculative fix, this should stop making test crashing on bots.
269
270         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
271         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
272
273 2019-03-22  Youenn Fablet  <youenn@apple.com>
274
275         storage/indexeddb/closed-cursor-private.html is crashing on debug
276         https://bugs.webkit.org/show_bug.cgi?id=196101
277
278         Reviewed by Alex Christensen.
279
280         In case of immediate close for user delete, the transaction might be deleted.
281         If the request for space is pending, it will be executed with an error as parameter.
282         In that case, the call to didCommitTransaction will not find any existing transaction.
283         Speculative fix, test should no longer crash.
284
285         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
286         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
287
288 2019-03-22  Devin Rousso  <drousso@apple.com>
289
290         Web Inspector: Safari Canvas Inspector seems to show the canvas being rendered twice per frame.
291         https://bugs.webkit.org/show_bug.cgi?id=196082
292         <rdar://problem/49113496>
293
294         Reviewed by Dean Jackson.
295
296         Tests: inspector/canvas/recording-2d.html
297                inspector/canvas/recording-bitmaprenderer.html
298                inspector/canvas/recording-html-2d.html
299                inspector/canvas/recording-webgl.html
300                inspector/canvas/setRecordingAutoCaptureFrameCount.html
301
302         WebGL `<canvas>` follow a different "rendering" path such that `HTMLCanvasElement::paint`
303         isn't called. Previously, there was a 0s timer that was started after the first action of a
304         frame was recorded (for the case that the `<canvas>` isn't attached to the DOM) that would
305         automatically stop the recording. It was possible that actions in two different "frame"s
306         were recorded as part of the same frame, because the WebGL `<canvas>` would instead fall
307         back to the timer to know when the "frame" had ended.
308
309         Now, there is additional instrumentation for the WebGL specific rendering path.
310         Additionally, replace the 0s timer with a microtask for more "immediate" calling.
311
312         * html/HTMLCanvasElement.cpp:
313         (WebCore::HTMLCanvasElement::paint):
314         Ensure that the `InspectorInstrumentation` call is last. This matches what we expect, as
315         before we were instrumenting right before is it about to paint.
316
317         * platform/graphics/GraphicsContext3D.h:
318         (WebCore::GraphicsContext3D::Client::~Client): Added.
319         (WebCore::GraphicsContext3D::addClient): Added.
320         (WebCore::GraphicsContext3D::removeClient): Added.
321         (WebCore::GraphicsContext3D::setWebGLContext): Deleted.
322         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
323         (WebCore::GraphicsContext3D::markLayerComposited):
324         (WebCore::GraphicsContext3D::forceContextLost):
325         (WebCore::GraphicsContext3D::recycleContext):
326         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
327         * html/canvas/WebGLRenderingContextBase.h:
328         * html/canvas/WebGLRenderingContextBase.cpp:
329         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
330         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
331         (WebCore::WebGLRenderingContextBase::didComposite): Added.
332         (WebCore::WebGLRenderingContextBase::forceContextLost):
333         (WebCore::WebGLRenderingContextBase::recycleContext):
334         (WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification): Added.
335         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Deleted.
336         Introduce a `GraphicsContext3DClient` abstract class, rather than passing the
337         `WebGLRenderingContextBase` directly to the `GraphicsContext3D` (layering violation).
338         Notify the client whenever the `GraphicsContext3D` composites, which will in turn notify the
339         `InspectorCanvasAgent` so that it knows that the "frame" is over.
340
341         * inspector/agents/InspectorCanvasAgent.h:
342         * inspector/agents/InspectorCanvasAgent.cpp:
343         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
344         (WebCore::InspectorCanvasAgent::requestNode):
345         (WebCore::InspectorCanvasAgent::requestContent):
346         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
347         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
348         (WebCore::InspectorCanvasAgent::startRecording):
349         (WebCore::InspectorCanvasAgent::stopRecording):
350         (WebCore::InspectorCanvasAgent::requestShaderSource):
351         (WebCore::InspectorCanvasAgent::updateShader):
352         (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
353         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
354         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
355         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
356         (WebCore::InspectorCanvasAgent::recordCanvasAction):
357         (WebCore::InspectorCanvasAgent::canvasDestroyed):
358         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
359         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
360         (WebCore::InspectorCanvasAgent::didEnableExtension):
361         (WebCore::InspectorCanvasAgent::didCreateProgram):
362         (WebCore::InspectorCanvasAgent::willDeleteProgram):
363         (WebCore::InspectorCanvasAgent::isShaderProgramDisabled):
364         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
365         (WebCore::InspectorCanvasAgent::clearCanvasData):
366         (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
367         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
368         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
369         (WebCore::InspectorCanvasAgent::findInspectorProgram):
370         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): Deleted.
371         Replace raw pointers with `RefPtr`s. This is primarily used so that the microtask (instead
372         of a timer) that is enqueued after the first action of each frame  is recorded can access a
373         ref-counted instance of an `InspectorCanvas`, ensuring that it isn't destructed.
374
375         * inspector/InspectorCanvas.h:
376         * inspector/InspectorCanvas.cpp:
377         (WebCore::InspectorCanvas::canvasElement):
378         (WebCore::InspectorCanvas::recordAction):
379         (WebCore::InspectorCanvas::finalizeFrame):
380         (WebCore::InspectorCanvas::releaseObjectForRecording): Added.
381         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
382         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
383         (WebCore::InspectorCanvas::buildInitialState):
384         (WebCore::InspectorCanvas::releaseInitialState): Deleted.
385         (WebCore::InspectorCanvas::releaseFrames): Deleted.
386         (WebCore::InspectorCanvas::releaseData): Deleted.
387         Move the recording payload construction logic to `InspectorCanvas` so the actual data
388         doesn't need to leave that class.
389         Drive-by: unify the logic for getting the contents of a canvas from `InspectorCanvasAgent`.
390
391 2019-03-22  Keith Rollin  <krollin@apple.com>
392
393         Enable ThinLTO support in Production builds
394         https://bugs.webkit.org/show_bug.cgi?id=190758
395         <rdar://problem/45413233>
396
397         Reviewed by Daniel Bates.
398
399         Enable building with Thin LTO in Production when using Xcode 10.2 or
400         later. This change results in a 1.45% progression in PLT5. Full
401         Production build times increase about 2-3%. Incremental build times
402         are more severely affected, and so LTO is not enabled for local
403         engineering builds.
404
405         LTO is enabled only on macOS for now, until rdar://problem/49013399,
406         which affects ARM builds, is fixed.
407
408         Removed the conditionals that disabled LTO on 32-bit systems since we
409         no longer build for those.
410
411         To change the LTO setting when building locally:
412
413         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
414           command line.
415         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
416           on the command line.
417         - If building with `build-root`, specify --lto={none,thin,full} on the
418           command line.
419         - If building with Xcode, create a LocalOverrides.xcconfig file at the
420           top level of your repository directory (if needed) and define
421           WK_LTO_MODE to full, thin, or none.
422
423         No new tests since there should be no observable behavior difference.
424
425         * Configurations/Base.xcconfig:
426
427 2019-03-22  Ryan Haddad  <ryanhaddad@apple.com>
428
429         Unreviewed, rolling out r243356.
430
431         Causes assertion failures with WebGL layout tests on macOS and
432         iOS.
433
434         Reverted changeset:
435
436         "Web Inspector: Safari Canvas Inspector seems to show the
437         canvas being rendered twice per frame."
438         https://bugs.webkit.org/show_bug.cgi?id=196082
439         https://trac.webkit.org/changeset/243356
440
441 2019-03-22  Antti Koivisto  <antti@apple.com>
442
443         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
444         https://bugs.webkit.org/show_bug.cgi?id=196100
445         <rdar://problem/49117933>
446
447         Reviewed by Simon Fraser.
448
449         Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
450
451         * page/scrolling/ScrollingTree.cpp:
452         (WebCore::ScrollingTree::commitTreeState):
453         * page/scrolling/ScrollingTree.h:
454         (WebCore::ScrollingTree::positionedNodesWithRelatedOverflow):
455
456         Add a separate map of positioned node ids for easy access.
457
458         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
459         (WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const):
460         (WebCore::ScrollingTreePositionedNode::relatedOverflowScrollingNodes const):
461         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
462         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
463
464 2019-03-22  Antoine Quint  <graouts@apple.com>
465
466         [Web Animations] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::WebAnimation::timeToNextTick const + 757
467         https://bugs.webkit.org/show_bug.cgi?id=196125
468         <rdar://problem/46520059>
469
470         Reviewed by Dean Jackson.
471
472         Because of floating point math in playState() that wouldn't account for timeEpsilon, we would get into a state where the animation phase
473         was "after" but the play state was "running" when the current time was about a microsecond away from the active time boundary. This meant
474         that the early return statement in WebAnimation::timeToNextTick() would not be hit while we would not handle the possibility of being in
475         the "after" phase in the rest of the function, therefore eventually hitting the ASSERT_NOT_REACHED() at the end of the function.
476
477         We now account for timeEpsilon in playState() and correctly report we're in the "finished" play state when in the "after" phase also.
478
479         * animation/WebAnimation.cpp:
480         (WebCore::WebAnimation::playState const):
481
482 2019-03-22  Alicia Boya García  <aboya@igalia.com>
483
484         [MSE][GStreamer] Don't construct segments on PlaybackPipeline::flush
485         https://bugs.webkit.org/show_bug.cgi?id=195867
486
487         Reviewed by Xabier Rodriguez-Calvar.
488
489         The previous approach did not really work for flushes on only one
490         branch, as setting reset-time in FLUSH_STOP affects the running time
491         of the entire pipeline, causing timing issues in the other branch.
492
493         Since it's preferable not to interfere with the other branch if
494         possible, setting reset-time to FALSE fixes that problem.
495
496         Also, it's not necessary to fabricate a segment. Since we are not
497         seeking, only the base needs to be adjusted, and gstbasesrc already
498         handles this correctly by default.
499
500         This fixes an audio/video synchronization bug in YT when some
501         automatic quality changes occur.
502
503         Tests: imported/w3c/web-platform-tests/media-source/mediasource-correct-frames-after-reappend.html
504                imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html
505
506         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
507         (WebCore::PlaybackPipeline::flush):
508
509 2019-03-22  Frederic Wang  <fwang@igalia.com>
510
511         Move implementation of mathsize to a single place
512         https://bugs.webkit.org/show_bug.cgi?id=196129
513
514         Reviewed by Ryosuke Niwa.
515
516         Currently, mathsize is partially implemented in the MathML UA stylesheet and partially
517         implemented in the MathML DOM classes using addPropertyToPresentationAttributeStyle. This
518         patch moves the whole implementation to the latter place, so that it's easier to understand.
519         It will also allow to conditionally disable the mathsize values removed from MathML Core.
520
521         No new tests, already covered by existing tests.
522
523         * css/mathml.css: Remove mathsize rules.
524         * mathml/MathMLElement.cpp:
525         (WebCore::convertMathSizeIfNeeded): Convert "small", "normal" and "big" to the values that
526         used to be in the UA stylesheet. Also add a comment that we don't support all MathML lengths.
527         (WebCore::MathMLElement::collectStyleForPresentationAttribute): Don't skip "small", "normal"
528         or "big".
529         (WebCore::convertToPercentageIfNeeded): Renamed to convertMathSizeIfNeeded.
530
531 2019-03-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
532
533         Remove the SVG tear off objects for SVGNumber, SVGNumberList and SVGAnimatedNumberList
534         https://bugs.webkit.org/show_bug.cgi?id=196084
535
536         Reviewed by Simon Fraser.
537
538         To remove the tear off objects for these interfaces, we need to do the
539         following:
540
541         -- SVGNumber will be a superclass of SVGValueProperty<float>. It provides
542            the DOM interface functions.
543
544         -- SVGNumberList will be a superclass of SVGValuePropertyList<SVGNumber>.
545            It provides creation, parsing and converting to string functions.
546
547         -- SVGAnimatedNumberList will be defined as SVGAnimatedPropertyList<SVGNumberList>.
548
549         To make things work as expected:
550
551         -- Properties of type SVGAnimatedNumberList have to be registered with
552            SVGPropertyOwnerRegistry.
553         -- An accessor, an animator and an animation function should be defined
554            for SVGAnimatedNumberList.
555
556         * Sources.txt:
557         * WebCore.xcodeproj/project.pbxproj:
558         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
559         (WebCore::updateCharacterData):
560         (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
561         * svg/SVGAnimatedNumberList.cpp: Removed.
562         * svg/SVGAnimatedNumberList.h: Removed.
563         * svg/SVGAnimatedPointList.cpp: Removed.
564         * svg/SVGAnimatedPointList.h: Removed.
565         * svg/SVGAnimatedType.h:
566         (WebCore::SVGAnimatedType::type const):
567         * svg/SVGAnimatorFactory.h:
568         (WebCore::SVGAnimatorFactory::create):
569         * svg/SVGComponentTransferFunctionElement.cpp:
570         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
571         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
572         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
573         * svg/SVGComponentTransferFunctionElement.h:
574         (WebCore::SVGComponentTransferFunctionElement::tableValues const):
575         (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated):
576         * svg/SVGFEColorMatrixElement.cpp:
577         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
578         (WebCore::SVGFEColorMatrixElement::registerAttributes):
579         (WebCore::SVGFEColorMatrixElement::parseAttribute):
580         (WebCore::SVGFEColorMatrixElement::build const):
581         * svg/SVGFEColorMatrixElement.h:
582         * svg/SVGFEConvolveMatrixElement.cpp:
583         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
584         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
585         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
586         (WebCore::SVGFEConvolveMatrixElement::build const):
587         * svg/SVGFEConvolveMatrixElement.h:
588         * svg/SVGNumber.h:
589         (WebCore::SVGNumber::create):
590         (WebCore::SVGNumber::clone const):
591         (WebCore::SVGNumber::valueForBindings):
592         (WebCore::SVGNumber::setValueForBindings):
593         (WebCore::SVGNumber::SVGNumber): Deleted.
594         * svg/SVGNumberList.h:
595         (WebCore::SVGNumberList::create):
596         (WebCore::SVGNumberList::parse):
597         (WebCore::SVGNumberList::SVGNumberList): Deleted.
598         * svg/SVGNumberListValues.cpp: Removed.
599         * svg/SVGNumberListValues.h: Removed.
600         * svg/SVGTextPositioningElement.cpp:
601         (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
602         (WebCore::SVGTextPositioningElement::registerAttributes):
603         (WebCore::SVGTextPositioningElement::parseAttribute):
604         * svg/SVGTextPositioningElement.h:
605         (WebCore::SVGTextPositioningElement::rotate const):
606         (WebCore::SVGTextPositioningElement::rotateAnimated):
607         * svg/SVGValue.h:
608         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
609         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
610         * svg/properties/SVGAnimatedPropertyImpl.h:
611         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
612         (WebCore::SVGAnimationNumberListFunction::progress):
613         * svg/properties/SVGAttributeRegistry.h:
614         * svg/properties/SVGPropertyOwnerRegistry.h:
615         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
616
617 2019-03-21  Devin Rousso  <drousso@apple.com>
618
619         Web Inspector: Safari Canvas Inspector seems to show the canvas being rendered twice per frame.
620         https://bugs.webkit.org/show_bug.cgi?id=196082
621         <rdar://problem/49113496>
622
623         Reviewed by Dean Jackson.
624
625         Tests: inspector/canvas/recording-2d.html
626                inspector/canvas/recording-bitmaprenderer.html
627                inspector/canvas/recording-html-2d.html
628                inspector/canvas/recording-webgl.html
629                inspector/canvas/setRecordingAutoCaptureFrameCount.html
630
631         WebGL `<canvas>` follow a different "rendering" path such that `HTMLCanvasElement::paint`
632         isn't called. Previously, there was a 0s timer that was started after the first action of a
633         frame was recorded (for the case that the `<canvas>` isn't attached to the DOM) that would
634         automatically stop the recording. It was possible that actions in two different "frame"s
635         were recorded as part of the same frame, because the WebGL `<canvas>` would instead fall
636         back to the timer to know when the "frame" had ended.
637
638         Now, there is additional instrumentation for the WebGL specific rendering path.
639         Additionally, replace the 0s timer with a microtask for more "immediate" calling.
640
641         * html/HTMLCanvasElement.cpp:
642         (WebCore::HTMLCanvasElement::paint):
643         Ensure that the `InspectorInstrumentation` call is last. This matches what we expect, as
644         before we were instrumenting right before is it about to paint.
645
646         * platform/graphics/GraphicsContext3D.h:
647         (WebCore::GraphicsContext3D::Client::~Client): Added.
648         (WebCore::GraphicsContext3D::addClient): Added.
649         (WebCore::GraphicsContext3D::removeClient): Added.
650         (WebCore::GraphicsContext3D::setWebGLContext): Deleted.
651         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
652         (WebCore::GraphicsContext3D::markLayerComposited):
653         (WebCore::GraphicsContext3D::forceContextLost):
654         (WebCore::GraphicsContext3D::recycleContext):
655         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
656         * html/canvas/WebGLRenderingContextBase.h:
657         * html/canvas/WebGLRenderingContextBase.cpp:
658         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
659         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
660         (WebCore::WebGLRenderingContextBase::didComposite): Added.
661         (WebCore::WebGLRenderingContextBase::forceContextLost):
662         (WebCore::WebGLRenderingContextBase::recycleContext):
663         (WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification): Added.
664         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Deleted.
665         Introduce a `GraphicsContext3DClient` abstract class, rather than passing the
666         `WebGLRenderingContextBase` directly to the `GraphicsContext3D` (layering violation).
667         Notify the client whenever the `GraphicsContext3D` composites, which will in turn notify the
668         `InspectorCanvasAgent` so that it knows that the "frame" is over.
669
670         * inspector/agents/InspectorCanvasAgent.h:
671         * inspector/agents/InspectorCanvasAgent.cpp:
672         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
673         (WebCore::InspectorCanvasAgent::requestNode):
674         (WebCore::InspectorCanvasAgent::requestContent):
675         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
676         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
677         (WebCore::InspectorCanvasAgent::startRecording):
678         (WebCore::InspectorCanvasAgent::stopRecording):
679         (WebCore::InspectorCanvasAgent::requestShaderSource):
680         (WebCore::InspectorCanvasAgent::updateShader):
681         (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
682         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
683         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
684         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
685         (WebCore::InspectorCanvasAgent::recordCanvasAction):
686         (WebCore::InspectorCanvasAgent::canvasDestroyed):
687         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
688         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
689         (WebCore::InspectorCanvasAgent::didEnableExtension):
690         (WebCore::InspectorCanvasAgent::didCreateProgram):
691         (WebCore::InspectorCanvasAgent::willDeleteProgram):
692         (WebCore::InspectorCanvasAgent::isShaderProgramDisabled):
693         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
694         (WebCore::InspectorCanvasAgent::clearCanvasData):
695         (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
696         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
697         (WebCore::InspectorCanvasAgent::assertInspectorProgram):
698         (WebCore::InspectorCanvasAgent::findInspectorProgram):
699         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): Deleted.
700         Replace raw pointers with `RefPtr`s. This is primarily used so that the microtask (instead
701         of a timer) that is enqueued after the first action of each frame  is recorded can access a
702         ref-counted instance of an `InspectorCanvas`, ensuring that it isn't destructed.
703
704         * inspector/InspectorCanvas.h:
705         * inspector/InspectorCanvas.cpp:
706         (WebCore::InspectorCanvas::canvasElement):
707         (WebCore::InspectorCanvas::recordAction):
708         (WebCore::InspectorCanvas::finalizeFrame):
709         (WebCore::InspectorCanvas::releaseObjectForRecording): Added.
710         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
711         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
712         (WebCore::InspectorCanvas::buildInitialState):
713         (WebCore::InspectorCanvas::releaseInitialState): Deleted.
714         (WebCore::InspectorCanvas::releaseFrames): Deleted.
715         (WebCore::InspectorCanvas::releaseData): Deleted.
716         Move the recording payload construction logic to `InspectorCanvas` so the actual data
717         doesn't need to leave that class.
718         Drive-by: unify the logic for getting the contents of a canvas from `InspectorCanvasAgent`.
719
720 2019-03-21  Tim Horton  <timothy_horton@apple.com>
721
722         Adopt UIWKDocumentContext
723         https://bugs.webkit.org/show_bug.cgi?id=196040
724         <rdar://problem/48642440>
725
726         Reviewed by Ryosuke Niwa.
727
728         New API test: WebKit.DocumentEditingContext
729
730         * dom/Range.h:
731         * editing/TextGranularity.h:
732         Make TextGranularity encodable by providing EnumTraits.
733
734         * editing/TextIterator.cpp:
735         (WebCore::plainTextReplacingNoBreakSpace):
736         * editing/TextIterator.h:
737         Expose an nbsp-replacing variant of plainText that takes Positions instead of Ranges.
738
739 2019-03-21  Sihui Liu  <sihui_liu@apple.com>
740
741         Fix key path extraction code in IndexedDB to check own property
742         https://bugs.webkit.org/show_bug.cgi?id=196099
743
744         Reviewed by Ryosuke Niwa.
745
746         Covered by existing tests.
747
748         * Modules/indexeddb/IDBFactory.cpp:
749         (WebCore::IDBFactory::cmp):
750         We don't need to check the second parameters if the first is already invalid.
751
752         * Modules/indexeddb/IDBKeyRange.cpp:
753         (WebCore::IDBKeyRange::bound):
754         Ditto.
755
756         * Modules/indexeddb/IDBObjectStore.cpp:
757         (WebCore::IDBObjectStore::putOrAdd):
758         we should not clear the exception during serialization because the execeptions may be explicitly thrown by parameters.
759
760         * bindings/js/IDBBindingUtilities.cpp:
761         (WebCore::get):
762         Fix implementation according to https://www.w3.org/TR/IndexedDB-2/#extract-key-from-value.
763
764         (WebCore::canInjectNthValueOnKeyPath):
765         Check the last identifier.
766
767 2019-03-21  Antoine Quint  <graouts@apple.com>
768
769         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
770         https://bugs.webkit.org/show_bug.cgi?id=196118
771         <rdar://problem/46614137>
772
773         Reviewed by Ryosuke Niwa.
774
775         Test: webanimations/js-wrapper-kept-alive.html
776
777         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.
778
779         * animation/WebAnimation.cpp:
780         (WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
781         (WebCore::WebAnimation::hasPendingActivity const):
782         * animation/WebAnimation.h:
783
784 2019-03-21  Jer Noble  <jer.noble@apple.com>
785
786         Inband Text Track cues interspersed with Data cues can display out of order.
787         https://bugs.webkit.org/show_bug.cgi?id=196095
788
789         Reviewed by Eric Carlson.
790
791         The compareCueIntervalForDisplay() comparator depends on a virtual function, isPositionedAbove(TextTrackCue* other),
792         but this comparison returns inconsistent results for cueA->isPositionedAbove(cueB) and cueB->isPositionedAbove(cueA)
793         if the two cues are different subclasses of TextTrackCue.
794
795         The underlying algorithm should be fixed in a future patch, but for now, remove all non-displaying cues from the array
796         of activeCues before sorting, rather than after when iterating over the sorted list of activeCues.
797
798         * html/shadow/MediaControlElements.cpp:
799         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
800
801 2019-03-21  Youenn Fablet  <youenn@apple.com>
802
803         Cache API and IDB space usages should be initialized on first quota check
804         https://bugs.webkit.org/show_bug.cgi?id=195707
805
806         Reviewed by Chris Dumez.
807
808         Add a way to require IDBServer to create a quota user for a given origin.
809         Make sure that removing a user might kick-in processing of pending requests.
810         In the case of processing pending requests, we should not decide on the first task
811         except if it is triggered by a request space response.
812         Update processPendingRequests accordingly.
813
814         Tests: http/tests/IndexedDB/storage-limit-1.https.html
815                http/tests/IndexedDB/storage-limit-2.https.html
816
817         * Modules/indexeddb/server/IDBServer.h:
818         (WebCore::IDBServer::IDBServer::initializeQuotaUser):
819         * storage/StorageQuotaManager.cpp:
820         (WebCore::StorageQuotaManager::removeUser):
821         (WebCore::StorageQuotaManager::askForMoreSpace):
822         (WebCore::StorageQuotaManager::processPendingRequests):
823         * storage/StorageQuotaManager.h:
824
825 2019-03-21  Alex Christensen  <achristensen@webkit.org>
826
827         Fix iOS build after r243337
828         https://bugs.webkit.org/show_bug.cgi?id=195935
829
830         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
831         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
832         (WebCore::playbackSessionModel const): Deleted.
833
834 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
835
836         Hardening: Use WeakPtrs in PlaybackSessionInterface{Mac,AVKit}
837         https://bugs.webkit.org/show_bug.cgi?id=195935
838         <rdar://problem/49007015>
839
840         Reviewed by Eric Carlson.
841
842         The PlaybackSessionInterface{Mac,AVKit} implementations store their playback session model
843         and playback controls manager members as bare pointers, something we've been working
844         to eliminate.
845         
846         This patch corrects this oversight.
847
848         No new tests since no changes in behavior.
849
850         * platform/cocoa/PlaybackSessionModel.h:
851         * platform/ios/PlaybackSessionInterfaceAVKit.h:
852         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
853         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
854         (WebCore::playbackSessionModel const): Moved to implementation since WEBCORE_EXPORT is not
855         supposed to be used with inline methods.
856         * platform/mac/PlaybackSessionInterfaceMac.h:
857         * platform/mac/PlaybackSessionInterfaceMac.mm:
858         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
859         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
860         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
861         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
862         (WebCore::PlaybackSessionInterfaceMac::playBackControlsManager):
863         * platform/mac/VideoFullscreenInterfaceMac.mm:
864         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
865         * platform/mac/WebPlaybackControlsManager.mm:
866         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
867         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
868         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
869
870 2019-03-21  Said Abou-Hallawa  <said@apple.com>
871
872         Remove the SVG tear off objects for SVGPoint, SVGPointList and SVGAnimatedPointList
873         https://bugs.webkit.org/show_bug.cgi?id=195905
874
875         Reviewed by Simon Fraser.
876
877         To remove the SVG tear off objects for SVGPoint, SVGPointList and 
878         SVGAnimatedPointList, these changes are needed:
879
880         -- Define SVGPoint to be a superclass of SVGValueProperty<FloatPoint>.
881
882         -- Define SVGAnimatedPointList to be a superclass of SVGAnimatedPropertyList<SVGPointList>
883
884         -- Add SVGPropertyList which is a superclass of SVGList. Its items are
885            defined to RefCounted. It is the base class of SVGValuePropertyList
886            and it will be  the base class of SVGPathSegList in a later patch.
887
888         -- Add SVGValuePropertyList which is the base class of all the lists whose
889            items are backed by a value objects like SVGPoint. The difference between
890            SVGPropertyList and SVGValuePropertyList is the former class can store
891            a Ref pointer of the base class like SVGPathSeg while the later type
892            has to store the same type for all the items.
893
894         -- Add SVGAnimatedPropertyList which is the base class for all the animated
895            lists. Note that:
896            1) SVGElement owns SVGAnimatedPropertyList
897            2) SVGAnimatedPropertyList owns m_baseVal whose type is SVGList
898            3) m_baseVal owns the items whose type is a superclass of SVGProperty.
899            When changing an item, it calls its owner which is an SVGList.
900            SVGList calls its owner which is SVGAnimatedPropertyList.
901            SVGAnimatedPropertyList calls its owner which SVGElement to commit
902            the change. Later SVGAnimatedPropertyList::synchronize() is called 
903            which returns the property valueAsString() to update the reflecting
904            attribute.
905
906         -- New accessor, animator and animation function are added to access
907            and animate a member of type SVGAnimatedPropertyList.
908
909         * Sources.txt:
910         * WebCore.xcodeproj/project.pbxproj:
911         * rendering/svg/SVGPathData.cpp:
912         (WebCore::pathFromCircleElement):
913         (WebCore::pathFromEllipseElement):
914         (WebCore::pathFromLineElement):
915         (WebCore::pathFromPathElement):
916         (WebCore::pathFromPolygonElement):
917         (WebCore::pathFromPolylineElement):
918         (WebCore::pathFromRectElement):
919         (WebCore::pathFromGraphicsElement):
920         * rendering/svg/SVGPathData.h:
921         The IDL of SVGPolyElement interface requires the following attribute:
922             readonly attribute SVGPointList points;
923         For which we return:
924             SVGPointList& points() { return m_points->baseVal(); }
925         But for all the other properties we return the currentValue(). So to have
926         the two functions with the same name, the following function is added:
927             const SVGPointList& points() const { return m_points->currentValue(); }
928         This definition requires changing all callers to be const.
929
930         * rendering/svg/SVGRenderTreeAsText.cpp:
931         (WebCore::operator<<):
932         * svg/SVGAnimatedPointList.cpp: Removed.
933         * svg/SVGAnimatedPointList.h: Removed.
934         * svg/SVGAnimatedType.h:
935         (WebCore::SVGAnimatedType::type const):
936         This function had a bad design. It was designed to use the index of the
937         variant as the AnimatedPropertyType. But when some of the types are removed
938         from SVGValueVariant, this broke things. This fix is temporary till the 
939         class SVGValueVariant is removed.
940
941         * svg/SVGAnimatorFactory.h:
942         (WebCore::SVGAnimatorFactory::create):
943         * svg/SVGExternalResourcesRequired.cpp:
944         * svg/SVGParserUtilities.cpp:
945         (WebCore::pointsListFromSVGData): Deleted.
946         * svg/SVGParserUtilities.h:
947         * svg/SVGPoint.h:
948         (WebCore::SVGPoint::create):
949         (WebCore::SVGPoint::clone const):
950         (WebCore::SVGPoint::x):
951         (WebCore::SVGPoint::setX):
952         (WebCore::SVGPoint::y):
953         (WebCore::SVGPoint::setY):
954         (WebCore::SVGPoint::matrixTransform const):
955         (WebCore::SVGPoint::matrixTransform): Deleted.
956         (WebCore::SVGPoint::SVGPoint): Deleted.
957         * svg/SVGPoint.idl:
958         matrixTransform() should not throw an exception.
959
960         * svg/SVGPointList.h:
961         (WebCore::SVGPointList::create):
962         (WebCore::SVGPointList::parse):
963         (WebCore::SVGPointList::SVGPointList): Deleted.
964         Move the parse() and valueAsString() methods to SVGPointList. It is now
965         a superclass of SVGValuePropertyList. Its items are of type Ref<SVGPoint>.
966
967         * svg/SVGPointListValues.cpp: Removed.
968         * svg/SVGPointListValues.h: Removed.
969         * svg/SVGPolyElement.cpp:
970         (WebCore::SVGPolyElement::SVGPolyElement):
971         (WebCore::SVGPolyElement::parseAttribute):
972         (WebCore::SVGPolyElement::approximateMemoryCost const):
973         (WebCore::SVGPolyElement::registerAttributes): Deleted.
974         (WebCore::SVGPolyElement::points): Deleted.
975         (WebCore::SVGPolyElement::animatedPoints): Deleted.
976         * svg/SVGPolyElement.h:
977         (WebCore::SVGPolyElement::points const):
978         (WebCore::SVGPolyElement::points):
979         (WebCore::SVGPolyElement::animatedPoints):
980         (WebCore::SVGPolyElement::pointList const): Deleted.
981         (WebCore::SVGPolyElement::attributeRegistry): Deleted.
982         * svg/SVGSVGElement.cpp:
983         (WebCore::SVGSVGElement::setCurrentTranslate):
984         (WebCore::SVGSVGElement::currentTranslate): Deleted.
985         * svg/SVGSVGElement.h:
986         * svg/SVGSVGElement.idl:
987         Define currentTranslate property to be of type Ref<SVGPoint>. When requesting
988         it just return a reference to it.
989
990         * svg/SVGValue.h:
991         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
992         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
993         * svg/properties/SVGAnimatedPropertyImpl.h:
994         * svg/properties/SVGAnimatedPropertyList.h: Added.
995         Define the accessor, the animator and the animated type of SVGPointList.
996
997         (WebCore::SVGAnimatedPropertyList::create):
998         (WebCore::SVGAnimatedPropertyList::~SVGAnimatedPropertyList):
999         (WebCore::SVGAnimatedPropertyList::baseVal const):
1000         (WebCore::SVGAnimatedPropertyList::baseVal):
1001         (WebCore::SVGAnimatedPropertyList::animVal const):
1002         (WebCore::SVGAnimatedPropertyList::animVal):
1003         (WebCore::SVGAnimatedPropertyList::currentValue const):
1004         (WebCore::SVGAnimatedPropertyList::SVGAnimatedPropertyList):
1005         (WebCore::SVGAnimatedPropertyList::ensureAnimVal):
1006         * svg/properties/SVGAnimationAdditiveListFunction.h: Added.
1007         (WebCore::SVGAnimationAdditiveListFunction::SVGAnimationAdditiveListFunction):
1008         (WebCore::SVGAnimationAdditiveListFunction::toAtEndOfDuration const):
1009         (WebCore::SVGAnimationAdditiveListFunction::adjustAnimatedList):
1010         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: Added.
1011         (WebCore::SVGAnimationPointListFunction::progress):
1012         Define the animation function for animating SVGPointList.
1013
1014         * svg/properties/SVGAttributeRegistry.h:
1015         * svg/properties/SVGPropertyList.h: Added.
1016         (WebCore::SVGPropertyList::SVGPropertyList):
1017         (WebCore::SVGPropertyList::~SVGPropertyList):
1018         * svg/properties/SVGPropertyOwnerRegistry.h:
1019         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1020         * svg/properties/SVGValuePropertyList.h: Added.
1021         (WebCore::SVGValuePropertyList::operator=):
1022         (WebCore::SVGValuePropertyList::operator Vector<typename PropertyType::ValueType> const):
1023         (WebCore::SVGValuePropertyList::resize):
1024         (WebCore::SVGValuePropertyList::SVGValuePropertyList):
1025
1026 2019-03-21  Said Abou-Hallawa  <said@apple.com>
1027
1028         Remove the SVG property tear off objects for SVGAnimatedString
1029         https://bugs.webkit.org/show_bug.cgi?id=196065
1030
1031         Reviewed by Simon Fraser.
1032
1033         -- Define SVGAnimatedString to be SVGAnimatedPrimitiveProperty<String>.
1034
1035         -- Add SVGAnimatedStringAccessor to associate an attribute name with a 
1036            pointer to an SVGAnimatedString member of an SVGElement. Given a 
1037            pointer to an SVGElement, this accessor will and create an animator
1038            for the animated property.
1039
1040         -- Add SVGAnimatedStringAnimator to animated an SVGAnimatedString.
1041
1042         -- Add SVGAnimationStringFunction which is a discrete function and is 
1043            responsible for progressing an animated String over a period of time.
1044
1045         -- Define SVGStringAnimator to be SVGPrimitivePropertyAnimator<String,
1046            SVGAnimationStringFunction>. SVGStringAnimator is responsible for
1047            animating attributes with no reflecting animated properties, e.g.
1048            "font-family".
1049
1050         * Sources.txt:
1051         * WebCore.xcodeproj/project.pbxproj:
1052         * svg/SVGAElement.cpp:
1053         (WebCore::SVGAElement::SVGAElement):
1054         (WebCore::SVGAElement::parseAttribute):
1055         (WebCore::SVGAElement::registerAttributes): Deleted.
1056         * svg/SVGAElement.h:
1057         * svg/SVGAnimateElementBase.cpp:
1058         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
1059         (WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
1060         * svg/SVGAnimateElementBase.h:
1061         * svg/SVGAnimatedString.cpp: Removed.
1062         * svg/SVGAnimatedString.h: Removed.
1063         * svg/SVGAnimationElement.cpp:
1064         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
1065         The animation controller has to tell whether the animator is discrete or
1066         not. The properties are now registered either in SVGAttributeRegistry which
1067         relies on the tear off objects to know the AnimatedPropertyType of the
1068         property. Or it is registered in SVGPropertyOwnerRegistry which creates
1069         the animators through the accessors. Each animator knows whether it is
1070         discrete or not.
1071
1072         * svg/SVGAnimatorFactory.h:
1073         (WebCore::SVGAnimatorFactory::create):
1074         * svg/SVGAttributeAnimationController.cpp:
1075         (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
1076         * svg/SVGAttributeAnimationController.h:
1077         * svg/SVGAttributeAnimationControllerBase.h:
1078         * svg/SVGCursorElement.h:
1079         * svg/SVGElement.cpp:
1080         (WebCore::SVGElement::SVGElement):
1081         (WebCore::SVGElement::parseAttribute):
1082         (WebCore::SVGElement::registerAttributes): Deleted.
1083         * svg/SVGElement.h:
1084         (WebCore::SVGElement::isKnownAttribute):
1085         (WebCore::SVGElement::className const):
1086         (WebCore::SVGElement::classNameAnimated):
1087         (WebCore::SVGElement::attributeRegistry): Deleted.
1088         * svg/SVGExternalResourcesRequired.cpp:
1089         * svg/SVGFEBlendElement.cpp:
1090         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
1091         (WebCore::SVGFEBlendElement::registerAttributes):
1092         (WebCore::SVGFEBlendElement::parseAttribute):
1093         * svg/SVGFEBlendElement.h:
1094         * svg/SVGFEColorMatrixElement.cpp:
1095         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
1096         (WebCore::SVGFEColorMatrixElement::registerAttributes):
1097         (WebCore::SVGFEColorMatrixElement::parseAttribute):
1098         * svg/SVGFEColorMatrixElement.h:
1099         * svg/SVGFEComponentTransferElement.cpp:
1100         (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
1101         (WebCore::SVGFEComponentTransferElement::parseAttribute):
1102         (WebCore::SVGFEComponentTransferElement::registerAttributes): Deleted.
1103         * svg/SVGFEComponentTransferElement.h:
1104         * svg/SVGFECompositeElement.cpp:
1105         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
1106         (WebCore::SVGFECompositeElement::registerAttributes):
1107         (WebCore::SVGFECompositeElement::parseAttribute):
1108         * svg/SVGFECompositeElement.h:
1109         * svg/SVGFEConvolveMatrixElement.cpp:
1110         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
1111         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
1112         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1113         * svg/SVGFEConvolveMatrixElement.h:
1114         * svg/SVGFEDiffuseLightingElement.cpp:
1115         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
1116         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
1117         (WebCore::SVGFEDiffuseLightingElement::registerAttributes): Deleted.
1118         * svg/SVGFEDiffuseLightingElement.h:
1119         * svg/SVGFEDisplacementMapElement.cpp:
1120         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
1121         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
1122         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
1123         * svg/SVGFEDisplacementMapElement.h:
1124         * svg/SVGFEDropShadowElement.cpp:
1125         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
1126         (WebCore::SVGFEDropShadowElement::parseAttribute):
1127         (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
1128         (WebCore::SVGFEDropShadowElement::registerAttributes): Deleted.
1129         * svg/SVGFEDropShadowElement.h:
1130         * svg/SVGFEGaussianBlurElement.cpp:
1131         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
1132         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
1133         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
1134         * svg/SVGFEGaussianBlurElement.h:
1135         * svg/SVGFEMergeNodeElement.cpp:
1136         (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
1137         (WebCore::SVGFEMergeNodeElement::parseAttribute):
1138         (WebCore::SVGFEMergeNodeElement::registerAttributes): Deleted.
1139         * svg/SVGFEMergeNodeElement.h:
1140         * svg/SVGFEMorphologyElement.cpp:
1141         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
1142         (WebCore::SVGFEMorphologyElement::registerAttributes):
1143         (WebCore::SVGFEMorphologyElement::parseAttribute):
1144         * svg/SVGFEMorphologyElement.h:
1145         * svg/SVGFEOffsetElement.cpp:
1146         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
1147         (WebCore::SVGFEOffsetElement::parseAttribute):
1148         (WebCore::SVGFEOffsetElement::svgAttributeChanged):
1149         (WebCore::SVGFEOffsetElement::registerAttributes): Deleted.
1150         * svg/SVGFEOffsetElement.h:
1151         * svg/SVGFESpecularLightingElement.cpp:
1152         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
1153         (WebCore::SVGFESpecularLightingElement::parseAttribute):
1154         (WebCore::SVGFESpecularLightingElement::registerAttributes): Deleted.
1155         * svg/SVGFESpecularLightingElement.h:
1156         * svg/SVGFETileElement.cpp:
1157         (WebCore::SVGFETileElement::SVGFETileElement):
1158         (WebCore::SVGFETileElement::parseAttribute):
1159         (WebCore::SVGFETileElement::registerAttributes): Deleted.
1160         * svg/SVGFETileElement.h:
1161         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1162         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
1163         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
1164         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
1165         * svg/SVGFilterPrimitiveStandardAttributes.h:
1166         (WebCore::SVGFilterPrimitiveStandardAttributes::result const):
1167         (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
1168         * svg/SVGLegacyAttributeAnimationController.cpp:
1169         (WebCore::SVGLegacyAttributeAnimationController::isDiscreteAnimator const):
1170         * svg/SVGLegacyAttributeAnimationController.h:
1171         * svg/SVGMPathElement.h:
1172         * svg/SVGScriptElement.h:
1173         * svg/SVGURIReference.cpp:
1174         (WebCore::SVGURIReference::SVGURIReference):
1175         (WebCore::SVGURIReference::isKnownAttribute):
1176         (WebCore::SVGURIReference::parseAttribute):
1177         (WebCore::SVGURIReference::registerAttributes): Deleted.
1178         (WebCore::SVGURIReference::href const): Deleted.
1179         (WebCore::SVGURIReference::hrefAnimated): Deleted.
1180         * svg/SVGURIReference.h:
1181         (WebCore::SVGURIReference::href const):
1182         (WebCore::SVGURIReference::hrefAnimated):
1183         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1184         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1185         * svg/properties/SVGAnimatedPropertyImpl.h:
1186         * svg/properties/SVGAttributeRegistry.h:
1187         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
1188         * svg/properties/SVGPropertyAnimatorFactory.h:
1189         (WebCore::SVGPropertyAnimatorFactory::createStringAnimator):
1190         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
1191         * svg/properties/SVGPropertyOwnerRegistry.h:
1192         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1193
1194 2019-03-21  Zalan Bujtas  <zalan@apple.com>
1195
1196         Do not insert the first-letter anonymous container until after we've constructed the first-letter renderer.
1197         https://bugs.webkit.org/show_bug.cgi?id=195919
1198         <rdar://problem/48573434>
1199
1200         Reviewed by Brent Fulgham.
1201
1202         When the container is injected too early, we might end up removing it as part of the collapsing logic
1203         while the text renderer is being removed (replaced with the first letter + remaining text).
1204
1205         Test: fast/css/first-letter-and-float-crash.html
1206
1207         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1208         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
1209
1210 2019-03-21  Eric Carlson  <eric.carlson@apple.com>
1211
1212         Add UI process WebRTC runtime logging.
1213         https://bugs.webkit.org/show_bug.cgi?id=196020
1214         <rdar://problem/49071443>
1215
1216         Reviewed by Youenn Fablet.
1217
1218         * inspector/agents/WebConsoleAgent.cpp:
1219         (WebCore::WebConsoleAgent::getLoggingChannels): Deleted.
1220         (WebCore::channelConfigurationForString): Deleted.
1221         (WebCore::WebConsoleAgent::setLoggingChannelLevel): Deleted.
1222         * inspector/agents/WebConsoleAgent.h:
1223         * inspector/agents/page/PageConsoleAgent.cpp:
1224         (WebCore::PageConsoleAgent::PageConsoleAgent): Change 'context' parameter from 
1225         WebAgentContext to PageAgentContext. Store the inspected page for later use.
1226         (WebCore::PageConsoleAgent::getLoggingChannels): Moved from WebConsoleAgent.
1227         (WebCore::channelConfigurationForString): Ditto.
1228         (WebCore::PageConsoleAgent::setLoggingChannelLevel): Moved from WebConsoleAgent.
1229         Call the inspected page to actually change the log channel configuration.
1230         * inspector/agents/page/PageConsoleAgent.h:
1231         * page/ChromeClient.h:
1232         * page/Page.cpp:
1233         (WebCore::Page::configureLoggingChannel): New.
1234         * page/Page.h:
1235
1236 2019-03-21  Andy Estes  <aestes@apple.com>
1237
1238         [iOS] Apple Pay should be available in documents with no user agent scripts
1239         https://bugs.webkit.org/show_bug.cgi?id=196061
1240         <rdar://problem/48649391>
1241
1242         Reviewed by Brady Eidson.
1243
1244         On platforms that support APPLE_PAY_REMOTE_UI, we can enable Apple Pay JS and Payment Request
1245         by default in all WebKit clients.
1246
1247         In order to protect the privacy of Apple Pay transactions, this patch implements the
1248         following restrictions on API usage:
1249
1250         1. If user agent scripts have been evaluated in a document, Apple Pay APIs will no longer be
1251         available for the duration of the document's lifetime.
1252         2. If an Apple Pay transaction has started in a document, user agent scripts will no longer
1253         be evaluated for the duration of the document's lifetime.
1254
1255         These restrictions are disabled for clients with the
1256         com.apple.private.WebKit.UnrestrictedApplePay entitlement and platforms that do support
1257         Apple Pay but don't support APPLE_PAY_REMOTE_UI.
1258
1259         Added new API tests.
1260
1261         * Modules/applepay/ApplePayRequestBase.cpp:
1262         (WebCore::convertAndValidate):
1263         * Modules/applepay/ApplePayRequestBase.h:
1264         * Modules/applepay/ApplePaySession.cpp:
1265         (WebCore::convertAndValidate):
1266         (WebCore::ApplePaySession::create):
1267         (WebCore::ApplePaySession::supportsVersion):
1268         (WebCore::ApplePaySession::canMakePayments):
1269         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
1270         (WebCore::ApplePaySession::openPaymentSetup):
1271         (WebCore::ApplePaySession::begin):
1272         * Modules/applepay/ApplePaySession.h:
1273         * Modules/applepay/ApplePaySession.idl:
1274         * Modules/applepay/PaymentCoordinator.cpp:
1275         (WebCore::PaymentCoordinator::supportsVersion const):
1276         (WebCore::PaymentCoordinator::canMakePayments):
1277         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
1278         (WebCore::PaymentCoordinator::openPaymentSetup):
1279         (WebCore::PaymentCoordinator::beginPaymentSession):
1280         (WebCore::PaymentCoordinator::validatedPaymentNetwork const):
1281         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
1282         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
1283         * Modules/applepay/PaymentCoordinator.h:
1284         * Modules/applepay/PaymentCoordinatorClient.h:
1285         (WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const):
1286         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1287         (WebCore::ApplePayPaymentHandler::show):
1288         (WebCore::ApplePayPaymentHandler::canMakePayment):
1289         (WebCore::ApplePayPaymentHandler::version const):
1290         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1291         * Modules/paymentrequest/PaymentHandler.h:
1292         * Modules/paymentrequest/PaymentRequest.cpp:
1293         (WebCore::PaymentRequest::show):
1294         (WebCore::PaymentRequest::canMakePayment):
1295
1296         Plumbed a Document& through to the various places that call into PaymentCoordinator for use
1297         by shouldAllowApplePay and shouldAllowUserAgentScripts.
1298
1299         * bindings/js/ScriptController.cpp:
1300         (WebCore::ScriptController::executeUserAgentScriptInWorld):
1301         (WebCore::ScriptController::shouldAllowUserAgentScripts const):
1302         * bindings/js/ScriptController.h:
1303
1304         Added executeUserAgentScriptInWorld, which calls executeScriptInWorld if allowed.
1305
1306         * dom/Document.cpp:
1307         (WebCore::Document::ensurePlugInsInjectedScript):
1308
1309         Changed to only evaluate the chrome client's plug-in extra script if allowed, and to mark
1310         the document as having evaluated user agent scripts.
1311
1312         (WebCore::Document::hasEvaluatedUserAgentScripts const):
1313         (WebCore::Document::isRunningUserScripts const):
1314         (WebCore::Document::setAsRunningUserScripts):
1315         (WebCore::Document::setHasEvaluatedUserAgentScripts):
1316         (WebCore::Document::hasStartedApplePaySession const):
1317         (WebCore::Document::setHasStartedApplePaySession):
1318         * dom/Document.h:
1319
1320         Added helper functions to set state on the top document.
1321
1322         * loader/DocumentThreadableLoader.cpp:
1323         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1324
1325         Removed call to topDocument() now that isRunningUserScripts() always checks the top document.
1326
1327         * page/Frame.cpp:
1328         (WebCore::Frame::injectUserScriptImmediately):
1329
1330         Changed to only inject the user script if allowed.
1331
1332         * page/Settings.yaml:
1333         * page/SettingsDefaultValues.h:
1334
1335         Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
1336
1337         * testing/Internals.cpp:
1338         (WebCore::Internals::setAsRunningUserScripts):
1339         (WebCore::Internals::setHasStartedApplePaySession):
1340         * testing/Internals.h:
1341         * testing/Internals.idl:
1342         * testing/MockPaymentCoordinator.h:
1343         * testing/MockPaymentCoordinator.idl:
1344
1345         Added some internal interfaces for use by TestWebKitAPI.
1346
1347 2019-03-21  Alex Christensen  <achristensen@webkit.org>
1348
1349         Add SPI to inform applications of WKContentRuleList actions
1350         https://bugs.webkit.org/show_bug.cgi?id=195965
1351         <rdar://problem/42664365>
1352
1353         Reviewed by Geoff Garen.
1354
1355         We already had SPI to inform the application of notifications.
1356         In order to inform it about other actions, I needed to put them in a different structure.
1357         Basically, instead of a Vector<Action> I use a Vector<Vector<Action>> that contains the same actions.
1358         That way we can give one callback per WKContentRuleList.
1359
1360         * Modules/websockets/WebSocketChannel.cpp:
1361         (WebCore::WebSocketChannel::connect):
1362         * WebCore.xcodeproj/project.pbxproj:
1363         * contentextensions/ContentExtensionActions.h:
1364         * contentextensions/ContentExtensionParser.cpp:
1365         (WebCore::ContentExtensions::loadEncodedRules):
1366         * contentextensions/ContentExtensionRule.cpp:
1367         (WebCore::ContentExtensions::Action::isolatedCopy const):
1368         * contentextensions/ContentExtensionRule.h:
1369         (WebCore::ContentExtensions::Action::operator== const):
1370         (WebCore::ContentExtensions::Action::setExtensionIdentifier): Deleted.
1371         (WebCore::ContentExtensions::Action::extensionIdentifier const): Deleted.
1372         * contentextensions/ContentExtensionsBackend.cpp:
1373         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
1374         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
1375         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForPingLoad):
1376         (WebCore::ContentExtensions::applyResultsToRequest):
1377         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
1378         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad): Deleted.
1379         (WebCore::ContentExtensions::applyBlockedStatusToRequest): Deleted.
1380         * contentextensions/ContentExtensionsBackend.h:
1381         * contentextensions/ContentRuleListResults.h: Added.
1382         (WebCore::ContentRuleListResults::Result::shouldNotifyApplication const):
1383         (WebCore::ContentRuleListResults::shouldNotifyApplication const):
1384         (WebCore::ContentRuleListResults::encode const):
1385         (WebCore::ContentRuleListResults::decode):
1386         (WebCore::ContentRuleListResults::Result::encode const):
1387         (WebCore::ContentRuleListResults::Result::decode):
1388         (WebCore::ContentRuleListResults::Summary::encode const):
1389         (WebCore::ContentRuleListResults::Summary::decode):
1390         * css/StyleSheetContents.cpp:
1391         (WebCore::StyleSheetContents::subresourcesAllowReuse const):
1392         * html/HTMLMediaElement.cpp:
1393         (WebCore::HTMLMediaElement::loadResource):
1394         * loader/FrameLoader.cpp:
1395         (WebCore::FrameLoader::loadResourceSynchronously):
1396         * loader/PingLoader.cpp:
1397         (WebCore::processContentRuleListsForLoad):
1398         (WebCore::PingLoader::loadImage):
1399         (WebCore::PingLoader::sendPing):
1400         (WebCore::PingLoader::sendViolationReport):
1401         (WebCore::processContentExtensionRulesForLoad): Deleted.
1402         * loader/ResourceLoader.cpp:
1403         (WebCore::ResourceLoader::willSendRequestInternal):
1404         * loader/cache/CachedResourceLoader.cpp:
1405         (WebCore::CachedResourceLoader::requestResource):
1406         * loader/cache/CachedResourceRequest.cpp:
1407         (WebCore::CachedResourceRequest::applyResults):
1408         (WebCore::CachedResourceRequest::applyBlockedStatus): Deleted.
1409         * loader/cache/CachedResourceRequest.h:
1410         * page/ChromeClient.h:
1411         (WebCore::ChromeClient::contentRuleListNotification):
1412         * page/DOMWindow.cpp:
1413         (WebCore::DOMWindow::open):
1414         * page/UserContentProvider.cpp:
1415         (WebCore::UserContentProvider::processContentRuleListsForLoad):
1416         (WebCore::UserContentProvider::actionsForResourceLoad):
1417         (WebCore::UserContentProvider::processContentExtensionRulesForLoad): Deleted.
1418         * page/UserContentProvider.h:
1419
1420 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
1421
1422         Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
1423         https://bugs.webkit.org/show_bug.cgi?id=196058
1424         rdar://problem/49078202
1425
1426         Reviewed by Antti Koivisto.
1427
1428         Add an internal setting called "legacyOverflowScrollingTouchEnabled", initially
1429         on by default.
1430
1431         When disabled, it makes the -webkit-overflow-scrolling property be unsupported.
1432
1433         Tests: fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html
1434                fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html
1435
1436         * css/parser/CSSParserContext.cpp:
1437         (WebCore::CSSParserContext::CSSParserContext):
1438         (WebCore::operator==):
1439         * css/parser/CSSParserContext.h:
1440         (WebCore::CSSParserContextHash::hash):
1441         * css/parser/CSSParserFastPaths.cpp:
1442         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1443         * css/parser/CSSParserFastPaths.h:
1444         * css/parser/CSSPropertyParser.cpp:
1445         (WebCore::CSSPropertyParser::parseSingleValue):
1446         * page/Settings.yaml:
1447
1448 2019-03-21  Antti Koivisto  <antti@apple.com>
1449
1450         UI-process hit-testing needs to know about containing block relationships
1451         https://bugs.webkit.org/show_bug.cgi?id=195845
1452         <rdar://problem/48949633>
1453
1454         Reviewed by Simon Fraser.
1455
1456         Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
1457
1458         * page/scrolling/ScrollingTree.h:
1459         * page/scrolling/ScrollingTreeScrollingNode.h:
1460         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
1461         (WebCore::ScrollingTreePositionedNode::layer const):
1462
1463 2019-03-21  Zalan Bujtas  <zalan@apple.com>
1464
1465         [ContentChangeObserver] Cleanup reset state.
1466         https://bugs.webkit.org/show_bug.cgi?id=196076
1467         <rdar://problem/49107931>
1468
1469         Reviewed by Simon Fraser.
1470
1471         stopObservingPendingActivities() is a subset of reset() and call it when we've observed a visible change.
1472
1473         * page/ios/ContentChangeObserver.cpp:
1474         (WebCore::ContentChangeObserver::willNotProceedWithClick):
1475         (WebCore::ContentChangeObserver::stopObservingPendingActivities):
1476         (WebCore::ContentChangeObserver::reset):
1477         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
1478         (WebCore::ContentChangeObserver::willDetachPage):
1479         (WebCore::ContentChangeObserver::adjustObservedState):
1480         (WebCore::ContentChangeObserver::cancelPendingActivities): Deleted.
1481         * page/ios/ContentChangeObserver.h:
1482
1483 2019-03-21  Zalan Bujtas  <zalan@apple.com>
1484
1485         Unreviewed build fix.
1486
1487         * page/ios/ContentChangeObserver.h:
1488
1489 2019-03-21  Zalan Bujtas  <zalan@apple.com>
1490
1491         [ContentChangeObserver] Start tracking implicit transitions at mousemove
1492         https://bugs.webkit.org/show_bug.cgi?id=196054
1493         <rdar://problem/49093840>
1494
1495         Reviewed by Simon Fraser.
1496
1497         This patch fixes the hover menu issue on seriouseats.com. After tapping on the menu items, the submenus show up now.
1498
1499         1. Start observing at mousemove
1500         2. Check if the style change is synchronous or not and start observing it accordingly.
1501
1502         Tests: fast/events/touch/ios/content-observation/0ms-delay-0ms-transition-on-mousemove.html
1503                fast/events/touch/ios/content-observation/100ms-delay-10ms-transition-on-mousemove.html
1504                fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-mousemove.html
1505                fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-touch-start.html
1506
1507         * page/ios/ContentChangeObserver.cpp:
1508         (WebCore::ContentChangeObserver::adjustObservedState):
1509
1510 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
1511
1512         Absolute in stacking-context scroller jiggles when scrolled
1513         https://bugs.webkit.org/show_bug.cgi?id=196010
1514
1515         Reviewed by Zalan Bujtas.
1516
1517         Updating compositing layers after a scroll (in a compositing update on the main thread)
1518         failed to traverse to an absolute layer inside a stacking-context overflow:scroll,
1519         because the overflow's layer didn't have the "hasCompositingAncestor" bit set on it.
1520
1521         This happened because childState.subtreeIsCompositing wasn't being set when indirect
1522         reasons trigger compositing. So clean up RenderLayerCompositor::computeCompositingRequirements()
1523         to set childState.subtreeIsCompositing for "late" compositing decisions, and move the
1524         "Subsequent layers in the parent stacking context also need to composite" chunk
1525         down to after the last compositing decision has been made.
1526
1527         Test: compositing/overflow/absolute-in-overflow.html
1528
1529         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1530         (WebCore::ScrollingTreeScrollingNode::scrollTo):
1531         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
1532         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1533         * rendering/RenderLayerCompositor.cpp:
1534         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1535
1536 2019-03-21  Zalan Bujtas  <zalan@apple.com>
1537
1538         [ContentChangeObserver] Start tracking implicit transitions at touchStart
1539         https://bugs.webkit.org/show_bug.cgi?id=196051
1540         <rdar://problem/49092952>
1541
1542         Reviewed by Simon Fraser.
1543
1544         This patch enables transition tracking on touchStart.
1545
1546         1. Start observing for new transitions at touchStart
1547         2. Stop observing at touchEnd
1548         3. Check the next style recalc when the transition is finished (at onAnimationEnd we don't yet have the final computed style).
1549         4. Remove the tracked transition when it is canceled.
1550
1551         Tests: fast/events/touch/ios/content-observation/0ms-transition-on-touch-start.html
1552                fast/events/touch/ios/content-observation/100ms-transition-on-touch-start.html
1553                fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start.html
1554                fast/events/touch/ios/content-observation/transition-on-touch-start-and-remove.html
1555
1556         * page/ios/ContentChangeObserver.cpp:
1557         (WebCore::ContentChangeObserver::didAddTransition):
1558         (WebCore::ContentChangeObserver::didFinishTransition):
1559         (WebCore::ContentChangeObserver::didRemoveTransition):
1560         (WebCore::ContentChangeObserver::adjustObservedState):
1561         * page/ios/ContentChangeObserver.h:
1562         (WebCore::ContentChangeObserver::setShouldObserveTransitions):
1563         (WebCore::ContentChangeObserver::clearObservedTransitions):
1564         (WebCore::ContentChangeObserver::hasObservedTransition const):
1565         (WebCore::ContentChangeObserver::hasPendingActivity const):
1566
1567 2019-03-21  Zalan Bujtas  <zalan@apple.com>
1568
1569         [ContentChangeObserver] Track hidden elements only while transitioning.
1570         https://bugs.webkit.org/show_bug.cgi?id=196050
1571         <rdar://problem/49092037>
1572
1573         Reviewed by Simon Fraser.
1574
1575         Use the existing isConsideredHidden() logic to decide whether the current transition should be tracked.
1576
1577         * page/ios/ContentChangeObserver.cpp:
1578         (WebCore::isConsideredHidden):
1579         (WebCore::ContentChangeObserver::didAddTransition):
1580         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
1581         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
1582         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Deleted.
1583         * page/ios/ContentChangeObserver.h:
1584
1585 2019-03-21  Zalan Bujtas  <zalan@apple.com>
1586
1587         [ContentChangeObserver] Add support for observing implicit transitions
1588         https://bugs.webkit.org/show_bug.cgi?id=195914
1589         <rdar://problem/49091959>
1590
1591         Reviewed by Simon Fraser.
1592
1593         This patch is in preparation for observing elements with property "left" implicit transitions.
1594
1595         This is not a continuous tracking, we are only interested in the start and the end state.
1596         The idea here is to register hidden elements only and check if they become visible by
1597         the end of the transition (and ignore if the transition gets "canceled").
1598
1599         * page/animation/AnimationBase.h:
1600         * page/animation/ImplicitAnimation.cpp:
1601         (WebCore::ImplicitAnimation::ImplicitAnimation):
1602         (WebCore::ImplicitAnimation::~ImplicitAnimation):
1603         (WebCore::ImplicitAnimation::clear):
1604         (WebCore::ImplicitAnimation::onAnimationEnd):
1605         * page/animation/ImplicitAnimation.h:
1606         * page/ios/ContentChangeObserver.cpp:
1607         (WebCore::ContentChangeObserver::didAddTransition):
1608         (WebCore::ContentChangeObserver::removeTransitionIfNeeded):
1609         (WebCore::ContentChangeObserver::didFinishTransition):
1610         (WebCore::ContentChangeObserver::didRemoveTransition):
1611         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1612         * page/ios/ContentChangeObserver.h:
1613         (WebCore::ContentChangeObserver::isObservingTransitions const):
1614         (WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
1615
1616 2019-03-21  Devin Rousso  <drousso@apple.com>
1617
1618         Web Inspector: Page: lazily create the agent
1619         https://bugs.webkit.org/show_bug.cgi?id=195592
1620         <rdar://problem/48791916>
1621
1622         Reviewed by Timothy Hatcher.
1623
1624         No change in functionality.
1625
1626         Have more agents save the inspected `Page` so they don't need to access it via the
1627         `InspectorPageAgent`. Make some of `InspectorPageAgent`'s functions `static` so other
1628         agents can use them without needing to have access to an enabled `InspectorPageAgent`.
1629
1630         * inspector/InspectorController.cpp:
1631         (WebCore::InspectorController::InspectorController):
1632         (WebCore::InspectorController::createLazyAgents):
1633
1634         * inspector/agents/InspectorPageAgent.h:
1635         (WebCore::InspectorPageAgent::page): Deleted.
1636         * inspector/agents/InspectorPageAgent.cpp:
1637         (WebCore::InspectorPageAgent::InspectorPageAgent):
1638         (WebCore::InspectorPageAgent::enable):
1639         (WebCore::InspectorPageAgent::disable):
1640         (WebCore::InspectorPageAgent::reload):
1641         (WebCore::InspectorPageAgent::navigate):
1642         (WebCore::InspectorPageAgent::overrideSetting):
1643         (WebCore::InspectorPageAgent::getCookies):
1644         (WebCore::InspectorPageAgent::deleteCookie):
1645         (WebCore::InspectorPageAgent::getResourceTree):
1646         (WebCore::InspectorPageAgent::searchInResources):
1647         (WebCore::InspectorPageAgent::didPaint):
1648         (WebCore::InspectorPageAgent::didLayout):
1649         (WebCore::InspectorPageAgent::didScroll):
1650         (WebCore::InspectorPageAgent::didRecalculateStyle):
1651         (WebCore::InspectorPageAgent::setEmulatedMedia):
1652         (WebCore::InspectorPageAgent::setForcedAppearance):
1653         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
1654         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
1655         (WebCore::InspectorPageAgent::snapshotNode):
1656         (WebCore::InspectorPageAgent::snapshotRect):
1657         (WebCore::InspectorPageAgent::archive):
1658         (WebCore::InspectorPageAgent::mainFrame): Deleted.
1659         (WebCore::InspectorPageAgent::hasIdForFrame const): Deleted.
1660
1661         * inspector/agents/InspectorApplicationCacheAgent.h:
1662         * inspector/agents/InspectorApplicationCacheAgent.cpp:
1663         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
1664         (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
1665         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
1666         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
1667
1668         * inspector/agents/InspectorCanvasAgent.h:
1669         * inspector/agents/InspectorCanvasAgent.cpp:
1670         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
1671         (WebCore::InspectorCanvasAgent::enable):
1672
1673         * inspector/agents/InspectorDOMStorageAgent.h:
1674         * inspector/agents/InspectorDOMStorageAgent.cpp:
1675         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
1676         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1677
1678         * inspector/agents/InspectorIndexedDBAgent.h:
1679         * inspector/agents/InspectorIndexedDBAgent.cpp:
1680         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
1681         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
1682         (WebCore::InspectorIndexedDBAgent::requestDatabase):
1683         (WebCore::InspectorIndexedDBAgent::requestData):
1684         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
1685
1686         * inspector/agents/page/PageDebuggerAgent.h:
1687         * inspector/agents/page/PageDebuggerAgent.cpp:
1688         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
1689         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
1690         (WebCore::PageDebuggerAgent::breakpointActionLog):
1691         (WebCore::PageDebuggerAgent::injectedScriptForEval):
1692
1693         * inspector/agents/page/PageNetworkAgent.h:
1694         * inspector/agents/page/PageNetworkAgent.cpp:
1695         (WebCore::PageNetworkAgent::PageNetworkAgent):
1696         (WebCore::PageNetworkAgent::loaderIdentifier):
1697         (WebCore::PageNetworkAgent::frameIdentifier):
1698         (WebCore::PageNetworkAgent::setResourceCachingDisabled):
1699         (WebCore::PageNetworkAgent::scriptExecutionContext):
1700
1701         * inspector/InspectorInstrumentation.cpp:
1702         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
1703
1704 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
1705
1706         Hardening: Use WeakPtrs in VideoFullscreenInterface{Mac,AVKit}
1707         https://bugs.webkit.org/show_bug.cgi?id=196052
1708         <rdar://problem/48778571>
1709
1710         Reviewed by Eric Carlson.
1711
1712         The VideoFullscreenInterface{Mac,AVKit} implementations store their fullscreen model
1713         and fullscreen change observer members as bare pointers, something we've been working
1714         to eliminate.
1715         
1716         This patch corrects this oversight.
1717
1718         No new tests since no changes in behavior.
1719
1720         * platform/cocoa/VideoFullscreenChangeObserver.h:
1721         * platform/cocoa/VideoFullscreenModel.h:
1722         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1723         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1724         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
1725         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
1726         (VideoFullscreenInterfaceAVKit::presentingViewController):
1727         (VideoFullscreenInterfaceAVKit::invalidate):
1728         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
1729         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1730         (VideoFullscreenInterfaceAVKit::doSetup):
1731         * platform/mac/VideoFullscreenInterfaceMac.h:
1732         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
1733         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
1734         * platform/mac/VideoFullscreenInterfaceMac.mm:
1735         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel):
1736         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
1737         (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
1738         (WebCore::VideoFullscreenInterfaceMac::invalidate):
1739
1740 2019-03-21  Megan Gardner  <megan_gardner@apple.com>
1741
1742         Smart delete for paragraphs.
1743         https://bugs.webkit.org/show_bug.cgi?id=195837
1744
1745         Reviewed by Ryosuke Niwa.
1746
1747         Remove additional newlines to maintain spacing around paragraphs.
1748
1749         Tests: editing/pasteboard/smart-delete-paragraph-001.html
1750                editing/pasteboard/smart-delete-paragraph-002.html
1751                editing/pasteboard/smart-delete-paragraph-003.html
1752                editing/pasteboard/smart-delete-paragraph-004.html
1753
1754         * editing/DeleteSelectionCommand.cpp:
1755         (WebCore::isBlankLine):
1756         (WebCore::DeleteSelectionCommand::initializePositionData):
1757
1758 2019-03-21  Cathie Chen  <cathiechen@igalia.com>
1759
1760         Fixed ContentChangeObserver build error.
1761         https://bugs.webkit.org/show_bug.cgi?id=195993
1762
1763         Reviewed by Rob Buis.
1764
1765         EWS IOS compiler complains after adding new files in Bug 157743.
1766         ContentChangeObserver.h should have forward declaration for Element.
1767
1768         * page/ios/ContentChangeObserver.cpp:
1769         * page/ios/ContentChangeObserver.h:
1770
1771 2019-03-21  Charlie Turner  <cturner@igalia.com>
1772
1773         [GStreamer][EME][Clearkey] Take a lock in keys() method
1774         https://bugs.webkit.org/show_bug.cgi?id=195900
1775
1776         Reviewed by Xabier Rodriguez-Calvar.
1777
1778         This isn't ideal, since we're taking a lock for every frame to
1779         decode. But there's no good way around it when keys can be
1780         made unavailable at any time via an update() call, so we can't
1781         cache key IDs in the decryptor.
1782
1783         Covered by test imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.https.html
1784
1785         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1786         (WebCore::CDMInstanceClearKey::keys const): This method is called
1787         from GStreamer's decode() method, which runs off the main thread,
1788         therefore we need to take a lock.
1789         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1790
1791 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1792
1793         [GTK][WPE] Add API to provide geolocation information
1794         https://bugs.webkit.org/show_bug.cgi?id=195940
1795
1796         Reviewed by Michael Catanzaro.
1797
1798         Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).
1799
1800         * PlatformGTK.cmake:
1801         * platform/geoclue/GeolocationProviderGeoclue.cpp:
1802         * platform/geoclue/GeolocationProviderGeoclue.h:
1803         * platform/geoclue/GeolocationProviderGeoclueClient.h:
1804
1805 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1806
1807         [WPE] Confusing messages in stderr when surfaceless context is not supported
1808         https://bugs.webkit.org/show_bug.cgi?id=195742
1809
1810         Reviewed by Žan Doberšek.
1811
1812         The messages shown are:
1813
1814         Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
1815         Cannot create EGL WPE context: EGL_SUCCESS
1816
1817         It seems like there's anything wrong, while there isn't. It's also confusing an error message where the error is
1818         EGL_SUCCESS. I think we should not show those messages at all, not suporting surfaceless contexts is not an
1819         error and it's correctly handled. Failing to get a native window handle from render backend offscreen egl target
1820         is not an error either, since most of the backends don't implement the interface (they actually have an empty
1821         implementation).
1822
1823         * platform/graphics/egl/GLContextEGL.cpp:
1824         (WebCore::GLContextEGL::createSurfacelessContext): Remove the message when extensions are not present
1825         * platform/graphics/egl/GLContextEGLLibWPE.cpp:
1826         (WebCore::GLContextEGL::createWPEContext): Handle the case of wpe_renderer_backend_egl_offscreen_target_create()
1827         returning nullptr, which can happen if the backend doesn't implement the interface. Move the context creation
1828         after the target initialization, to avoid leaking the context when the target doesn't have a native window.
1829
1830 2019-03-20  Yusuke Suzuki  <ysuzuki@apple.com>
1831
1832         [JSC] Use finalizer in JSGlobalLexicalEnvironment and JSGlobalObject
1833         https://bugs.webkit.org/show_bug.cgi?id=195992
1834
1835         Reviewed by Keith Miller and Mark Lam.
1836
1837         Use cellHeapCellType since JSSegmentedVariableObject already set finalizer.
1838
1839         * bindings/js/WebCoreJSClientData.cpp:
1840         (WebCore::JSVMClientData::JSVMClientData):
1841
1842 2019-03-20  Youenn Fablet  <youenn@apple.com>
1843
1844         Compute quota after network process restart based on default quota and space used
1845         https://bugs.webkit.org/show_bug.cgi?id=195804
1846
1847         Reviewed by Chris Dumez.
1848
1849         At creation of quota manager, a default quota will be assigned.
1850         This value is the same for all origins.
1851         Some origins may have been granted a bigger quota by the user.
1852         In that case, the space used might be greater for these origins.
1853         Update at initialization time the quota according the space used as follows:
1854         - If space used is below default quota, stick with default quota.
1855         - If space used is above, set quota to space used rounded by one tenth of the default quota.
1856         The rounding ensures that quota requests will not happen too quickly after a page is loaded.
1857
1858         Test: http/wpt/cache-storage/cache-quota-after-restart.any.html
1859
1860         * Modules/cache/CacheStorageConnection.h:
1861         (WebCore::CacheStorageConnection::setQuotaBasedOnSpaceUsage):
1862         * storage/StorageQuotaManager.cpp:
1863         (WebCore::StorageQuotaManager::setQuotaBasedOnSpaceUsage):
1864         (WebCore::StorageQuotaManager::addUser):
1865         * storage/StorageQuotaManager.h:
1866         * testing/Internals.cpp:
1867         (WebCore::Internals::updateQuotaBasedOnSpaceUsage):
1868         * testing/Internals.h:
1869         * testing/Internals.idl:
1870
1871 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1872
1873         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
1874         https://bugs.webkit.org/show_bug.cgi?id=196049
1875
1876         Reviewed by Tim Horton.
1877
1878         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
1879         overflow scrolling in general, so rename it.
1880
1881         * Configurations/FeatureDefines.xcconfig:
1882         * css/CSSComputedStyleDeclaration.cpp:
1883         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1884         * css/CSSProperties.json:
1885         * css/CSSValueKeywords.in:
1886         * css/StyleBuilderConverter.h:
1887         * css/StyleResolver.cpp:
1888         (WebCore::StyleResolver::adjustRenderStyle):
1889         * css/parser/CSSParserFastPaths.cpp:
1890         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1891         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1892         * dom/Element.cpp:
1893         * dom/Element.h:
1894         * rendering/RenderLayer.cpp:
1895         (WebCore::RenderLayer::canUseCompositedScrolling const):
1896         * rendering/style/RenderStyle.cpp:
1897         (WebCore::rareInheritedDataChangeRequiresLayout):
1898         * rendering/style/RenderStyle.h:
1899         * rendering/style/StyleRareInheritedData.cpp:
1900         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1901         (WebCore::StyleRareInheritedData::operator== const):
1902         * rendering/style/StyleRareInheritedData.h:
1903         * rendering/style/WillChangeData.cpp:
1904         (WebCore::WillChangeData::propertyCreatesStackingContext):
1905
1906 2019-03-20  Devin Rousso  <drousso@apple.com>
1907
1908         Web Inspector: DOM: lazily create the agent
1909         https://bugs.webkit.org/show_bug.cgi?id=195589
1910         <rdar://problem/48791742>
1911
1912         Reviewed by Timothy Hatcher.
1913
1914         No change in functionality.
1915
1916         * inspector/agents/InspectorDOMAgent.h:
1917         (WebCore::InspectorDOMAgent::DOMListener): Deleted.
1918         (WebCore::InspectorDOMAgent::pageAgent): Deleted.
1919         * inspector/agents/InspectorDOMAgent.cpp:
1920         (WebCore::InspectorDOMAgent):
1921         (WebCore::InspectorDOMAgent::unbind):
1922         (WebCore::InspectorDOMAgent::setSearchingForNode):
1923         (WebCore::InspectorDOMAgent::highlightSelector):
1924         (WebCore::InspectorDOMAgent::highlightFrame):
1925         (WebCore::InspectorDOMAgent::buildObjectForNode):
1926         (WebCore::InspectorDOMAgent::didModifyDOMAttr):
1927         (WebCore::InspectorDOMAgent::didRemoveDOMAttr):
1928         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
1929         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
1930         (WebCore::InspectorDOMAgent::setDOMListener): Deleted.
1931
1932         * inspector/agents/InspectorCSSAgent.h:
1933         * inspector/agents/InspectorCSSAgent.cpp:
1934         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
1935         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
1936         (WebCore::InspectorCSSAgent::reset):
1937         (WebCore::InspectorCSSAgent::enable):
1938         (WebCore::InspectorCSSAgent::disable):
1939         (WebCore::InspectorCSSAgent::forcePseudoState):
1940         (WebCore::InspectorCSSAgent::collectAllStyleSheets):
1941         (WebCore::InspectorCSSAgent::setStyleSheetText):
1942         (WebCore::InspectorCSSAgent::setStyleText):
1943         (WebCore::InspectorCSSAgent::setRuleSelector):
1944         (WebCore::InspectorCSSAgent::createStyleSheet):
1945         (WebCore::InspectorCSSAgent::addRule):
1946         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
1947         (WebCore::InspectorCSSAgent::elementForId):
1948         (WebCore::InspectorCSSAgent::bindStyleSheet):
1949         (WebCore::InspectorCSSAgent::~InspectorCSSAgent): Deleted.
1950         (WebCore::InspectorCSSAgent::discardAgent): Deleted.
1951         (WebCore::InspectorCSSAgent::resetNonPersistentData): Deleted.
1952         * inspector/InspectorStyleSheet.cpp:
1953
1954         * inspector/agents/InspectorDOMDebuggerAgent.h:
1955         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1956         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
1957         (WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint):
1958         (WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint):
1959         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
1960         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
1961
1962         * inspector/agents/page/PageConsoleAgent.h:
1963         * inspector/agents/page/PageConsoleAgent.cpp:
1964         (WebCore::PageConsoleAgent::PageConsoleAgent):
1965         (WebCore::PageConsoleAgent::clearMessages):
1966
1967         * inspector/InspectorController.h:
1968         * inspector/InspectorController.cpp:
1969         (WebCore::InspectorController::InspectorController):
1970         (WebCore::InspectorController::createLazyAgents):
1971         (WebCore::InspectorController::inspect):
1972         (WebCore::InspectorController::hideHighlight):
1973
1974 2019-03-20  Youenn Fablet  <youenn@apple.com>
1975
1976         Include WAL and SHM file size in IDB database size computation
1977         https://bugs.webkit.org/show_bug.cgi?id=195688
1978
1979         Reviewed by Brady Eidson.
1980
1981         Count WAL and SHM files as part of IDB quota checks.
1982         This makes some IDB tests go over the testing quota which then
1983         triggers some IDB tasks to happen sooner than other write IDB tasks.
1984         The IDB implementation requires these tasks to remain ordered.
1985         In case a write task is pending quota check, queue all tasks,
1986         write or read, to keep the order.
1987
1988         This patch specials case aborting a transaction.
1989         In case it is called as part of clearing a database,
1990         the task should not be queued and all pending tasks are errored.
1991         When transaction is aborted by the web page, queue the task.
1992
1993         When we can make a decision to run tasks with size 0,
1994         do not check quota. This ensures that read operations
1995         succeed even if we are above quota.
1996
1997         Covered by existing tests.
1998
1999         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2000         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
2001         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
2002         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
2003         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
2004         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
2005         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
2006         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
2007         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
2008         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
2009         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
2010         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
2011         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2012         * Modules/webdatabase/DatabaseTracker.cpp:
2013         (WebCore::DatabaseTracker::usage):
2014         * platform/sql/SQLiteFileSystem.cpp:
2015         (WebCore::SQLiteFileSystem::getDatabaseFileSize):
2016         * storage/StorageQuotaManager.h:
2017         * storage/StorageQuotaManager.cpp:
2018         (WebCore::StorageQuotaManager::requestSpace):
2019
2020 2019-03-20  Devin Rousso  <drousso@apple.com>
2021
2022         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
2023         https://bugs.webkit.org/show_bug.cgi?id=176824
2024         <rdar://problem/34290931>
2025
2026         Reviewed by Timothy Hatcher.
2027
2028         Original patch by Joseph Pecoraro <pecoraro@apple.com>.
2029
2030         Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
2031                inspector/timeline/timeline-event-EventDispatch.html
2032                inspector/timeline/timeline-event-FireAnimationFrame.html
2033                inspector/timeline/timeline-event-RequestAnimationFrame.html
2034                inspector/timeline/timeline-event-TimerFire.html
2035                inspector/timeline/timeline-event-TimerInstall.html
2036                inspector/timeline/timeline-event-TimerRemove.html
2037
2038         * dom/EventTarget.cpp:
2039         (WebCore::EventTarget::innerInvokeEventListeners):
2040         * page/DOMWindow.cpp:
2041         (WebCore::DOMWindow::dispatchEvent):
2042         Include `defaultPrevented` when notifying inspector.
2043
2044         * inspector/InspectorInstrumentation.h:
2045         (WebCore::InspectorInstrumentation::didDispatchEvent):
2046         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
2047         * inspector/InspectorInstrumentation.cpp:
2048         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
2049         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
2050         Pass `defaultPrevented` on to agent.
2051
2052         * inspector/agents/InspectorTimelineAgent.h:
2053         * inspector/agents/InspectorTimelineAgent.cpp:
2054         (WebCore::InspectorTimelineAgent::didDispatchEvent):
2055         Append a boolean `defaultPrevented` property on the `EventDispatch` timeline record's data.
2056
2057 2019-03-20  Antoine Quint  <graouts@apple.com>
2058
2059         DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
2060         https://bugs.webkit.org/show_bug.cgi?id=196028
2061         <rdar://problem/46842707>
2062
2063         Reviewed by Dean Jackson.
2064
2065         Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.
2066
2067         * animation/AnimationTimeline.cpp:
2068         (WebCore::AnimationTimeline::forgetAnimation):
2069         (WebCore::AnimationTimeline::animationTimingDidChange):
2070         (WebCore::AnimationTimeline::cancelDeclarativeAnimation):
2071         * animation/AnimationTimeline.h:
2072         * animation/DocumentTimeline.cpp:
2073         (WebCore::DocumentTimeline::getAnimations const):
2074
2075 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2076
2077         Remove the SVG property tear off objects for SVGAnimatedNumber
2078         https://bugs.webkit.org/show_bug.cgi?id=196037
2079
2080         Reviewed by Simon Fraser.
2081
2082         -- Define SVGAnimatedNumber to be SVGAnimatedPrimitiveProperty<float>.
2083
2084         -- Add SVGAnimatedNumberAccessor to associate an attribute name with a 
2085            pointer to an SVGAnimatedNumber. Given a pointer to an SVGElement,
2086            this accessor will and create an animator for the animated property.
2087
2088         -- Add SVGAnimatedNumberPairAccessor to associate an attribute name
2089            with a pair of pointers to SVGAnimatedNumbers. Given a pointer to an
2090            SVGElement, this accessor will and create an animator for these
2091            animated properties.
2092
2093         -- Add SVGAnimatedNumberAnimator to animated an SVGAnimatedNumber.
2094
2095         -- Add SVGAnimatedNumberPairAnimator to animated a pair of SVGAnimatedNumbers.
2096
2097         -- Add SVGAnimationNumberFunction which will be responsible for progressing
2098            a float over a period of time.
2099
2100         -- Define SVGNumberAnimator to be SVGPrimitivePropertyAnimator<float,
2101            SVGAnimationNumberFunction>. SVGNumberAnimator will be responsible 
2102            for animating attributes with no reflecting animated properties, e.g.
2103            "fill-opacity".
2104
2105         * Sources.txt:
2106         * WebCore.xcodeproj/project.pbxproj:
2107         * svg/SVGAnimatedLength.cpp:
2108         * svg/SVGAnimatedLengthList.cpp:
2109         * svg/SVGAnimatedNumber.cpp: Removed.
2110         * svg/SVGAnimatedNumber.h: Removed.
2111         * svg/SVGAnimatedNumberList.cpp:
2112         * svg/SVGAnimatedNumberOptionalNumber.cpp: Removed.
2113         * svg/SVGAnimatedNumberOptionalNumber.h: Removed.
2114         * svg/SVGAnimatedTransformList.cpp:
2115         * svg/SVGAnimatorFactory.h:
2116         (WebCore::SVGAnimatorFactory::create):
2117         * svg/SVGComponentTransferFunctionElement.cpp:
2118         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
2119         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
2120         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
2121         * svg/SVGComponentTransferFunctionElement.h:
2122         (WebCore::SVGComponentTransferFunctionElement::slope const):
2123         (WebCore::SVGComponentTransferFunctionElement::intercept const):
2124         (WebCore::SVGComponentTransferFunctionElement::amplitude const):
2125         (WebCore::SVGComponentTransferFunctionElement::exponent const):
2126         (WebCore::SVGComponentTransferFunctionElement::offset const):
2127         (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
2128         (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
2129         (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
2130         (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
2131         (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
2132         * svg/SVGFECompositeElement.cpp:
2133         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
2134         (WebCore::SVGFECompositeElement::registerAttributes):
2135         (WebCore::SVGFECompositeElement::parseAttribute):
2136         * svg/SVGFECompositeElement.h:
2137         * svg/SVGFEConvolveMatrixElement.cpp:
2138         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
2139         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
2140         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
2141         (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
2142         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted.
2143         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted.
2144         * svg/SVGFEConvolveMatrixElement.h:
2145         * svg/SVGFEDiffuseLightingElement.cpp:
2146         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
2147         (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
2148         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
2149         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted.
2150         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted.
2151         * svg/SVGFEDiffuseLightingElement.h:
2152         * svg/SVGFEDisplacementMapElement.cpp:
2153         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
2154         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
2155         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
2156         * svg/SVGFEDisplacementMapElement.h:
2157         * svg/SVGFEDropShadowElement.cpp:
2158         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
2159         (WebCore::SVGFEDropShadowElement::setStdDeviation):
2160         (WebCore::SVGFEDropShadowElement::registerAttributes):
2161         (WebCore::SVGFEDropShadowElement::parseAttribute):
2162         (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted.
2163         (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted.
2164         * svg/SVGFEDropShadowElement.h:
2165         * svg/SVGFEGaussianBlurElement.cpp:
2166         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
2167         (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
2168         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
2169         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
2170         (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted.
2171         (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted.
2172         * svg/SVGFEGaussianBlurElement.h:
2173         * svg/SVGFELightElement.cpp:
2174         (WebCore::SVGFELightElement::SVGFELightElement):
2175         (WebCore::SVGFELightElement::parseAttribute):
2176         (WebCore::SVGFELightElement::svgAttributeChanged):
2177         (WebCore::SVGFELightElement::registerAttributes): Deleted.
2178         * svg/SVGFELightElement.h:
2179         (WebCore::SVGFELightElement::azimuth const):
2180         (WebCore::SVGFELightElement::elevation const):
2181         (WebCore::SVGFELightElement::x const):
2182         (WebCore::SVGFELightElement::y const):
2183         (WebCore::SVGFELightElement::z const):
2184         (WebCore::SVGFELightElement::pointsAtX const):
2185         (WebCore::SVGFELightElement::pointsAtY const):
2186         (WebCore::SVGFELightElement::pointsAtZ const):
2187         (WebCore::SVGFELightElement::specularExponent const):
2188         (WebCore::SVGFELightElement::limitingConeAngle const):
2189         (WebCore::SVGFELightElement::azimuthAnimated):
2190         (WebCore::SVGFELightElement::elevationAnimated):
2191         (WebCore::SVGFELightElement::xAnimated):
2192         (WebCore::SVGFELightElement::yAnimated):
2193         (WebCore::SVGFELightElement::zAnimated):
2194         (WebCore::SVGFELightElement::pointsAtXAnimated):
2195         (WebCore::SVGFELightElement::pointsAtYAnimated):
2196         (WebCore::SVGFELightElement::pointsAtZAnimated):
2197         (WebCore::SVGFELightElement::specularExponentAnimated):
2198         (WebCore::SVGFELightElement::limitingConeAngleAnimated):
2199         (WebCore::SVGFELightElement::attributeRegistry): Deleted.
2200         (WebCore::SVGFELightElement::isKnownAttribute): Deleted.
2201         * svg/SVGFEMorphologyElement.cpp:
2202         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
2203         (WebCore::SVGFEMorphologyElement::setRadius):
2204         (WebCore::SVGFEMorphologyElement::registerAttributes):
2205         (WebCore::SVGFEMorphologyElement::parseAttribute):
2206         (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted.
2207         (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted.
2208         * svg/SVGFEMorphologyElement.h:
2209         * svg/SVGFEOffsetElement.cpp:
2210         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
2211         (WebCore::SVGFEOffsetElement::registerAttributes):
2212         (WebCore::SVGFEOffsetElement::parseAttribute):
2213         * svg/SVGFEOffsetElement.h:
2214         * svg/SVGFESpecularLightingElement.cpp:
2215         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
2216         (WebCore::SVGFESpecularLightingElement::registerAttributes):
2217         (WebCore::SVGFESpecularLightingElement::parseAttribute):
2218         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted.
2219         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted.
2220         * svg/SVGFESpecularLightingElement.h:
2221         * svg/SVGFETurbulenceElement.cpp:
2222         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
2223         (WebCore::SVGFETurbulenceElement::registerAttributes):
2224         (WebCore::SVGFETurbulenceElement::parseAttribute):
2225         (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted.
2226         (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted.
2227         * svg/SVGFETurbulenceElement.h:
2228         * svg/SVGGeometryElement.cpp:
2229         (WebCore::SVGGeometryElement::SVGGeometryElement):
2230         (WebCore::SVGGeometryElement::parseAttribute):
2231         (WebCore::SVGGeometryElement::registerAttributes): Deleted.
2232         * svg/SVGGeometryElement.h:
2233         (WebCore::SVGGeometryElement::pathLength const):
2234         (WebCore::SVGGeometryElement::pathLengthAnimated):
2235         (WebCore::SVGGeometryElement::attributeRegistry): Deleted.
2236         (WebCore::SVGGeometryElement::isKnownAttribute): Deleted.
2237         * svg/SVGPathElement.h:
2238         * svg/SVGStopElement.cpp:
2239         (WebCore::SVGStopElement::SVGStopElement):
2240         (WebCore::SVGStopElement::parseAttribute):
2241         (WebCore::SVGStopElement::registerAttributes): Deleted.
2242         * svg/SVGStopElement.h:
2243         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2244         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2245         * svg/properties/SVGAnimatedPropertyImpl.h:
2246         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
2247         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
2248         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2249         (WebCore::SVGAnimationNumberFunction::progress):
2250         * svg/properties/SVGAttributeRegistry.h:
2251         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
2252         * svg/properties/SVGPropertyAnimatorCreator.h:
2253         (WebCore::SVGPropertyAnimatorCreator::createNumberAnimator):
2254         (WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator):
2255         * svg/properties/SVGPropertyOwnerRegistry.h:
2256         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2257
2258 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2259
2260         Remove the SVG tear off objects for SVGColorAnimator
2261         https://bugs.webkit.org/show_bug.cgi?id=196025
2262
2263         Reviewed by Simon Fraser.
2264
2265         SVG attributes like "fill" and "stroke" do not have reflecting properties
2266         in SVGElement but they are animatable by SMIL. Animating such attributes
2267         is different from animating the SVG animated properties. These new classes
2268         will be added to handle the first type of this kind of attribute: the Color:
2269
2270         -- SVGPropertyAnimatorCreator is added to SVGElement. It is responsible 
2271            for creating SVGPropertyAnimators for the attribute which do not have
2272            reflecting animated properties stored by SVGElement. It will maintain
2273            a HashMap for the animated values for these attributes which is indexed
2274            by the attribute name. The animated values has to be RefCounted because
2275            the same attribute can be animated by multiple animators. So the values
2276            of this HashMap will be of type Ref<SVGProperty>, e.g.
2277             <circle cx="80" cy="120" r="35">
2278                 <animate attributeName="fill" values="#080" begin="2s" />
2279                 <animate attributeName="fill" values="#602;#004" begin="4s" dur="5s"/>
2280             </circle>
2281
2282         -- SVGPropertyAnimator is the a new type which animates an attribute with
2283            no reflecting animated property.
2284
2285         -- SVGPrimitivePropertyAnimator is a template class which is responsible
2286            for animating attributes with primitive types, e.g. Color, string and 
2287            float. It is derived form SVGPropertyAnimator and it is initialized 
2288            with a Ref<SVGValueProperty<PropertyType>> which is created and maintained
2289            by SVGPropertyAnimatorFactory.
2290
2291         -- SVGAnimationColorFunction is the animation function that animates the
2292            attributes whose type are Color. Note the conversion form String to 
2293            Color in this class has to handle the case when its value is "attributeName="
2294            e.g. <animate attributeName="fill" from="attributeName="r"/>
2295
2296         -- SVGColorAnimator will be defined to be
2297            SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>.
2298
2299         The life cycle of the RefCounted properties can be explained as follows:
2300
2301         -- SVGPropertyAnimatorFactory checks whether its HashMap has an entry
2302            for the given attribute name. If it does not have, it will create a
2303            new value through the value creation method for this attribute.
2304
2305         -- SVGPropertyAnimatorFactory passes the shared animated value to the
2306            animator creation method. So multiple animators will be accessing the
2307            same value through their RefCounted pointers.
2308
2309         -- When the animator is about to be deleted, it will notify the target
2310            SVGElement which will notify its SVGPropertyAnimatorFactory.
2311            SVGPropertyAnimatorFactory will check its HashMap and retrieves the
2312            entry for the given attribute name. If the refCount is 2, it is going
2313            to remove the entry form the HashMap.
2314
2315         * Sources.txt:
2316         * WebCore.xcodeproj/project.pbxproj:
2317         * svg/SVGAnimateColorElement.cpp:
2318         (WebCore::attributeValueIsCurrentColor): Deleted.
2319         (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): Deleted.
2320         * svg/SVGAnimateColorElement.h:
2321         * svg/SVGAnimateElementBase.cpp:
2322         (WebCore::SVGAnimateElementBase::attributeAnimationController):
2323         * svg/SVGAnimatedColor.cpp: Removed.
2324         * svg/SVGAnimatedColor.h: Removed.
2325         * svg/SVGAnimatorFactory.h:
2326         (WebCore::SVGAnimatorFactory::create):
2327         * svg/SVGAttributeAnimationController.cpp:
2328         (WebCore::SVGAttributeAnimationController::~SVGAttributeAnimationController):
2329         * svg/SVGAttributeAnimationController.h:
2330         * svg/SVGElement.cpp:
2331         (WebCore::SVGElement::SVGElement):
2332         (WebCore::SVGElement::isAnimatedAttribute const):
2333         (WebCore::SVGElement::createAnimator):
2334         (WebCore::SVGElement::animatorWillBeDeleted):
2335         * svg/SVGElement.h:
2336         (WebCore::SVGElement::propertyAnimatorFactory):
2337         * svg/SVGFitToViewBox.h:
2338         * svg/SVGMPathElement.cpp:
2339         * svg/graphics/filters/SVGFEImage.h:
2340         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp: Added.
2341         (WebCore::SVGAnimationColorFunction::colorFromString):
2342         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2343         (WebCore::SVGAnimationColorFunction::progress):
2344         * svg/properties/SVGAnimationFunction.h:
2345         * svg/properties/SVGAttributeAnimator.cpp:
2346         (WebCore::SVGAttributeAnimator::applyAnimatedStylePropertyChange):
2347         (WebCore::SVGAttributeAnimator::removeAnimatedStyleProperty):
2348         * svg/properties/SVGAttributeAnimator.h:
2349         * svg/properties/SVGPrimitivePropertyAnimator.h: Added.
2350         (WebCore::SVGPrimitivePropertyAnimator::create):
2351         (WebCore::SVGPrimitivePropertyAnimator::SVGPrimitivePropertyAnimator):
2352         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h: Added.
2353         * svg/properties/SVGPropertyAnimator.h: Added.
2354         (WebCore::SVGPropertyAnimator::SVGPropertyAnimator):
2355         (WebCore::SVGPropertyAnimator::adjustForInheritance const):
2356         (WebCore::SVGPropertyAnimator::computeCSSPropertyValue const):
2357         (WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):
2358         * svg/properties/SVGPropertyAnimatorFactory.h: Added.
2359         (WebCore::SVGPropertyAnimatorFactory::isKnownAttribute):
2360         (WebCore::SVGPropertyAnimatorFactory::createAnimator):
2361         (WebCore::SVGPropertyAnimatorFactory::animatorWillBeDeleted):
2362         (WebCore::SVGPropertyAnimatorFactory::createColorAnimator):
2363         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
2364
2365 2019-03-20  Alex Christensen  <achristensen@webkit.org>
2366
2367         Use WeakPtr instead of storing raw pointers in WebSocket code
2368         https://bugs.webkit.org/show_bug.cgi?id=196034
2369
2370         Reviewed by Geoff Garen.
2371
2372         This could prevent using freed memory if we forget to reset a pointer somewhere.
2373
2374         * Modules/websockets/WebSocketChannel.cpp:
2375         (WebCore::WebSocketChannel::WebSocketChannel):
2376         (WebCore::WebSocketChannel::connect):
2377         (WebCore::WebSocketChannel::fail):
2378         (WebCore::WebSocketChannel::disconnect):
2379         (WebCore::WebSocketChannel::didOpenSocketStream):
2380         (WebCore::WebSocketChannel::didCloseSocketStream):
2381         (WebCore::WebSocketChannel::didFailSocketStream):
2382         (WebCore::WebSocketChannel::processBuffer):
2383         (WebCore::WebSocketChannel::processFrame):
2384         (WebCore::WebSocketChannel::processOutgoingFrameQueue):
2385         (WebCore::WebSocketChannel::sendFrame):
2386         * Modules/websockets/WebSocketChannel.h:
2387         * Modules/websockets/WebSocketChannelClient.h:
2388         * Modules/websockets/WebSocketHandshake.cpp:
2389         (WebCore::WebSocketHandshake::WebSocketHandshake):
2390         * Modules/websockets/WebSocketHandshake.h:
2391
2392 2019-03-20  Dean Jackson  <dino@apple.com>
2393
2394         [iOS] Crash in WebCore::Node::renderRect
2395         https://bugs.webkit.org/show_bug.cgi?id=196035
2396         <rdar://problem/49076783>
2397
2398         Reviewed by Antoine Quint.
2399
2400         When renderRect was called on an HTMLAreaElement, it would
2401         ASSERT because it doesn't have a renderer. We hadn't noticed
2402         this before because none of our tests were hitting this in
2403         debug mode.
2404
2405         The fix is to ask the corresponding HTMLImageElement for
2406         its renderer, and use that for the returned rectangle.
2407
2408         Covered by these tests that had become flakey:
2409             fast/images/imagemap-in-shadow-tree.html
2410             http/tests/download/area-download.html
2411
2412         * dom/Node.cpp:
2413         (WebCore::Node::renderRect):
2414
2415 2019-03-20  Youenn Fablet  <youenn@apple.com>
2416
2417         Have smaller default quotas for third party frames
2418         https://bugs.webkit.org/show_bug.cgi?id=195841
2419
2420         Reviewed by Geoffrey Garen.
2421
2422         Test: http/wpt/cache-storage/quota-third-party.https.html
2423
2424         * storage/StorageQuotaManager.h:
2425         (WebCore::StorageQuotaManager::defaultQuota):
2426         Change default quota to 1GB.
2427
2428 2019-03-20  Devin Rousso  <drousso@apple.com>
2429
2430         Web Inspector: DOM: include window as part of any event listener chain
2431         https://bugs.webkit.org/show_bug.cgi?id=195730
2432         <rdar://problem/48916872>
2433
2434         Reviewed by Timothy Hatcher.
2435
2436         Test: inspector/dom/getEventListenersForNode.html
2437
2438         * inspector/agents/InspectorDOMAgent.h:
2439         (WebCore::EventListenerInfo::EventListenerInfo): Deleted.
2440         * inspector/agents/InspectorDOMAgent.cpp:
2441         (WebCore::InspectorDOMAgent::getEventListenersForNode):
2442         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2443         (WebCore::InspectorDOMAgent::getEventListeners): Deleted.
2444
2445 2019-03-20  Devin Rousso  <drousso@apple.com>
2446
2447         Web Inspector: Runtime: lazily create the agent
2448         https://bugs.webkit.org/show_bug.cgi?id=195972
2449         <rdar://problem/49039655>
2450
2451         Reviewed by Timothy Hatcher.
2452
2453         No change in functionality.
2454
2455         * inspector/InspectorController.cpp:
2456         (WebCore::InspectorController::InspectorController):
2457         (WebCore::InspectorController::createLazyAgents):
2458
2459         * inspector/WorkerInspectorController.cpp:
2460         (WebCore::WorkerInspectorController::WorkerInspectorController):
2461         (WebCore::WorkerInspectorController::createLazyAgents):
2462
2463         * inspector/agents/page/PageRuntimeAgent.h:
2464         * inspector/agents/page/PageRuntimeAgent.cpp:
2465         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
2466         (WebCore::PageRuntimeAgent::enable):
2467         (WebCore::PageRuntimeAgent::disable):
2468         (WebCore::PageRuntimeAgent::didCreateMainWorldContext):
2469         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
2470         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend): Deleted.
2471         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
2472
2473         * inspector/agents/worker/WorkerRuntimeAgent.h:
2474         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
2475         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend): Deleted.
2476         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
2477
2478 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
2479
2480         [CSS OM] StyledElementInlineStylePropertyMap creates a Ref cycle with its owner element
2481         https://bugs.webkit.org/show_bug.cgi?id=195987
2482
2483         Reviewed by Simon Fraser.
2484
2485         StyledElementInlineStylePropertyMap was leaking every element for which it was created because due to
2486         a reference cycle. The StyledElementInlineStylePropertyMap holds onto its element using Ref and
2487         the element also stores StyledElementInlineStylePropertyMap in ElementRareData using RefPtr.
2488
2489         Fixed the cycle by making the reference from StyledElementInlineStylePropertyMap weak. For now we use
2490         a raw pointer because we can't create a WeakPtr of an element yet.
2491
2492         Test: css-typedom/attribute-style-map-should-not-leak-every-element.html
2493
2494         * css/typedom/StylePropertyMap.h:
2495         (WebCore::StylePropertyMap): Added clearElement as a virtual function.
2496         * dom/Element.cpp:
2497         (WebCore::Element::~Element): Clear the element pointer in StyledElementInlineStylePropertyMap.
2498         * dom/StyledElement.cpp:
2499         (WebCore::StyledElementInlineStylePropertyMap::get): Added a null check for m_element.
2500         (WebCore::StyledElementInlineStylePropertyMap::StyledElementInlineStylePropertyMap):
2501         (WebCore::StyledElementInlineStylePropertyMap::clearElement): Added.
2502         (WebCore::StyledElementInlineStylePropertyMap): Use a raw pointer instead of Ref to StyledElement
2503         to avoid the leak.
2504         * platform/graphics/CustomPaintImage.cpp:
2505         (WebCore::HashMapStylePropertyMap::clearElement): Added.
2506
2507 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
2508
2509         appendChild should throw when inserting an ancestor of a template into its content adopted to another document
2510         https://bugs.webkit.org/show_bug.cgi?id=195984
2511
2512         Reviewed by Darin Adler.
2513
2514         The WPT test caught a bug that appendChild and other DOM insertion functions were incorrectly assuming that
2515         any node that's in a HTML template element has the current document's template document as its owner.
2516         The assumption is wrong when the template element's content DocumentFragment is adopted to another document.
2517
2518         Fixed the bug by always checking the ancestor host elements in checkAcceptChild. Also
2519
2520         Test: fast/dom/insert-template-parent-into-adopted-content.html
2521
2522         * dom/ContainerNode.cpp:
2523         (WebCore::isInTemplateContent): Deleted. This code is simply wrong.
2524         (WebCore::containsConsideringHostElements): Deleted. Call sites are updated to use containsIncludingHostElements.
2525         (WebCore::containsIncludingHostElements): Moved from Node.cpp and optimized this code a bit. It's more efficient
2526         to get the parent node and check for ShadowRoot and DocumentFragment only when the parent is null than to check
2527         for those two node types before getting the parent node.
2528         (WebCore::checkAcceptChild): Merged two code paths to call containsIncludingHostElements. The early return for
2529         a pseudo element is there only to prevent tree corruption in release build even in the presence of a major bug
2530         so it shouldn't be an spec compliance issue.
2531         * dom/Node.cpp:
2532         (WebCore::Node::containsIncludingHostElements const): Deleted.
2533         * dom/Node.h:
2534
2535 2019-03-20  Timothy Hatcher  <timothy@apple.com>
2536
2537         Unreviewed followup to r243169 to fix test failures.
2538
2539         * DerivedSources.make: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_AND_PLATFORM_DEFINES.
2540
2541 2019-03-20  Keith Rollin  <krollin@apple.com>
2542
2543         Update the location for XProtect.meta.plist file
2544         https://bugs.webkit.org/show_bug.cgi?id=195764
2545
2546         Reviewed by Alexey Proskuryakov.
2547
2548         The location of this file is changing in the future, so adjust for
2549         that.
2550
2551         No new tests since there should be no observable behavior difference.
2552
2553         * platform/mac/BlacklistUpdater.mm:
2554
2555 2019-03-20  Devin Rousso  <drousso@apple.com>
2556
2557         Web Inspector: Database: lazily create the agent
2558         https://bugs.webkit.org/show_bug.cgi?id=195587
2559         <rdar://problem/48791735>
2560
2561         Reviewed by Timothy Hatcher.
2562
2563         No change in functionality.
2564
2565         * inspector/agents/InspectorDatabaseAgent.h:
2566         * inspector/agents/InspectorDatabaseAgent.cpp:
2567         (WebCore::InspectorDatabaseAgent::didCommitLoad): Added.
2568         (WebCore::InspectorDatabaseAgent::didOpenDatabase):
2569         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
2570         (WebCore::InspectorDatabaseAgent::enable):
2571         (WebCore::InspectorDatabaseAgent::disable):
2572         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
2573         (WebCore::InspectorDatabaseAgent::executeSQL):
2574         (WebCore::InspectorDatabaseAgent::databaseId):
2575         (WebCore::InspectorDatabaseAgent::findByFileName):
2576         (WebCore::InspectorDatabaseAgent::databaseForId):
2577         (WebCore::InspectorDatabaseAgent::clearResources): Deleted.
2578         (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent): Deleted.
2579         * inspector/InspectorDatabaseResource.h:
2580         (WebCore::InspectorDatabaseResource::database const):
2581         (WebCore::InspectorDatabaseResource::setDatabase):
2582         (WebCore::InspectorDatabaseResource::database): Deleted.
2583         * inspector/InspectorDatabaseResource.cpp:
2584         (WebCore::InspectorDatabaseResource::create):
2585         (WebCore::InspectorDatabaseResource::InspectorDatabaseResource):
2586         (WebCore::InspectorDatabaseResource::bind):
2587         * inspector/InspectorInstrumentation.h:
2588         (WebCore::InspectorInstrumentation::didOpenDatabase):
2589         * inspector/InspectorInstrumentation.cpp:
2590         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2591         (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
2592         Pass the `Database` as a reference instead of a pointer. Retrieve any information directly
2593         from the `Database`, rather than using the arguments that were used to create it.
2594
2595         * Modules/webdatabase/Database.h:
2596         (WebCore::Database::expectedVersion const): Deleted.
2597         * Modules/webdatabase/Database.cpp:
2598         (WebCore::Database::expectedVersion const): Added.
2599         * Modules/webdatabase/DatabaseManager.cpp:
2600         (WebCore::DatabaseManager::openDatabase):
2601         * Modules/webdatabase/DatabaseTracker.h:
2602         * Modules/webdatabase/DatabaseTracker.cpp:
2603         (WebCore::DatabaseTracker::closeAllDatabases):
2604         (WebCore::DatabaseTracker::openDatabases): Added.
2605         Expose various values used by `InspectorDatabaseAgent` and `InspectorDatabaseResource`.
2606
2607         * inspector/InspectorController.cpp:
2608         (WebCore::InspectorController::InspectorController):
2609         (WebCore::InspectorController::createLazyAgents):
2610         * inspector/WorkerInspectorController.cpp:
2611         (WebCore::WorkerInspectorController::WorkerInspectorController):
2612
2613         * inspector/CommandLineAPIHost.h:
2614         (WebCore::CommandLineAPIHost::init):
2615         * inspector/CommandLineAPIHost.cpp:
2616         (WebCore::CommandLineAPIHost::disconnect):
2617         (WebCore::CommandLineAPIHost::inspect):
2618         (WebCore::CommandLineAPIHost::clearConsoleMessages):
2619         (WebCore::CommandLineAPIHost::databaseId):
2620         (WebCore::CommandLineAPIHost::storageId):
2621         Rather than pass each agent individually, pass the entire `InstrumentingAgents` so that the
2622         current agent can be used instead of whatever was initially created.
2623
2624 2019-03-20  Oriol Brufau  <obrufau@igalia.com>
2625
2626         [css-grid] Always consider baseline shim for the minimum contribution
2627         https://bugs.webkit.org/show_bug.cgi?id=195964
2628
2629         Reviewed by Javier Fernandez.
2630
2631         Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-lr.html
2632                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-rl.html
2633                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim.html
2634
2635         Before this patch, the shim used for baseline alignment is not taken
2636         into consideration when calculating the minimum contribution of a grid
2637         item if its preferred size is auto, its minimum size is auto, and the
2638         max track sizing function is a fixed small value. In this case, the
2639         auto minimum size can produce a smaller track than if it was 0.
2640
2641         The specification needs to clarify how baseline shims interact with
2642         minimum contributions (https://github.com/w3c/csswg-drafts/issues/3660),
2643         but the above doesn't make sense.
2644
2645         * rendering/GridTrackSizingAlgorithm.cpp:
2646         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2647
2648 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
2649
2650         Some elements lag behind async overflow scrolling on palace-games.com
2651         https://bugs.webkit.org/show_bug.cgi?id=195934
2652
2653         Reviewed by Zalan Bujtas.
2654
2655         The logic added in r242997 was wrong for an absolutely-positioned layer whose containig block was
2656         inside an overflow:scroll, but whose compositing ancestor was outside. This is a case where
2657         we need to make a Positioning node for the absolute layer, because it needs to move along
2658         with the scrolled content.
2659         
2660         There are six permutations of overflow, containing block and compositing ancestor that we care about.
2661         Showing renderer (aka DOM) order, they are (where <- indicates child <- parent):
2662         
2663         layer <- cb <- ca <- os -- no positioned node required
2664         layer <- cb <- os <- ca -- compositing parent skips overflow, need a "Moved" Positioned node.
2665         layer <- ov <- cb <- ca -- no positioned node required
2666         layer <- ov <- ca <- cb -- no positioned node required
2667         layer <- ca <- cb <- ov -- no positioned node required
2668         layer <- ca <- ov <- cb -- containing block skips overflow, need a "Stationary" Positioned node.
2669         
2670         [cb = containing block, ca = compositing ancestor, ov = overflow scroll]
2671
2672         Test: scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html
2673
2674         * rendering/RenderLayer.cpp:
2675         (WebCore::outputPaintOrderTreeRecursive):
2676         * rendering/RenderLayerCompositor.cpp:
2677         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
2678         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2679
2680 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
2681
2682         Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes
2683         https://bugs.webkit.org/show_bug.cgi?id=195710
2684         <rdar://problem/48867502>
2685
2686         Reviewed by Zalan Bujtas.
2687
2688         A position:absolute layer whose containing block is outside an enclosing overflow:scroll, but
2689         whose compositing ancestor is the overflow or is inside it, needs to be composited so that
2690         we can make a Positioning scrolling tree node for it.
2691
2692         Handle this case as a "OverflowScrollPositioning" indirect compositing reason.
2693
2694         Test: compositing/layer-creation/absolute-in-async-overflow-scroll.html
2695
2696         * inspector/agents/InspectorLayerTreeAgent.cpp:
2697         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
2698         * rendering/RenderLayer.h:
2699         * rendering/RenderLayerCompositor.cpp:
2700         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2701         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2702         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2703         (WebCore::RenderLayerCompositor::logReasonsForCompositing):
2704         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
2705         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
2706         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
2707         * rendering/RenderLayerCompositor.h: Generalize OverflowScrollingTouch to OverflowScrolling.
2708
2709 2019-03-20  Devin Rousso  <drousso@apple.com>
2710
2711         Web Inspector: Search: allow DOM searches to be case sensitive
2712         https://bugs.webkit.org/show_bug.cgi?id=194673
2713         <rdar://problem/48087577>
2714
2715         Reviewed by Timothy Hatcher.
2716
2717         Tests: inspector/dom/dom-search.html
2718                inspector/dom/dom-search-caseSensitive.html
2719
2720         Since `DOM.performSearch` also searches by selector and XPath, some results may appear
2721         as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
2722         as although the literal node name ("BODY") didn't match, it did match via selector/XPath.
2723
2724         * inspector/agents/InspectorDOMAgent.h:
2725         * inspector/agents/InspectorDOMAgent.cpp:
2726         (WebCore::InspectorDOMAgent::performSearch):
2727
2728         * inspector/InspectorNodeFinder.h:
2729         * inspector/InspectorNodeFinder.cpp:
2730         (WebCore::InspectorNodeFinder::InspectorNodeFinder):
2731         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
2732         (WebCore::InspectorNodeFinder::checkEquals): Added.
2733         (WebCore::InspectorNodeFinder::checkContains): Added.
2734         (WebCore::InspectorNodeFinder::checkStartsWith): Added.
2735         (WebCore::InspectorNodeFinder::checkEndsWith): Added.
2736         (WebCore::InspectorNodeFinder::matchesAttribute):
2737         (WebCore::InspectorNodeFinder::matchesElement):
2738         (WebCore::InspectorNodeFinder::searchUsingXPath):
2739         (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
2740
2741 2019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2742
2743         Remove copyRef() calls added in r243163
2744         https://bugs.webkit.org/show_bug.cgi?id=195962
2745
2746         Reviewed by Chris Dumez.
2747
2748         The first two cases here can just directly return the RefPtr.
2749
2750         In the third case, we have to work around a GCC 6 bug because GCC 6 is unable to pick the
2751         right constructor to use, unlike modern compilers.
2752
2753         * Modules/fetch/FetchBody.cpp:
2754         (WebCore::FetchBody::bodyAsFormData const):
2755         (WebCore::FetchBody::take):
2756
2757 2019-03-20  Alicia Boya García  <aboya@igalia.com>
2758
2759         [MSE][GStreamer] Fix handling of resolution changes in AppendPipeline
2760         https://bugs.webkit.org/show_bug.cgi?id=195855
2761
2762         Reviewed by Xabier Rodriguez-Calvar.
2763
2764         MediaSample instances produced by the AppendPipeline were not
2765         accounting for resolution changes. The causes of this are twofold:
2766
2767         1) m_presentationSize is set by connectDemuxerSrcPadToAppsink() (by
2768         calling parseDemuxerSrcPadCaps()), but not by appsinkCapsChanged().
2769
2770         2) appsinkCapsChanged() was being called in the main thread as an
2771         asynchronous task. In consequence, even if m_presentationSize is set
2772         there, many samples with the new resolution would still be wrapped in
2773         a MediaSampleGStreamer using the old resolution by the main thread
2774         running consumeAppsinkAvailableSamples() before appsinkCapsChanged()
2775         is dispatched.
2776
2777         This patch fixes these problems by updating m_presentationSize in
2778         appsinkCapsChanged() and making the streaming thread block until the
2779         main thread has dispatched appsinkCapsChanged(). This way the handling
2780         of caps changes is serialized with the handling of frames.
2781
2782         Test: media/media-source/media-source-samples-resolution-change.html
2783
2784         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2785         (WebCore::AppendPipeline::AppendPipeline):
2786         (WebCore::AppendPipeline::appsinkCapsChanged):
2787
2788 2019-03-20  Joanmarie Diggs  <jdiggs@igalia.com>
2789
2790         AX: Implement support for new meter ARIA role
2791         https://bugs.webkit.org/show_bug.cgi?id=195966
2792
2793         Reviewed by Chris Fleizach.
2794
2795         Add the new ARIA role to the internal rolemap so that it is treated
2796         in the same fashion as its HTML element counterpart.
2797
2798         No new tests. Instead add the role to the existing role-exposure tests.
2799
2800         * accessibility/AccessibilityObject.cpp:
2801         (WebCore::AccessibilityObject::isMeter const):
2802         (WebCore::initializeRoleMap):
2803         (WebCore::AccessibilityObject::computedRoleString const):
2804         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2805         (atkRole):
2806
2807 2019-03-20  Philippe Normand  <pnormand@igalia.com>
2808
2809         [GStreamer] Switch back to webkitwebsrc for adaptive streaming fragments downloading
2810         https://bugs.webkit.org/show_bug.cgi?id=195948
2811
2812         Reviewed by Xabier Rodriguez-Calvar.
2813
2814         The webkitwebsrc element now behaves much better when used through
2815         GStreamer's adaptivedemux, so use it for all WebKit media
2816         downloads. The MediaPlayer needed by the webkitwebsrc element now
2817         travels through GstContext messages and queries so that it can be
2818         shared by multiple elements, typically the first webkitwebsrc
2819         element downloads the HLS manifest and then adaptivedemux, through
2820         uridownloader, will create new webkitwebsrc elements for fragments
2821         downloading. Those new elements will query the first webkitwebsrc
2822         element for its context.
2823
2824         The previous hack used to check SecurityOrigins can
2825         also be cleaned-up. The origins are now cached upon reception of
2826         the HTTP headers message from webkitwebsrc.
2827
2828         No new tests, existing http/tests/media/hls tests cover this change.
2829
2830         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2831         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
2832         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2833         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2834         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2835         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
2836         (WebCore::convertToInternalProtocol): Deleted.
2837         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2838         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2839         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
2840         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2841         (webkit_web_src_class_init):
2842         (webKitWebSrcSetContext):
2843         (webKitWebSrcStart):
2844         (webKitWebSrcGetProtocols):
2845         (webKitWebSrcSetUri):
2846         (CachedResourceStreamingClient::responseReceived):
2847         (convertPlaybinURI): Deleted.
2848         (webKitSrcWouldTaintOrigin): Deleted.
2849         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2850
2851 2019-03-20  Thibault Saunier  <tsaunier@igalia.com>
2852
2853         [GStreamer][WebRTC]: Refactor to make the encoding happen synchronously
2854         https://bugs.webkit.org/show_bug.cgi?id=195674
2855
2856         This simplifies the code and make sure that everything is called from the right
2857         thread. It also makes it so we follow the same way of doing things as other libwebrtc
2858         encoders.
2859
2860         Also "s/codecSpecifiInfos/codecSpecificInfos/"
2861
2862         Reviewed by Philippe Normand.
2863
2864         No new test as this is just a refactoring
2865
2866         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2867         (WebCore::GStreamerVideoEncoder::InitEncode):
2868         (WebCore::GStreamerVideoEncoder::returnFromFlowReturn):
2869
2870 2019-03-20  Tim Horton  <timothy_horton@apple.com>
2871
2872         Add an platform-driven spell-checking mechanism
2873         https://bugs.webkit.org/show_bug.cgi?id=195795
2874
2875         Reviewed by Ryosuke Niwa.
2876
2877         * dom/Document.cpp:
2878         (WebCore::Document::textInserted):
2879         PlatformTextChecking markers are not expected
2880         to propagate to newly inserted text, so remove them.
2881
2882         * dom/DocumentMarker.h:
2883         (WebCore::DocumentMarker::allMarkers):
2884         Add a new type of DocumentMarker, PlatformTextChecking,
2885         and a new data variant that stores a key value pair of strings.
2886
2887         * dom/DocumentMarkerController.cpp:
2888         (WebCore::DocumentMarkerController::addPlatformTextCheckingMarker):
2889         (WebCore::DocumentMarkerController::removeMarkers):
2890         (WebCore::DocumentMarkerController::filterMarkers):
2891         (WebCore::shouldInsertAsSeparateMarker):
2892         * dom/DocumentMarkerController.h:
2893         Export some things.
2894         Add addPlatformTextCheckingMarker, like the others.
2895         Make it possible to filter out markers of a particular type
2896         in a range with a predicate function.
2897
2898         * editing/CompositeEditCommand.cpp:
2899         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
2900         Propagate PlatformTextChecking data.
2901         A future change should probably make it possible for
2902         any DocumentMarker to copy its data here, instead of
2903         special-casing each type that is important.
2904
2905         * editing/Editor.cpp:
2906         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2907         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
2908         (WebCore::Editor::markMisspellingsAndBadGrammar):
2909         * editing/TextCheckingHelper.cpp:
2910         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2911         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
2912         (WebCore::platformDrivenTextCheckerEnabled):
2913         * editing/TextCheckingHelper.h:
2914         Bail from traditional spell checking if this mechanism is
2915         enabled. (I wrote it this way to make it runtime switchable
2916         in the near future, and to be similar to unifiedTextCheckerEnabled).
2917
2918 2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>
2919
2920         [WebAuthN] Implement FIDO AppID extension
2921         https://bugs.webkit.org/show_bug.cgi?id=143491
2922         <rdar://problem/48298273>
2923
2924         Reviewed by Brent Fulgham.
2925
2926         This patch adds support for FIDO AppID extension: https://www.w3.org/TR/webauthn/#sctn-appid-extension.
2927         To be noticed, this implementation follows what spec suggested in the 'Note' session and what Chrome/Firefox
2928         do in practice to avoid some unnecessary steps of
2929         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-appid-and-facets-v2.0-id-20180227.html#determining-if-a-caller-s-facetid-is-authorized-for-an-appid.
2930
2931         In fido::convertToU2fSignCommand, the checkOnly flag is deleted as it is never used.
2932
2933         Covered by new tests in existing files.
2934
2935         * CMakeLists.txt:
2936         * DerivedSources-input.xcfilelist:
2937         * DerivedSources-output.xcfilelist:
2938         * DerivedSources.make:
2939         * Modules/webauthn/AuthenticationExtensionsClientInputs.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
2940         (WebCore::AuthenticationExtensionsClientInputs::encode const):
2941         (WebCore::AuthenticationExtensionsClientInputs::decode):
2942         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
2943         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2944         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
2945         (WebCore::AuthenticatorCoordinator::create const):
2946         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
2947         * Modules/webauthn/PublicKeyCredential.cpp:
2948         (WebCore::PublicKeyCredential::tryCreate):
2949         (WebCore::PublicKeyCredential::PublicKeyCredential):
2950         (WebCore::PublicKeyCredential::getClientExtensionResults const):
2951         (WebCore::PublicKeyCredential::create): Deleted.
2952         * Modules/webauthn/PublicKeyCredential.h:
2953         * Modules/webauthn/PublicKeyCredential.idl:
2954         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2955         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
2956         * Modules/webauthn/PublicKeyCredentialData.h:
2957         (WebCore::PublicKeyCredentialData::encode const):
2958         (WebCore::PublicKeyCredentialData::decode):
2959         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
2960         (WebCore::PublicKeyCredentialRequestOptions::encode const):
2961         (WebCore::PublicKeyCredentialRequestOptions::decode):
2962         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
2963         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2964         (fido::readCTAPMakeCredentialResponse):
2965         (fido::readCTAPGetAssertionResponse):
2966         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2967         (fido::convertToU2fSignCommand):
2968         * Modules/webauthn/fido/U2fCommandConstructor.h:
2969         * Modules/webauthn/fido/U2fResponseConverter.cpp:
2970         (fido::readU2fRegisterResponse):
2971         (fido::readU2fSignResponse):
2972         * Sources.txt:
2973         * WebCore.xcodeproj/project.pbxproj:
2974
2975 2019-03-19  Devin Rousso  <drousso@apple.com>
2976
2977         Web Inspector: Debugger: lazily create the agent
2978         https://bugs.webkit.org/show_bug.cgi?id=195973
2979         <rdar://problem/49039674>
2980
2981         Reviewed by Joseph Pecoraro.
2982
2983         No change in functionality.
2984
2985         * inspector/WorkerInspectorController.cpp:
2986         (WebCore::WorkerInspectorController::WorkerInspectorController):
2987         (WebCore::WorkerInspectorController::createLazyAgents):
2988
2989         * inspector/agents/WebDebuggerAgent.cpp:
2990         (WebCore::WebDebuggerAgent::disable):
2991
2992         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2993         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
2994         (WebCore::InspectorDOMDebuggerAgent::discardAgent):
2995
2996 2019-03-18  Maciej Stachowiak  <mjs@apple.com>
2997
2998         Simplify Cocoa platform user agent logic by using string constants instead of function calls for the frozen parts
2999         https://bugs.webkit.org/show_bug.cgi?id=195936
3000
3001         Reviewed by Dean Jackson.
3002
3003         No new tests because no behavior changes. Existing behavior is tested by fast/dom/navigator-userAgent-frozen.html
3004
3005         * platform/UserAgent.h: Remove prototype of removed function.
3006         * platform/cocoa/UserAgentCocoa.mm:
3007         (WebCore::userAgentBundleVersion): Deleted.
3008         * platform/ios/UserAgentIOS.mm:
3009         * platform/ios/UserAgentIOS.mm:
3010         (WebCore::osNameForUserAgent): Use WTF String instead of NSString
3011         (WebCore::deviceNameForUserAgent): dutto
3012         (WebCore::standardUserAgentWithApplicationName): Simplify this
3013         function to account for WebKit version now being frozen. Also
3014         use String instead of NSString.
3015         * platform/mac/UserAgentMac.mm:
3016         (WebCore::standardUserAgentWithApplicationName): Simplify this
3017         function to account for CPU and WEbKit version now being
3018         frozen. Also avoid two separate but very similar calls to
3019         makeString().
3020
3021 2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>
3022
3023         Unreviewed adjustment to r242842 per Darin's request.
3024
3025         * platform/win/LoggingWin.cpp:
3026         (WebCore::logLevelString):
3027
3028 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
3029
3030         Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
3031         https://bugs.webkit.org/show_bug.cgi?id=195960
3032
3033         Reviewed by Simon Fraser.
3034
3035         -- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<
3036            SVGPreserveAspectRatio>.
3037
3038         -- Make SVGPreserveAspectRatio be derived form SVGValueProperty<
3039            SVGPreserveAspectRatioValue>.
3040
3041         -- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated 
3042            property.
3043
3044         -- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated
3045            property of the target element and all its instances.
3046
3047         -- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of
3048            animated property in a period of time.
3049
3050         SVGFilterPrimitiveStandardAttributes::build() should be const function.
3051         This is required for this patch because SVGFEImageElement::build() calls
3052         SVGFEImageElement::preserveAspectRatio() which is const.
3053
3054         * Sources.txt:
3055         * WebCore.xcodeproj/project.pbxproj:
3056         * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
3057         * svg/SVGAnimatedPreserveAspectRatio.h: Removed.
3058         * svg/SVGAnimatorFactory.h:
3059         (WebCore::SVGAnimatorFactory::create):
3060         * svg/SVGFEBlendElement.cpp:
3061         (WebCore::SVGFEBlendElement::build const):
3062         (WebCore::SVGFEBlendElement::build): Deleted.
3063         * svg/SVGFEBlendElement.h:
3064         * svg/SVGFEColorMatrixElement.cpp:
3065         (WebCore::SVGFEColorMatrixElement::build const):
3066         (WebCore::SVGFEColorMatrixElement::build): Deleted.
3067         * svg/SVGFEColorMatrixElement.h:
3068         * svg/SVGFEComponentTransferElement.cpp:
3069         (WebCore::SVGFEComponentTransferElement::build const):
3070         (WebCore::SVGFEComponentTransferElement::build): Deleted.
3071         * svg/SVGFEComponentTransferElement.h:
3072         * svg/SVGFECompositeElement.cpp:
3073         (WebCore::SVGFECompositeElement::build const):
3074         (WebCore::SVGFECompositeElement::build): Deleted.
3075         * svg/SVGFECompositeElement.h:
3076         * svg/SVGFEConvolveMatrixElement.cpp:
3077         (WebCore::SVGFEConvolveMatrixElement::build const):
3078         (WebCore::SVGFEConvolveMatrixElement::build): Deleted.
3079         * svg/SVGFEConvolveMatrixElement.h:
3080         * svg/SVGFEDiffuseLightingElement.cpp:
3081         (WebCore::SVGFEDiffuseLightingElement::build const):
3082         (WebCore::SVGFEDiffuseLightingElement::build): Deleted.
3083         * svg/SVGFEDiffuseLightingElement.h:
3084         * svg/SVGFEDisplacementMapElement.cpp:
3085         (WebCore::SVGFEDisplacementMapElement::build const):
3086         (WebCore::SVGFEDisplacementMapElement::build): Deleted.
3087         * svg/SVGFEDisplacementMapElement.h:
3088         * svg/SVGFEDropShadowElement.cpp:
3089         (WebCore::SVGFEDropShadowElement::build const):
3090         (WebCore::SVGFEDropShadowElement::build): Deleted.
3091         * svg/SVGFEDropShadowElement.h:
3092         * svg/SVGFEFloodElement.cpp:
3093         (WebCore::SVGFEFloodElement::build const):
3094         (WebCore::SVGFEFloodElement::build): Deleted.
3095         * svg/SVGFEFloodElement.h:
3096         * svg/SVGFEGaussianBlurElement.cpp:
3097         (WebCore::SVGFEGaussianBlurElement::build const):
3098         (WebCore::SVGFEGaussianBlurElement::build): Deleted.
3099         * svg/SVGFEGaussianBlurElement.h:
3100         * svg/SVGFEImageElement.cpp:
3101         (WebCore::SVGFEImageElement::SVGFEImageElement):
3102         (WebCore::SVGFEImageElement::parseAttribute):
3103         (WebCore::SVGFEImageElement::build const):
3104         (WebCore::SVGFEImageElement::registerAttributes): Deleted.
3105         (WebCore::SVGFEImageElement::build): Deleted.
3106         * svg/SVGFEImageElement.h:
3107         * svg/SVGFEMergeElement.cpp:
3108         (WebCore::SVGFEMergeElement::build const):
3109         (WebCore::SVGFEMergeElement::build): Deleted.
3110         * svg/SVGFEMergeElement.h:
3111         * svg/SVGFEMorphologyElement.cpp:
3112         (WebCore::SVGFEMorphologyElement::build const):
3113         (WebCore::SVGFEMorphologyElement::build): Deleted.
3114         * svg/SVGFEMorphologyElement.h:
3115         * svg/SVGFEOffsetElement.cpp:
3116         (WebCore::SVGFEOffsetElement::build const):
3117         (WebCore::SVGFEOffsetElement::build): Deleted.
3118         * svg/SVGFEOffsetElement.h:
3119         * svg/SVGFESpecularLightingElement.cpp:
3120         (WebCore::SVGFESpecularLightingElement::build const):
3121         (WebCore::SVGFESpecularLightingElement::build): Deleted.
3122         * svg/SVGFESpecularLightingElement.h:
3123         * svg/SVGFETileElement.cpp:
3124         (WebCore::SVGFETileElement::build const):
3125         (WebCore::SVGFETileElement::build): Deleted.
3126         * svg/SVGFETileElement.h:
3127         * svg/SVGFETurbulenceElement.cpp:
3128         (WebCore::SVGFETurbulenceElement::build const):
3129         (WebCore::SVGFETurbulenceElement::build): Deleted.
3130         * svg/SVGFETurbulenceElement.h:
3131         * svg/SVGFilterPrimitiveStandardAttributes.h:
3132         * svg/SVGFitToViewBox.cpp:
3133         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
3134         (WebCore::SVGFitToViewBox::parseViewBox):
3135         (WebCore::SVGFitToViewBox::registerAttributes): Deleted.
3136         * svg/SVGFitToViewBox.h:
3137         (WebCore::SVGFitToViewBox::preserveAspectRatio const):
3138         (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
3139         (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
3140         (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
3141         (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
3142         * svg/SVGImageElement.cpp:
3143         (WebCore::SVGImageElement::SVGImageElement):
3144         (WebCore::SVGImageElement::registerAttributes):
3145         (WebCore::SVGImageElement::parseAttribute):
3146         * svg/SVGImageElement.h:
3147         * svg/SVGMarkerElement.h:
3148         * svg/SVGPatternElement.h:
3149         * svg/SVGPreserveAspectRatio.h:
3150         (WebCore::SVGPreserveAspectRatio::create):
3151         (WebCore::SVGPreserveAspectRatio::align const):
3152         (WebCore::SVGPreserveAspectRatio::setAlign):
3153         (WebCore::SVGPreserveAspectRatio::meetOrSlice const):
3154         (WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
3155         (WebCore::SVGPreserveAspectRatio::align): Deleted.
3156         (WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
3157         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.
3158         * svg/SVGSVGElement.h:
3159         * svg/SVGStringList.h:
3160         * svg/SVGSymbolElement.h:
3161         * svg/SVGViewSpec.h:
3162         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
3163         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
3164         * svg/properties/SVGAnimatedPropertyImpl.h:
3165         * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
3166         * svg/properties/SVGAttributeRegistry.h:
3167         * svg/properties/SVGPropertyOwnerRegistry.h:
3168         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
3169
3170 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
3171
3172         Remove the SVG property tear off objects of SVGAnimatedRect
3173         https://bugs.webkit.org/show_bug.cgi?id=195949
3174
3175         Reviewed by Simon Fraser.
3176
3177         SVGRect is an SVG type, so we need to introduce two classes to represent
3178         it and its animated property SVGAnimatedRect.
3179
3180         -- SVGValueProperty: It is derived from SVGProperty and it will be the 
3181            base class of all the SVG type based properties. It is basically a
3182            RefCounted object with m_value member. For SVGRect, m_value will be
3183            of type FloatRect.
3184
3185         -- SVGAnimatedValueProperty: It is derived from SVGAnimatedProperty and
3186            it will be the base class of all the animated SVG type based properties.
3187            It is RefCounted object with two RefCounted members: baseVal and animVal.
3188            These two members are of type SVGValueProperty. For SVGAnimatedRect,
3189            baseVal and animVal will be of type SVGRect.
3190
3191         SVGAnimatedValueProperty will be responsible for:
3192
3193         1) Providing access to its baseVal and animVal. Note the same interface
3194            is used internally and used by the DOM.
3195
3196         2) Managing the animation of the property by starting and stopping it.
3197
3198         3) Coordinating the changes in its baseVal and animVal with the owner
3199            element.
3200
3201         * Sources.txt:
3202         * WebCore.xcodeproj/project.pbxproj:
3203         * svg/SVGAnimatedRect.cpp: Removed.
3204         * svg/SVGAnimatedRect.h: Removed.
3205         * svg/SVGAnimatorFactory.h:
3206         (WebCore::SVGAnimatorFactory::create):
3207         * svg/SVGAttributeAnimationController.cpp:
3208         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
3209         This is a bug from r243036. The <set> can be the tag of m_animationElement
3210         not m_targetElement.
3211         * svg/SVGAttributeAnimationController.h:
3212         * svg/SVGAttributeAnimationControllerBase.h:
3213         * svg/SVGFitToViewBox.cpp:
3214         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
3215         (WebCore::SVGFitToViewBox::registerAttributes):
3216         (WebCore::SVGFitToViewBox::setViewBox):
3217         (WebCore::SVGFitToViewBox::resetViewBox):
3218         * svg/SVGFitToViewBox.h:
3219         (WebCore::SVGFitToViewBox::viewBox const):
3220         (WebCore::SVGFitToViewBox::viewBoxAnimated):
3221         (WebCore::SVGFitToViewBox::viewBoxString const):
3222         * svg/SVGMarkerElement.h:
3223         * svg/SVGPatternElement.h:
3224         * svg/SVGRect.h:
3225         (WebCore::SVGRect::create):
3226         (WebCore::SVGRect::x):
3227         (WebCore::SVGRect::setX):
3228         (WebCore::SVGRect::y):
3229         (WebCore::SVGRect::setY):
3230         (WebCore::SVGRect::width):
3231         (WebCore::SVGRect::setWidth):
3232         (WebCore::SVGRect::height):
3233         (WebCore::SVGRect::setHeight):
3234         (WebCore::SVGRect::SVGRect): Deleted.
3235         * svg/SVGSVGElement.cpp:
3236         (WebCore::checkIntersectionWithoutUpdatingLayout):
3237         (WebCore::checkEnclosureWithoutUpdatingLayout):
3238         * svg/SVGSVGElement.h:
3239         * svg/SVGSymbolElement.h:
3240         * svg/SVGViewSpec.cpp:
3241         (WebCore::SVGViewSpec::SVGViewSpec):
3242         * svg/SVGViewSpec.h:
3243         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
3244         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
3245         * svg/properties/SVGAnimatedPropertyImpl.h:
3246         * svg/properties/SVGAnimatedValueProperty.h: Added.
3247         (WebCore::SVGAnimatedValueProperty::create):
3248         (WebCore::SVGAnimatedValueProperty::~SVGAnimatedValueProperty):
3249         (WebCore::SVGAnimatedValueProperty::setBaseValInternal):
3250         (WebCore::SVGAnimatedValueProperty::baseVal const):
3251         (WebCore::SVGAnimatedValueProperty::baseVal):
3252         (WebCore::SVGAnimatedValueProperty::setAnimVal):
3253         (WebCore::SVGAnimatedValueProperty::animVal const):
3254         (WebCore::SVGAnimatedValueProperty::animVal):
3255         (WebCore::SVGAnimatedValueProperty::currentValue const):
3256         (WebCore::SVGAnimatedValueProperty::SVGAnimatedValueProperty):
3257         (WebCore::SVGAnimatedValueProperty::ensureAnimVal):
3258         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
3259         (WebCore::SVGAnimationRectFunction::progress):
3260         * svg/properties/SVGAttributeRegistry.h:
3261         * svg/properties/SVGPropertyOwnerRegistry.h:
3262         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
3263         * svg/properties/SVGValueProperty.h: Added.
3264         (WebCore::SVGValueProperty::create):
3265         (WebCore::SVGValueProperty::value const):
3266         (WebCore::SVGValueProperty::setValue):
3267         (WebCore::SVGValueProperty::value):
3268         (WebCore::SVGValueProperty::SVGValueProperty):
3269
3270 2019-03-19  John Wilander  <wilander@apple.com>
3271
3272         Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
3273         https://bugs.webkit.org/show_bug.cgi?id=195923
3274         <rdar://problem/49001272>
3275
3276         Reviewed by Alex Christensen.
3277
3278         Adds a new experimental feature.
3279
3280         Test: http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
3281
3282         * page/RuntimeEnabledFeatures.h:
3283         (WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled):
3284         (WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const):
3285
3286 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
3287
3288         Reparenting during a mutation event inside appendChild could result in a circular DOM tree
3289         https://bugs.webkit.org/show_bug.cgi?id=192825
3290
3291         Reviewed by Zalan Bujtas.
3292
3293         The bug was caused by appendChildWithoutPreInsertionValidityCheck, insertBefore and replaceChild
3294         checking the circular dependency against newChild instead of targets even though when newChild
3295         is a document fragment, appendChildWithoutPreInsertionValidityCheck inserts the children of
3296         the document fragment. Fixed the bug by checking the circular dependency against each target child.
3297
3298         Also fixed the bug that checkAcceptChildGuaranteedNodeTypes was not considering shadow inclusive
3299         ancestors or template host elements.
3300
3301         Tests: fast/dom/append-child-with-mutation-event-removal-and-circular-insertion.html
3302                fast/dom/append-child-with-mutation-event-removal-and-circular-shadow-insertion.html
3303                fast/dom/append-child-with-mutation-event-removal-and-circular-template-insertion.html
3304                fast/dom/insert-child-with-mutation-event-removal-and-circular-insertion.html
3305                fast/dom/insert-child-with-mutation-event-removal-and-circular-shadow-insertion.html
3306                fast/dom/insert-child-with-mutation-event-removal-and-circular-template-insertion.html
3307                fast/dom/replace-child-with-mutation-event-removal-and-circular-insertion.html
3308                fast/dom/replace-child-with-mutation-event-removal-and-circular-shadow-insertion.html
3309                fast/dom/replace-child-with-mutation-event-removal-and-circular-template-insertion.html
3310
3311         * dom/ContainerNode.cpp:
3312         (WebCore::checkAcceptChildGuaranteedNodeTypes):
3313         (WebCore::ContainerNode::insertBefore):
3314         (WebCore::ContainerNode::replaceChild):
3315         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
3316
3317 2019-03-19  Brent Fulgham  <bfulgham@apple.com>
3318
3319         Add default prompt implementation for the Storage Access API
3320         https://bugs.webkit.org/show_bug.cgi?id=195866
3321         <rdar://problem/45150009>
3322
3323         Reviewed by Chris Dumez.
3324
3325         * en.lproj/Localizable.strings: Update with new strings used by the
3326         Storage Access API dialog.
3327
3328 2019-03-19  Thibault Saunier  <tsaunier@igalia.com>
3329
3330         [GStreamer][WebRTC] Create sps/pps for all frames to please libwebrtc
3331         https://bugs.webkit.org/show_bug.cgi?id=195677
3332
3333         Reviewed by Xabier Rodriguez-Calvar.
3334
3335         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
3336         (gst_webrtc_video_encoder_set_format):
3337         (register_known_encoder):
3338         (setup_x264enc):
3339         (setup_openh264enc):
3340         (setup_omxh264enc):
3341         (set_bitrate_bit_per_sec):
3342         (gst_webrtc_video_encoder_class_init):
3343
3344 2019-03-19  Timothy Hatcher  <timothy@apple.com>
3345
3346         REGRESSION (r239904): Update dark mode defines in a few places that got missed.
3347         https://bugs.webkit.org/show_bug.cgi?id=195958
3348
3349         Reviewed by Megan Gardner.
3350
3351         * DerivedSources.make: Support HAVE_OS_DARK_MODE_SUPPORT in html.css.
3352         * css/html.css: Update dark mode defines.
3353         * page/FrameView.cpp:
3354         (WebCore::FrameView::updateBackgroundRecursively): Ditto.
3355
3356 2019-03-19  Chris Dumez  <cdumez@apple.com>
3357
3358         media/track/track-in-band-style.html is flaky
3359         https://bugs.webkit.org/show_bug.cgi?id=195922
3360
3361         Reviewed by Eric Carlson.
3362
3363         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3364         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
3365         Small optimization: some of the if checks were missing their "continue;"
3366         statement. This would cause us to keep checking following keys even though
3367         we already got a match.
3368
3369 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3370
3371         Build cleanly with GCC 9
3372         https://bugs.webkit.org/show_bug.cgi?id=195920
3373
3374         Reviewed by Chris Dumez.
3375
3376         WebKit triggers three new GCC 9 warnings:
3377
3378         """
3379         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
3380