00be0d4aeacf37bf3fc665c75581ae45d5d66780
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-07  Zalan Bujtas  <zalan@apple.com>
2
3         [ContentChangeObserver] Click event fires immediately on hover menu at Ebbets.com
4         https://bugs.webkit.org/show_bug.cgi?id=195397
5
6         Reviewed by Simon Fraser.
7
8         This patch introduces TouchEventScope to track changes triggered by touch start.
9
10         Test: fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html
11
12         * page/ios/ContentChangeObserver.cpp:
13         (WebCore::ContentChangeObserver::touchEventDidStart):
14         (WebCore::ContentChangeObserver::touchEventDidFinish):
15         (WebCore::ContentChangeObserver::mouseMovedDidStart):
16         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
17         (WebCore::ContentChangeObserver::adjustObservedState):
18         (WebCore::ContentChangeObserver::TouchEventScope::TouchEventScope):
19         (WebCore::ContentChangeObserver::TouchEventScope::~TouchEventScope):
20         * page/ios/ContentChangeObserver.h:
21         (WebCore::ContentChangeObserver::isObservingContentChanges const):
22
23 2019-03-07  Zalan Bujtas  <zalan@apple.com>
24
25         [ContentChangeObserver] Introduce fixed duration content observation
26         https://bugs.webkit.org/show_bug.cgi?id=195295
27         <rdar://problem/48579913>
28
29         Reviewed by Simon Fraser.
30
31         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
32         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
33         we stop observing for content changes before they even get fired.
34
35         Test: fast/events/touch/ios/content-observation/visibility-change-happens-on-timer-hops.html
36
37         * page/ios/ContentChangeObserver.cpp:
38         (WebCore::ContentChangeObserver::ContentChangeObserver):
39         (WebCore::ContentChangeObserver::startContentObservationForDuration):
40         (WebCore::ContentChangeObserver::completeDurationBasedContentObservation):
41         (WebCore::ContentChangeObserver::didInstallDOMTimer):
42         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
43         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
44         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
45         (WebCore::ContentChangeObserver::styleRecalcDidStart):
46         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
47         (WebCore::ContentChangeObserver::cancelPendingActivities):
48         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
49         (WebCore::ContentChangeObserver::willDetachPage):
50         (WebCore::ContentChangeObserver::contentVisibilityDidChange):
51         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
52         (WebCore::ContentChangeObserver::adjustObservedState):
53         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
54         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
55         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange): Deleted.
56         * page/ios/ContentChangeObserver.h:
57         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
58         (WebCore::ContentChangeObserver::isObservingContentChanges const):
59         (WebCore::ContentChangeObserver::hasPendingActivity const):
60
61 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
62
63         requestAnimationFrame should execute before the next frame
64         https://bugs.webkit.org/show_bug.cgi?id=177484
65
66         Reviewed by Simon Fraser.
67
68         This change fixes two issues with animation timing:
69
70         1. Calling the requestAnimationFrame callbacks would have happened when
71            the DisplayLink fires. This may have happened even if the frame is
72            missed and no display is committed.
73
74         2. Style changes and layout triggered by script could trigger painting
75            at more than 60fps. CoreAnimation commits could happen at more than
76            60fps, although WindowServer will throttle those, and only some will
77            be shown on the screen.
78
79         This change introduces a new paint scheduling model where painting is
80         driven by a "RenderingUpdateScheduler", which only triggers paints once
81         per 16.7ms frame.
82
83         Code that previously scheduled a compositing layer flush now schedules a
84         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
85         callback. When the render happens, we service requestAnimationFrame callbacks,
86         Web Animations and intersection observations per the "Update the rendering"
87         step of the HTML Event Loop specification
88         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
89
90         In the future, more rendering steps will be added to this code.
91
92         * Sources.txt:
93         * WebCore.xcodeproj/project.pbxproj:
94         * accessibility/mac/AXObjectCacheMac.mm:
95         Fix layout tests by adding null check.
96
97         * animation/DocumentAnimationScheduler.cpp: Removed.
98         * animation/DocumentAnimationScheduler.h: Removed.
99         * animation/DocumentTimeline.cpp:
100         (WebCore::DocumentTimeline::DocumentTimeline):
101         (WebCore::DocumentTimeline::updateThrottlingState):
102         (WebCore::DocumentTimeline::resumeAnimations):
103         (WebCore::DocumentTimeline::liveCurrentTime const):
104         (WebCore::DocumentTimeline::currentTime):
105         (WebCore::DocumentTimeline::animationTimingDidChange):
106         (WebCore::DocumentTimeline::scheduleAnimationResolution):
107         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
108         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
109         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
110         (WebCore::DocumentTimeline::scheduleNextTick):
111         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
112         Simplify this function by handling the case of no-animations separately.
113
114         (WebCore::DocumentTimeline::resolveAnimationsForElement):
115         Simplify the loop and delete hasPendingAcceleratedAnimations because it
116         is initialized to true and is not changed inside the loop.
117
118         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
119         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
120         * animation/DocumentTimeline.h:
121         * dom/Document.cpp:
122         (WebCore::Document::resolveStyle):
123         There is no need to force update in resolveStyle(). notifyFlushRequired()
124         will be called eventually which will scheduleRenderingUpdate().
125
126         (WebCore::Document::prepareForDestruction):
127         (WebCore::Document::updateAnimationsAndSendEvents):
128         (WebCore::Document::serviceRequestAnimationFrameCallbacks):
129         (WebCore::Document::windowScreenDidChange):
130         (WebCore::Document::updateIntersectionObservations):
131         (WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
132         (WebCore::Document::animationScheduler): Deleted.
133         * dom/Document.h:
134         (WebCore::Document::numberOfIntersectionObservers const):
135         * dom/ScriptedAnimationController.cpp:
136         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
137         (WebCore::ScriptedAnimationController::scheduleAnimation):
138         (WebCore::ScriptedAnimationController::animationTimerFired):
139         (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
140         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
141         * dom/ScriptedAnimationController.h:
142         * page/FrameView.cpp:
143         (WebCore::FrameView::viewportContentsChanged):
144         * page/IntersectionObserver.cpp:
145         (WebCore::IntersectionObserver::observe):
146         * page/Page.cpp:
147         (WebCore::Page::Page):
148         (WebCore::Page::layoutIfNeeded):
149         (WebCore::Page::renderingUpdate):
150         (WebCore::Page::renderingUpdateScheduler):
151         (WebCore::Page::willDisplayPage): Deleted.
152         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
153         (WebCore::Page::updateIntersectionObservations): Deleted.
154         (WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
155         * page/Page.h:
156         * page/PageOverlayController.cpp:
157         (WebCore::PageOverlayController::didChangeViewExposedRect):
158         (WebCore::PageOverlayController::notifyFlushRequired):
159         * page/ResourceUsageData.h:
160         Include header files that become missing because of adding 
161         RenderingUpdateScheduler.cpp.
162
163         * page/RenderingUpdateScheduler.cpp: Added.
164         (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
165         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
166         (WebCore::RenderingUpdateScheduler::startTimer):
167         (WebCore::RenderingUpdateScheduler::clearTimer):
168         (WebCore::RenderingUpdateScheduler::windowScreenDidChange):
169         (WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
170         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
171         * page/RenderingUpdateScheduler.h: Added.
172         (WebCore::RenderingUpdateScheduler::create):
173         * page/ios/ContentChangeObserver.h:
174         Include header files that become missing because of adding 
175         RenderingUpdateScheduler.cpp.
176
177         * page/mac/ServicesOverlayController.mm:
178         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
179         * rendering/RenderLayerCompositor.cpp:
180         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
181
182 2019-03-07  Zalan Bujtas  <zalan@apple.com>
183
184         [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
185         https://bugs.webkit.org/show_bug.cgi?id=195353
186         <rdar://problem/48626394>
187
188         Reviewed by Simon Fraser.
189
190         Move content observation tests to a dedicated directory.
191
192         Tests: fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html
193                fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html
194                fast/events/touch/ios/content-observation/stuck-with-hover-state.html
195                fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html
196                fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html
197
198         * page/Settings.yaml:
199         * page/ios/ContentChangeObserver.cpp:
200         (WebCore::ContentChangeObserver::didInstallDOMTimer):
201         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
202         * page/ios/ContentChangeObserver.h:
203         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
204         * testing/InternalSettings.cpp:
205         (WebCore::InternalSettings::resetToConsistentState):
206
207 2019-03-07  John Wilander  <wilander@apple.com>
208
209         Make sure an empty host matches the internal representation "nullOrigin" in WebCore::RegistrableDomain::matches()
210         https://bugs.webkit.org/show_bug.cgi?id=195435
211
212         Reviewed by Brent Fulgham.
213
214         No new tests. Tests are currently failing and will pass again with
215         this patch.
216
217         WebCore::RegistrableDomain::matches() is a quick way to compare a
218         RegistrableDomain with a URL. Since RegistrableDomain represents the
219         empty host as "nullOrigin," a URL with an empty host needs to match
220         that representation in WebCore::RegistrableDomain::matches().
221         Failure to do so caused debug assertions in fast/ layout tests after
222         https://trac.webkit.org/changeset/242603/webkit.
223
224         * platform/RegistrableDomain.h:
225         (WebCore::RegistrableDomain::matches const):
226
227 2019-03-07  Justin Fan  <justin_fan@apple.com>
228
229         Unreviewed build fixes since MTLClampToBorderColor is only supported on macOS.
230
231         * Modules/webgpu/GPUSamplerDescriptor.idl:
232         * platform/graphics/gpu/GPUSamplerDescriptor.h:
233         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Forgot include.
234         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
235         (WebCore::mtlAddressModeForAddressMode):
236         (WebCore::tryCreateMtlSamplerState):
237         (WebCore::mtlBorderColorForBorderColor): Deleted.
238
239 2019-03-07  Justin Fan  <justin_fan@apple.com>
240
241         [Web GPU] GPUSampler implementation
242         https://bugs.webkit.org/show_bug.cgi?id=195427
243         <rdar://problem/48686011>
244
245         Reviewed by Dean Jackson.
246
247         Implement ability to create GPUSamplers and use them as pipeline resource bindings.
248
249         Test: texture-triangle-strip.html updated.
250
251         Add symbols to project:
252         * CMakeLists.txt:
253         * DerivedSources-input.xcfilelist:
254         * DerivedSources-output.xcfilelist:
255         * DerivedSources.make:
256         * Sources.txt:
257         * SourcesCocoa.txt:
258         * WebCore.xcodeproj/project.pbxproj:
259         * bindings/js/WebCoreBuiltinNames.h:
260
261         GPUSampler creation:
262         * Modules/webgpu/GPUSamplerDescriptor.idl: Added.
263         * Modules/webgpu/WebGPUDevice.cpp:
264         (WebCore::WebGPUDevice::createSampler const): Added.
265         * Modules/webgpu/WebGPUDevice.h:
266         * Modules/webgpu/WebGPUDevice.idl:
267         * Modules/webgpu/WebGPUSampler.cpp: Added.
268         (WebCore::WebGPUSampler::create):
269         (WebCore::WebGPUSampler::WebGPUSampler):
270         * Modules/webgpu/WebGPUSampler.h: Added.
271         (WebCore::WebGPUSampler::sampler const):
272         * Modules/webgpu/WebGPUSampler.idl: Added.
273         * platform/graphics/gpu/GPUDevice.cpp:
274         (WebCore::GPUDevice::tryCreateSampler const): Added.
275         * platform/graphics/gpu/GPUDevice.h:
276         * platform/graphics/gpu/GPUSampler.h: Added.
277         (WebCore::GPUSampler::platformSampler const):
278         * platform/graphics/gpu/GPUSamplerDescriptor.h: Added.
279         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: Added.
280         (WebCore::mtlAddressModeForAddressMode):
281         (WebCore::mtlBorderColorForBorderColor):
282         (WebCore::mtlMinMagFilterForFilterMode):
283         (WebCore::mtlMipFilterForFilterMode):
284         (WebCore::tryCreateMtlSamplerState):
285         (WebCore::GPUSampler::tryCreate):
286         (WebCore::GPUSampler::GPUSampler):
287
288         Move GPUCompareFunction to Utils for shared use.
289         * platform/graphics/gpu/GPUCompareFunction.h:
290         * platform/graphics/gpu/GPUUtils.h:
291         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
292         (WebCore::tryCreateMtlDepthStencilState):
293         (WebCore::validateAndConvertDepthCompareFunctionToMtl): Deleted.
294         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
295         (WebCore::platformTextureFormatForGPUTextureFormat):
296         (WebCore::platformCompareFunctionForGPUCompareFunction):
297
298         Expand bind groups to accept GPUSamplers:
299         * Modules/webgpu/WebGPUBindGroupBinding.h:
300         * Modules/webgpu/WebGPUBindGroupBinding.idl:
301         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
302         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const):
303         * platform/graphics/gpu/GPUBindGroupBinding.h:
304         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
305         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
306         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
307         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
308         (WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Added.
309         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
310
311         Misc:
312         * Modules/webgpu/WebGPUTexture.cpp: Missing includes.
313         * Modules/webgpu/WebGPUTexture.h:
314         * Modules/webgpu/WebGPUSwapChain.cpp: Removed extra include.
315
316 2019-03-07  Commit Queue  <commit-queue@webkit.org>
317
318         Unreviewed, rolling out r242297.
319         https://bugs.webkit.org/show_bug.cgi?id=195430
320
321         Broke Microsoft Visio. (Requested by dydz on #webkit).
322
323         Reverted changeset:
324
325         "[iOS] Turn mouse event simulation on by default"
326         https://bugs.webkit.org/show_bug.cgi?id=195218
327         https://trac.webkit.org/changeset/242297
328
329 2019-03-07  Sihui Liu  <sihui_liu@apple.com>
330
331         Crash in com.apple.WebCore: WebCore::IDBTransaction::pendingOperationTimerFired + 72
332         https://bugs.webkit.org/show_bug.cgi?id=195214
333         <rdar://problem/48461116>
334
335         Reviewed by Geoffrey Garen.
336
337         When IDBTransaction is ready to commit, a commit operation would be schedule to 
338         m_pendingTransactionOperationQueue. If connection to IDBServer is lost, pending operations are moved to 
339         m_transactionOperationsInProgressQueue and will be completed with TransactionOperation::doComplete. doComplete 
340         executes complete function of the operation, clears the complete function, and then removes the operation from 
341         m_transactionOperationsInProgressQueue. In doComplete, we do early return when complete function is null, 
342         since the doComplete could be invoked twice due to the race conditions between receiving "operation complete" 
343         message from server and client-side abort.
344
345         However, commit operation does not have a complete function because it should be the last operation of 
346         transaction and it gets removed from queue in its perform function. A commit operation would not be removed from 
347         m_transactionOperationsInProgressQueue because of the early return. It would be removed from 
348         m_transactionOperationMap, which may hold the last ref to the commit operation, in 
349         IDBTransaction::connectionClosedFromServer. In this case, when pendingOperationTimerFired is called later, the 
350         commit operation left in m_transactionOperationsInProgressQueue would be used and found to be freed. We should
351         not use null check of complete function to decide whether an operation is completed.
352
353         * Modules/indexeddb/client/TransactionOperation.h:
354         (WebCore::IDBClient::TransactionOperation::doComplete):
355
356 2019-03-07  John Wilander  <wilander@apple.com>
357
358         Resource Load Statistics: Log first-party navigations with link decoration
359         https://bugs.webkit.org/show_bug.cgi?id=195301
360         <rdar://problem/48569971>
361
362         Reviewed by Brent Fulgham.
363
364         Test: http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html
365
366         This patch adds two new members to WebCore::ResourceLoadStatistics:
367         - topFrameLinkDecorationsFrom, a set of domains
368         - gotLinkDecorationFromPrevalentResource, a boolean state
369
370         * loader/ResourceLoadStatistics.cpp:
371         (WebCore::ResourceLoadStatistics::encode const):
372         (WebCore::ResourceLoadStatistics::decode):
373         (WebCore::ResourceLoadStatistics::toString const):
374         (WebCore::ResourceLoadStatistics::merge):
375         * loader/ResourceLoadStatistics.h:
376
377 2019-03-07  Simon Fraser  <simon.fraser@apple.com>
378
379         [iOS WK] REGRESSION (r242132): Fixed position banners flicker and move when scrolling (Apple, Tesla, YouTube, Reddit)
380         https://bugs.webkit.org/show_bug.cgi?id=195396
381         rdar://problem/48518959
382
383         Reviewed by Antti Koivisto.
384         
385         r242132 introduced two issues that contributed to jumpiness of position:fixed layers when scrolling.
386         
387         First, ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling() would early return if the scroll position
388         hadn't changed. It also needs to check the supplied layoutViewport (if any), but in some cases running the
389         notifyRelatedNodesAfterScrollPositionChange() code is necessary even without a scroll position change:
390         if the web process has committed new scrolling tree state (e.g. with new fixed constraints) since
391         the last call, we have to run the layer positioning code to have fixed layers re-adjust their position relative
392         to the root. This was the primary bug fix.
393
394         Secondly, a layer tree commit can give ScrollingTreeFrameScrollingNode a new layout viewport, but we need to
395         adjust this by the scrolling tree's current scroll position in case it gets used before the next scroll.
396
397         Currently no way to test this, as it's very timing-dependent.
398
399         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
400         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
401         (WebCore::ScrollingTreeFrameScrollingNode::scrollPositionAndLayoutViewportMatch):
402         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
403         * page/scrolling/ScrollingTreeScrollingNode.cpp:
404         (WebCore::ScrollingTreeScrollingNode::scrollPositionAndLayoutViewportMatch):
405         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
406         * page/scrolling/ScrollingTreeScrollingNode.h:
407
408 2019-03-07  Youenn Fablet  <youenn@apple.com>
409
410         Introduce a quota manager for Cache API/Service Worker/IDB storage
411         https://bugs.webkit.org/show_bug.cgi?id=195283
412
413         Reviewed by Chris Dumez.
414
415         Introduce a generic quota manager and quota users to be used in Network Process.
416         Quota manager/users are scoped by client origin.
417         Quota manager is used to check for quota by an entity wanting to execute a storage task of a given taskSize.
418         Quota manager will check the current space used by all its quota users.
419         If the size + taskSize is above quota, it will call a function to try extend the quota.
420         In the meantime, the task (and all tasks that may be added) are queued.
421
422         Once the new quota is received, the quota manager will either allow or disallow the first task in the queue.
423         The quota manager will try to execute as many tasks as possible with the provided quota.
424         If some tasks are remaining and quota limit is hit, the quota manager will compute the space needed for all remaining requests
425         and do another quota extension request.
426
427         * Sources.txt:
428         * WebCore.xcodeproj/project.pbxproj:
429         * page/ClientOrigin.h:
430         * storage/StorageQuotaManager.cpp: Added.
431         (WebCore::StorageQuotaManager::~StorageQuotaManager):
432         (WebCore::StorageQuotaManager::spaceUsage const):
433         (WebCore::StorageQuotaManager::requestSpace):
434         (WebCore::StorageQuotaManager::askForMoreSpace):
435         (WebCore::StorageQuotaManager::processPendingRequests):
436         * storage/StorageQuotaManager.h: Added.
437         (WebCore::StorageQuotaManager::StorageQuotaManager):
438         (WebCore::StorageQuotaManager::addUser):
439         (WebCore::StorageQuotaManager::removeUser):
440         * storage/StorageQuotaUser.h: Added.
441
442 2019-03-07  John Wilander  <wilander@apple.com>
443
444         Resource Load Statistics: Make it possible to purge only script-accessible cookies
445         https://bugs.webkit.org/show_bug.cgi?id=195383
446         <rdar://problem/48570136>
447
448         Reviewed by Brent Fulgham.
449
450         Test: http/tests/resourceLoadStatistics/delete-script-accessible-cookies.html
451
452         This patch provides the ability to purge all script-accessible cookies while leaving
453         HttpOnly cookies in place.
454
455         * loader/CookieJar.h:
456             Added boolean enum IncludeHttpOnlyCookies for use as function parameter.
457         * platform/network/NetworkStorageSession.h:
458         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
459         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
460             Support for the new IncludeHttpOnlyCookies flag.
461         * platform/network/curl/NetworkStorageSessionCurl.cpp:
462         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
463             Stubbed out the new function and added a FIXME comment.
464         * platform/network/soup/NetworkStorageSessionSoup.cpp:
465         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
466             Stubbed out the new function and added a FIXME comment.
467
468 2019-03-06  Mark Lam  <mark.lam@apple.com>
469
470         Exception is a JSCell, not a JSObject.
471         https://bugs.webkit.org/show_bug.cgi?id=195392
472
473         Reviewed by Saam Barati.
474
475         * bridge/objc/objc_utility.h:
476         * bridge/objc/objc_utility.mm:
477         (JSC::Bindings::throwError):
478         * bridge/runtime_object.cpp:
479         (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
480         * bridge/runtime_object.h:
481
482 2019-03-07  Devin Rousso  <drousso@apple.com>
483
484         Web Inspector: Canvas: lazily create the agent
485         https://bugs.webkit.org/show_bug.cgi?id=195241
486
487         Reviewed by Joseph Pecoraro.
488
489         No functionality change.
490
491         * html/canvas/CanvasRenderingContext.h:
492         * html/canvas/CanvasRenderingContext.cpp:
493         (WebCore::CanvasRenderingContext::instances): Added.
494         (WebCore::CanvasRenderingContext::instancesMutex): Added.
495         (WebCore::CanvasRenderingContext::CanvasRenderingContext):
496         (WebCore::CanvasRenderingContext::~CanvasRenderingContext):
497
498         * html/canvas/WebGLProgram.h:
499         * html/canvas/WebGLProgram.cpp:
500         (WebCore::WebGLProgram::instances): Added.
501         (WebCore::WebGLProgram::instancesMutex): Added.
502         (WebCore::WebGLProgram::WebGLProgram):
503         (WebCore::WebGLProgram::~WebGLProgram):
504         * html/canvas/WebGLRenderingContextBase.cpp:
505         (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
506
507         * inspector/InspectorController.cpp:
508         (WebCore::InspectorController::InspectorController):
509         (WebCore::InspectorController::createLazyAgents):
510
511         * inspector/agents/InspectorCanvasAgent.h:
512         * inspector/agents/InspectorCanvasAgent.cpp:
513         (WebCore::InspectorCanvasAgent::enable):
514         (WebCore::InspectorCanvasAgent::disable):
515         (WebCore::InspectorCanvasAgent::frameNavigated):
516         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
517         (WebCore::InspectorCanvasAgent::canvasDestroyed):
518         (WebCore::InspectorCanvasAgent::didCreateProgram):
519         (WebCore::InspectorCanvasAgent::willDeleteProgram):
520         (WebCore::InspectorCanvasAgent::bindCanvas): Added.
521         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
522
523         * inspector/InspectorInstrumentation.h:
524         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
525         (WebCore::InspectorInstrumentation::didCreateProgram):
526         (WebCore::InspectorInstrumentation::willDeleteProgram):
527
528 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
529
530         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
531         https://bugs.webkit.org/show_bug.cgi?id=195346
532
533         Reviewed by Fujii Hironori.
534
535         * platform/graphics/win/FontCacheWin.cpp:
536         (WebCore::appendLinkedFonts):
537         (WebCore::getLinkedFonts):
538         (WebCore::FontCache::systemFallbackForCharacters):
539         (WebCore::FontCache::fontFromDescriptionAndLogFont):
540         (WebCore::createGDIFont):
541         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
542         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
543         (WebCore::FontCustomPlatformData::fontPlatformData):
544         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
545         (WebCore::GlyphPage::fill):
546         * platform/graphics/win/IconWin.cpp:
547         (WebCore::Icon::createIconForFiles):
548         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
549         (WebCore::mimeTypeCache):
550         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
551         * platform/graphics/win/UniscribeController.cpp:
552         (WebCore::UniscribeController::itemizeShapeAndPlace):
553         (WebCore::UniscribeController::shape):
554         * platform/network/win/DownloadBundleWin.cpp:
555         (WebCore::DownloadBundle::appendResumeData):
556         (WebCore::DownloadBundle::extractResumeData):
557         * platform/text/win/LocaleWin.cpp:
558         (WebCore::LCIDFromLocaleInternal):
559         (WebCore::LCIDFromLocale):
560         (WebCore::LocaleWin::getLocaleInfoString):
561         * platform/win/BString.cpp:
562         (WebCore::BString::BString):
563         * platform/win/ClipboardUtilitiesWin.cpp:
564         (WebCore::getWebLocData):
565         (WebCore::createGlobalData):
566         (WebCore::getFileDescriptorData):
567         (WebCore::getURL):
568         (WebCore::getCFData):
569         (WebCore::setCFData):
570         * platform/win/DragDataWin.cpp:
571         (WebCore::DragData::asFilenames const):
572         * platform/win/DragImageWin.cpp:
573         (WebCore::createDragImageIconForCachedImageFilename):
574         (WebCore::dragLabelFont):
575         * platform/win/MIMETypeRegistryWin.cpp:
576         (WebCore::mimeTypeForExtension):
577         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
578         * platform/win/PasteboardWin.cpp:
579         (WebCore::Pasteboard::read):
580         (WebCore::filesystemPathFromUrlOrTitle):
581         (WebCore::Pasteboard::writeURLToDataObject):
582         (WebCore::createGlobalImageFileDescriptor):
583         (WebCore::createGlobalHDropContent):
584         * platform/win/SSLKeyGeneratorWin.cpp:
585         (WebCore::signedPublicKeyAndChallengeString):
586         * platform/win/SharedBufferWin.cpp:
587         (WebCore::SharedBuffer::createFromReadingFile):
588         * rendering/RenderThemeWin.cpp:
589         (WebCore::fillFontDescription):
590         Use wchar helpers as needed.
591
592 2019-03-06  Devin Rousso  <drousso@apple.com>
593
594         Web Inspector: DOM Debugger: event breakpoints still fire when breakpoints are disabled
595         https://bugs.webkit.org/show_bug.cgi?id=195377
596         <rdar://problem/48651645>
597
598         Reviewed by Joseph Pecoraro and Matt Baker.
599
600         Test: inspector/dom-debugger/event-listener-breakpoints.html
601
602         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
603         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
604         (WebCore::InspectorDOMDebuggerAgent::willFireTimer):
605         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
606
607 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
608
609         Crash when attempting to change input type while dismissing datalist suggestions
610         https://bugs.webkit.org/show_bug.cgi?id=195384
611         <rdar://problem/48563718>
612
613         Reviewed by Brent Fulgham.
614
615         When closing a datalist suggestion menu, WebPageProxy sends a message to WebPage instructing it to tell its
616         active datalist suggestions picker to close. However, for a myriad of reasons, the suggestions picker (kept
617         alive by its text input type) may have already gone away by this point. To mitigate this, make WebPage weakly
618         reference its active datalist suggestions picker.
619
620         Test: fast/forms/datalist/change-input-type-after-closing-datalist-suggestions.html
621
622         * platform/DataListSuggestionPicker.h:
623
624         Make DataListSuggestionPicker capable of being weakly referenced. Additionally, fix some minor preexisting
625         issues in this header (#imports instead of #includes, as well as an unnecessary include of IntRect.h).
626
627 2019-03-06  Ryan Haddad  <ryanhaddad@apple.com>
628
629         Remove an unneeded assert that was added with r242113
630         https://bugs.webkit.org/show_bug.cgi?id=195391
631
632         Reviewed by Simon Fraser.
633
634         Many layout tests are failing ASSERT(m_mediaBufferingIsSuspended). Since m_mediaBufferingIsSuspended is
635         protected by an 'if' statement directly afterwards, the assertion should be safe to remove.
636
637         * page/Page.cpp:
638         (WebCore::Page::resumeAllMediaBuffering):
639
640 2019-03-06  Justin Fan  <justin_fan@apple.com>
641
642         Unreviewed build fix. Replace a forward declaration with an include.
643
644         * Modules/webgpu/WebGPUTextureView.cpp:
645         * Modules/webgpu/WebGPUTextureView.h:
646
647 2019-03-06  Justin Fan  <justin_fan@apple.com>
648
649         [Web GPU] GPUTexture and GPUTextureView updates, and related GPUBindGroup updates
650         https://bugs.webkit.org/show_bug.cgi?id=195347
651
652         Reviewed by Dean Jackson.
653
654         Implement the ability to display image data as a GPUTexture in the rendering pipeline. Improve GPUTexture and 
655         GPUTextureView implementations. Rename various bind group classes to GPU* to match API.
656
657         Test: webgpu/texture-triangle-strip.html
658
659         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
660         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Update to validate GPUTextureView resources.
661         * Modules/webgpu/WebGPUCommandBuffer.cpp: Move instead of copy the converted view objects.
662         (WebCore::WebGPUCommandBuffer::copyBufferToTexture):
663         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer):
664         (WebCore::WebGPUCommandBuffer::copyTextureToTexture):
665         * Modules/webgpu/WebGPUCommandBuffer.h:
666         (WebCore::WebGPUCommandBuffer::commandBuffer const): No longer returns const so used resources can be registered on it.
667         * Modules/webgpu/WebGPUDevice.cpp:
668         (WebCore::WebGPUDevice::createBindGroupLayout const): Rename WebGPUBindGroupLayoutDescriptor and replace unnecessary rvalue reference.
669         * Modules/webgpu/WebGPUDevice.h: Ditto.
670         * Modules/webgpu/WebGPUDevice.idl: Ditto.
671         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
672         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
673         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
674         * Modules/webgpu/WebGPUQueue.cpp:
675         (WebCore::WebGPUQueue::submit):
676         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
677         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
678         * Modules/webgpu/WebGPUTexture.cpp:
679         (WebCore::WebGPUTexture::~WebGPUTexture): Clean up any resources created for and from this WebGPUTexture.
680         (WebCore::WebGPUTexture::createDefaultTextureView): Now returns an empty object other than null on failure.
681         (WebCore::WebGPUTexture::destroy):
682         (WebCore::WebGPUTexture::destroyImpl):
683         * Modules/webgpu/WebGPUTexture.h: Keep a list of any views created from this texture.
684         * Modules/webgpu/WebGPUTexture.idl: Enable destroy.
685         * Modules/webgpu/WebGPUTextureView.cpp:
686         (WebCore::WebGPUTextureView::create):
687         (WebCore::WebGPUTextureView::WebGPUTextureView):
688         (WebCore::WebGPUTextureView::destroy):
689         * Modules/webgpu/WebGPUTextureView.h:
690         (WebCore::WebGPUTextureView::~WebGPUTextureView): Clean up any resources backing this WebGPUTextureView.
691         (WebCore::WebGPUTextureView::texture const):
692         (WebCore::WebGPUTextureView::texture): Deleted.
693         * platform/graphics/gpu/GPUBindGroupLayout.h:
694         * platform/graphics/gpu/GPUCommandBuffer.h:
695         (WebCore::GPUCommandBuffer::usedTextures const): Keep a list of all texture resources that will be used by this command buffer on submit.
696         (WebCore::GPUCommandBuffer::isEncodingPass const): Added to prevent multiple pass encoders from being active on one command buffer.
697         (WebCore::GPUCommandBuffer::setIsEncodingPass):
698         (WebCore::GPUCommandBuffer::useTexture):
699         * platform/graphics/gpu/GPUDevice.cpp:
700         (WebCore::GPUDevice::tryCreateBindGroupLayout const):
701         * platform/graphics/gpu/GPUDevice.h:
702         * platform/graphics/gpu/GPUPipelineLayout.cpp:
703         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
704         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp:
705         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
706         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
707         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
708         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
709         (): Deleted.
710         * platform/graphics/gpu/GPUQueue.h:
711         * platform/graphics/gpu/GPURenderPassEncoder.h:
712         * platform/graphics/gpu/GPUTexture.h:
713         (WebCore::GPUTexture::isReadOnly const):
714         (WebCore::GPUTexture::destroy):
715         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
716         (WebCore::MTLDataTypeForBindingType):
717         (WebCore::GPUBindGroupLayout::tryCreate):
718         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
719         (WebCore::GPUCommandBuffer::create):
720         (WebCore::GPUCommandBuffer::~GPUCommandBuffer): Ensure blitEncoder is ended before releasing it.
721         (WebCore::GPUCommandBuffer::endBlitEncoding):
722         (WebCore::GPUCommandBuffer::copyBufferToTexture): Ensure textures are marked for usage before submission occurs.
723         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
724         (WebCore::GPUCommandBuffer::copyTextureToTexture):
725         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
726         (WebCore::GPUDevice::create):
727         (WebCore::GPUDevice::GPUDevice):
728         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
729         (WebCore::GPUProgrammablePassEncoder::endPass):
730         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Now supports texture resources.
731         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Just moved.
732         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
733         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
734         (WebCore::GPUQueue::submit): Ensures destroyed GPUTextures are not submitted.
735         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
736         (WebCore::GPURenderPassEncoder::tryCreate): Ensure any other encoders are ended before attempting to activate a new one.
737         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
738         (WebCore::GPURenderPassEncoder::endPass): Invalidates the MTLCommandEncoder upon success.
739         (WebCore::GPURenderPassEncoder::setPipeline):
740         (WebCore::GPURenderPassEncoder::setVertexBuffers):
741         (WebCore::GPURenderPassEncoder::draw):
742         (WebCore::GPURenderPassEncoder::useResource):
743         (WebCore::GPURenderPassEncoder::setVertexBuffer):
744         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
745         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
746         (WebCore::GPUSwapChain::getNextTexture):
747         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
748         (WebCore::storageModeForPixelFormatAndSampleCount): 
749                 Always create MTLStorageModePrivate textures on macOS, as Web GPU doesn't provide CPU access to textures anyway.
750         (WebCore::tryCreateMtlTextureDescriptor):
751         (WebCore::GPUTexture::create):
752         (WebCore::GPUTexture::GPUTexture):
753         (WebCore::GPUTexture::tryCreateDefaultTextureView): Renamed from createDefaultTextureView.
754
755         Update files and symbols in project:
756         * CMakeLists.txt:
757         * DerivedSources-input.xcfilelist:
758         * DerivedSources-output.xcfilelist:
759         * DerivedSources.make:
760         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Removed.
761         * Modules/webgpu/GPUBindGroupLayoutBinding.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h.
762         * Modules/webgpu/GPUBindGroupLayoutBinding.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl.
763         * Modules/webgpu/GPUBindGroupLayoutDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h.
764         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl.
765         * Modules/webgpu/GPUShaderStageBit.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h.
766         * Modules/webgpu/GPUShaderStageBit.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl.
767         * Sources.txt:
768         * WebCore.xcodeproj/project.pbxproj:
769         * bindings/js/WebCoreBuiltinNames.h:
770
771 2019-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
772
773         [WHLSL] Pack and unpack data at entry points and exit points
774         https://bugs.webkit.org/show_bug.cgi?id=193877
775
776         Reviewed by Dean Jackson.
777
778         This implements the bulk of the rest of the Metal code generation piece.
779         Specifically, this patch adds support for the packing and unpacking steps
780         at the beginning of the entry point functions and all returns from those
781         functions. It does this by creating an object, EntryPointScaffolding, that
782         knows how to emit all the helper types, packing / unpacking code, and the
783         function signature. This patch also accepts parts of the
784         PipelineStateDescriptor so we know the data layout we should be packing and
785         unpacking.
786
787         This is the last patch before enough of the compiler is present that we can
788         start testing it. The next patch will start porting the test suite.
789
790         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
791         (WebCore::WHLSL::Metal::attributeForSemantic):
792         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
793         (WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const):
794         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
795         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
796         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
797         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
798         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
799         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
800         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
801         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
802         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
803         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
804         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
805         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding):
806         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
807         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
808         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
809         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
810         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::ComputeEntryPointScaffolding):
811         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::helperTypes):
812         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
813         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::unpack):
814         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack):
815         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes): Deleted.
816         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature): Deleted.
817         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack): Deleted.
818         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack): Deleted.
819         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
820         (WebCore::WHLSL::Metal::EntryPointScaffolding::parameterVariables):
821         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
822         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
823         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
824         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
825         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
826         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
827         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
828         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
829         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups):
830         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups):
831         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
832         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
833         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups):
834         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
835         (WebCore::WHLSL::Metal::sharedMetalFunctions):
836         (WebCore::WHLSL::Metal::metalFunctions):
837         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
838         * Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
839         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
840         (WebCore::WHLSL::Metal::generateMetalCodeShared):
841         (WebCore::WHLSL::Metal::generateMetalCode):
842         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
843         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
844         (WebCore::WHLSL::Intrinsics::float2Type const):
845         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: Added.
846         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: Added.
847         (WebCore::WHLSL::prepareShared):
848         (WebCore::WHLSL::prepare):
849         * Modules/webgpu/WHLSL/WHLSLPrepare.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
850         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Added.
851         (WebCore::WHLSL::findEntryPoint):
852         (WebCore::WHLSL::matchMode):
853         (WebCore::WHLSL::matchResources):
854         (WebCore::WHLSL::matchInputsOutputs):
855         (WebCore::WHLSL::isAcceptableFormat):
856         (WebCore::WHLSL::matchVertexAttributes):
857         (WebCore::WHLSL::matchColorAttachments):
858         (WebCore::WHLSL::matchDepthAttachment):
859         (WebCore::WHLSL::matchSemantics):
860         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp.
861         * Sources.txt:
862         * WebCore.xcodeproj/project.pbxproj:
863
864 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
865
866         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
867         https://bugs.webkit.org/show_bug.cgi?id=195300
868
869         Reviewed by Simon Fraser.
870
871         Move isTransparentOrFullyClippedRespectingParentFrames() from RenderObject to RenderLayer, since this function
872         asks questions about RenderLayers rather than their renderers. No change in behavior.
873
874         * rendering/RenderLayer.cpp:
875         (WebCore::enclosingFrameRenderLayer):
876         (WebCore::parentLayerCrossFrame):
877
878         Some static helpers currently in RenderObject that walk up the layer hierarchy through subframes are redundant
879         with static helpers in RenderLayer. Now that isTransparentOrFullyClippedRespectingParentFrames exists in
880         RenderLayer, simply use this existing helper instead and split logic to grab the enclosing layer around the
881         owner element of a frame into a separate helper.
882
883         * rendering/RenderLayer.h:
884         * rendering/RenderObject.cpp:
885         (WebCore::enclosingFrameRenderLayer): Deleted.
886         (WebCore::parentLayerCrossingFrameBoundaries): Deleted.
887         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const): Deleted.
888
889         Moved from RenderObject.
890
891         * rendering/RenderObject.h:
892
893 2019-03-06  Sihui Liu  <sihui_liu@apple.com>
894
895         Assertion Failed: m_databaseQueue.isKilled() in UniqueIDBDatabase::~UniqueIDBDatabase()
896         https://bugs.webkit.org/show_bug.cgi?id=195073
897         <rdar://problem/48285200>
898
899         Reviewed by Geoffrey Garen.
900
901         r240931 removed a retain cycle between IDBConnectionToServer and IDBConnectionToServerDelegate, so 
902         IDBConnectionToServerDelegate, or InProcessIDBServer would not live forever. When IDBDatabase is gone, 
903         InProcessIDBServer would schedule a notifification to IDBServer with databaseConnectionClosed. IDBServer would 
904         then notify UniqueIDBDatabase. When UniqueIDBDatabase finds all database connections are gone, it would acquires
905         its only reference pointer from IDBServer schedule and perform a shutdown that kills its database task queue.
906
907         The assertion failure tells us UniqueIDBDatabase was destructed at when IDBServer was destructed, which means 
908         UniqueIDBDatabase had not acquired its pointer. It's probably because UniqueIDBDatabase had unfinished tasks or
909         the operation timer function had not been executed. Since UniqueIDBDatabase needs to complete shutdown process,
910         we should make IDBServer live as long as UniqueIDBDatabase by keeping a reference pointer of IDBServer in 
911         UniqueIDBDatabase. 
912
913         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
914         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
915         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
916         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
917         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
918         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
919         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
920         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
921         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
922         * Modules/indexeddb/server/UniqueIDBDatabase.h:
923         (WebCore::IDBServer::UniqueIDBDatabase::server):
924
925 2019-03-06  Rob Buis  <rbuis@igalia.com>
926
927         Consider supporting the `referrerpolicy` attribute.
928         https://bugs.webkit.org/show_bug.cgi?id=179053
929
930         Reviewed by Darin Adler.
931
932         This patch adds 'referrerpolicy' attribute support for iframe.
933         If set, the value is restricted to the ReferrerPolicy enum, and
934         if valid it is used for the subframe load.
935         If not set or invalid, the current behavior is kept.
936
937         Tests: http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http-http.html
938                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http.https.html
939                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/same-origin.html
940                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http-http.html
941                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http.https.html
942                http/tests/referrer-policy-iframe/no-referrer/same-origin.html
943                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http-http.html
944                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http.https.html
945                http/tests/referrer-policy-iframe/origin-when-cross-origin/same-origin.html
946                http/tests/referrer-policy-iframe/origin/cross-origin-http-http.html
947                http/tests/referrer-policy-iframe/origin/cross-origin-http.https.html
948                http/tests/referrer-policy-iframe/origin/same-origin.html
949                http/tests/referrer-policy-iframe/same-origin/cross-origin-http-http.html
950                http/tests/referrer-policy-iframe/same-origin/cross-origin-http.https.html
951                http/tests/referrer-policy-iframe/same-origin/same-origin.html
952                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http-http.html
953                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http.https.html
954                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/same-origin.html
955                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http-http.html
956                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http.https.html
957                http/tests/referrer-policy-iframe/strict-origin/same-origin.html
958                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http-http.html
959                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http.https.html
960                http/tests/referrer-policy-iframe/unsafe-url/same-origin.html
961
962         * html/HTMLAttributeNames.in:
963         * html/HTMLFrameOwnerElement.h:
964         (WebCore::HTMLFrameOwnerElement::referrerPolicy const):
965         * html/HTMLIFrameElement.cpp:
966         (WebCore::HTMLIFrameElement::setReferrerPolicyForBindings):
967         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
968         (WebCore::HTMLIFrameElement::referrerPolicy const):
969         * html/HTMLIFrameElement.h:
970         * html/HTMLIFrameElement.idl:
971         * loader/SubframeLoader.cpp:
972         (WebCore::SubframeLoader::loadSubframe):
973         * page/RuntimeEnabledFeatures.h:
974         (WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const):
975         (WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled):
976         * platform/ReferrerPolicy.cpp:
977         (WebCore::parseReferrerPolicy):
978         * platform/ReferrerPolicy.h:
979
980 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
981
982         [curl] Remove unnecessary file.
983         https://bugs.webkit.org/show_bug.cgi?id=195350
984
985         Reviewed by Fujii Hironori.
986
987         Removed unused file.
988
989         No new tests. No change in behavior.
990
991         * platform/network/curl/CookieJarCurlDatabase.cpp: Removed.
992
993 2019-03-05  Eric Liang  <ericliang@apple.com>
994
995         AX: Add remote search support for keyboard focusable element search type
996         https://bugs.webkit.org/show_bug.cgi?id=195336
997
998         Reviewed by Chris Fleizach.
999
1000         Added AXKeyboardFocusable search key to return default keyboard-focusable elements for accessibility.
1001
1002         Test: accessibility/mac/search-predicate-keyboard-focusable.html
1003
1004         * accessibility/AccessibilityObject.cpp:
1005         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
1006         (WebCore::AccessibilityObject::isKeyboardFocusable const):
1007         * accessibility/AccessibilityObject.h:
1008         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1009         (createAccessibilitySearchKeyMap):
1010
1011 2019-03-05  Don Olmstead  <don.olmstead@sony.com>
1012
1013         [WinCairo] Enable CSS Typed OM
1014         https://bugs.webkit.org/show_bug.cgi?id=195340
1015
1016         Reviewed by Myles C. Maxfield.
1017
1018         * bindings/js/CallTracerTypes.h:
1019
1020 2019-03-05  Sihui Liu  <sihui_liu@apple.com>
1021
1022         Fix a typo in Web SQL quirk
1023         https://bugs.webkit.org/show_bug.cgi?id=195338
1024
1025         Reviewed by Geoffrey Garen.
1026
1027         * page/Quirks.cpp:
1028         (WebCore::Quirks::hasWebSQLSupportQuirk const):
1029
1030 2019-03-05  Daniel Bates  <dabates@apple.com>
1031
1032         [iOS] Should not scroll when checkbox, radio, submit, reset, or button is spacebar activated
1033         https://bugs.webkit.org/show_bug.cgi?id=195281
1034         <rdar://problem/48564347>
1035
1036         Reviewed by Simon Fraser.
1037
1038         Do not call the base class's default event handler (HTMLTextFormControlElement::defaultEventHandler())
1039         when WebCore sees a keydown of the spacebar as we consider such an event as handled.
1040         Otherwise, calling the base class's default event handler ultimately gives the embedding
1041         client a chance to wrongly handle the event. In the case of iOS, keydown of the spacebar
1042         causes the page to scroll.
1043
1044         WebCore implements spacebar activation on keydown for form controls. For IE compatibility
1045         WebCore does not mark such keydown events as handled so that a DOM keypress event will
1046         be subsequently dispatched. The current logic only skips calling the base class's default
1047         event handler if the DOM event was not marked handled. This is insufficient. We need to
1048         know whether WebCore handled the event. If asking the input type to handle the key down
1049         marks the DOM event as handled then, clearly, WebCore handled the event. However, if the
1050         event is not marked as handled, but WebCore actually accounted for this event then we need
1051         to know this so that we do not call the base class's default event handler and ultimately
1052         the embedding client asking for an interpretation of the key event. Towards this, have
1053         InputType::handleKeydownEvent() return a bit whether or not the base class's default
1054         event handler should be invoked.
1055
1056         Tests: fast/events/ios/activating-button-should-not-scroll-page.html
1057                fast/events/ios/activating-checkbox-should-not-scroll-page.html
1058                fast/events/ios/activating-radio-button-should-not-scroll-page.html
1059                fast/events/ios/activating-reset-button-should-not-scroll-page.html
1060                fast/events/ios/activating-submit-button-should-not-scroll-page.html
1061
1062         * html/BaseCheckableInputType.cpp:
1063         (WebCore::BaseCheckableInputType::handleKeydownEvent): Return ShouldCallBaseEventHandler::No
1064         if WebCore handled the spacebar activation. Otherewise, return ShouldCallBaseEventHandler::Yes.
1065         * html/BaseCheckableInputType.h:
1066         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1067         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent): Ditto.
1068         * html/BaseChooserOnlyDateAndTimeInputType.h:
1069         * html/BaseClickableWithKeyInputType.cpp:
1070         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
1071         * html/BaseClickableWithKeyInputType.h:
1072         * html/HTMLInputElement.cpp:
1073         (WebCore::HTMLInputElement::defaultEventHandler): Do not fallthrough and call the base class's default
1074         event handler if the input type told us it handled the event regardless of whether the event was handled
1075         from the perspective of the DOM.
1076         * html/InputType.cpp:
1077         (WebCore::InputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
1078         * html/InputType.h:
1079
1080         * html/NumberInputType.cpp:
1081         (WebCore::NumberInputType::handleKeydownEvent):
1082         * html/NumberInputType.h:
1083         * html/RadioInputType.cpp:
1084         (WebCore::RadioInputType::handleKeydownEvent):
1085         * html/RadioInputType.h:
1086         * html/RangeInputType.cpp:
1087         (WebCore::RangeInputType::handleKeydownEvent):
1088         * html/RangeInputType.h:
1089         * html/SearchInputType.cpp:
1090         (WebCore::SearchInputType::handleKeydownEvent):
1091         * html/SearchInputType.h:
1092         * html/TextFieldInputType.cpp:
1093         (WebCore::TextFieldInputType::handleKeydownEvent):
1094         * html/TextFieldInputType.h:
1095         Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
1096
1097 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
1098
1099         [Curl] Implement Cookie Accept Policy.
1100         https://bugs.webkit.org/show_bug.cgi?id=191645
1101
1102         Reviewed by Fujii Hironori.
1103
1104         Make Curl network layer respect to coookie accept policy.
1105         This patch fixes tests below on TestRunner, but doesn't fix tests on DumpRenderTree.
1106
1107         Tests: http/tests/cookies/only-accept-first-party-cookies.html
1108                http/tests/cookies/third-party-cookie-relaxing.html
1109                http/tests/security/cookies/third-party-cookie-blocking-redirect.html
1110                http/tests/security/cookies/third-party-cookie-blocking-user-action.html
1111                http/tests/security/cookies/third-party-cookie-blocking-xslt.xml
1112                http/tests/security/cookies/third-party-cookie-blocking.html
1113
1114         * platform/network/curl/CookieJarCurl.cpp:
1115         (WebCore::cookiesForSession):
1116         (WebCore::CookieJarCurl::setCookiesFromDOM const):
1117         (WebCore::CookieJarCurl::setCookiesFromHTTPResponse const):
1118         (WebCore::CookieJarCurl::setCookieAcceptPolicy const):
1119         (WebCore::CookieJarCurl::cookieAcceptPolicy const):
1120         (WebCore::CookieJarCurl::getRawCookies const):
1121         * platform/network/curl/CookieJarCurl.h:
1122         * platform/network/curl/CookieJarDB.cpp:
1123         (WebCore::CookieJarDB::openDatabase):
1124         (WebCore::CookieJarDB::isEnabled const):
1125         (WebCore::CookieJarDB::checkCookieAcceptPolicy):
1126         (WebCore::CookieJarDB::hasCookies):
1127         (WebCore::CookieJarDB::searchCookies):
1128         (WebCore::CookieJarDB::canAcceptCookie):
1129         (WebCore::CookieJarDB::setCookie):
1130         (WebCore::CookieJarDB::setEnabled): Deleted.
1131         * platform/network/curl/CookieJarDB.h:
1132         (WebCore::CookieJarDB::setAcceptPolicy):
1133         (WebCore::CookieJarDB::acceptPolicy const):
1134         * platform/network/curl/CookieUtil.cpp:
1135         (WebCore::CookieUtil::parseCookieAttributes):
1136         (WebCore::CookieUtil::parseCookieHeader):
1137         * platform/network/curl/CurlResourceHandleDelegate.cpp:
1138         (WebCore::handleCookieHeaders):
1139         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
1140
1141 2019-03-05  Zalan Bujtas  <zalan@apple.com>
1142
1143         [ContentChangeObserver] Assert on if notify content change is allowed
1144         https://bugs.webkit.org/show_bug.cgi?id=195332
1145         <rdar://problem/48603276>
1146
1147         Reviewed by Simon Fraser.
1148
1149         Assert we don't notify the client about the state change while in handleSyntheticClick().
1150
1151         * page/ios/ContentChangeObserver.cpp:
1152         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
1153         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
1154         (WebCore::ContentChangeObserver::adjustObservedState):
1155         * page/ios/ContentChangeObserver.h:
1156         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1157         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
1158
1159 2019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
1160
1161         SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
1162         https://bugs.webkit.org/show_bug.cgi?id=195333
1163         <rdar://problem/48475802>
1164
1165         Reviewed by Simon Fraser.
1166
1167         Because the SVG1.1 specs states that the newItem should be removed from
1168         its original list before adding it to another list,
1169         SVGPathSegList.insertItemBefore() should fail if the new item belongs to
1170         an animating animPathSegList since it is read-only.
1171
1172         Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
1173
1174         * svg/SVGPathSegList.cpp:
1175         (WebCore::SVGPathSegList::processIncomingListItemValue):
1176
1177 2019-03-05  Zalan Bujtas  <zalan@apple.com>
1178
1179         [ContentChangeObserver] Send content change notification through adjustObservedState
1180         https://bugs.webkit.org/show_bug.cgi?id=195328
1181         <rdar://problem/48601143>
1182
1183         Reviewed by Simon Fraser.
1184
1185         Have a dedicated place for the notification logic.
1186
1187         * page/ios/ContentChangeObserver.cpp:
1188         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
1189         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1190         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1191         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
1192         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
1193         (WebCore::ContentChangeObserver::mouseMovedDidStart):
1194         (WebCore::ContentChangeObserver::adjustObservedState):
1195         (WebCore::ContentChangeObserver::registerDOMTimer): Deleted.
1196         (WebCore::ContentChangeObserver::unregisterDOMTimer): Deleted.
1197         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded): Deleted.
1198         * page/ios/ContentChangeObserver.h:
1199         (WebCore::ContentChangeObserver::registerDOMTimer):
1200         (WebCore::ContentChangeObserver::unregisterDOMTimer):
1201
1202 2019-03-05  Youenn Fablet  <youenn@apple.com>
1203
1204         MockLibWebRTCPeerConnection is leaking some session description
1205         https://bugs.webkit.org/show_bug.cgi?id=195315
1206         <rdar://problem/47840038>
1207
1208         Reviewed by David Kilzer.
1209
1210         Make sure to release raw pointers given from WebCore to mock libwebrtc layer.
1211         Covered by existing tests when run in leaks mode.
1212
1213         * testing/MockLibWebRTCPeerConnection.cpp:
1214         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
1215         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
1216
1217 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
1218
1219         Unreviewed, rolling out r242403.
1220
1221         Caused layout test crashes on iOS simulator.
1222
1223         Reverted changeset:
1224
1225         "[ContentChangeObserver] Introduce fixed duration content
1226         observation"
1227         https://bugs.webkit.org/show_bug.cgi?id=195295
1228         https://trac.webkit.org/changeset/242403
1229
1230 2019-03-05  Frederic Wang  <fwang@igalia.com>
1231
1232         Web Inspector: Better categorize CPU usage per-thread / worker
1233         https://bugs.webkit.org/show_bug.cgi?id=194564
1234
1235         Unreviewed compilation fix.
1236
1237         * page/ResourceUsageData.h: Add missing headers.
1238
1239 2019-03-05  Frederic Wang  <fwang@igalia.com>
1240
1241         Share more code for updating the state of frame scrolling nodes
1242         https://bugs.webkit.org/show_bug.cgi?id=195254
1243
1244         Unreviewed compilation warning fix.
1245
1246         * page/scrolling/AsyncScrollingCoordinator.cpp:
1247         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Add UNUSED_PARAM on non-Cocoa
1248         platforms.
1249
1250 2019-03-05  Cathie Chen  <cathiechen@igalia.com>
1251
1252         The include file in ScrollingStateFrameHostingNode.h is wrong.
1253         https://bugs.webkit.org/show_bug.cgi?id=195280
1254
1255         Reviewed by Frédéric Wang.
1256
1257         * page/scrolling/ScrollingStateFrameHostingNode.h:
1258
1259 2019-03-04  Justin Fan  <justin_fan@apple.com>
1260
1261         Unreviewed build fix for High Sierra.
1262
1263         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Should fix "global constructor" error.
1264
1265 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
1266
1267         Use a SQLite database to hold the ResourceLoadStatistics data
1268         https://bugs.webkit.org/show_bug.cgi?id=194867
1269         <rdar://problem/24240854>
1270
1271         Reviewed by Chris Dumez.
1272
1273         Add a new runtime feature flag to support use of an experimental database
1274         back-end. Also expose some SQLite function calls for use outside of WebCore.
1275
1276         No change in functionality, so no new tests.
1277
1278         * page/RuntimeEnabledFeatures.h:
1279         (WebCore::RuntimeEnabledFeatures::setItpDatabaseModeEnabled):
1280         (WebCore::RuntimeEnabledFeatures::itpDatabaseModeEnabled const):
1281         * platform/sql/SQLiteDatabase.h:
1282         * platform/sql/SQLiteStatement.h:
1283
1284 2019-03-04  Justin Fan  <justin_fan@apple.com>
1285
1286         [Web GPU] Blitting function prototypes
1287         https://bugs.webkit.org/show_bug.cgi?id=195224
1288         <rdar://problem/48538902>
1289
1290         Reviewed by Dean Jackson.
1291
1292         Implement barebones GPUCommandBuffer::copy* prototypes while rounding out GPUTexture implementation details.
1293
1294         Test: webgpu/blit-commands.html
1295
1296         * Modules/webgpu/GPUOrigin3D.h: Added.
1297         * Modules/webgpu/GPUOrigin3D.idl: Added.
1298         * Modules/webgpu/WebGPUCommandBuffer.cpp: Add copy view struct implementations.
1299         (WebCore::WebGPUBufferCopyView::asGPUBufferCopyView const): Added.
1300         (WebCore::WebGPUTextureCopyView::asGPUTextureCopyView const): Added.
1301         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Added.
1302         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Added.
1303         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Added.
1304         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Added.
1305         * Modules/webgpu/WebGPUCommandBuffer.h: Add new functions and supporting structs.
1306         * Modules/webgpu/WebGPUCommandBuffer.idl: Ditto.
1307         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Refactor constructors to copy the entire base class.
1308         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
1309         (WebCore::GPURenderPassDepthStencilAttachmentDescriptor::GPURenderPassDepthStencilAttachmentDescriptor):
1310         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
1311         (WebCore::attachment): Deleted.
1312         * Modules/webgpu/WebGPUTexture.h:
1313         (WebCore::WebGPUTexture::texture const): Added.
1314         * platform/graphics/gpu/GPUBuffer.h:
1315         (WebCore::GPUBuffer::byteLength const): Added.
1316         (WebCore::GPUBuffer::isTransferSource const): Added.
1317         (WebCore::GPUBuffer::isTransferDestination const): Renamed from isTransferDst. Refactored for OptionSet API.
1318         (WebCore::GPUBuffer::isVertex const): Ditto.
1319         (WebCore::GPUBuffer::isUniform const): Ditto.
1320         (WebCore::GPUBuffer::isStorage const): Ditto.
1321         (WebCore::GPUBuffer::isMappable const): Ditto.
1322         (WebCore::GPUBuffer::isMapWrite const): Ditto.
1323         (WebCore::GPUBuffer::isMapRead const): Ditto.
1324         * platform/graphics/gpu/GPUBufferUsage.h: Refactored for better bit flag style.
1325         * platform/graphics/gpu/GPUCommandBuffer.h:
1326         (WebCore::GPUCommandBuffer::blitEncoder const): Added.
1327         * platform/graphics/gpu/GPURenderPassDescriptor.h: 
1328         * platform/graphics/gpu/GPUTexture.h: Cache usage flags for reference.
1329         (WebCore::GPUTexture::isTransferSrc const): Added.
1330         (WebCore::GPUTexture::isTransferDst const): Added.
1331         (WebCore::GPUTexture::isOutputAttachment const): Added.
1332         * platform/graphics/gpu/GPUTextureUsage.h: Refactor to match GPUBufferUsage.h.
1333         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1334         (WebCore::GPUBuffer::validateBufferUsage): Renamed from validateBufferCreate, refactored for OptionSet.
1335         (WebCore::GPUBuffer::tryCreate):
1336         (WebCore::GPUBuffer::GPUBuffer):
1337         (WebCore::GPUBuffer::isReadOnly const):
1338         (WebCore::GPUBuffer::setSubData): Add alignment check according to Metal docs.
1339         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: 
1340         (WebCore::GPUCommandBuffer::create): No need to use this alias here.
1341         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Ditto.
1342         (WebCore::GPUCommandBuffer::copyBufferToBuffer): Added.
1343         (WebCore::GPUCommandBuffer::copyBufferToTexture): Added.
1344         (WebCore::GPUCommandBuffer::copyTextureToBuffer): Added. 
1345         (WebCore::GPUCommandBuffer::copyTextureToTexture): Added. 
1346         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
1347         (WebCore::GPUQueue::submit): End encoding on the MTLCommandBuffer's blitCommandEncoder if it was used.
1348         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
1349         (WebCore::GPUSwapChain::getNextTexture): Now provide usage flags to texture creation.
1350         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
1351         (WebCore::mtlTextureUsageForGPUTextureUsageFlags): Refactor validation.
1352         (WebCore::tryCreateMtlTextureDescriptor): Ditto.
1353         (WebCore::GPUTexture::tryCreate): Now provide usage flags to texture creation.
1354         (WebCore::GPUTexture::create): Ditto.
1355         (WebCore::GPUTexture::GPUTexture): Ditto.
1356         (WebCore::GPUTexture::createDefaultTextureView): Ditto.
1357
1358 2019-03-04  Zalan Bujtas  <zalan@apple.com>
1359
1360         [ContentChangeObserver] Introduce fixed duration content observation
1361         https://bugs.webkit.org/show_bug.cgi?id=195295
1362         <rdar://problem/48579913>
1363
1364         Reviewed by Simon Fraser.
1365
1366         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
1367         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
1368         we stop observing for content changes before they even get fired.
1369
1370         Test: fast/events/touch/ios/visibility-change-happens-on-timer-hops.html
1371
1372         * page/ios/ContentChangeObserver.cpp:
1373         (WebCore::ContentChangeObserver::ContentChangeObserver):
1374         (WebCore::ContentChangeObserver::startContentObservationForDuration):
1375         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
1376         (WebCore::ContentChangeObserver::hasDeterminateState const):
1377         (WebCore::ContentChangeObserver::adjustObservedState):
1378         * page/ios/ContentChangeObserver.h:
1379         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1380         (WebCore::ContentChangeObserver::hasPendingActivity const):
1381
1382 2019-03-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1383
1384         Native text selection UI is incorrectly suppressed in Microsoft Visio
1385         https://bugs.webkit.org/show_bug.cgi?id=195178
1386         <rdar://problem/48519394>
1387
1388         Reviewed by Darin Adler.
1389
1390         Currently, our heuristics for detecting hidden editable areas attempt to search for empty parent renderers with
1391         "overflow: hidden". It does this by ascending the layer tree in search of renderers that have an empty content
1392         size, and whose renderers' styles indicate that they have overflow: hidden in the X or Y directions. This fails
1393         in the case where a child renderer is positioned out of flow, relative to one of its parent layers, since the
1394         child will be visible, but we'll incorrectly believe that it is hidden. This leads to selection UI unexpectedly
1395         disappearing in the online version of Microsoft Visio.
1396
1397         To fix this, we check whether the enclosing layer around the editable element has an empty clip rect; if the
1398         element is inside of a subframe, we additionally walk up to each enclosing frame's layer and check if that
1399         frame's layer has an empty clip rect.
1400
1401         Test: editing/selection/ios/do-not-hide-selection-in-visible-container.html
1402
1403         * rendering/RenderObject.cpp:
1404         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
1405
1406 2019-03-01  Ryosuke Niwa  <rniwa@webkit.org>
1407
1408         gPictureOwnerMap is unnecessary
1409         https://bugs.webkit.org/show_bug.cgi?id=195228
1410
1411         Reviewed by Zalan Bujtas.
1412
1413         Just store in HTMLImageElement. An extra pointer isn't going to affect the memory use here.
1414         If anything, we should worry about m_editableImage and m_pendingClonedAttachmentID instead.
1415
1416         * html/HTMLImageElement.cpp:
1417         (WebCore::HTMLImageElement::pictureElement const):
1418         (WebCore::HTMLImageElement::setPictureElement):
1419         * html/HTMLImageElement.h:
1420
1421 2019-03-04  Daniel Bates  <dabates@apple.com>
1422
1423         [iOS] Caret x-position in empty text area does not match text field
1424         https://bugs.webkit.org/show_bug.cgi?id=195125
1425         <rdar://problem/47161070>
1426
1427         Remove the word "use" in the added comment to make it read well.
1428
1429         * css/html.css:
1430         (textarea):
1431
1432 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
1433
1434         ITMLKit Inspector: Data Bindings / Associated Data for nodes
1435         https://bugs.webkit.org/show_bug.cgi?id=195290
1436         <rdar://problem/48304019>
1437
1438         Reviewed by Devin Rousso.
1439
1440         * inspector/agents/InspectorDOMAgent.h:
1441         * inspector/agents/InspectorDOMAgent.cpp:
1442         (WebCore::InspectorDOMAgent::getDataBindingsForNode):
1443         (WebCore::InspectorDOMAgent::getAssociatedDataForNode):
1444         Stub these for web pages, they will only be used for ITMLKit right now.
1445
1446 2019-03-04  Daniel Bates  <dabates@apple.com>
1447
1448         [iOS] Caret x-position in empty text area does not match text field
1449         https://bugs.webkit.org/show_bug.cgi?id=195125
1450         <rdar://problem/47161070>
1451
1452         Reviewed by Darin Adler.
1453
1454         Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
1455         width and same text-indent as <input type="text">. This makes the x-position of the caret
1456         in an empty textarea match the position of the caret in an empty text field.
1457
1458         Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html
1459
1460         * css/html.css:
1461         (textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
1462         padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
1463         and do not specify left and right padding so that we inherit the padding set earlier in this file.
1464         (textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
1465         text so as to match the position of the textarea's inner text and the position of a text field's inner
1466         text. This fix up may have worked out visually when it was added, but based on the discovery of the
1467         hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
1468         * html/HTMLTextAreaElement.cpp:
1469         (WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.
1470
1471 2019-03-04  Youenn Fablet  <youenn@apple.com>
1472
1473         Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
1474         https://bugs.webkit.org/show_bug.cgi?id=195195
1475
1476         Reviewed by Chris Dumez.
1477
1478         Before the patch, we were notifying that some jobs were finished too aggressively at context stop time.
1479         This was confusing the Network Process.
1480         Only notify such jobs that have pending loads.
1481         Improve the tracking of jobs doing registration resolution to ensure the Network Process gets notified
1482         in case of a registration promise being resolved but the settling callback being not yet called while the context is stopped.
1483
1484         Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
1485
1486         * workers/service/ServiceWorkerContainer.cpp:
1487         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1488         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
1489         (WebCore::ServiceWorkerContainer::stop):
1490         * workers/service/ServiceWorkerContainer.h:
1491         * workers/service/ServiceWorkerJob.cpp:
1492         (WebCore::ServiceWorkerJob::cancelPendingLoad):
1493         * workers/service/ServiceWorkerJob.h:
1494         (WebCore::ServiceWorkerJob::isLoading const):
1495
1496 2019-03-04  Chris Dumez  <cdumez@apple.com>
1497
1498         [iOS] Improve our file picker
1499         https://bugs.webkit.org/show_bug.cgi?id=195284
1500         <rdar://problem/45655856>
1501
1502         Reviewed by Tim Horton and Wenson Hsieh.
1503
1504         Export UTIUtilities.h so that it can be used from WebKit2.
1505
1506         * WebCore.xcodeproj/project.pbxproj:
1507
1508 2019-03-04  Zalan Bujtas  <zalan@apple.com>
1509
1510         [ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
1511         https://bugs.webkit.org/show_bug.cgi?id=195286
1512
1513         Reviewed by Simon Fraser.
1514
1515         Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
1516         This patch also renames a couple of functions to follow the didStart/didFinish pattern.
1517
1518         * page/ios/ContentChangeObserver.cpp:
1519         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
1520         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
1521         (WebCore::ContentChangeObserver::styleRecalcDidStart):
1522         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
1523         (WebCore::ContentChangeObserver::mouseMovedDidStart):
1524         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
1525         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
1526         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
1527         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
1528         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
1529         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
1530         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
1531         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
1532         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
1533         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
1534         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
1535         (WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
1536         (WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
1537         (WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
1538         (WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
1539         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
1540         * page/ios/ContentChangeObserver.h:
1541         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
1542         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
1543         (WebCore::ContentChangeObserver::isObservingStyleRecalc const):
1544         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1545         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
1546         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
1547         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.
1548
1549 2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
1550
1551         [JSC] Offer @makeTypeError instead of exposing @TypeError
1552         https://bugs.webkit.org/show_bug.cgi?id=193858
1553
1554         Reviewed by Mark Lam.
1555
1556         Use @makeTypeError instead.
1557
1558         * Modules/mediastream/RTCPeerConnection.js:
1559         * Modules/mediastream/RTCPeerConnectionInternals.js:
1560         * Modules/streams/ReadableByteStreamInternals.js:
1561         (readableByteStreamControllerClose):
1562         (readableByteStreamControllerPullInto):
1563         * Modules/streams/ReadableStream.js:
1564         (cancel):
1565         (pipeTo):
1566         * Modules/streams/ReadableStreamBYOBReader.js:
1567         (cancel):
1568         (read):
1569         * Modules/streams/ReadableStreamDefaultReader.js:
1570         (cancel):
1571         (read):
1572         * Modules/streams/ReadableStreamInternals.js:
1573         (readableStreamReaderGenericRelease):
1574         * Modules/streams/WritableStream.js:
1575         (abort):
1576         (close):
1577         (write):
1578         (getter.closed):
1579         (getter.ready):
1580
1581 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
1582
1583         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
1584         https://bugs.webkit.org/show_bug.cgi?id=195258
1585
1586         Reviewed by Antti Koivisto.
1587
1588         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
1589         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
1590         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
1591         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
1592
1593         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
1594         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
1595         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
1596         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
1597         references to GraphicsLayers before that becomes safe).
1598         
1599         The actual fix that allows overflow scrollbars to show is the change in
1600         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
1601         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
1602
1603         * SourcesCocoa.txt:
1604         * WebCore.xcodeproj/project.pbxproj:
1605         * page/scrolling/AsyncScrollingCoordinator.cpp:
1606         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
1607         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
1608         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
1609         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
1610         * page/scrolling/ScrollingCoordinator.h:
1611         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1612         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1613         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
1614         (WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
1615         (WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
1616         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
1617         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1618         * page/scrolling/ScrollingStateScrollingNode.cpp:
1619         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
1620         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
1621         (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
1622         (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
1623         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
1624         * page/scrolling/ScrollingStateScrollingNode.h:
1625         (WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
1626         (WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
1627         (WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
1628         (WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
1629         * page/scrolling/ScrollingTree.cpp:
1630         (WebCore::ScrollingTree::setOrClearLatchedNode):
1631         (WebCore::ScrollingTree::handleWheelEvent):
1632         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
1633         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
1634         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1635         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1636         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1637         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1638         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
1639         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
1640         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
1641         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1642         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1643         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
1644         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
1645         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
1646         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
1647         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1648         (WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
1649         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
1650         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
1651         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
1652         (WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
1653         * platform/ScrollbarThemeComposite.h:
1654         * rendering/RenderLayerCompositor.cpp:
1655         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1656         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1657         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1658         * rendering/RenderLayerCompositor.h:
1659
1660 2019-03-04  Jer Noble  <jer.noble@apple.com>
1661
1662         Remove HEVC as a codec requiring hardware support.
1663         https://bugs.webkit.org/show_bug.cgi?id=194960
1664         <rdar://problem/47741432>
1665
1666         Reviewed by Eric Carlson.
1667
1668         * page/cocoa/SettingsBaseCocoa.mm:
1669         (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):
1670
1671 2019-03-04  Jer Noble  <jer.noble@apple.com>
1672
1673         [iOS] Fullscreen "stay in page" option breaks video playback
1674         https://bugs.webkit.org/show_bug.cgi?id=195277
1675         <rdar://problem/48537317>
1676
1677         Reviewed by Eric Carlson.
1678
1679         Add a LOG entry when playback is rejected due to media playback suspension.
1680
1681         * html/MediaElementSession.cpp:
1682         (WebCore::MediaElementSession::playbackPermitted const):
1683
1684 2019-03-04  Tim Horton  <timothy_horton@apple.com>
1685
1686         Fix the build.
1687
1688         * dom/Document.h:
1689
1690 2019-03-03  Zalan Bujtas  <zalan@apple.com>
1691
1692         [ContentChangeObserver] Content observation should be limited to the current document.
1693         https://bugs.webkit.org/show_bug.cgi?id=195256
1694         <rdar://problem/48544402>
1695
1696         Move ContentChangeObserver from Page to Document.
1697         It limits content observation to the target node's owner document.
1698
1699         Reviewed by Simon Fraser.
1700
1701         * dom/Document.cpp:
1702         (WebCore::m_contentChangeObserver):
1703         (WebCore::Document::updateStyleIfNeeded):
1704         (WebCore::Document::willDetachPage):
1705         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1706         (WebCore::m_undoManager): Deleted.
1707         * dom/Document.h:
1708         (WebCore::Document::contentChangeObserver):
1709         * page/DOMTimer.cpp:
1710         (WebCore::DOMTimer::install):
1711         (WebCore::DOMTimer::removeById):
1712         (WebCore::DOMTimer::fired):
1713         * page/Frame.cpp:
1714         (WebCore::Frame::willDetachPage):
1715         * page/Page.cpp:
1716         (WebCore::Page::Page):
1717         * page/Page.h:
1718         (WebCore::Page::pointerLockController const):
1719         (WebCore::Page::contentChangeObserver): Deleted.
1720         * page/ios/ContentChangeObserver.cpp:
1721         (WebCore::ContentChangeObserver::ContentChangeObserver):
1722         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1723         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1724         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1725         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1726         (WebCore::ContentChangeObserver::startObservingMouseMoved):
1727         (WebCore::ContentChangeObserver::hasDeterminateState const):
1728         (WebCore::ContentChangeObserver::adjustObservedState):
1729         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
1730         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
1731         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
1732         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
1733         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
1734         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
1735         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
1736         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
1737         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
1738         (WebCore::hasPendingStyleRecalc): Deleted.
1739         * page/ios/ContentChangeObserver.h:
1740         * page/ios/EventHandlerIOS.mm:
1741         (WebCore::EventHandler::mouseMoved):
1742         * rendering/updating/RenderTreeUpdater.cpp:
1743         (WebCore::RenderTreeUpdater::updateElementRenderer):
1744
1745 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
1746
1747         Share more code for updating the state of frame scrolling nodes
1748         https://bugs.webkit.org/show_bug.cgi?id=195254
1749
1750         Reviewed by Antti Koivisto.
1751
1752         Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
1753         AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
1754         RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
1755         ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
1756         state tree.
1757         
1758         We also share code between updating ScrollingStateFrameScrollingNodes and
1759         ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
1760         Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
1761         ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
1762         on macOS.
1763
1764         * page/scrolling/AsyncScrollingCoordinator.cpp:
1765         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1766         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
1767         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
1768         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
1769         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
1770         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
1771         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
1772         * page/scrolling/AsyncScrollingCoordinator.h:
1773         * page/scrolling/ScrollingCoordinator.h:
1774         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
1775         (WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
1776         (WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
1777         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
1778         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
1779         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
1780         * platform/ScrollView.h:
1781         (WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
1782         (WebCore::ScrollView::verticalScrollbarMode const): Deleted.
1783         * platform/ScrollableArea.cpp:
1784         (WebCore::ScrollableArea::reachableTotalContentsSize const):
1785         * platform/ScrollableArea.h:
1786         (WebCore::ScrollableArea::horizontalScrollbarMode const):
1787         (WebCore::ScrollableArea::verticalScrollbarMode const):
1788         * rendering/RenderLayer.cpp:
1789         (WebCore::RenderLayer::overhangAmount const):
1790         (WebCore::RenderLayer::reachableTotalContentsSize const):
1791         (WebCore::RenderLayer::scrollableContentsSize const): Deleted.
1792         * rendering/RenderLayer.h:
1793         * rendering/RenderLayerCompositor.cpp:
1794         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1795         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1796         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
1797         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
1798         (WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
1799         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1800         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
1801         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
1802         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
1803         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
1804         * rendering/RenderLayerCompositor.h:
1805
1806 2019-03-02  Darin Adler  <darin@apple.com>
1807
1808         Retire legacy dtoa function and DecimalNumber class
1809         https://bugs.webkit.org/show_bug.cgi?id=195253
1810
1811         Reviewed by Daniel Bates.
1812
1813         * css/CSSPrimitiveValue.cpp:
1814         (WebCore::CSSPrimitiveValue::formatNumberValue const): Use makeString instead
1815         of DecimalNumber. Also changed return type to String and use StringView and
1816         removed special handling of literals.
1817         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed an
1818         unnecessary use of StringBuilder.
1819
1820         * css/CSSPrimitiveValue.h: Updated for changes to formatNumberValue.
1821
1822 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1823
1824         [SOUP] Cleanups in SoupNetworkSession
1825         https://bugs.webkit.org/show_bug.cgi?id=195247
1826
1827         Reviewed by Daniel Bates.
1828
1829         This renames clientCertificates to allowedCertificates, since they are not client
1830         certificates at all, but server certificates. It also adds a using statement to avoid
1831         repeating the long type of the map, and avoids an unnecessary copy.
1832
1833         * platform/network/soup/SoupNetworkSession.cpp:
1834         (WebCore::allowedCertificates):
1835         (WebCore::SoupNetworkSession::checkTLSErrors):
1836         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
1837         (WebCore::clientCertificates): Deleted.
1838
1839 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1840
1841         -Wformat error in SharedBuffer::tryCreateArrayBuffer
1842         https://bugs.webkit.org/show_bug.cgi?id=195004
1843
1844         Reviewed by Darin Adler.
1845
1846         Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
1847         just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
1848         guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
1849         with char larger than one byte, but perhaps it didn't realize sizeof always returns
1850         multiples of char and so sizeof(char) is always one even on such mythical systems.
1851
1852         Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
1853         would actually be more readable.
1854
1855         * platform/SharedBuffer.cpp:
1856         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
1857
1858 2019-03-03  Tim Horton  <timothy_horton@apple.com>
1859
1860         Remove some more unused 32-bit code
1861         https://bugs.webkit.org/show_bug.cgi?id=195255
1862
1863         Reviewed by Darin Adler.
1864
1865         * platform/gamepad/cocoa/GameControllerGamepad.h:
1866         * platform/gamepad/cocoa/GameControllerGamepad.mm:
1867         * platform/gamepad/cocoa/GameControllerGamepadProvider.h:
1868         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
1869         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1870         * platform/mac/PlatformEventFactoryMac.mm:
1871         (WebCore::globalPointForEvent):
1872         (WebCore::pointForEvent):
1873         (WebCore::mouseButtonForEvent):
1874         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1875         * rendering/RenderThemeMac.mm:
1876         (WebCore::RenderThemeMac::servicesRolloverButtonCell const):
1877         (WebCore::RenderThemeMac::paintImageControlsButton):
1878         (WebCore::RenderThemeMac::imageControlsButtonSize const):
1879         (WebCore::RenderThemeMac::imageControlsButtonPositionOffset const):
1880
1881 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1882
1883         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
1884         https://bugs.webkit.org/show_bug.cgi?id=195252
1885         <rdar://problem/48539446>
1886
1887         Reviewed by Simon Fraser.
1888
1889         Scope the mouse-moved event to make the callsites less error-prone. 
1890
1891         * page/ios/ContentChangeObserver.cpp:
1892         (WebCore::ContentChangeObserver::startObservingMouseMoved):
1893         (WebCore::ContentChangeObserver::stopObservingMouseMoved):
1894         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
1895         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
1896         (WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
1897         (WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
1898         * page/ios/ContentChangeObserver.h:
1899         * page/ios/EventHandlerIOS.mm:
1900         (WebCore::EventHandler::mouseMoved):
1901
1902 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1903
1904         [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
1905         https://bugs.webkit.org/show_bug.cgi?id=195244
1906         <rdar://problem/48536737>
1907
1908         Reviewed by Simon Fraser.
1909
1910         Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
1911         let the client know about the state change (or lack of state change).
1912
1913         Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html
1914
1915         * page/ios/ContentChangeObserver.cpp:
1916         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1917         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1918         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1919         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1920         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1921         (WebCore::ContentChangeObserver::didContentVisibilityChange):
1922         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1923         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1924         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
1925         (WebCore::ContentChangeObserver::adjustObservedState):
1926         (WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
1927         * page/ios/ContentChangeObserver.h:
1928         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
1929         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
1930         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
1931
1932 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1933
1934         [ContentChangeObserver] Move away from WKContentChange values
1935         https://bugs.webkit.org/show_bug.cgi?id=195240
1936         <rdar://problem/48532358>
1937
1938         Reviewed by Simon Fraser.
1939
1940         This is in preparation for moving towards a state machine-like implementation.
1941
1942         * page/ios/ContentChangeObserver.cpp:
1943         (WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
1944         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1945         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1946         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1947         (WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
1948         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1949         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1950         (WebCore::ContentChangeObserver::didContentVisibilityChange):
1951         (WebCore::ContentChangeObserver::startObservingContentChanges):
1952         (WebCore::ContentChangeObserver::observedContentChange const):
1953         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1954         (WebCore::ContentChangeObserver::hasDeterminedState const):
1955         (WebCore::ContentChangeObserver::observedContentChange): Deleted.
1956         (WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
1957         (WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
1958         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
1959         * page/ios/ContentChangeObserver.h:
1960         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1961         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
1962         (WebCore::ContentChangeObserver::hasVisibleChangeState const):
1963         (WebCore::ContentChangeObserver::hasObservedDOMTimer const):
1964         (WebCore::ContentChangeObserver::setHasNoChangeState):
1965         (WebCore::ContentChangeObserver::setHasIndeterminateState):
1966         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
1967         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.
1968
1969 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1970
1971         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
1972         https://bugs.webkit.org/show_bug.cgi?id=195053
1973         <rdar://problem/48134710>
1974
1975         Reviewed by Ryosuke Niwa.
1976
1977         Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
1978         ChangeLog for more details.
1979
1980         Test: editing/pasteboard/ios/dom-paste-same-origin.html
1981
1982         * WebCore.xcodeproj/project.pbxproj:
1983         * dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
1984
1985         Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
1986         particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
1987         throughout the user gesture.
1988
1989         * dom/UserGestureIndicator.h:
1990         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
1991         * loader/EmptyClients.cpp:
1992         * page/EditorClient.h:
1993         * page/Frame.cpp:
1994         (WebCore::Frame::requestDOMPasteAccess):
1995
1996 2019-02-27  Darin Adler  <darin@apple.com>
1997
1998         Fixed makeString(float) to do shortest-form serialization without first converting to double
1999         https://bugs.webkit.org/show_bug.cgi?id=195142
2000
2001         Reviewed by Daniel Bates.
2002
2003         * platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.
2004
2005 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
2006
2007         REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
2008         https://bugs.webkit.org/show_bug.cgi?id=195246
2009
2010         Reviewed by Frederic Wang.
2011
2012         r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
2013         was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
2014         tree, which it did, causing sibling position:fixed to behave incorrectly.
2015
2016         Test: scrollingcoordinator/mac/multiple-fixed.html
2017
2018         * page/scrolling/ScrollingTree.cpp:
2019         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
2020         * page/scrolling/ScrollingTree.h:
2021
2022 2019-03-02  Darin Adler  <darin@apple.com>
2023
2024         Improve some comments
2025         https://bugs.webkit.org/show_bug.cgi?id=195243
2026
2027         Reviewed by Daniel Bates.
2028
2029         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2030         (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
2031         Fix a typo in a comment.
2032
2033         * dom/RadioButtonGroups.cpp: Fix a typo in a comment.
2034         (WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
2035
2036         * html/HTMLInputElement.cpp:
2037         (WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
2038         it a bit longer. Use nullptr instead of 0.
2039         (WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
2040
2041 2019-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2042
2043         [Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
2044         https://bugs.webkit.org/show_bug.cgi?id=190620
2045         <rdar://problem/19226679>
2046
2047         Reviewed by Ryosuke Niwa.
2048
2049         Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
2050         To understand why we hit this assertion, we first note several observations:
2051
2052             -   The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
2053             -   Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
2054             -   `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
2055                 cached value without update.
2056
2057         Now, consider the following scenario:
2058
2059             1.  Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
2060                 several things:
2061                 a.  The form control changes readonly state
2062                 b.  The form control changes disabled state
2063                 c.  The form control is added to a datalist element
2064                 d.  The form control is removed from a datalist element
2065             2.  Call `willValidate()`.
2066             3.  Call `isValid()`.
2067
2068         In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
2069         `m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
2070         result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
2071         control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
2072         isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.
2073
2074         * html/HTMLFormControlElement.cpp:
2075         (WebCore::HTMLFormControlElement::insertedIntoAncestor):
2076         (WebCore::HTMLFormControlElement::removedFromAncestor):
2077
2078         Make a couple of minor tweaks:
2079           - Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
2080             control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
2081             already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
2082             does not yet have an ancestor (in the case where it is being added).
2083           - If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
2084             as well as its cached validity (`m_isValid`).
2085
2086 2019-03-01  Darin Adler  <darin@apple.com>
2087
2088         Finish removing String::format
2089         https://bugs.webkit.org/show_bug.cgi?id=194893
2090
2091         Reviewed by Daniel Bates.
2092
2093         * dom/Document.cpp:
2094         (WebCore::Document::lastModified const): Use makeString and pad.
2095         * html/FTPDirectoryDocument.cpp:
2096         (WebCore::processFileDateString): Ditto.
2097
2098         * mathml/MathMLElement.cpp:
2099         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
2100
2101         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2102         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
2103
2104         * page/linux/ResourceUsageOverlayLinux.cpp:
2105         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
2106         (WebCore::gcTimerString): Use String::number.
2107
2108         * platform/DateComponents.cpp:
2109         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
2110         (WebCore::DateComponents::toString const): Ditto.
2111
2112         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
2113         and that was also inaccurate.
2114
2115         * platform/audio/HRTFElevation.cpp:
2116         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2117         Use makeString and pad.
2118         * platform/mock/MockRealtimeVideoSource.cpp:
2119         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2120         * rendering/RenderLayerCompositor.cpp:
2121         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
2122         * rendering/RenderTheme.cpp:
2123         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2124
2125 2019-03-01  Chris Dumez  <cdumez@apple.com>
2126
2127         Do not attempt to set WAL Journal mode on a readonly SQLite database
2128         https://bugs.webkit.org/show_bug.cgi?id=195237
2129
2130         Reviewed by Simon Fraser.
2131
2132         This avoids logging errors when opening the database.
2133
2134         * platform/sql/SQLiteDatabase.cpp:
2135         (WebCore::SQLiteDatabase::open):
2136         (WebCore::SQLiteDatabase::useWALJournalMode):
2137         * platform/sql/SQLiteDatabase.h:
2138
2139 2019-03-01  Antoine Quint  <graouts@apple.com>
2140
2141         [iOS] Turn mouse event simulation on by default
2142         https://bugs.webkit.org/show_bug.cgi?id=195218
2143         <rdar://problem/48516794>
2144
2145         Reviewed by Dean Jackson.
2146
2147         * page/RuntimeEnabledFeatures.h:
2148
2149 2019-03-01  Chris Dumez  <cdumez@apple.com>
2150
2151         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
2152         https://bugs.webkit.org/show_bug.cgi?id=195230
2153         <rdar://problem/47925359>
2154
2155         Reviewed by Ryosuke Niwa.
2156
2157         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
2158         to address crashes on iOS WK1.
2159
2160         * platform/network/NetworkStateNotifier.cpp:
2161         (WebCore::shouldSuppressThreadSafetyCheck):
2162         (WebCore::NetworkStateNotifier::singleton):
2163
2164 2019-03-01  Simon Fraser  <simon.fraser@apple.com>
2165
2166         Show mouse event regions in the overlay
2167         https://bugs.webkit.org/show_bug.cgi?id=195227
2168
2169         Reviewed by Tim Horton.
2170
2171         Enhance event region overlays to show more kinds of events.
2172
2173         * page/DebugPageOverlays.cpp:
2174         (WebCore::touchEventRegionColors):
2175         (WebCore::NonFastScrollableRegionOverlay::drawRect):
2176
2177 2019-03-01  Zalan Bujtas  <zalan@apple.com>
2178
2179         [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
2180         https://bugs.webkit.org/show_bug.cgi?id=195220
2181         <rdar://problem/48518979>
2182
2183         Reviewed by Simon Fraser.
2184
2185         didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
2186         when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
2187         Let's just check if we've got a pending style recalc when the DOM timer comes back.
2188
2189         Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
2190
2191         * dom/Document.cpp:
2192         (WebCore::Document::scheduleStyleRecalc):
2193         * page/ios/ContentChangeObserver.cpp:
2194         (WebCore::hasPendingStyleRecalc):
2195         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
2196         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2197         (WebCore::ContentChangeObserver::startObservingContentChanges):
2198         (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
2199         * page/ios/ContentChangeObserver.h:
2200         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
2201         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
2202         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
2203
2204 2019-03-01  John Wilander  <wilander@apple.com>
2205
2206         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
2207         https://bugs.webkit.org/show_bug.cgi?id=195196
2208         <rdar://problem/48006419>
2209
2210         Reviewed by Brent Fulgham.
2211
2212         Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
2213                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
2214                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
2215                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
2216                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
2217
2218         Trackers abuse link query parameters to transport user identifiers cross-site.
2219         This patch detects such navigations and applies further restrictions to
2220         client-site cookies on the destination page.
2221
2222         * platform/network/NetworkStorageSession.cpp:
2223         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
2224             Now sets the regular 7-day cap and a reduced 1-day cap.
2225         (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
2226             Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
2227             NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
2228             it now clears out two types of page-specific data.
2229         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
2230             This function receives a cross-site navigation and checks if the originating
2231             site is a prevalent resource. If so, it marks the page or stricter cookie
2232             rules.
2233         (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
2234             Test infrastructure. This sets a state that overrides the regular per-page
2235             clear of data. The reason is that the double clear was racy and caused test
2236             failures.
2237         (WebCore::NetworkStorageSession::clientSideCookieCap const):
2238             New function that returns the current cookie lifetime cap.
2239         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
2240             Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
2241         * platform/network/NetworkStorageSession.h:
2242         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2243         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2244             Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
2245
2246 2019-03-01  Rob Buis  <rbuis@igalia.com>
2247
2248         Adjust XMLHttpRequest Content-Type handling
2249         https://bugs.webkit.org/show_bug.cgi?id=184645
2250
2251         Reviewed by Youenn Fablet.
2252
2253         Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
2254
2255         Test: web-platform-tests/xhr/send-content-type-charset.htm
2256
2257         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
2258
2259         * platform/network/ParsedContentType.cpp:
2260         (WebCore::ParsedContentType::setCharset):
2261         * platform/network/ParsedContentType.h:
2262         * xml/XMLHttpRequest.cpp:
2263         (WebCore::replaceCharsetInMediaTypeIfNeeded):
2264         (WebCore::XMLHttpRequest::send):
2265         (WebCore::replaceCharsetInMediaType): Deleted.
2266
2267 2019-03-01  Youenn Fablet  <youenn@apple.com>
2268
2269         Update originsMatch to handle the case of file origins which enforce file path separation
2270         https://bugs.webkit.org/show_bug.cgi?id=195216
2271
2272         Reviewed by Brady Eidson.
2273
2274         Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
2275         Make sure originsMatch returns true if either compared origins are the same object
2276         or they have the same file path separation behavior.
2277
2278         * page/SecurityOrigin.cpp:
2279         (WebCore::areOriginsMatching):
2280         (WebCore::originsMatch):
2281
2282 2019-03-01  Youenn Fablet  <youenn@apple.com>
2283
2284         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
2285         https://bugs.webkit.org/show_bug.cgi?id=195213
2286
2287         Reviewed by Alex Christensen.
2288
2289         Add traits to enable enum IPC encoding.
2290         No change of behavior.
2291
2292         * Modules/indexeddb/IndexedDB.h:
2293
2294 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
2295
2296         [WinCairo] Enable service worker
2297         https://bugs.webkit.org/show_bug.cgi?id=188318
2298
2299         Reviewed by Youenn Fablet.
2300
2301         * WebCorePrefix.h:
2302         * testing/ServiceWorkerInternals.h:
2303         * workers/service/context/SWContextManager.cpp:
2304         (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
2305         * workers/service/context/SWContextManager.h:
2306
2307 2019-03-01  Sihui Liu  <sihui_liu@apple.com>
2308
2309         Add a quirk for bostongloble.com and latimes.com
2310         https://bugs.webkit.org/show_bug.cgi?id=195155
2311
2312         Reviewed by Geoffrey Garen.
2313
2314         Covered by manual testing.
2315
2316         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2317         * bindings/scripts/CodeGeneratorJS.pm:
2318         (GenerateRuntimeEnableConditionalString):
2319         * bindings/scripts/IDLAttributes.json:
2320         * bindings/scripts/preprocess-idls.pl:
2321         (GenerateConstructorAttributes):
2322         * page/Quirks.cpp:
2323         (WebCore::Quirks::hasWebSQLSupportQuirk const):
2324         * page/Quirks.h:
2325
2326 2019-03-01  Zalan Bujtas  <zalan@apple.com>
2327
2328         [ContentChangeObserver] Rename members and move implementation to header.
2329         https://bugs.webkit.org/show_bug.cgi?id=195198
2330         <rdar://problem/48499967>
2331
2332         Reviewed by Simon Fraser.
2333
2334         * page/ios/ContentChangeObserver.cpp:
2335         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
2336         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2337         (WebCore::ContentChangeObserver::startObservingStyleRecalc):
2338         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
2339         (WebCore::ContentChangeObserver::startObservingContentChanges):
2340         (WebCore::ContentChangeObserver::stopObservingContentChanges):
2341         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
2342         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
2343         (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
2344         (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
2345         (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
2346         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
2347         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
2348         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
2349         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
2350         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
2351         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
2352         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
2353         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
2354         (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
2355         (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
2356         (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
2357         * page/ios/ContentChangeObserver.h:
2358         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
2359         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
2360         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
2361         (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
2362         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
2363         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
2364         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
2365         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
2366         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
2367         (WebCore::ContentChangeObserver::isObservingContentChanges const):
2368         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
2369         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
2370
2371 2019-03-01  Zalan Bujtas  <zalan@apple.com>
2372
2373         [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
2374         https://bugs.webkit.org/show_bug.cgi?id=195197
2375         <rdar://problem/48498332>
2376
2377         Reviewed by Simon Fraser.
2378
2379         Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
2380
2381         * page/ios/ContentChangeObserver.cpp:
2382         (WebCore::ContentChangeObserver::didContentVisibilityChange):
2383         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
2384         * page/ios/ContentChangeObserver.h:
2385
2386 2019-03-01  Jer Noble  <jer.noble@apple.com>
2387
2388         [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
2389         https://bugs.webkit.org/show_bug.cgi?id=195217
2390
2391         Reviewed by Eric Carlson.
2392
2393         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2394         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2395
2396 2019-03-01  Justin Fan  <justin_fan@apple.com>
2397
2398         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
2399         https://bugs.webkit.org/show_bug.cgi?id=195191
2400
2401         Rubber-stamped by Dean Jackson.
2402
2403         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
2404
2405         * Configurations/FeatureDefines.xcconfig:
2406
2407 2019-02-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2408
2409         HTTPSUpgradeList.db database should be opened in readonly mode
2410         https://bugs.webkit.org/show_bug.cgi?id=195194
2411         <rdar://problem/47103889>
2412
2413         Unreviewed build fix for curl.
2414
2415         * platform/network/curl/CookieJarDB.cpp:
2416         (WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
2417
2418 2019-02-28  Chris Dumez  <cdumez@apple.com>
2419
2420         Unreviewed Windows build fix after r242251.
2421
2422         * platform/win/SearchPopupMenuDB.cpp:
2423         (WebCore::SearchPopupMenuDB::openDatabase):
2424
2425 2019-02-28  Zalan Bujtas  <zalan@apple.com>
2426
2427         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
2428         https://bugs.webkit.org/show_bug.cgi?id=195143
2429         <rdar://problem/48462351>
2430
2431         Reviewed by Simon Fraser.
2432
2433         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
2434
2435         * page/DOMTimer.cpp:
2436         (WebCore::DOMTimer::removeById):
2437         * page/DOMWindow.cpp:
2438         (WebCore::DOMWindow::clearTimeout):
2439         * page/ios/ContentChangeObserver.cpp:
2440         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
2441         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2442         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
2443         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
2444         * page/ios/ContentChangeObserver.h:
2445
2446 2019-02-28  Chris Dumez  <cdumez@apple.com>
2447
2448         HTTPSUpgradeList.db database should be opened in readonly mode
2449         https://bugs.webkit.org/show_bug.cgi?id=195194
2450         <rdar://problem/47103889>
2451
2452         Reviewed by Youenn Fablet.
2453
2454         Add parameter to SQLiteDatabase::open() to specific the open flags.
2455
2456         * Modules/webdatabase/Database.cpp:
2457         (WebCore::Database::performOpenAndVerify):
2458         * platform/sql/SQLiteDatabase.cpp:
2459         (WebCore::SQLiteDatabase::open):
2460         * platform/sql/SQLiteDatabase.h:
2461         * platform/sql/SQLiteFileSystem.cpp:
2462         * platform/sql/SQLiteFileSystem.h:
2463
2464 2019-02-28  Brady Eidson  <beidson@apple.com>
2465
2466         Followup to:
2467         Universal links from Google search results pages don't open the app
2468         https://bugs.webkit.org/show_bug.cgi?id=195126
2469
2470         Unreviewed.
2471
2472         * page/SecurityOrigin.cpp:
2473         (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
2474
2475 2019-02-28  Simon Fraser  <simon.fraser@apple.com>
2476
2477         [iOS] Dark flash when opening Google AMP pages
2478         https://bugs.webkit.org/show_bug.cgi?id=195193
2479         rdar://problem/48326442
2480
2481         Reviewed by Zalan Bujtas.
2482
2483         After the incremental compositing updates changes, it was possible for a change in the size
2484         of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
2485         a composited descendant that is not a descendant in z-order. When Google search results
2486         create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
2487         leaving the #222 background of an intermediate element visible.
2488
2489         Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
2490         that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
2491         this flag affects all descendants; in future, we might be able to clear it for grand-children.
2492
2493         Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
2494                compositing/geometry/ancestor-clip-change.html
2495
2496         * rendering/RenderLayer.cpp:
2497         (WebCore::RenderLayer::updateLayerPositions):
2498         (WebCore::RenderLayer::updateLayerPosition):
2499         * rendering/RenderLayer.h:
2500         * rendering/RenderLayerBacking.cpp:
2501         (WebCore::RenderLayerBacking::updateAfterLayout):
2502         * rendering/RenderLayerBacking.h:
2503
2504 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
2505
2506         Use-after-move in RenderCombineText::combineTextIfNeeded()
2507         https://bugs.webkit.org/show_bug.cgi?id=195188
2508
2509         Reviewed by Zalan Bujtas.
2510
2511         r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
2512         symptom, but this patch fixes the source of the problem (and reverts r242204).
2513
2514         The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
2515
2516         FontDescription bestFitDescription;
2517         while (...) {
2518             FontCascade compressedFont(WTFMove(bestFitDescription), ...);
2519             ...
2520         }
2521
2522         Clearly this is wrong.
2523
2524         Test: fast/text/text-combine-crash-2.html
2525
2526         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2527         (WebCore::FontDescription::platformResolveGenericFamily):
2528         * rendering/RenderCombineText.cpp:
2529         (WebCore::RenderCombineText::combineTextIfNeeded):
2530
2531 2019-02-28  Zalan Bujtas  <zalan@apple.com>
2532
2533         [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
2534         https://bugs.webkit.org/show_bug.cgi?id=195172
2535         <rdar://problem/48479259>
2536
2537         Reviewed by Simon Fraser.
2538
2539         Let's scope start/stopObserving call pairs.
2540
2541         * dom/Document.cpp:
2542         (WebCore::Document::updateStyleIfNeeded):
2543         * page/DOMTimer.cpp:
2544         (WebCore::DOMTimer::fired):
2545         * page/ios/ContentChangeObserver.cpp:
2546         (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
2547         (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
2548         (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
2549         (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
2550         (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
2551         (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
2552         (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
2553         (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
2554         * page/ios/ContentChangeObserver.h:
2555         * rendering/updating/RenderTreeUpdater.cpp:
2556         (WebCore::RenderTreeUpdater::updateElementRenderer):
2557
2558 2019-02-28  Antoine Quint  <graouts@apple.com>
2559
2560         Enable the Pointer Events runtime flag by default
2561         https://bugs.webkit.org/show_bug.cgi?id=195156
2562
2563         Reviewed by Dean Jackson.
2564
2565         * page/RuntimeEnabledFeatures.h:
2566
2567 2019-02-28  Zalan Bujtas  <zalan@apple.com>
2568
2569         [ContentChangeObserver] Make observed state reset explicit.
2570         https://bugs.webkit.org/show_bug.cgi?id=195185
2571         <rdar://problem/48488342>
2572
2573         Reviewed by Simon Fraser.
2574
2575         Use setObservedContentChange only for setting the observed change while observing.
2576
2577         * page/ios/ContentChangeObserver.cpp:
2578         (WebCore::ContentChangeObserver::startObservingContentChanges):
2579         (WebCore::ContentChangeObserver::resetObservedContentChange):
2580         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2581         * page/ios/ContentChangeObserver.h:
2582
2583 2019-02-28  Commit Queue  <commit-queue@webkit.org>
2584
2585         Unreviewed, rolling out r242210.
2586         https://bugs.webkit.org/show_bug.cgi?id=195179
2587
2588         it broke hover menus on losaltosonline.com (Requested by zalan
2589         on #webkit).
2590
2591         Reverted changeset:
2592
2593         "[ContentChangeObserver] Move timer removal code from
2594         DOMWindow::clearTimeout to DOMTimer::removeById"
2595         https://bugs.webkit.org/show_bug.cgi?id=195143
2596         https://trac.webkit.org/changeset/242210
2597
2598 2019-02-28  Zalan Bujtas  <zalan@apple.com>
2599
2600         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
2601         https://bugs.webkit.org/show_bug.cgi?id=195143
2602         <rdar://problem/48462351>
2603
2604         Reviewed by Simon Fraser.
2605
2606         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
2607
2608         * page/DOMTimer.cpp:
2609         (WebCore::DOMTimer::removeById):
2610         * page/DOMWindow.cpp:
2611         (WebCore::DOMWindow::clearTimeout):
2612         * page/ios/ContentChangeObserver.cpp:
2613         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
2614         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2615         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
2616         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
2617         * page/ios/ContentChangeObserver.h:
2618
2619 2019-02-28  Charles Vazac  <cvazac@akamai.com>
2620
2621         Fix Resource Timing buffer edge cases for WPT
2622         https://bugs.webkit.org/show_bug.cgi?id=193213
2623
2624         Reviewed by Youenn Fablet.
2625
2626         Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
2627
2628         * page/Performance.cpp:
2629         (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
2630         resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
2631         expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
2632         the secondary buffer.
2633
2634 2019-02-28  Takashi Komori  <Takashi.Komori@sony.com>
2635
2636         [Curl] HTTP Body is missing with redirection.
2637         https://bugs.webkit.org/show_bug.cgi?id=191651
2638
2639         Reviewed by Don Olmstead.
2640
2641         Implement updateFromDelegatePreservingOldProperties for curl port.
2642
2643         Tests: http/tests/navigation/post-301-response.html
2644                http/tests/navigation/post-302-response.html
2645                http/tests/navigation/post-303-response.html
2646                http/tests/navigation/post-307-response.html
2647                http/tests/navigation/post-308-response.html
2648
2649         * platform/Curl.cmake:
2650         * platform/network/curl/ResourceRequest.h:
2651         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
2652         * platform/network/curl/ResourceRequestCurl.cpp: Added.
2653         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2654
2655 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2656
2657         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
2658         https://bugs.webkit.org/show_bug.cgi?id=195159
2659
2660         Reviewed by Don Olmstead.
2661
2662         Use COORDINATED_GRAPHICS instead.
2663
2664         * platform/graphics/GraphicsContext3D.h:
2665         * platform/graphics/PlatformLayer.h:
2666         * platform/graphics/cairo/ImageBufferCairo.cpp:
2667         (WebCore::ImageBufferData::ImageBufferData):
2668         (WebCore::ImageBufferData::~ImageBufferData):
2669         * platform/graphics/cairo/ImageBufferDataCairo.h:
2670         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
2671         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
2672         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
2673         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
2674         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2675         (WebCore::GraphicsContext3D::reshapeFBOs):
2676         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2677         (WebCore::GraphicsContext3D::prepareTexture):
2678         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2679         (WebCore::GraphicsContext3D::reshapeFBOs):
2680         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
2681         (WebCore::GraphicsContext3D::GraphicsContext3D):
2682         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2683         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2684         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
2685         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
2686         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2687         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2688         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2689         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2690         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2691         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
2692         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2693         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
2694         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
2695         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
2696         * rendering/RenderLayerBacking.cpp:
2697         (WebCore::RenderLayerBacking::paintsIntoWindow const):
2698         * rendering/RenderLayerCompositor.cpp:
2699         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2700
2701 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
2702
2703         Locale names can be nullptr
2704         https://bugs.webkit.org/show_bug.cgi?id=195171
2705         <rdar://problem/48262376>
2706
2707         Reviewed by Dean Jackson.
2708
2709         Nullptr can't be used in keys to HashMaps, so take an early out in this case.
2710
2711         This is a partial revert of r241288.
2712
2713         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2714         (WebCore::FontDescription::platformResolveGenericFamily):
2715
2716 2019-02-28  Justin Fan  <justin_fan@apple.com>
2717
2718         [Web GPU] Enable Web GPU only on 64-bit
2719         https://bugs.webkit.org/show_bug.cgi?id=195139
2720
2721         Because Metal is only supported on 64 bit apps.
2722
2723         Unreviewed build fix.
2724
2725         * Configurations/FeatureDefines.xcconfig:
2726
2727 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2728
2729         [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
2730         https://bugs.webkit.org/show_bug.cgi?id=195128
2731         <rdar://problem/48456752>
2732
2733         Reviewed by Simon Fraser.
2734
2735         Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
2736
2737         * WebCore.xcodeproj/project.pbxproj:
2738         * page/ios/ContentChangeObserver.mm:
2739         (WebCore::ContentChangeObserver::setObservedContentChange):
2740         * platform/ios/wak/WKContentObservation.cpp:
2741         (WKSetObservedContentChange):
2742         * platform/ios/wak/WKContentObservation.h:
2743         * platform/ios/wak/WKContentObservationInternal.h: Removed.
2744
2745 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
2746
2747         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
2748
2749         * dom/Document.cpp:
2750         (WebCore::Document::lastModified const):
2751         * html/FTPDirectoryDocument.cpp:
2752         (WebCore::processFileDateString):
2753         * mathml/MathMLElement.cpp:
2754         (WebCore::convertToPercentageIfNeeded):
2755         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
2756         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2757         (WebCore::ResourceUsageOverlay::platformDraw):
2758         * page/linux/ResourceUsageOverlayLinux.cpp:
2759         (WebCore::cpuUsageString):
2760         (WebCore::gcTimerString):
2761         * platform/DateComponents.cpp:
2762         (WebCore::DateComponents::toStringForTime const):
2763         (WebCore::DateComponents::toString const):
2764         * platform/LocalizedStrings.cpp:
2765         (WebCore::localizedString):
2766         * platform/audio/HRTFElevation.cpp:
2767         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2768         * platform/mock/MockRealtimeVideoSource.cpp:
2769         (WebCore::MockRealtimeVideoSource::drawText):
2770         * rendering/RenderLayerCompositor.cpp:
2771         (WebCore::RenderLayerCompositor::logLayerInfo):
2772         * rendering/RenderTheme.cpp:
2773         (WebCore::RenderTheme::formatMediaControlsTime const):
2774
2775 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2776
2777         [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
2778         https://bugs.webkit.org/show_bug.cgi?id=195091
2779         <rdar://problem/48427271>
2780
2781         Reviewed by Tim Horton.
2782
2783         * page/ios/ContentChangeObserver.h:
2784         * page/ios/ContentChangeObserver.mm:
2785         (WebCore::ContentChangeObserver::startObservingContentChanges):
2786         (WebCore::ContentChangeObserver::stopObservingContentChanges):
2787         (WebCore::ContentChangeObserver::isObservingContentChanges):
2788         * platform/ios/wak/WKContentObservation.cpp:
2789         (WKObservingContentChanges): Deleted.
2790         (WKStartObservingContentChanges): Deleted.
2791         (WKStopObservingContentChanges): Deleted.
2792         * platform/ios/wak/WKContentObservation.h:
2793         * platform/ios/wak/WKContentObservationInternal.h:
2794
2795 2019-02-27  Brady Eidson  <beidson@apple.com>
2796
2797         Universal links from Google search results pages don't open the app.
2798         <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
2799
2800         Reviewed by Geoffrey Garen.
2801
2802         Covered by new API tests.
2803
2804         * loader/DocumentLoader.cpp:
2805         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
2806           an iframe if it is from the same security origin as the main frame.
2807
2808 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2809
2810         [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
2811         https://bugs.webkit.org/show_bug.cgi?id=195090
2812         <rdar://problem/48426771>
2813
2814         Reviewed by Tim Horton.
2815
2816         Also remove some unused functions from WKContentObservationInternal.
2817
2818         * page/ios/ContentChangeObserver.h:
2819         * page/ios/ContentChangeObserver.mm:
2820         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
2821         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
2822         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
2823         * platform/ios/wak/WKContentObservation.cpp:
2824         (WKStartObservingDOMTimerScheduling): Deleted.
2825         (WKStopObservingDOMTimerScheduling): Deleted.
2826         (WKIsObservingDOMTimerScheduling): Deleted.
2827         * platform/ios/wak/WKContentObservation.h:
2828         * platform/ios/wak/WKContentObservationInternal.h:
2829
2830 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2831
2832         [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
2833         https://bugs.webkit.org/show_bug.cgi?id=195087
2834
2835         Reviewed by Simon Fraser.
2836
2837         Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
2838
2839         * page/ios/ContentChangeObserver.h:
2840         * page/ios/ContentChangeObserver.mm:
2841         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
2842         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
2843         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
2844         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
2845         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
2846         (WebCore::ContentChangeObserver::setObservedContentChange):
2847         * platform/ios/wak/WKContentObservation.cpp:
2848         (WKSetObservedContentChange):
2849         (WKStartObservingStyleRecalcScheduling): Deleted.
2850         (WKStopObservingStyleRecalcScheduling): Deleted.
2851         (WKIsObservingStyleRecalcScheduling): Deleted.
2852         (WKSetShouldObserveNextStyleRecalc): Deleted.
2853         (WKShouldObserveNextStyleRecalc): Deleted.
2854         * platform/ios/wak/WKContentObservation.h:
2855
2856 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2857
2858         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
2859         https://bugs.webkit.org/show_bug.cgi?id=195070
2860         <rdar://problem/48417650>
2861
2862         Reviewed by Tim Horton.
2863
2864         Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
2865
2866         * page/ios/ContentChangeObserver.h:
2867         * page/ios/ContentChangeObserver.mm:
2868         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
2869         (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
2870         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
2871         (WebCore::ContentChangeObserver::setObservedContentChange):
2872         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
2873         (WebCore::ContentChangeObserver::addObservedDOMTimer):
2874         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2875         * platform/ios/wak/WKContentObservation.cpp:
2876         (WKStartObservingDOMTimerScheduling):
2877         (WKSetObservedContentChange):
2878         (WebThreadGetObservedDOMTimers): Deleted.
2879         (WebThreadCountOfObservedDOMTimers): Deleted.
2880         (WebThreadClearObservedDOMTimers): Deleted.
2881         (WebThreadContainsObservedDOMTimer): Deleted.
2882         (WebThreadAddObservedDOMTimer): Deleted.
2883         (WebThreadRemoveObservedDOMTimer): Deleted.
2884         * platform/ios/wak/WKContentObservation.h:
2885
2886 2019-02-27  Justin Fan  <justin_fan@apple.com>
2887         Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
2888
2889         Unreviewed build fix.
2890
2891         * Modules/webgpu/WebGPUBuffer.cpp:
2892         (WebCore::WebGPUBuffer::setSubData):
2893         * Modules/webgpu/WebGPUBuffer.h:
2894         * Modules/webgpu/WebGPUBufferBinding.h:
2895         * Modules/webgpu/WebGPURenderPassEncoder.idl:
2896         * platform/graphics/gpu/GPUBufferBinding.h:
2897         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
2898         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
2899
2900 2019-02-27  John Wilander  <wilander@apple.com>
2901
2902         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
2903         https://bugs.webkit.org/show_bug.cgi?id=195071
2904         <rdar://problem/48417690>
2905
2906         Reviewed by Alex Christensen and Brent Fulgham.
2907
2908         No new tests. This patch maintains functionality covered by plenty of layout
2909         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
2910
2911         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
2912         and makes the necessary infrastructure changes to support that.
2913
2914         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
2915         HashSets since we never used the counts for anything. This change simplified
2916         encoding and decoding for IPC and will eventually simplify encoding and
2917         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
2918         model version 14 and below.
2919
2920         The patch also makes WebCore::RegistrableDomain's String constructor private.
2921         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
2922         is introduced to better signal to users that creating a registrable domain
2923         object with a string may create an object that doesn't match a registrable
2924         domain in a valid HTTP-family URL. This change (private String constructor)
2925         motivated a change in WebCore::AdClickAttribution where the Source and
2926         Destination structs now take a URL as parameter instead of a String.
2927
2928         Finally, this patch harmonizes parameter and variable naming, going from
2929         "origin" to "domain" and "mainFrame" to "topFrame."
2930
2931         * html/HTMLAnchorElement.cpp:
2932         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2933         * html/HTMLMediaElement.cpp:
2934         (WebCore::HTMLMediaElement::mediaSessionTitle const):
2935         * loader/AdClickAttribution.h:
2936         (WebCore::AdClickAttribution::Source::Source):
2937         (WebCore::AdClickAttribution::Source::deletedValue):
2938         (WebCore::AdClickAttribution::Destination::Destination):
2939         (WebCore::AdClickAttribution::Destination::deletedValue):
2940         (WebCore::AdClickAttribution::decode):
2941         * loader/ResourceLoadObserver.cpp:
2942         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2943         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2944         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2945         (WebCore::ResourceLoadObserver::statisticsForURL):
2946         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
2947         * loader/ResourceLoadObserver.h:
2948         * loader/ResourceLoadStatistics.cpp:
2949         (WebCore::encodeHashSet):
2950         (WebCore::ResourceLoadStatistics::encode const):
2951         (WebCore::decodeHashCountedSet):
2952         (WebCore::decodeHashSet):
2953         (WebCore::ResourceLoadStatistics::decode):
2954         (WebCore::appendHashSet):
2955         (WebCore::ResourceLoadStatistics::toString const):
2956         (WebCore::ResourceLoadStatistics::merge):
2957         (WebCore::encodeHashCountedSet): Deleted.
2958         (WebCore::encodeOriginHashSet): Deleted.
2959         (WebCore::decodeOriginHashSet): Deleted.
2960         (WebCore::appendHashCountedSet): Deleted.
2961         * loader/ResourceLoadStatistics.h:
2962         * platform/RegistrableDomain.h:
2963         (WebCore::RegistrableDomain::uncheckedCreateFromString):
2964         (WebCore::RegistrableDomain::RegistrableDomain):
2965         * testing/Internals.cpp:
2966         (WebCore::Internals::resourceLoadStatisticsForURL):
2967         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
2968         * testing/Internals.h:
2969         * testing/Internals.idl:
2970
2971 2019-02-27  Justin Fan  <justin_fan@apple.com>
2972
2973         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
2974         https://bugs.webkit.org/show_bug.cgi?id=195077
2975         <rdar://problem/47805229>
2976
2977         Reviewed by Dean Jackson.
2978
2979         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
2980         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
2981         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
2982
2983         Tests: webgpu/buffer-command-buffer-races.html
2984                webgpu/map-read-buffers.html
2985
2986         * Modules/webgpu/WebGPUBindGroup.h:
2987         (WebCore::WebGPUBindGroup::bindGroup const):
2988         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
2989         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
2990         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
2991         (WebCore::WebGPUBuffer::setSubData):
2992         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
2993         (WebCore::WebGPUBuffer::destroy):
2994         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
2995         * Modules/webgpu/WebGPUBuffer.h:
2996         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
2997         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
2998         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2999         (WebCore::WebGPUCommandBuffer::beginRenderPass):
3000         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
3001         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
3002         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
3003         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3004         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
3005         * Sources.txt:
3006         * WebCore.xcodeproj/project.pbxproj:
3007         * platform/graphics/gpu/GPUBuffer.h:
3008         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
3009         (WebCore::GPUBuffer::isVertex const):
3010         (WebCore::GPUBuffer::isUniform const):
3011         (WebCore::GPUBuffer::isStorage const):
3012         (WebCore::GPUBuffer::isReadOnly const):
3013         (WebCore::GPUBuffer::isMappable const):
3014         (WebCore::GPUBuffer::isMapWrite const):
3015         (WebCore::GPUBuffer::isMapRead const):
3016         (WebCore::GPUBuffer::isMapWriteable const):
3017         (WebCore::GPUBuffer::isMapReadable const):
3018         * platform/graphics/gpu/GPUBufferBinding.h:
3019         * platform/graphics/gpu/GPUCommandBuffer.h:
3020         (WebCore::GPUCommandBuffer::usedBuffers const):
3021         (WebCore::GPUCommandBuffer::useBuffer):
3022         * platform/graphics/gpu/GPUDevice.cpp:
3023         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
3024         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
3025         * platform/graphics/gpu/GPUDevice.h:
3026         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
3027         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
3028         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
3029         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
3030         * platform/graphics/gpu/GPURenderPassEncoder.h:
3031         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3032         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
3033         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
3034         (WebCore::GPUBuffer::GPUBuffer):
3035         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
3036         (WebCore::GPUBuffer::state const):
3037         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
3038         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
3039         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
3040         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
3041         (WebCore::GPUBuffer::registerMappingCallback):
3042         (WebCore::GPUBuffer::runMappingCallback):
3043         (WebCore::GPUBuffer::unmap):
3044         (WebCore::GPUBuffer::destroy):
3045         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
3046         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
3047         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
3048         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
3049         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3050         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
3051         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3052         (WebCore::GPURenderPassEncoder::tryCreate):
3053         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
3054         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
3055         (WebCore::GPURenderPassEncoder::create): Deleted.
3056
3057         Buffer size updates in the IDL:
3058         * Modules/webgpu/GPUBufferDescriptor.idl:
3059         * Modules/webgpu/WebGPUBuffer.idl:
3060         * Modules/webgpu/WebGPUBufferBinding.idl:
3061         * Modules/webgpu/WebGPUCommandBuffer.idl:
3062         * Modules/webgpu/WebGPURenderPassEncoder.idl:
3063         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
3064         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
3065
3066 2019-02-27  Youenn Fablet  <youenn@apple.com>
3067
3068         Remove LeetCode FetchRequest quirk
3069         https://bugs.webkit.org/show_bug.cgi?id=195100
3070
3071         Reviewed by Alex Christensen.
3072
3073         Covered by manual testing.
3074
3075         * Modules/fetch/FetchRequest.cpp:
3076         (WebCore::needsSignalQuirk):
3077
3078 2019-02-27  Chris Dumez  <cdumez@apple.com>
3079
3080         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
3081         https://bugs.webkit.org/show_bug.cgi?id=195101
3082         <rdar://problem/48423023>
3083
3084         Reviewed by Geoffrey Garen.
3085
3086         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
3087         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
3088         needed to unblock the site and proceed with the login flow.
3089
3090         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
3091         guard the quirk behind this flag.
3092
3093         * page/DOMWindow.cpp:
3094         (WebCore::DOMWindow::addEventListener):
3095         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
3096         * page/DOMWindow.h:
3097
3098 2019-02-27  Antoine Quint  <graouts@apple.com>
3099
3100         Support Pointer Events on macOS
3101         https://bugs.webkit.org/show_bug.cgi?id=195008
3102         <rdar://problem/47454419>
3103
3104         Reviewed by Dean Jackson.
3105
3106         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
3107         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
3108         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
3109         and the same behavior also extends to "pointerup".
3110
3111         Tests: pointerevents/mouse/over-enter-out-leave.html
3112                pointerevents/mouse/pointer-capture.html
3113                pointerevents/mouse/pointer-event-basic-properties.html
3114                pointerevents/mouse/pointer-events-before-mouse-events.html
3115                pointerevents/mouse/pointerdown-prevent-default.html
3116
3117         * Configurations/FeatureDefines.xcconfig:
3118         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
3119         property does not have any effect on macOS.
3120         (WebCore::Document::invalidateRenderingDependentRegions):
3121         (WebCore::Document::nodeWillBeRemoved):
3122         (WebCore::Document::updateTouchActionElements):
3123         * dom/Document.h:
3124         * dom/Element.cpp:
3125         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
3126         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
3127         the mouse event.
3128         * dom/PointerEvent.cpp:
3129         (WebCore::pointerEventType):
3130         (WebCore::PointerEvent::create):
3131         * dom/PointerEvent.h:
3132         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
3133         (WebCore::hierarchyHasCapturingEventListeners):
3134         (WebCore::EventHandler::updateMouseEventTargetNode):
3135         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
3136         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
3137         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
3138         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
3139         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
3140         it is set.
3141         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
3142         * style/StyleTreeResolver.cpp:
3143         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
3144
3145 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
3146
3147         Network Process is put to suspended when holding locked IndexedDB files
3148         https://bugs.webkit.org/show_bug.cgi?id=195024
3149         <rdar://problem/45194169>
3150
3151         Reviewed by Geoffrey Garen.
3152
3153         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
3154         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
3155         taking background assertion in UI process until the closes are done and locks are released.
3156
3157         * Modules/indexeddb/server/IDBServer.cpp:
3158         (WebCore::IDBServer::IDBServer::create):
3159         (WebCore::IDBServer::IDBServer::IDBServer):
3160         (WebCore::IDBServer::IDBServer::createBackingStore):
3161         (WebCore::IDBServer::IDBServer::closeDatabase):
3162         (WebCore::IDBServer::IDBServer::didCloseDatabase):
3163         * Modules/indexeddb/server/IDBServer.h:
3164         (WebCore::IDBServer::IDBServer::create):
3165         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3166         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
3167         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
3168         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
3169         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3170         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3171         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
3172         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3173
3174 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
3175
3176         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
3177         https://bugs.webkit.org/show_bug.cgi?id=194973
3178
3179         Reviewed by Antti Koivisto.
3180
3181         This patch cleans up how the scrolling tree responds to scrolls.
3182
3183         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
3184         UI process scroll position.
3185
3186         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
3187         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
3188         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
3189         updates related layers on this node (counter-scrolling layers etc), and then tells the
3190         scrolling tree, which recurses through descendant nodes so they can adjust their layer
3191         positions.
3192
3193         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
3194         which does the above other than setting scrolledContentsLayer (since we're reacting to
3195         layer state changes, not producing them).
3196
3197         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
3198         ScrollingTree does the tree walk so classes don't have to implement
3199         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
3200         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
3201         need to cross frame boundaries).
3202
3203         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
3204         since the fixed state was computed with the "layout" scroll position, so we have to account
3205         for the scroll delta since the last committed position. It's possible we could improve this
3206         in future.
3207
3208         * page/scrolling/ScrollingTree.cpp:
3209         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
3210         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
3211         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
3212         (WebCore::ScrollingTree::mainFrameLayoutViewport):
3213         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
3214         * page/scrolling/ScrollingTree.h:
3215         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3216         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
3217         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3218         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3219         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
3220         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
3221         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3222         * page/scrolling/ScrollingTreeNode.cpp:
3223         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
3224         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
3225         * page/scrolling/ScrollingTreeNode.h:
3226         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3227         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
3228         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
3229         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
3230         (WebCore::ScrollingTreeScrollingNode::scrollBy):
3231         (WebCore::ScrollingTreeScrollingNode::scrollTo):
3232         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
3233         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
3234         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
3235         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
3236         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
3237         * page/scrolling/ScrollingTreeScrollingNode.h:
3238         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
3239         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
3240         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
3241         * page/scrolling/ThreadedScrollingTree.cpp:
3242         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
3243         * page/scrolling/ThreadedScrollingTree.h:
3244         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
3245         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
3246         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
3247         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
3248         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
3249         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
3250         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
3251         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
3252         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3253         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3254         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
3255         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
3256         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3257         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
3258         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
3259         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
3260         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
3261         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
3262         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
3263         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
3264         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
3265         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
3266         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
3267         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3268         (): Deleted.
3269         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3270         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
3271         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
3272         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
3273         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
3274         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
3275         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
3276         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
3277         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
3278         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3279         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
3280         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
3281         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
3282         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
3283         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
3284         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
3285
3286 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
3287
3288         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
3289         https://bugs.webkit.org/show_bug.cgi?id=194973
3290
3291         Reviewed by Antti Koivisto.
3292
3293         The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
3294         layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
3295         and require different code for each scrolling node subclass, and adds a choke point that we can use to update
3296         the layout viewport.
3297         
3298         We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
3299         an alias for the scroll position.
3300
3301         Add some isRootNode() checks for things that should only affect the main frame.
3302
3303         * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
3304         no sense here.
3305         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3306         (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
3307         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3308         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
3309         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
3310         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
3311         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3312         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
3313         (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
3314         (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
3315         * page/scrolling/ScrollingTreeScrollingNode.h:
3316         (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
3317         * page/scrolling/ios/ScrollingTreeIOS.cpp:
3318         (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
3319         * page/scrolling/ios/ScrollingTreeIOS.h:
3320         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3321         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3322         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
3323         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
3324         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3325         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
3326         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
3327         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
3328         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3329         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3330         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
3331
3332 2019-02-27  Ulrich Pflueger  <up@nanocosmos.de>
3333
3334         [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
3335         https://bugs.webkit.org/show_bug.cgi?id=194747
3336         <rdar://problem/48148469>
3337
3338         Reviewed by Jer Noble.
3339
3340         Prevent unintended frame drops by including last frame duration in discontinuity check. 
3341
3342         Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
3343
3344         * Modules/mediasource/SourceBuffer.cpp:
3345         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3346
3347 2019-02-27  Timothy Hatcher  <timothy@apple.com>
3348
3349         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
3350         https://bugs.webkit.org/show_bug.cgi?id=195086
3351         rdar://problem/48419124
3352
3353         Reviewed by Tim Horton.
3354
3355         * platform/mac/ScrollAnimatorMac.mm:
3356         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
3357
3358 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3359
3360         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
3361         https://bugs.webkit.org/show_bug.cgi?id=195067
3362         <rdar://problem/44812080>
3363
3364         Reviewed by Tim Horton.
3365
3366         This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
3367         would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
3368         by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
3369         really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
3370         specific guards around this logic.
3371
3372         Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
3373         a very subtle behavior change covered by the new layout test below.
3374
3375         Test: editing/undo/redo-text-insertion-in-non-editable-node.html
3376
3377         * editing/InsertIntoTextNodeCommand.cpp:
3378         (WebCore::InsertIntoTextNodeCommand::doReapply):
3379         * editing/InsertIntoTextNodeCommand.h:
3380
3381 2019-02-26  Keith Miller  <keith_miller@apple.com>
3382
3383         Code quality cleanup in NeverDestroyed
3384         https://bugs.webkit.org/show_bug.cgi?id=194824
3385
3386         Reviewed by Mark Lam.
3387
3388         name_names.pl should not just assume the layout of LazyNeverDestroyed.
3389
3390         * dom/make_names.pl:
3391         (printNamesCppFile):
3392
3393 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3394
3395         Do not try to observe the timer when Page is nullptr
3396         https://bugs.webkit.org/show_bug.cgi?id=195076
3397
3398         Reviewed by Tim Horton.
3399
3400         Covered by fast/dom/Window/timer-null-script-execution-context.html.
3401
3402         * page/DOMTimer.cpp:
3403         (WebCore::DOMTimer::install):
3404
3405 2019-02-20  Jer Noble  <jer.noble@apple.com>
3406
3407         [Cocoa] Media elements will restart network buffering just before suspending
3408         https://bugs.webkit.org/show_bug.cgi?id=193691
3409
3410         Reviewed by Eric Carlson.
3411
3412         API Test: WebKit.ProcessSuspendMediaBuffering
3413
3414         Allow the Page to suspend all media buffering in its child Documents.
3415
3416         * dom/Document.cpp:
3417         (WebCore::Document::suspendAllMediaBuffering):
3418         (WebCore::Document::resumeAllMediaBuffering):
3419         * dom/Document.h:
3420         * html/MediaElementSession.cpp:
3421         (WebCore::MediaElementSession::dataBufferingPermitted const):
3422         (WebCore::MediaElementSession::suspendBuffering):
3423         (WebCore::MediaElementSession::resumeBuffering):
3424         (WebCore::MediaElementSession::bufferingSuspended const):
3425         * html/MediaElementSession.h:
3426         * page/Page.cpp:
3427         (WebCore::Page::suspendAllMediaBuffering):
3428         (WebCore::Page::resumeAllMediaBuffering):
3429         * page/Page.h:
3430         (WebCore::Page::mediaPlaybackIsSuspended const):
3431         (WebCore::Page::mediaBufferingIsSuspended const):
3432         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
3433         * platform/audio/PlatformMediaSession.h:
3434         (WebCore::PlatformMediaSession::suspendBuffering):
3435         (WebCore::PlatformMediaSession::resumeBuffering):
3436         * platform/audio/PlatformMediaSessionManager.cpp:
3437         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
3438         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
3439         * platform/audio/PlatformMediaSessionManager.h:
3440
3441 2019-02-26  Youenn Fablet  <youenn@apple.com>
3442
3443         Move service worker response validation from the service worker client to the service worker itself
3444         https://bugs.webkit.org/show_bug.cgi?id=194716
3445
3446         Reviewed by Geoffrey Garen.
3447
3448         Added response validation at service worker side.
3449
3450         No change of behavior except for now logging validation error messages in the console.
3451         Covered by rebased tests.
3452
3453         * workers/service/context/ServiceWorkerFetch.cpp:
3454         (WebCore::ServiceWorkerFetch::validateResponse):
3455         (WebCore::ServiceWorkerFetch::processResponse):
3456         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
3457
3458 2019-02-26  Sihui Liu  <sihui_liu@apple.com>
3459
3460         [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
3461         https://bugs.webkit.org/show_bug.cgi?id=195036
3462
3463         Reviewed by Geoffrey Garen.
3464
3465         When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but 
3466         also transactions in committing process.
3467
3468         Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise 
3469         there is a reference cycle of TransactionOpration.
3470
3471         Covered by existing tests storage/indexeddb/IDBObject-leak.html.
3472
3473         * Modules/indexeddb/IDBDatabase.cpp:
3474         (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
3475         * Modules/indexeddb/IDBTransaction.cpp:
3476         (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
3477         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3478         (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
3479         * Modules/indexeddb/client/IDBConnectionProxy.h:
3480         * Modules/indexeddb/client/TransactionOperation.h:
3481         (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the 
3482         operation is in completion process. 
3483
3484 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3485
3486         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
3487         https://bugs.webkit.org/show_bug.cgi?id=195066
3488         <rdar://problem/48411682>
3489
3490         Reviewed by Tim Horton.
3491
3492         Now all the empty clearContentChangeObservers() implementations can be removed.
3493
3494         * dom/Document.cpp:
3495         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
3496         * loader/EmptyClients.h:
3497         * page/ChromeClient.h:
3498         * page/Frame.cpp:
3499         (WebCore::Frame::willDetachPage):
3500         * page/ios/ContentChangeObserver.h:
3501         * page/ios/ContentChangeObserver.mm:
3502         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
3503         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
3504         (WebCore::ContentChangeObserver::willDetachPage):
3505
3506 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3507
3508         [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
3509         https://bugs.webkit.org/show_bug.cgi?id=195062
3510         <rdar://problem/48409258>
3511
3512         Reviewed by Tim Horton.
3513
3514         Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
3515
3516         * dom/Document.cpp:
3517         (WebCore::Document::scheduleStyleRecalc):
3518         * page/DOMTimer.cpp:
3519         (WebCore::DOMTimer::install):
3520         * page/ios/ContentChangeObserver.h:
3521         * page/ios/ContentChangeObserver.mm:
3522         (WebCore::ContentChangeObserver::didInstallDOMTimer):
3523         (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
3524         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
3525
3526 2019-02-26  Chris Dumez  <cdumez@apple.com>
3527
3528         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
3529         https://bugs.webkit.org/show_bug.cgi?id=195054
3530         <rdar://problem/48330549>
3531
3532         Reviewed by Geoff Garen.
3533
3534         Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
3535
3536         * page/MemoryRelease.cpp:
3537         (WebCore::releaseNoncriticalMemory):
3538         (WebCore::releaseCriticalMemory):
3539         (WebCore::releaseMemory):
3540         * page/MemoryRelease.h:
3541
3542 2019-02-26  Commit Queue  <commit-queue@webkit.org>
3543
3544         Unreviewed, rolling out r241970.
3545         https://bugs.webkit.org/show_bug.cgi?id=195057
3546
3547         made the QuickLook.LegacyQuickLookContent API test flakey
3548         (Requested by estes on #webkit).
3549
3550         Reverted changeset:
3551
3552         "[iOS] Break a reference cycle between PreviewLoader and
3553         ResourceLoader"
3554         https://bugs.webkit.org/show_bug.cgi?id=194964
3555         https://trac.webkit.org/changeset/241970
3556
3557 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3558
3559         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
3560         https://bugs.webkit.org/show_bug.cgi?id=195023
3561         <rdar://problem/48381885>
3562
3563         Reviewed by Tim Horton.
3564
3565         In the future we might decide that certain activities don't require DOMTimer observation, but that should
3566         be internal to ContentChangeObserver.
3567
3568         * page/ios/ContentChangeObserver.h:
3569         * page/ios/ContentChangeObserver.mm:
3570         (WebCore::ContentChangeObserver::startObservingContentChanges):
3571         (WebCore::ContentChangeObserver::stopObservingContentChanges):
3572         * page/ios/EventHandlerIOS.mm:
3573         (WebCore::EventHandler::mouseMoved):
3574
3575 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3576
3577         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
3578         https://bugs.webkit.org/show_bug.cgi?id=195032
3579         <rdar://problem/48388063>
3580
3581         Reviewed by Tim Horton.
3582
3583         This might eventually turn into a regular start/stop content observing call.
3584
3585         * dom/Document.cpp:
3586         (WebCore::Document::updateStyleIfNeeded):
3587         * page/ios/ContentChangeObserver.h:
3588         * page/ios/ContentChangeObserver.mm:
3589         (WebCore::ContentChangeObserver::startObservingStyleResolve):
3590         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
3591
3592 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3593
3594         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
3595         https://bugs.webkit.org/show_bug.cgi?id=195035
3596         <rdar://problem/48389123>
3597
3598         Reviewed by Tim Horton.
3599
3600         Visibility checking logic belongs to ContentChangeObserver.
3601
3602         * page/ios/ContentChangeObserver.h:
3603         * page/ios/ContentChangeObserver.mm:
3604         (WebCore::elementImplicitVisibility):
3605         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
3606         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
3607         * rendering/updating/RenderTreeUpdater.cpp:
3608         (WebCore::RenderTreeUpdater::updateElementRenderer):
3609         (WebCore::elementImplicitVisibility): Deleted.
3610         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
3611         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
3612
3613 2019-02-26  Philippe Normand  <pnormand@igalia.com>
3614
3615         [EGL] Runtime support for RGB565 pixel layout
3616         https://bugs.webkit.org/show_bug.cgi?id=194817
3617
3618         Reviewed by Carlos Garcia Campos.
3619
3620         Currently our graphics pipeline always relies on a ARGB8888 (32
3621         bpp) pixel configuration. On some low-end (old) embedded platforms
3622         the graphics driver is sometimes optimized for 16 bpp
3623         configurations, such as RGB565. On those platforms the application
3624         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
3625         "RGB565" to adjust to the best pixel configuration supported by
3626         the screen and graphics driver.
3627
3628         * platform/graphics/egl/GLContextEGL.cpp:
3629         (WebCore::GLContextEGL::getEGLConfig):
3630
3631 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
3632
3633         [WPE] Add API for webview background color configuration
3634         https://bugs.webkit.org/show_bug.cgi?id=192305
3635
3636         Reviewed by Michael Catanzaro.
3637
3638         Adapt the FrameView API to allow a default non-white background color.
3639
3640         * page/Frame.cpp:
3641         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
3642         * page/Frame.h:
3643         * page/FrameView.cpp:
3644         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
3645         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
3646         used only in non-dark-mode-css build configurations.
3647         * page/FrameView.h:
3648         * testing/Internals.cpp:
3649         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
3650
3651 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
3652
3653         scalableNativeWebpageParameters() is not preserved on new page navigation.
3654         https://bugs.webkit.org/show_bug.cgi?id=194892
3655         <rdar://problem/47538280>
3656
3657         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
3658         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
3659         configuration until we derive the right values from viewport meta-tag.
3660
3661         Reviewed by Wenson Hsieh.
3662
3663         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
3664
3665         * page/ViewportConfiguration.cpp:
3666         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
3667         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
3668         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
3669             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
3670         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
3671         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
3672         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
3673             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
3674
3675 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3676
3677         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
3678         https://bugs.webkit.org/show_bug.cgi?id=194988
3679         <rdar://problem/48343040>
3680
3681         Reviewed by Tim Horton.
3682
3683         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
3684
3685         * page/DOMWindow.cpp:
3686         (WebCore::DOMWindow::clearTimeout):
3687         * page/ios/ContentChangeObserver.h:
3688         * page/ios/ContentChangeObserver.mm:
3689         (WebCore::ContentChangeObserver::startObservingDOMTimer):
3690         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
3691         (WebCore::ContentChangeObserver::removeDOMTimer):
3692
3693 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3694
3695         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
3696         https://bugs.webkit.org/show_bug.cgi?id=194987
3697         <rdar://problem/48342910>
3698
3699         Reviewed by Tim Horton.
3700
3701         Content obvservation logic should all move to the ContentChangeObserver class.
3702
3703         * page/DOMTimer.cpp:
3704         (WebCore::DOMTimer::install):
3705         (WebCore::DOMTimer::fired):
3706         * page/Page.cpp:
3707         (WebCore::Page::Page):
3708         * page/Page.h:
3709         (WebCore::Page::contentChangeObserver):
3710         * page/ios/ContentChangeObserver.h:
3711         * page/ios/ContentChangeObserver.mm:
3712         (WebCore::ContentChangeObserver::ContentChangeObserver):
3713         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
3714         (WebCore::ContentChangeObserver::startObservingDOMTimer):
3715         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
3716         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
3717         (WebCore::ContentChangeObserver::addObservedDOMTimer):
3718         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
3719
3720 2019-02-25  John Wilander  <wilander@apple.com>
3721
3722         Introduce and adopt new class RegistrableDomain for eTLD+1
3723         https://bugs.webkit.org/show_bug.cgi?id=194791
3724         <rdar://problem/48179240>
3725
3726         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
3727
3728         A new API test was added. Plenty of existing layout tests under
3729         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
3730
3731         This patch introduces and adopts a new class called WebCore::RegistrableDomain
3732         which represents a domain's eTLD+1 (effective top level domain plus one) and is
3733         the basis for the term "site," as in same-site. Other popular names include
3734         high-level domain, primary domain, and top privately controlled/owned domain.
3735         Effective top level domains are enumerated on the Public Suffix List
3736         (https://publicsuffix.org).
3737
3738         This class just uses the full domain for when the Public Suffix List cannot help
3739         finding the registrable domain and for WebKit ports that haven't enabled
3740         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
3741         for the null or unique origin (this matches how these origins were handled
3742         before).
3743
3744         The implementation is a wrapper around a String and the functions and class
3745         members that now make use of this new class used to handle regular String
3746         objects which didn't help much in terms of type safety or guarantees that the
3747         string had already been converted to an eTLD+1.
3748
3749         We've at least two bad bugs in the Storage Access API because of confusion
3750         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
3751         will prohibit such bugs in the future.
3752
3753         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
3754         WebCore::RegistrableDomain for partitioning in a later patch.
3755
3756         This patch also enhances parameter naming by:
3757         - Removing parts that refer to "primary" as in primaryDomain.
3758         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
3759         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
3760         - Using the term "domain" consistently instead of e.g. "host."
3761
3762         * WebCore.xcodeproj/project.pbxproj:
3763         * dom/Document.cpp:
3764         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
3765         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
3766         * dom/Document.h:
3767         * html/HTMLAnchorElement.cpp:
3768         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
3769         * html/HTMLMediaElement.cpp:
3770         (WebCore::HTMLMediaElement::mediaSessionTitle const):
3771         * loader/AdClickAttribution.cpp:
3772         (WebCore::AdClickAttribution::url const):
3773         (WebCore::AdClickAttribution::referrer const):
3774         (WebCore::AdClickAttribution::toString const):
3775         * loader/AdClickAttribution.h:
3776         (WebCore::AdClickAttribution::Source::Source):
3777         (WebCore::AdClickAttribution::Source::matches const):
3778         (WebCore::AdClickAttribution::Source::deleteValue):
3779         (WebCore::AdClickAttribution::Destination::Destination):
3780         (WebCore::AdClickAttribution::Destination::matches const):
3781         (WebCore::AdClickAttribution::Destination::deleteValue):
3782         * loader/ResourceLoadObserver.cpp:
3783         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
3784         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
3785         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
3786         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
3787         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
3788         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3789         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3790         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3791         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
3792         (WebCore::ResourceLoadObserver::logFontLoad):
3793         (WebCore::ResourceLoadObserver::logCanvasRead):
3794         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
3795         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
3796         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
3797         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
3798         (WebCore::ResourceLoadObserver::statisticsForOrigin):
3799         (WebCore::primaryDomain): Deleted.
3800         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
3801         * loader/ResourceLoadObserver.h:
3802         * loader/ResourceLoadStatistics.cpp:
3803         (WebCore::ResourceLoadStatistics::encode const):
3804         (WebCore::ResourceLoadStatistics::decode):
3805         (WebCore::ResourceLoadStatistics::toString const):
3806         (WebCore::ResourceLoadStatistics::merge):
3807         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
3808         * loader/ResourceLoadStatistics.h:
3809         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
3810         * page/Page.cpp:
3811         (WebCore::Page::logNavigation):
3812         (WebCore::Page::mainFrameLoadStarted):
3813         * page/Page.h:
3814         * page/PerformanceMonitor.cpp:
3815         (WebCore::reportPageOverPostLoadResourceThreshold):
3816         * platform/RegistrableDomain.h: Added.
3817         (WebCore::RegistrableDomain::RegistrableDomain):
3818         (WebCore::RegistrableDomain::isEmpty const):
3819         (WebCore::RegistrableDomain::string const):
3820         (WebCore::RegistrableDomain::operator!= const):
3821         (WebCore::RegistrableDomain::operator== const):
3822         (WebCore::RegistrableDomain::matches const):
3823         (WebCore::RegistrableDomain::isolatedCopy const):
3824         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
3825         (WebCore::RegistrableDomain::hash const):
3826         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
3827         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
3828         (WebCore::RegistrableDomain::encode const):
3829         (WebCore::RegistrableDomain::decode):
3830         * platform/network/NetworkStorageSession.cpp:
3831         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
3832         (WebCore::NetworkStorageSession::shouldBlockCookies const):
3833         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
3834         (WebCore::NetworkStorageSession::removePrevalentDomains):
3835         (WebCore::NetworkStorageSession::hasStorageAccess const):
3836         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
3837         (WebCore::NetworkStorageSession::grantStorageAccess):
3838         (WebCore::getPartitioningDomain): Deleted.
3839         * platform/network/NetworkStorageSession.h:
3840
3841 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
3842
3843         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
3844         https://bugs.webkit.org/show_bug.cgi?id=190138
3845         <rdar://problem/44907695>
3846
3847         Reviewed by Joanmarie Diggs.
3848
3849         Make sure that footer elements use the right role depending on their context.
3850         If scoped to body, they become contentinfo. Otherwise they are just delineated by
3851         a footer subrole.
3852
3853         * accessibility/AccessibilityObject.cpp:
3854         (WebCore::AccessibilityObject::isLandmark const):
3855         * accessibility/AccessibilityRenderObject.cpp:
3856         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
3857         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
3858         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3859         * accessibility/AccessibilityRenderObject.h:
3860         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3861         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
3862         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3863         (-[WebAccessibilityObjectWrapper subrole]):
3864
3865 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
3866
3867         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
3868         https://bugs.webkit.org/show_bug.cgi?id=194709
3869
3870         Reviewed by Geoffrey Garen.
3871
3872         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
3873         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
3874  
3875         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
3876         between IDBOpenDBRequest and IDBTransaction.
3877
3878         Test: storage/indexeddb/IDBObject-leak.html
3879
3880         * Modules/indexeddb/IDBDatabase.cpp:
3881         (WebCore::IDBDatabase::connectionToServerLost):
3882         * Modules/indexeddb/IDBTransaction.cpp:
3883         (WebCore::IDBTransaction::IDBTransaction):
3884         (WebCore::IDBTransaction::~IDBTransaction):
3885         (WebCore::IDBTransaction::connectionClosedFromServer):
3886         * Modules/indexeddb/IDBTransaction.h:
3887         * testing/Internals.cpp:
3888         (WebCore::Internals::numberOfIDBTransactions const):
3889         * testing/Internals.h:
3890         * testing/Internals.idl:
3891
3892 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3893
3894         Add missing stream parameter. Unreviewed.
3895
3896         * page/DOMTimer.cpp:
3897         (WebCore::DOMTimer::fired):
3898
3899 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3900
3901         Unreviewed build fix after r242032.
3902
3903         * page/DOMTimer.cpp:
3904         (WebCore::DOMTimer::install):
3905
3906 2019-02-20  Darin Adler  <darin@apple.com>
3907
3908         Incorrect use of String::foldCase for font family names
3909         https://bugs.webkit.org/show_bug.cgi?id=194895
3910
3911         Reviewed by Myles C. Maxfield.
3912
3913         * platform/graphics/FontCascadeDescription.cpp:
3914         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
3915         familyNamesAreEqual instead of calling convertToASCIILowercase directly.
3916         (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
3917         operator== when we want case sensitive family name comparisons. This is a special
3918         case to accomodate CoreText, which uses "."-prefix names for internal fonts that
3919         are treated case sensitively. (Ideally webpages would not use these fonts at all.)
3920         (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
3921         when we want case sensitive family name hashing.
3922         (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
3923         AtomicString so we can use this at an additional call site. Converting from an
3924         AtomicString to a String if free and automatic at the existing call sites. Use
3925         convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
3926         here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
3927         must be consistent. 2) this is considerably faster, and 3) font family names don't
3928         need arbitrary Unicode case folding, it's only A-Z that should be folded.
3929         * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
3930         in the foldedFamilyName function.
3931
3932         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3933         (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
3934         FontCascadeDescription::foldedFamilyName to correctly fold font family names.
3935
3936 2019-02-25  Charlie Turner  <cturner@igalia.com>
3937
3938         [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
3939         https://bugs.webkit.org/show_bug.cgi?id=194992