Absolute in stacking-context scroller jiggles when scrolled
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-21  Simon Fraser  <simon.fraser@apple.com>
2
3         Absolute in stacking-context scroller jiggles when scrolled
4         https://bugs.webkit.org/show_bug.cgi?id=196010
5
6         Reviewed by Zalan Bujtas.
7
8         Updating compositing layers after a scroll (in a compositing update on the main thread)
9         failed to traverse to an absolute layer inside a stacking-context overflow:scroll,
10         because the overflow's layer didn't have the "hasCompositingAncestor" bit set on it.
11
12         This happened because childState.subtreeIsCompositing wasn't being set when indirect
13         reasons trigger compositing. So clean up RenderLayerCompositor::computeCompositingRequirements()
14         to set childState.subtreeIsCompositing for "late" compositing decisions, and move the
15         "Subsequent layers in the parent stacking context also need to composite" chunk
16         down to after the last compositing decision has been made.
17
18         Test: compositing/overflow/absolute-in-overflow.html
19
20         * page/scrolling/ScrollingTreeScrollingNode.cpp:
21         (WebCore::ScrollingTreeScrollingNode::scrollTo):
22         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
23         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
24         * rendering/RenderLayerCompositor.cpp:
25         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
26
27 2019-03-21  Zalan Bujtas  <zalan@apple.com>
28
29         [ContentChangeObserver] Start tracking implicit transitions at touchStart
30         https://bugs.webkit.org/show_bug.cgi?id=196051
31         <rdar://problem/49092952>
32
33         Reviewed by Simon Fraser.
34
35         This patch enables transition tracking on touchStart.
36
37         1. Start observing for new transitions at touchStart
38         2. Stop observing at touchEnd
39         3. Check the next style recalc when the transition is finished (at onAnimationEnd we don't yet have the final computed style).
40         4. Remove the tracked transition when it is canceled.
41
42         Tests: fast/events/touch/ios/content-observation/0ms-transition-on-touch-start.html
43                fast/events/touch/ios/content-observation/100ms-transition-on-touch-start.html
44                fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start.html
45                fast/events/touch/ios/content-observation/transition-on-touch-start-and-remove.html
46
47         * page/ios/ContentChangeObserver.cpp:
48         (WebCore::ContentChangeObserver::didAddTransition):
49         (WebCore::ContentChangeObserver::didFinishTransition):
50         (WebCore::ContentChangeObserver::didRemoveTransition):
51         (WebCore::ContentChangeObserver::adjustObservedState):
52         * page/ios/ContentChangeObserver.h:
53         (WebCore::ContentChangeObserver::setShouldObserveTransitions):
54         (WebCore::ContentChangeObserver::clearObservedTransitions):
55         (WebCore::ContentChangeObserver::hasObservedTransition const):
56         (WebCore::ContentChangeObserver::hasPendingActivity const):
57
58 2019-03-21  Zalan Bujtas  <zalan@apple.com>
59
60         [ContentChangeObserver] Track hidden elements only while transitioning.
61         https://bugs.webkit.org/show_bug.cgi?id=196050
62         <rdar://problem/49092037>
63
64         Reviewed by Simon Fraser.
65
66         Use the existing isConsideredHidden() logic to decide whether the current transition should be tracked.
67
68         * page/ios/ContentChangeObserver.cpp:
69         (WebCore::isConsideredHidden):
70         (WebCore::ContentChangeObserver::didAddTransition):
71         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
72         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
73         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Deleted.
74         * page/ios/ContentChangeObserver.h:
75
76 2019-03-21  Zalan Bujtas  <zalan@apple.com>
77
78         [ContentChangeObserver] Add support for observing implicit transitions
79         https://bugs.webkit.org/show_bug.cgi?id=195914
80         <rdar://problem/49091959>
81
82         Reviewed by Simon Fraser.
83
84         This patch is in preparation for observing elements with property "left" implicit transitions.
85
86         This is not a continuous tracking, we are only interested in the start and the end state.
87         The idea here is to register hidden elements only and check if they become visible by
88         the end of the transition (and ignore if the transition gets "canceled").
89
90         * page/animation/AnimationBase.h:
91         * page/animation/ImplicitAnimation.cpp:
92         (WebCore::ImplicitAnimation::ImplicitAnimation):
93         (WebCore::ImplicitAnimation::~ImplicitAnimation):
94         (WebCore::ImplicitAnimation::clear):
95         (WebCore::ImplicitAnimation::onAnimationEnd):
96         * page/animation/ImplicitAnimation.h:
97         * page/ios/ContentChangeObserver.cpp:
98         (WebCore::ContentChangeObserver::didAddTransition):
99         (WebCore::ContentChangeObserver::removeTransitionIfNeeded):
100         (WebCore::ContentChangeObserver::didFinishTransition):
101         (WebCore::ContentChangeObserver::didRemoveTransition):
102         (WebCore::ContentChangeObserver::didInstallDOMTimer):
103         * page/ios/ContentChangeObserver.h:
104         (WebCore::ContentChangeObserver::isObservingTransitions const):
105         (WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
106
107 2019-03-21  Devin Rousso  <drousso@apple.com>
108
109         Web Inspector: Page: lazily create the agent
110         https://bugs.webkit.org/show_bug.cgi?id=195592
111         <rdar://problem/48791916>
112
113         Reviewed by Timothy Hatcher.
114
115         No change in functionality.
116
117         Have more agents save the inspected `Page` so they don't need to access it via the
118         `InspectorPageAgent`. Make some of `InspectorPageAgent`'s functions `static` so other
119         agents can use them without needing to have access to an enabled `InspectorPageAgent`.
120
121         * inspector/InspectorController.cpp:
122         (WebCore::InspectorController::InspectorController):
123         (WebCore::InspectorController::createLazyAgents):
124
125         * inspector/agents/InspectorPageAgent.h:
126         (WebCore::InspectorPageAgent::page): Deleted.
127         * inspector/agents/InspectorPageAgent.cpp:
128         (WebCore::InspectorPageAgent::InspectorPageAgent):
129         (WebCore::InspectorPageAgent::enable):
130         (WebCore::InspectorPageAgent::disable):
131         (WebCore::InspectorPageAgent::reload):
132         (WebCore::InspectorPageAgent::navigate):
133         (WebCore::InspectorPageAgent::overrideSetting):
134         (WebCore::InspectorPageAgent::getCookies):
135         (WebCore::InspectorPageAgent::deleteCookie):
136         (WebCore::InspectorPageAgent::getResourceTree):
137         (WebCore::InspectorPageAgent::searchInResources):
138         (WebCore::InspectorPageAgent::didPaint):
139         (WebCore::InspectorPageAgent::didLayout):
140         (WebCore::InspectorPageAgent::didScroll):
141         (WebCore::InspectorPageAgent::didRecalculateStyle):
142         (WebCore::InspectorPageAgent::setEmulatedMedia):
143         (WebCore::InspectorPageAgent::setForcedAppearance):
144         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
145         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
146         (WebCore::InspectorPageAgent::snapshotNode):
147         (WebCore::InspectorPageAgent::snapshotRect):
148         (WebCore::InspectorPageAgent::archive):
149         (WebCore::InspectorPageAgent::mainFrame): Deleted.
150         (WebCore::InspectorPageAgent::hasIdForFrame const): Deleted.
151
152         * inspector/agents/InspectorApplicationCacheAgent.h:
153         * inspector/agents/InspectorApplicationCacheAgent.cpp:
154         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
155         (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
156         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
157         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
158
159         * inspector/agents/InspectorCanvasAgent.h:
160         * inspector/agents/InspectorCanvasAgent.cpp:
161         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
162         (WebCore::InspectorCanvasAgent::enable):
163
164         * inspector/agents/InspectorDOMStorageAgent.h:
165         * inspector/agents/InspectorDOMStorageAgent.cpp:
166         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
167         (WebCore::InspectorDOMStorageAgent::findStorageArea):
168
169         * inspector/agents/InspectorIndexedDBAgent.h:
170         * inspector/agents/InspectorIndexedDBAgent.cpp:
171         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
172         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
173         (WebCore::InspectorIndexedDBAgent::requestDatabase):
174         (WebCore::InspectorIndexedDBAgent::requestData):
175         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
176
177         * inspector/agents/page/PageDebuggerAgent.h:
178         * inspector/agents/page/PageDebuggerAgent.cpp:
179         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
180         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
181         (WebCore::PageDebuggerAgent::breakpointActionLog):
182         (WebCore::PageDebuggerAgent::injectedScriptForEval):
183
184         * inspector/agents/page/PageNetworkAgent.h:
185         * inspector/agents/page/PageNetworkAgent.cpp:
186         (WebCore::PageNetworkAgent::PageNetworkAgent):
187         (WebCore::PageNetworkAgent::loaderIdentifier):
188         (WebCore::PageNetworkAgent::frameIdentifier):
189         (WebCore::PageNetworkAgent::setResourceCachingDisabled):
190         (WebCore::PageNetworkAgent::scriptExecutionContext):
191
192         * inspector/InspectorInstrumentation.cpp:
193         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
194
195 2019-03-21  Brent Fulgham  <bfulgham@apple.com>
196
197         Hardening: Use WeakPtrs in VideoFullscreenInterface{Mac,AVKit}
198         https://bugs.webkit.org/show_bug.cgi?id=196052
199         <rdar://problem/48778571>
200
201         Reviewed by Eric Carlson.
202
203         The VideoFullscreenInterface{Mac,AVKit} implementations store their fullscreen model
204         and fullscreen change observer members as bare pointers, something we've been working
205         to eliminate.
206         
207         This patch corrects this oversight.
208
209         No new tests since no changes in behavior.
210
211         * platform/cocoa/VideoFullscreenChangeObserver.h:
212         * platform/cocoa/VideoFullscreenModel.h:
213         * platform/ios/VideoFullscreenInterfaceAVKit.h:
214         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
215         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
216         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
217         (VideoFullscreenInterfaceAVKit::presentingViewController):
218         (VideoFullscreenInterfaceAVKit::invalidate):
219         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
220         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
221         (VideoFullscreenInterfaceAVKit::doSetup):
222         * platform/mac/VideoFullscreenInterfaceMac.h:
223         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
224         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
225         * platform/mac/VideoFullscreenInterfaceMac.mm:
226         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel):
227         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
228         (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
229         (WebCore::VideoFullscreenInterfaceMac::invalidate):
230
231 2019-03-21  Megan Gardner  <megan_gardner@apple.com>
232
233         Smart delete for paragraphs.
234         https://bugs.webkit.org/show_bug.cgi?id=195837
235
236         Reviewed by Ryosuke Niwa.
237
238         Remove additional newlines to maintain spacing around paragraphs.
239
240         Tests: editing/pasteboard/smart-delete-paragraph-001.html
241                editing/pasteboard/smart-delete-paragraph-002.html
242                editing/pasteboard/smart-delete-paragraph-003.html
243                editing/pasteboard/smart-delete-paragraph-004.html
244
245         * editing/DeleteSelectionCommand.cpp:
246         (WebCore::isBlankLine):
247         (WebCore::DeleteSelectionCommand::initializePositionData):
248
249 2019-03-21  Cathie Chen  <cathiechen@igalia.com>
250
251         Fixed ContentChangeObserver build error.
252         https://bugs.webkit.org/show_bug.cgi?id=195993
253
254         Reviewed by Rob Buis.
255
256         EWS IOS compiler complains after adding new files in Bug 157743.
257         ContentChangeObserver.h should have forward declaration for Element.
258
259         * page/ios/ContentChangeObserver.cpp:
260         * page/ios/ContentChangeObserver.h:
261
262 2019-03-21  Charlie Turner  <cturner@igalia.com>
263
264         [GStreamer][EME][Clearkey] Take a lock in keys() method
265         https://bugs.webkit.org/show_bug.cgi?id=195900
266
267         Reviewed by Xabier Rodriguez-Calvar.
268
269         This isn't ideal, since we're taking a lock for every frame to
270         decode. But there's no good way around it when keys can be
271         made unavailable at any time via an update() call, so we can't
272         cache key IDs in the decryptor.
273
274         Covered by test imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.https.html
275
276         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
277         (WebCore::CDMInstanceClearKey::keys const): This method is called
278         from GStreamer's decode() method, which runs off the main thread,
279         therefore we need to take a lock.
280         * platform/encryptedmedia/clearkey/CDMClearKey.h:
281
282 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
283
284         [GTK][WPE] Add API to provide geolocation information
285         https://bugs.webkit.org/show_bug.cgi?id=195940
286
287         Reviewed by Michael Catanzaro.
288
289         Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).
290
291         * PlatformGTK.cmake:
292         * platform/geoclue/GeolocationProviderGeoclue.cpp:
293         * platform/geoclue/GeolocationProviderGeoclue.h:
294         * platform/geoclue/GeolocationProviderGeoclueClient.h:
295
296 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
297
298         [WPE] Confusing messages in stderr when surfaceless context is not supported
299         https://bugs.webkit.org/show_bug.cgi?id=195742
300
301         Reviewed by Žan Doberšek.
302
303         The messages shown are:
304
305         Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
306         Cannot create EGL WPE context: EGL_SUCCESS
307
308         It seems like there's anything wrong, while there isn't. It's also confusing an error message where the error is
309         EGL_SUCCESS. I think we should not show those messages at all, not suporting surfaceless contexts is not an
310         error and it's correctly handled. Failing to get a native window handle from render backend offscreen egl target
311         is not an error either, since most of the backends don't implement the interface (they actually have an empty
312         implementation).
313
314         * platform/graphics/egl/GLContextEGL.cpp:
315         (WebCore::GLContextEGL::createSurfacelessContext): Remove the message when extensions are not present
316         * platform/graphics/egl/GLContextEGLLibWPE.cpp:
317         (WebCore::GLContextEGL::createWPEContext): Handle the case of wpe_renderer_backend_egl_offscreen_target_create()
318         returning nullptr, which can happen if the backend doesn't implement the interface. Move the context creation
319         after the target initialization, to avoid leaking the context when the target doesn't have a native window.
320
321 2019-03-20  Yusuke Suzuki  <ysuzuki@apple.com>
322
323         [JSC] Use finalizer in JSGlobalLexicalEnvironment and JSGlobalObject
324         https://bugs.webkit.org/show_bug.cgi?id=195992
325
326         Reviewed by Keith Miller and Mark Lam.
327
328         Use cellHeapCellType since JSSegmentedVariableObject already set finalizer.
329
330         * bindings/js/WebCoreJSClientData.cpp:
331         (WebCore::JSVMClientData::JSVMClientData):
332
333 2019-03-20  Youenn Fablet  <youenn@apple.com>
334
335         Compute quota after network process restart based on default quota and space used
336         https://bugs.webkit.org/show_bug.cgi?id=195804
337
338         Reviewed by Chris Dumez.
339
340         At creation of quota manager, a default quota will be assigned.
341         This value is the same for all origins.
342         Some origins may have been granted a bigger quota by the user.
343         In that case, the space used might be greater for these origins.
344         Update at initialization time the quota according the space used as follows:
345         - If space used is below default quota, stick with default quota.
346         - If space used is above, set quota to space used rounded by one tenth of the default quota.
347         The rounding ensures that quota requests will not happen too quickly after a page is loaded.
348
349         Test: http/wpt/cache-storage/cache-quota-after-restart.any.html
350
351         * Modules/cache/CacheStorageConnection.h:
352         (WebCore::CacheStorageConnection::setQuotaBasedOnSpaceUsage):
353         * storage/StorageQuotaManager.cpp:
354         (WebCore::StorageQuotaManager::setQuotaBasedOnSpaceUsage):
355         (WebCore::StorageQuotaManager::addUser):
356         * storage/StorageQuotaManager.h:
357         * testing/Internals.cpp:
358         (WebCore::Internals::updateQuotaBasedOnSpaceUsage):
359         * testing/Internals.h:
360         * testing/Internals.idl:
361
362 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
363
364         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
365         https://bugs.webkit.org/show_bug.cgi?id=196049
366
367         Reviewed by Tim Horton.
368
369         This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
370         overflow scrolling in general, so rename it.
371
372         * Configurations/FeatureDefines.xcconfig:
373         * css/CSSComputedStyleDeclaration.cpp:
374         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
375         * css/CSSProperties.json:
376         * css/CSSValueKeywords.in:
377         * css/StyleBuilderConverter.h:
378         * css/StyleResolver.cpp:
379         (WebCore::StyleResolver::adjustRenderStyle):
380         * css/parser/CSSParserFastPaths.cpp:
381         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
382         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
383         * dom/Element.cpp:
384         * dom/Element.h:
385         * rendering/RenderLayer.cpp:
386         (WebCore::RenderLayer::canUseCompositedScrolling const):
387         * rendering/style/RenderStyle.cpp:
388         (WebCore::rareInheritedDataChangeRequiresLayout):
389         * rendering/style/RenderStyle.h:
390         * rendering/style/StyleRareInheritedData.cpp:
391         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
392         (WebCore::StyleRareInheritedData::operator== const):
393         * rendering/style/StyleRareInheritedData.h:
394         * rendering/style/WillChangeData.cpp:
395         (WebCore::WillChangeData::propertyCreatesStackingContext):
396
397 2019-03-20  Devin Rousso  <drousso@apple.com>
398
399         Web Inspector: DOM: lazily create the agent
400         https://bugs.webkit.org/show_bug.cgi?id=195589
401         <rdar://problem/48791742>
402
403         Reviewed by Timothy Hatcher.
404
405         No change in functionality.
406
407         * inspector/agents/InspectorDOMAgent.h:
408         (WebCore::InspectorDOMAgent::DOMListener): Deleted.
409         (WebCore::InspectorDOMAgent::pageAgent): Deleted.
410         * inspector/agents/InspectorDOMAgent.cpp:
411         (WebCore::InspectorDOMAgent):
412         (WebCore::InspectorDOMAgent::unbind):
413         (WebCore::InspectorDOMAgent::setSearchingForNode):
414         (WebCore::InspectorDOMAgent::highlightSelector):
415         (WebCore::InspectorDOMAgent::highlightFrame):
416         (WebCore::InspectorDOMAgent::buildObjectForNode):
417         (WebCore::InspectorDOMAgent::didModifyDOMAttr):
418         (WebCore::InspectorDOMAgent::didRemoveDOMAttr):
419         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
420         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
421         (WebCore::InspectorDOMAgent::setDOMListener): Deleted.
422
423         * inspector/agents/InspectorCSSAgent.h:
424         * inspector/agents/InspectorCSSAgent.cpp:
425         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
426         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
427         (WebCore::InspectorCSSAgent::reset):
428         (WebCore::InspectorCSSAgent::enable):
429         (WebCore::InspectorCSSAgent::disable):
430         (WebCore::InspectorCSSAgent::forcePseudoState):
431         (WebCore::InspectorCSSAgent::collectAllStyleSheets):
432         (WebCore::InspectorCSSAgent::setStyleSheetText):
433         (WebCore::InspectorCSSAgent::setStyleText):
434         (WebCore::InspectorCSSAgent::setRuleSelector):
435         (WebCore::InspectorCSSAgent::createStyleSheet):
436         (WebCore::InspectorCSSAgent::addRule):
437         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
438         (WebCore::InspectorCSSAgent::elementForId):
439         (WebCore::InspectorCSSAgent::bindStyleSheet):
440         (WebCore::InspectorCSSAgent::~InspectorCSSAgent): Deleted.
441         (WebCore::InspectorCSSAgent::discardAgent): Deleted.
442         (WebCore::InspectorCSSAgent::resetNonPersistentData): Deleted.
443         * inspector/InspectorStyleSheet.cpp:
444
445         * inspector/agents/InspectorDOMDebuggerAgent.h:
446         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
447         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
448         (WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint):
449         (WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint):
450         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
451         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
452
453         * inspector/agents/page/PageConsoleAgent.h:
454         * inspector/agents/page/PageConsoleAgent.cpp:
455         (WebCore::PageConsoleAgent::PageConsoleAgent):
456         (WebCore::PageConsoleAgent::clearMessages):
457
458         * inspector/InspectorController.h:
459         * inspector/InspectorController.cpp:
460         (WebCore::InspectorController::InspectorController):
461         (WebCore::InspectorController::createLazyAgents):
462         (WebCore::InspectorController::inspect):
463         (WebCore::InspectorController::hideHighlight):
464
465 2019-03-20  Youenn Fablet  <youenn@apple.com>
466
467         Include WAL and SHM file size in IDB database size computation
468         https://bugs.webkit.org/show_bug.cgi?id=195688
469
470         Reviewed by Brady Eidson.
471
472         Count WAL and SHM files as part of IDB quota checks.
473         This makes some IDB tests go over the testing quota which then
474         triggers some IDB tasks to happen sooner than other write IDB tasks.
475         The IDB implementation requires these tasks to remain ordered.
476         In case a write task is pending quota check, queue all tasks,
477         write or read, to keep the order.
478
479         This patch specials case aborting a transaction.
480         In case it is called as part of clearing a database,
481         the task should not be queued and all pending tasks are errored.
482         When transaction is aborted by the web page, queue the task.
483
484         When we can make a decision to run tasks with size 0,
485         do not check quota. This ensures that read operations
486         succeed even if we are above quota.
487
488         Covered by existing tests.
489
490         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
491         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
492         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
493         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
494         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
495         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
496         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
497         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
498         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
499         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
500         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
501         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
502         * Modules/indexeddb/server/UniqueIDBDatabase.h:
503         * Modules/webdatabase/DatabaseTracker.cpp:
504         (WebCore::DatabaseTracker::usage):
505         * platform/sql/SQLiteFileSystem.cpp:
506         (WebCore::SQLiteFileSystem::getDatabaseFileSize):
507         * storage/StorageQuotaManager.h:
508         * storage/StorageQuotaManager.cpp:
509         (WebCore::StorageQuotaManager::requestSpace):
510
511 2019-03-20  Devin Rousso  <drousso@apple.com>
512
513         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
514         https://bugs.webkit.org/show_bug.cgi?id=176824
515         <rdar://problem/34290931>
516
517         Reviewed by Timothy Hatcher.
518
519         Original patch by Joseph Pecoraro <pecoraro@apple.com>.
520
521         Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
522                inspector/timeline/timeline-event-EventDispatch.html
523                inspector/timeline/timeline-event-FireAnimationFrame.html
524                inspector/timeline/timeline-event-RequestAnimationFrame.html
525                inspector/timeline/timeline-event-TimerFire.html
526                inspector/timeline/timeline-event-TimerInstall.html
527                inspector/timeline/timeline-event-TimerRemove.html
528
529         * dom/EventTarget.cpp:
530         (WebCore::EventTarget::innerInvokeEventListeners):
531         * page/DOMWindow.cpp:
532         (WebCore::DOMWindow::dispatchEvent):
533         Include `defaultPrevented` when notifying inspector.
534
535         * inspector/InspectorInstrumentation.h:
536         (WebCore::InspectorInstrumentation::didDispatchEvent):
537         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
538         * inspector/InspectorInstrumentation.cpp:
539         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
540         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
541         Pass `defaultPrevented` on to agent.
542
543         * inspector/agents/InspectorTimelineAgent.h:
544         * inspector/agents/InspectorTimelineAgent.cpp:
545         (WebCore::InspectorTimelineAgent::didDispatchEvent):
546         Append a boolean `defaultPrevented` property on the `EventDispatch` timeline record's data.
547
548 2019-03-20  Antoine Quint  <graouts@apple.com>
549
550         DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
551         https://bugs.webkit.org/show_bug.cgi?id=196028
552         <rdar://problem/46842707>
553
554         Reviewed by Dean Jackson.
555
556         Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.
557
558         * animation/AnimationTimeline.cpp:
559         (WebCore::AnimationTimeline::forgetAnimation):
560         (WebCore::AnimationTimeline::animationTimingDidChange):
561         (WebCore::AnimationTimeline::cancelDeclarativeAnimation):
562         * animation/AnimationTimeline.h:
563         * animation/DocumentTimeline.cpp:
564         (WebCore::DocumentTimeline::getAnimations const):
565
566 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
567
568         Remove the SVG property tear off objects for SVGAnimatedNumber
569         https://bugs.webkit.org/show_bug.cgi?id=196037
570
571         Reviewed by Simon Fraser.
572
573         -- Define SVGAnimatedNumber to be SVGAnimatedPrimitiveProperty<float>.
574
575         -- Add SVGAnimatedNumberAccessor to associate an attribute name with a 
576            pointer to an SVGAnimatedNumber. Given a pointer to an SVGElement,
577            this accessor will and create an animator for the animated property.
578
579         -- Add SVGAnimatedNumberPairAccessor to associate an attribute name
580            with a pair of pointers to SVGAnimatedNumbers. Given a pointer to an
581            SVGElement, this accessor will and create an animator for these
582            animated properties.
583
584         -- Add SVGAnimatedNumberAnimator to animated an SVGAnimatedNumber.
585
586         -- Add SVGAnimatedNumberPairAnimator to animated a pair of SVGAnimatedNumbers.
587
588         -- Add SVGAnimationNumberFunction which will be responsible for progressing
589            a float over a period of time.
590
591         -- Define SVGNumberAnimator to be SVGPrimitivePropertyAnimator<float,
592            SVGAnimationNumberFunction>. SVGNumberAnimator will be responsible 
593            for animating attributes with no reflecting animated properties, e.g.
594            "fill-opacity".
595
596         * Sources.txt:
597         * WebCore.xcodeproj/project.pbxproj:
598         * svg/SVGAnimatedLength.cpp:
599         * svg/SVGAnimatedLengthList.cpp:
600         * svg/SVGAnimatedNumber.cpp: Removed.
601         * svg/SVGAnimatedNumber.h: Removed.
602         * svg/SVGAnimatedNumberList.cpp:
603         * svg/SVGAnimatedNumberOptionalNumber.cpp: Removed.
604         * svg/SVGAnimatedNumberOptionalNumber.h: Removed.
605         * svg/SVGAnimatedTransformList.cpp:
606         * svg/SVGAnimatorFactory.h:
607         (WebCore::SVGAnimatorFactory::create):
608         * svg/SVGComponentTransferFunctionElement.cpp:
609         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
610         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
611         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
612         * svg/SVGComponentTransferFunctionElement.h:
613         (WebCore::SVGComponentTransferFunctionElement::slope const):
614         (WebCore::SVGComponentTransferFunctionElement::intercept const):
615         (WebCore::SVGComponentTransferFunctionElement::amplitude const):
616         (WebCore::SVGComponentTransferFunctionElement::exponent const):
617         (WebCore::SVGComponentTransferFunctionElement::offset const):
618         (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
619         (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
620         (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
621         (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
622         (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
623         * svg/SVGFECompositeElement.cpp:
624         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
625         (WebCore::SVGFECompositeElement::registerAttributes):
626         (WebCore::SVGFECompositeElement::parseAttribute):
627         * svg/SVGFECompositeElement.h:
628         * svg/SVGFEConvolveMatrixElement.cpp:
629         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
630         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
631         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
632         (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
633         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted.
634         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted.
635         * svg/SVGFEConvolveMatrixElement.h:
636         * svg/SVGFEDiffuseLightingElement.cpp:
637         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
638         (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
639         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
640         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted.
641         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted.
642         * svg/SVGFEDiffuseLightingElement.h:
643         * svg/SVGFEDisplacementMapElement.cpp:
644         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
645         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
646         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
647         * svg/SVGFEDisplacementMapElement.h:
648         * svg/SVGFEDropShadowElement.cpp:
649         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
650         (WebCore::SVGFEDropShadowElement::setStdDeviation):
651         (WebCore::SVGFEDropShadowElement::registerAttributes):
652         (WebCore::SVGFEDropShadowElement::parseAttribute):
653         (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted.
654         (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted.
655         * svg/SVGFEDropShadowElement.h:
656         * svg/SVGFEGaussianBlurElement.cpp:
657         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
658         (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
659         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
660         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
661         (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted.
662         (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted.
663         * svg/SVGFEGaussianBlurElement.h:
664         * svg/SVGFELightElement.cpp:
665         (WebCore::SVGFELightElement::SVGFELightElement):
666         (WebCore::SVGFELightElement::parseAttribute):
667         (WebCore::SVGFELightElement::svgAttributeChanged):
668         (WebCore::SVGFELightElement::registerAttributes): Deleted.
669         * svg/SVGFELightElement.h:
670         (WebCore::SVGFELightElement::azimuth const):
671         (WebCore::SVGFELightElement::elevation const):
672         (WebCore::SVGFELightElement::x const):
673         (WebCore::SVGFELightElement::y const):
674         (WebCore::SVGFELightElement::z const):
675         (WebCore::SVGFELightElement::pointsAtX const):
676         (WebCore::SVGFELightElement::pointsAtY const):
677         (WebCore::SVGFELightElement::pointsAtZ const):
678         (WebCore::SVGFELightElement::specularExponent const):
679         (WebCore::SVGFELightElement::limitingConeAngle const):
680         (WebCore::SVGFELightElement::azimuthAnimated):
681         (WebCore::SVGFELightElement::elevationAnimated):
682         (WebCore::SVGFELightElement::xAnimated):
683         (WebCore::SVGFELightElement::yAnimated):
684         (WebCore::SVGFELightElement::zAnimated):
685         (WebCore::SVGFELightElement::pointsAtXAnimated):
686         (WebCore::SVGFELightElement::pointsAtYAnimated):
687         (WebCore::SVGFELightElement::pointsAtZAnimated):
688         (WebCore::SVGFELightElement::specularExponentAnimated):
689         (WebCore::SVGFELightElement::limitingConeAngleAnimated):
690         (WebCore::SVGFELightElement::attributeRegistry): Deleted.
691         (WebCore::SVGFELightElement::isKnownAttribute): Deleted.
692         * svg/SVGFEMorphologyElement.cpp:
693         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
694         (WebCore::SVGFEMorphologyElement::setRadius):
695         (WebCore::SVGFEMorphologyElement::registerAttributes):
696         (WebCore::SVGFEMorphologyElement::parseAttribute):
697         (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted.
698         (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted.
699         * svg/SVGFEMorphologyElement.h:
700         * svg/SVGFEOffsetElement.cpp:
701         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
702         (WebCore::SVGFEOffsetElement::registerAttributes):
703         (WebCore::SVGFEOffsetElement::parseAttribute):
704         * svg/SVGFEOffsetElement.h:
705         * svg/SVGFESpecularLightingElement.cpp:
706         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
707         (WebCore::SVGFESpecularLightingElement::registerAttributes):
708         (WebCore::SVGFESpecularLightingElement::parseAttribute):
709         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted.
710         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted.
711         * svg/SVGFESpecularLightingElement.h:
712         * svg/SVGFETurbulenceElement.cpp:
713         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
714         (WebCore::SVGFETurbulenceElement::registerAttributes):
715         (WebCore::SVGFETurbulenceElement::parseAttribute):
716         (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted.
717         (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted.
718         * svg/SVGFETurbulenceElement.h:
719         * svg/SVGGeometryElement.cpp:
720         (WebCore::SVGGeometryElement::SVGGeometryElement):
721         (WebCore::SVGGeometryElement::parseAttribute):
722         (WebCore::SVGGeometryElement::registerAttributes): Deleted.
723         * svg/SVGGeometryElement.h:
724         (WebCore::SVGGeometryElement::pathLength const):
725         (WebCore::SVGGeometryElement::pathLengthAnimated):
726         (WebCore::SVGGeometryElement::attributeRegistry): Deleted.
727         (WebCore::SVGGeometryElement::isKnownAttribute): Deleted.
728         * svg/SVGPathElement.h:
729         * svg/SVGStopElement.cpp:
730         (WebCore::SVGStopElement::SVGStopElement):
731         (WebCore::SVGStopElement::parseAttribute):
732         (WebCore::SVGStopElement::registerAttributes): Deleted.
733         * svg/SVGStopElement.h:
734         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
735         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
736         * svg/properties/SVGAnimatedPropertyImpl.h:
737         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
738         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
739         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
740         (WebCore::SVGAnimationNumberFunction::progress):
741         * svg/properties/SVGAttributeRegistry.h:
742         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
743         * svg/properties/SVGPropertyAnimatorCreator.h:
744         (WebCore::SVGPropertyAnimatorCreator::createNumberAnimator):
745         (WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator):
746         * svg/properties/SVGPropertyOwnerRegistry.h:
747         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
748
749 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
750
751         Remove the SVG tear off objects for SVGColorAnimator
752         https://bugs.webkit.org/show_bug.cgi?id=196025
753
754         Reviewed by Simon Fraser.
755
756         SVG attributes like "fill" and "stroke" do not have reflecting properties
757         in SVGElement but they are animatable by SMIL. Animating such attributes
758         is different from animating the SVG animated properties. These new classes
759         will be added to handle the first type of this kind of attribute: the Color:
760
761         -- SVGPropertyAnimatorCreator is added to SVGElement. It is responsible 
762            for creating SVGPropertyAnimators for the attribute which do not have
763            reflecting animated properties stored by SVGElement. It will maintain
764            a HashMap for the animated values for these attributes which is indexed
765            by the attribute name. The animated values has to be RefCounted because
766            the same attribute can be animated by multiple animators. So the values
767            of this HashMap will be of type Ref<SVGProperty>, e.g.
768             <circle cx="80" cy="120" r="35">
769                 <animate attributeName="fill" values="#080" begin="2s" />
770                 <animate attributeName="fill" values="#602;#004" begin="4s" dur="5s"/>
771             </circle>
772
773         -- SVGPropertyAnimator is the a new type which animates an attribute with
774            no reflecting animated property.
775
776         -- SVGPrimitivePropertyAnimator is a template class which is responsible
777            for animating attributes with primitive types, e.g. Color, string and 
778            float. It is derived form SVGPropertyAnimator and it is initialized 
779            with a Ref<SVGValueProperty<PropertyType>> which is created and maintained
780            by SVGPropertyAnimatorFactory.
781
782         -- SVGAnimationColorFunction is the animation function that animates the
783            attributes whose type are Color. Note the conversion form String to 
784            Color in this class has to handle the case when its value is "attributeName="
785            e.g. <animate attributeName="fill" from="attributeName="r"/>
786
787         -- SVGColorAnimator will be defined to be
788            SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>.
789
790         The life cycle of the RefCounted properties can be explained as follows:
791
792         -- SVGPropertyAnimatorFactory checks whether its HashMap has an entry
793            for the given attribute name. If it does not have, it will create a
794            new value through the value creation method for this attribute.
795
796         -- SVGPropertyAnimatorFactory passes the shared animated value to the
797            animator creation method. So multiple animators will be accessing the
798            same value through their RefCounted pointers.
799
800         -- When the animator is about to be deleted, it will notify the target
801            SVGElement which will notify its SVGPropertyAnimatorFactory.
802            SVGPropertyAnimatorFactory will check its HashMap and retrieves the
803            entry for the given attribute name. If the refCount is 2, it is going
804            to remove the entry form the HashMap.
805
806         * Sources.txt:
807         * WebCore.xcodeproj/project.pbxproj:
808         * svg/SVGAnimateColorElement.cpp:
809         (WebCore::attributeValueIsCurrentColor): Deleted.
810         (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): Deleted.
811         * svg/SVGAnimateColorElement.h:
812         * svg/SVGAnimateElementBase.cpp:
813         (WebCore::SVGAnimateElementBase::attributeAnimationController):
814         * svg/SVGAnimatedColor.cpp: Removed.
815         * svg/SVGAnimatedColor.h: Removed.
816         * svg/SVGAnimatorFactory.h:
817         (WebCore::SVGAnimatorFactory::create):
818         * svg/SVGAttributeAnimationController.cpp:
819         (WebCore::SVGAttributeAnimationController::~SVGAttributeAnimationController):
820         * svg/SVGAttributeAnimationController.h:
821         * svg/SVGElement.cpp:
822         (WebCore::SVGElement::SVGElement):
823         (WebCore::SVGElement::isAnimatedAttribute const):
824         (WebCore::SVGElement::createAnimator):
825         (WebCore::SVGElement::animatorWillBeDeleted):
826         * svg/SVGElement.h:
827         (WebCore::SVGElement::propertyAnimatorFactory):
828         * svg/SVGFitToViewBox.h:
829         * svg/SVGMPathElement.cpp:
830         * svg/graphics/filters/SVGFEImage.h:
831         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp: Added.
832         (WebCore::SVGAnimationColorFunction::colorFromString):
833         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
834         (WebCore::SVGAnimationColorFunction::progress):
835         * svg/properties/SVGAnimationFunction.h:
836         * svg/properties/SVGAttributeAnimator.cpp:
837         (WebCore::SVGAttributeAnimator::applyAnimatedStylePropertyChange):
838         (WebCore::SVGAttributeAnimator::removeAnimatedStyleProperty):
839         * svg/properties/SVGAttributeAnimator.h:
840         * svg/properties/SVGPrimitivePropertyAnimator.h: Added.
841         (WebCore::SVGPrimitivePropertyAnimator::create):
842         (WebCore::SVGPrimitivePropertyAnimator::SVGPrimitivePropertyAnimator):
843         * svg/properties/SVGPrimitivePropertyAnimatorImpl.h: Added.
844         * svg/properties/SVGPropertyAnimator.h: Added.
845         (WebCore::SVGPropertyAnimator::SVGPropertyAnimator):
846         (WebCore::SVGPropertyAnimator::adjustForInheritance const):
847         (WebCore::SVGPropertyAnimator::computeCSSPropertyValue const):
848         (WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):
849         * svg/properties/SVGPropertyAnimatorFactory.h: Added.
850         (WebCore::SVGPropertyAnimatorFactory::isKnownAttribute):
851         (WebCore::SVGPropertyAnimatorFactory::createAnimator):
852         (WebCore::SVGPropertyAnimatorFactory::animatorWillBeDeleted):
853         (WebCore::SVGPropertyAnimatorFactory::createColorAnimator):
854         (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
855
856 2019-03-20  Alex Christensen  <achristensen@webkit.org>
857
858         Use WeakPtr instead of storing raw pointers in WebSocket code
859         https://bugs.webkit.org/show_bug.cgi?id=196034
860
861         Reviewed by Geoff Garen.
862
863         This could prevent using freed memory if we forget to reset a pointer somewhere.
864
865         * Modules/websockets/WebSocketChannel.cpp:
866         (WebCore::WebSocketChannel::WebSocketChannel):
867         (WebCore::WebSocketChannel::connect):
868         (WebCore::WebSocketChannel::fail):
869         (WebCore::WebSocketChannel::disconnect):
870         (WebCore::WebSocketChannel::didOpenSocketStream):
871         (WebCore::WebSocketChannel::didCloseSocketStream):
872         (WebCore::WebSocketChannel::didFailSocketStream):
873         (WebCore::WebSocketChannel::processBuffer):
874         (WebCore::WebSocketChannel::processFrame):
875         (WebCore::WebSocketChannel::processOutgoingFrameQueue):
876         (WebCore::WebSocketChannel::sendFrame):
877         * Modules/websockets/WebSocketChannel.h:
878         * Modules/websockets/WebSocketChannelClient.h:
879         * Modules/websockets/WebSocketHandshake.cpp:
880         (WebCore::WebSocketHandshake::WebSocketHandshake):
881         * Modules/websockets/WebSocketHandshake.h:
882
883 2019-03-20  Dean Jackson  <dino@apple.com>
884
885         [iOS] Crash in WebCore::Node::renderRect
886         https://bugs.webkit.org/show_bug.cgi?id=196035
887         <rdar://problem/49076783>
888
889         Reviewed by Antoine Quint.
890
891         When renderRect was called on an HTMLAreaElement, it would
892         ASSERT because it doesn't have a renderer. We hadn't noticed
893         this before because none of our tests were hitting this in
894         debug mode.
895
896         The fix is to ask the corresponding HTMLImageElement for
897         its renderer, and use that for the returned rectangle.
898
899         Covered by these tests that had become flakey:
900             fast/images/imagemap-in-shadow-tree.html
901             http/tests/download/area-download.html
902
903         * dom/Node.cpp:
904         (WebCore::Node::renderRect):
905
906 2019-03-20  Youenn Fablet  <youenn@apple.com>
907
908         Have smaller default quotas for third party frames
909         https://bugs.webkit.org/show_bug.cgi?id=195841
910
911         Reviewed by Geoffrey Garen.
912
913         Test: http/wpt/cache-storage/quota-third-party.https.html
914
915         * storage/StorageQuotaManager.h:
916         (WebCore::StorageQuotaManager::defaultQuota):
917         Change default quota to 1GB.
918
919 2019-03-20  Devin Rousso  <drousso@apple.com>
920
921         Web Inspector: DOM: include window as part of any event listener chain
922         https://bugs.webkit.org/show_bug.cgi?id=195730
923         <rdar://problem/48916872>
924
925         Reviewed by Timothy Hatcher.
926
927         Test: inspector/dom/getEventListenersForNode.html
928
929         * inspector/agents/InspectorDOMAgent.h:
930         (WebCore::EventListenerInfo::EventListenerInfo): Deleted.
931         * inspector/agents/InspectorDOMAgent.cpp:
932         (WebCore::InspectorDOMAgent::getEventListenersForNode):
933         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
934         (WebCore::InspectorDOMAgent::getEventListeners): Deleted.
935
936 2019-03-20  Devin Rousso  <drousso@apple.com>
937
938         Web Inspector: Runtime: lazily create the agent
939         https://bugs.webkit.org/show_bug.cgi?id=195972
940         <rdar://problem/49039655>
941
942         Reviewed by Timothy Hatcher.
943
944         No change in functionality.
945
946         * inspector/InspectorController.cpp:
947         (WebCore::InspectorController::InspectorController):
948         (WebCore::InspectorController::createLazyAgents):
949
950         * inspector/WorkerInspectorController.cpp:
951         (WebCore::WorkerInspectorController::WorkerInspectorController):
952         (WebCore::WorkerInspectorController::createLazyAgents):
953
954         * inspector/agents/page/PageRuntimeAgent.h:
955         * inspector/agents/page/PageRuntimeAgent.cpp:
956         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
957         (WebCore::PageRuntimeAgent::enable):
958         (WebCore::PageRuntimeAgent::disable):
959         (WebCore::PageRuntimeAgent::didCreateMainWorldContext):
960         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
961         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend): Deleted.
962         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
963
964         * inspector/agents/worker/WorkerRuntimeAgent.h:
965         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
966         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend): Deleted.
967         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
968
969 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
970
971         [CSS OM] StyledElementInlineStylePropertyMap creates a Ref cycle with its owner element
972         https://bugs.webkit.org/show_bug.cgi?id=195987
973
974         Reviewed by Simon Fraser.
975
976         StyledElementInlineStylePropertyMap was leaking every element for which it was created because due to
977         a reference cycle. The StyledElementInlineStylePropertyMap holds onto its element using Ref and
978         the element also stores StyledElementInlineStylePropertyMap in ElementRareData using RefPtr.
979
980         Fixed the cycle by making the reference from StyledElementInlineStylePropertyMap weak. For now we use
981         a raw pointer because we can't create a WeakPtr of an element yet.
982
983         Test: css-typedom/attribute-style-map-should-not-leak-every-element.html
984
985         * css/typedom/StylePropertyMap.h:
986         (WebCore::StylePropertyMap): Added clearElement as a virtual function.
987         * dom/Element.cpp:
988         (WebCore::Element::~Element): Clear the element pointer in StyledElementInlineStylePropertyMap.
989         * dom/StyledElement.cpp:
990         (WebCore::StyledElementInlineStylePropertyMap::get): Added a null check for m_element.
991         (WebCore::StyledElementInlineStylePropertyMap::StyledElementInlineStylePropertyMap):
992         (WebCore::StyledElementInlineStylePropertyMap::clearElement): Added.
993         (WebCore::StyledElementInlineStylePropertyMap): Use a raw pointer instead of Ref to StyledElement
994         to avoid the leak.
995         * platform/graphics/CustomPaintImage.cpp:
996         (WebCore::HashMapStylePropertyMap::clearElement): Added.
997
998 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
999
1000         appendChild should throw when inserting an ancestor of a template into its content adopted to another document
1001         https://bugs.webkit.org/show_bug.cgi?id=195984
1002
1003         Reviewed by Darin Adler.
1004
1005         The WPT test caught a bug that appendChild and other DOM insertion functions were incorrectly assuming that
1006         any node that's in a HTML template element has the current document's template document as its owner.
1007         The assumption is wrong when the template element's content DocumentFragment is adopted to another document.
1008
1009         Fixed the bug by always checking the ancestor host elements in checkAcceptChild. Also
1010
1011         Test: fast/dom/insert-template-parent-into-adopted-content.html
1012
1013         * dom/ContainerNode.cpp:
1014         (WebCore::isInTemplateContent): Deleted. This code is simply wrong.
1015         (WebCore::containsConsideringHostElements): Deleted. Call sites are updated to use containsIncludingHostElements.
1016         (WebCore::containsIncludingHostElements): Moved from Node.cpp and optimized this code a bit. It's more efficient
1017         to get the parent node and check for ShadowRoot and DocumentFragment only when the parent is null than to check
1018         for those two node types before getting the parent node.
1019         (WebCore::checkAcceptChild): Merged two code paths to call containsIncludingHostElements. The early return for
1020         a pseudo element is there only to prevent tree corruption in release build even in the presence of a major bug
1021         so it shouldn't be an spec compliance issue.
1022         * dom/Node.cpp:
1023         (WebCore::Node::containsIncludingHostElements const): Deleted.
1024         * dom/Node.h:
1025
1026 2019-03-20  Timothy Hatcher  <timothy@apple.com>
1027
1028         Unreviewed followup to r243169 to fix test failures.
1029
1030         * DerivedSources.make: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_AND_PLATFORM_DEFINES.
1031
1032 2019-03-20  Keith Rollin  <krollin@apple.com>
1033
1034         Update the location for XProtect.meta.plist file
1035         https://bugs.webkit.org/show_bug.cgi?id=195764
1036
1037         Reviewed by Alexey Proskuryakov.
1038
1039         The location of this file is changing in the future, so adjust for
1040         that.
1041
1042         No new tests since there should be no observable behavior difference.
1043
1044         * platform/mac/BlacklistUpdater.mm:
1045
1046 2019-03-20  Devin Rousso  <drousso@apple.com>
1047
1048         Web Inspector: Database: lazily create the agent
1049         https://bugs.webkit.org/show_bug.cgi?id=195587
1050         <rdar://problem/48791735>
1051
1052         Reviewed by Timothy Hatcher.
1053
1054         No change in functionality.
1055
1056         * inspector/agents/InspectorDatabaseAgent.h:
1057         * inspector/agents/InspectorDatabaseAgent.cpp:
1058         (WebCore::InspectorDatabaseAgent::didCommitLoad): Added.
1059         (WebCore::InspectorDatabaseAgent::didOpenDatabase):
1060         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
1061         (WebCore::InspectorDatabaseAgent::enable):
1062         (WebCore::InspectorDatabaseAgent::disable):
1063         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
1064         (WebCore::InspectorDatabaseAgent::executeSQL):
1065         (WebCore::InspectorDatabaseAgent::databaseId):
1066         (WebCore::InspectorDatabaseAgent::findByFileName):
1067         (WebCore::InspectorDatabaseAgent::databaseForId):
1068         (WebCore::InspectorDatabaseAgent::clearResources): Deleted.
1069         (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent): Deleted.
1070         * inspector/InspectorDatabaseResource.h:
1071         (WebCore::InspectorDatabaseResource::database const):
1072         (WebCore::InspectorDatabaseResource::setDatabase):
1073         (WebCore::InspectorDatabaseResource::database): Deleted.
1074         * inspector/InspectorDatabaseResource.cpp:
1075         (WebCore::InspectorDatabaseResource::create):
1076         (WebCore::InspectorDatabaseResource::InspectorDatabaseResource):
1077         (WebCore::InspectorDatabaseResource::bind):
1078         * inspector/InspectorInstrumentation.h:
1079         (WebCore::InspectorInstrumentation::didOpenDatabase):
1080         * inspector/InspectorInstrumentation.cpp:
1081         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1082         (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
1083         Pass the `Database` as a reference instead of a pointer. Retrieve any information directly
1084         from the `Database`, rather than using the arguments that were used to create it.
1085
1086         * Modules/webdatabase/Database.h:
1087         (WebCore::Database::expectedVersion const): Deleted.
1088         * Modules/webdatabase/Database.cpp:
1089         (WebCore::Database::expectedVersion const): Added.
1090         * Modules/webdatabase/DatabaseManager.cpp:
1091         (WebCore::DatabaseManager::openDatabase):
1092         * Modules/webdatabase/DatabaseTracker.h:
1093         * Modules/webdatabase/DatabaseTracker.cpp:
1094         (WebCore::DatabaseTracker::closeAllDatabases):
1095         (WebCore::DatabaseTracker::openDatabases): Added.
1096         Expose various values used by `InspectorDatabaseAgent` and `InspectorDatabaseResource`.
1097
1098         * inspector/InspectorController.cpp:
1099         (WebCore::InspectorController::InspectorController):
1100         (WebCore::InspectorController::createLazyAgents):
1101         * inspector/WorkerInspectorController.cpp:
1102         (WebCore::WorkerInspectorController::WorkerInspectorController):
1103
1104         * inspector/CommandLineAPIHost.h:
1105         (WebCore::CommandLineAPIHost::init):
1106         * inspector/CommandLineAPIHost.cpp:
1107         (WebCore::CommandLineAPIHost::disconnect):
1108         (WebCore::CommandLineAPIHost::inspect):
1109         (WebCore::CommandLineAPIHost::clearConsoleMessages):
1110         (WebCore::CommandLineAPIHost::databaseId):
1111         (WebCore::CommandLineAPIHost::storageId):
1112         Rather than pass each agent individually, pass the entire `InstrumentingAgents` so that the
1113         current agent can be used instead of whatever was initially created.
1114
1115 2019-03-20  Oriol Brufau  <obrufau@igalia.com>
1116
1117         [css-grid] Always consider baseline shim for the minimum contribution
1118         https://bugs.webkit.org/show_bug.cgi?id=195964
1119
1120         Reviewed by Javier Fernandez.
1121
1122         Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-lr.html
1123                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-rl.html
1124                imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim.html
1125
1126         Before this patch, the shim used for baseline alignment is not taken
1127         into consideration when calculating the minimum contribution of a grid
1128         item if its preferred size is auto, its minimum size is auto, and the
1129         max track sizing function is a fixed small value. In this case, the
1130         auto minimum size can produce a smaller track than if it was 0.
1131
1132         The specification needs to clarify how baseline shims interact with
1133         minimum contributions (https://github.com/w3c/csswg-drafts/issues/3660),
1134         but the above doesn't make sense.
1135
1136         * rendering/GridTrackSizingAlgorithm.cpp:
1137         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1138
1139 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1140
1141         Some elements lag behind async overflow scrolling on palace-games.com
1142         https://bugs.webkit.org/show_bug.cgi?id=195934
1143
1144         Reviewed by Zalan Bujtas.
1145
1146         The logic added in r242997 was wrong for an absolutely-positioned layer whose containig block was
1147         inside an overflow:scroll, but whose compositing ancestor was outside. This is a case where
1148         we need to make a Positioning node for the absolute layer, because it needs to move along
1149         with the scrolled content.
1150         
1151         There are six permutations of overflow, containing block and compositing ancestor that we care about.
1152         Showing renderer (aka DOM) order, they are (where <- indicates child <- parent):
1153         
1154         layer <- cb <- ca <- os -- no positioned node required
1155         layer <- cb <- os <- ca -- compositing parent skips overflow, need a "Moved" Positioned node.
1156         layer <- ov <- cb <- ca -- no positioned node required
1157         layer <- ov <- ca <- cb -- no positioned node required
1158         layer <- ca <- cb <- ov -- no positioned node required
1159         layer <- ca <- ov <- cb -- containing block skips overflow, need a "Stationary" Positioned node.
1160         
1161         [cb = containing block, ca = compositing ancestor, ov = overflow scroll]
1162
1163         Test: scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html
1164
1165         * rendering/RenderLayer.cpp:
1166         (WebCore::outputPaintOrderTreeRecursive):
1167         * rendering/RenderLayerCompositor.cpp:
1168         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
1169         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1170
1171 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
1172
1173         Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes
1174         https://bugs.webkit.org/show_bug.cgi?id=195710
1175         <rdar://problem/48867502>
1176
1177         Reviewed by Zalan Bujtas.
1178
1179         A position:absolute layer whose containing block is outside an enclosing overflow:scroll, but
1180         whose compositing ancestor is the overflow or is inside it, needs to be composited so that
1181         we can make a Positioning scrolling tree node for it.
1182
1183         Handle this case as a "OverflowScrollPositioning" indirect compositing reason.
1184
1185         Test: compositing/layer-creation/absolute-in-async-overflow-scroll.html
1186
1187         * inspector/agents/InspectorLayerTreeAgent.cpp:
1188         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
1189         * rendering/RenderLayer.h:
1190         * rendering/RenderLayerCompositor.cpp:
1191         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1192         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1193         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1194         (WebCore::RenderLayerCompositor::logReasonsForCompositing):
1195         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1196         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
1197         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
1198         * rendering/RenderLayerCompositor.h: Generalize OverflowScrollingTouch to OverflowScrolling.
1199
1200 2019-03-20  Devin Rousso  <drousso@apple.com>
1201
1202         Web Inspector: Search: allow DOM searches to be case sensitive
1203         https://bugs.webkit.org/show_bug.cgi?id=194673
1204         <rdar://problem/48087577>
1205
1206         Reviewed by Timothy Hatcher.
1207
1208         Tests: inspector/dom/dom-search.html
1209                inspector/dom/dom-search-caseSensitive.html
1210
1211         Since `DOM.performSearch` also searches by selector and XPath, some results may appear
1212         as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
1213         as although the literal node name ("BODY") didn't match, it did match via selector/XPath.
1214
1215         * inspector/agents/InspectorDOMAgent.h:
1216         * inspector/agents/InspectorDOMAgent.cpp:
1217         (WebCore::InspectorDOMAgent::performSearch):
1218
1219         * inspector/InspectorNodeFinder.h:
1220         * inspector/InspectorNodeFinder.cpp:
1221         (WebCore::InspectorNodeFinder::InspectorNodeFinder):
1222         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
1223         (WebCore::InspectorNodeFinder::checkEquals): Added.
1224         (WebCore::InspectorNodeFinder::checkContains): Added.
1225         (WebCore::InspectorNodeFinder::checkStartsWith): Added.
1226         (WebCore::InspectorNodeFinder::checkEndsWith): Added.
1227         (WebCore::InspectorNodeFinder::matchesAttribute):
1228         (WebCore::InspectorNodeFinder::matchesElement):
1229         (WebCore::InspectorNodeFinder::searchUsingXPath):
1230         (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
1231
1232 2019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1233
1234         Remove copyRef() calls added in r243163
1235         https://bugs.webkit.org/show_bug.cgi?id=195962
1236
1237         Reviewed by Chris Dumez.
1238
1239         The first two cases here can just directly return the RefPtr.
1240
1241         In the third case, we have to work around a GCC 6 bug because GCC 6 is unable to pick the
1242         right constructor to use, unlike modern compilers.
1243
1244         * Modules/fetch/FetchBody.cpp:
1245         (WebCore::FetchBody::bodyAsFormData const):
1246         (WebCore::FetchBody::take):
1247
1248 2019-03-20  Alicia Boya García  <aboya@igalia.com>
1249
1250         [MSE][GStreamer] Fix handling of resolution changes in AppendPipeline
1251         https://bugs.webkit.org/show_bug.cgi?id=195855
1252
1253         Reviewed by Xabier Rodriguez-Calvar.
1254
1255         MediaSample instances produced by the AppendPipeline were not
1256         accounting for resolution changes. The causes of this are twofold:
1257
1258         1) m_presentationSize is set by connectDemuxerSrcPadToAppsink() (by
1259         calling parseDemuxerSrcPadCaps()), but not by appsinkCapsChanged().
1260
1261         2) appsinkCapsChanged() was being called in the main thread as an
1262         asynchronous task. In consequence, even if m_presentationSize is set
1263         there, many samples with the new resolution would still be wrapped in
1264         a MediaSampleGStreamer using the old resolution by the main thread
1265         running consumeAppsinkAvailableSamples() before appsinkCapsChanged()
1266         is dispatched.
1267
1268         This patch fixes these problems by updating m_presentationSize in
1269         appsinkCapsChanged() and making the streaming thread block until the
1270         main thread has dispatched appsinkCapsChanged(). This way the handling
1271         of caps changes is serialized with the handling of frames.
1272
1273         Test: media/media-source/media-source-samples-resolution-change.html
1274
1275         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1276         (WebCore::AppendPipeline::AppendPipeline):
1277         (WebCore::AppendPipeline::appsinkCapsChanged):
1278
1279 2019-03-20  Joanmarie Diggs  <jdiggs@igalia.com>
1280
1281         AX: Implement support for new meter ARIA role
1282         https://bugs.webkit.org/show_bug.cgi?id=195966
1283
1284         Reviewed by Chris Fleizach.
1285
1286         Add the new ARIA role to the internal rolemap so that it is treated
1287         in the same fashion as its HTML element counterpart.
1288
1289         No new tests. Instead add the role to the existing role-exposure tests.
1290
1291         * accessibility/AccessibilityObject.cpp:
1292         (WebCore::AccessibilityObject::isMeter const):
1293         (WebCore::initializeRoleMap):
1294         (WebCore::AccessibilityObject::computedRoleString const):
1295         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1296         (atkRole):
1297
1298 2019-03-20  Philippe Normand  <pnormand@igalia.com>
1299
1300         [GStreamer] Switch back to webkitwebsrc for adaptive streaming fragments downloading
1301         https://bugs.webkit.org/show_bug.cgi?id=195948
1302
1303         Reviewed by Xabier Rodriguez-Calvar.
1304
1305         The webkitwebsrc element now behaves much better when used through
1306         GStreamer's adaptivedemux, so use it for all WebKit media
1307         downloads. The MediaPlayer needed by the webkitwebsrc element now
1308         travels through GstContext messages and queries so that it can be
1309         shared by multiple elements, typically the first webkitwebsrc
1310         element downloads the HLS manifest and then adaptivedemux, through
1311         uridownloader, will create new webkitwebsrc elements for fragments
1312         downloading. Those new elements will query the first webkitwebsrc
1313         element for its context.
1314
1315         The previous hack used to check SecurityOrigins can
1316         also be cleaned-up. The origins are now cached upon reception of
1317         the HTTP headers message from webkitwebsrc.
1318
1319         No new tests, existing http/tests/media/hls tests cover this change.
1320
1321         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1322         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
1323         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
1324         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1325         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1326         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
1327         (WebCore::convertToInternalProtocol): Deleted.
1328         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1329         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1330         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1331         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1332         (webkit_web_src_class_init):
1333         (webKitWebSrcSetContext):
1334         (webKitWebSrcStart):
1335         (webKitWebSrcGetProtocols):
1336         (webKitWebSrcSetUri):
1337         (CachedResourceStreamingClient::responseReceived):
1338         (convertPlaybinURI): Deleted.
1339         (webKitSrcWouldTaintOrigin): Deleted.
1340         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
1341
1342 2019-03-20  Thibault Saunier  <tsaunier@igalia.com>
1343
1344         [GStreamer][WebRTC]: Refactor to make the encoding happen synchronously
1345         https://bugs.webkit.org/show_bug.cgi?id=195674
1346
1347         This simplifies the code and make sure that everything is called from the right
1348         thread. It also makes it so we follow the same way of doing things as other libwebrtc
1349         encoders.
1350
1351         Also "s/codecSpecifiInfos/codecSpecificInfos/"
1352
1353         Reviewed by Philippe Normand.
1354
1355         No new test as this is just a refactoring
1356
1357         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1358         (WebCore::GStreamerVideoEncoder::InitEncode):
1359         (WebCore::GStreamerVideoEncoder::returnFromFlowReturn):
1360
1361 2019-03-20  Tim Horton  <timothy_horton@apple.com>
1362
1363         Add an platform-driven spell-checking mechanism
1364         https://bugs.webkit.org/show_bug.cgi?id=195795
1365
1366         Reviewed by Ryosuke Niwa.
1367
1368         * dom/Document.cpp:
1369         (WebCore::Document::textInserted):
1370         PlatformTextChecking markers are not expected
1371         to propagate to newly inserted text, so remove them.
1372
1373         * dom/DocumentMarker.h:
1374         (WebCore::DocumentMarker::allMarkers):
1375         Add a new type of DocumentMarker, PlatformTextChecking,
1376         and a new data variant that stores a key value pair of strings.
1377
1378         * dom/DocumentMarkerController.cpp:
1379         (WebCore::DocumentMarkerController::addPlatformTextCheckingMarker):
1380         (WebCore::DocumentMarkerController::removeMarkers):
1381         (WebCore::DocumentMarkerController::filterMarkers):
1382         (WebCore::shouldInsertAsSeparateMarker):
1383         * dom/DocumentMarkerController.h:
1384         Export some things.
1385         Add addPlatformTextCheckingMarker, like the others.
1386         Make it possible to filter out markers of a particular type
1387         in a range with a predicate function.
1388
1389         * editing/CompositeEditCommand.cpp:
1390         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
1391         Propagate PlatformTextChecking data.
1392         A future change should probably make it possible for
1393         any DocumentMarker to copy its data here, instead of
1394         special-casing each type that is important.
1395
1396         * editing/Editor.cpp:
1397         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1398         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
1399         (WebCore::Editor::markMisspellingsAndBadGrammar):
1400         * editing/TextCheckingHelper.cpp:
1401         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
1402         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
1403         (WebCore::platformDrivenTextCheckerEnabled):
1404         * editing/TextCheckingHelper.h:
1405         Bail from traditional spell checking if this mechanism is
1406         enabled. (I wrote it this way to make it runtime switchable
1407         in the near future, and to be similar to unifiedTextCheckerEnabled).
1408
1409 2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>
1410
1411         [WebAuthN] Implement FIDO AppID extension
1412         https://bugs.webkit.org/show_bug.cgi?id=143491
1413         <rdar://problem/48298273>
1414
1415         Reviewed by Brent Fulgham.
1416
1417         This patch adds support for FIDO AppID extension: https://www.w3.org/TR/webauthn/#sctn-appid-extension.
1418         To be noticed, this implementation follows what spec suggested in the 'Note' session and what Chrome/Firefox
1419         do in practice to avoid some unnecessary steps of
1420         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-appid-and-facets-v2.0-id-20180227.html#determining-if-a-caller-s-facetid-is-authorized-for-an-appid.
1421
1422         In fido::convertToU2fSignCommand, the checkOnly flag is deleted as it is never used.
1423
1424         Covered by new tests in existing files.
1425
1426         * CMakeLists.txt:
1427         * DerivedSources-input.xcfilelist:
1428         * DerivedSources-output.xcfilelist:
1429         * DerivedSources.make:
1430         * Modules/webauthn/AuthenticationExtensionsClientInputs.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
1431         (WebCore::AuthenticationExtensionsClientInputs::encode const):
1432         (WebCore::AuthenticationExtensionsClientInputs::decode):
1433         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
1434         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1435         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
1436         (WebCore::AuthenticatorCoordinator::create const):
1437         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
1438         * Modules/webauthn/PublicKeyCredential.cpp:
1439         (WebCore::PublicKeyCredential::tryCreate):
1440         (WebCore::PublicKeyCredential::PublicKeyCredential):
1441         (WebCore::PublicKeyCredential::getClientExtensionResults const):
1442         (WebCore::PublicKeyCredential::create): Deleted.
1443         * Modules/webauthn/PublicKeyCredential.h:
1444         * Modules/webauthn/PublicKeyCredential.idl:
1445         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1446         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
1447         * Modules/webauthn/PublicKeyCredentialData.h:
1448         (WebCore::PublicKeyCredentialData::encode const):
1449         (WebCore::PublicKeyCredentialData::decode):
1450         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
1451         (WebCore::PublicKeyCredentialRequestOptions::encode const):
1452         (WebCore::PublicKeyCredentialRequestOptions::decode):
1453         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
1454         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
1455         (fido::readCTAPMakeCredentialResponse):
1456         (fido::readCTAPGetAssertionResponse):
1457         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
1458         (fido::convertToU2fSignCommand):
1459         * Modules/webauthn/fido/U2fCommandConstructor.h:
1460         * Modules/webauthn/fido/U2fResponseConverter.cpp:
1461         (fido::readU2fRegisterResponse):
1462         (fido::readU2fSignResponse):
1463         * Sources.txt:
1464         * WebCore.xcodeproj/project.pbxproj:
1465
1466 2019-03-19  Devin Rousso  <drousso@apple.com>
1467
1468         Web Inspector: Debugger: lazily create the agent
1469         https://bugs.webkit.org/show_bug.cgi?id=195973
1470         <rdar://problem/49039674>
1471
1472         Reviewed by Joseph Pecoraro.
1473
1474         No change in functionality.
1475
1476         * inspector/WorkerInspectorController.cpp:
1477         (WebCore::WorkerInspectorController::WorkerInspectorController):
1478         (WebCore::WorkerInspectorController::createLazyAgents):
1479
1480         * inspector/agents/WebDebuggerAgent.cpp:
1481         (WebCore::WebDebuggerAgent::disable):
1482
1483         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1484         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
1485         (WebCore::InspectorDOMDebuggerAgent::discardAgent):
1486
1487 2019-03-18  Maciej Stachowiak  <mjs@apple.com>
1488
1489         Simplify Cocoa platform user agent logic by using string constants instead of function calls for the frozen parts
1490         https://bugs.webkit.org/show_bug.cgi?id=195936
1491
1492         Reviewed by Dean Jackson.
1493
1494         No new tests because no behavior changes. Existing behavior is tested by fast/dom/navigator-userAgent-frozen.html
1495
1496         * platform/UserAgent.h: Remove prototype of removed function.
1497         * platform/cocoa/UserAgentCocoa.mm:
1498         (WebCore::userAgentBundleVersion): Deleted.
1499         * platform/ios/UserAgentIOS.mm:
1500         * platform/ios/UserAgentIOS.mm:
1501         (WebCore::osNameForUserAgent): Use WTF String instead of NSString
1502         (WebCore::deviceNameForUserAgent): dutto
1503         (WebCore::standardUserAgentWithApplicationName): Simplify this
1504         function to account for WebKit version now being frozen. Also
1505         use String instead of NSString.
1506         * platform/mac/UserAgentMac.mm:
1507         (WebCore::standardUserAgentWithApplicationName): Simplify this
1508         function to account for CPU and WEbKit version now being
1509         frozen. Also avoid two separate but very similar calls to
1510         makeString().
1511
1512 2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>
1513
1514         Unreviewed adjustment to r242842 per Darin's request.
1515
1516         * platform/win/LoggingWin.cpp:
1517         (WebCore::logLevelString):
1518
1519 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
1520
1521         Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
1522         https://bugs.webkit.org/show_bug.cgi?id=195960
1523
1524         Reviewed by Simon Fraser.
1525
1526         -- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<
1527            SVGPreserveAspectRatio>.
1528
1529         -- Make SVGPreserveAspectRatio be derived form SVGValueProperty<
1530            SVGPreserveAspectRatioValue>.
1531
1532         -- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated 
1533            property.
1534
1535         -- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated
1536            property of the target element and all its instances.
1537
1538         -- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of
1539            animated property in a period of time.
1540
1541         SVGFilterPrimitiveStandardAttributes::build() should be const function.
1542         This is required for this patch because SVGFEImageElement::build() calls
1543         SVGFEImageElement::preserveAspectRatio() which is const.
1544
1545         * Sources.txt:
1546         * WebCore.xcodeproj/project.pbxproj:
1547         * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
1548         * svg/SVGAnimatedPreserveAspectRatio.h: Removed.
1549         * svg/SVGAnimatorFactory.h:
1550         (WebCore::SVGAnimatorFactory::create):
1551         * svg/SVGFEBlendElement.cpp:
1552         (WebCore::SVGFEBlendElement::build const):
1553         (WebCore::SVGFEBlendElement::build): Deleted.
1554         * svg/SVGFEBlendElement.h:
1555         * svg/SVGFEColorMatrixElement.cpp:
1556         (WebCore::SVGFEColorMatrixElement::build const):
1557         (WebCore::SVGFEColorMatrixElement::build): Deleted.
1558         * svg/SVGFEColorMatrixElement.h:
1559         * svg/SVGFEComponentTransferElement.cpp:
1560         (WebCore::SVGFEComponentTransferElement::build const):
1561         (WebCore::SVGFEComponentTransferElement::build): Deleted.
1562         * svg/SVGFEComponentTransferElement.h:
1563         * svg/SVGFECompositeElement.cpp:
1564         (WebCore::SVGFECompositeElement::build const):
1565         (WebCore::SVGFECompositeElement::build): Deleted.
1566         * svg/SVGFECompositeElement.h:
1567         * svg/SVGFEConvolveMatrixElement.cpp:
1568         (WebCore::SVGFEConvolveMatrixElement::build const):
1569         (WebCore::SVGFEConvolveMatrixElement::build): Deleted.
1570         * svg/SVGFEConvolveMatrixElement.h:
1571         * svg/SVGFEDiffuseLightingElement.cpp:
1572         (WebCore::SVGFEDiffuseLightingElement::build const):
1573         (WebCore::SVGFEDiffuseLightingElement::build): Deleted.
1574         * svg/SVGFEDiffuseLightingElement.h:
1575         * svg/SVGFEDisplacementMapElement.cpp:
1576         (WebCore::SVGFEDisplacementMapElement::build const):
1577         (WebCore::SVGFEDisplacementMapElement::build): Deleted.
1578         * svg/SVGFEDisplacementMapElement.h:
1579         * svg/SVGFEDropShadowElement.cpp:
1580         (WebCore::SVGFEDropShadowElement::build const):
1581         (WebCore::SVGFEDropShadowElement::build): Deleted.
1582         * svg/SVGFEDropShadowElement.h:
1583         * svg/SVGFEFloodElement.cpp:
1584         (WebCore::SVGFEFloodElement::build const):
1585         (WebCore::SVGFEFloodElement::build): Deleted.
1586         * svg/SVGFEFloodElement.h:
1587         * svg/SVGFEGaussianBlurElement.cpp:
1588         (WebCore::SVGFEGaussianBlurElement::build const):
1589         (WebCore::SVGFEGaussianBlurElement::build): Deleted.
1590         * svg/SVGFEGaussianBlurElement.h:
1591         * svg/SVGFEImageElement.cpp:
1592         (WebCore::SVGFEImageElement::SVGFEImageElement):
1593         (WebCore::SVGFEImageElement::parseAttribute):
1594         (WebCore::SVGFEImageElement::build const):
1595         (WebCore::SVGFEImageElement::registerAttributes): Deleted.
1596         (WebCore::SVGFEImageElement::build): Deleted.
1597         * svg/SVGFEImageElement.h:
1598         * svg/SVGFEMergeElement.cpp:
1599         (WebCore::SVGFEMergeElement::build const):
1600         (WebCore::SVGFEMergeElement::build): Deleted.
1601         * svg/SVGFEMergeElement.h:
1602         * svg/SVGFEMorphologyElement.cpp:
1603         (WebCore::SVGFEMorphologyElement::build const):
1604         (WebCore::SVGFEMorphologyElement::build): Deleted.
1605         * svg/SVGFEMorphologyElement.h:
1606         * svg/SVGFEOffsetElement.cpp:
1607         (WebCore::SVGFEOffsetElement::build const):
1608         (WebCore::SVGFEOffsetElement::build): Deleted.
1609         * svg/SVGFEOffsetElement.h:
1610         * svg/SVGFESpecularLightingElement.cpp:
1611         (WebCore::SVGFESpecularLightingElement::build const):
1612         (WebCore::SVGFESpecularLightingElement::build): Deleted.
1613         * svg/SVGFESpecularLightingElement.h:
1614         * svg/SVGFETileElement.cpp:
1615         (WebCore::SVGFETileElement::build const):
1616         (WebCore::SVGFETileElement::build): Deleted.
1617         * svg/SVGFETileElement.h:
1618         * svg/SVGFETurbulenceElement.cpp:
1619         (WebCore::SVGFETurbulenceElement::build const):
1620         (WebCore::SVGFETurbulenceElement::build): Deleted.
1621         * svg/SVGFETurbulenceElement.h:
1622         * svg/SVGFilterPrimitiveStandardAttributes.h:
1623         * svg/SVGFitToViewBox.cpp:
1624         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
1625         (WebCore::SVGFitToViewBox::parseViewBox):
1626         (WebCore::SVGFitToViewBox::registerAttributes): Deleted.
1627         * svg/SVGFitToViewBox.h:
1628         (WebCore::SVGFitToViewBox::preserveAspectRatio const):
1629         (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
1630         (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
1631         (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
1632         (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
1633         * svg/SVGImageElement.cpp:
1634         (WebCore::SVGImageElement::SVGImageElement):
1635         (WebCore::SVGImageElement::registerAttributes):
1636         (WebCore::SVGImageElement::parseAttribute):
1637         * svg/SVGImageElement.h:
1638         * svg/SVGMarkerElement.h:
1639         * svg/SVGPatternElement.h:
1640         * svg/SVGPreserveAspectRatio.h:
1641         (WebCore::SVGPreserveAspectRatio::create):
1642         (WebCore::SVGPreserveAspectRatio::align const):
1643         (WebCore::SVGPreserveAspectRatio::setAlign):
1644         (WebCore::SVGPreserveAspectRatio::meetOrSlice const):
1645         (WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
1646         (WebCore::SVGPreserveAspectRatio::align): Deleted.
1647         (WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
1648         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.
1649         * svg/SVGSVGElement.h:
1650         * svg/SVGStringList.h:
1651         * svg/SVGSymbolElement.h:
1652         * svg/SVGViewSpec.h:
1653         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1654         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1655         * svg/properties/SVGAnimatedPropertyImpl.h:
1656         * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
1657         * svg/properties/SVGAttributeRegistry.h:
1658         * svg/properties/SVGPropertyOwnerRegistry.h:
1659         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1660
1661 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
1662
1663         Remove the SVG property tear off objects of SVGAnimatedRect
1664         https://bugs.webkit.org/show_bug.cgi?id=195949
1665
1666         Reviewed by Simon Fraser.
1667
1668         SVGRect is an SVG type, so we need to introduce two classes to represent
1669         it and its animated property SVGAnimatedRect.
1670
1671         -- SVGValueProperty: It is derived from SVGProperty and it will be the 
1672            base class of all the SVG type based properties. It is basically a
1673            RefCounted object with m_value member. For SVGRect, m_value will be
1674            of type FloatRect.
1675
1676         -- SVGAnimatedValueProperty: It is derived from SVGAnimatedProperty and
1677            it will be the base class of all the animated SVG type based properties.
1678            It is RefCounted object with two RefCounted members: baseVal and animVal.
1679            These two members are of type SVGValueProperty. For SVGAnimatedRect,
1680            baseVal and animVal will be of type SVGRect.
1681
1682         SVGAnimatedValueProperty will be responsible for:
1683
1684         1) Providing access to its baseVal and animVal. Note the same interface
1685            is used internally and used by the DOM.
1686
1687         2) Managing the animation of the property by starting and stopping it.
1688
1689         3) Coordinating the changes in its baseVal and animVal with the owner
1690            element.
1691
1692         * Sources.txt:
1693         * WebCore.xcodeproj/project.pbxproj:
1694         * svg/SVGAnimatedRect.cpp: Removed.
1695         * svg/SVGAnimatedRect.h: Removed.
1696         * svg/SVGAnimatorFactory.h:
1697         (WebCore::SVGAnimatorFactory::create):
1698         * svg/SVGAttributeAnimationController.cpp:
1699         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
1700         This is a bug from r243036. The <set> can be the tag of m_animationElement
1701         not m_targetElement.
1702         * svg/SVGAttributeAnimationController.h:
1703         * svg/SVGAttributeAnimationControllerBase.h:
1704         * svg/SVGFitToViewBox.cpp:
1705         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
1706         (WebCore::SVGFitToViewBox::registerAttributes):
1707         (WebCore::SVGFitToViewBox::setViewBox):
1708         (WebCore::SVGFitToViewBox::resetViewBox):
1709         * svg/SVGFitToViewBox.h:
1710         (WebCore::SVGFitToViewBox::viewBox const):
1711         (WebCore::SVGFitToViewBox::viewBoxAnimated):
1712         (WebCore::SVGFitToViewBox::viewBoxString const):
1713         * svg/SVGMarkerElement.h:
1714         * svg/SVGPatternElement.h:
1715         * svg/SVGRect.h:
1716         (WebCore::SVGRect::create):
1717         (WebCore::SVGRect::x):
1718         (WebCore::SVGRect::setX):
1719         (WebCore::SVGRect::y):
1720         (WebCore::SVGRect::setY):
1721         (WebCore::SVGRect::width):
1722         (WebCore::SVGRect::setWidth):
1723         (WebCore::SVGRect::height):
1724         (WebCore::SVGRect::setHeight):
1725         (WebCore::SVGRect::SVGRect): Deleted.
1726         * svg/SVGSVGElement.cpp:
1727         (WebCore::checkIntersectionWithoutUpdatingLayout):
1728         (WebCore::checkEnclosureWithoutUpdatingLayout):
1729         * svg/SVGSVGElement.h:
1730         * svg/SVGSymbolElement.h:
1731         * svg/SVGViewSpec.cpp:
1732         (WebCore::SVGViewSpec::SVGViewSpec):
1733         * svg/SVGViewSpec.h:
1734         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1735         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1736         * svg/properties/SVGAnimatedPropertyImpl.h:
1737         * svg/properties/SVGAnimatedValueProperty.h: Added.
1738         (WebCore::SVGAnimatedValueProperty::create):
1739         (WebCore::SVGAnimatedValueProperty::~SVGAnimatedValueProperty):
1740         (WebCore::SVGAnimatedValueProperty::setBaseValInternal):
1741         (WebCore::SVGAnimatedValueProperty::baseVal const):
1742         (WebCore::SVGAnimatedValueProperty::baseVal):
1743         (WebCore::SVGAnimatedValueProperty::setAnimVal):
1744         (WebCore::SVGAnimatedValueProperty::animVal const):
1745         (WebCore::SVGAnimatedValueProperty::animVal):
1746         (WebCore::SVGAnimatedValueProperty::currentValue const):
1747         (WebCore::SVGAnimatedValueProperty::SVGAnimatedValueProperty):
1748         (WebCore::SVGAnimatedValueProperty::ensureAnimVal):
1749         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
1750         (WebCore::SVGAnimationRectFunction::progress):
1751         * svg/properties/SVGAttributeRegistry.h:
1752         * svg/properties/SVGPropertyOwnerRegistry.h:
1753         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1754         * svg/properties/SVGValueProperty.h: Added.
1755         (WebCore::SVGValueProperty::create):
1756         (WebCore::SVGValueProperty::value const):
1757         (WebCore::SVGValueProperty::setValue):
1758         (WebCore::SVGValueProperty::value):
1759         (WebCore::SVGValueProperty::SVGValueProperty):
1760
1761 2019-03-19  John Wilander  <wilander@apple.com>
1762
1763         Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
1764         https://bugs.webkit.org/show_bug.cgi?id=195923
1765         <rdar://problem/49001272>
1766
1767         Reviewed by Alex Christensen.
1768
1769         Adds a new experimental feature.
1770
1771         Test: http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
1772
1773         * page/RuntimeEnabledFeatures.h:
1774         (WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled):
1775         (WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const):
1776
1777 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
1778
1779         Reparenting during a mutation event inside appendChild could result in a circular DOM tree
1780         https://bugs.webkit.org/show_bug.cgi?id=192825
1781
1782         Reviewed by Zalan Bujtas.
1783
1784         The bug was caused by appendChildWithoutPreInsertionValidityCheck, insertBefore and replaceChild
1785         checking the circular dependency against newChild instead of targets even though when newChild
1786         is a document fragment, appendChildWithoutPreInsertionValidityCheck inserts the children of
1787         the document fragment. Fixed the bug by checking the circular dependency against each target child.
1788
1789         Also fixed the bug that checkAcceptChildGuaranteedNodeTypes was not considering shadow inclusive
1790         ancestors or template host elements.
1791
1792         Tests: fast/dom/append-child-with-mutation-event-removal-and-circular-insertion.html
1793                fast/dom/append-child-with-mutation-event-removal-and-circular-shadow-insertion.html
1794                fast/dom/append-child-with-mutation-event-removal-and-circular-template-insertion.html
1795                fast/dom/insert-child-with-mutation-event-removal-and-circular-insertion.html
1796                fast/dom/insert-child-with-mutation-event-removal-and-circular-shadow-insertion.html
1797                fast/dom/insert-child-with-mutation-event-removal-and-circular-template-insertion.html
1798                fast/dom/replace-child-with-mutation-event-removal-and-circular-insertion.html
1799                fast/dom/replace-child-with-mutation-event-removal-and-circular-shadow-insertion.html
1800                fast/dom/replace-child-with-mutation-event-removal-and-circular-template-insertion.html
1801
1802         * dom/ContainerNode.cpp:
1803         (WebCore::checkAcceptChildGuaranteedNodeTypes):
1804         (WebCore::ContainerNode::insertBefore):
1805         (WebCore::ContainerNode::replaceChild):
1806         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
1807
1808 2019-03-19  Brent Fulgham  <bfulgham@apple.com>
1809
1810         Add default prompt implementation for the Storage Access API
1811         https://bugs.webkit.org/show_bug.cgi?id=195866
1812         <rdar://problem/45150009>
1813
1814         Reviewed by Chris Dumez.
1815
1816         * en.lproj/Localizable.strings: Update with new strings used by the
1817         Storage Access API dialog.
1818
1819 2019-03-19  Thibault Saunier  <tsaunier@igalia.com>
1820
1821         [GStreamer][WebRTC] Create sps/pps for all frames to please libwebrtc
1822         https://bugs.webkit.org/show_bug.cgi?id=195677
1823
1824         Reviewed by Xabier Rodriguez-Calvar.
1825
1826         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
1827         (gst_webrtc_video_encoder_set_format):
1828         (register_known_encoder):
1829         (setup_x264enc):
1830         (setup_openh264enc):
1831         (setup_omxh264enc):
1832         (set_bitrate_bit_per_sec):
1833         (gst_webrtc_video_encoder_class_init):
1834
1835 2019-03-19  Timothy Hatcher  <timothy@apple.com>
1836
1837         REGRESSION (r239904): Update dark mode defines in a few places that got missed.
1838         https://bugs.webkit.org/show_bug.cgi?id=195958
1839
1840         Reviewed by Megan Gardner.
1841
1842         * DerivedSources.make: Support HAVE_OS_DARK_MODE_SUPPORT in html.css.
1843         * css/html.css: Update dark mode defines.
1844         * page/FrameView.cpp:
1845         (WebCore::FrameView::updateBackgroundRecursively): Ditto.
1846
1847 2019-03-19  Chris Dumez  <cdumez@apple.com>
1848
1849         media/track/track-in-band-style.html is flaky
1850         https://bugs.webkit.org/show_bug.cgi?id=195922
1851
1852         Reviewed by Eric Carlson.
1853
1854         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1855         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
1856         Small optimization: some of the if checks were missing their "continue;"
1857         statement. This would cause us to keep checking following keys even though
1858         we already got a match.
1859
1860 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1861
1862         Build cleanly with GCC 9
1863         https://bugs.webkit.org/show_bug.cgi?id=195920
1864
1865         Reviewed by Chris Dumez.
1866
1867         WebKit triggers three new GCC 9 warnings:
1868
1869         """
1870         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
1871         declared copy constructor and assignment operator if one of them is user-provided.
1872         """
1873
1874         Solution is to either add a copy constructor or copy assignment operator, if required, or
1875         else remove one if it is redundant.
1876
1877         """
1878         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
1879         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
1880         """
1881
1882         These account for most of this patch. Solution is to just remove the bad WTFMove().
1883
1884         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
1885         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
1886         would be safer to not use memcpy on nontrivial types, but that's too complex for this
1887         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
1888
1889         * Modules/encryptedmedia/CDM.cpp:
1890         (WebCore::CDM::getSupportedConfiguration):
1891         * Modules/encryptedmedia/MediaKeys.cpp:
1892         (WebCore::MediaKeys::createSession):
1893         * Modules/entriesapi/DOMFileSystem.cpp:
1894         (WebCore::listDirectoryWithMetadata):
1895         (WebCore::toFileSystemEntries):
1896         * Modules/fetch/FetchBody.cpp:
1897         (WebCore::FetchBody::fromFormData):
1898         (WebCore::FetchBody::bodyAsFormData const):
1899         (WebCore::FetchBody::take):
1900         * Modules/fetch/FetchRequest.cpp:
1901         (WebCore::FetchRequest::create):
1902         (WebCore::FetchRequest::clone):
1903         * Modules/fetch/FetchResponse.cpp:
1904         (WebCore::FetchResponse::create):
1905         (WebCore::FetchResponse::redirect):
1906         (WebCore::FetchResponse::clone):
1907         * Modules/indexeddb/IDBCursor.cpp:
1908         (WebCore::IDBCursor::update):
1909         (WebCore::IDBCursor::deleteFunction):
1910         * Modules/indexeddb/IDBDatabase.cpp:
1911         (WebCore::IDBDatabase::transaction):
1912         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1913         (WebCore::IDBDatabaseIdentifier::decode):
1914         * Modules/indexeddb/IDBKeyData.h:
1915         (WebCore::IDBKeyData::decode):
1916         * Modules/indexeddb/IDBObjectStore.cpp:
1917         (WebCore::IDBObjectStore::createIndex):
1918         (WebCore::IDBObjectStore::index):
1919         * Modules/indexeddb/IDBValue.h:
1920         (WebCore::IDBValue::decode):
1921         * Modules/indexeddb/shared/IDBError.cpp:
1922         (WebCore::IDBError::operator=): Deleted.
1923         * Modules/indexeddb/shared/IDBError.h:
1924         * Modules/indexeddb/shared/IDBResultData.h:
1925         (WebCore::IDBResultData::decode):
1926         * Modules/mediarecorder/MediaRecorder.cpp:
1927         (WebCore::MediaRecorder::create):
1928         * Modules/mediasource/MediaSource.cpp:
1929         (WebCore::MediaSource::addSourceBuffer):
1930         * Modules/mediastream/RTCPeerConnection.cpp:
1931         (WebCore::iceServersFromConfiguration):
1932         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
1933         (WebCore::certificateTypeFromAlgorithmIdentifier):
1934         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1935         (WebCore::LibWebRTCMediaEndpoint::getStats):
1936         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1937         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1938         (WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
1939         * Modules/webaudio/AudioBuffer.cpp:
1940         (WebCore::AudioBuffer::create):
1941         * Modules/webaudio/AudioContext.cpp:
1942         (WebCore::AudioContext::createMediaElementSource):
1943         (WebCore::AudioContext::createMediaStreamSource):
1944         (WebCore::AudioContext::createScriptProcessor):
1945         * Modules/webaudio/OfflineAudioContext.cpp:
1946         (WebCore::OfflineAudioContext::create):
1947         * Modules/webdatabase/DatabaseManager.cpp:
1948         (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
1949         * Modules/webdatabase/DatabaseTracker.cpp:
1950         (WebCore::DatabaseTracker::canEstablishDatabase):
1951         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
1952         * Modules/webdatabase/SQLResultSetRowList.cpp:
1953         (WebCore::SQLResultSetRowList::item const):
1954         * Modules/websockets/WebSocket.cpp:
1955         (WebCore::WebSocket::create):
1956         * accessibility/AXObjectCache.cpp:
1957         (WebCore::AXObjectCache::rangeForNodeContents):
1958         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
1959         * animation/KeyframeEffect.cpp:
1960         (WebCore::KeyframeEffect::create):
1961         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
1962         * bindings/js/JSCustomElementInterface.cpp:
1963         (WebCore::JSCustomElementInterface::constructElementWithFallback):
1964         * bindings/js/JSDOMConvertVariadic.h:
1965         (WebCore::VariadicConverter::convert):
1966         (WebCore::convertVariadicArguments):
1967         * bindings/js/SerializedScriptValue.cpp:
1968         (WebCore::CloneDeserializer::readDOMPointInit):
1969         (WebCore::transferArrayBuffers):
1970         * bindings/scripts/CodeGeneratorJS.pm:
1971         (GenerateCallbackImplementationContent):
1972         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1973         (WebCore::JSTestCallbackFunction::handleEvent):
1974         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
1975         (WebCore::JSTestCallbackFunctionRethrow::handleEvent):
1976         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1977         (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
1978         (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
1979         (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
1980         (WebCore::JSTestCallbackInterface::callbackWithThisObject):
1981         * contentextensions/ContentExtensionParser.cpp:
1982         (WebCore::ContentExtensions::getStringList):
1983         (WebCore::ContentExtensions::loadTrigger):
1984         (WebCore::ContentExtensions::loadEncodedRules):
1985         (WebCore::ContentExtensions::parseRuleList):
1986         * crypto/SubtleCrypto.cpp:
1987         (WebCore::normalizeCryptoAlgorithmParameters):
1988         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
1989         (WebCore::calculateSignature):
1990         * crypto/keys/CryptoKeyEC.cpp:
1991         (WebCore::CryptoKeyEC::exportJwk const):
1992         * css/CSSComputedStyleDeclaration.cpp:
1993         (WebCore::computedTransform):
1994         (WebCore::ComputedStyleExtractor::valueForShadow):
1995         (WebCore::ComputedStyleExtractor::valueForFilter):
1996         (WebCore::specifiedValueForGridTrackSize):
1997         (WebCore::valueForGridTrackList):
1998         (WebCore::valueForGridPosition):
1999         (WebCore::willChangePropertyValue):
2000         (WebCore::fontVariantLigaturesPropertyValue):
2001         (WebCore::fontVariantNumericPropertyValue):
2002         (WebCore::fontVariantEastAsianPropertyValue):
2003         (WebCore::touchActionFlagsToCSSValue):
2004         (WebCore::renderTextDecorationFlagsToCSSValue):
2005         (WebCore::renderEmphasisPositionFlagsToCSSValue):
2006         (WebCore::speakAsToCSSValue):
2007         (WebCore::hangingPunctuationToCSSValue):
2008         (WebCore::fillRepeatToCSSValue):
2009         (WebCore::fillSizeToCSSValue):
2010         (WebCore::counterToCSSValue):
2011         (WebCore::fontVariantFromStyle):
2012         (WebCore::fontSynthesisFromStyle):
2013         (WebCore::shapePropertyValue):
2014         (WebCore::paintOrder):
2015         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2016         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
2017         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
2018         * css/CSSFontFaceSet.cpp:
2019         (WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
2020         * css/CSSGradientValue.cpp:
2021         (WebCore::CSSGradientValue::image):
2022         * css/CSSStyleSheet.cpp:
2023         (WebCore::CSSStyleSheet::rules):
2024         * css/DOMMatrixReadOnly.cpp:
2025         (WebCore::DOMMatrixReadOnly::parseStringIntoAbstractMatrix):
2026         * css/FontFace.cpp:
2027         (WebCore::FontFace::create):
2028         * css/FontVariantBuilder.cpp:
2029         (WebCore::computeFontVariant):
2030         * css/PropertySetCSSStyleDeclaration.cpp:
2031         (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
2032         * css/SVGCSSComputedStyleDeclaration.cpp:
2033         (WebCore::strokeDashArrayToCSSValueList):
2034         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
2035         * css/StyleBuilderConverter.h:
2036         (WebCore::StyleBuilderConverter::convertReflection):
2037         * css/WebKitCSSMatrix.cpp:
2038         (WebCore::WebKitCSSMatrix::create):
2039         (WebCore::WebKitCSSMatrix::multiply const):
2040         * css/parser/CSSPropertyParser.cpp:
2041         (WebCore::consumeFontVariationSettings):
2042         (WebCore::consumeBasicShapePath):
2043         (WebCore::consumeImplicitGridAutoFlow):
2044         * cssjit/StackAllocator.h:
2045         * dom/DOMImplementation.cpp:
2046         (WebCore::DOMImplementation::createDocument):
2047         * dom/Document.cpp:
2048         (WebCore::Document::cloneNodeInternal):
2049         * dom/DocumentFragment.cpp:
2050         (WebCore::DocumentFragment::cloneNodeInternal):
2051         * dom/Element.cpp:
2052         (WebCore::Element::setAttributeNode):
2053         (WebCore::Element::setAttributeNodeNS):
2054         (WebCore::Element::removeAttributeNode):
2055         (WebCore::Element::parseAttributeName):
2056         (WebCore::Element::animate):
2057         * dom/MessagePort.cpp:
2058         (WebCore::MessagePort::disentanglePorts):
2059         * dom/NodeIterator.cpp:
2060         (WebCore::NodeIterator::nextNode):
2061         (WebCore::NodeIterator::previousNode):
2062         * dom/Range.cpp:
2063         (WebCore::Range::processContents):
2064         (WebCore::processContentsBetweenOffsets):
2065         (WebCore::processAncestorsAndTheirSiblings):
2066         * dom/RangeBoundaryPoint.h:
2067         * dom/ScriptDisallowedScope.h:
2068         (WebCore::ScriptDisallowedScope::operator=):
2069         * dom/Text.cpp:
2070         (WebCore::Text::splitText):
2071         * dom/TextDecoder.cpp:
2072         (WebCore::TextDecoder::create):
2073         (WebCore::TextDecoder::decode):
2074         * editing/CompositeEditCommand.cpp:
2075         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
2076         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2077         * editing/Editing.cpp:
2078         (WebCore::createTabSpanElement):
2079         * editing/EditingStyle.cpp:
2080         (WebCore::EditingStyle::styleAtSelectionStart):
2081         * editing/TextIterator.cpp:
2082         (WebCore::TextIterator::rangeFromLocationAndLength):
2083         * editing/VisibleSelection.cpp:
2084         (WebCore::makeSearchRange):
2085         * editing/markup.cpp:
2086         (WebCore::styleFromMatchedRulesAndInlineDecl):
2087         (WebCore::createFragmentForInnerOuterHTML):
2088         (WebCore::createContextualFragment):
2089         * html/FormController.cpp:
2090         (WebCore::deserializeFormControlState):
2091         * html/HTMLCanvasElement.cpp:
2092         (WebCore::HTMLCanvasElement::captureStream):
2093         * html/HTMLMediaElement.cpp:
2094         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
2095         * html/HTMLOptionElement.cpp:
2096         (WebCore::HTMLOptionElement::createForJSConstructor):
2097         * html/HTMLPlugInImageElement.cpp:
2098         (WebCore::HTMLPlugInImageElement::createElementRenderer):
2099         * html/HTMLTableElement.cpp:
2100         (WebCore::HTMLTableElement::createSharedCellStyle):
2101         * html/HTMLTableRowElement.cpp:
2102         (WebCore::HTMLTableRowElement::insertCell):
2103         * html/ImageData.cpp:
2104         (WebCore::ImageData::create):
2105         * html/OffscreenCanvas.cpp:
2106         (WebCore::OffscreenCanvas::transferToImageBitmap):
2107         * html/canvas/CanvasRenderingContext2DBase.cpp:
2108         (WebCore::CanvasRenderingContext2DBase::createLinearGradient):
2109         (WebCore::CanvasRenderingContext2DBase::createRadialGradient):
2110         * html/canvas/OESVertexArrayObject.cpp:
2111         (WebCore::OESVertexArrayObject::createVertexArrayOES):
2112         * html/canvas/WebGLRenderingContextBase.cpp:
2113         (WebCore::WebGLRenderingContextBase::createBuffer):
2114         (WebCore::WebGLRenderingContextBase::createFramebuffer):
2115         (WebCore::WebGLRenderingContextBase::createTexture):
2116         (WebCore::WebGLRenderingContextBase::createProgram):
2117         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
2118         (WebCore::WebGLRenderingContextBase::createShader):
2119         (WebCore::WebGLRenderingContextBase::getContextAttributes):
2120         (WebCore::WebGLRenderingContextBase::getUniform):
2121         * html/shadow/TextControlInnerElements.cpp:
2122         (WebCore::TextControlInnerContainer::resolveCustomStyle):
2123         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
2124         * html/track/BufferedLineReader.cpp:
2125         (WebCore::BufferedLineReader::nextLine):
2126         * html/track/VTTCue.cpp:
2127         (WebCore::VTTCue::getCueAsHTML):
2128         (WebCore::VTTCue::createCueRenderingTree):
2129         * html/track/WebVTTElement.cpp:
2130         (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
2131         * inspector/InspectorStyleSheet.cpp:
2132         (WebCore::asCSSRuleList):
2133         (WebCore::InspectorStyle::buildObjectForStyle const):
2134         (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
2135         (WebCore::InspectorStyleSheet::buildObjectForRule):
2136         * inspector/agents/InspectorCSSAgent.cpp:
2137         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2138         * inspector/agents/InspectorDOMAgent.cpp:
2139         (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
2140         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2141         * inspector/agents/InspectorNetworkAgent.cpp:
2142         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2143         * loader/FetchOptions.h:
2144         (WebCore::FetchOptions::decode):
2145         * loader/MediaResourceLoader.cpp:
2146         (WebCore::MediaResourceLoader::requestResource):
2147         * loader/appcache/ApplicationCacheStorage.cpp:
2148         (WebCore::ApplicationCacheStorage::loadCache):
2149         (WebCore::ApplicationCacheStorage::manifestURLs):
2150         * loader/archive/mhtml/MHTMLParser.cpp:
2151         (WebCore::MHTMLParser::parseArchiveWithHeader):
2152         * loader/cache/CachedResourceLoader.cpp:
2153         (WebCore::CachedResourceLoader::requestResource):
2154         * page/DOMWindow.cpp:
2155         (WebCore::DOMWindow::getMatchedCSSRules const):
2156         * page/DragController.cpp:
2157         (WebCore::documentFragmentFromDragData):
2158         * page/EventSource.cpp:
2159         (WebCore::EventSource::create):
2160         * page/PerformanceUserTiming.cpp:
2161         (WebCore::UserTiming::mark):
2162         (WebCore::UserTiming::measure):
2163         * page/SecurityOrigin.h:
2164         (WebCore::SecurityOrigin::decode):
2165         * page/scrolling/ScrollingConstraints.h:
2166         (WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints):
2167         (WebCore::LayoutConstraints::LayoutConstraints): Deleted.
2168         * platform/Length.h:
2169         (WebCore::Length::Length):
2170         * platform/animation/TimingFunction.cpp:
2171         (WebCore::TimingFunction::createFromCSSText):
2172         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2173         (WebCore::parseLicenseFormat):
2174         * platform/graphics/FloatPoint3D.h:
2175         * platform/graphics/Font.cpp:
2176         (WebCore::createAndFillGlyphPage):
2177         * platform/graphics/GLContext.cpp:
2178         (WebCore::GLContext::createContextForWindow):
2179         (WebCore::GLContext::createSharingContext):
2180         * platform/graphics/GraphicsContext.cpp:
2181         * platform/graphics/HEVCUtilities.cpp:
2182         (WebCore::parseHEVCCodecParameters):
2183         * platform/graphics/gtk/ImageGtk.cpp:
2184         (WebCore::loadImageFromGResource):
2185         (WebCore::loadMissingImageIconFromTheme):
2186         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2187         (WebCore::PlatformDisplayWayland::create):
2188         * platform/mediastream/MediaConstraints.h:
2189         (WebCore::MediaTrackConstraintSetMap::decode):
2190         * platform/mediastream/MediaStreamRequest.h:
2191         (WebCore::MediaStreamRequest::decode):
2192         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
2193         (WebCore::GStreamerSampleFromLibWebRTCVideoFrame):
2194         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
2195         (WebCore::RealtimeIncomingAudioSource::create):
2196         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
2197         (WebCore::RealtimeIncomingVideoSource::create):
2198         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2199         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
2200         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2201         (WebCore::MockMediaSample::createNonDisplayingCopy const):
2202         * platform/network/BlobRegistryImpl.cpp:
2203         (WebCore::BlobRegistryImpl::createResourceHandle):
2204         * platform/network/CookieRequestHeaderFieldProxy.h:
2205         (WebCore::CookieRequestHeaderFieldProxy::decode):
2206         * platform/network/FormData.h:
2207         (WebCore::FormData::decode):
2208         * platform/network/MIMEHeader.cpp:
2209         (WebCore::MIMEHeader::parseHeader):
2210         * platform/network/ResourceHandle.cpp:
2211         (WebCore::ResourceHandle::create):
2212         * platform/network/soup/DNSResolveQueueSoup.cpp:
2213         (WebCore::DNSResolveQueueSoup::takeCompletionAndCancelHandlers):
2214         * rendering/RenderElement.cpp:
2215         (WebCore::RenderElement::createFor):
2216         * rendering/shapes/Shape.cpp:
2217         (WebCore::Shape::createRasterShape):
2218         (WebCore::Shape::createBoxShape):
2219         * rendering/style/BasicShapes.cpp:
2220         (WebCore::BasicShapeCircle::blend const):
2221         (WebCore::BasicShapeEllipse::blend const):
2222         (WebCore::BasicShapePolygon::blend const):
2223         (WebCore::BasicShapePath::blend const):
2224         (WebCore::BasicShapeInset::blend const):
2225         * rendering/style/BasicShapes.h:
2226         (WebCore::BasicShapeRadius::BasicShapeRadius):
2227         * rendering/style/ContentData.cpp:
2228         (WebCore::ImageContentData::createContentRenderer const):
2229         (WebCore::TextContentData::createContentRenderer const):
2230         (WebCore::QuoteContentData::createContentRenderer const):
2231         * rendering/style/ContentData.h:
2232         * rendering/svg/RenderSVGInline.cpp:
2233         (WebCore::RenderSVGInline::createInlineFlowBox):
2234         * rendering/svg/RenderSVGInlineText.cpp:
2235         (WebCore::RenderSVGInlineText::createTextBox):
2236         * rendering/svg/RenderSVGText.cpp:
2237         (WebCore::RenderSVGText::createRootInlineBox):
2238         * svg/SVGFEBlendElement.cpp:
2239         (WebCore::SVGFEBlendElement::build):
2240         * svg/SVGFEColorMatrixElement.cpp:
2241         (WebCore::SVGFEColorMatrixElement::build):
2242         * svg/SVGFEComponentTransferElement.cpp:
2243         (WebCore::SVGFEComponentTransferElement::build):
2244         * svg/SVGFECompositeElement.cpp:
2245         (WebCore::SVGFECompositeElement::build):
2246         * svg/SVGFEConvolveMatrixElement.cpp:
2247         (WebCore::SVGFEConvolveMatrixElement::build):
2248         * svg/SVGFEDiffuseLightingElement.cpp:
2249         (WebCore::SVGFEDiffuseLightingElement::build):
2250         * svg/SVGFEDisplacementMapElement.cpp:
2251         (WebCore::SVGFEDisplacementMapElement::build):
2252         * svg/SVGFEDropShadowElement.cpp:
2253         (WebCore::SVGFEDropShadowElement::build):
2254         * svg/SVGFEGaussianBlurElement.cpp:
2255         (WebCore::SVGFEGaussianBlurElement::build):
2256         * svg/SVGFEMergeElement.cpp:
2257         (WebCore::SVGFEMergeElement::build):
2258         * svg/SVGFEMorphologyElement.cpp:
2259         (WebCore::SVGFEMorphologyElement::build):
2260         * svg/SVGFEOffsetElement.cpp:
2261         (WebCore::SVGFEOffsetElement::build):
2262         * svg/SVGFESpecularLightingElement.cpp:
2263         (WebCore::SVGFESpecularLightingElement::build):
2264         * svg/SVGFETileElement.cpp:
2265         (WebCore::SVGFETileElement::build):
2266         * svg/SVGTransformList.h:
2267         * svg/properties/SVGList.h:
2268         (WebCore::SVGList::initialize):
2269         (WebCore::SVGList::insertItemBefore):
2270         (WebCore::SVGList::replaceItem):
2271         (WebCore::SVGList::removeItem):
2272         (WebCore::SVGList::appendItem):
2273         * svg/properties/SVGListProperty.h:
2274         (WebCore::SVGListProperty::initializeValuesAndWrappers):
2275         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2276         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2277         (WebCore::SVGListProperty::removeItemValues):
2278         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
2279         * svg/properties/SVGPrimitiveList.h:
2280         * testing/Internals.cpp:
2281         (WebCore::Internals::elementRenderTreeAsText):
2282         (WebCore::parseFindOptions):
2283         * workers/AbstractWorker.cpp:
2284         (WebCore::AbstractWorker::resolveURL):
2285         * workers/Worker.cpp:
2286         (WebCore::Worker::create):
2287         * workers/service/ServiceWorkerJobData.h:
2288         (WebCore::ServiceWorkerJobData::decode):
2289         * xml/DOMParser.cpp:
2290         (WebCore::DOMParser::parseFromString):
2291         * xml/XPathExpression.cpp:
2292         (WebCore::XPathExpression::evaluate):
2293
2294 2019-03-19  Devin Rousso  <drousso@apple.com>
2295
2296         Web Inspector: Provide $event in the console when paused on an event listener
2297         https://bugs.webkit.org/show_bug.cgi?id=188672
2298
2299         Reviewed by Timothy Hatcher.
2300
2301         Implement similiar methods/logic as to the way that `$exception` is set.
2302
2303         * inspector/CommandLineAPIModuleSource.js:
2304         (CommandLineAPI):
2305
2306         * inspector/InspectorInstrumentation.h:
2307         (WebCore::InspectorInstrumentation::willHandleEvent):
2308         * inspector/InspectorInstrumentation.cpp:
2309         (WebCore::InspectorInstrumentation::willHandleEventImpl):
2310         (WebCore::InspectorInstrumentation::didHandleEventImpl):
2311
2312         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2313         * inspector/agents/InspectorDOMDebuggerAgent.h:
2314         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
2315         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
2316         (WebCore::InspectorDOMDebuggerAgent::didHandleEvent): Added.
2317
2318 2019-03-19  Devin Rousso  <drousso@apple.com>
2319
2320         Web Inspector: ScriptProfiler: lazily create the agent
2321         https://bugs.webkit.org/show_bug.cgi?id=195591
2322         <rdar://problem/48791756>
2323
2324         Reviewed by Joseph Pecoraro.
2325
2326         No change in functionality.
2327
2328         * inspector/InspectorController.cpp:
2329         (WebCore::InspectorController::InspectorController):
2330         (WebCore::InspectorController::createLazyAgents):
2331
2332 2019-03-19  Devin Rousso  <drousso@apple.com>
2333
2334         Web Inspector: DOMStorage: lazily create the agent
2335         https://bugs.webkit.org/show_bug.cgi?id=195588
2336         <rdar://problem/48791878>
2337
2338         Reviewed by Joseph Pecoraro.
2339
2340         No change in functionality.
2341
2342         Make functions used by `CommandLineAPIHost` static so that an `InspectorDOMStorageAgent`
2343         doesn't need to be created to call them.
2344
2345         * inspector/agents/InspectorDOMStorageAgent.h:
2346         * inspector/agents/InspectorDOMStorageAgent.cpp:
2347         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
2348         (WebCore::InspectorDOMStorageAgent::enable):
2349         (WebCore::InspectorDOMStorageAgent::disable):
2350         (WebCore::InspectorDOMStorageAgent::storageId):
2351         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
2352         (WebCore::InspectorDOMStorageAgent::findStorageArea):
2353         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent): Deleted.
2354
2355         * inspector/CommandLineAPIHost.h:
2356         (WebCore::CommandLineAPIHost::init):
2357         * inspector/CommandLineAPIHost.cpp:
2358         (WebCore::CommandLineAPIHost::disconnect):
2359         (WebCore::CommandLineAPIHost::storageId):
2360
2361         * inspector/InspectorController.cpp:
2362         (WebCore::InspectorController::InspectorController):
2363         (WebCore::InspectorController::createLazyAgents):
2364         * inspector/WorkerInspectorController.cpp:
2365         (WebCore::WorkerInspectorController::WorkerInspectorController):
2366
2367 2019-03-19  Youenn Fablet  <youenn@apple.com>
2368
2369         REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
2370         https://bugs.webkit.org/show_bug.cgi?id=195779
2371
2372         Reviewed by Chris Dumez.
2373
2374         When requesting space, we might delay execution of the task.
2375         In such a case, a task to close the database might be done before the task continues.
2376         Check that the database is not closing to continue the task.
2377         This should ensure that the cross thread queue is not already killed.
2378
2379         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2380         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
2381
2382 2019-03-19  Zalan Bujtas  <zalan@apple.com>
2383
2384         RenderElement::startAnimation should take const Animation&
2385         https://bugs.webkit.org/show_bug.cgi?id=195929
2386
2387         Reviewed by Daniel Bates.
2388
2389         * animation/KeyframeEffect.cpp:
2390         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
2391         * page/animation/KeyframeAnimation.cpp:
2392         (WebCore::KeyframeAnimation::startAnimation):
2393         (WebCore::KeyframeAnimation::endAnimation):
2394         * rendering/RenderElement.h:
2395         (WebCore::RenderElement::startAnimation):
2396         (WebCore::RenderElement::animationFinished):
2397         * rendering/RenderLayerBacking.cpp:
2398         (WebCore::RenderLayerBacking::startAnimation):
2399         * rendering/RenderLayerBacking.h:
2400         * rendering/RenderLayerModelObject.cpp:
2401         (WebCore::RenderLayerModelObject::startAnimation):
2402         (WebCore::RenderLayerModelObject::animationFinished):
2403         * rendering/RenderLayerModelObject.h:
2404
2405 2019-03-19  Devin Rousso  <drousso@apple.com>
2406
2407         Web Inspector: Heap: lazily create the agent
2408         https://bugs.webkit.org/show_bug.cgi?id=195590
2409         <rdar://problem/48791750>
2410
2411         Reviewed by Joseph Pecoraro.
2412
2413         No change in functionality.
2414
2415         * inspector/agents/page/PageHeapAgent.cpp:
2416         (WebCore::PageHeapAgent::disable):
2417         * inspector/agents/WebHeapAgent.h:
2418         * inspector/agents/WebHeapAgent.cpp:
2419         (WebCore::WebHeapAgent::WebHeapAgent):
2420         (WebCore::WebHeapAgent::enable): Added.
2421         (WebCore::WebHeapAgent::disable):
2422
2423         * inspector/agents/page/PageConsoleAgent.h:
2424         * inspector/agents/page/PageConsoleAgent.cpp:
2425         (WebCore::PageConsoleAgent::PageConsoleAgent):
2426         * inspector/agents/WebConsoleAgent.h:
2427         * inspector/agents/WebConsoleAgent.cpp:
2428         (WebCore::WebConsoleAgent::WebConsoleAgent):
2429         * inspector/agents/worker/WorkerConsoleAgent.h:
2430         * inspector/agents/worker/WorkerConsoleAgent.cpp:
2431         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
2432
2433         * inspector/InspectorController.cpp:
2434         (WebCore::InspectorController::InspectorController):
2435         (WebCore::InspectorController::createLazyAgents):
2436         * inspector/WorkerInspectorController.cpp:
2437         (WebCore::WorkerInspectorController::WorkerInspectorController):
2438         (WebCore::WorkerInspectorController::createLazyAgents):
2439
2440 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
2441
2442         Fix GraphicsLayer-related crashes after r243129
2443         https://bugs.webkit.org/show_bug.cgi?id=195953
2444
2445         Reviewed by Dean Jackson.
2446
2447         Extending the lifetime of GraphicsLayers by referencing them in the scrolling tree (r243129)
2448         revealed a bug where RenderLayerCompositor was failing to clear itself as the client of
2449         GraphicsLayers that it owned, causing crashes.
2450
2451         Fix by using the GraphicsLayer::unparentAndClear() helper to clean up all the GraphicsLayers
2452         owned by RenderLayerCompositor.
2453
2454         * rendering/RenderLayerCompositor.cpp:
2455         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
2456         * rendering/RenderLayerCompositor.h:
2457
2458 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
2459
2460         [Async overflow] Handle positioned nodes in a few more places
2461         https://bugs.webkit.org/show_bug.cgi?id=195946
2462
2463         Reviewed by Zalan Bujtas.
2464
2465         When I added support for positioned nodes in the scrolling tree I missed handling
2466         the ScrollCoordinationRole::Positioning in a few places.
2467
2468         I wasn't able to come up with a test for this; when a positioned node toggles between
2469         tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
2470         update the node with the new layer.
2471
2472         * rendering/RenderLayer.cpp:
2473         (WebCore::outputPaintOrderTreeRecursive): Logging.
2474         * rendering/RenderLayerBacking.cpp:
2475         (WebCore::operator<<): Logging.
2476         * rendering/RenderLayerCompositor.cpp:
2477         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
2478         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.
2479
2480 2019-03-19  Alex Christensen  <achristensen@webkit.org>
2481
2482         Make WTFLogChannelState and WTFLogLevel enum classes
2483         https://bugs.webkit.org/show_bug.cgi?id=195904
2484
2485         Reviewed by Eric Carlson.
2486
2487         * Modules/mediasource/SourceBuffer.cpp:
2488         (WebCore::removeSamplesFromTrackBuffer):
2489         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2490         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
2491         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
2492         * dom/Document.cpp:
2493         (WebCore::messageLevelFromWTFLogLevel):
2494         * html/FTPDirectoryDocument.cpp:
2495         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
2496         * html/HTMLMediaElement.cpp:
2497         (WebCore::HTMLMediaElement::seekTask):
2498         (WebCore::HTMLMediaElement::selectNextSourceChild):
2499         (WebCore::HTMLMediaElement::sourceWasAdded):
2500         (WebCore::HTMLMediaElement::sourceWasRemoved):
2501         * inspector/agents/WebConsoleAgent.cpp:
2502         (WebCore::WebConsoleAgent::getLoggingChannels):
2503         (WebCore::channelConfigurationForString):
2504         * platform/Logging.cpp:
2505         (WebCore::isLogChannelEnabled):
2506         (WebCore::setLogChannelToAccumulate):
2507         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2508         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2509         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2510         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2511         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2512         (WebCore::initializePeerConnectionFactoryAndThreads):
2513         * rendering/RenderLayerCompositor.cpp:
2514         (WebCore::compositingLogEnabled):
2515
2516 2019-03-19  Philippe Normand  <pnormand@igalia.com>
2517
2518         REGRESSION(r243058): [GStreamer] 3 tests now timing out
2519         https://bugs.webkit.org/show_bug.cgi?id=195888
2520
2521         Reviewed by Xabier Rodriguez-Calvar.
2522
2523         A breaking change was introduced in r243058. Now on-disk-buffering
2524         is disabled when the reported Content-Length is 0 or not present
2525         at all. This broke the progress event logic in didLoadProgress()
2526         because leading to progress events not being fired as expected.
2527
2528         The proposed solution is to make webkitwebsrc notify the player
2529         every time the network process receives data from the network. So
2530         the player can now easily determine if the load progressed by
2531         checking the reported statistics.
2532
2533         No new tests, existing media tests cover this change.
2534
2535         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2536         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2537         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
2538         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2539         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2540         (CachedResourceStreamingClient::dataReceived):
2541
2542 2019-03-19  Alicia Boya García  <aboya@igalia.com>
2543
2544         [MSE] Use tolerance in eraseBeginTime
2545         https://bugs.webkit.org/show_bug.cgi?id=195911
2546
2547         Reviewed by Jer Noble.
2548
2549         https://bugs.webkit.org/show_bug.cgi?id=190085 introduced tolerance
2550         when erasing frames during the Coded Frame Processing algorithm in
2551         such a way that, in files with less than perfect timestamps, a frame
2552         existing before after the current append is not erased accidentally
2553         due to small overlaps.
2554
2555         This patch takes care of the opposite problem: we don't want an old
2556         frame being accidentally NOT erased by a new one with the same
2557         timestamps just because these overlaps make
2558         highestPresentationTimestamp very slightly higher than the frame PTS.
2559
2560         This bug in practice causes some frames of the old quality to not be
2561         erased when the new quality is appended, resulting in some seemingly
2562         still frames from a different quality appearing at some points during
2563         WebM video in presence of quality changes.
2564
2565         This bug can be reduced to this minimal test case that illustrates the
2566         timestamp imprecission of a typical WebM file:
2567
2568         function sampleRun(generation) {
2569             return concatenateSamples([
2570                 makeASample(     0,      0, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation),
2571                 makeASample(167000, 167000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
2572                 makeASample(333000, 333000, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation), // overlaps previous frame
2573                 makeASample(500000, 500000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
2574             ]);
2575         }
2576
2577         After appending this twice it would be expected that the second
2578         generation takes fully over the first, since the timestamps are
2579         completely the same. Due to the bug, sync frames with an overlap, like
2580         the third one in that list, actually persist from the first
2581         generation, due to lack of tolerance when comparing the start of a new
2582         frame with highestPresentationTimestamp.
2583
2584         This patch introduces the tolerance in that case too to fix this
2585         problem.
2586
2587         Test: media/media-source/media-source-append-twice-overlapping-sync-frame.html
2588
2589         * Modules/mediasource/SourceBuffer.cpp:
2590         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2591
2592 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2593
2594         Unreviewed GTK build fix
2595         https://bugs.webkit.org/show_bug.cgi?id=195863
2596         <rdar://problem/49006248>
2597
2598         Patch by Diego Pino.
2599
2600         * svg/SVGTests.h:
2601
2602 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2603
2604         Unreviewed, rolling out r243132.
2605
2606         Broke GTK build
2607
2608         Reverted changeset:
2609
2610         "Make WTFLogChannelState and WTFLogLevel enum classes"
2611         https://bugs.webkit.org/show_bug.cgi?id=195904
2612         https://trac.webkit.org/changeset/243132
2613
2614 2019-03-19  Antti Koivisto  <antti@apple.com>
2615
2616         Layer with no backing store should still hit-test over a scroller
2617         https://bugs.webkit.org/show_bug.cgi?id=195378
2618         <rdar://problem/48652078>
2619
2620         Reviewed by Simon Fraser.
2621
2622         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
2623                fast/scrolling/ios/overflow-scroll-overlap-4.html
2624
2625         Move collecting event region from paint to compositing update time.
2626         This solves a number of problems including regions for non-painting layers.
2627
2628         * platform/graphics/GraphicsLayer.h:
2629         * rendering/RenderBlock.cpp:
2630         (WebCore::RenderBlock::paintObject):
2631
2632         Use the existing visibleToHitTesting() helper.
2633
2634         * rendering/RenderLayer.cpp:
2635         (WebCore::RenderLayer::paintLayerContents):
2636
2637         Use flag for event region collecting, don't paint content.
2638
2639         (WebCore::RenderLayer::paintList):
2640
2641         We can bail out immediately if there is no overflow.
2642
2643         (WebCore::RenderLayer::paintForegroundForFragments):
2644         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2645         (WebCore::RenderLayer::collectEventRegionForFragments):
2646
2647         Move to a separate function.
2648
2649         * rendering/RenderLayer.h:
2650         * rendering/RenderLayerBacking.cpp:
2651         (WebCore::RenderLayerBacking::updateConfiguration):
2652
2653         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
2654
2655         (WebCore::RenderLayerBacking::updateEventRegion):
2656         (WebCore::RenderLayerBacking::paintIntoLayer):
2657         * rendering/RenderLayerBacking.h:
2658
2659 2019-03-18  Alex Christensen  <achristensen@webkit.org>
2660
2661         Make WTFLogChannelState and WTFLogLevel enum classes
2662         https://bugs.webkit.org/show_bug.cgi?id=195904
2663
2664         Reviewed by Eric Carlson.
2665
2666         * Modules/mediasource/SourceBuffer.cpp:
2667         (WebCore::removeSamplesFromTrackBuffer):
2668         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2669         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
2670         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
2671         * dom/Document.cpp:
2672         (WebCore::messageLevelFromWTFLogLevel):
2673         * html/FTPDirectoryDocument.cpp:
2674         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
2675         * html/HTMLMediaElement.cpp:
2676         (WebCore::HTMLMediaElement::seekTask):
2677         (WebCore::HTMLMediaElement::selectNextSourceChild):
2678         (WebCore::HTMLMediaElement::sourceWasAdded):
2679         (WebCore::HTMLMediaElement::sourceWasRemoved):
2680         * inspector/agents/WebConsoleAgent.cpp:
2681         (WebCore::WebConsoleAgent::getLoggingChannels):
2682         (WebCore::channelConfigurationForString):
2683         * platform/Logging.cpp:
2684         (WebCore::isLogChannelEnabled):
2685         (WebCore::setLogChannelToAccumulate):
2686         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2687         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2688         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2689         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2690         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2691         (WebCore::initializePeerConnectionFactoryAndThreads):
2692         * rendering/RenderLayerCompositor.cpp:
2693         (WebCore::compositingLogEnabled):
2694
2695 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2696
2697         Remove the SVG property tear off objects for SVGStringList
2698         https://bugs.webkit.org/show_bug.cgi?id=195863
2699
2700         Reviewed by Simon Fraser.
2701
2702         SVGStringList is not animated list. So we need to introduce two new classes:
2703
2704         -- SVGProperty: This will be the base of all the non-animated properties.
2705            Like the SVGAnimatedProperty, SVGProperty will be registered with the
2706            attribute name in SVGPropertyRegistery. It will also commit changes
2707            to the reflecting attribute. And it will provide a synchronize string
2708            for lazy attribute update.
2709
2710         -- SVGList: It will be the base of all the list properties. It can hold
2711            primitive types or SVG types. In this patch primitive types will be 
2712            supported only. To do that, a superclass called SVGPrimitiveList is
2713            added. Its items are of primitive type such as String type.
2714
2715         * Sources.txt:
2716         * WebCore.xcodeproj/project.pbxproj:
2717         * svg/SVGElement.cpp:
2718         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
2719         (WebCore::SVGElement::commitPropertyChange):
2720         * svg/SVGElement.h:
2721         * svg/SVGStringList.h:
2722         * svg/SVGStringListValues.cpp: Removed.
2723         * svg/SVGStringListValues.h: Removed.
2724         * svg/SVGTests.cpp:
2725         (WebCore::SVGTests::SVGTests):
2726         (WebCore::SVGTests::isKnownAttribute):
2727         (WebCore::SVGTests::isValid const):
2728         (WebCore::SVGTests::parseAttribute):
2729         (WebCore::SVGTests::registerAttributes): Deleted.
2730         (WebCore::SVGTests::requiredFeatures): Deleted.
2731         (WebCore::SVGTests::requiredExtensions): Deleted.
2732         (WebCore::SVGTests::systemLanguage): Deleted.
2733         * svg/SVGTests.h:
2734         (WebCore::SVGTests::requiredFeatures):
2735         (WebCore::SVGTests::requiredExtensions):
2736         (WebCore::SVGTests::systemLanguage):
2737         (): Deleted.
2738         * svg/SVGTests.idl:
2739         * svg/SVGTextPositioningElement.h:
2740         * svg/SVGViewElement.cpp:
2741         (WebCore::SVGViewElement::SVGViewElement):
2742         (WebCore::SVGViewElement::parseAttribute):
2743         (WebCore::SVGViewElement::viewTarget): Deleted.
2744         * svg/SVGViewElement.h:
2745         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2746         * svg/properties/SVGAnimatedPrimitiveProperty.h:
2747         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
2748         * svg/properties/SVGAnimatedProperty.cpp:
2749         (WebCore::SVGAnimatedProperty::commitPropertyChange):
2750         * svg/properties/SVGAnimatedProperty.h:
2751         * svg/properties/SVGAttributeRegistry.h:
2752         * svg/properties/SVGList.h: Added.
2753         (WebCore::SVGList::numberOfItems const):
2754         (WebCore::SVGList::clear):
2755         (WebCore::SVGList::getItem):
2756         (WebCore::SVGList::initialize):
2757         (WebCore::SVGList::insertItemBefore):
2758         (WebCore::SVGList::replaceItem):
2759         (WebCore::SVGList::removeItem):
2760         (WebCore::SVGList::appendItem):
2761         (WebCore::SVGList::items):
2762         (WebCore::SVGList::items const):
2763         (WebCore::SVGList::size const):
2764         (WebCore::SVGList::isEmpty const):
2765         (WebCore::SVGList::clearItems):
2766         (WebCore::SVGList::canAlterList const):
2767         (WebCore::SVGList::canGetItem):
2768         (WebCore::SVGList::canReplaceItem):
2769         (WebCore::SVGList::canRemoveItem):
2770         (WebCore::SVGList::detachItems):
2771         * svg/properties/SVGMemberAccessor.h:
2772         (WebCore::SVGMemberAccessor::matches const):
2773         * svg/properties/SVGPrimitiveList.h: Added.
2774         * svg/properties/SVGProperty.h:
2775         (WebCore::SVGProperty::isAttached const):
2776         (WebCore::SVGProperty::attach):
2777         (WebCore::SVGProperty::detach):
2778         (WebCore::SVGProperty::contextElement const):
2779         (WebCore::SVGProperty::commitChange):
2780         (WebCore::SVGProperty::access const):
2781         (WebCore::SVGProperty::isReadOnly const):
2782         (WebCore::SVGProperty::isDirty const):
2783         (WebCore::SVGProperty::setDirty):
2784         (WebCore::SVGProperty::synchronize):
2785         (WebCore::SVGProperty::valueAsString const):
2786         (WebCore::SVGProperty::SVGProperty):
2787         * svg/properties/SVGPropertyAccessor.h: Added.
2788         * svg/properties/SVGPropertyAccessorImpl.h: Added.
2789         * svg/properties/SVGPropertyOwner.h:
2790         (WebCore::SVGPropertyOwner::commitPropertyChange):
2791         * svg/properties/SVGPropertyOwnerRegistry.h:
2792         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2793         * svg/properties/SVGPropertyRegistry.h:
2794         * svg/properties/SVGStaticListPropertyTearOff.h: Removed.
2795
2796 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
2797
2798         Unreviewed followup to r243126.
2799
2800         LayerRepresentation operator=() needs to copy m_graphicsLayer now that it doesn't
2801         share a pointer with m_typelessPlatformLayer. Also make the LayerRepresentation construction
2802         from a GraphiscLayer* explicit.
2803
2804         * page/scrolling/ScrollingStateNode.h:
2805         (WebCore::LayerRepresentation::operator=):
2806         (WebCore::LayerRepresentation::toRepresentation const):
2807
2808 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
2809
2810         Scrolling state nodes should hold references to GraphicsLayers
2811         https://bugs.webkit.org/show_bug.cgi?id=195844
2812         <rdar://problem/48949634>
2813
2814         Reviewed by Tim Horton.
2815
2816         GraphicsLayers are refcounted, and the scrolling tree keeps GraphicsLayer pointers,
2817         so for safely the scrolling tree should store RefPtr<GraphicsLayer> instead.
2818
2819         I removed the union (since it would be weird with a RefPtr and raw pointer). This code
2820         should probably use WTF::Variant<> in future.
2821
2822         * page/scrolling/ScrollingStateNode.h:
2823         (WebCore::LayerRepresentation::LayerRepresentation):
2824         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
2825
2826 2019-03-18  Commit Queue  <commit-queue@webkit.org>
2827
2828         Unreviewed, rolling out r243092 and r243096.
2829         https://bugs.webkit.org/show_bug.cgi?id=195926
2830
2831         Caused assertions in tests (Requested by smfr on #webkit).
2832
2833         Reverted changesets:
2834
2835         "Layer with no backing store should still hit-test over a
2836         scroller"
2837         https://bugs.webkit.org/show_bug.cgi?id=195378
2838         https://trac.webkit.org/changeset/243092
2839
2840         "Try to fix Windows build."
2841         https://trac.webkit.org/changeset/243096
2842
2843 2019-03-18  Megan Gardner  <megan_gardner@apple.com>
2844
2845         Smart Insert for paragraphs.
2846         https://bugs.webkit.org/show_bug.cgi?id=194880
2847
2848         Reviewed by Ryosuke Niwa.
2849
2850         Add additional newlines to maintain spacing around paragraphs.
2851
2852         Tests: editing/pasteboard/smart-paste-paragraph-001.html
2853                editing/pasteboard/smart-paste-paragraph-002.html
2854                editing/pasteboard/smart-paste-paragraph-003.html
2855                editing/pasteboard/smart-paste-paragraph-004.html
2856
2857         * dom/Document.cpp:
2858         (WebCore::Document::editingBehavior const):
2859         * dom/Document.h:
2860
2861         Expose editing behaviour through document so that is can be access from the selection commands
2862         and allow the editing behaviour to be used.
2863
2864         * editing/CompositeEditCommand.h:
2865         * editing/EditingBehavior.h:
2866         (WebCore::EditingBehavior::shouldSmartInsertDeleteParagraphs const):
2867
2868         Only have editing insert paragraphs on iOS and in editing elements that support multiple lines.
2869
2870         * editing/ReplaceSelectionCommand.cpp:
2871         (WebCore::ReplaceSelectionCommand::doApply):
2872         (WebCore::ReplaceSelectionCommand::shouldPerformSmartParagraphReplace const):
2873         (WebCore::ReplaceSelectionCommand::addNewLinesForSmartReplace):
2874         * editing/ReplaceSelectionCommand.h:
2875
2876         Add addititional newlines when pasting full paragraphs to maintian two newlines between paragraphs
2877         if that is what the original document had. If there are not multiple lines between paragraphs, do not
2878         add additional new lines.
2879
2880 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
2881
2882         Reduce the size of Node::deref by eliminating an explicit parentNode check
2883         https://bugs.webkit.org/show_bug.cgi?id=195776
2884
2885         Reviewed by Geoffrey Garen.
2886
2887         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
2888         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
2889         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
2890
2891         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
2892         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
2893         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
2894         is identically equal to 0.
2895
2896         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
2897         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
2898         or not when m_referencingNodeCount becomes 0.
2899
2900         No new tests since there should be no behavioral change.
2901
2902         * dom/Document.cpp:
2903         (WebCore::Document::removedLastRef):
2904         * dom/Document.h:
2905         (WebCore::Document::decrementReferencingNodeCount):
2906         * dom/Node.cpp:
2907         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
2908         (WebCore::Node::~Node):
2909         (WebCore::Node::removedLastRef):
2910         * dom/Node.h:
2911         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
2912         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
2913         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
2914         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
2915         (WebCore::Node::hasOneRef const):
2916         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
2917         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
2918         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
2919
2920 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2921
2922         Remove the SVG property tear off objects for SVGAnimatedBoolean
2923         https://bugs.webkit.org/show_bug.cgi?id=195862
2924
2925         Reviewed by Simon Fraser.
2926
2927         -- SVGAnimatedBoolean will be defined as SVGAnimatedPrimitiveProperty<bool>.
2928         -- SVGAnimatedBooleanAccessor is added to access a member of this type.
2929         -- A function registerProperty() is added to SVGPropertyOwnerRegistry
2930            to register this type.
2931         -- SVGAnimatedBooleanAnimator is added to animate a member of this type.
2932         -- SVGAnimationBooleanFunction is added to handle the progress of this
2933            new type over a period of time.
2934
2935         SVGAnimationDiscreteFunction is the base class of SVGAnimationBooleanFunction.
2936         It will be the base class of all the discrete animation function types:
2937         string, bool, enum and PreserveAspectRatio types.
2938
2939         * Sources.txt:
2940         * WebCore.xcodeproj/project.pbxproj:
2941         * svg/SVGAnimationElement.h:
2942         * svg/SVGAnimatorFactory.h:
2943         (WebCore::SVGAnimatorFactory::create):
2944         * svg/SVGClipPathElement.h:
2945         * svg/SVGCursorElement.h:
2946         * svg/SVGDefsElement.h:
2947         * svg/SVGExternalResourcesRequired.cpp:
2948         (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
2949         (WebCore::SVGExternalResourcesRequired::parseAttribute):
2950         (WebCore::SVGExternalResourcesRequired::registerAttributes): Deleted.
2951         * svg/SVGExternalResourcesRequired.h:
2952         (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
2953         (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
2954         (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): Deleted.
2955         * svg/SVGFEConvolveMatrixElement.cpp:
2956         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
2957         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
2958         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
2959         * svg/SVGFEConvolveMatrixElement.h:
2960         * svg/SVGFEImageElement.h:
2961         * svg/SVGFontElement.h:
2962         * svg/SVGForeignObjectElement.h:
2963         * svg/SVGGElement.h:
2964         * svg/SVGGradientElement.h:
2965         * svg/SVGMPathElement.h:
2966         * svg/SVGMarkerElement.h:
2967         * svg/SVGMaskElement.h:
2968         * svg/SVGPathElement.h:
2969         * svg/SVGPatternElement.h:
2970         * svg/SVGRectElement.h:
2971         * svg/SVGSVGElement.h:
2972         * svg/SVGScriptElement.h:
2973         * svg/SVGSwitchElement.h:
2974         * svg/SVGSymbolElement.h:
2975         * svg/SVGTextContentElement.h:
2976         * svg/SVGUseElement.h:
2977         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2978         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2979         * svg/properties/SVGAnimatedPropertyImpl.h:
2980         * svg/properties/SVGAnimationDiscreteFunction.h: Added.
2981         (WebCore::SVGAnimationDiscreteFunction::SVGAnimationDiscreteFunction):
2982         (WebCore::SVGAnimationDiscreteFunction::progress):
2983         * svg/properties/SVGAnimationDiscreteFunctionImpl.h: Added.
2984         * svg/properties/SVGAttributeRegistry.h:
2985         * svg/properties/SVGPropertyOwnerRegistry.h:
2986         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2987
2988 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
2989
2990         Crash when reloading test with async overflow scrolling
2991         https://bugs.webkit.org/show_bug.cgi?id=195629
2992         <rdar://problem/48814045>
2993
2994         Reviewed by Antoine Quint.
2995
2996         RenderLayerCompositor::removeFromScrollCoordinatedLayers needs to pass the Positioning
2997         bit to make sure we remove RenderLayers added m_scrollingNodeToLayerMap for Positioning
2998         scrolling nodes.
2999
3000         Fixes crashes seen in compositing/clipping/border-radius-async-overflow-non-stacking.html
3001         and scrollingcoordinator/scrolling-tree/remove-coordinated-frame.html.
3002
3003         * rendering/RenderLayerBacking.cpp:
3004         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3005         * rendering/RenderLayerCompositor.cpp:
3006         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
3007
3008 2019-03-18  Devin Rousso  <drousso@apple.com>
3009
3010         Web Inspector: Timeline: lazily create the agent
3011         https://bugs.webkit.org/show_bug.cgi?id=195865
3012         <rdar://problem/48965403>
3013
3014         Reviewed by Joseph Pecoraro.
3015
3016         No change in functionality.
3017
3018         * inspector/agents/InspectorTimelineAgent.h:
3019         * inspector/agents/InspectorTimelineAgent.cpp:
3020         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3021         (WebCore::InspectorTimelineAgent::toggleScriptProfilerInstrument):
3022         (WebCore::InspectorTimelineAgent::toggleHeapInstrument):
3023         (WebCore::InspectorTimelineAgent::setFrameIdentifier):
3024
3025         * inspector/InspectorInstrumentation.h:
3026         (WebCore::InspectorInstrumentation::startProfiling):
3027         (WebCore::InspectorInstrumentation::stopProfiling):
3028         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
3029         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
3030
3031         * inspector/InstrumentingAgents.h:
3032         (WebCore::InstrumentingAgents::inspectorScriptProfilerAgent const): Added.
3033         (WebCore::InstrumentingAgents::setInspectorScriptProfilerAgent): Added.
3034         * inspector/InstrumentingAgents.cpp:
3035         (WebCore::InstrumentingAgents::reset):
3036
3037         * inspector/InspectorController.cpp:
3038         (WebCore::InspectorController::InspectorController):
3039         (WebCore::InspectorController::createLazyAgents):
3040
3041 2019-03-18  Darin Adler  <darin@apple.com>
3042
3043         Cut down on use of StringBuffer, possibly leading toward removing it entirely
3044         https://bugs.webkit.org/show_bug.cgi?id=195870
3045
3046         Reviewed by Daniel Bates.
3047
3048         * dom/Document.cpp:
3049         (WebCore::canonicalizedTitle): Fixed all the problems mentioned in "FIXME".
3050         Made this a single function rather than a function template. Switch to
3051         StringBuilder instead of StringBuffer. Return the original string if the
3052         canonicalize operation doesn't change anything.
3053         (WebCore::Document::updateTitle): Updated for the change above.
3054
3055         * platform/Length.cpp:
3056         (WebCore::newCoordsArray): Use createUninitialized instead of StringBuffer.
3057         Also got rid of unneeded use of upconvertedCharacters on a temporary string
3058         that we explicitly created with 16-bit characters. The performance of this
3059         function could be considerably simplified by not copying the original string
3060         at all, but didn't do that at this time.
3061
3062         * platform/text/TextCodecUTF16.cpp:
3063         (WebCore::TextCodecUTF16::decode): Use createUninitialized instead of
3064         StringBuffer. Also renamed numChars to numCodeUnits to both switch to complete
3065         words and to be slightly more accurate.
3066
3067         * rendering/RenderText.cpp:
3068         (WebCore::convertNoBreakSpace): Added.
3069         (WebCore::capitalize): Use Vector instead of StringBuffer. Simplify code by
3070         using convertNoBreakSpace function. Removed code that was using StringImpl
3071         directly for a tiny speed boost; if we want to optimize the performance of
3072         this function we would need to do more than that. Return the original string
3073         if it happens to already be capitalized.
3074
3075 2019-03-18  Timothy Hatcher  <timothy@apple.com>
3076
3077         WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
3078         https://bugs.webkit.org/show_bug.cgi?id=195916
3079
3080         Reviewed by Tim Horton.
3081
3082         * WebCore.xcodeproj/project.pbxproj: Make ColorIOS.h a private header.
3083         * platform/ios/ColorIOS.h: Export colorFromUIColor.
3084
3085 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3086
3087         Define the type of SVGPropertyOwnerRegistry for all SVG elements
3088         https://bugs.webkit.org/show_bug.cgi?id=195859
3089
3090         Reviewed by Simon Fraser.
3091
3092         SVGPropertyOwnerRegistry will eventually replace SVGAttributeOwnerProxyImpl.
3093
3094         * svg/SVGAElement.h:
3095         * svg/SVGAltGlyphElement.h:
3096         * svg/SVGAnimationElement.h:
3097         * svg/SVGCircleElement.h:
3098         * svg/SVGClipPathElement.h:
3099         * svg/SVGComponentTransferFunctionElement.h:
3100         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
3101         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
3102         * svg/SVGCursorElement.h:
3103         * svg/SVGDefsElement.h:
3104         * svg/SVGElement.h:
3105         * svg/SVGEllipseElement.h:
3106         * svg/SVGExternalResourcesRequired.h:
3107         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
3108         * svg/SVGFEBlendElement.h:
3109         * svg/SVGFEColorMatrixElement.h:
3110         * svg/SVGFEComponentTransferElement.h:
3111         * svg/SVGFECompositeElement.h:
3112         * svg/SVGFEConvolveMatrixElement.h:
3113         * svg/SVGFEDiffuseLightingElement.h:
3114         * svg/SVGFEDisplacementMapElement.h:
3115         * svg/SVGFEDropShadowElement.h:
3116         * svg/SVGFEGaussianBlurElement.h:
3117         * svg/SVGFEImageElement.h:
3118         * svg/SVGFELightElement.h:
3119         (WebCore::SVGFELightElement::attributeRegistry):
3120         (WebCore::SVGFELightElement::isKnownAttribute):
3121         * svg/SVGFEMergeNodeElement.h:
3122         * svg/SVGFEMorphologyElement.h:
3123         * svg/SVGFEOffsetElement.h:
3124         * svg/SVGFESpecularLightingElement.h:
3125         * svg/SVGFETileElement.h:
3126         * svg/SVGFETurbulenceElement.cpp:
3127         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
3128         * svg/SVGFETurbulenceElement.h:
3129         * svg/SVGFilterElement.h:
3130         * svg/SVGFilterPrimitiveStandardAttributes.h:
3131         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
3132         * svg/SVGFitToViewBox.h:
3133         (WebCore::SVGFitToViewBox::isKnownAttribute):
3134         * svg/SVGFontElement.h:
3135         * svg/SVGForeignObjectElement.h:
3136         * svg/SVGGElement.h:
3137         * svg/SVGGeometryElement.h:
3138         (WebCore::SVGGeometryElement::isKnownAttribute):
3139         * svg/SVGGlyphRefElement.h:
3140         * svg/SVGGradientElement.h:
3141         (WebCore::SVGGradientElement::isKnownAttribute):
3142         * svg/SVGGraphicsElement.h:
3143         (WebCore::SVGGraphicsElement::isKnownAttribute):
3144         * svg/SVGImageElement.h:
3145         * svg/SVGLineElement.h:
3146         * svg/SVGLinearGradientElement.h:
3147         * svg/SVGMPathElement.h:
3148         * svg/SVGMarkerElement.h:
3149         * svg/SVGMaskElement.h:
3150         * svg/SVGPathElement.h:
3151         * svg/SVGPatternElement.h:
3152         * svg/SVGPolyElement.h:
3153         (WebCore::SVGPolyElement::attributeRegistry):
3154         (WebCore::SVGPolyElement::isKnownAttribute):
3155         * svg/SVGRadialGradientElement.h:
3156         * svg/SVGRectElement.h:
3157         * svg/SVGSVGElement.h:
3158         * svg/SVGScriptElement.h:
3159         * svg/SVGStopElement.h:
3160         * svg/SVGSwitchElement.h:
3161         * svg/SVGSymbolElement.h:
3162         * svg/SVGTRefElement.h:
3163         * svg/SVGTests.h:
3164         * svg/SVGTextContentElement.h:
3165         (WebCore::SVGTextContentElement::isKnownAttribute):
3166         * svg/SVGTextPathElement.h:
3167         * svg/SVGTextPositioningElement.h:
3168         (WebCore::SVGTextPositioningElement::isKnownAttribute):
3169         * svg/SVGURIReference.h:
3170         * svg/SVGUseElement.h:
3171         * svg/SVGViewElement.h:
3172         * svg/SVGViewSpec.h:
3173         * svg/SVGZoomAndPan.cpp:
3174         (WebCore::SVGZoomAndPan::parseZoomAndPan):
3175         (WebCore::SVGZoomAndPan::parseAttribute):
3176         (WebCore::SVGZoomAndPan::SVGZoomAndPan): Deleted.
3177         (WebCore::SVGZoomAndPan::registerAttributes): Deleted.
3178         * svg/SVGZoomAndPan.h:
3179         (WebCore::SVGZoomAndPan::zoomAndPan const):
3180         (WebCore::SVGZoomAndPan::setZoomAndPan):
3181         (WebCore::SVGZoomAndPan::reset):
3182         (WebCore::SVGZoomAndPan::attributeRegistry): Deleted.
3183         (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
3184
3185 2019-03-18  Timothy Hatcher  <timothy@apple.com>
3186
3187         Add new NSAttributedString API for converting HTML.
3188         https://bugs.webkit.org/show_bug.cgi?id=195636
3189         rdar://problem/45055697
3190
3191         Reviewed by Tim Horton.
3192
3193         * en.lproj/Localizable.strings: Updated.
3194
3195 2019-03-18  Zalan Bujtas  <zalan@apple.com>
3196
3197         Call transition and animation callbacks on non-composited renderers too.
3198         https://bugs.webkit.org/show_bug.cgi?id=195907
3199
3200         Reviewed by Simon Fraser.
3201
3202         These callbacks are not composited specific functions.
3203
3204         * page/animation/AnimationBase.cpp:
3205         (WebCore::AnimationBase::freezeAtTime):
3206         (WebCore::AnimationBase::compositedRenderer const): Deleted.
3207         * page/animation/AnimationBase.h:
3208         * page/animation/ImplicitAnimation.cpp:
3209         (WebCore::ImplicitAnimation::startAnimation):
3210         (WebCore::ImplicitAnimation::pauseAnimation):
3211         (WebCore::ImplicitAnimation::endAnimation):
3212         * page/animation/KeyframeAnimation.cpp:
3213         (WebCore::KeyframeAnimation::startAnimation):
3214         (WebCore::KeyframeAnimation::pauseAnimation):
3215         (WebCore::KeyframeAnimation::endAnimation):
3216         * rendering/RenderLayerModelObject.cpp:
3217         (WebCore::RenderLayerModelObject::startTransition):
3218         (WebCore::RenderLayerModelObject::transitionPaused):
3219         (WebCore::RenderLayerModelObject::transitionFinished):
3220         (WebCore::RenderLayerModelObject::startAnimation):
3221         (WebCore::RenderLayerModelObject::animationPaused):
3222         (WebCore::RenderLayerModelObject::animationSeeked):
3223         (WebCore::RenderLayerModelObject::animationFinished):
3224         (WebCore::RenderLayerModelObject::suspendAnimations):
3225
3226 2019-03-18  Jer Noble  <jer.noble@apple.com>
3227
3228         Add experimental "alphaChannel" property to VideoConfiguration
3229         https://bugs.webkit.org/show_bug.cgi?id=195853
3230
3231         Reviewed by Eric Carlson.
3232
3233         Test: media/mediacapabilities/mock-decodingInfo-alphaChannel.html
3234
3235         Add a new, experimental addition to Media Capabilities to allow pages to query for
3236         alpha channel support.
3237
3238         * Modules/mediacapabilities/MediaCapabilities.cpp:
3239         (WebCore::MediaCapabilities::decodingInfo):
3240         * Modules/mediacapabilities/MediaCapabilities.h:
3241         * Modules/mediacapabilities/MediaCapabilities.idl:
3242         * Modules/mediacapabilities/VideoConfiguration.idl:
3243         * SourcesCocoa.txt:
3244         * WebCore.xcodeproj/project.pbxproj:
3245         * platform/cocoa/VideoToolboxSoftLink.cpp:
3246         * platform/cocoa/VideoToolboxSoftLink.h:
3247         * platform/graphics/cocoa/HEVCUtilitiesCocoa.h:
3248         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: Renamed from Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp.
3249         (WebCore::validateHEVCParameters):
3250         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
3251         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
3252         * platform/mediacapabilities/VideoConfiguration.h:
3253         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
3254         (WebCore::canDecodeMedia):
3255         (WebCore::canEncodeMedia):
3256
3257 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
3258
3259         Remove unused webkitEditableContentChanged event
3260         https://bugs.webkit.org/show_bug.cgi?id=195909
3261
3262         Reviewed by Wenson Hsieh.
3263
3264         Removed webkitEditableContentChanged event which is no longer used after r206944.
3265
3266         Note that only WebKit's C++ code can fire events in TextControlInnerElements
3267         since the element is an implementation detail of input and textarea elements.
3268
3269         * dom/EventNames.h:
3270         * html/shadow/TextControlInnerElements.cpp:
3271         (WebCore::TextControlInnerTextElement::defaultEventHandler):
3272
3273 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
3274
3275         [WHLSL] Hook up the compiler to our WebGPU implementation
3276         https://bugs.webkit.org/show_bug.cgi?id=195509
3277
3278         Unreviewed.
3279
3280         Update after r243091.
3281
3282         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
3283         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3284         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
3285
3286 2019-03-18  Chris Dumez  <cdumez@apple.com>
3287
3288         REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
3289         https://bugs.webkit.org/show_bug.cgi?id=195322
3290
3291         Reviewed by Ryosuke Niwa.
3292
3293         Since r236862, DOMWindow objects get disconnected from their Frame object as soon as
3294         their iframe element gets removed from the document. Previously, DOMWindow was a
3295         FrameDestructionObserver and would stay connected to its frame until the frame died.
3296
3297         This means that some of the work that we were doing in DOMWindow::frameDestroyed() and
3298         Document::willDetachPage() no longer happens for subframe windows because they get
3299         disconnected from their frame because they get a chance to get such notifications.
3300         To address this issue, we now also do this work in DOMWindow::willDetachDocumentFromFrame()
3301         which gets called when the iframe gets removed from the document and the document / window
3302         get disconnected from the Frame element.
3303
3304         No new tests, verified locally that the leak is gone on JetStream.
3305
3306         * page/DOMWindow.cpp:
3307         (WebCore::DOMWindow::willDetachDocumentFromFrame):
3308
3309 2019-03-18  Zalan Bujtas  <zalan@apple.com>
3310
3311         Move animation and transition functions from RenderBoxModelObject to RenderElement
3312         https://bugs.webkit.org/show_bug.cgi?id=195903
3313
3314         Reviewed by Simon Fraser.
3315
3316         Transitions and animations do not require RenderBoxModelObject. Move these functions to RenderElement and override them at RenderLayerModelObject to support
3317         composition related callbacks.
3318
3319         * page/animation/AnimationBase.cpp:
3320         (WebCore::AnimationBase::compositedRenderer const):
3321         * page/animation/AnimationBase.h:
3322         * rendering/RenderBoxModelObject.cpp:
3323         (WebCore::RenderBoxModelObject::startTransition): Deleted.
3324         (WebCore::RenderBoxModelObject::transitionPaused): Deleted.
3325         (WebCore::RenderBoxModelObject::transitionFinished): Deleted.
3326         (WebCore::RenderBoxModelObject::startAnimation): Deleted.
3327         (WebCore::RenderBoxModelObject::animationPaused): Deleted.
3328         (WebCore::RenderBoxModelObject::animationSeeked): Deleted.
3329         (WebCore::RenderBoxModelObject::animationFinished): Deleted.
3330         (WebCore::RenderBoxModelObject::suspendAnimations): Deleted.
3331         * rendering/RenderBoxModelObject.h:
3332         * rendering/RenderElement.cpp:
3333         (WebCore::RenderElement::startTransition):
3334         (WebCore::RenderElement::transitionPaused):
3335         (WebCore::RenderElement::transitionFinished):
3336         (WebCore::RenderElement::startAnimation):
3337         (WebCore::RenderElement::animationPaused):
3338         (WebCore::RenderElement::animationSeeked):
3339         (WebCore::RenderElement::animationFinished):
3340         (WebCore::RenderElement::suspendAnimations):
3341         * rendering/RenderElement.h:
3342
3343 2019-03-18  Antti Koivisto  <antti@apple.com>
3344
3345         Try to fix Windows build.
3346
3347         * rendering/RenderLayerBacking.cpp:
3348         (WebCore::RenderLayerBacking::updateEventRegion):
3349
3350 2019-03-18  Antti Koivisto  <antti@apple.com>
3351
3352         Layer with no backing store should still hit-test over a scroller
3353         https://bugs.webkit.org/show_bug.cgi?id=195378
3354         <rdar://problem/48652078>
3355
3356         Reviewed by Simon Fraser.
3357
3358         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
3359                fast/scrolling/ios/overflow-scroll-overlap-4.html
3360
3361         Move collecting event region from paint to compositing update time.
3362         This solves a number of problems including regions for non-painting layers.
3363
3364         * platform/graphics/GraphicsLayer.h:
3365         * rendering/RenderBlock.cpp:
3366         (WebCore::RenderBlock::paintObject):
3367
3368         Use the existing visibleToHitTesting() helper.
3369
3370         * rendering/RenderLayer.cpp:
3371         (WebCore::RenderLayer::paintLayerContents):
3372
3373         Use flag for event region collecting, don't paint content.
3374
3375         (WebCore::RenderLayer::paintList):
3376
3377         We can bail out immediately if there is no overflow.
3378
3379         (WebCore::RenderLayer::paintForegroundForFragments):
3380         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
3381         (WebCore::RenderLayer::collectEventRegionForFragments):
3382
3383         Move to a separate function.
3384
3385         * rendering/RenderLayer.h:
3386         * rendering/RenderLayerBacking.cpp:
3387         (WebCore::RenderLayerBacking::updateConfiguration):
3388
3389         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
3390
3391         (WebCore::RenderLayerBacking::updateEventRegion):
3392         (WebCore::RenderLayerBacking::paintIntoLayer):
3393         * rendering/RenderLayerBacking.h:
3394
3395 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
3396
3397         [WHLSL] Hook up the compiler to our WebGPU implementation
3398         https://bugs.webkit.org/show_bug.cgi?id=195509
3399
3400         Reviewed by Dean Jackson.
3401
3402         This represents a collection of changes necessary to compile and run the first WHLSL program in WebKit.
3403
3404         Because WHLSL isn't fully implemented yet, this patch doesn't remove the existing method for supplying
3405         Metal shaders to WebGPU. Instead, it adds a new boolean to WebGPUShaderModuleDescriptor, "isWHLSL" which
3406         causes us to run the WHLSL compiler.
3407
3408         More details below.
3409
3410         Test: webgpu/whlsl.html
3411
3412         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Use raw pointer instead of Optional<std::reference_wrapper>.
3413         (WebCore::WHLSL::AST::CallExpression::setCastData):
3414         (WebCore::WHLSL::AST::CallExpression::isCast):
3415         (WebCore::WHLSL::AST::CallExpression::castReturnType):
3416         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
3417         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
3418         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsAtomic):