Web Inspector: Timelines: can't reliably stop/start a recording
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-10  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: Timelines: can't reliably stop/start a recording
4         https://bugs.webkit.org/show_bug.cgi?id=196778
5         <rdar://problem/47606798>
6
7         Reviewed by Timothy Hatcher.
8
9         * inspector/agents/InspectorTimelineAgent.cpp:
10         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
11         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
12         It is possible to determine when programmatic capturing starts/stops in the frontend based
13         on the state when the backend causes the state to change, such as if the state is "inactive"
14         when the frontend is told that the backend has started capturing.
15
16         * inspector/agents/InspectorCPUProfilerAgent.cpp:
17         (WebCore::InspectorCPUProfilerAgent::stopTracking):
18         * inspector/agents/InspectorMemoryAgent.cpp:
19         (WebCore::InspectorMemoryAgent::stopTracking):
20         Send an end timestamp to match other instruments.
21
22 2019-04-10  Tim Horton  <timothy_horton@apple.com>
23
24         Add modern API for overriding the page's specified viewport configuration
25         https://bugs.webkit.org/show_bug.cgi?id=167734
26         <rdar://problem/30331795>
27
28         Reviewed by Simon Fraser.
29
30         New API test: WebKit.OverrideViewportArguments
31
32         * dom/Document.cpp:
33         (WebCore::Document::updateViewportArguments):
34         * dom/Document.h:
35         (WebCore::Document::viewportArguments const):
36         Make the viewportArguments() getter respect the overridden arguments.
37
38         * dom/ViewportArguments.cpp:
39         (WebCore::numericPrefix):
40         (WebCore::findSizeValue):
41         (WebCore::findScaleValue):
42         (WebCore::findBooleanValue):
43         (WebCore::parseViewportFitValue):
44         (WebCore::viewportErrorMessage):
45         (WebCore::reportViewportWarning):
46         (WebCore::setViewportFeature):
47         * dom/ViewportArguments.h:
48         Make it possible to parse ViewportArguments without a Document, so
49         that it can be used in the UI process. We only used the Document for
50         two things: error reporting, and getting the state of one setting.
51         Refactor error handling to use a passed-arund function, and add a
52         variant of setViewportFeature() that doesn't take a Document.
53
54 2019-04-10  Justin Fan  <justin_fan@apple.com>
55
56         [Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
57         https://bugs.webkit.org/show_bug.cgi?id=196758
58
59         Reviewed by Dean Jackson.
60
61         Test: webgpu/draw-indexed-triangles.html
62
63         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed to enable indexed drawing.
64         Disable GPUCommandEncoders with active pass encoders from being submitted or encoding blits. 
65
66         Prevent active GPUCommandEncoders from being submitted or encoding blit commands:
67         * Modules/webgpu/WebGPUCommandEncoder.cpp:
68         (WebCore::WebGPUCommandEncoder::finish):
69         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
70         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
71         (WebCore::GPUCommandBuffer::copyBufferToTexture):
72         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
73         (WebCore::GPUCommandBuffer::copyTextureToTexture):
74
75         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed:
76         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
77         (WebCore::WebGPURenderPassEncoder::setIndexBuffer):
78         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Remove unnecessary move operations.
79         (WebCore::WebGPURenderPassEncoder::drawIndexed): Added.
80         * Modules/webgpu/WebGPURenderPassEncoder.h:
81         * Modules/webgpu/WebGPURenderPassEncoder.idl:
82         * platform/graphics/gpu/GPUBuffer.h:
83         (WebCore::GPUBuffer::isIndex const):
84         * platform/graphics/gpu/GPUInputStateDescriptor.h:
85         * platform/graphics/gpu/GPURenderPassEncoder.h: Cache the index buffer, as Metal does not set the index buffer separate from the draw call.
86         * platform/graphics/gpu/GPURenderPipeline.h:
87         (WebCore::GPURenderPipeline::indexFormat const):
88         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
89         (WebCore::GPURenderPassEncoder::setIndexBuffer):
90         (WebCore::GPURenderPassEncoder::setVertexBuffers):
91         (WebCore::mtlPrimitiveTypeForGPUPrimitiveTopology):
92         (WebCore::GPURenderPassEncoder::draw):
93         (WebCore::mtlIndexTypeForGPUIndexFormat): Added.
94         (WebCore::GPURenderPassEncoder::drawIndexed): Added.
95         (WebCore::primitiveTypeForGPUPrimitiveTopology): Deleted.
96         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
97         (WebCore::GPURenderPipeline::tryCreate):
98         (WebCore::GPURenderPipeline::GPURenderPipeline):
99
100 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
101
102         OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if offlineRender exists early
103         https://bugs.webkit.org/show_bug.cgi?id=196759
104
105         Reviewed by Eric Carlson.
106
107         OfflineAudioDestinationNode::startRendering unconditionally ref's itself before invoking offlineRender() in a new thread.
108         But offlineRender can early exit without ever calling deref() in the main thread, leading to the leak of
109         OfflineAudioDestinationNode. Fixed the leak by always calling deref in the main thread after calling offlineRender().
110
111         Also removed the debug assertion in offlineRender which always hits when we run the relevant test.
112
113         Test: imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html
114
115         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
116         (WebCore::OfflineAudioDestinationNode::startRendering):
117         (WebCore::OfflineAudioDestinationNode::offlineRender):
118         (WebCore::OfflineAudioDestinationNode::notifyComplete): Merged into startRendering.
119         * Modules/webaudio/OfflineAudioDestinationNode.h:
120
121 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
122
123         Fix text autoscrolling when typing in modern webkit
124         https://bugs.webkit.org/show_bug.cgi?id=196718
125         <rdar://problem/49225507>
126
127         Reviewed by Tim Horton.
128
129         Tests: fast/events/autoscroll-when-input-is-offscreen.html
130                fast/events/autoscroll-with-software-keyboard.html
131
132         We have been relying on UIKit to scroll editable text, but
133         since we cannot give them enough information for them to always
134         do the right thing, we should just do all the work in WebKit.
135         This has the added benifit of fixing some tricky autoscrolling
136         bugs that have cropped up recently.
137
138         * editing/Editor.cpp:
139         (WebCore::Editor::insertTextWithoutSendingTextEvent):
140         (WebCore::Editor::revealSelectionAfterEditingOperation):
141         We should be scrolling the main frame in WebKit. We have been relying on UIKit,
142         but we cannot give them enough information to guarantee a correct scroll, so just
143         do all the work in WebKit.
144         * page/FrameView.cpp:
145         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
146         Update to use the rect that is actually visible, accounting for the software keyboard.
147
148 2019-04-10  Ross Kirsling  <ross.kirsling@sony.com>
149
150         WebCore should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
151         https://bugs.webkit.org/show_bug.cgi?id=196762
152
153         Reviewed by Ryosuke Niwa.
154
155         * Modules/indexeddb/IDBCursor.h:
156         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
157         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
158         * Modules/websockets/WebSocketFrame.cpp:
159         * accessibility/AccessibilityARIAGridRow.cpp:
160         (WebCore::AccessibilityARIAGridRow::parentTable const):
161         * accessibility/AccessibilityObject.cpp:
162         * accessibility/AccessibilityRenderObject.cpp:
163         * animation/CSSAnimation.cpp:
164         * animation/DeclarativeAnimation.cpp:
165         * bindings/js/DOMGCOutputConstraint.h:
166         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
167         (WebCore::root):
168         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
169         (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
170         * bindings/js/JSDOMConvertNumbers.cpp:
171         * bindings/js/JSDOMWindowCustom.cpp:
172         * bindings/js/JSExtendableMessageEventCustom.cpp:
173         * bindings/js/SerializedScriptValue.cpp:
174         * css/CSSFontFaceSource.cpp:
175         * css/CSSFontFaceSource.h:
176         * css/MediaQueryMatcher.h:
177         * css/parser/CSSPropertyParserHelpers.cpp:
178         * dom/DocumentParser.cpp:
179         * dom/EventPath.cpp:
180         * dom/MouseEvent.h:
181         * dom/SpectreGadget.cpp:
182         * dom/SpectreGadget.h:
183         * editing/ChangeListTypeCommand.cpp:
184         * editing/EditAction.cpp:
185         * editing/ReplaceSelectionCommand.cpp:
186         * editing/TextGranularity.h:
187         * html/HTMLFormControlsCollection.cpp:
188         * html/HTMLImageElement.cpp:
189         * html/canvas/CanvasRenderingContext2DBase.cpp:
190         * inspector/InspectorController.cpp:
191         * inspector/agents/InspectorApplicationCacheAgent.cpp:
192         * inspector/agents/InspectorCanvasAgent.cpp:
193         * inspector/agents/WebHeapAgent.cpp:
194         * inspector/agents/page/PageAuditAgent.cpp:
195         * inspector/agents/page/PageConsoleAgent.cpp:
196         * inspector/agents/page/PageNetworkAgent.cpp:
197         * inspector/agents/worker/WorkerAuditAgent.cpp:
198         * loader/CrossOriginAccessControl.h:
199         * loader/CrossOriginPreflightResultCache.h:
200         * loader/NavigationAction.cpp:
201         * loader/ResourceLoadObserver.cpp:
202         * page/FrameTree.cpp:
203         * page/IntersectionObserver.cpp:
204         * page/PageConfiguration.cpp:
205         * page/PerformanceResourceTiming.cpp:
206         * page/ResizeObservation.cpp:
207         * page/UndoManager.cpp:
208         * plugins/PluginData.cpp:
209         * rendering/Grid.h:
210         * rendering/GridBaselineAlignment.cpp:
211         * rendering/GridBaselineAlignment.h:
212         * rendering/GridLayoutFunctions.cpp:
213         * rendering/GridLayoutFunctions.h:
214         * rendering/GridTrackSizingAlgorithm.h:
215         * rendering/RenderDeprecatedFlexibleBox.cpp:
216         * rendering/RenderFlexibleBox.cpp:
217         * rendering/RenderIFrame.cpp:
218         * rendering/RenderLayerFilters.cpp:
219         * rendering/TextDecorationPainter.cpp:
220         * rendering/TextDecorationPainter.h:
221         * rendering/TextPainter.cpp:
222         * rendering/TextPainter.h:
223         * rendering/style/StyleRareNonInheritedData.cpp:
224         * rendering/style/StyleRareNonInheritedData.h:
225         * rendering/svg/SVGRenderSupport.h:
226         * rendering/updating/RenderTreeBuilder.cpp:
227         * rendering/updating/RenderTreeBuilderSVG.cpp:
228         * style/InlineTextBoxStyle.cpp:
229         * style/InlineTextBoxStyle.h:
230         * style/StylePendingResources.cpp:
231         * svg/SVGMatrix.h:
232         * svg/SVGViewSpec.h:
233         * svg/SVGZoomAndPan.h:
234         * workers/WorkerScriptLoader.cpp:
235         * workers/WorkerScriptLoader.h:
236         * workers/service/ServiceWorker.cpp:
237         * workers/service/ServiceWorkerClientData.cpp:
238         * workers/service/ServiceWorkerClients.cpp:
239         * workers/service/ServiceWorkerClients.h:
240         * workers/service/ServiceWorkerGlobalScope.cpp:
241         * workers/service/ServiceWorkerJob.cpp:
242         * workers/service/ServiceWorkerProvider.cpp:
243         * workers/service/context/ServiceWorkerFetch.cpp:
244         * workers/service/context/ServiceWorkerInspectorProxy.h:
245         * workers/service/context/ServiceWorkerThread.cpp:
246         * workers/service/context/ServiceWorkerThreadProxy.cpp:
247         * workers/service/server/SWServerJobQueue.cpp:
248         * workers/service/server/SWServerToContextConnection.cpp:
249         * workers/service/server/SWServerWorker.cpp:
250         * workers/service/server/SWServerWorker.h:
251         * worklets/Worklet.h:
252
253 2019-04-10  Antoine Quint  <graouts@apple.com>
254
255         Enable Pointer Events on watchOS
256         https://bugs.webkit.org/show_bug.cgi?id=196771
257         <rdar://problem/49040909>
258
259         Reviewed by Dean Jackson.
260
261         * Configurations/FeatureDefines.xcconfig:
262
263 2019-04-10  Youenn Fablet  <youenn@apple.com>
264
265         Delay initialization of quota users until the first quota request
266         https://bugs.webkit.org/show_bug.cgi?id=196467
267
268         Reviewed by Chris Dumez.
269
270         Instead of triggering initialization of each user when being added,
271         delay initialization until the first call to requestSpace with a non zero task size.
272         This will make sure we do not load Cache API information in memory or check for
273         IDB space until actually necessary.
274
275         To implement that, move from a HashSet of being initialized users to a HashMap where the key is user and
276         the value is the user initialization state.
277
278         When removing a user, delay the call to processPendingRequest so that a synchronous call to addUser
279         can be taken into consideration.
280
281         This unflakes some Cache API tests as these tests do clear the Cache API and check for the clearing result.
282         Clearing the caches triggers a removeUser/addUser dance which then triggers initialization of the Caches structure.
283
284         Covered by existing tests.
285
286         * storage/StorageQuotaManager.cpp:
287         (WebCore::StorageQuotaManager::initializeUsersIfNeeded):
288         (WebCore::StorageQuotaManager::askUserToInitialize):
289         (WebCore::StorageQuotaManager::addUser):
290         (WebCore::StorageQuotaManager::requestSpace):
291         * storage/StorageQuotaManager.h:
292
293 2019-04-10  Philippe Normand  <pnormand@igalia.com>
294
295         there is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
296         https://bugs.webkit.org/show_bug.cgi?id=196615
297
298         Reviewed by Xabier Rodriguez-Calvar.
299
300         Add vp8.0 and vp9.0 in supported mime-types if the corresponding video decoders are found.
301
302         No new tests, existing web-platform-tests cover this change.
303
304         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
305         (WebCore::GStreamerRegistryScanner::initialize):
306
307 2019-04-10  Philippe Normand  <pnormand@igalia.com>
308
309         [GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
310         https://bugs.webkit.org/show_bug.cgi?id=196765
311
312         Reviewed by Xabier Rodriguez-Calvar.
313
314         Without the following patch in gst-plugins-bad, the uridownloader
315         doesn't relay need-context messages to its parent, so in our case
316         the player can't share its context with secondary webkitwebsrc
317         elements and a RELEASE_ASSERT is hit in the WebProcess.
318
319         So the workaround is to use again webkit+ protocol prefixes for
320         GStreamer versions older than 1.12.
321
322         https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/8cf858fb27919e1d631223375f81b98055623733
323
324         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
325         (WebCore::convertToInternalProtocol):
326         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
327         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
328         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
329         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
330         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
331         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
332         (webKitWebSrcStart):
333         (webKitWebSrcGetProtocols):
334         (convertPlaybinURI):
335         (webKitWebSrcSetUri):
336         (CachedResourceStreamingClient::responseReceived):
337         (webKitSrcWouldTaintOrigin):
338         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
339
340 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
341
342         [ATK] Defer the emision of AtkObject::children-changed signal after layout is done
343         https://bugs.webkit.org/show_bug.cgi?id=187948
344
345         Reviewed by Michael Catanzaro.
346
347         The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
348         AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
349         of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
350         most of them update the backing store at the beginning.
351
352         Fixes: accessibility/children-changed-sends-notification.html
353
354         * accessibility/AXObjectCache.cpp:
355         (WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
356         * accessibility/AXObjectCache.h:
357         * accessibility/atk/AXObjectCacheAtk.cpp:
358         (WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
359         (WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
360         (WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
361         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
362         in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
363         * accessibility/ios/AXObjectCacheIOS.mm:
364         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
365         * accessibility/mac/AXObjectCacheMac.mm:
366         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
367         * accessibility/win/AXObjectCacheWin.cpp:
368         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
369         * accessibility/wpe/AXObjectCacheWPE.cpp:
370         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
371
372 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
373
374         [ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
375         https://bugs.webkit.org/show_bug.cgi?id=172281
376         <rdar://problem/37030990>
377
378         Reviewed by Joanmarie Diggs.
379
380         The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
381         first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
382         things differently, we don't include the static text elements individually, but parent element uses
383         textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.
384
385         Fixes: accessibility/insert-children-assert.html
386
387         * accessibility/AccessibilityRenderObject.cpp:
388         (WebCore::AccessibilityRenderObject::textUnderElement const):
389
390 2019-04-09  Keith Rollin  <krollin@apple.com>
391
392         Unreviewed build maintenance -- update .xcfilelists.
393
394         * DerivedSources-input.xcfilelist:
395         * DerivedSources-output.xcfilelist:
396
397 2019-04-09  Zalan Bujtas  <zalan@apple.com>
398
399         [AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
400         https://bugs.webkit.org/show_bug.cgi?id=196743
401         <rdar://problem/43897551>
402
403         Reviewed by Tim Horton.
404
405         This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
406         Now with the initial containing block width is firmly set to auto-sizing width, the overflow content will not stretch the ICB. Instead it overflows the ICB
407         and triggers scrolling the same way the non-auto-sizing mode does.
408
409         * page/FrameView.cpp:
410         (WebCore::FrameView::autoSizeIfEnabled):
411         (WebCore::FrameView::enableAutoSizeMode):
412         * page/FrameView.h:
413         * testing/Internals.cpp:
414         (WebCore::Internals::enableAutoSizeMode):
415         * testing/Internals.h:
416         * testing/Internals.idl:
417
418 2019-04-09  Youenn Fablet  <youenn@apple.com>
419
420         Close service worker database on network process suspension
421         https://bugs.webkit.org/show_bug.cgi?id=196623
422         <rdar://problem/48930869>
423
424         Reviewed by Alex Christensen.
425
426         Add suspend/resume support to SWServer.
427         On suspend, close the service worker database and stop pushing for changes.
428         On resume, push changes if needed.
429
430         * workers/service/server/RegistrationDatabase.cpp:
431         (WebCore::RegistrationDatabase::close):
432         * workers/service/server/RegistrationDatabase.h:
433         (WebCore::RegistrationDatabase::isClosed const): Deleted.
434         * workers/service/server/RegistrationStore.cpp:
435         (WebCore::RegistrationStore::closeDatabase):
436         * workers/service/server/RegistrationStore.cpp:
437         (WebCore::RegistrationStore::pushChangesToDatabase):
438         (WebCore::RegistrationStore::clearAll):
439         (WebCore::RegistrationStore::startSuspension):
440         (WebCore::RegistrationStore::endSuspension):
441         * workers/service/server/RegistrationStore.h:
442         * workers/service/server/SWServer.cpp:
443         (WebCore::SWServer::startSuspension):
444         (WebCore::SWServer::endSuspension):
445         * workers/service/server/SWServer.h:
446
447 2019-04-09  Justin Fan  <justin_fan@apple.com>
448
449         [Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
450         https://bugs.webkit.org/show_bug.cgi?id=196719
451
452         Reviewed by Myles C. Maxfield.
453
454         Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.
455
456         Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html
457
458         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
459         (WebCore::WebGPURenderPassEncoder::setBlendColor):
460         (WebCore::WebGPURenderPassEncoder::setViewport):
461         (WebCore::WebGPURenderPassEncoder::setScissorRect):
462         * Modules/webgpu/WebGPURenderPassEncoder.h:
463         * Modules/webgpu/WebGPURenderPassEncoder.idl:
464         * platform/graphics/gpu/GPURenderPassEncoder.h:
465         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
466         (WebCore::GPURenderPassEncoder::setBlendColor):
467         (WebCore::GPURenderPassEncoder::setViewport):
468         (WebCore::GPURenderPassEncoder::setScissorRect):
469
470 2019-04-09  Andy Estes  <aestes@apple.com>
471
472         [Apple Pay] Add release logging to PaymentCoordinator
473         https://bugs.webkit.org/show_bug.cgi?id=196738
474
475         Reviewed by Alex Christensen.
476
477         When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.
478
479         The following information might be logged: names of functions called, merchant API versions,
480         boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
481         completePaymentSession() was called with a final state result, boolean results of
482         shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
483         user scripts, and whether a client supports unrestricted Apple Pay.
484
485         * Modules/applepay/PaymentCoordinator.cpp:
486         (WebCore::PaymentCoordinator::supportsVersion const):
487         (WebCore::PaymentCoordinator::canMakePayments):
488         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
489         (WebCore::PaymentCoordinator::openPaymentSetup):
490         (WebCore::PaymentCoordinator::beginPaymentSession):
491         (WebCore::PaymentCoordinator::completeMerchantValidation):
492         (WebCore::PaymentCoordinator::completeShippingMethodSelection):
493         (WebCore::PaymentCoordinator::completeShippingContactSelection):
494         (WebCore::PaymentCoordinator::completePaymentMethodSelection):
495         (WebCore::PaymentCoordinator::completePaymentSession):
496         (WebCore::PaymentCoordinator::abortPaymentSession):
497         (WebCore::PaymentCoordinator::cancelPaymentSession):
498         (WebCore::PaymentCoordinator::validateMerchant):
499         (WebCore::PaymentCoordinator::didAuthorizePayment):
500         (WebCore::PaymentCoordinator::didSelectPaymentMethod):
501         (WebCore::PaymentCoordinator::didSelectShippingMethod):
502         (WebCore::PaymentCoordinator::didSelectShippingContact):
503         (WebCore::PaymentCoordinator::didCancelPaymentSession):
504         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
505         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
506         * Modules/applepay/PaymentCoordinatorClient.h:
507         (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
508         * platform/Logging.h:
509         * testing/MockPaymentCoordinator.h:
510
511 2019-04-09  John Wilander  <wilander@apple.com>
512
513         Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
514         https://bugs.webkit.org/show_bug.cgi?id=196558
515         <rdar://problem/47650245>
516
517         Reviewed by Youenn Fablet.
518
519         Tests: http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html
520                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html
521                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html
522
523         The existing API tests were expanded too.
524
525         * html/HTMLAnchorElement.cpp:
526         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
527            Enhanced the use of AdClickAttribution::MaxEntropy.
528         * loader/AdClickAttribution.cpp:
529         (WebCore::AdClickAttribution::parseConversionRequest):
530             New function to parse and validate URLs with a path starting with
531             /.well-known/ad-click-attribution/.
532         (WebCore::AdClickAttribution::toString const):
533             Added output for the conversion priority for testing purposes.
534         * loader/AdClickAttribution.h:
535         (WebCore::AdClickAttribution::Campaign::isValid const):
536         (WebCore::AdClickAttribution::Conversion::isValid const):
537            Enhanced the use of AdClickAttribution::MaxEntropy.
538
539 2019-04-09  Don Olmstead  <don.olmstead@sony.com>
540
541         [CMake] Apple builds should use ICU_INCLUDE_DIRS
542         https://bugs.webkit.org/show_bug.cgi?id=196720
543
544         Reviewed by Konstantin Tokarev.
545
546         * PlatformMac.cmake:
547
548 2019-04-09  Jer Noble  <jer.noble@apple.com>
549
550         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
551         https://bugs.webkit.org/show_bug.cgi?id=196097
552
553         Reviewed by Eric Carlson.
554
555         Test: media/track/track-in-band-metadata-display-order.html
556
557         Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
558         by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
559         TextTrackCueGeneric for testing.
560
561         Drive-by fixes:
562
563         Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
564         parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
565         a HTMLMediaElement*
566
567         TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
568         enable use of is<> and downcast<>.
569
570         * Source/WebCore/CMakeLists.txt:
571         * DerivedSources-input.xcfilelist:
572         * DerivedSources-output.xcfilelist:
573         * DerivedSources.make:
574         * WebCore.xcodeproj/project.pbxproj:
575         * Sources.txt:
576         * html/shadow/MediaControlElementTypes.cpp:
577         (WebCore::parentMediaElement):
578         * html/shadow/MediaControlElementTypes.h:
579         * html/shadow/MediaControlElements.cpp:
580         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
581         (WebCore::MediaControlTextTrackContainerElement::logger const):
582         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
583         (WebCore::MediaControlTextTrackContainerElement::logChannel const):
584         * html/shadow/MediaControlElements.h:
585         * html/track/DataCue.h:
586         (isType):
587         * html/track/TextTrackCueGeneric.h:
588         (isType):
589         * html/track/TextTrackCueGeneric.idl: Added.
590         * html/track/VTTCue.h:
591         (isType):
592         * testing/Internals.cpp:
593         (WebCore::Internals::createGenericCue):
594         * testing/Internals.h:
595         * testing/Internals.idl:
596
597 2019-04-09  Sihui Liu  <sihui_liu@apple.com>
598
599         Remove unnecessary network process assertion for IDB close
600         https://bugs.webkit.org/show_bug.cgi?id=196693
601
602         Reviewed by Geoffrey Garen.
603
604         We already took assertion at WebCore::SQLiteDatabase::close.
605
606         * Modules/indexeddb/server/IDBServer.cpp:
607         (WebCore::IDBServer::IDBServer::create):
608         (WebCore::IDBServer::IDBServer::IDBServer):
609         (WebCore::IDBServer::m_quotaManagerGetter): Deleted.
610         (WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
611         (WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
612         * Modules/indexeddb/server/IDBServer.h:
613         (WebCore::IDBServer::IDBServer::create): Deleted.
614         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
615         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
616         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
617         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
618         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
619         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
620         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
621         * Modules/indexeddb/server/UniqueIDBDatabase.h:
622
623 2019-04-09  Eike Rathke  <erack@redhat.com>
624
625         Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
626         https://bugs.webkit.org/show_bug.cgi?id=196350
627
628         Reviewed by Xabier Rodriguez-Calvar.
629
630         trackTypeAsString was uninitialized in the
631         TrackPrivateBaseGStreamer::TrackType::Text case when calling
632         GST_INFO_OBJECT().
633
634         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
635         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
636
637 2019-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
638
639         [ATK] Cleanup WebKitAccessibleHyperlink
640         https://bugs.webkit.org/show_bug.cgi?id=196602
641
642         Reviewed by Michael Catanzaro.
643
644         Cleanups:
645
646          - Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
647            the object data here.
648          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
649            struct are no longer leaked.
650          - Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
651          - Use nullptr instead of 0 and other coding style issues.
652
653         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
654         (webkitAccessibleHyperlinkActionDoAction):
655         (webkitAccessibleHyperlinkActionGetNActions):
656         (webkitAccessibleHyperlinkActionGetDescription):
657         (webkitAccessibleHyperlinkActionGetKeybinding):
658         (webkitAccessibleHyperlinkActionGetName):
659         (atk_action_interface_init):
660         (webkitAccessibleHyperlinkGetURI):
661         (webkitAccessibleHyperlinkGetObject):
662         (rangeLengthForObject):
663         (webkitAccessibleHyperlinkGetStartIndex):
664         (webkitAccessibleHyperlinkGetEndIndex):
665         (webkitAccessibleHyperlinkIsValid):
666         (webkitAccessibleHyperlinkGetNAnchors):
667         (webkitAccessibleHyperlinkIsSelectedLink):
668         (webkitAccessibleHyperlinkGetProperty):
669         (webkitAccessibleHyperlinkSetProperty):
670         (webkit_accessible_hyperlink_class_init):
671         (webkitAccessibleHyperlinkGetOrCreate):
672         (core): Deleted.
673         (atkActionInterfaceInit): Deleted.
674         (getRangeLengthForObject): Deleted.
675         (webkitAccessibleHyperlinkFinalize): Deleted.
676         (webkitAccessibleHyperlinkClassInit): Deleted.
677         (webkitAccessibleHyperlinkInit): Deleted.
678         (webkitAccessibleHyperlinkGetType): Deleted.
679         (webkitAccessibleHyperlinkNew): Deleted.
680         (webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
681         * accessibility/atk/WebKitAccessibleHyperlink.h:
682         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
683         (webkitAccessibleHyperlinkImplGetHyperlink):
684         (webkitAccessibleHyperlinkImplInterfaceInit):
685
686 2019-04-08  Simon Fraser  <simon.fraser@apple.com>
687
688         Remove some iOS #ifdefs around sticky-related code
689         https://bugs.webkit.org/show_bug.cgi?id=196726
690
691         Reviewed by Zalan Bujtas.
692
693         Now that async overflow scrolling can be enabled on macOS, RenderLayerCompositor::isAsyncScrollableStickyLayer()
694         should not have iOS-only code.
695
696         The answer to the FIXME in RenderLayerCompositor::computeStickyViewportConstraints is obvious: composited
697         overflow:scroll can be the container for sticky. The assertion can be removed.
698
699         * rendering/RenderLayer.cpp: Fix spacing in some logging.
700         (WebCore::outputPaintOrderTreeRecursive):
701         * rendering/RenderLayerCompositor.cpp:
702         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
703         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
704
705 2019-04-08  Don Olmstead  <don.olmstead@sony.com>
706
707         [CMake][WinCairo] Separate copied headers into different directories
708         https://bugs.webkit.org/show_bug.cgi?id=196655
709
710         Reviewed by Michael Catanzaro.
711
712         * CMakeLists.txt:
713         * PlatformWin.cmake:
714
715 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
716
717         AX: Automatically compute accessibility labels for Apple Pay buttons
718         https://bugs.webkit.org/show_bug.cgi?id=196661
719
720         Reviewed by Joanmarie Diggs.
721
722         Detect Apple Pay buttons and return a standard role and label for them based on their type.
723
724         Test: accessibility/mac/apple-pay-labels.html
725               accessibility/mac/apple-pay-session-v4.html
726
727         * accessibility/AccessibilityNodeObject.cpp:
728         (WebCore::AccessibilityNodeObject::isControl const):
729         * accessibility/AccessibilityNodeObject.h:
730         * accessibility/AccessibilityRenderObject.cpp:
731         (WebCore::AccessibilityRenderObject::applePayButtonDescription const):
732         (WebCore::AccessibilityRenderObject::titleElementText const):
733         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
734         (WebCore::AccessibilityRenderObject::isApplePayButton const):
735         (WebCore::AccessibilityRenderObject::applePayButtonType const):
736         * accessibility/AccessibilityRenderObject.h:
737         * en.lproj/Localizable.strings:
738         * platform/LocalizedStrings.cpp:
739         (WebCore::AXApplePayPlainLabel):
740         (WebCore::AXApplePayBuyLabel):
741         (WebCore::AXApplePaySetupLabel):
742         (WebCore::AXApplePayDonateLabel):
743         (WebCore::AXApplePayCheckOutLabel):
744         (WebCore::AXApplePayBookLabel):
745         (WebCore::AXApplePaySubscribeLabel):
746         * platform/LocalizedStrings.h:
747
748 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
749
750         AX: Support API: accessibilityReplaceRange:withText
751         https://bugs.webkit.org/show_bug.cgi?id=196636
752
753         Reviewed by Daniel Bates.
754
755         Support this platform API on mac to provide a way to replace a range of editable text.
756
757         Test: accessibility/mac/replace-text-with-range.html
758
759         * accessibility/AccessibilityObject.cpp:
760         (WebCore::AccessibilityObject::replaceTextInRange):
761         * accessibility/AccessibilityObject.h:
762         * accessibility/mac/AccessibilityObjectBase.mm:
763         (WebCore::PlainTextRange::PlainTextRange):
764         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
765         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
766
767 2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
768
769         [iOS] Do not allow starting selection drags when selection views are not visible
770         https://bugs.webkit.org/show_bug.cgi?id=196686
771         <rdar://problem/49399192>
772
773         Reviewed by Tim Horton.
774
775         See WebKit ChangeLog for more details.
776
777         Tests:  DragAndDropTests.CanDragImageWhenNotFirstResponder
778                 DragAndDropTests.DoNotPerformSelectionDragWhenNotFirstResponder
779
780         * page/DragController.cpp:
781         (WebCore::DragController::draggableElement const):
782
783         Make this respect the case where m_dragSourceAction does not include DragSourceActionSelection. All the other
784         drag source types are currently consulted in this method, with the exception of DragSourceActionSelection.
785
786 2019-04-08  Youenn Fablet  <youenn@apple.com>
787
788         Add a test to check for the service worker process name
789         https://bugs.webkit.org/show_bug.cgi?id=196621
790
791         Reviewed by Chris Dumez.
792
793         Add a service worker internal API to get process name.
794         Covered by updated test.
795
796         * WebCore.xcodeproj/project.pbxproj:
797         * testing/ServiceWorkerInternals.cpp:
798         (WebCore::ServiceWorkerInternals::processName const):
799         * testing/ServiceWorkerInternals.h:
800         * testing/ServiceWorkerInternals.idl:
801         * testing/ServiceWorkerInternals.mm: Added.
802
803 2019-04-08  Yusuke Suzuki  <ysuzuki@apple.com>
804
805         Unreviewed, speculative fix for build failure in old macOS after r243887
806         https://bugs.webkit.org/show_bug.cgi?id=196475
807
808         * dom/NodeList.h:
809
810 2019-04-08  Justin Fan  <justin_fan@apple.com>
811
812         [Web GPU] Fix Web GPU experimental feature on iOS
813         https://bugs.webkit.org/show_bug.cgi?id=196632
814
815         Reviewed by Myles C. Maxfield.
816
817         Add feature conditionals for iOS 11.
818         Properly make Web GPU available on iOS 11+.
819
820         * Configurations/FeatureDefines.xcconfig:
821         * Configurations/WebKitTargetConditionals.xcconfig:
822
823 2019-04-08  Timothy Hatcher  <timothy@apple.com>
824
825         Unreviewed build fix for iOSMac after r243893.
826         https://bugs.webkit.org/show_bug.cgi?id=196707
827
828         * dom/Element.cpp:
829         (WebCore::parentCrossingFrameBoundaries): Remove ENABLE(POINTER_EVENTS) since computedTouchActions()
830         no longer uses parentCrossingFrameBoundaries().
831
832 2019-04-08  Youenn Fablet  <youenn@apple.com>
833
834         Lazily construct Navigator serviceWorker
835         https://bugs.webkit.org/show_bug.cgi?id=196692
836
837         Reviewed by Chris Dumez.
838
839         Make NavigatorBase a ContextDestructionObserver.
840         This allows to get the navigator script execution context.
841         Use it when creating the navigator ServiceWorkerContainer object.
842         For GC, introduce serviceWorkerIfAny which returns the container if created.
843         No JS observable change of behavior.
844         Covered by existing tests.
845
846         * bindings/js/JSNavigatorCustom.cpp:
847         (WebCore::JSNavigator::visitAdditionalChildren):
848         * bindings/js/JSWorkerNavigatorCustom.cpp:
849         (WebCore::JSWorkerNavigator::visitAdditionalChildren):
850         * page/NavigatorBase.cpp:
851         (WebCore::NavigatorBase::NavigatorBase):
852         (WebCore::NavigatorBase::serviceWorkerIfAny):
853         (WebCore::NavigatorBase::serviceWorker):
854         * page/NavigatorBase.h:
855
856 2019-04-08  Antti Koivisto  <antti@apple.com>
857
858         Update touch-action region on property changes
859         https://bugs.webkit.org/show_bug.cgi?id=196608
860
861         Reviewed by Simon Fraser.
862
863         Test: pointerevents/ios/touch-action-region-dynamic.html
864
865         * rendering/EventRegion.cpp:
866         (WebCore::EventRegion::touchActionsForPoint const):
867
868         Correctly return 'auto' when nothing is found from the regions (this code is not used yet).
869
870         * rendering/RenderElement.cpp:
871         (WebCore::RenderElement::styleWillChange):
872
873         React to 'touch-action' property changes, similarly to 'pointer-events'.
874
875         * rendering/RenderLayer.cpp:
876         (WebCore::RenderLayer::invalidateEventRegion):
877
878         Test if need to invalidate.
879
880         * rendering/RenderLayerBacking.cpp:
881         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
882         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
883
884         Call invalidateEventRegion explicitly instead of relying on compositing update. This ensures
885         that we update the top level event region correctly when we have touch-actions.
886
887 2019-04-08  Javier Fernandez  <jfernandez@igalia.com>
888
889         Implement white-space:break-spaces value
890         https://bugs.webkit.org/show_bug.cgi?id=177327
891
892         Reviewed by Myles Maxfield and Zalan Bujtas.
893
894         Finally the CSS WG decided [1] to move back the 'break-spaces' value to
895         the 'white-space' property. This makes the parsing logic easier than
896         the previous approach of using the 'overflow-wrap' property.
897
898         This new value prevents the white-space sequence to collapse and gives
899         breaking opportunities after every preserved white-space.
900
901         https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces
902
903         Additionally, unlike 'pre-wrap', non-collapsible spaces or tabs at the
904         end of a line cannot be hung or visually collapsed, since we want them
905         to be preserved and broken.
906
907         [1] https://github.com/w3c/csswg-drafts/pull/2841
908
909         Tests: imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-008.html
910                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-003.html
911                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-009.html
912
913         * css/CSSPrimitiveValueMappings.h:
914         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping for CSSVaueBreakSpaces.
915         (WebCore::CSSPrimitiveValue::operator WhiteSpace const): New value BreakSpaces for the Whitespace enum.
916         * css/CSSProperties.json: new 'break-spaces' value for the 'white-space' property.
917         * css/CSSValueKeywords.in: new break-spaces keyword
918         * css/parser/CSSParserFastPaths.cpp:
919         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
920         * rendering/SimpleLineLayout.cpp:  The SimpleLineLayut codepath must handle properly the new behavior of preserved whitespaces.
921         (WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace const): Require that m_trailingWhitespaceWidth being greater than zero.
922         (WebCore::SimpleLineLayout::LineState::hasWhitespaceFragments const): New function to detect former whitespae fragments that could be breaking opportunities.
923         (WebCore::SimpleLineLayout::removeTrailingWhitespace): The 'break-spaces' feature forbids to remove any trailing whitespace.
924         (WebCore::SimpleLineLayout::firstFragment): We have now leading whitespace sequences comming from the previous line.
925         (WebCore::SimpleLineLayout::createLineRuns): We should revert some breaking opportunities if others were formerly found in the line.
926         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
927         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): New style fields to determine whether the break-space feature is being used. Also split out the break-all and breal-all values.
928         * rendering/SimpleLineLayoutTextFragmentIterator.h:
929         * rendering/line/BreakingContext.h: Different codepath but similar changes to properly handle the new behavior of preserved whitespace.
930         (WebCore::BreakingContext::BreakingContext): New class field to determine whether there are some whitespace that may prevent the word ot be broken.
931         (WebCore::BreakingContext::handleText): New line-breaking logic to implement the break-spaces behavior.
932         (WebCore::BreakingContext::trailingSpacesHang): Cases where the preserved breakspaces should hand or overflow.
933         * rendering/style/RenderStyle.h:
934         (WebCore::RenderStyle::collapseWhiteSpace): With break-spaces collapsing whitespaces is not allowed.
935         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Add the WhiteSpace::BreakSpaces to this group.
936         * rendering/style/RenderStyleConstants.h: A new constan added.
937
938 2019-04-08  Youenn Fablet  <youenn@apple.com>
939
940         LibWebRTCMediaEndpoint does not need to hop to the signaling thread to gather stats
941         https://bugs.webkit.org/show_bug.cgi?id=196697
942         <rdar://problem/47477113>
943
944         Reviewed by Eric Carlson.
945
946         It is not thread safe to use m_backend in another thread than the main thread.
947         It is not useful anymore to hop to the signaling thread to gather stats.
948         No change of behavior.
949
950         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
951         (WebCore::LibWebRTCMediaEndpoint::getStats):
952         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
953
954 2019-04-08  Antoine Quint  <graouts@apple.com>
955
956         [ Mac WK2 iOS Debug ] REGRESSION(r233667) Layout Test imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/constructor.html is a flaky failure
957         https://bugs.webkit.org/show_bug.cgi?id=195233
958         <rdar://problem/48527231>
959
960         Reviewed by Dean Jackson.
961
962         We need to create the "main" document timeline (document.timeline) if it doesn't already exist and use its current time as a basis for any other DocumentTimeline instance.
963
964         * animation/DocumentTimeline.cpp:
965         (WebCore::DocumentTimeline::currentTime):
966
967 2019-04-08  Antoine Quint  <graouts@apple.com>
968
969         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
970         https://bugs.webkit.org/show_bug.cgi?id=196118
971         <rdar://problem/46614137>
972
973         Reviewed by Chris Dumez.
974
975         Test: webanimations/js-wrapper-kept-alive.html
976
977         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.
978         We also need to ensure that the new implementation of hasPendingActivity() does not interfere with the ability of pages to enter the page
979         cache when running animations.
980
981         * animation/WebAnimation.cpp:
982         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
983         (WebCore::WebAnimation::stop):
984         (WebCore::WebAnimation::hasPendingActivity const):
985         * animation/WebAnimation.h:
986
987 2019-04-08  Eric Liang  <ericliang@apple.com>
988
989         AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
990         https://bugs.webkit.org/show_bug.cgi?id=156774
991
992         Reviewed by Chris Fleizach.
993
994         Labelled SVGs without accessible descendants are exposed as AXImage rather than groups.
995
996         Unlabelled equivalents are not exposed. Otherwise, SVGs with accessible descendants are exposed as AXGroup. 
997         Also added back functionalities from last patch of determining whether a SVG element should be ignored.
998         
999         Test: accessibility/svg-shape-labelled.html
1000
1001         * accessibility/AccessibilityRenderObject.cpp:
1002         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
1003         * accessibility/AccessibilitySVGElement.cpp:
1004         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
1005
1006 2019-04-08  Youenn Fablet  <youenn@apple.com>
1007
1008         Make sure UniqueIDBDatabaseConnection unregisters itself even if its database is gone
1009         https://bugs.webkit.org/show_bug.cgi?id=196651
1010
1011         Reviewed by Brady Eidson.
1012
1013         In UniqueIDBDatabase methods, many operations are refing the transaction
1014         so that it stays alive until a quota check decision is made.
1015         This extends the lifetime of the transaction which may be lasting
1016         longer than its database that may be cleared without waiting for the quota check decisions.
1017
1018         We therefore need to make sure that the transaction is cleaning itself correctly at destruction time.
1019
1020         Make sure that the transaction is unregistering itself from its IDBServer.
1021         To do so, the transaction keeps a weak ref to the IDBServer.
1022
1023         This is timing sensitive hence difficult to test.
1024
1025         * Modules/indexeddb/server/IDBServer.h:
1026         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1027         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
1028         Like done below for UniqueIDBDatabaseConnection::didCommitTransaction,
1029         add a check to ensure that either the database is we are in an error case.
1030         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1031         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
1032         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
1033         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1034
1035 2019-04-08  Christopher Reid  <chris.reid@sony.com>
1036
1037         Undefined Behavior: m_experimentalImageMenuEnabled isn't initialized in HTMLImageElement when SERVICE_CONTROLS is disabled
1038         https://bugs.webkit.org/show_bug.cgi?id=196664
1039
1040         Reviewed by Ross Kirsling.
1041
1042         No observable change in behavior.
1043
1044         Initialize m_experimentalImageMenuEnabled regardless of ENABLE(SERVICE_CONTROLS)
1045
1046         * html/HTMLImageElement.cpp:
1047
1048 2019-04-08  Ryan Haddad  <ryanhaddad@apple.com>
1049
1050         Unreviewed, rolling out r243943.
1051
1052         Caused test262 failures.
1053
1054         Reverted changeset:
1055
1056         "[JSC] Filter DontEnum properties in
1057         ProxyObject::getOwnPropertyNames()"
1058         https://bugs.webkit.org/show_bug.cgi?id=176810
1059         https://trac.webkit.org/changeset/243943
1060
1061 2019-04-05  Sergio Villar Senin  <svillar@igalia.com>
1062
1063         [GTK][WPE] outlook.live.com displays old-fashioned UI
1064         https://bugs.webkit.org/show_bug.cgi?id=196642
1065
1066         Reviewed by Carlos Garcia Campos.
1067
1068         The new good looking UI is shown as long as pretend we're a Mac in the UA.
1069
1070         * platform/UserAgentQuirks.cpp:
1071         (WebCore::urlRequiresChromeBrowser):
1072
1073 2019-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1074
1075         [ATK] Cleanup accessible wrapper base class
1076         https://bugs.webkit.org/show_bug.cgi?id=196601
1077
1078         Reviewed by Mario Sanchez Prada.
1079
1080         Cleanups:
1081
1082          - Rename WebKitAccessibleWrapperAtk cpp and header as WebKitAccessible for consistency with the class name.
1083          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
1084            struct are no longer leaked.
1085          - Move core object pointer to the private struct.
1086          - Remove confusing core() function and simply get the core object from the private struct.
1087          - Use nullptr instead of 0 and other coding style issues.
1088          - Rename cacheAndReturnAtkProperty as webkitAccessibleCacheAndReturnAtkProperty and use WebKitAccessible as
1089            instance parameter.
1090          - Make webkitAccessibleGetAccessibilityObject() return a reference, since we use a fallback object on detach it
1091            never returns nullptr.
1092          - Move objectFocusedAndCaretOffsetUnignored() to WebKitAccessibleUtil.
1093
1094         * SourcesGTK.txt:
1095         * accessibility/atk/AXObjectCacheAtk.cpp:
1096         * accessibility/atk/WebKitAccessible.cpp: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp.
1097         (webkitAccessibleGetName):
1098         (webkitAccessibleGetDescription):
1099         (setAtkRelationSetFromCoreObject):
1100         (isRootObject):
1101         (webkitAccessibleGetParent):
1102         (webkitAccessibleGetNChildren):
1103         (webkitAccessibleRefChild):
1104         (webkitAccessibleGetIndexInParent):
1105         (webkitAccessibleGetAttributes):
1106         (atkRole):
1107         (webkitAccessibleGetRole):
1108         (webkitAccessibleRefStateSet):
1109         (webkitAccessibleRefRelationSet):
1110         (webkitAccessibleInit):
1111         (webkitAccessibleGetObjectLocale):
1112         (webkit_accessible_class_init):
1113         (interfaceMaskFromObject):
1114         (uniqueAccessibilityTypeName):
1115         (accessibilityTypeFromObject):
1116         (webkitAccessibleNew):
1117         (webkitAccessibleGetAccessibilityObject):
1118         (webkitAccessibleDetach):
1119         (webkitAccessibleIsDetached):
1120         (webkitAccessibleCacheAndReturnAtkProperty):
1121         * accessibility/atk/WebKitAccessible.h: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.h.
1122         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1123         (core):
1124         * accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
1125         (core):
1126         (webkitAccessibleActionGetKeybinding):
1127         (webkitAccessibleActionGetName):
1128         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1129         (core):
1130         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
1131         (core):
1132         (documentAttributeValue):
1133         * accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
1134         (core):
1135         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
1136         (core):
1137         * accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
1138         (core):
1139         (webkitAccessibleImageGetImageDescription):
1140         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
1141         (core):
1142         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1143         (core):
1144         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
1145         (core):
1146         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1147         (core):
1148         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
1149         (core):
1150         * accessibility/atk/WebKitAccessibleUtil.cpp:
1151         (objectFocusedAndCaretOffsetUnignored):
1152         * accessibility/atk/WebKitAccessibleUtil.h:
1153         * editing/atk/FrameSelectionAtk.cpp:
1154
1155 2019-04-06  Antti Koivisto  <antti@apple.com>
1156
1157         Combine event and touch action regions into a single class
1158         https://bugs.webkit.org/show_bug.cgi?id=196644
1159         <rdar://problem/49643614>
1160
1161         Reviewed by Darin Adler.
1162
1163         This patch replaces the existing TouchActionRegion class with the more general EventRegion class.
1164         It collects both the overall event region and the touch action regions. This avoids duplication
1165         and simplifies the code.
1166
1167         The patch also adds serialization support for EventRegion, so touch-action regions gets passed
1168         to the UI process too.
1169
1170         * Sources.txt:
1171         * WebCore.xcodeproj/project.pbxproj:
1172         * platform/graphics/GraphicsLayer.cpp:
1173         (WebCore::GraphicsLayer::setEventRegion):
1174         (WebCore::GraphicsLayer::dumpProperties const):
1175         (WebCore::GraphicsLayer::setTouchActionRegion): Deleted.
1176         * platform/graphics/GraphicsLayer.h:
1177         (WebCore::GraphicsLayer::eventRegion const):
1178         (WebCore::GraphicsLayer::touchActionRegion const): Deleted.
1179         * platform/graphics/Region.cpp:
1180         (WebCore::operator<<):
1181         * platform/graphics/ca/GraphicsLayerCA.cpp:
1182         (WebCore::GraphicsLayerCA::setEventRegion):
1183         (WebCore::GraphicsLayerCA::setTouchActionRegion): Deleted.
1184         * platform/graphics/ca/GraphicsLayerCA.h:
1185         * platform/graphics/ca/PlatformCALayer.h:
1186         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1187         * rendering/EventRegion.cpp: Copied from Source/WebCore/rendering/TouchActionRegion.cpp.
1188         (WebCore::EventRegion::operator== const):
1189         (WebCore::EventRegion::unite):
1190         (WebCore::EventRegion::translate):
1191         (WebCore::EventRegion::uniteTouchActions):
1192         (WebCore::EventRegion::touchActionsForPoint const):
1193         (WebCore::operator<<):
1194         (WebCore::TouchActionRegion::unite): Deleted.
1195         (WebCore::TouchActionRegion::actionsForPoint const): Deleted.
1196         (WebCore::TouchActionRegion::translate): Deleted.
1197         * rendering/EventRegion.h: Copied from Source/WebCore/rendering/TouchActionRegion.h.
1198         (WebCore::EventRegion::isEmpty const):
1199         (WebCore::EventRegion::contains const):
1200         (WebCore::EventRegion::hasTouchActions const):
1201         (WebCore::EventRegion::encode const):
1202         (WebCore::EventRegion::decode):
1203         (WebCore::TouchActionRegion::isEmpty const): Deleted.
1204         (WebCore::TouchActionRegion::operator== const): Deleted.
1205         * rendering/InlineTextBox.cpp:
1206         (WebCore::InlineTextBox::paint):
1207         * rendering/PaintInfo.h:
1208         * rendering/RenderBlock.cpp:
1209         (WebCore::RenderBlock::paintObject):
1210         * rendering/RenderLayer.cpp:
1211         (WebCore::RenderLayer::collectEventRegionForFragments):
1212         * rendering/RenderLayer.h:
1213         * rendering/RenderLayerBacking.cpp:
1214         (WebCore::RenderLayerBacking::updateEventRegion):
1215         * rendering/RenderLayerModelObject.cpp:
1216         * rendering/SimpleLineLayoutFunctions.cpp:
1217         (WebCore::SimpleLineLayout::paintFlow):
1218         * rendering/TouchActionRegion.cpp: Removed.
1219         * rendering/TouchActionRegion.h: Removed.
1220
1221 2019-04-05  Yongjun Zhang  <yongjun_zhang@apple.com>
1222
1223         We should pass minimumEffectiveDeviceWidth to web process on new page creation.
1224         https://bugs.webkit.org/show_bug.cgi?id=196077
1225         <rdar://problem/49108202>
1226
1227         Reviewed by Chris Dumez.
1228
1229         If the page doesn't specify it requires to use the device width in viewport tag, we should try to scale down
1230         the page to fit the window width.
1231
1232         Test: fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta.html
1233
1234         * page/ViewportConfiguration.cpp:
1235         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Also update the minimum layout size
1236             when the default configuration is changed.
1237         (WebCore::ViewportConfiguration::nativeWebpageParametersWithShrinkToFit): Make sure we fit the content
1238             to window width.
1239
1240 2019-04-05  Jer Noble  <jer.noble@apple.com>
1241
1242         [Cocoa] Deactivate the audio session before the WebProcess suspends.
1243         https://bugs.webkit.org/show_bug.cgi?id=196658
1244
1245         Reviewed by Eric Carlson.
1246
1247         Test: platform/mac/media/audio-session-deactivated-when-suspended.html
1248
1249         Deactivate the audio session when we are notified that the session will suspend.
1250
1251         Drive-by fix: don't try to begin playback when the process is suspended.
1252
1253         * platform/audio/PlatformMediaSessionManager.cpp:
1254         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1255         (WebCore::PlatformMediaSessionManager::processWillSuspend):
1256         (WebCore::PlatformMediaSessionManager::processDidResume):
1257         * platform/audio/PlatformMediaSessionManager.h:
1258         (WebCore::PlatformMediaSessionManager::processIsSuspended const):
1259         * testing/InternalSettings.cpp:
1260         (WebCore::InternalSettings::Backup::Backup):
1261         (WebCore::InternalSettings::Backup::restoreTo):
1262         (WebCore::InternalSettings::setShouldDeactivateAudioSession):
1263         * testing/InternalSettings.h:
1264         * testing/InternalSettings.idl:
1265         * testing/Internals.cpp:
1266         (WebCore::Internals::processWillSuspend):
1267         (WebCore::Internals::processDidResume):
1268         * testing/Internals.h:
1269         * testing/Internals.idl:
1270
1271 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
1272
1273         [iOS] Web process gets suspended while holding locked database files
1274         https://bugs.webkit.org/show_bug.cgi?id=196519
1275         <rdar://problem/49531797>
1276
1277         Reviewed by Chris Dumez.
1278
1279         Don't use DatabaseTracker singleton before it is initialized.
1280
1281         * Modules/webdatabase/DatabaseTracker.cpp:
1282         (WebCore::DatabaseTracker::isInitialized):
1283         * Modules/webdatabase/DatabaseTracker.h:
1284
1285 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
1286
1287         Make WeakPtr<Element> possible and deploy it in form associated elements code
1288         https://bugs.webkit.org/show_bug.cgi?id=196626
1289
1290         Reviewed by Antti Koivisto.
1291
1292         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
1293
1294         No new tests sine there should be no behavioral change.
1295
1296         * dom/Element.h:
1297         * html/FormAssociatedElement.cpp:
1298         (WebCore::FormAssociatedElement::FormAssociatedElement):
1299         (WebCore::FormAssociatedElement::insertedIntoAncestor):
1300         (WebCore::FormAssociatedElement::setForm):
1301         (WebCore::FormAssociatedElement::resetFormOwner):
1302         (WebCore::FormAssociatedElement::formAttributeChanged):
1303         * html/FormAssociatedElement.h:
1304         (WebCore::FormAssociatedElement::form const):
1305         * html/HTMLElement.cpp:
1306         (WebCore::HTMLElement::asFormNamedItem):
1307         (WebCore::HTMLElement::asFormAssociatedElement):
1308         * html/HTMLElement.h:
1309         (WebCore::HTMLElement::asFormNamedItem): Deleted.
1310         * html/HTMLFormControlElement.h:
1311         * html/HTMLFormControlsCollection.cpp:
1312         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
1313         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1314         * html/HTMLFormControlsCollection.h:
1315         * html/HTMLFormElement.cpp:
1316         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
1317         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
1318         (WebCore::HTMLFormElement::registerImgElement):
1319         (WebCore::HTMLFormElement::defaultButton const):
1320         (WebCore::HTMLFormElement::resetDefaultButton):
1321         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
1322         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
1323         * html/HTMLFormElement.h:
1324         * html/HTMLImageElement.cpp:
1325         (WebCore::HTMLImageElement::HTMLImageElement):
1326         (WebCore::HTMLImageElement::insertedIntoAncestor):
1327         * html/HTMLImageElement.h:
1328         * html/HTMLInputElement.h:
1329         * html/HTMLMediaElement.h:
1330         * html/HTMLObjectElement.h:
1331         * html/HTMLPictureElement.h:
1332         * html/HTMLSlotElement.h:
1333         * svg/SVGElement.h:
1334
1335 2019-04-05  Caitlin Potter  <caitp@igalia.com>
1336
1337         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
1338         https://bugs.webkit.org/show_bug.cgi?id=176810
1339
1340         Reviewed by Saam Barati.
1341
1342         Previously, there was a comment here indicating uncertainty of whether it
1343         was necessary to filter DontEnum properties explicitly or not. It turns
1344         out that it was necessary in the case of JSC ProxyObjects.
1345
1346         This patch adds DontEnum filtering for ProxyObjects, however we continue
1347         to explicitly filter them in JSDOMConvertRecord, which needs to use the
1348         property descriptor after filtering. This change prevents observably
1349         fetching the property descriptor twice per property.
1350
1351         * bindings/js/JSDOMConvertRecord.h:
1352
1353 2019-04-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1354
1355         Unreviewed manual rollout of r243929
1356         https://bugs.webkit.org/show_bug.cgi?id=196626
1357
1358         * dom/Element.h:
1359         * html/FormAssociatedElement.cpp:
1360         (WebCore::FormAssociatedElement::FormAssociatedElement):
1361         (WebCore::FormAssociatedElement::insertedIntoAncestor):
1362         (WebCore::FormAssociatedElement::setForm):
1363         (WebCore::FormAssociatedElement::resetFormOwner):
1364         (WebCore::FormAssociatedElement::formAttributeChanged):
1365         * html/FormAssociatedElement.h:
1366         (WebCore::FormAssociatedElement::form const):
1367         * html/HTMLElement.cpp:
1368         (WebCore::HTMLElement::asFormNamedItem): Deleted.
1369         (WebCore::HTMLElement::asFormAssociatedElement): Deleted.
1370         * html/HTMLElement.h:
1371         (WebCore::HTMLElement::asFormNamedItem):
1372         * html/HTMLFormControlElement.h:
1373         * html/HTMLFormControlsCollection.cpp:
1374         (WebCore:: const):
1375         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1376         * html/HTMLFormControlsCollection.h:
1377         * html/HTMLFormElement.cpp:
1378         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
1379         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
1380         (WebCore::HTMLFormElement::registerImgElement):
1381         (WebCore::HTMLFormElement::defaultButton const):
1382         (WebCore::HTMLFormElement::resetDefaultButton):
1383         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
1384         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
1385         * html/HTMLFormElement.h:
1386         * html/HTMLImageElement.cpp:
1387         (WebCore::HTMLImageElement::HTMLImageElement):
1388         (WebCore::HTMLImageElement::insertedIntoAncestor):
1389         * html/HTMLImageElement.h:
1390         * html/HTMLInputElement.h:
1391         * html/HTMLMediaElement.h:
1392         * html/HTMLObjectElement.h:
1393         * html/HTMLPictureElement.h:
1394         * html/HTMLSlotElement.h:
1395         * svg/SVGElement.h:
1396
1397 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
1398
1399         [iOS] Web process gets suspended while holding locked database files
1400         https://bugs.webkit.org/show_bug.cgi?id=196519
1401         <rdar://problem/49531797>
1402
1403         Reviewed by Chris Dumez.
1404
1405         We should close all databases and make sure not open new databases when web process is ready to suspend.
1406
1407         * platform/sql/SQLiteDatabase.cpp:
1408         (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
1409         (WebCore::SQLiteDatabase::open):
1410         * platform/sql/SQLiteDatabase.h:
1411         * platform/sql/SQLiteDatabaseTracker.cpp:
1412         (WebCore::SQLiteDatabaseTracker::setClient):
1413         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
1414         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
1415         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
1416
1417 2019-04-05  Commit Queue  <commit-queue@webkit.org>
1418
1419         Unreviewed, rolling out r243833.
1420         https://bugs.webkit.org/show_bug.cgi?id=196645
1421
1422         This change breaks build of WPE and GTK ports (Requested by
1423         annulen on #webkit).
1424
1425         Reverted changeset:
1426
1427         "[CMake][WTF] Mirror XCode header directories"
1428         https://bugs.webkit.org/show_bug.cgi?id=191662
1429         https://trac.webkit.org/changeset/243833
1430
1431 2019-04-05  David Kilzer  <ddkilzer@apple.com>
1432
1433         REGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>
1434
1435         Caused by:
1436             [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
1437             https://bugs.webkit.org/show_bug.cgi?id=196475
1438
1439         * css/CSSComputedStyleDeclaration.h:
1440         * dom/DOMRectReadOnly.h:
1441         * dom/LiveNodeList.h:
1442         * dom/NodeIterator.h:
1443         * dom/TreeWalker.h:
1444         * fileapi/Blob.h:
1445         * fileapi/File.h:
1446         * fileapi/FileList.h:
1447         * html/CachedHTMLCollection.h:
1448         * html/HTMLFormElement.h:
1449         * html/HTMLNameCollection.h:
1450         * html/canvas/GPUBasedCanvasRenderingContext.h:
1451         * page/RemoteDOMWindow.h:
1452
1453 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
1454
1455         Make WeakPtr<Element> possible and deploy it in form associated elements code
1456         https://bugs.webkit.org/show_bug.cgi?id=196626
1457
1458         Reviewed by Antti Koivisto.
1459
1460         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
1461
1462         No new tests sine there should be no behavioral change.
1463
1464         * dom/Element.h:
1465         * html/FormAssociatedElement.cpp:
1466         (WebCore::FormAssociatedElement::FormAssociatedElement):
1467         (WebCore::FormAssociatedElement::insertedIntoAncestor):
1468         (WebCore::FormAssociatedElement::setForm):
1469         (WebCore::FormAssociatedElement::resetFormOwner):
1470         (WebCore::FormAssociatedElement::formAttributeChanged):
1471         * html/FormAssociatedElement.h:
1472         (WebCore::FormAssociatedElement::form const):
1473         * html/HTMLElement.cpp:
1474         (WebCore::HTMLElement::asFormNamedItem):
1475         (WebCore::HTMLElement::asFormAssociatedElement):
1476         * html/HTMLElement.h:
1477         (WebCore::HTMLElement::asFormNamedItem): Deleted.
1478         * html/HTMLFormControlElement.h:
1479         * html/HTMLFormControlsCollection.cpp:
1480         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
1481         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1482         * html/HTMLFormControlsCollection.h:
1483         * html/HTMLFormElement.cpp:
1484         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
1485         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
1486         (WebCore::HTMLFormElement::registerImgElement):
1487         (WebCore::HTMLFormElement::defaultButton const):
1488         (WebCore::HTMLFormElement::resetDefaultButton):
1489         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
1490         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
1491         * html/HTMLFormElement.h:
1492         * html/HTMLImageElement.cpp:
1493         (WebCore::HTMLImageElement::HTMLImageElement):
1494         (WebCore::HTMLImageElement::insertedIntoAncestor):
1495         * html/HTMLImageElement.h:
1496         * html/HTMLInputElement.h:
1497         * html/HTMLMediaElement.h:
1498         * html/HTMLObjectElement.h:
1499         * html/HTMLPictureElement.h:
1500         * html/HTMLSlotElement.h:
1501         * svg/SVGElement.h:
1502
1503 2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1504
1505         [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
1506         https://bugs.webkit.org/show_bug.cgi?id=196593
1507         <rdar://problem/49599153>
1508
1509         Reviewed by Michael Catanzaro.
1510
1511         We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use
1512         WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be
1513         WebKitAccessible instances. This requires a few casts to AtkObject.
1514
1515         * accessibility/AccessibilityObject.h:
1516         (WebCore::AccessibilityObject::setWrapper):
1517         * accessibility/AccessibilityObjectInterface.h:
1518         * accessibility/atk/AXObjectCacheAtk.cpp:
1519         (WebCore::AXObjectCache::detachWrapper):
1520         (WebCore::AXObjectCache::attachWrapper):
1521         (WebCore::notifyChildrenSelectionChange):
1522         (WebCore::AXObjectCache::postPlatformNotification):
1523         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1524         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
1525         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
1526         * accessibility/atk/AccessibilityObjectAtk.cpp:
1527         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1528         (webkitAccessibleComponentRefAccessibleAtPoint):
1529         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
1530         (webkitAccessibleHypertextGetLink):
1531         (webkitAccessibleHypertextGetNLinks):
1532         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
1533         (webkitAccessibleSelectionRefSelection):
1534         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1535         (webkitAccessibleTableRefAt):
1536         (webkitAccessibleTableGetColumnHeader):
1537         (webkitAccessibleTableGetRowHeader):
1538         (webkitAccessibleTableGetCaption):
1539         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
1540         (convertToGPtrArray):
1541         (webkitAccessibleTableCellGetTable):
1542         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1543         (accessibilityObjectLength):
1544         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1545         (setAtkRelationSetFromCoreObject):
1546         (atkParentOfRootObject):
1547         (webkitAccessibleGetParent):
1548         (webkitAccessibleRefChild):
1549         (isTextWithCaret):
1550         * editing/atk/FrameSelectionAtk.cpp:
1551         (WebCore::emitTextSelectionChange):
1552         (WebCore::maybeEmitTextFocusChange):
1553
1554 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1555
1556         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
1557         https://bugs.webkit.org/show_bug.cgi?id=195584
1558
1559         Reviewed by Zalan Bujtas.
1560
1561         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
1562         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
1563         just as we do for frames.
1564
1565         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
1566
1567         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
1568         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
1569         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
1570         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
1571
1572         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
1573         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
1574         already been put in the right locations, but the UI process needs to know that a scroll happened).
1575         However, we need to prevent notifications from programmatic scrolls getting back to the
1576         web process, because this causes jumpiness. This is done via an early return in
1577         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
1578
1579         Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
1580                scrollingcoordinator/ios/programmatic-page-scroll.html
1581
1582         * page/scrolling/AsyncScrollingCoordinator.cpp:
1583         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1584         * page/scrolling/AsyncScrollingCoordinator.h:
1585         * page/scrolling/ScrollingCoordinator.h:
1586         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
1587         * page/scrolling/ScrollingTree.cpp:
1588         (WebCore::ScrollingTree::commitTreeState):
1589         (WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
1590         * page/scrolling/ScrollingTree.h:
1591         (WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
1592         (WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
1593         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1594         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1595         (WebCore::ScrollingTreeScrollingNode::scrollTo):
1596         * page/scrolling/ScrollingTreeScrollingNode.h:
1597         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1598         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1599         * rendering/RenderLayer.cpp:
1600         (WebCore::RenderLayer::scrollToOffset):
1601         (WebCore::RenderLayer::scrollingNodeID const):
1602         * rendering/RenderLayer.h:
1603         * rendering/RenderMarquee.cpp:
1604         (WebCore::RenderMarquee::timerFired):
1605
1606 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
1607
1608         Unreviewed, speculative fix for build failure
1609         https://bugs.webkit.org/show_bug.cgi?id=196475
1610
1611         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
1612
1613 2019-04-04  Ryosuke Niwa  <rniwa@webkit.org>
1614
1615         Element::isFocusable() debug asserts too frequently
1616         https://bugs.webkit.org/show_bug.cgi?id=196634
1617
1618         Reviewed by Geoffrey Garen.
1619
1620         Remove the debug assertion for now.
1621
1622         * dom/Element.cpp:
1623         (WebCore::Element::isFocusable const):
1624
1625 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1626
1627         Have ScrollableArea store a ScrollType for the current scroll
1628         https://bugs.webkit.org/show_bug.cgi?id=196627
1629
1630         Reviewed by Zalan Bujtas.
1631
1632         RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
1633         so just have ScrollableArea store a ScrollType.
1634
1635         RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
1636         it onto the base class.
1637
1638         AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
1639         incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.
1640
1641         No behavior change.
1642
1643         * page/FrameView.cpp:
1644         (WebCore::FrameView::setFrameRect):
1645         (WebCore::FrameView::topContentInsetDidChange):
1646         (WebCore::FrameView::updateLayoutViewport):
1647         (WebCore::FrameView::setScrollPosition):
1648         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
1649         (WebCore::FrameView::setWasScrolledByUser):
1650         * page/FrameViewLayoutContext.cpp:
1651         (WebCore::LayoutScope::LayoutScope):
1652         (WebCore::LayoutScope::~LayoutScope):
1653         * page/ios/FrameIOS.mm:
1654         (WebCore::Frame::overflowScrollPositionChangedForNode):
1655         * page/scrolling/AsyncScrollingCoordinator.cpp:
1656         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1657         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1658         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1659         * platform/ScrollView.cpp:
1660         (WebCore::ScrollView::setScrollPosition):
1661         * platform/ScrollableArea.cpp:
1662         (WebCore::ScrollableArea::ScrollableArea):
1663         * platform/ScrollableArea.h:
1664         (WebCore::ScrollableArea::currentScrollType const):
1665         (WebCore::ScrollableArea::setCurrentScrollType):
1666         (WebCore::ScrollableArea::setIsUserScroll): Deleted.
1667         (WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
1668         (WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
1669         * rendering/RenderLayer.cpp:
1670         (WebCore::RenderLayer::RenderLayer):
1671         (WebCore::RenderLayer::scrollToXPosition):
1672         (WebCore::RenderLayer::scrollToYPosition):
1673         (WebCore::RenderLayer::scrollToOffset):
1674         (WebCore::RenderLayer::scrollTo):
1675         * rendering/RenderLayer.h:
1676         * rendering/RenderLayerBacking.cpp:
1677         (WebCore::RenderLayerBacking::updateScrollOffset):
1678         * rendering/RenderMarquee.cpp:
1679         (WebCore::RenderMarquee::start):
1680
1681 2019-04-04  Shawn Roberts  <sroberts@apple.com>
1682
1683         Unreviewed, rolling out r243868.
1684
1685         Causing timeouts failures on several queues
1686
1687         Reverted changeset:
1688
1689         "[Web Animations] JS wrapper may be deleted while animation is
1690         yet to dispatch its finish event"
1691         https://bugs.webkit.org/show_bug.cgi?id=196118
1692         https://trac.webkit.org/changeset/243868
1693
1694 2019-04-04  Youenn Fablet  <youenn@apple.com>
1695
1696         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
1697         https://bugs.webkit.org/show_bug.cgi?id=196543
1698
1699         Reviewed by Alex Christensen.
1700
1701         Add a default routine to compute a third party quota from a per origin quota.
1702         No change of behavior.
1703
1704         * storage/StorageQuotaManager.h:
1705         (WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
1706         (WebCore::StorageQuotaManager::defaultThirdPartyQuota):
1707
1708 2019-04-04  Commit Queue  <commit-queue@webkit.org>
1709
1710         Unreviewed, rolling out r243807 and r243824.
1711         https://bugs.webkit.org/show_bug.cgi?id=196611
1712
1713         Test added is a flaky timeout on iOS Simulator, 3 tests
1714         unskipped are flaky failures (Requested by ShawnRoberts on
1715         #webkit).
1716
1717         Reverted changesets:
1718
1719         "Blob type cannot be stored correctly in IDB when
1720         IDBObjectStore has autoIncrement and keyPath options"
1721         https://bugs.webkit.org/show_bug.cgi?id=196128
1722         https://trac.webkit.org/changeset/243807
1723
1724         "Follow up fix for r243807: Use MarkedArgumentBuffer instead
1725         of Vector for JSValue"
1726         https://bugs.webkit.org/show_bug.cgi?id=196547
1727         https://trac.webkit.org/changeset/243824
1728
1729 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1730
1731         Fix rare crash under collectRelatedCoordinatedScrollingNodes()
1732         https://bugs.webkit.org/show_bug.cgi?id=196610
1733         rdar://problem/49595426
1734
1735         Reviewed by Zalan Bujtas.
1736
1737         hasCompositedScrollableOverflow() doesn't check whether a layer is composited (it has
1738         to report the right status before layers have been created), so collectRelatedCoordinatedScrollingNodes()
1739         needs to check whether there's backing.
1740
1741         * rendering/RenderLayerCompositor.cpp:
1742         (WebCore::collectRelatedCoordinatedScrollingNodes):
1743
1744 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1745
1746         Move "inProgrammaticScroll" down to ScrollableArea
1747         https://bugs.webkit.org/show_bug.cgi?id=196614
1748
1749         Reviewed by Zalan Bujtas.
1750
1751         A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
1752         inProgrammaticScroll() down to ScrollableArea.
1753
1754         ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
1755         to reduce confusion. It might be possible to remove this in future with some refactoring.
1756
1757         Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.
1758
1759         * dom/Element.cpp:
1760         (WebCore::Element::setScrollLeft):
1761         (WebCore::Element::setScrollTop):
1762         * page/EventHandler.cpp:
1763         (WebCore::EventHandler::completeWidgetWheelEvent):
1764         (WebCore::EventHandler::handleWheelEvent):
1765         * page/FrameView.cpp:
1766         (WebCore::FrameView::setFrameRect):
1767         (WebCore::FrameView::topContentInsetDidChange):
1768         (WebCore::FrameView::updateLayoutViewport):
1769         (WebCore::FrameView::setScrollPosition):
1770         (WebCore::FrameView::setWasScrolledByUser):
1771         * page/FrameView.h:
1772         * platform/ScrollView.h:
1773         (WebCore::ScrollView::inProgrammaticScroll const): Deleted.
1774         * platform/ScrollableArea.cpp:
1775         (WebCore::ScrollableArea::ScrollableArea):
1776         * platform/ScrollableArea.h:
1777         (WebCore::ScrollableArea::inProgrammaticScroll const):
1778         (WebCore::ScrollableArea::setInProgrammaticScroll):
1779         (WebCore::ScrollableArea::scrollShouldClearLatchedState const):
1780         (WebCore::ScrollableArea::setScrollShouldClearLatchedState):
1781         (WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
1782         (WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.
1783
1784 2019-04-04  Sihui Liu  <sihui_liu@apple.com>
1785
1786         Leak of UniqueIDBDatabase in network process running layout tests
1787         https://bugs.webkit.org/show_bug.cgi?id=196565
1788         <rdar://problem/49346139>
1789
1790         Reviewed by Geoffrey Garen.
1791
1792         UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
1793         is possible that the web process to network process connection closes before servers gets the 
1794         confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a 
1795         conenctionClosedFromClient.
1796
1797         No new test because this bug is caused by race between network receiving conenctionClosedFromClient and 
1798         receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak 
1799         option.
1800
1801         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1802         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
1803         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
1804
1805 2019-04-04  Chris Dumez  <cdumez@apple.com>
1806
1807         Unreviewed, fix iOS build with recent SDKs.
1808
1809         * platform/gamepad/cocoa/GameControllerGamepad.mm:
1810         (WebCore::GameControllerGamepad::GameControllerGamepad):
1811
1812 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
1813
1814         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
1815         https://bugs.webkit.org/show_bug.cgi?id=196555
1816         <rdar://problem/47303865>
1817
1818         Reviewed by Youenn Fablet.
1819
1820         Test: fast/mediastream/media-stream-page-muted.html
1821
1822         * Modules/mediastream/MediaStream.cpp:
1823         (WebCore::MediaStream::MediaStream): Call setCaptureTracksMuted to pass page muted 
1824         state to tracks.
1825         (WebCore::MediaStream::startProducingData): Ditto.
1826         (WebCore::MediaStream::setCaptureTracksMuted): New.
1827         * Modules/mediastream/MediaStream.h:
1828
1829         * Modules/mediastream/MediaStreamTrack.cpp:
1830         (WebCore::MediaStreamTrack::MediaStreamTrack): Call setMuted with page muted state.
1831         (WebCore::MediaStreamTrack::setMuted): Set muted according to page state and source type.
1832         (WebCore::MediaStreamTrack::pageMutedStateDidChange): Call setMuted.
1833         (WebCore::MediaStreamTrack::mediaState const): Update for new page state.
1834         * Modules/mediastream/MediaStreamTrack.h:
1835
1836         * page/MediaProducer.h: Split capture muted state into two: camera/microphone and screen.
1837
1838         * page/Page.h:
1839         (WebCore::Page::isMediaCaptureMuted const): Update for state changes.
1840
1841         * platform/mediastream/MediaStreamPrivate.cpp:
1842         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Deleted.
1843         (WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
1844         * platform/mediastream/MediaStreamPrivate.h:
1845
1846         * platform/mediastream/RealtimeMediaSource.cpp:
1847         (WebCore::RealtimeMediaSource::setMuted): Log state.
1848         (WebCore::RealtimeMediaSource::notifyMutedChange): Call notifyMutedObservers on the
1849         next runloop so events aren't dispatched synchronously.
1850
1851         * testing/Internals.cpp:
1852         (WebCore::Internals::setPageMuted): Add new state.
1853
1854 2019-04-04  Chris Dumez  <cdumez@apple.com>
1855
1856         Unreviewed, update r243884 to use macros in Compiler.h instead.
1857
1858         * platform/ios/LegacyTileGrid.mm:
1859         (WebCore::LegacyTileGrid::dropDistantTiles):
1860
1861 2019-04-04  Chris Fleizach  <cfleizach@apple.com>
1862
1863         AX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
1864         https://bugs.webkit.org/show_bug.cgi?id=196600
1865         <rdar://problem/49572996>
1866
1867         Reviewed by Joanmarie Diggs.
1868
1869         Audit AX code to not dereference renderer before checking if it's null.
1870         Not clear how to reproduce at this time.
1871
1872         * accessibility/AccessibilityRenderObject.cpp:
1873         (WebCore::webAreaIsPresentational):
1874         (WebCore::AccessibilityRenderObject::layoutCount const):
1875         (WebCore::AccessibilityRenderObject::widget const):
1876
1877 2019-04-04  Antti Koivisto  <antti@apple.com>
1878
1879         Compute accurate regions for touch-action
1880         https://bugs.webkit.org/show_bug.cgi?id=196536
1881         <rdar://problem/49516022>
1882
1883         Reviewed by Simon Fraser.
1884
1885         Tests: pointerevents/ios/touch-action-region-basic.html
1886                pointerevents/ios/touch-action-region-layers.html
1887                pointerevents/ios/touch-action-region-pan-x-y.html
1888
1889         - Use style system to compute effective touch-action without additional tree walks.
1890         - Compute touch-action region in a fake paint, at the same time with the event region.
1891
1892         This patch doesn't yet use the computed region for anything except test output.
1893
1894         * Sources.txt:
1895         * WebCore.xcodeproj/project.pbxproj:
1896         * css/StyleResolver.cpp:
1897         (WebCore::computeEffectiveTouchActions):
1898         (WebCore::StyleResolver::adjustRenderStyle):
1899
1900         Update RenderStyle::effectiveTouchAction.
1901
1902         * dom/Element.cpp:
1903         (WebCore::Element::computedTouchActions const):
1904
1905         Just get it from the style.
1906
1907         * platform/graphics/GraphicsLayer.cpp:
1908         (WebCore::GraphicsLayer::setEventRegion):
1909         (WebCore::GraphicsLayer::setTouchActionRegion):
1910         (WebCore::GraphicsLayer::dumpProperties const):
1911         * platform/graphics/GraphicsLayer.h:
1912         (WebCore::GraphicsLayer::touchActionRegion const):
1913         * platform/graphics/ca/GraphicsLayerCA.cpp:
1914         (WebCore::GraphicsLayerCA::setTouchActionRegion):
1915         * platform/graphics/ca/GraphicsLayerCA.h:
1916         * rendering/PaintInfo.h:
1917         * rendering/RenderBlock.cpp:
1918         (WebCore::RenderBlock::paintObject):
1919         * rendering/RenderLayer.cpp:
1920         (WebCore::RenderLayer::collectEventRegionForFragments):
1921         * rendering/RenderLayer.h:
1922         * rendering/RenderLayerBacking.cpp:
1923         (WebCore::RenderLayerBacking::updateConfiguration):
1924
1925         Need to do this for the top compositing layer too.
1926
1927         (WebCore::RenderLayerBacking::updateEventRegion):
1928
1929         Compute touch-action region too.
1930         As a basic optimization avoid doing any extra work if there are no elements with non-default touch-action property.
1931
1932         * rendering/TouchActionRegion.cpp: Added.
1933         (WebCore::toIndex):
1934         (WebCore::toTouchAction):
1935         (WebCore::toString):
1936         (WebCore::TouchActionRegion::unite):
1937         (WebCore::TouchActionRegion::actionsForPoint const):
1938         (WebCore::TouchActionRegion::translate):
1939         (WebCore::operator<<):
1940         * rendering/TouchActionRegion.h: Added.
1941
1942         Class for collecting and maintaining touch-action region.
1943
1944         (WebCore::TouchActionRegion::isEmpty const):
1945         (WebCore::TouchActionRegion::operator== const):
1946         * rendering/style/RenderStyle.h:
1947         (WebCore::RenderStyle::effectiveTouchActions const):
1948         (WebCore::RenderStyle::setEffectiveTouchActions):
1949
1950         Implement as inherited property for efficiency (touch-action itself is non-inherited).
1951
1952         * rendering/style/StyleRareInheritedData.cpp:
1953         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1954         (WebCore::StyleRareInheritedData::operator== const):
1955         * rendering/style/StyleRareInheritedData.h:
1956
1957 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
1958
1959         Unreviewed, fix linking error because the build of RTCIceTransport.cpp is handled in Xcode project side accidentally
1960         https://bugs.webkit.org/show_bug.cgi?id=196475
1961
1962         We did not have RTCIceTransport.cpp in Sources.txt.
1963
1964         * WebCore.xcodeproj/project.pbxproj:
1965
1966 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
1967
1968         [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
1969         https://bugs.webkit.org/show_bug.cgi?id=196475
1970
1971         Reviewed by Saam Barati.
1972
1973         This patch puts most of derived classes of ScriptWrappable into IsoHeap. We do not include derived classes of Event simply
1974         because Internal repository code also inherits it. After watching the result of this patch, we will try Event and its derived
1975         classes into IsoHeap too.
1976
1977         This patch makes the following things IsoHeap-allocated. These classes are listed by using lldb python script.
1978
1979             1. DOM collections (HTMLCollection etc.)
1980             2. WebAudio nodes
1981             3. IDB classes
1982             4. FileSystem API classes
1983             5. Canvas contexts
1984             6. WebRTC classses
1985             7. XMLHttpRequest related classes
1986             8. WebSocket related classes
1987             9. Worker and Worklet related classes
1988             10. Other misc classes
1989
1990         * Modules/applepay/ApplePaySession.cpp:
1991         * Modules/applepay/ApplePaySession.h:
1992         * Modules/encryptedmedia/MediaKeySession.cpp:
1993         * Modules/encryptedmedia/MediaKeySession.h:
1994         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1995         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1996         * Modules/entriesapi/DOMFileSystem.cpp:
1997         * Modules/entriesapi/DOMFileSystem.h:
1998         (WebCore::DOMFileSystem::createEntryForFile): Deleted.
1999         (WebCore::DOMFileSystem::name const): Deleted.
2000         * Modules/entriesapi/FileSystemDirectoryEntry.h:
2001         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
2002         * Modules/entriesapi/FileSystemDirectoryReader.h:
2003         * Modules/entriesapi/FileSystemEntry.cpp:
2004         * Modules/entriesapi/FileSystemEntry.h:
2005         * Modules/entriesapi/FileSystemFileEntry.h:
2006         * Modules/geolocation/Geolocation.cpp:
2007         * Modules/geolocation/Geolocation.h:
2008         (WebCore::Geolocation::document const): Deleted.
2009         (WebCore::Geolocation::frame const): Deleted.
2010         (WebCore::Geolocation::resetIsAllowed): Deleted.
2011         (WebCore::Geolocation::isAllowed const): Deleted.
2012         (WebCore::Geolocation::isDenied const): Deleted.
2013         (WebCore::Geolocation::hasListeners const): Deleted.
2014         * Modules/indexeddb/IDBCursor.cpp:
2015         * Modules/indexeddb/IDBCursor.h:
2016         * Modules/indexeddb/IDBCursorWithValue.cpp:
2017         * Modules/indexeddb/IDBCursorWithValue.h:
2018         * Modules/indexeddb/IDBDatabase.cpp:
2019         * Modules/indexeddb/IDBDatabase.h:
2020         (WebCore::IDBDatabase::info const): Deleted.
2021         (WebCore::IDBDatabase::databaseConnectionIdentifier const): Deleted.
2022         (WebCore::IDBDatabase::connectionProxy): Deleted.
2023         (WebCore::IDBDatabase::isClosingOrClosed const): Deleted.
2024         * Modules/indexeddb/IDBKeyRange.cpp:
2025         * Modules/indexeddb/IDBKeyRange.h:
2026         (WebCore::IDBKeyRange::lower const): Deleted.
2027         (WebCore::IDBKeyRange::upper const): Deleted.
2028         (WebCore::IDBKeyRange::lowerOpen const): Deleted.
2029         (WebCore::IDBKeyRange::upperOpen const): Deleted.
2030         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2031         * Modules/indexeddb/IDBOpenDBRequest.h:
2032         * Modules/indexeddb/IDBRequest.cpp:
2033         * Modules/indexeddb/IDBRequest.h:
2034         * Modules/indexeddb/IDBTransaction.cpp:
2035         * Modules/indexeddb/IDBTransaction.h:
2036         (WebCore::IDBTransaction::mode const): Deleted.
2037         (WebCore::IDBTransaction::info const): Deleted.
2038         (WebCore::IDBTransaction::database): Deleted.
2039         (WebCore::IDBTransaction::database const): Deleted.
2040         (WebCore::IDBTransaction::originalDatabaseInfo const): Deleted.
2041         (WebCore::IDBTransaction::isVersionChange const): Deleted.
2042         (WebCore::IDBTransaction::isReadOnly const): Deleted.
2043         (WebCore::IDBTransaction::isFinished const): Deleted.
2044         * Modules/mediarecorder/MediaRecorder.cpp:
2045         * Modules/mediarecorder/MediaRecorder.h:
2046         * Modules/mediasession/MediaRemoteControls.cpp:
2047         * Modules/mediasession/MediaRemoteControls.h:
2048         (WebCore::MediaRemoteControls::create): Deleted.
2049         (WebCore::MediaRemoteControls::previousTrackEnabled const): Deleted.
2050         (WebCore::MediaRemoteControls::nextTrackEnabled const): Deleted.
2051         * Modules/mediasource/MediaSource.cpp:
2052         * Modules/mediasource/MediaSource.h:
2053         * Modules/mediasource/SourceBuffer.cpp:
2054         * Modules/mediasource/SourceBuffer.h:
2055         * Modules/mediasource/SourceBufferList.cpp:
2056         * Modules/mediasource/SourceBufferList.h:
2057         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2058         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
2059         * Modules/mediastream/MediaDeviceInfo.cpp:
2060         * Modules/mediastream/MediaDeviceInfo.h:
2061         (WebCore::MediaDeviceInfo::label const): Deleted.
2062         (WebCore::MediaDeviceInfo::deviceId const): Deleted.
2063         (WebCore::MediaDeviceInfo::groupId const): Deleted.
2064         (WebCore::MediaDeviceInfo::kind const): Deleted.
2065         * Modules/mediastream/MediaDevices.cpp:
2066         * Modules/mediastream/MediaDevices.h:
2067         * Modules/mediastream/MediaStream.cpp:
2068         * Modules/mediastream/MediaStream.h:
2069         * Modules/mediastream/MediaStreamTrack.cpp:
2070         * Modules/mediastream/MediaStreamTrack.h:
2071         * Modules/mediastream/RTCDTMFSender.cpp:
2072         * Modules/mediastream/RTCDTMFSender.h:
2073         * Modules/mediastream/RTCDataChannel.cpp:
2074         * Modules/mediastream/RTCDataChannel.h:
2075         * Modules/mediastream/RTCIceCandidate.cpp:
2076         * Modules/mediastream/RTCIceCandidate.h:
2077         (WebCore::RTCIceCandidate::candidate const): Deleted.
2078         (WebCore::RTCIceCandidate::sdpMid const): Deleted.
2079         (WebCore::RTCIceCandidate::sdpMLineIndex const): Deleted.
2080         (WebCore::RTCIceCandidate::setCandidate): Deleted.
2081         * Modules/mediastream/RTCIceTransport.cpp:
2082         * Modules/mediastream/RTCIceTransport.h:
2083         (WebCore::RTCIceTransport::create): Deleted.
2084         (WebCore::RTCIceTransport::state const): Deleted.
2085         (WebCore::RTCIceTransport::setState): Deleted.
2086         (WebCore::RTCIceTransport::gatheringState const): Deleted.
2087         (WebCore::RTCIceTransport::setGatheringState): Deleted.
2088         (WebCore::RTCIceTransport::RTCIceTransport): Deleted.
2089         * Modules/mediastream/RTCPeerConnection.cpp:
2090         * Modules/mediastream/RTCPeerConnection.h:
2091         * Modules/mediastream/RTCRtpReceiver.cpp:
2092         * Modules/mediastream/RTCRtpReceiver.h:
2093         (WebCore::RTCRtpReceiver::create): Deleted.
2094         (WebCore::RTCRtpReceiver::setBackend): Deleted.
2095         (WebCore::RTCRtpReceiver::getParameters): Deleted.
2096         (WebCore::RTCRtpReceiver::getContributingSources const): Deleted.
2097         (WebCore::RTCRtpReceiver::getSynchronizationSources const): Deleted.
2098         (WebCore::RTCRtpReceiver::track): Deleted.
2099         (WebCore::RTCRtpReceiver::backend): Deleted.
2100         * Modules/mediastream/RTCRtpSender.cpp:
2101         * Modules/mediastream/RTCRtpSender.h:
2102         (WebCore::RTCRtpSender::track): Deleted.
2103         (WebCore::RTCRtpSender::trackId const): Deleted.
2104         (WebCore::RTCRtpSender::trackKind const): Deleted.
2105         (WebCore::RTCRtpSender::mediaStreamIds const): Deleted.
2106         (WebCore::RTCRtpSender::setMediaStreamIds): Deleted.
2107         (WebCore::RTCRtpSender::isStopped const): Deleted.
2108         (WebCore::RTCRtpSender::backend): Deleted.
2109         * Modules/mediastream/RTCRtpTransceiver.cpp:
2110         * Modules/mediastream/RTCRtpTransceiver.h:
2111         (WebCore::RTCRtpTransceiver::create): Deleted.
2112         (WebCore::RTCRtpTransceiver::sender): Deleted.
2113         (WebCore::RTCRtpTransceiver::receiver): Deleted.
2114         (WebCore::RTCRtpTransceiver::iceTransport): Deleted.
2115         (WebCore::RTCRtpTransceiver::backend): Deleted.
2116         * Modules/mediastream/RTCSessionDescription.cpp:
2117         * Modules/mediastream/RTCSessionDescription.h:
2118         (WebCore::RTCSessionDescription::type const): Deleted.
2119         (WebCore::RTCSessionDescription::sdp const): Deleted.
2120         (WebCore::RTCSessionDescription::setSdp): Deleted.
2121         * Modules/notifications/Notification.cpp:
2122         * Modules/notifications/Notification.h:
2123         * Modules/paymentrequest/PaymentRequest.cpp:
2124         * Modules/paymentrequest/PaymentRequest.h:
2125         * Modules/paymentrequest/PaymentResponse.cpp:
2126         * Modules/paymentrequest/PaymentResponse.h:
2127         * Modules/speech/SpeechSynthesisUtterance.cpp:
2128         * Modules/speech/SpeechSynthesisUtterance.h:
2129         * Modules/webaudio/AnalyserNode.cpp:
2130         * Modules/webaudio/AnalyserNode.h:
2131         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2132         * Modules/webaudio/AudioBasicInspectorNode.h:
2133         * Modules/webaudio/AudioBasicProcessorNode.cpp:
2134         * Modules/webaudio/AudioBasicProcessorNode.h:
2135         * Modules/webaudio/AudioBufferSourceNode.cpp:
2136         * Modules/webaudio/AudioBufferSourceNode.h:
2137         * Modules/webaudio/AudioContext.cpp:
2138         * Modules/webaudio/AudioContext.h:
2139         * Modules/webaudio/AudioDestinationNode.cpp:
2140         * Modules/webaudio/AudioDestinationNode.h:
2141         * Modules/webaudio/AudioNode.cpp:
2142         * Modules/webaudio/AudioNode.h:
2143         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2144         * Modules/webaudio/AudioScheduledSourceNode.h:
2145         * Modules/webaudio/BiquadFilterNode.cpp:
2146         * Modules/webaudio/BiquadFilterNode.h:
2147         * Modules/webaudio/ChannelMergerNode.cpp:
2148         * Modules/webaudio/ChannelMergerNode.h:
2149         * Modules/webaudio/ChannelSplitterNode.cpp:
2150         * Modules/webaudio/ChannelSplitterNode.h:
2151         * Modules/webaudio/ConvolverNode.cpp:
2152         * Modules/webaudio/ConvolverNode.h:
2153         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2154         * Modules/webaudio/DefaultAudioDestinationNode.h:
2155         * Modules/webaudio/DelayNode.cpp:
2156         * Modules/webaudio/DelayNode.h:
2157         * Modules/webaudio/DynamicsCompressorNode.cpp:
2158         * Modules/webaudio/DynamicsCompressorNode.h:
2159         * Modules/webaudio/GainNode.cpp:
2160         * Modules/webaudio/GainNode.h:
2161         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2162         * Modules/webaudio/MediaElementAudioSourceNode.h:
2163         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
2164         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
2165         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
2166         * Modules/webaudio/MediaStreamAudioSourceNode.h:
2167         * Modules/webaudio/OfflineAudioContext.cpp:
2168         * Modules/webaudio/OfflineAudioContext.h:
2169         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2170         * Modules/webaudio/OfflineAudioDestinationNode.h:
2171         * Modules/webaudio/OscillatorNode.cpp:
2172         * Modules/webaudio/OscillatorNode.h:
2173         * Modules/webaudio/PannerNode.cpp:
2174         * Modules/webaudio/PannerNode.h:
2175         * Modules/webaudio/ScriptProcessorNode.cpp:
2176         * Modules/webaudio/ScriptProcessorNode.h:
2177         * Modules/webaudio/WaveShaperNode.cpp:
2178         * Modules/webaudio/WaveShaperNode.h:
2179         * Modules/webgpu/GPUCanvasContext.cpp:
2180         * Modules/webgpu/GPUCanvasContext.h:
2181         * Modules/websockets/WebSocket.cpp:
2182         * Modules/websockets/WebSocket.h:
2183         * Modules/webvr/VRDisplay.cpp:
2184         * Modules/webvr/VRDisplay.h:
2185         (WebCore::VRDisplay::isPresenting const): Deleted.
2186         (WebCore::VRDisplay::displayName const): Deleted.
2187         (WebCore::VRDisplay::displayId const): Deleted.
2188         (WebCore::VRDisplay::depthNear const): Deleted.
2189         (WebCore::VRDisplay::setDepthNear): Deleted.
2190         (WebCore::VRDisplay::depthFar const): Deleted.
2191         (WebCore::VRDisplay::setDepthFar): Deleted.
2192         (WebCore::VRDisplay::document): Deleted.
2193         * Sources.txt:
2194         * WebCore.xcodeproj/project.pbxproj:
2195         * animation/CSSAnimation.cpp:
2196         * animation/CSSAnimation.h:
2197         * animation/CSSTransition.cpp:
2198         * animation/CSSTransition.h:
2199         * animation/DeclarativeAnimation.cpp:
2200         * animation/DeclarativeAnimation.h:
2201         * animation/WebAnimation.cpp:
2202         * animation/WebAnimation.h:
2203         * bindings/js/ScriptWrappable.h:
2204         * css/CSSComputedStyleDeclaration.cpp:
2205         * css/CSSComputedStyleDeclaration.h:
2206         * css/CSSStyleDeclaration.cpp:
2207         (): Deleted.
2208         * css/CSSStyleDeclaration.h:
2209         * css/DOMMatrix.h:
2210         * css/DOMMatrixReadOnly.cpp:
2211         * css/DOMMatrixReadOnly.h:
2212         * css/FontFaceSet.cpp:
2213         * css/FontFaceSet.h:
2214         * css/PropertySetCSSStyleDeclaration.cpp:
2215         * css/PropertySetCSSStyleDeclaration.h:
2216         * css/WebKitCSSMatrix.cpp:
2217         * css/WebKitCSSMatrix.h:
2218         * css/typedom/TypedOMCSSImageValue.cpp: Added.
2219         * css/typedom/TypedOMCSSImageValue.h:
2220         * css/typedom/TypedOMCSSNumericValue.cpp: Added.
2221         * css/typedom/TypedOMCSSNumericValue.h:
2222         * css/typedom/TypedOMCSSStyleValue.cpp: Added.
2223         * css/typedom/TypedOMCSSStyleValue.h:
2224         * css/typedom/TypedOMCSSUnitValue.cpp: Added.
2225         * css/typedom/TypedOMCSSUnitValue.h:
2226         * css/typedom/TypedOMCSSUnparsedValue.cpp: Added.
2227         * css/typedom/TypedOMCSSUnparsedValue.h:
2228         * dom/AbortController.cpp:
2229         * dom/AbortController.h:
2230         * dom/AbortSignal.cpp:
2231         * dom/AbortSignal.h:
2232         * dom/AllDescendantsCollection.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
2233         * dom/AllDescendantsCollection.h:
2234         * dom/ChildNodeList.cpp:
2235         * dom/ChildNodeList.h:
2236         * dom/ClassCollection.cpp:
2237         * dom/ClassCollection.h:
2238         * dom/DOMImplementation.cpp:
2239         * dom/DOMImplementation.h:
2240         (WebCore::DOMImplementation::ref): Deleted.
2241         (WebCore::DOMImplementation::deref): Deleted.
2242         (WebCore::DOMImplementation::document): Deleted.
2243         (WebCore::DOMImplementation::hasFeature): Deleted.
2244         * dom/DOMPoint.h:
2245         * dom/DOMPointReadOnly.cpp:
2246         * dom/DOMPointReadOnly.h:
2247         * dom/DOMQuad.cpp:
2248         * dom/DOMQuad.h:
2249         * dom/DOMRect.h:
2250         * dom/DOMRectReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.cpp.
2251         * dom/DOMRectReadOnly.h:
2252         * dom/DataTransferItemList.cpp:
2253         * dom/DataTransferItemList.h:
2254         (WebCore::DataTransferItemList::ref): Deleted.
2255         (WebCore::DataTransferItemList::deref): Deleted.
2256         (WebCore::DataTransferItemList::dataTransfer): Deleted.
2257         (WebCore::DataTransferItemList::hasItems const): Deleted.
2258         (WebCore::DataTransferItemList::items const): Deleted.
2259         * dom/DatasetDOMStringMap.cpp:
2260         * dom/DatasetDOMStringMap.h:
2261         * dom/DocumentParser.h:
2262         * dom/EventTarget.cpp:
2263         * dom/EventTarget.h:
2264         * dom/LiveNodeList.cpp:
2265         * dom/LiveNodeList.h:
2266         * dom/MessageChannel.cpp:
2267         * dom/MessagePort.cpp:
2268         * dom/MessagePort.h:
2269         * dom/NameNodeList.cpp:
2270         * dom/NameNodeList.h:
2271         * dom/NamedNodeMap.cpp:
2272         * dom/NamedNodeMap.h:
2273         (WebCore::NamedNodeMap::NamedNodeMap): Deleted.
2274         (WebCore::NamedNodeMap::element): Deleted.
2275         * dom/NodeIterator.cpp:
2276         * dom/NodeIterator.h:
2277         (WebCore::NodeIterator::detach): Deleted.
2278         (WebCore::NodeIterator::referenceNode const): Deleted.
2279         (WebCore::NodeIterator::pointerBeforeReferenceNode const): Deleted.
2280         * dom/NodeList.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
2281         * dom/NodeList.h:
2282         * dom/NodeRareData.cpp:
2283         * dom/ScriptExecutionContext.cpp:
2284         * dom/SimulatedClick.cpp:
2285         * dom/StaticNodeList.cpp:
2286         * dom/StaticNodeList.h:
2287         * dom/TagCollection.cpp:
2288         * dom/TagCollection.h:
2289         * dom/TreeWalker.cpp:
2290         * dom/TreeWalker.h:
2291         (WebCore::TreeWalker::create): Deleted.
2292         (WebCore::TreeWalker::currentNode): Deleted.
2293         (WebCore::TreeWalker::currentNode const): Deleted.
2294         * fileapi/Blob.cpp:
2295         * fileapi/Blob.h:
2296         * fileapi/File.cpp:
2297         * fileapi/File.h:
2298         * fileapi/FileList.cpp:
2299         * fileapi/FileList.h:
2300         (WebCore::FileList::create): Deleted.
2301         (WebCore::FileList::length const): Deleted.
2302         (WebCore::FileList::isEmpty const): Deleted.
2303         (WebCore::FileList::files const): Deleted.
2304         (WebCore::FileList::file const): Deleted.
2305         (WebCore::FileList::FileList): Deleted.
2306         (WebCore::FileList::append): Deleted.
2307         (WebCore::FileList::clear): Deleted.
2308         * fileapi/FileReader.cpp:
2309         * fileapi/FileReader.h:
2310         * html/CachedHTMLCollection.h:
2311         * html/GenericCachedHTMLCollection.cpp:
2312         * html/GenericCachedHTMLCollection.h:
2313         * html/HTMLAllCollection.cpp:
2314         * html/HTMLAllCollection.h:
2315         * html/HTMLCollection.cpp:
2316         * html/HTMLCollection.h:
2317         * html/HTMLFormControlsCollection.cpp:
2318         * html/HTMLFormControlsCollection.h:
2319         * html/HTMLNameCollection.cpp:
2320         * html/HTMLNameCollection.h:
2321         * html/HTMLOptionsCollection.cpp:
2322         * html/HTMLOptionsCollection.h:
2323         * html/HTMLTableRowsCollection.cpp:
2324         * html/HTMLTableRowsCollection.h:
2325         * html/ImageBitmap.cpp:
2326         * html/ImageBitmap.h:
2327         (WebCore::ImageBitmap::isDetached const): Deleted.
2328         (WebCore::ImageBitmap::buffer): Deleted.
2329         (WebCore::ImageBitmap::originClean const): Deleted.
2330         * html/LabelsNodeList.cpp:
2331         * html/LabelsNodeList.h:
2332         * html/MediaController.cpp:
2333         * html/MediaController.h:
2334         * html/OffscreenCanvas.cpp:
2335         * html/OffscreenCanvas.h:
2336         * html/RadioNodeList.cpp:
2337         * html/RadioNodeList.h:
2338         * html/canvas/CanvasRenderingContext.cpp:
2339         * html/canvas/CanvasRenderingContext.h:
2340         * html/canvas/CanvasRenderingContext2D.cpp:
2341         * html/canvas/CanvasRenderingContext2D.h:
2342         * html/canvas/CanvasRenderingContext2DBase.cpp:
2343         * html/canvas/CanvasRenderingContext2DBase.h:
2344         * html/canvas/GPUBasedCanvasRenderingContext.h:
2345         * html/canvas/ImageBitmapRenderingContext.cpp:
2346         * html/canvas/ImageBitmapRenderingContext.h:
2347         * html/canvas/OffscreenCanvasRenderingContext2D.cpp:
2348         * html/canvas/OffscreenCanvasRenderingContext2D.h:
2349         * html/canvas/PaintRenderingContext2D.cpp:
2350         * html/canvas/PaintRenderingContext2D.h:
2351         * html/canvas/PlaceholderRenderingContext.cpp:
2352         * html/canvas/PlaceholderRenderingContext.h:
2353         * html/canvas/WebGL2RenderingContext.cpp:
2354         * html/canvas/WebGL2RenderingContext.h:
2355         * html/canvas/WebGLRenderingContext.cpp:
2356         * html/canvas/WebGLRenderingContext.h:
2357         * html/canvas/WebGLRenderingContextBase.cpp:
2358         * html/canvas/WebGLRenderingContextBase.h:
2359         * html/track/AudioTrackList.h:
2360         * html/track/DataCue.cpp:
2361         * html/track/DataCue.h:
2362         * html/track/InbandDataTextTrack.cpp:
2363         * html/track/InbandDataTextTrack.h:
2364         * html/track/InbandGenericTextTrack.cpp:
2365         * html/track/InbandGenericTextTrack.h:
2366         * html/track/InbandTextTrack.cpp:
2367         * html/track/InbandTextTrack.h:
2368         * html/track/InbandWebVTTTextTrack.cpp:
2369         * html/track/InbandWebVTTTextTrack.h:
2370         * html/track/LoadableTextTrack.cpp:
2371         * html/track/LoadableTextTrack.h:
2372         * html/track/TextTrack.cpp:
2373         * html/track/TextTrack.h:
2374         * html/track/TextTrackCue.cpp:
2375         * html/track/TextTrackCue.h:
2376         * html/track/TextTrackCueGeneric.cpp:
2377         * html/track/TextTrackCueGeneric.h:
2378         * html/track/TextTrackList.cpp:
2379         * html/track/TextTrackList.h:
2380         * html/track/TrackListBase.cpp:
2381         * html/track/TrackListBase.h:
2382         * html/track/VTTCue.cpp:
2383         * html/track/VTTCue.h:
2384         * html/track/VideoTrackList.h:
2385         * loader/appcache/DOMApplicationCache.cpp:
2386         * loader/appcache/DOMApplicationCache.h:
2387         * page/AbstractDOMWindow.cpp:
2388         * page/AbstractDOMWindow.h:
2389         * page/BarProp.cpp:
2390         * page/BarProp.h:
2391         (WebCore::BarProp::create): Deleted.
2392         * page/DOMWindow.cpp:
2393         * page/DOMWindow.h:
2394         * page/EventSource.cpp:
2395         * page/EventSource.h:
2396         * page/History.cpp:
2397         * page/History.h:
2398         * page/Location.cpp:
2399         * page/Location.h:
2400         (WebCore::Location::create): Deleted.
2401         (WebCore::Location::toString const): Deleted.
2402         * page/Navigator.cpp:
2403         * page/Navigator.h:
2404         * page/Performance.cpp:
2405         * page/Performance.h:
2406         * page/RemoteDOMWindow.cpp:
2407         * page/RemoteDOMWindow.h:
2408         * page/Screen.cpp:
2409         * page/Screen.h:
2410         * page/VisualViewport.cpp:
2411         * page/VisualViewport.h:
2412         * plugins/DOMMimeTypeArray.cpp:
2413         * plugins/DOMMimeTypeArray.h:
2414         (WebCore::DOMMimeTypeArray::create): Deleted.
2415         * plugins/DOMPlugin.cpp:
2416         * plugins/DOMPlugin.h:
2417         (WebCore::DOMPlugin::create): Deleted.
2418         * plugins/DOMPluginArray.cpp:
2419         * plugins/DOMPluginArray.h:
2420         (WebCore::DOMPluginArray::create): Deleted.
2421         * storage/Storage.cpp:
2422         * storage/Storage.h:
2423         (WebCore::Storage::area const): Deleted.
2424         * workers/AbstractWorker.cpp:
2425         * workers/AbstractWorker.h:
2426         * workers/DedicatedWorkerGlobalScope.cpp:
2427         * workers/DedicatedWorkerGlobalScope.h:
2428         * workers/Worker.cpp:
2429         * workers/Worker.h:
2430         * workers/WorkerGlobalScope.cpp:
2431         * workers/WorkerGlobalScope.h:
2432         * workers/service/ServiceWorker.cpp:
2433         * workers/service/ServiceWorker.h:
2434         * workers/service/ServiceWorkerContainer.cpp:
2435         * workers/service/ServiceWorkerContainer.h:
2436         * workers/service/ServiceWorkerGlobalScope.cpp:
2437         * workers/service/ServiceWorkerGlobalScope.h:
2438         * workers/service/ServiceWorkerRegistration.cpp:
2439         * workers/service/ServiceWorkerRegistration.h:
2440         * worklets/PaintWorkletGlobalScope.cpp:
2441         * worklets/PaintWorkletGlobalScope.h:
2442         * worklets/Worklet.cpp:
2443         * worklets/Worklet.h:
2444         * worklets/WorkletGlobalScope.cpp:
2445         * worklets/WorkletGlobalScope.h:
2446         * xml/XMLHttpRequest.cpp:
2447         * xml/XMLHttpRequest.h:
2448         * xml/XMLHttpRequestEventTarget.h:
2449         * xml/XMLHttpRequestUpload.cpp:
2450         * xml/XMLHttpRequestUpload.h:
2451         * xml/XPathParser.cpp:
2452
2453 2019-04-04  Chris Dumez  <cdumez@apple.com>
2454
2455         Unreviewed, fix iOS build with recent SDKs.
2456
2457         std::ptr_fun() is deprecated.
2458
2459         * platform/ios/LegacyTileGrid.mm:
2460         (WebCore::LegacyTileGrid::dropDistantTiles):
2461
2462 2019-04-04  Antoine Quint  <graouts@apple.com>
2463
2464         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
2465         https://bugs.webkit.org/show_bug.cgi?id=196118
2466         <rdar://problem/46614137>
2467
2468         Reviewed by Ryosuke Niwa.
2469
2470         Test: webanimations/js-wrapper-kept-alive.html
2471
2472         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.
2473
2474         * animation/WebAnimation.cpp:
2475         (WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
2476         (WebCore::WebAnimation::hasPendingActivity const):
2477         * animation/WebAnimation.h:
2478
2479 2019-04-04  Miguel Gomez  <magomez@igalia.com>
2480
2481         [GTK][WPE] Use a timer to request the creation of pending tiles
2482         https://bugs.webkit.org/show_bug.cgi?id=196594
2483
2484         Reviewed by Žan Doberšek.
2485
2486         Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
2487         while inside a layer flush.
2488
2489         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2490         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2491         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2492         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2493         (WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
2494         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2495
2496 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2497
2498         [ATK] Wrong index passed to AtkObject::children-changed::add signal in AXObjectCache::attachWrapper()
2499         https://bugs.webkit.org/show_bug.cgi?id=196538
2500
2501         Reviewed by Michael Catanzaro.
2502
2503         In most of the cases the parent is not found, probably because the child is not a direct descendant of the
2504         parent returned by parentObjectUnignored(). We need to handle the case of find() returning notFound.
2505
2506         * accessibility/atk/AXObjectCacheAtk.cpp:
2507         (WebCore::AXObjectCache::attachWrapper): Use -1 as the index when find() returns notFound.
2508
2509 2019-04-03  Timothy Hatcher  <timothy@apple.com>
2510
2511         Update AutoFill field icons to be SVG instead of PNG images.
2512         https://bugs.webkit.org/show_bug.cgi?id=196557
2513         rdar://problem/48292514
2514
2515         Reviewed by Tim Horton.
2516
2517         * css/html.css:
2518         (input::-webkit-credentials-auto-fill-button):
2519         (input::-webkit-contacts-auto-fill-button):
2520         (input::-webkit-credit-card-auto-fill-button):
2521
2522 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
2523
2524         Simplify some "programmaticScroll" code paths
2525         https://bugs.webkit.org/show_bug.cgi?id=196589
2526
2527         Reviewed by Zalan Bujtas.
2528
2529         AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() just returned early if programmaticScroll
2530         was true, so instead, just never call it. This means we can remove the "programmaticScroll" argument from 
2531         scheduleUpdateScrollPositionAfterAsyncScroll(). Also change some callers to use the ScrollType enum
2532         instead of a bool.
2533
2534         Now, ThreadedScrollingTree::scrollingTreeNodeDidScroll() just returns early. Programmatic scrolls
2535         update state on the main thread before updating the scrolling tree, so this makes sense.
2536
2537         * page/scrolling/AsyncScrollingCoordinator.cpp:
2538         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2539         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
2540         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
2541         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2542         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2543         * page/scrolling/AsyncScrollingCoordinator.h:
2544         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
2545         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::matchesUpdateType const):
2546         * page/scrolling/ScrollingCoordinator.cpp:
2547         (WebCore::operator<<):
2548         * page/scrolling/ScrollingCoordinator.h:
2549         (WebCore::ScrollingCoordinator::reconcileScrollingState):
2550         * page/scrolling/ThreadedScrollingTree.cpp:
2551         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2552
2553 2019-04-03  Youenn Fablet  <youenn@apple.com>
2554
2555         Add logging and ASSERTs to investigate issue with VPModuleInitialize
2556         https://bugs.webkit.org/show_bug.cgi?id=196573
2557
2558         Reviewed by Eric Carlson.
2559
2560         Add some ASSERTs.
2561         No change of behavior.
2562
2563         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2564         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2565         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2566
2567 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
2568
2569         Remove some redundant memebers from ScrollingStateFrameScrollingNode
2570         https://bugs.webkit.org/show_bug.cgi?id=196571
2571
2572         Reviewed by Zalan Bujtas.
2573
2574         m_requestedScrollPosition and m_requestedScrollPositionRepresentsProgrammaticScroll were
2575         duplicated on ScrollingStateFrameScrollingNode and ScrollingStateScrollingNode, so
2576         remove them from the derived class.
2577
2578         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2579         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2580         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2581         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2582
2583 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2584
2585         REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
2586         https://bugs.webkit.org/show_bug.cgi?id=196518
2587
2588         Reviewed by Simon Fraser.
2589
2590         r220717 made RenderSVGRect clear its m_path in updateShapeFromElement().
2591
2592         RenderSVGRect tries to optimize its layout and drawing if the rectangle
2593         is not rounded. So it uses the flag m_usePathFallback to know whether to
2594         use m_path or m_innerStrokeRect and m_outerStrokeRect. If the rectangle
2595         is rounded but its boundingSize is empty, m_path will be cleared,
2596         m_innerStrokeRect and m_outerStrokeRect will be recalculated but
2597         m_usePathFallback will not be reset to false. Therefore when calling 
2598         RenderSVGRect::isEmpty(), it will call RenderSVGShape::isEmpty() which
2599         will assert since m_path is null.
2600
2601         Test: svg/animations/animate-rounded-corner-rect-zero-height.svg
2602
2603         * rendering/svg/RenderSVGRect.cpp:
2604         (WebCore::RenderSVGRect::updateShapeFromElement):
2605         Reset m_usePathFallback to false once clearPath() is called.
2606
2607 2019-04-03  Ryosuke Niwa  <rniwa@webkit.org>
2608
2609         Nullptr crash in InlineTextBox::selectionState via TextIndicator::createWithRange
2610         https://bugs.webkit.org/show_bug.cgi?id=196579
2611
2612         Reviewed by Simon Fraser.
2613
2614         Avoid crashing accessing the unengated optional's value in relese builds for now.
2615
2616         Unfortunately, fixing the underlying cause of the selection states of RenderView & RenderObject
2617         getting out out of sync would require a significant re-architecturing of the whole selection
2618         repainting / state managing mechanism.
2619
2620         * rendering/SelectionRangeData.h:
2621         (WebCore::SelectionRangeData::startPosition const):
2622         (WebCore::SelectionRangeData::endPosition const):
2623
2624 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
2625
2626         -apple-trailing-word is needed for browser detection
2627         https://bugs.webkit.org/show_bug.cgi?id=196575
2628
2629         Unreviewed.
2630
2631         This is an unreviewed partial revert of r243819. Turns out there are some websites
2632         which use this property to do browser detection. So, we need to continue to parse
2633         the property, but we don't need the property to do anything.
2634
2635         Test: fast/text/trailing-word-detection.html
2636
2637         * Configurations/FeatureDefines.xcconfig:
2638         * css/CSSComputedStyleDeclaration.cpp:
2639         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2640         * css/CSSPrimitiveValueMappings.h:
2641         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2642         (WebCore::CSSPrimitiveValue::operator TrailingWord const):
2643         * css/CSSProperties.json:
2644         * css/CSSValueKeywords.in:
2645         * css/parser/CSSParserFastPaths.cpp:
2646         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2647         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2648         * rendering/style/RenderStyle.h:
2649         (WebCore::RenderStyle::trailingWord const):
2650         (WebCore::RenderStyle::setTrailingWord):
2651         (WebCore::RenderStyle::initialTrailingWord):
2652         * rendering/style/RenderStyleConstants.h:
2653
2654 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
2655
2656         [CMake][WTF] Mirror XCode header directories
2657         https://bugs.webkit.org/show_bug.cgi?id=191662
2658
2659         Reviewed by Konstantin Tokarev.
2660
2661         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
2662         builds.
2663
2664         * CMakeLists.txt:
2665         * PlatformWin.cmake:
2666
2667 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2668
2669         Remove SVG properties tear-off objects
2670         https://bugs.webkit.org/show_bug.cgi?id=191237
2671
2672         Reviewed by Simon Fraser.
2673
2674         This patch cleans the code from unused SVG sources and get rid off the
2675         remaining SVG properties tear-off objects. Here are more details:
2676
2677         -- Remove the SVGAttributeAnimationController and move its code to the
2678            SVGAnimateElementBase. SVGAttributeAnimationController was introduced
2679            to allow animating the SVG properties whether they are backed by tear
2680            off objects or not. Since there will be no tear off objects anymore,
2681            one animation controller will be needed. But in this case, it will be
2682            better if we make SVGAnimateElementBase is the animation controller
2683            and make it manage the animator directly.
2684
2685         -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual
2686            function SVGElement::attributeOwnerProxy(). Remove also all the
2687            overriding functions attributeOwnerProxy() from all the SVGElements.
2688
2689         -- Remove isKnownAttribute() from all the SVG header files except from 
2690            four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace
2691            and SVGExternalResourcesRequired.
2692
2693         -- Remove all the SVG animated properties classifying functions from
2694            SVGElement. This is now handled by SVGPropertyRegistry.
2695
2696         -- There is no need for the enum AnimatedPropertyType anymore. The SVG
2697            property accessor knows its type, knows how to access it and know what
2698            animator it should be created for it.
2699
2700         * Sources.txt:
2701         * WebCore.xcodeproj/project.pbxproj:
2702         * dom/Element.cpp:
2703         (WebCore::Element::synchronizeAllAttributes const):
2704         (WebCore::Element::synchronizeAttribute const):
2705         (WebCore::Element::fastAttributeLookupAllowed const):
2706         These functions are surprisingly marked 'const'. They were calling 'const'
2707         functions in SVGElement and SVGElement was casting 'this' as non 'const'
2708         before calling the non 'const' functions through the non 'const' 'this'
2709         pointer. Change this by moving the casting to the Element functions.
2710
2711         * rendering/svg/RenderSVGResourceGradient.cpp:
2712         (WebCore::RenderSVGResourceGradient::applyResource):
2713         * rendering/svg/RenderSVGResourcePattern.cpp:
2714         (WebCore::RenderSVGResourcePattern::applyResource):
2715         * svg/SVGAElement.h:
2716         * svg/SVGAltGlyphElement.h:
2717         * svg/SVGAnimateElementBase.cpp:
2718         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
2719         (WebCore::SVGAnimateElementBase::animator const):
2720         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
2721         (WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
2722         (WebCore::SVGAnimateElementBase::setTargetElement):
2723         (WebCore::SVGAnimateElementBase::setAttributeName):
2724         (WebCore::SVGAnimateElementBase::resetAnimation):
2725         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
2726         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
2727         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
2728         (WebCore::SVGAnimateElementBase::resetAnimatedType):
2729         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2730         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
2731         (WebCore::SVGAnimateElementBase::clearAnimatedType):
2732         (WebCore::SVGAnimateElementBase::calculateDistance):
2733         (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted.
2734         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted.
2735         (WebCore::SVGAnimateElementBase::isAdditive const): Deleted.
2736         * svg/SVGAnimateElementBase.h:
2737         (WebCore::SVGAnimateElementBase::animatorIfExists const):
2738         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted.
2739         The order of the functions was changed to resemble the order of running
2740         the animation:
2741           -- Setting the animation range
2742           -- Starting the animation
2743           -- Progressing the animation
2744           -- Applying the the progressed animaVal() to the target element
2745           -- Stopping the animation
2746
2747         * svg/SVGAnimateMotionElement.cpp:
2748         (WebCore::SVGAnimateMotionElement::calculateDistance):
2749         * svg/SVGAnimateMotionElement.h:
2750         * svg/SVGAnimationElement.cpp:
2751         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
2752         (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted.
2753         * svg/SVGAnimationElement.h:
2754         (WebCore::SVGAnimationElement::attributeRegistry): Deleted.
2755         (WebCore::SVGAnimationElement::calculateDistance): Deleted.
2756         * svg/SVGAttributeAnimationController.cpp: Removed.
2757         * svg/SVGAttributeAnimationController.h: Removed.
2758         * svg/SVGAttributeAnimationControllerBase.cpp: Removed.
2759         * svg/SVGAttributeAnimationControllerBase.h: Removed.
2760         * svg/SVGCircleElement.h:
2761         * svg/SVGClipPathElement.h:
2762         * svg/SVGComponentTransferFunctionElement.h:
2763         * svg/SVGCursorElement.h:
2764         * svg/SVGDefsElement.h:
2765         * svg/SVGElement.cpp:
2766         (WebCore::SVGElement::synchronizeAttribute):
2767         (WebCore::SVGElement::synchronizeAllAttributes):
2768         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
2769         (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted.
2770         (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted.
2771         (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
2772         (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
2773         (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted.
2774         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted.
2775         (WebCore::SVGElement::isAnimatableCSSProperty): Deleted.
2776         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted.
2777         * svg/SVGElement.h:
2778         (WebCore::SVGElement::attributeOwnerProxy const): Deleted.
2779         (WebCore::SVGElement::attributeRegistry): Deleted.
2780         (WebCore::SVGElement::synchronizeAttribute): Deleted.
2781         (WebCore::SVGElement::synchronizeAttributes): Deleted.
2782         (WebCore::SVGElement::animatedTypes const): Deleted.
2783         (WebCore::SVGElement::lookupAnimatedProperty const): Deleted.
2784         (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted.
2785         (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted.
2786         (WebCore::SVGElement::isKnownAttribute): Deleted.
2787         * svg/SVGEllipseElement.h:
2788         * svg/SVGExternalResourcesRequired.h:
2789         (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted.
2790         (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted.
2791         * svg/SVGFEBlendElement.h:
2792         * svg/SVGFEColorMatrixElement.h:
2793         * svg/SVGFEComponentTransferElement.h:
2794         * svg/SVGFECompositeElement.h:
2795         * svg/SVGFEConvolveMatrixElement.h:
2796         * svg/SVGFEDiffuseLightingElement.h:
2797         * svg/SVGFEDisplacementMapElement.h:
2798         * svg/SVGFEDropShadowElement.h:
2799         * svg/SVGFEGaussianBlurElement.h:
2800         * svg/SVGFEImageElement.h:
2801         * svg/SVGFELightElement.h:
2802         * svg/SVGFEMergeNodeElement.h:
2803         * svg/SVGFEMorphologyElement.h:
2804         * svg/SVGFEOffsetElement.h:
2805         * svg/SVGFESpecularLightingElement.h:
2806         * svg/SVGFETileElement.h:
2807         * svg/SVGFETurbulenceElement.h:
2808         * svg/SVGFilterElement.h:
2809         * svg/SVGFilterPrimitiveStandardAttributes.h:
2810         (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted.
2811         * svg/SVGFitToViewBox.h:
2812         (WebCore::SVGFitToViewBox::attributeRegistry): Deleted.
2813         * svg/SVGFontElement.h:
2814         * svg/SVGForeignObjectElement.h:
2815         * svg/SVGGElement.h:
2816         * svg/SVGGeometryElement.h:
2817         * svg/SVGGlyphRefElement.h:
2818         * svg/SVGGradientElement.cpp:
2819         (WebCore::SVGGradientElement::svgAttributeChanged):
2820         * svg/SVGGradientElement.h:
2821         (WebCore::SVGGradientElement::attributeRegistry): Deleted.
2822         (WebCore::SVGGradientElement::isKnownAttribute): Deleted.
2823         * svg/SVGGraphicsElement.h:
2824         (WebCore::SVGGraphicsElement::attributeRegistry): Deleted.
2825         * svg/SVGImageElement.h:
2826         * svg/SVGLineElement.h:
2827         * svg/SVGLinearGradientElement.h:
2828         * svg/SVGMPathElement.h:
2829         * svg/SVGMarkerElement.cpp:
2830         * svg/SVGMarkerElement.h:
2831         * svg/SVGMaskElement.h:
2832         * svg/SVGPathElement.h:
2833         * svg/SVGPatternElement.h:
2834         * svg/SVGPolyElement.h:
2835         * svg/SVGRadialGradientElement.h:
2836         * svg/SVGRectElement.h:
2837         * svg/SVGSVGElement.h:
2838         * svg/SVGScriptElement.h:
2839         * svg/SVGStopElement.h:
2840         * svg/SVGSwitchElement.h:
2841         * svg/SVGSymbolElement.h:
2842         * svg/SVGTRefElement.h:
2843         * svg/SVGTests.cpp:
2844         (WebCore::SVGTests::svgAttributeChanged):
2845         (WebCore::SVGTests::attributeRegistry): Deleted.
2846         (WebCore::SVGTests::isKnownAttribute): Deleted.
2847         * svg/SVGTests.h:
2848         * svg/SVGTextContentElement.cpp:
2849         * svg/SVGTextContentElement.h:
2850         (WebCore::SVGTextContentElement::attributeRegistry): Deleted.
2851         * svg/SVGTextPathElement.h:
2852         * svg/SVGTextPositioningElement.h:
2853         (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted.
2854         * svg/SVGURIReference.cpp:
2855         (WebCore::SVGURIReference::SVGURIReference):
2856         (WebCore::SVGURIReference::attributeRegistry): Deleted.
2857         * svg/SVGURIReference.h:
2858         * svg/SVGUseElement.h:
2859         * svg/SVGViewElement.h:
2860         * svg/SVGViewSpec.cpp:
2861         (WebCore::SVGViewSpec::SVGViewSpec):
2862         * svg/SVGViewSpec.h:
2863         * svg/SVGZoomAndPanType.h:
2864         * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed.
2865         * svg/properties/SVGAnimatedPropertyAnimator.h:
2866         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2867         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
2868         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
2869         * svg/properties/SVGAnimatedPropertyTearOff.h: Removed.
2870         * svg/properties/SVGAnimatedPropertyType.h: Removed.
2871
2872         * svg/properties/SVGAnimationAdditiveFunction.h:
2873         (WebCore::SVGAnimationAdditiveFunction::animate):
2874         (WebCore::SVGAnimationAdditiveFunction::progress): Deleted.
2875         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
2876         (WebCore::SVGAnimationLengthListFunction::animate):
2877         (WebCore::SVGAnimationNumberListFunction::animate):
2878         (WebCore::SVGAnimationPointListFunction::animate):
2879         (WebCore::SVGAnimationTransformListFunction::animate):
2880         (WebCore::SVGAnimationLengthListFunction::progress): Deleted.
2881         (WebCore::SVGAnimationNumberListFunction::progress): Deleted.
2882         (WebCore::SVGAnimationPointListFunction::progress): Deleted.
2883         (WebCore::SVGAnimationTransformListFunction::progress): Deleted.
2884         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2885         (WebCore::SVGAnimationAngleFunction::animate):
2886         (WebCore::SVGAnimationColorFunction::animate):
2887         (WebCore::SVGAnimationIntegerFunction::animate):
2888         (WebCore::SVGAnimationLengthFunction::animate):
2889         (WebCore::SVGAnimationNumberFunction::animate):
2890         (WebCore::SVGAnimationPathSegListFunction::animate):
2891         (WebCore::SVGAnimationRectFunction::animate):
2892         (WebCore::SVGAnimationAngleFunction::progress): Deleted.
2893         (WebCore::SVGAnimationColorFunction::progress): Deleted.
2894         (WebCore::SVGAnimationIntegerFunction::progress): Deleted.
2895         (WebCore::SVGAnimationLengthFunction::progress): Deleted.
2896         (WebCore::SVGAnimationNumberFunction::progress): Deleted.
2897         (WebCore::SVGAnimationPathSegListFunction::progress): Deleted.
2898         (WebCore::SVGAnimationRectFunction::progress): Deleted.
2899         * svg/properties/SVGAnimationDiscreteFunction.h:
2900         (WebCore::SVGAnimationDiscreteFunction::animate):
2901         (WebCore::SVGAnimationDiscreteFunction::progress): Deleted.
2902         * svg/properties/SVGAnimationFunction.h:
2903         (WebCore::SVGAnimationFunction::calculateDistance const):
2904         -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction
2905            to 'animate()'.
2906         -- Rename the argument 'percentage' of these function to 'progress'
2907         -- Make calculateDistance return Optional<float> so it does not have to
2908            return -1 in case of error.
2909
2910         * svg/properties/SVGAttribute.h: Removed.
2911         * svg/properties/SVGAttributeAccessor.h: Removed.
2912         * svg/properties/SVGAttributeAnimator.h:
2913         (WebCore::SVGAttributeAnimator::calculateDistance const):
2914         * svg/properties/SVGAttributeOwnerProxy.cpp: Removed.
2915         * svg/properties/SVGAttributeOwnerProxy.h: Removed.
2916         * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed.
2917         * svg/properties/SVGAttributeRegistry.h: Removed.
2918         * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed.
2919         * svg/properties/SVGLegacyAnimatedProperty.h: Removed.
2920         * svg/properties/SVGLegacyProperty.h: Removed.
2921         * svg/properties/SVGListProperty.h: Removed.
2922         * svg/properties/SVGListPropertyTearOff.h: Removed.
2923         * svg/properties/SVGPrimitivePropertyAnimator.h:
2924         * svg/properties/SVGProperty.h:
2925         * svg/properties/SVGPropertyAnimator.h:
2926         * svg/properties/SVGPropertyTearOff.h: Removed.
2927         * svg/properties/SVGValuePropertyAnimator.h:
2928         * svg/properties/SVGValuePropertyListAnimator.h:
2929
2930 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
2931
2932         Documents can be destroyed before their CSSFontFaceSet is destroyed
2933         https://bugs.webkit.org/show_bug.cgi?id=195830
2934
2935         Reviewed by Darin Adler.
2936
2937         CSSFontFaceSet has a raw pointer to its owning document. JS can keep the CSSFontFaceSet alive (by using FontFaceSet)
2938         and can destroy the document at any time. When the document is destroyed, the link between the two objects needs to
2939         be severed.
2940
2941         Test: fast/text/font-face-set-destroy-document.html
2942
2943         * css/CSSFontFace.cpp:
2944         (WebCore::CSSFontFace::CSSFontFace):
2945         * css/CSSFontFace.h:
2946         * css/CSSFontFaceSet.cpp:
2947         (WebCore::CSSFontFaceSet::CSSFontFaceSet):
2948         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
2949         * css/CSSFontFaceSet.h:
2950         * css/CSSFontSelector.cpp:
2951         (WebCore::CSSFontSelector::CSSFontSelector):
2952         (WebCore::CSSFontSelector::addFontFaceRule):
2953         * css/CSSFontSelector.h:
2954         * css/FontFace.cpp:
2955         (WebCore::FontFace::FontFace):
2956
2957 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
2958
2959         Follow up fix for r243807: Use MarkedArgumentBuffer instead of Vector for JSValue
2960         https://bugs.webkit.org/show_bug.cgi?id=196547
2961
2962         Reviewed by Geoffrey Garen.
2963
2964         JSValue in Vector could be garbage collected because GC doesn't know Vector memory on C++ heap.
2965
2966         * bindings/js/JSIDBRequestCustom.cpp:
2967         (WebCore::JSIDBRequest::result const):
2968
2969 2019-04-03  Chris Dumez  <cdumez@apple.com>
2970
2971         HTML fragment serialization should not strip whitespace from URL attribute values
2972         https://bugs.webkit.org/show_bug.cgi?id=196551
2973
2974         Reviewed by Ryosuke Niwa.
2975
2976         HTML fragment serialization should not strip whitespace from URL attribute values as per:
2977         - https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-serialisation-algorithm
2978
2979         WebKit was stripping such whitespace, Gecko and Blink are not. Align WebKit with other
2980         browser engines and the specification.
2981
2982         No new tests, rebaselined existing test.
2983
2984         * editing/MarkupAccumulator.cpp:
2985         (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
2986
2987 2019-04-02  Ryosuke Niwa  <rniwa@webkit.org>
2988
2989         Crash in HTMLCanvasElement::createContext2d after the element got adopted to a new document
2990         https://bugs.webkit.org/show_bug.cgi?id=196527
2991
2992         Reviewed by Antti Koivisto.
2993
2994         We need to update CanvasBase::m_scriptExecutionContext when HTMLCanvasElement moves from
2995         one document to another. Fixed the bug by making CanvasBase::scriptExecutionContext make
2996         a virtual function call instead of directly storing a raw pointer. In HTMLCanvasElement,
2997         we use Node::scriptExecutionContext(). Use ContextDestructionObserver in CustomPaintCanvas
2998         and OffscreenCanvas instead of a raw pointer.
2999
3000         Unfortunately, no new tests since there is no reproducible test case.
3001
3002         * html/CanvasBase.cpp:
3003         (WebCore::CanvasBase::CanvasBase):
3004         * html/CanvasBase.h:
3005         (WebCore::CanvasBase::scriptExecutionContext const):
3006         * html/CustomPaintCanvas.cpp:
3007         (WebCore::CustomPaintCanvas::CustomPaintCanvas):
3008         * html/CustomPaintCanvas.h:
3009         * html/HTMLCanvasElement.cpp:
3010         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
3011         * html/HTMLCanvasElement.h:
3012         * html/OffscreenCanvas.cpp:
3013         (WebCore::OffscreenCanvas::OffscreenCanvas):
3014         * html/OffscreenCanvas.h:
3015
3016 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
3017
3018         Remove support for -apple-trailing-word
3019         https://bugs.webkit.org/show_bug.cgi?id=196525
3020
3021         Reviewed by Zalan Bujtas.
3022
3023         This CSS property is nonstandard and not used.
3024
3025         * Configurations/FeatureDefines.xcconfig:
3026         * css/CSSComputedStyleDeclaration.cpp:
3027         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3028         * css/CSSPrimitiveValueMappings.h:
3029         (WebCore::CSSPrimitiveValue::operator TrailingWord const): Deleted.
3030         * css/CSSProperties.json:
3031         * css/CSSValueKeywords.in:
3032         * css/parser/CSSParserFastPaths.cpp:
3033         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3034         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3035         * rendering/SimpleLineLayout.cpp:
3036         (WebCore::SimpleLineLayout::canUseForStyle):
3037         * rendering/SimpleLineLayoutCoverage.cpp:
3038         (WebCore::SimpleLineLayout::printReason):
3039         * rendering/SimpleLineLayoutCoverage.h:
3040         * rendering/line/BreakingContext.h:
3041         (WebCore::BreakingContext::BreakingContext):
3042         (WebCore::BreakingContext::lineBreak):
3043         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
3044         (WebCore::BreakingContext::commitLineBreakClear):
3045         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
3046         (WebCore::BreakingContext::handleBR):
3047         (WebCore::BreakingContext::handleFloat):
3048         (WebCore::BreakingContext::handleText):
3049         (WebCore::BreakingContext::handleEndOfLine):
3050         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Deleted.
3051         (WebCore::BreakingContext::InlineIteratorHistory::push): Deleted.
3052         (WebCore::BreakingContext::InlineIteratorHistory::update): Deleted.
3053         (WebCore::BreakingContext::InlineIteratorHistory::renderer const): Deleted.
3054         (WebCore::BreakingContext::InlineIteratorHistory::offset const): Deleted.
3055         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition const): Deleted.
3056         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator const): Deleted.
3057         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode const): Deleted.
3058         (WebCore::BreakingContext::InlineIteratorHistory::get const): Deleted.
3059         (WebCore::BreakingContext::InlineIteratorHistory::current const): Deleted.
3060         (WebCore::BreakingContext::InlineIteratorHistory::historyLength const): Deleted.
3061         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Deleted.
3062         (WebCore::BreakingContext::InlineIteratorHistory::increment): Deleted.
3063         (WebCore::BreakingContext::InlineIteratorHistory::clear): Deleted.
3064         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Deleted.
3065         * rendering/style/RenderStyle.h:
3066         (WebCore::RenderStyle::trailingWord const): Deleted.
3067         (WebCore::RenderStyle::setTrailingWord): Deleted.
3068         (WebCore::RenderStyle::initialTrailingWord): Deleted.
3069         * rendering/style/RenderStyleConstants.h:
3070         * rendering/style/StyleRareInheritedData.cpp:
3071         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3072         (WebCore::StyleRareInheritedData::operator== const):
3073         * rendering/style/StyleRareInheritedData.h:
3074
3075 2019-04-03  Youenn Fablet  <youenn@apple.com>
3076
3077         Use makePendingActivity in DOMCache
3078         https://bugs.webkit.org/show_bug.cgi?id=196515
3079
3080         Reviewed by Geoffrey Garen.
3081
3082         No change of behavior, just modernizing the code.
3083
3084         * Modules/cache/DOMCache.cpp:
3085         (WebCore::DOMCache::retrieveRecords):
3086         (WebCore::DOMCache::batchDeleteOperation):
3087         (WebCore::DOMCache::batchPutOperation):
3088         * Modules/cache/DOMCacheStorage.cpp:
3089         (WebCore::DOMCacheStorage::match):
3090
3091 2019-04-03  Chris Dumez  <cdumez@apple.com>
3092
3093         [XML Parser] Insert the error message block when stopping parsing and an error occurred
3094         https://bugs.webkit.org/show_bug.cgi?id=196546
3095
3096         Reviewed by Alexey Proskuryakov.
3097
3098         Insert the error message block when stopping parsing and an error occurred. This is based
3099         on the following Blink commit:
3100         - https://chromium.googlesource.com/chromium/src.git/+/565958bc22e2d49fed7af144482c2bf4d416fec5
3101
3102         No new tests, rebaselined existing test.
3103
3104         * xml/parser/XMLDocumentParser.cpp:
3105         (WebCore::XMLDocumentParser::end):
3106         Avoid showing the error message block twice in some cases. No need to ever call
3107         insertErrorMessageBlock() if we're already stopped since stopParsing() already
3108         takes care of doing this.
3109
3110         * xml/parser/XMLDocumentParserLibxml2.cpp:
3111         (WebCore::XMLDocumentParser::stopParsing):
3112         When XMLDocumentParser::stopParsing() is called to stop parsing, call
3113         insertErrorMessageBlock() to insert the <parsererror> element if an error
3114         occurred.
3115
3116 2019-04-03  Youenn Fablet  <youenn@apple.com>
3117
3118         Clear WorkerCacheStorageConnection callbacks on WorkerGlobalScope termination
3119         https://bugs.webkit.org/show_bug.cgi?id=196521
3120
3121         Reviewed by Alex Christensen.
3122
3123         When the worker global scope is preparing for termination,
3124         all ActiveDOMObjects are stopped.
3125         At that time, the completion handlers related to
3126         WorkerCacheStorageConnection should be cleared to be able to free
3127         memory, and as they are now no-op anyway.
3128
3129         We clear the completion handlers once the active DOM objects are stopped
3130         to limit the processing triggered by clearing them.
3131
3132         Introducing a new Stopped error code to handle this case.
3133         Add an assertion so that this error does not surface to JS.
3134
3135         Covered by existing tests.
3136
3137         * Modules/cache/CacheStorageConnection.cpp:
3138         (WebCore::CacheStorageConnection::clearPendingRequests):
3139         * Modules/cache/CacheStorageConnection.h:
3140         * Modules/cache/DOMCacheEngine.cpp:
3141         (WebCore::DOMCacheEngine::errorToException):
3142         * Modules/cache/DOMCacheEngine.h:
3143         * workers/WorkerGlobalScope.cpp:
3144         (WebCore::WorkerGlobalScope::prepareForTermination):
3145         (WebCore::WorkerGlobalScope::stopIndexedDatabase):
3146
3147 2019-04-03  Youenn Fablet  <youenn@apple.com>
3148
3149         Adopt new VCP SPI
3150         https://bugs.webkit.org/show_bug.cgi?id=193357
3151         <rdar://problem/43656651>
3152
3153         Reviewed by Eric Carlson.
3154
3155         Covered by existing tests.
3156
3157         * testing/Internals.cpp:
3158         (WebCore::Internals::supportsVCPEncoder):
3159
3160 2019-04-03  Chris Dumez  <cdumez@apple.com>
3161
3162         Remove legacy webkitRequestAnimationFrame time quirk
3163         https://bugs.webkit.org/show_bug.cgi?id=196458
3164         <rdar://problem/49490207>
3165
3166         Reviewed by Simon Fraser.
3167
3168         Remove legacy webkitRequestAnimationFrame time quirk and log a deprecation
3169         warning whenever webkitRequestAnimationFrame is called.
3170
3171         * dom/ScriptedAnimationController.cpp:
3172         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3173         * page/DOMWindow.cpp:
3174         (WebCore::DOMWindow::requestAnimationFrame):
3175         (WebCore::DOMWindow::webkitRequestAnimationFrame):
3176
3177 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
3178
3179         Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
3180         https://bugs.webkit.org/show_bug.cgi?id=196128
3181
3182         Reviewed by Geoffrey Garen.
3183
3184         If a key is auto-generated, it should become a property of the value object. Network process would perform the 
3185         key injection by deserializing IDBValue into script value, setting the property, serializing the result and 
3186         storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to 
3187         deserialize types including Blob and File.
3188
3189         To solve this issue, we move the key injection to web process and let network process store the original value 
3190         it gets. In this case, when web process asks for some value, network process should return key, value and key 
3191         path so that web process can decide whether it should perform a key injection before returning the result. Note
3192         that the auto-generated key would always be stored as the key in a ObjectStore record.
3193
3194         Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
3195
3196         * Modules/indexeddb/IDBCursor.cpp:
3197         (WebCore::IDBCursor::setGetResult):
3198         * Modules/indexeddb/IDBCursor.h:
3199         (WebCore::IDBCursor::primaryKeyPath):
3200         * Modules/indexeddb/IDBGetAllResult.cpp:
3201         (WebCore::IDBGetAllResult::isolatedCopy):
3202         (WebCore::IDBGetAllResult::addKey):
3203         (WebCore::IDBGetAllResult::addValue):
3204         (WebCore::IDBGetAllResult::keys const):
3205         (WebCore::IDBGetAllResult::values const):
3206         (WebCore::IDBGetAllResult::allBlobFilePaths const):
3207         (WebCore::isolatedCopyOfVariant): Deleted.
3208
3209         * Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
3210         because we only needed to store either key or value before, and now the stored value could be incomplete.
3211         (WebCore::IDBGetAllResult::IDBGetAllResult):
3212         (WebCore::IDBGetAllResult::keyPath const):
3213         (WebCore::IDBGetAllResult::encode const):
3214         (WebCore::IDBGetAllResult::decode):
3215
3216         * Modules/indexeddb/IDBGetResult.cpp:
3217         (WebCore::IDBGetResult::setValue):
3218         * Modules/indexeddb/IDBGetResult.h:
3219         (WebCore::IDBGetResult::IDBGetResult):
3220         (WebCore::IDBGetResult::keyPath const):
3221         * Modules/indexeddb/IDBObjectStore.cpp:
3222         * Modules/indexeddb/IDBRequest.cpp:
3223         (WebCore::IDBRequest::setResult):
3224         (WebCore::IDBRequest::setResultToStructuredClone):
3225         * Modules/indexeddb/IDBRequest.h:
3226         * Modules/indexeddb/IDBTransaction.cpp:
3227         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
3228         (WebCore::IDBTransaction::didGetRecordOnServer):
3229         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3230         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
3231         * Modules/indexeddb/server/MemoryIndex.cpp:
3232         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
3233         (WebCore::IDBServer::MemoryIndex::getAllRecords const):
3234         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
3235         (WebCore::IDBServer::MemoryIndexCursor::currentData):
3236         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3237         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
3238         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
3239         (WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
3240         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
3241         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
3242         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3243         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
3244         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
3245         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3246         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
3247         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
3248         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
3249         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
3250         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
3251         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
3252         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
3253         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3254         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
3255         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3256
3257         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3258         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process. 
3259         UniqueIDBDatabase stores any value it gets from IDBClient.
3260
3261         * Modules/indexeddb/shared/IDBResultData.cpp:
3262         (WebCore::IDBResultData::getResultRef):
3263         * Modules/indexeddb/shared/IDBResultData.h:
3264
3265         * bindings/js/IDBBindingUtilities.cpp:
3266         (WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
3267         return null, but we expect it to return result as long as the property value is the same as target. Therefore, 
3268         we can add an early return here.
3269         (WebCore::createKeyPathArray):
3270
3271         (WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
3272         value gets stored does not include auto-generated key, as we remove the key injection from network process. In 
3273         this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
3274         for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in 
3275         database record, we could use value of that key when we find a match in key path.
3276
3277         (WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is 
3278         probably auto-generated, so we could inject the result key into the result value unconditionally.
3279
3280         * bindings/js/IDBBindingUtilities.h:
3281         * bindings/js/JSIDBCursorWithValueCustom.cpp:
3282         (WebCore::JSIDBCursorWithValue::value const):
3283         * bindings/js/JSIDBRequestCustom.cpp:
3284         (WebCore::JSIDBRequest::result const):
3285
3286 2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3287
3288         Get rid of HTMLInputElement::setEditingValue
3289         https://bugs.webkit.org/show_bug.cgi?id=196402
3290
3291         Reviewed by Darin Adler.
3292
3293         HTMLInputElement::setEditingValue is only used for Epiphany password autofill. We did it
3294         this way because that's what Chrome uses for autofill, but Apple uses
3295         HTMLInputElement::setValueForUser. Let's switch to that instead, then we can get rid of
3296         setEditingValue.
3297
3298         This fixes logging into ting.com after username and password are autofilled by Epiphany.
3299         Before this change, the login would fail unless you first manually edit either the username
3300         or the password field.
3301
3302         * html/HTMLInputElement.cpp:
3303         (WebCore::HTMLInputElement::setEditingValue): Deleted.
3304         * html/HTMLInputElement.h:
3305         * testing/Internals.cpp:
3306         (WebCore::Internals::setEditingValue): Deleted.
3307         * testing/Internals.h:
3308         * testing/Internals.idl:
3309
3310 2019-04-03  Pablo Saavedra  <psaavedra@igalia.com>
3311
3312         Missing includes that were previously provided via UnifiedSources
3313         https://bugs.webkit.org/show_bug.cgi?id=196434
3314
3315         Unreviewed build fix.
3316
3317         * html/InputType.h:
3318
3319 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3320
3321         Introduce and add plumbing for a website policy for meta viewport tag handling
3322         https://bugs.webkit.org/show_bug.cgi?id=196285
3323
3324         Reviewed by Tim Horton.
3325
3326         Add MetaViewportPolicy to DocumentLoader. See WebKit ChangeLog for more detail.
3327
3328         * loader/DocumentLoader.h:
3329         (WebCore::DocumentLoader::metaViewportPolicy const):
3330         (WebCore::DocumentLoader::setMetaViewportPolicy):
3331
3332 2019-04-03  Joseph Pecoraro  <pecoraro@apple.com>
3333
3334         Web Inspector: Remote Inspector indicate callback should always happen on the main thread
3335         https://bugs.webkit.org/show_bug.cgi?id=196513
3336         <rdar://problem/49498284>
3337
3338         Reviewed by Devin Rousso.
3339
3340         * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
3341         (InitWebCoreThreadSystemInterface):
3342
3343 2019-04-02  Simon Fraser  <simon.fraser@apple.com>
3344
3345         REGRESSION (r238266): Exchange 2013 Outlook Web Access displays partially blank page when creating new e-mail
3346         https://bugs.webkit.org/show_bug.cgi?id=196522
3347         rdar://problem/49472941
3348
3349         Reviewed by Zalan Bujtas.
3350
3351         In this content a layer is composited to clip descendants, and has negative z-order children,
3352         so we compute that it "paints into ancestor", and has a foreground layer. This combination doesn't
3353         make sense, and when the layer becomes scrollable, we end up with bad paint phases on layers, and
3354         fail to paint the contents.
3355
3356         Fix by ensuring that a layer has its own backing store if it requires a foreground layer
3357         by virtue of having negative z-order children.
3358
3359         Test: compositing/backing/foreground-layer-no-paints-into-ancestor.html
3360
3361         * rendering/RenderLayerCompositor.cpp:
3362         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
3363
3364 2019-04-02  Timothy Hatcher  <timothy@apple.com>
3365
3366         Cursor count badge reverts to Zero during Drag & Drop of multiple items.
3367         https://bugs.webkit.org/show_bug.cgi?id=196511
3368
3369         Reviewed by Daniel Bates.
3370
3371         * page/DragController.cpp:
3372         (WebCore::DragController::tryDocumentDrag): Don't set m_numberOfItemsToBeAccepted to
3373         zero when dragging to a non-file input element.
3374
3375 2019-04-02  Chris Dumez  <cdumez@apple.com>
3376
3377         HTML Parser: Remove conditional parsing of <noembed> content
3378         https://bugs.webkit.org/show_bug.cgi?id=196514
3379
3380         Reviewed by Geoffrey Garen.
3381
3382         Our HTML Parser has raw text handling for <noembed> content only if plugins are runnable.
3383         However, the HTML specification doesn't ask such behavior [1], and it doesn't match to
3384         our HTML serializer. We should always handle it as raw text.
3385
3386         Blink already made this change in https://chromium-review.googlesource.com/c/1477556.
3387
3388         [1] https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments:noembed
3389
3390         No new tests, updated existing test.
3391
3392         * html/parser/HTMLParserOptions.cpp:
3393         (WebCore::HTMLParserOptions::HTMLParserOptions):
3394         * html/parser/HTMLParserOptions.h:
3395         * html/parser/HTMLTokenizer.cpp:
3396         (WebCore::HTMLTokenizer::updateStateFor):
3397         * html/parser/HTMLTreeBuilder.cpp:
3398         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
3399
3400 2019-04-02  Chris Dumez  <cdumez@apple.com>
3401
3402         XMLHttpRequestUpload's loadstart event not correct initialized
3403         https://bugs.webkit.org/show_bug.cgi?id=196174
3404         <rdar://problem/49191412>
3405
3406         Reviewed by Alex Christensen.
3407
3408         Align progress event firing with the XHR specification.
3409
3410         No new tests, rebaselined existing tests.
3411
3412         * xml/XMLHttpRequest.cpp:
3413         (WebCore::XMLHttpRequest::createRequest):
3414         As per [1], the loadstart event fired on the XMLHttpRequestUpload object should use
3415         loaded=0 and total=`req’s body’s total bytes`.
3416         [1] https://xhr.spec.whatwg.org/#the-send()-method (step 11.2.)
3417
3418         (WebCore::XMLHttpRequest::didSendData):
3419         As per [2], the progress / load / loadend should use loaded=transmitted and total=length.
3420         [2] https://xhr.spec.whatwg.org/#ref-for-process-request-end-of-body (steps 5, 6 and 7)
3421
3422         (WebCore::XMLHttpRequest::didReceiveData):
3423         As per [3], we should fire the readystatechange event *before* the progress event.
3424         This is covered by web-platform-tests/xhr/send-response-event-order.htm which was failing
3425         differently after the other changes in this patch.
3426         [3] https://xhr.spec.whatwg.org/#ref-for-process-response (steps 9.4 and 9.5)
3427
3428         (WebCore::XMLHttpRequest::dispatchErrorEvents):
3429         As per [4], in case of an error, we should fire the provided 'event' and 'loadend' with
3430         loaded=0 and total=0.
3431         [4] https://xhr.spec.whatwg.org/#request-error-steps (steps 7 and 8)
3432
3433         * xml/XMLHttpRequestUpload.cpp:
3434         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
3435         * xml/XMLHttpRequestUpload.h:
3436         Simplify XMLHttpRequestUpload. It no longer needs to store loaded / total as data
3437         members now that they are always passed by the call site. lengthComputable is set
3438         to !!total as [5] says to set it to true if length/total is not 0. 
3439         [5] https://xhr.spec.whatwg.org/#concept-event-fire-progress
3440
3441 2019-04-02  Devin Rousso  <drousso@apple.com>
3442
3443         Web Inspector: Canvas: add support for showing WebGPU contexts
3444         https://bugs.webkit.org/show_bug.cgi?id=196413
3445         <rdar://problem/49438898>
3446
3447         Reviewed by Timothy Hatcher.
3448
3449         Tests: inspector/canvas/create-context-webgpu.html
3450                inspector/canvas/resolveCanvasContext-webgpu.html
3451
3452         * Modules/webgpu/GPUCanvasContext.idl:
3453         * Modules/webgpu/GPUCanvasContext.h:
3454         (WebCore::GPUCanvasContext::canvas const): Added.
3455         * Modules/webgpu/GPUCanvasContext.cpp:
3456         (WebCore::GPUCanvasContext::create):
3457
3458         * testing/InternalSettings.idl:
3459         * testing/InternalSettings.h:
3460         * testing/InternalSettings.cpp:
3461         (WebCore::InternalSettings::setWebGPUEnabled): Added.
3462
3463 2019-04-02  Chris Dumez  <cdumez@apple.com>
3464
3465         [WK2] Add support for Window's beforeprint / afterprint events
3466         https://bugs.webkit.org/show_bug.cgi?id=196478
3467
3468         Reviewed by Alex Christensen.
3469
3470         Add support for Window's beforeprint / afterprint events as per:
3471         - https://html.spec.whatwg.org/#dom-print
3472
3473         Blink and Gecko already support this.
3474
3475         Test: printing/printing-events.html
3476
3477         * dom/EventNames.h:
3478         * html/HTMLAttributeNames.in:
3479         * html/HTMLBodyElement.cpp:
3480         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
3481         * page/Page.cpp:
3482         (WebCore::dispatchPrintEvent):
3483         (WebCore::Page::dispatchBeforePrintEvent):
3484         (WebCore::Page::dispatchAfterPrintEvent):
3485         * page/Page.h:
3486         * page/WindowEventHandlers.idl:
3487
3488 2019-04-02  Zalan Bujtas  <zalan@apple.com>
3489
3490         [ContentChangeObserver] Hover menus do not function on fidelity.com
3491         https://bugs.webkit.org/show_bug.cgi?id=196507
3492         <rdar://problem/49496520>
3493
3494         Reviewed by Simon Fraser.
3495
3496         fidelity.com has 400ms hover intent timer to bring up the main menus.
3497
3498         Test: fast/events/touch/ios/content-observation/400ms-hover-intent.html
3499
3500         * page/ios/ContentChangeObserver.cpp:
3501
3502 2019-04-02  Timothy Hatcher  <timothy@apple.com>
3503
3504         NSAttributedString crashes when encoding text attachment cell for missing image.
3505         https://bugs.webkit.org/show_bug.cgi?id=196504
3506         rdar://problem/49161281
3507
3508         Reviewed by Tim Horton.
3509
3510         Clean up and fix a couple of errors and crashes in the missing image path of our
3511         attributed string converter.
3512
3513         Fixes include:
3514         * Removed manual call to release on a RetainPtr, leading to autorelease pool crash.
3515         * No longer try to load an image that is missing on disk and has long been renamed.
3516         * No longer use a NSTextAttachmentCell in the Mac code path which can't be encoded
3517           for sending to the UIProcess, so it was pretty useless in the web content process.
3518         * Stopped using NSFileWrapper for the missing image so the attachment can contain the
3519           retina versions of the missing image.
3520         * Simplified bundle finding code, since WebCore is assumed to be loaded.
3521         * Fix leak of attachment by adding missing adoptNS().
3522
3523         * editing/cocoa/HTMLConverter.mm:
3524         (HTMLConverter::_addAttachmentForElement): Unify and simplify missing image path.
3525         (_NSFirstPathForDirectoriesInDomains): Deleted.
3526         (_NSSystemLibraryPath): Deleted.
3527         (_webKitBundle): Deleted.
3528
3529 2019-04-02  Chris Dumez  <cdumez@apple.com>
3530
3531         [Fetch API] Allow used body replacement in Request constructor
3532         https://bugs.webkit.org/show_bug.cgi?id=183703
3533         <rdar://problem/49425609>
3534
3535         Reviewed by Youenn Fablet.
3536
3537         Allow used body replacement in Request constructor as per:
3538         - https://github.com/whatwg/fetch/pull/675
3539
3540         No new tests, rebaseline existing test.
3541
3542         * Modules/fetch/FetchRequest.cpp:
3543         (WebCore::FetchRequest::initializeWith):
3544
3545 2019-04-02  Chris Dumez  <cdumez@apple.com>
3546
3547         Unreviewed, rolling out r243551.
3548
3549         Seems to have broken file uploads to SoundCloud
3550
3551         Reverted changeset:
3552
3553         "XMLHttpRequestUpload's loadstart event not correct
3554         initialized"
3555         https://bugs.webkit.org/show_bug.cgi?id=196174
3556         https://trac.webkit.org/changeset/243551
3557
3558 2019-04-02  Justin Fan  <justin_fan@apple.com>
3559
3560         [Web GPU] Implement blend states and color write mask for GPUColorStateDescriptor
3561         https://bugs.webkit.org/show_bug.cgi?id=196474
3562
3563         Reviewed by Myles C. Maxfield.
3564
3565         Blend states and color write masks must now be specified on GPUColorStateDescriptor instead of 
3566         relying on underlying MTLRenderPipelineColorAttachmentDescriptor defaults.
3567
3568         Test: webgpu/blend-triangle-strip.html, webgpu/color-write-mask-triangle-strip.html
3569
3570         * CMakeLists.txt:
3571         * DerivedSources-input.xcfilelist:
3572         * DerivedSources-output.xcfilelist:
3573         * DerivedSources.make:
3574         * Modules/webgpu/GPUBlendDescriptor.idl: 
3575         * Modules/webgpu/GPUColorStateDescriptor.idl:
3576         * Modules/webgpu/GPUColorWriteBits.idl: 
3577         * Sources.txt:
3578         * WebCore.xcodeproj/project.pbxproj:
3579         * bindings/js/WebCoreBuiltinNames.h:
3580         * platform/graphics/gpu/GPUBlendDescriptor.h:
3581         * platform/graphics/gpu/GPUColorStateDescriptor.h:
3582         * platform/graphics/gpu/GPUColorWriteBits.h:
3583         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3584         (WebCore::mtlColorWriteMaskForGPUColorWriteFlags):
3585         (WebCore::mtlBlendOperationForGPUBlendOperation):
3586         (WebCore::mtlBlendFactorForGPUBlendFactor):
3587         (WebCore::setColorStatesForColorAttachmentArray):
3588         (WebCore::tryCreateMtlRenderPipelineState):
3589         (WebCore::trySetColorStatesForColorAttachmentArray): Deleted.
3590
3591 2019-04-02  Zalan Bujtas  <zalan@apple.com>
3592
3593         [ContentChangeObserver] Ignore reconstructed renderers when checking for visibility change
3594         https://bugs.webkit.org/show_bug.cgi?id=196483
3595         <rdar://problem/49288174>
3596
3597         Reviewed by Simon Fraser.
3598
3599         This patch fixes the cases when the content gets reconstructed in a way that existing and visible elements gain
3600         new renderers within one style recalc. We failed to recognize such cases and ended up detecting the newly constructed renderers
3601         as "visible change" thereby triggering hover.
3602
3603         Test: fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html
3604
3605         * page/ios/ContentChangeObserver.cpp:
3606         (WebCore::ContentChangeObserver::renderTreeUpdateDidStart):
3607         (WebCore::ContentChangeObserver::renderTreeUpdateDidFinish):
3608         (WebCore::ContentChangeObserver::reset):
3609         (WebCore::ContentChangeObserver::willDestroyRenderer):
3610         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3611         (WebCore::ContentChangeObserver::RenderTreeUpdateScope::RenderTreeUpdateScope):
3612         (WebCore::ContentChangeObserver::RenderTreeUpdateScope::~RenderTreeUpdateScope):
3613         * page/ios/ContentChangeObserver.h:
3614         (WebCore::ContentChangeObserver::visibleRendererWasDestroyed const):
3615         * rendering/updating/RenderTreeUpdater.cpp:
3616         (WebCore::RenderTreeUpdater::updateRenderTree):
3617         (WebCore::RenderTreeUpdater::tearDownRenderers):
3618
3619 2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
3620
3621         [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
3622         https://bugs.webkit.org/show_bug.cgi?id=182757
3623
3624         Reviewed by Don Olmstead.
3625
3626         No new tests because no behavior changes.
3627
3628         * PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES of
3629         WEBKIT_MAKE_FORWARDING_HEADERS. Added
3630         WebCore_PRIVATE_FRAMEWORK_HEADERS.
3631         * WebCoreMacros.cmake (GENERATE_DOM_NAMES): Added
3632         ${_namespace}ElementTypeHelpers.h to _outputfiles.
3633
3634 2019-04-02  Cathie Chen  <cathiechen@igalia.com>
3635
3636         Update the status of ResizeObserver in features.json.
3637         https://bugs.webkit.org/show_bug.cgi?id=196443
3638
3639         Reviewed by Rob Buis.
3640
3641         * features.json:
3642
3643 2019-04-01  Ryosuke Niwa  <rniwa@webkit.org>
3644
3645         Nullptr crash in Document::open after calling policyChecker().stopCheck()
3646         https://bugs.webkit.org/show_bug.cgi?id=196479
3647
3648         Reviewed by Antti Koivisto.
3649
3650         Added a missing nullptr check in Document::open after calling m_frame->loader().policyChecker().stopCheck()
3651         since it invokes m_willSubmitFormCompletionHandlers in WebKit2, and that could clear m_frame.
3652
3653         Unfortunately, we don't have any reproducible test case.
3654
3655         * dom/Document.cpp:
3656         (WebCore::Document::open):
3657
3658 2019-04-01  Timothy Hatcher  <timothy@apple.com>
3659
3660         Unreviewed build fix.
3661
3662         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3663         (WebCore::createAndStoreMasterKey): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
3664         around SecTrustedApplicationCreateFromPath call.
3665
3666 2019-04-01  Simon Fraser  <simon.fraser@apple.com>
3667
3668         Remove some unused iOS scrolling-related code in Frame
3669         https://bugs.webkit.org/show_bug.cgi?id=196473
3670
3671         Reviewed by Zalan Bujtas.
3672
3673         This code has no callers.
3674
3675         * page/Frame.cpp:
3676         (WebCore::Frame::Frame):
3677         (WebCore::Frame::scrollOverflowLayer): Deleted.
3678         (WebCore::Frame::overflowAutoScrollTimerFired): Deleted.
3679         (WebCore::Frame::startOverflowAutoScroll): Deleted.
3680         (WebCore::Frame::checkOverflowScroll): Deleted.
3681         * page/Frame.h:
3682
3683 2019-04-01  Chris Dumez  <cdumez@apple.com>
3684
3685         Attr nodes are not cloned properly
3686         https://bugs.webkit.org/show_bug.cgi?id=196466
3687
3688         Reviewed by Ryosuke Niwa.
3689
3690         Attr nodes are not cloned properly according to:
3691         - https://dom.spec.whatwg.org/#concept-node-clone
3692
3693         A cloned Attr node should retain its prefix and namespace.
3694
3695         Both Gecko and Blink agree with the DOM specification here.
3696
3697         No new tests, rebaselined existing test.
3698
3699         * dom/Document.cpp:
3700         (WebCore::Document::importNode):
3701
3702 2019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3703
3704         Remove the SVG tear off objects for SVGMatrix, SVGTransfrom, SVGTransformList and SVGAnimatedTransformList
3705         https://bugs.webkit.org/show_bug.cgi?id=196086
3706
3707         Reviewed by Simon Fraser.
3708
3709         The IDL changes:
3710
3711         SVGTransform.idl:
3712             Remove the NewObject qualifier from matrix attribute. This matches 
3713             the specs: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGTransform.
3714             SVGTransform will internally hold an SVGMatrix. A change in this
3715             SVGMatrix will affect the container SVGTransform.
3716
3717         SVGTransformList.idl:
3718             Remove the NewObject qualifier from consolidate() method. This matches
3719             the specs:
3720             https://www.w3.org/TR/SVG11/coords.html#__svg__SVGTransformList__consolidate
3721             The method consolidate() should return a reference to the first item
3722             in the list after consolidating it.
3723
3724         Code changes:
3725
3726         -- SVGMatrix is now a superclass of SVGValueProperty<AffineTransform>.
3727            No need for SVGMatrixValue since it was wrapper of AffineTransform.
3728
3729         -- SVGTransformValue now holds a Ref<SVGMatrix> member in addition to the
3730            angle and the rotationCenter. Ref<SVGMatrix> is what SVGTransform.matrix
3731            will return. So a change in this matrix will change the owner SVGTransform.
3732
3733         -- SVGTransform is now the owner of SVGMatrix via its SVGTransformValue.
3734
3735         -- SVGTransformList is now a superclass of SVGValuePropertyList<SVGTransform>.
3736            It is responsible for parsing a String to items of SVGTransform.
3737
3738         -- SVGAnimatedTransformList is now defined as SVGAnimatedPropertyList<
3739            SVGTransformList>.
3740
3741         Note the ownership chain of these objects is the following:
3742
3743         -- SVGAnimatedTransformList owns the SVGTransformList via its baseVal 
3744            and animVal members.
3745
3746         -- SVGTransformList owns SVGTransform via its list of items
3747
3748         -- SVGTransform owns SVGMatrix via its SVGTransformValue.
3749
3750            So a change in SVGMatrix will propagate to the owner SVGElement through
3751            the following ownership chain:
3752
3753            SVGMatrix
3754              |_ SVGTransfrom
3755                   |_ SVGTransformList
3756                        |_ SVGAmimatedTransformList
3757                             |_ SVGElement
3758
3759         To get the mechanics of this change right, a new accessor, a new animator
3760         and animation functions are added for the SVGAnimatedTransformList.
3761
3762         -- SVGViewSpec used to hold an SVGAnimatedTransformListAttribute for the
3763         member m_transform although this member should not be animated. See the
3764         comment in the old SVGViewSpec::transform(). This has been changed in this
3765         patch. SVGViewSpec now holds Ref<SVGTransformList> which matches the specs:
3766         https://www.w3.org/TR/SVG11/types.html#InterfaceSVGViewSpec.
3767
3768         * Sources.txt:
3769         * WebCore.xcodeproj/project.pbxproj:
3770         * svg/SVGAnimateElementBase.cpp:
3771         (WebCore::SVGAnimateElementBase::attributeAnimationController):
3772         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
3773         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
3774         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
3775         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
3776         * svg/SVGAnimateElementBase.h:
3777         (WebCore::SVGAnimateElementBase::animateRangeString const):
3778         * svg/SVGAnimateTransformElement.cpp:
3779         (WebCore::SVGAnimateTransformElement::animateRangeString const):
3780         * svg/SVGAnimateTransformElement.h:
3781                 This change is needed because animating the transform attribute can be
3782         written as
3783             <animate ... from="translate(100)" to="translate(200)"/>
3784         or
3785             <animateTransform type="translate" from="100" to="200"/>"
3786         So we need to surround the animation range string with the type qualifier
3787         for animateTransform.
3788
3789         * svg/SVGAnimatedTransformList.cpp: Removed.
3790         * svg/SVGAnimatedTransformList.h: Removed.
3791         * svg/SVGAnimatedType.h: Removed.
3792         * svg/SVGAnimatedTypeAnimator.cpp: Removed.
3793         * svg/SVGAnimatedTypeAnimator.h: Removed.
3794         * svg/SVGAnimationElement.cpp:
3795         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
3796         * svg/SVGAnimationElement.h:
3797         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
3798         (WebCore::SVGAnimationElement::adjustFromToListValues): Deleted.
3799         (WebCore::SVGAnimationElement::animateDiscreteType): Deleted.
3800         These functions were used by SVGLegacyAttributeAnimationController.
3801
3802         * svg/SVGAnimatorFactory.h: Removed.
3803         * svg/SVGExternalResourcesRequired.h:
3804         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
3805         * svg/SVGFEImageElement.h:
3806         * svg/SVGFEMorphologyElement.h:
3807         * svg/SVGFETileElement.h:
3808         * svg/SVGFitToViewBox.h:
3809         (WebCore::SVGFitToViewBox::isKnownAttribute):
3810         * svg/SVGGradientElement.cpp:
3811         (WebCore::SVGGradientElement::SVGGradientElement):
3812         (WebCore::SVGGradientElement::parseAttribute):
3813         (WebCore::SVGGradientElement::registerAttributes): Deleted.
3814         * svg/SVGGradientElement.h:
3815         (WebCore::SVGGradientElement::gradientTransform const):
3816         (WebCore::SVGGradientElement::gradientTransformAnimated):
3817         (WebCore::SVGGradientElement::isKnownAttribute):
3818         * svg/SVGGraphicsElement.cpp:
3819         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
3820         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
3821         (WebCore::SVGGraphicsElement::parseAttribute):
3822         (WebCore::SVGGraphicsElement::svgAttributeChanged):
3823         There is one attribute for this element which is "SVGNames::transformAttr"
3824         So there is no need to check for it twice.
3825
3826         (WebCore::SVGGraphicsElement::registerAttributes): Deleted.
3827         * svg/SVGGraphicsElement.h:
3828         (WebCore::SVGGraphicsElement::transform const):
3829         (WebCore::SVGGraphicsElement::transformAnimated):
3830         (WebCore::SVGGraphicsElement::isKnownAttribute): Deleted.
3831         * svg/SVGLangSpace.cpp:
3832         (WebCore::SVGLangSpace::SVGLangSpace):
3833         (WebCore::SVGLangSpace::xmlspace const):
3834         (WebCore::SVGLangSpace::isKnownAttribute):
3835         (WebCore::SVGLangSpace::svgAttributeChanged):
3836         (WebCore::SVGLangSpace::registerAttributes): Deleted.
3837         * svg/SVGLangSpace.h:
3838         (WebCore::SVGLangSpace::xmllang const):
3839         (WebCore::SVGLangSpace::setXmllang):
3840         (WebCore::SVGLangSpace::setXmlspace):
3841         (WebCore::SVGLangSpace::attributeRegistry): Deleted.
3842         (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
3843         * svg/SVGLegacyAttributeAnimationController.cpp: Removed.
3844         * svg/SVGLegacyAttributeAnimationController.h: Removed.
3845         * svg/SVGLinearGradientElement.cpp:
3846         (WebCore::setGradientAttributes):
3847         * svg/SVGMaskElement.h:
3848         * svg/SVGMatrix.h:
3849         (WebCore::SVGMatrix::create):
3850         (WebCore::SVGMatrix::a const):
3851         (WebCore::SVGMatrix::setA):
3852         (WebCore::SVGMatrix::b const):
3853         (WebCore::SVGMatrix::setB):
3854         (WebCore::SVGMatrix::c const):
3855         (WebCore::SVGMatrix::setC):
3856         (WebCore::SVGMatrix::d const):
3857         (WebCore::SVGMatrix::setD):
3858         (WebCore::SVGMatrix::e const):
3859         (WebCore::SVGMatrix::setE):
3860         (WebCore::SVGMatrix::f const):
3861         (WebCore::SVGMatrix::setF):
3862         (WebCore::SVGMatrix::multiply const):
3863         (WebCore::SVGMatrix::inverse const):
3864         (WebCore::SVGMatrix::translate const):
3865         (WebCore::SVGMatrix::scale const):
3866         (WebCore::SVGMatrix::scaleNonUniform const):
3867         (WebCore::SVGMatrix::rotate const):
3868         (WebCore::SVGMatrix::rotateFromVector const):
3869         (WebCore::SVGMatrix::flipX const):
3870         (WebCore::SVGMatrix::flipY const):
3871         (WebCore::SVGMatrix::skewX const):
3872         (WebCore::SVGMatrix::skewY const):
3873         * svg/SVGPatternElement.cpp:
3874         (WebCore::SVGPatternElement::SVGPatternElement):
3875         (WebCore::SVGPatternElement::parseAttribute):
3876         (WebCore::SVGPatternElement::svgAttributeChanged):
3877         (WebCore::SVGPatternElement::collectPatternAttributes const):
3878         (WebCore::SVGPatternElement::localCoordinateSpaceTransform const):
3879         (WebCore::SVGPatternElement::registerAttributes): Deleted.
3880         * svg/SVGPatternElement.h:
3881         * svg/SVGPoint.h:
3882         (WebCore::SVGPoint::matrixTransform const):
3883         * svg/SVGPolyElement.h:
3884         (WebCore::SVGPolyElement::isKnownAttribute): Deleted.
3885         * svg/SVGRadialGradientElement.cpp:
3886         (WebCore::setGradientAttributes):
3887         * svg/SVGSVGElement.cpp:
3888         (WebCore::SVGSVGElement::createSVGTransform):
3889         (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
3890         (WebCore::SVGSVGElement::viewBoxToViewTransform const):
3891         * svg/SVGTextElement.cpp:
3892         (WebCore::SVGTextElement::animatedLocalTransform const):
3893         * svg/SVGTransform.cpp: Removed.
3894         * svg/SVGTransform.h:
3895         (WebCore::SVGTransform::create):
3896         (WebCore::SVGTransform::~SVGTransform):
3897         (WebCore::SVGTransform::clone const):
3898         (WebCore::SVGTransform::type):
3899         (WebCore::SVGTransform::angle):
3900         (WebCore::SVGTransform::matrix):
3901         (WebCore::SVGTransform::setMatrix):
3902         (WebCore::SVGTransform::setTranslate):
3903         (WebCore::SVGTransform::setScale):
3904         (WebCore::SVGTransform::setRotate):
3905         (WebCore::SVGTransform::setSkewX):
3906         (WebCore::SVGTransform::setSkewY):
3907         (WebCore::SVGTransform::SVGTransform):
3908         * svg/SVGTransform.idl:
3909         * svg/SVGTransformList.h:
3910         * svg/SVGTransformList.idl:
3911         * svg/SVGTransformListValues.cpp: Removed.
3912         * svg/SVGTransformListValues.h: Removed.
3913         * svg/SVGTransformValue.cpp: Removed.
3914         * svg/SVGTransformValue.h:
3915         (WebCore::SVGTransformValue::SVGTransformValue):
3916         (WebCore::SVGTransformValue::operator=):
3917         (WebCore::SVGTransformValue::matrix const):
3918         (WebCore::SVGTransformValue::rotationCenter const):
3919         (WebCore::SVGTransformValue::isValid const):
3920         (WebCore::SVGTransformValue::setMatrix):
3921         (WebCore::SVGTransformValue::matrixDidChange):
3922         (WebCore::SVGTransformValue::translate const):
3923         (WebCore::SVGTransformValue::setTranslate):
3924         (WebCore::SVGTransformValue::scale const):
3925         (WebCore::SVGTransformValue::setScale):
3926         (WebCore::SVGTransformValue::setRotate):
3927         (WebCore::SVGTransformValue::setSkewX):
3928         (WebCore::SVGTransformValue::setSkewY):
3929         (WebCore::SVGTransformValue::valueAsString const):
3930         (WebCore::SVGTransformValue::prefixForTransfromType):
3931         (WebCore::SVGTransformValue::appendNumbers const):
3932         (WebCore::SVGTransformValue::appendMatrix const):
3933         (WebCore::SVGTransformValue::appendTranslate const):
3934         (WebCore::SVGTransformValue::appendScale const):
3935         (WebCore::SVGTransformValue::appendRotate const):
3936         (WebCore::SVGTransformValue::appendSkewX const):
3937         (WebCore::SVGTransformValue::appendSkewY const):
3938         (WebCore::SVGTransformValue::matrix): Deleted.
3939         * svg/SVGTransformable.cpp:
3940         (WebCore::SVGTransformable::parseAndSkipType):
3941         (WebCore::parseAndSkipType): Deleted.
3942         (WebCore::SVGTransformable::parseTransformAttribute): Deleted.
3943         The code of this function was moved to SVGTransformList::parse().
3944
3945         * svg/SVGTransformable.h:
3946         There is no need for enum TransformParsingMode. It was used by 
3947         SVGViewSpec::parseViewSpec() to tell SVGTransformable::parseTransformAttribute()
3948         not to clear the list. SVGTransfromList now has two parse() functions:
3949         one public and the second is private. The public one clear the list
3950         before parsing the input String. The private one just does the parsing.
3951         SVGViewSpec::parseViewSpec() calls the private once since it is a friend
3952         of SVGTransfromList.
3953
3954         * svg/SVGValue.h: Removed.
3955         * svg/SVGViewSpec.cpp:
3956         (WebCore::SVGViewSpec::SVGViewSpec):
3957         (WebCore::SVGViewSpec::reset):
3958         (WebCore::SVGViewSpec::parseViewSpec):
3959         (WebCore::SVGViewSpec::registerAttributes): Deleted.
3960         (WebCore::SVGViewSpec::transform): Deleted.
3961         * svg/SVGViewSpec.h:
3962         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
3963         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
3964         * svg/properties/SVGAnimatedPropertyImpl.h:
3965         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Removed.
3966         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
3967         (WebCore::SVGAnimationTransformListFunction::progress):
3968         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
3969         * svg/properties/SVGAttributeRegistry.h:
3970         * svg/properties/SVGMatrixTearOff.h: Removed.
3971         * svg/properties/SVGPropertyAccessorImpl.h:
3972         * svg/properties/SVGPropertyOwnerRegistry.h:
3973         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
3974
3975 2019-04-01  Devin Rousso  <drousso@apple.com>
3976
3977         Web Inspector: DOMDebugger: breakpoints for attribute modifications still fire when breakpoints are disabled
3978         https://bugs.webkit.org/show_bug.cgi?id=196456
3979         <rdar://problem/49489747>
3980
3981         Reviewed by Joseph Pecoraro.
3982
3983         Test: inspector/dom-debugger/dom-breakpoints.html
3984
3985         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
3986         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
3987         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
3988
3989 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3990
3991         Unable to copy and paste a PDF from Notes into Mail compose body
3992         https://bugs.webkit.org/show_bug.cgi?id=196442
3993         <rdar://problem/48573098>
3994
3995         Reviewed by Tim Horton.
3996
3997         Refactor some logic for inserting attachment elements upon paste or drop. Currently, we only prefer inserting
3998         content as attachment elements if the i