Followup to:
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-28  Brady Eidson  <beidson@apple.com>
2
3         Followup to:
4         Universal links from Google search results pages don't open the app
5         https://bugs.webkit.org/show_bug.cgi?id=195126
6
7         Unreviewed.
8
9         * page/SecurityOrigin.cpp:
10         (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
11
12 2019-02-28  Simon Fraser  <simon.fraser@apple.com>
13
14         [iOS] Dark flash when opening Google AMP pages
15         https://bugs.webkit.org/show_bug.cgi?id=195193
16         rdar://problem/48326442
17
18         Reviewed by Zalan Bujtas.
19
20         After the incremental compositing updates changes, it was possible for a change in the size
21         of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
22         a composited descendant that is not a descendant in z-order. When Google search results
23         create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
24         leaving the #222 background of an intermediate element visible.
25
26         Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
27         that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
28         this flag affects all descendants; in future, we might be able to clear it for grand-children.
29
30         Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
31                compositing/geometry/ancestor-clip-change.html
32
33         * rendering/RenderLayer.cpp:
34         (WebCore::RenderLayer::updateLayerPositions):
35         (WebCore::RenderLayer::updateLayerPosition):
36         * rendering/RenderLayer.h:
37         * rendering/RenderLayerBacking.cpp:
38         (WebCore::RenderLayerBacking::updateAfterLayout):
39         * rendering/RenderLayerBacking.h:
40
41 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
42
43         Use-after-move in RenderCombineText::combineTextIfNeeded()
44         https://bugs.webkit.org/show_bug.cgi?id=195188
45
46         Reviewed by Zalan Bujtas.
47
48         r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
49         symptom, but this patch fixes the source of the problem (and reverts r242204).
50
51         The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
52
53         FontDescription bestFitDescription;
54         while (...) {
55             FontCascade compressedFont(WTFMove(bestFitDescription), ...);
56             ...
57         }
58
59         Clearly this is wrong.
60
61         Test: fast/text/text-combine-crash-2.html
62
63         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
64         (WebCore::FontDescription::platformResolveGenericFamily):
65         * rendering/RenderCombineText.cpp:
66         (WebCore::RenderCombineText::combineTextIfNeeded):
67
68 2019-02-28  Zalan Bujtas  <zalan@apple.com>
69
70         [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
71         https://bugs.webkit.org/show_bug.cgi?id=195172
72         <rdar://problem/48479259>
73
74         Reviewed by Simon Fraser.
75
76         Let's scope start/stopObserving call pairs.
77
78         * dom/Document.cpp:
79         (WebCore::Document::updateStyleIfNeeded):
80         * page/DOMTimer.cpp:
81         (WebCore::DOMTimer::fired):
82         * page/ios/ContentChangeObserver.cpp:
83         (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
84         (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
85         (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
86         (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
87         (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
88         (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
89         (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
90         (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
91         * page/ios/ContentChangeObserver.h:
92         * rendering/updating/RenderTreeUpdater.cpp:
93         (WebCore::RenderTreeUpdater::updateElementRenderer):
94
95 2019-02-28  Antoine Quint  <graouts@apple.com>
96
97         Enable the Pointer Events runtime flag by default
98         https://bugs.webkit.org/show_bug.cgi?id=195156
99
100         Reviewed by Dean Jackson.
101
102         * page/RuntimeEnabledFeatures.h:
103
104 2019-02-28  Zalan Bujtas  <zalan@apple.com>
105
106         [ContentChangeObserver] Make observed state reset explicit.
107         https://bugs.webkit.org/show_bug.cgi?id=195185
108         <rdar://problem/48488342>
109
110         Reviewed by Simon Fraser.
111
112         Use setObservedContentChange only for setting the observed change while observing.
113
114         * page/ios/ContentChangeObserver.cpp:
115         (WebCore::ContentChangeObserver::startObservingContentChanges):
116         (WebCore::ContentChangeObserver::resetObservedContentChange):
117         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
118         * page/ios/ContentChangeObserver.h:
119
120 2019-02-28  Commit Queue  <commit-queue@webkit.org>
121
122         Unreviewed, rolling out r242210.
123         https://bugs.webkit.org/show_bug.cgi?id=195179
124
125         it broke hover menus on losaltosonline.com (Requested by zalan
126         on #webkit).
127
128         Reverted changeset:
129
130         "[ContentChangeObserver] Move timer removal code from
131         DOMWindow::clearTimeout to DOMTimer::removeById"
132         https://bugs.webkit.org/show_bug.cgi?id=195143
133         https://trac.webkit.org/changeset/242210
134
135 2019-02-28  Zalan Bujtas  <zalan@apple.com>
136
137         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
138         https://bugs.webkit.org/show_bug.cgi?id=195143
139         <rdar://problem/48462351>
140
141         Reviewed by Simon Fraser.
142
143         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
144
145         * page/DOMTimer.cpp:
146         (WebCore::DOMTimer::removeById):
147         * page/DOMWindow.cpp:
148         (WebCore::DOMWindow::clearTimeout):
149         * page/ios/ContentChangeObserver.cpp:
150         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
151         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
152         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
153         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
154         * page/ios/ContentChangeObserver.h:
155
156 2019-02-28  Charles Vazac  <cvazac@akamai.com>
157
158         Fix Resource Timing buffer edge cases for WPT
159         https://bugs.webkit.org/show_bug.cgi?id=193213
160
161         Reviewed by Youenn Fablet.
162
163         Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
164
165         * page/Performance.cpp:
166         (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
167         resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
168         expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
169         the secondary buffer.
170
171 2019-02-28  Takashi Komori  <Takashi.Komori@sony.com>
172
173         [Curl] HTTP Body is missing with redirection.
174         https://bugs.webkit.org/show_bug.cgi?id=191651
175
176         Reviewed by Don Olmstead.
177
178         Implement updateFromDelegatePreservingOldProperties for curl port.
179
180         Tests: http/tests/navigation/post-301-response.html
181                http/tests/navigation/post-302-response.html
182                http/tests/navigation/post-303-response.html
183                http/tests/navigation/post-307-response.html
184                http/tests/navigation/post-308-response.html
185
186         * platform/Curl.cmake:
187         * platform/network/curl/ResourceRequest.h:
188         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
189         * platform/network/curl/ResourceRequestCurl.cpp: Added.
190         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
191
192 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
193
194         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
195         https://bugs.webkit.org/show_bug.cgi?id=195159
196
197         Reviewed by Don Olmstead.
198
199         Use COORDINATED_GRAPHICS instead.
200
201         * platform/graphics/GraphicsContext3D.h:
202         * platform/graphics/PlatformLayer.h:
203         * platform/graphics/cairo/ImageBufferCairo.cpp:
204         (WebCore::ImageBufferData::ImageBufferData):
205         (WebCore::ImageBufferData::~ImageBufferData):
206         * platform/graphics/cairo/ImageBufferDataCairo.h:
207         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
208         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
209         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
210         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
211         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
212         (WebCore::GraphicsContext3D::reshapeFBOs):
213         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
214         (WebCore::GraphicsContext3D::prepareTexture):
215         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
216         (WebCore::GraphicsContext3D::reshapeFBOs):
217         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
218         (WebCore::GraphicsContext3D::GraphicsContext3D):
219         (WebCore::GraphicsContext3D::~GraphicsContext3D):
220         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
221         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
222         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
223         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
224         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
225         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
226         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
227         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
228         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
229         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
230         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
231         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
232         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
233         * rendering/RenderLayerBacking.cpp:
234         (WebCore::RenderLayerBacking::paintsIntoWindow const):
235         * rendering/RenderLayerCompositor.cpp:
236         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
237
238 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
239
240         Locale names can be nullptr
241         https://bugs.webkit.org/show_bug.cgi?id=195171
242         <rdar://problem/48262376>
243
244         Reviewed by Dean Jackson.
245
246         Nullptr can't be used in keys to HashMaps, so take an early out in this case.
247
248         This is a partial revert of r241288.
249
250         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
251         (WebCore::FontDescription::platformResolveGenericFamily):
252
253 2019-02-28  Justin Fan  <justin_fan@apple.com>
254
255         [Web GPU] Enable Web GPU only on 64-bit
256         https://bugs.webkit.org/show_bug.cgi?id=195139
257
258         Because Metal is only supported on 64 bit apps.
259
260         Unreviewed build fix.
261
262         * Configurations/FeatureDefines.xcconfig:
263
264 2019-02-27  Zalan Bujtas  <zalan@apple.com>
265
266         [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
267         https://bugs.webkit.org/show_bug.cgi?id=195128
268         <rdar://problem/48456752>
269
270         Reviewed by Simon Fraser.
271
272         Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
273
274         * WebCore.xcodeproj/project.pbxproj:
275         * page/ios/ContentChangeObserver.mm:
276         (WebCore::ContentChangeObserver::setObservedContentChange):
277         * platform/ios/wak/WKContentObservation.cpp:
278         (WKSetObservedContentChange):
279         * platform/ios/wak/WKContentObservation.h:
280         * platform/ios/wak/WKContentObservationInternal.h: Removed.
281
282 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
283
284         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
285
286         * dom/Document.cpp:
287         (WebCore::Document::lastModified const):
288         * html/FTPDirectoryDocument.cpp:
289         (WebCore::processFileDateString):
290         * mathml/MathMLElement.cpp:
291         (WebCore::convertToPercentageIfNeeded):
292         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
293         * page/cocoa/ResourceUsageOverlayCocoa.mm:
294         (WebCore::ResourceUsageOverlay::platformDraw):
295         * page/linux/ResourceUsageOverlayLinux.cpp:
296         (WebCore::cpuUsageString):
297         (WebCore::gcTimerString):
298         * platform/DateComponents.cpp:
299         (WebCore::DateComponents::toStringForTime const):
300         (WebCore::DateComponents::toString const):
301         * platform/LocalizedStrings.cpp:
302         (WebCore::localizedString):
303         * platform/audio/HRTFElevation.cpp:
304         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
305         * platform/mock/MockRealtimeVideoSource.cpp:
306         (WebCore::MockRealtimeVideoSource::drawText):
307         * rendering/RenderLayerCompositor.cpp:
308         (WebCore::RenderLayerCompositor::logLayerInfo):
309         * rendering/RenderTheme.cpp:
310         (WebCore::RenderTheme::formatMediaControlsTime const):
311
312 2019-02-27  Zalan Bujtas  <zalan@apple.com>
313
314         [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
315         https://bugs.webkit.org/show_bug.cgi?id=195091
316         <rdar://problem/48427271>
317
318         Reviewed by Tim Horton.
319
320         * page/ios/ContentChangeObserver.h:
321         * page/ios/ContentChangeObserver.mm:
322         (WebCore::ContentChangeObserver::startObservingContentChanges):
323         (WebCore::ContentChangeObserver::stopObservingContentChanges):
324         (WebCore::ContentChangeObserver::isObservingContentChanges):
325         * platform/ios/wak/WKContentObservation.cpp:
326         (WKObservingContentChanges): Deleted.
327         (WKStartObservingContentChanges): Deleted.
328         (WKStopObservingContentChanges): Deleted.
329         * platform/ios/wak/WKContentObservation.h:
330         * platform/ios/wak/WKContentObservationInternal.h:
331
332 2019-02-27  Brady Eidson  <beidson@apple.com>
333
334         Universal links from Google search results pages don't open the app.
335         <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
336
337         Reviewed by Geoffrey Garen.
338
339         Covered by new API tests.
340
341         * loader/DocumentLoader.cpp:
342         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
343           an iframe if it is from the same security origin as the main frame.
344
345 2019-02-27  Zalan Bujtas  <zalan@apple.com>
346
347         [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
348         https://bugs.webkit.org/show_bug.cgi?id=195090
349         <rdar://problem/48426771>
350
351         Reviewed by Tim Horton.
352
353         Also remove some unused functions from WKContentObservationInternal.
354
355         * page/ios/ContentChangeObserver.h:
356         * page/ios/ContentChangeObserver.mm:
357         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
358         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
359         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
360         * platform/ios/wak/WKContentObservation.cpp:
361         (WKStartObservingDOMTimerScheduling): Deleted.
362         (WKStopObservingDOMTimerScheduling): Deleted.
363         (WKIsObservingDOMTimerScheduling): Deleted.
364         * platform/ios/wak/WKContentObservation.h:
365         * platform/ios/wak/WKContentObservationInternal.h:
366
367 2019-02-27  Zalan Bujtas  <zalan@apple.com>
368
369         [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
370         https://bugs.webkit.org/show_bug.cgi?id=195087
371
372         Reviewed by Simon Fraser.
373
374         Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
375
376         * page/ios/ContentChangeObserver.h:
377         * page/ios/ContentChangeObserver.mm:
378         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
379         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
380         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
381         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
382         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
383         (WebCore::ContentChangeObserver::setObservedContentChange):
384         * platform/ios/wak/WKContentObservation.cpp:
385         (WKSetObservedContentChange):
386         (WKStartObservingStyleRecalcScheduling): Deleted.
387         (WKStopObservingStyleRecalcScheduling): Deleted.
388         (WKIsObservingStyleRecalcScheduling): Deleted.
389         (WKSetShouldObserveNextStyleRecalc): Deleted.
390         (WKShouldObserveNextStyleRecalc): Deleted.
391         * platform/ios/wak/WKContentObservation.h:
392
393 2019-02-27  Zalan Bujtas  <zalan@apple.com>
394
395         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
396         https://bugs.webkit.org/show_bug.cgi?id=195070
397         <rdar://problem/48417650>
398
399         Reviewed by Tim Horton.
400
401         Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
402
403         * page/ios/ContentChangeObserver.h:
404         * page/ios/ContentChangeObserver.mm:
405         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
406         (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
407         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
408         (WebCore::ContentChangeObserver::setObservedContentChange):
409         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
410         (WebCore::ContentChangeObserver::addObservedDOMTimer):
411         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
412         * platform/ios/wak/WKContentObservation.cpp:
413         (WKStartObservingDOMTimerScheduling):
414         (WKSetObservedContentChange):
415         (WebThreadGetObservedDOMTimers): Deleted.
416         (WebThreadCountOfObservedDOMTimers): Deleted.
417         (WebThreadClearObservedDOMTimers): Deleted.
418         (WebThreadContainsObservedDOMTimer): Deleted.
419         (WebThreadAddObservedDOMTimer): Deleted.
420         (WebThreadRemoveObservedDOMTimer): Deleted.
421         * platform/ios/wak/WKContentObservation.h:
422
423 2019-02-27  Justin Fan  <justin_fan@apple.com>
424         Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
425
426         Unreviewed build fix.
427
428         * Modules/webgpu/WebGPUBuffer.cpp:
429         (WebCore::WebGPUBuffer::setSubData):
430         * Modules/webgpu/WebGPUBuffer.h:
431         * Modules/webgpu/WebGPUBufferBinding.h:
432         * Modules/webgpu/WebGPURenderPassEncoder.idl:
433         * platform/graphics/gpu/GPUBufferBinding.h:
434         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
435         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
436
437 2019-02-27  John Wilander  <wilander@apple.com>
438
439         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
440         https://bugs.webkit.org/show_bug.cgi?id=195071
441         <rdar://problem/48417690>
442
443         Reviewed by Alex Christensen and Brent Fulgham.
444
445         No new tests. This patch maintains functionality covered by plenty of layout
446         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
447
448         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
449         and makes the necessary infrastructure changes to support that.
450
451         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
452         HashSets since we never used the counts for anything. This change simplified
453         encoding and decoding for IPC and will eventually simplify encoding and
454         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
455         model version 14 and below.
456
457         The patch also makes WebCore::RegistrableDomain's String constructor private.
458         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
459         is introduced to better signal to users that creating a registrable domain
460         object with a string may create an object that doesn't match a registrable
461         domain in a valid HTTP-family URL. This change (private String constructor)
462         motivated a change in WebCore::AdClickAttribution where the Source and
463         Destination structs now take a URL as parameter instead of a String.
464
465         Finally, this patch harmonizes parameter and variable naming, going from
466         "origin" to "domain" and "mainFrame" to "topFrame."
467
468         * html/HTMLAnchorElement.cpp:
469         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
470         * html/HTMLMediaElement.cpp:
471         (WebCore::HTMLMediaElement::mediaSessionTitle const):
472         * loader/AdClickAttribution.h:
473         (WebCore::AdClickAttribution::Source::Source):
474         (WebCore::AdClickAttribution::Source::deletedValue):
475         (WebCore::AdClickAttribution::Destination::Destination):
476         (WebCore::AdClickAttribution::Destination::deletedValue):
477         (WebCore::AdClickAttribution::decode):
478         * loader/ResourceLoadObserver.cpp:
479         (WebCore::ResourceLoadObserver::logSubresourceLoading):
480         (WebCore::ResourceLoadObserver::logWebSocketLoading):
481         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
482         (WebCore::ResourceLoadObserver::statisticsForURL):
483         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
484         * loader/ResourceLoadObserver.h:
485         * loader/ResourceLoadStatistics.cpp:
486         (WebCore::encodeHashSet):
487         (WebCore::ResourceLoadStatistics::encode const):
488         (WebCore::decodeHashCountedSet):
489         (WebCore::decodeHashSet):
490         (WebCore::ResourceLoadStatistics::decode):
491         (WebCore::appendHashSet):
492         (WebCore::ResourceLoadStatistics::toString const):
493         (WebCore::ResourceLoadStatistics::merge):
494         (WebCore::encodeHashCountedSet): Deleted.
495         (WebCore::encodeOriginHashSet): Deleted.
496         (WebCore::decodeOriginHashSet): Deleted.
497         (WebCore::appendHashCountedSet): Deleted.
498         * loader/ResourceLoadStatistics.h:
499         * platform/RegistrableDomain.h:
500         (WebCore::RegistrableDomain::uncheckedCreateFromString):
501         (WebCore::RegistrableDomain::RegistrableDomain):
502         * testing/Internals.cpp:
503         (WebCore::Internals::resourceLoadStatisticsForURL):
504         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
505         * testing/Internals.h:
506         * testing/Internals.idl:
507
508 2019-02-27  Justin Fan  <justin_fan@apple.com>
509
510         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
511         https://bugs.webkit.org/show_bug.cgi?id=195077
512         <rdar://problem/47805229>
513
514         Reviewed by Dean Jackson.
515
516         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
517         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
518         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
519
520         Tests: webgpu/buffer-command-buffer-races.html
521                webgpu/map-read-buffers.html
522
523         * Modules/webgpu/WebGPUBindGroup.h:
524         (WebCore::WebGPUBindGroup::bindGroup const):
525         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
526         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
527         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
528         (WebCore::WebGPUBuffer::setSubData):
529         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
530         (WebCore::WebGPUBuffer::destroy):
531         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
532         * Modules/webgpu/WebGPUBuffer.h:
533         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
534         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
535         * Modules/webgpu/WebGPUCommandBuffer.cpp:
536         (WebCore::WebGPUCommandBuffer::beginRenderPass):
537         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
538         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
539         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
540         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
541         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
542         * Sources.txt:
543         * WebCore.xcodeproj/project.pbxproj:
544         * platform/graphics/gpu/GPUBuffer.h:
545         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
546         (WebCore::GPUBuffer::isVertex const):
547         (WebCore::GPUBuffer::isUniform const):
548         (WebCore::GPUBuffer::isStorage const):
549         (WebCore::GPUBuffer::isReadOnly const):
550         (WebCore::GPUBuffer::isMappable const):
551         (WebCore::GPUBuffer::isMapWrite const):
552         (WebCore::GPUBuffer::isMapRead const):
553         (WebCore::GPUBuffer::isMapWriteable const):
554         (WebCore::GPUBuffer::isMapReadable const):
555         * platform/graphics/gpu/GPUBufferBinding.h:
556         * platform/graphics/gpu/GPUCommandBuffer.h:
557         (WebCore::GPUCommandBuffer::usedBuffers const):
558         (WebCore::GPUCommandBuffer::useBuffer):
559         * platform/graphics/gpu/GPUDevice.cpp:
560         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
561         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
562         * platform/graphics/gpu/GPUDevice.h:
563         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
564         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
565         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
566         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
567         * platform/graphics/gpu/GPURenderPassEncoder.h:
568         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
569         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
570         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
571         (WebCore::GPUBuffer::GPUBuffer):
572         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
573         (WebCore::GPUBuffer::state const):
574         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
575         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
576         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
577         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
578         (WebCore::GPUBuffer::registerMappingCallback):
579         (WebCore::GPUBuffer::runMappingCallback):
580         (WebCore::GPUBuffer::unmap):
581         (WebCore::GPUBuffer::destroy):
582         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
583         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
584         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
585         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
586         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
587         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
588         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
589         (WebCore::GPURenderPassEncoder::tryCreate):
590         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
591         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
592         (WebCore::GPURenderPassEncoder::create): Deleted.
593
594         Buffer size updates in the IDL:
595         * Modules/webgpu/GPUBufferDescriptor.idl:
596         * Modules/webgpu/WebGPUBuffer.idl:
597         * Modules/webgpu/WebGPUBufferBinding.idl:
598         * Modules/webgpu/WebGPUCommandBuffer.idl:
599         * Modules/webgpu/WebGPURenderPassEncoder.idl:
600         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
601         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
602
603 2019-02-27  Youenn Fablet  <youenn@apple.com>
604
605         Remove LeetCode FetchRequest quirk
606         https://bugs.webkit.org/show_bug.cgi?id=195100
607
608         Reviewed by Alex Christensen.
609
610         Covered by manual testing.
611
612         * Modules/fetch/FetchRequest.cpp:
613         (WebCore::needsSignalQuirk):
614
615 2019-02-27  Chris Dumez  <cdumez@apple.com>
616
617         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
618         https://bugs.webkit.org/show_bug.cgi?id=195101
619         <rdar://problem/48423023>
620
621         Reviewed by Geoffrey Garen.
622
623         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
624         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
625         needed to unblock the site and proceed with the login flow.
626
627         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
628         guard the quirk behind this flag.
629
630         * page/DOMWindow.cpp:
631         (WebCore::DOMWindow::addEventListener):
632         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
633         * page/DOMWindow.h:
634
635 2019-02-27  Antoine Quint  <graouts@apple.com>
636
637         Support Pointer Events on macOS
638         https://bugs.webkit.org/show_bug.cgi?id=195008
639         <rdar://problem/47454419>
640
641         Reviewed by Dean Jackson.
642
643         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
644         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
645         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
646         and the same behavior also extends to "pointerup".
647
648         Tests: pointerevents/mouse/over-enter-out-leave.html
649                pointerevents/mouse/pointer-capture.html
650                pointerevents/mouse/pointer-event-basic-properties.html
651                pointerevents/mouse/pointer-events-before-mouse-events.html
652                pointerevents/mouse/pointerdown-prevent-default.html
653
654         * Configurations/FeatureDefines.xcconfig:
655         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
656         property does not have any effect on macOS.
657         (WebCore::Document::invalidateRenderingDependentRegions):
658         (WebCore::Document::nodeWillBeRemoved):
659         (WebCore::Document::updateTouchActionElements):
660         * dom/Document.h:
661         * dom/Element.cpp:
662         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
663         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
664         the mouse event.
665         * dom/PointerEvent.cpp:
666         (WebCore::pointerEventType):
667         (WebCore::PointerEvent::create):
668         * dom/PointerEvent.h:
669         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
670         (WebCore::hierarchyHasCapturingEventListeners):
671         (WebCore::EventHandler::updateMouseEventTargetNode):
672         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
673         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
674         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
675         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
676         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
677         it is set.
678         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
679         * style/StyleTreeResolver.cpp:
680         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
681
682 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
683
684         Network Process is put to suspended when holding locked IndexedDB files
685         https://bugs.webkit.org/show_bug.cgi?id=195024
686         <rdar://problem/45194169>
687
688         Reviewed by Geoffrey Garen.
689
690         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
691         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
692         taking background assertion in UI process until the closes are done and locks are released.
693
694         * Modules/indexeddb/server/IDBServer.cpp:
695         (WebCore::IDBServer::IDBServer::create):
696         (WebCore::IDBServer::IDBServer::IDBServer):
697         (WebCore::IDBServer::IDBServer::createBackingStore):
698         (WebCore::IDBServer::IDBServer::closeDatabase):
699         (WebCore::IDBServer::IDBServer::didCloseDatabase):
700         * Modules/indexeddb/server/IDBServer.h:
701         (WebCore::IDBServer::IDBServer::create):
702         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
703         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
704         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
705         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
706         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
707         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
708         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
709         * Modules/indexeddb/server/UniqueIDBDatabase.h:
710
711 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
712
713         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
714         https://bugs.webkit.org/show_bug.cgi?id=194973
715
716         Reviewed by Antti Koivisto.
717
718         This patch cleans up how the scrolling tree responds to scrolls.
719
720         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
721         UI process scroll position.
722
723         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
724         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
725         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
726         updates related layers on this node (counter-scrolling layers etc), and then tells the
727         scrolling tree, which recurses through descendant nodes so they can adjust their layer
728         positions.
729
730         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
731         which does the above other than setting scrolledContentsLayer (since we're reacting to
732         layer state changes, not producing them).
733
734         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
735         ScrollingTree does the tree walk so classes don't have to implement
736         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
737         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
738         need to cross frame boundaries).
739
740         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
741         since the fixed state was computed with the "layout" scroll position, so we have to account
742         for the scroll delta since the last committed position. It's possible we could improve this
743         in future.
744
745         * page/scrolling/ScrollingTree.cpp:
746         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
747         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
748         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
749         (WebCore::ScrollingTree::mainFrameLayoutViewport):
750         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
751         * page/scrolling/ScrollingTree.h:
752         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
753         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
754         * page/scrolling/ScrollingTreeFrameHostingNode.h:
755         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
756         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
757         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
758         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
759         * page/scrolling/ScrollingTreeNode.cpp:
760         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
761         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
762         * page/scrolling/ScrollingTreeNode.h:
763         * page/scrolling/ScrollingTreeScrollingNode.cpp:
764         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
765         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
766         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
767         (WebCore::ScrollingTreeScrollingNode::scrollBy):
768         (WebCore::ScrollingTreeScrollingNode::scrollTo):
769         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
770         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
771         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
772         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
773         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
774         * page/scrolling/ScrollingTreeScrollingNode.h:
775         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
776         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
777         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
778         * page/scrolling/ThreadedScrollingTree.cpp:
779         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
780         * page/scrolling/ThreadedScrollingTree.h:
781         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
782         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
783         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
784         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
785         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
786         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
787         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
788         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
789         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
790         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
791         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
792         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
793         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
794         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
795         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
796         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
797         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
798         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
799         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
800         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
801         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
802         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
803         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
804         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
805         (): Deleted.
806         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
807         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
808         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
809         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
810         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
811         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
812         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
813         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
814         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
815         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
816         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
817         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
818         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
819         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
820         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
821         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
822
823 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
824
825         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
826         https://bugs.webkit.org/show_bug.cgi?id=194973
827
828         Reviewed by Antti Koivisto.
829
830         The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
831         layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
832         and require different code for each scrolling node subclass, and adds a choke point that we can use to update
833         the layout viewport.
834         
835         We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
836         an alias for the scroll position.
837
838         Add some isRootNode() checks for things that should only affect the main frame.
839
840         * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
841         no sense here.
842         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
843         (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
844         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
845         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
846         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
847         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
848         * page/scrolling/ScrollingTreeScrollingNode.cpp:
849         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
850         (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
851         (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
852         * page/scrolling/ScrollingTreeScrollingNode.h:
853         (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
854         * page/scrolling/ios/ScrollingTreeIOS.cpp:
855         (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
856         * page/scrolling/ios/ScrollingTreeIOS.h:
857         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
858         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
859         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
860         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
861         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
862         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
863         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
864         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
865         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
866         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
867         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
868
869 2019-02-27  Ulrich Pflueger  <up@nanocosmos.de>
870
871         [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
872         https://bugs.webkit.org/show_bug.cgi?id=194747
873         <rdar://problem/48148469>
874
875         Reviewed by Jer Noble.
876
877         Prevent unintended frame drops by including last frame duration in discontinuity check. 
878
879         Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
880
881         * Modules/mediasource/SourceBuffer.cpp:
882         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
883
884 2019-02-27  Timothy Hatcher  <timothy@apple.com>
885
886         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
887         https://bugs.webkit.org/show_bug.cgi?id=195086
888         rdar://problem/48419124
889
890         Reviewed by Tim Horton.
891
892         * platform/mac/ScrollAnimatorMac.mm:
893         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
894
895 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
896
897         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
898         https://bugs.webkit.org/show_bug.cgi?id=195067
899         <rdar://problem/44812080>
900
901         Reviewed by Tim Horton.
902
903         This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
904         would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
905         by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
906         really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
907         specific guards around this logic.
908
909         Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
910         a very subtle behavior change covered by the new layout test below.
911
912         Test: editing/undo/redo-text-insertion-in-non-editable-node.html
913
914         * editing/InsertIntoTextNodeCommand.cpp:
915         (WebCore::InsertIntoTextNodeCommand::doReapply):
916         * editing/InsertIntoTextNodeCommand.h:
917
918 2019-02-26  Keith Miller  <keith_miller@apple.com>
919
920         Code quality cleanup in NeverDestroyed
921         https://bugs.webkit.org/show_bug.cgi?id=194824
922
923         Reviewed by Mark Lam.
924
925         name_names.pl should not just assume the layout of LazyNeverDestroyed.
926
927         * dom/make_names.pl:
928         (printNamesCppFile):
929
930 2019-02-26  Zalan Bujtas  <zalan@apple.com>
931
932         Do not try to observe the timer when Page is nullptr
933         https://bugs.webkit.org/show_bug.cgi?id=195076
934
935         Reviewed by Tim Horton.
936
937         Covered by fast/dom/Window/timer-null-script-execution-context.html.
938
939         * page/DOMTimer.cpp:
940         (WebCore::DOMTimer::install):
941
942 2019-02-20  Jer Noble  <jer.noble@apple.com>
943
944         [Cocoa] Media elements will restart network buffering just before suspending
945         https://bugs.webkit.org/show_bug.cgi?id=193691
946
947         Reviewed by Eric Carlson.
948
949         API Test: WebKit.ProcessSuspendMediaBuffering
950
951         Allow the Page to suspend all media buffering in its child Documents.
952
953         * dom/Document.cpp:
954         (WebCore::Document::suspendAllMediaBuffering):
955         (WebCore::Document::resumeAllMediaBuffering):
956         * dom/Document.h:
957         * html/MediaElementSession.cpp:
958         (WebCore::MediaElementSession::dataBufferingPermitted const):
959         (WebCore::MediaElementSession::suspendBuffering):
960         (WebCore::MediaElementSession::resumeBuffering):
961         (WebCore::MediaElementSession::bufferingSuspended const):
962         * html/MediaElementSession.h:
963         * page/Page.cpp:
964         (WebCore::Page::suspendAllMediaBuffering):
965         (WebCore::Page::resumeAllMediaBuffering):
966         * page/Page.h:
967         (WebCore::Page::mediaPlaybackIsSuspended const):
968         (WebCore::Page::mediaBufferingIsSuspended const):
969         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
970         * platform/audio/PlatformMediaSession.h:
971         (WebCore::PlatformMediaSession::suspendBuffering):
972         (WebCore::PlatformMediaSession::resumeBuffering):
973         * platform/audio/PlatformMediaSessionManager.cpp:
974         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
975         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
976         * platform/audio/PlatformMediaSessionManager.h:
977
978 2019-02-26  Youenn Fablet  <youenn@apple.com>
979
980         Move service worker response validation from the service worker client to the service worker itself
981         https://bugs.webkit.org/show_bug.cgi?id=194716
982
983         Reviewed by Geoffrey Garen.
984
985         Added response validation at service worker side.
986
987         No change of behavior except for now logging validation error messages in the console.
988         Covered by rebased tests.
989
990         * workers/service/context/ServiceWorkerFetch.cpp:
991         (WebCore::ServiceWorkerFetch::validateResponse):
992         (WebCore::ServiceWorkerFetch::processResponse):
993         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
994
995 2019-02-26  Sihui Liu  <sihui_liu@apple.com>
996
997         [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
998         https://bugs.webkit.org/show_bug.cgi?id=195036
999
1000         Reviewed by Geoffrey Garen.
1001
1002         When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but 
1003         also transactions in committing process.
1004
1005         Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise 
1006         there is a reference cycle of TransactionOpration.
1007
1008         Covered by existing tests storage/indexeddb/IDBObject-leak.html.
1009
1010         * Modules/indexeddb/IDBDatabase.cpp:
1011         (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
1012         * Modules/indexeddb/IDBTransaction.cpp:
1013         (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
1014         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1015         (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
1016         * Modules/indexeddb/client/IDBConnectionProxy.h:
1017         * Modules/indexeddb/client/TransactionOperation.h:
1018         (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the 
1019         operation is in completion process. 
1020
1021 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1022
1023         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
1024         https://bugs.webkit.org/show_bug.cgi?id=195066
1025         <rdar://problem/48411682>
1026
1027         Reviewed by Tim Horton.
1028
1029         Now all the empty clearContentChangeObservers() implementations can be removed.
1030
1031         * dom/Document.cpp:
1032         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1033         * loader/EmptyClients.h:
1034         * page/ChromeClient.h:
1035         * page/Frame.cpp:
1036         (WebCore::Frame::willDetachPage):
1037         * page/ios/ContentChangeObserver.h:
1038         * page/ios/ContentChangeObserver.mm:
1039         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1040         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
1041         (WebCore::ContentChangeObserver::willDetachPage):
1042
1043 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1044
1045         [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
1046         https://bugs.webkit.org/show_bug.cgi?id=195062
1047         <rdar://problem/48409258>
1048
1049         Reviewed by Tim Horton.
1050
1051         Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
1052
1053         * dom/Document.cpp:
1054         (WebCore::Document::scheduleStyleRecalc):
1055         * page/DOMTimer.cpp:
1056         (WebCore::DOMTimer::install):
1057         * page/ios/ContentChangeObserver.h:
1058         * page/ios/ContentChangeObserver.mm:
1059         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1060         (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
1061         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
1062
1063 2019-02-26  Chris Dumez  <cdumez@apple.com>
1064
1065         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
1066         https://bugs.webkit.org/show_bug.cgi?id=195054
1067         <rdar://problem/48330549>
1068
1069         Reviewed by Geoff Garen.
1070
1071         Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
1072
1073         * page/MemoryRelease.cpp:
1074         (WebCore::releaseNoncriticalMemory):
1075         (WebCore::releaseCriticalMemory):
1076         (WebCore::releaseMemory):
1077         * page/MemoryRelease.h:
1078
1079 2019-02-26  Commit Queue  <commit-queue@webkit.org>
1080
1081         Unreviewed, rolling out r241970.
1082         https://bugs.webkit.org/show_bug.cgi?id=195057
1083
1084         made the QuickLook.LegacyQuickLookContent API test flakey
1085         (Requested by estes on #webkit).
1086
1087         Reverted changeset:
1088
1089         "[iOS] Break a reference cycle between PreviewLoader and
1090         ResourceLoader"
1091         https://bugs.webkit.org/show_bug.cgi?id=194964
1092         https://trac.webkit.org/changeset/241970
1093
1094 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1095
1096         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
1097         https://bugs.webkit.org/show_bug.cgi?id=195023
1098         <rdar://problem/48381885>
1099
1100         Reviewed by Tim Horton.
1101
1102         In the future we might decide that certain activities don't require DOMTimer observation, but that should
1103         be internal to ContentChangeObserver.
1104
1105         * page/ios/ContentChangeObserver.h:
1106         * page/ios/ContentChangeObserver.mm:
1107         (WebCore::ContentChangeObserver::startObservingContentChanges):
1108         (WebCore::ContentChangeObserver::stopObservingContentChanges):
1109         * page/ios/EventHandlerIOS.mm:
1110         (WebCore::EventHandler::mouseMoved):
1111
1112 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1113
1114         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
1115         https://bugs.webkit.org/show_bug.cgi?id=195032
1116         <rdar://problem/48388063>
1117
1118         Reviewed by Tim Horton.
1119
1120         This might eventually turn into a regular start/stop content observing call.
1121
1122         * dom/Document.cpp:
1123         (WebCore::Document::updateStyleIfNeeded):
1124         * page/ios/ContentChangeObserver.h:
1125         * page/ios/ContentChangeObserver.mm:
1126         (WebCore::ContentChangeObserver::startObservingStyleResolve):
1127         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
1128
1129 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1130
1131         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
1132         https://bugs.webkit.org/show_bug.cgi?id=195035
1133         <rdar://problem/48389123>
1134
1135         Reviewed by Tim Horton.
1136
1137         Visibility checking logic belongs to ContentChangeObserver.
1138
1139         * page/ios/ContentChangeObserver.h:
1140         * page/ios/ContentChangeObserver.mm:
1141         (WebCore::elementImplicitVisibility):
1142         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
1143         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
1144         * rendering/updating/RenderTreeUpdater.cpp:
1145         (WebCore::RenderTreeUpdater::updateElementRenderer):
1146         (WebCore::elementImplicitVisibility): Deleted.
1147         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
1148         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
1149
1150 2019-02-26  Philippe Normand  <pnormand@igalia.com>
1151
1152         [EGL] Runtime support for RGB565 pixel layout
1153         https://bugs.webkit.org/show_bug.cgi?id=194817
1154
1155         Reviewed by Carlos Garcia Campos.
1156
1157         Currently our graphics pipeline always relies on a ARGB8888 (32
1158         bpp) pixel configuration. On some low-end (old) embedded platforms
1159         the graphics driver is sometimes optimized for 16 bpp
1160         configurations, such as RGB565. On those platforms the application
1161         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
1162         "RGB565" to adjust to the best pixel configuration supported by
1163         the screen and graphics driver.
1164
1165         * platform/graphics/egl/GLContextEGL.cpp:
1166         (WebCore::GLContextEGL::getEGLConfig):
1167
1168 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
1169
1170         [WPE] Add API for webview background color configuration
1171         https://bugs.webkit.org/show_bug.cgi?id=192305
1172
1173         Reviewed by Michael Catanzaro.
1174
1175         Adapt the FrameView API to allow a default non-white background color.
1176
1177         * page/Frame.cpp:
1178         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
1179         * page/Frame.h:
1180         * page/FrameView.cpp:
1181         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
1182         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
1183         used only in non-dark-mode-css build configurations.
1184         * page/FrameView.h:
1185         * testing/Internals.cpp:
1186         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
1187
1188 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
1189
1190         scalableNativeWebpageParameters() is not preserved on new page navigation.
1191         https://bugs.webkit.org/show_bug.cgi?id=194892
1192         <rdar://problem/47538280>
1193
1194         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
1195         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
1196         configuration until we derive the right values from viewport meta-tag.
1197
1198         Reviewed by Wenson Hsieh.
1199
1200         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
1201
1202         * page/ViewportConfiguration.cpp:
1203         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
1204         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
1205         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
1206             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
1207         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
1208         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
1209         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
1210             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
1211
1212 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1213
1214         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
1215         https://bugs.webkit.org/show_bug.cgi?id=194988
1216         <rdar://problem/48343040>
1217
1218         Reviewed by Tim Horton.
1219
1220         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
1221
1222         * page/DOMWindow.cpp:
1223         (WebCore::DOMWindow::clearTimeout):
1224         * page/ios/ContentChangeObserver.h:
1225         * page/ios/ContentChangeObserver.mm:
1226         (WebCore::ContentChangeObserver::startObservingDOMTimer):
1227         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
1228         (WebCore::ContentChangeObserver::removeDOMTimer):
1229
1230 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1231
1232         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
1233         https://bugs.webkit.org/show_bug.cgi?id=194987
1234         <rdar://problem/48342910>
1235
1236         Reviewed by Tim Horton.
1237
1238         Content obvservation logic should all move to the ContentChangeObserver class.
1239
1240         * page/DOMTimer.cpp:
1241         (WebCore::DOMTimer::install):
1242         (WebCore::DOMTimer::fired):
1243         * page/Page.cpp:
1244         (WebCore::Page::Page):
1245         * page/Page.h:
1246         (WebCore::Page::contentChangeObserver):
1247         * page/ios/ContentChangeObserver.h:
1248         * page/ios/ContentChangeObserver.mm:
1249         (WebCore::ContentChangeObserver::ContentChangeObserver):
1250         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
1251         (WebCore::ContentChangeObserver::startObservingDOMTimer):
1252         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
1253         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
1254         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1255         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1256
1257 2019-02-25  John Wilander  <wilander@apple.com>
1258
1259         Introduce and adopt new class RegistrableDomain for eTLD+1
1260         https://bugs.webkit.org/show_bug.cgi?id=194791
1261         <rdar://problem/48179240>
1262
1263         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
1264
1265         A new API test was added. Plenty of existing layout tests under
1266         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
1267
1268         This patch introduces and adopts a new class called WebCore::RegistrableDomain
1269         which represents a domain's eTLD+1 (effective top level domain plus one) and is
1270         the basis for the term "site," as in same-site. Other popular names include
1271         high-level domain, primary domain, and top privately controlled/owned domain.
1272         Effective top level domains are enumerated on the Public Suffix List
1273         (https://publicsuffix.org).
1274
1275         This class just uses the full domain for when the Public Suffix List cannot help
1276         finding the registrable domain and for WebKit ports that haven't enabled
1277         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
1278         for the null or unique origin (this matches how these origins were handled
1279         before).
1280
1281         The implementation is a wrapper around a String and the functions and class
1282         members that now make use of this new class used to handle regular String
1283         objects which didn't help much in terms of type safety or guarantees that the
1284         string had already been converted to an eTLD+1.
1285
1286         We've at least two bad bugs in the Storage Access API because of confusion
1287         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
1288         will prohibit such bugs in the future.
1289
1290         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
1291         WebCore::RegistrableDomain for partitioning in a later patch.
1292
1293         This patch also enhances parameter naming by:
1294         - Removing parts that refer to "primary" as in primaryDomain.
1295         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
1296         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
1297         - Using the term "domain" consistently instead of e.g. "host."
1298
1299         * WebCore.xcodeproj/project.pbxproj:
1300         * dom/Document.cpp:
1301         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
1302         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
1303         * dom/Document.h:
1304         * html/HTMLAnchorElement.cpp:
1305         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1306         * html/HTMLMediaElement.cpp:
1307         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1308         * loader/AdClickAttribution.cpp:
1309         (WebCore::AdClickAttribution::url const):
1310         (WebCore::AdClickAttribution::referrer const):
1311         (WebCore::AdClickAttribution::toString const):
1312         * loader/AdClickAttribution.h:
1313         (WebCore::AdClickAttribution::Source::Source):
1314         (WebCore::AdClickAttribution::Source::matches const):
1315         (WebCore::AdClickAttribution::Source::deleteValue):
1316         (WebCore::AdClickAttribution::Destination::Destination):
1317         (WebCore::AdClickAttribution::Destination::matches const):
1318         (WebCore::AdClickAttribution::Destination::deleteValue):
1319         * loader/ResourceLoadObserver.cpp:
1320         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
1321         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
1322         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
1323         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
1324         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
1325         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1326         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1327         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1328         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
1329         (WebCore::ResourceLoadObserver::logFontLoad):
1330         (WebCore::ResourceLoadObserver::logCanvasRead):
1331         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
1332         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
1333         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
1334         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
1335         (WebCore::ResourceLoadObserver::statisticsForOrigin):
1336         (WebCore::primaryDomain): Deleted.
1337         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
1338         * loader/ResourceLoadObserver.h:
1339         * loader/ResourceLoadStatistics.cpp:
1340         (WebCore::ResourceLoadStatistics::encode const):
1341         (WebCore::ResourceLoadStatistics::decode):
1342         (WebCore::ResourceLoadStatistics::toString const):
1343         (WebCore::ResourceLoadStatistics::merge):
1344         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
1345         * loader/ResourceLoadStatistics.h:
1346         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
1347         * page/Page.cpp:
1348         (WebCore::Page::logNavigation):
1349         (WebCore::Page::mainFrameLoadStarted):
1350         * page/Page.h:
1351         * page/PerformanceMonitor.cpp:
1352         (WebCore::reportPageOverPostLoadResourceThreshold):
1353         * platform/RegistrableDomain.h: Added.
1354         (WebCore::RegistrableDomain::RegistrableDomain):
1355         (WebCore::RegistrableDomain::isEmpty const):
1356         (WebCore::RegistrableDomain::string const):
1357         (WebCore::RegistrableDomain::operator!= const):
1358         (WebCore::RegistrableDomain::operator== const):
1359         (WebCore::RegistrableDomain::matches const):
1360         (WebCore::RegistrableDomain::isolatedCopy const):
1361         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
1362         (WebCore::RegistrableDomain::hash const):
1363         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
1364         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
1365         (WebCore::RegistrableDomain::encode const):
1366         (WebCore::RegistrableDomain::decode):
1367         * platform/network/NetworkStorageSession.cpp:
1368         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
1369         (WebCore::NetworkStorageSession::shouldBlockCookies const):
1370         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
1371         (WebCore::NetworkStorageSession::removePrevalentDomains):
1372         (WebCore::NetworkStorageSession::hasStorageAccess const):
1373         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
1374         (WebCore::NetworkStorageSession::grantStorageAccess):
1375         (WebCore::getPartitioningDomain): Deleted.
1376         * platform/network/NetworkStorageSession.h:
1377
1378 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
1379
1380         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
1381         https://bugs.webkit.org/show_bug.cgi?id=190138
1382         <rdar://problem/44907695>
1383
1384         Reviewed by Joanmarie Diggs.
1385
1386         Make sure that footer elements use the right role depending on their context.
1387         If scoped to body, they become contentinfo. Otherwise they are just delineated by
1388         a footer subrole.
1389
1390         * accessibility/AccessibilityObject.cpp:
1391         (WebCore::AccessibilityObject::isLandmark const):
1392         * accessibility/AccessibilityRenderObject.cpp:
1393         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
1394         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
1395         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1396         * accessibility/AccessibilityRenderObject.h:
1397         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1398         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
1399         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1400         (-[WebAccessibilityObjectWrapper subrole]):
1401
1402 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
1403
1404         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
1405         https://bugs.webkit.org/show_bug.cgi?id=194709
1406
1407         Reviewed by Geoffrey Garen.
1408
1409         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
1410         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
1411  
1412         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
1413         between IDBOpenDBRequest and IDBTransaction.
1414
1415         Test: storage/indexeddb/IDBObject-leak.html
1416
1417         * Modules/indexeddb/IDBDatabase.cpp:
1418         (WebCore::IDBDatabase::connectionToServerLost):
1419         * Modules/indexeddb/IDBTransaction.cpp:
1420         (WebCore::IDBTransaction::IDBTransaction):
1421         (WebCore::IDBTransaction::~IDBTransaction):
1422         (WebCore::IDBTransaction::connectionClosedFromServer):
1423         * Modules/indexeddb/IDBTransaction.h:
1424         * testing/Internals.cpp:
1425         (WebCore::Internals::numberOfIDBTransactions const):
1426         * testing/Internals.h:
1427         * testing/Internals.idl:
1428
1429 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1430
1431         Add missing stream parameter. Unreviewed.
1432
1433         * page/DOMTimer.cpp:
1434         (WebCore::DOMTimer::fired):
1435
1436 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1437
1438         Unreviewed build fix after r242032.
1439
1440         * page/DOMTimer.cpp:
1441         (WebCore::DOMTimer::install):
1442
1443 2019-02-20  Darin Adler  <darin@apple.com>
1444
1445         Incorrect use of String::foldCase for font family names
1446         https://bugs.webkit.org/show_bug.cgi?id=194895
1447
1448         Reviewed by Myles C. Maxfield.
1449
1450         * platform/graphics/FontCascadeDescription.cpp:
1451         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
1452         familyNamesAreEqual instead of calling convertToASCIILowercase directly.
1453         (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
1454         operator== when we want case sensitive family name comparisons. This is a special
1455         case to accomodate CoreText, which uses "."-prefix names for internal fonts that
1456         are treated case sensitively. (Ideally webpages would not use these fonts at all.)
1457         (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
1458         when we want case sensitive family name hashing.
1459         (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
1460         AtomicString so we can use this at an additional call site. Converting from an
1461         AtomicString to a String if free and automatic at the existing call sites. Use
1462         convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
1463         here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
1464         must be consistent. 2) this is considerably faster, and 3) font family names don't
1465         need arbitrary Unicode case folding, it's only A-Z that should be folded.
1466         * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
1467         in the foldedFamilyName function.
1468
1469         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1470         (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
1471         FontCascadeDescription::foldedFamilyName to correctly fold font family names.
1472
1473 2019-02-25  Charlie Turner  <cturner@igalia.com>
1474
1475         [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
1476         https://bugs.webkit.org/show_bug.cgi?id=194992
1477
1478         Reviewed by Xabier Rodriguez-Calvar.
1479
1480         Refactoring, no new tests.
1481
1482         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1483         (transformCaps): Simplify the code a little. The idea to use this
1484         utility function came from a review upstream here:
1485         https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
1486
1487 2019-02-25  Alicia Boya García  <aboya@igalia.com>
1488
1489         [MSE][GStreamer] Batch player duration updates
1490         https://bugs.webkit.org/show_bug.cgi?id=194220
1491
1492         Reviewed by Xabier Rodriguez-Calvar.
1493
1494         This saves up a ton of CPU cycles doing layout unnecessarily when all
1495         the appended frames extend the duration of the movie, like in
1496         YTTV 2018 59.DASHLatencyVP9.
1497
1498         This patch is an optimization that introduces no new behavior.
1499
1500         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1501         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
1502         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1503         (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
1504         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
1505         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
1506         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1507
1508 2019-02-25  Miguel Gomez  <magomez@igalia.com>
1509
1510         [WPE] Add support for holepunch using an external video player
1511         https://bugs.webkit.org/show_bug.cgi?id=194899
1512
1513         Reviewed by Xabier Rodriguez-Calvar.
1514
1515         Implement the holepunch feature to allow playback using an external player. This creates
1516         a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
1517         whose goal is to just draw a transparent rectangle in the position where the video should be.
1518         This can be used to allow a player placed on a lower plane than the browser to become visible.
1519
1520         Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
1521
1522         * PlatformWPE.cmake:
1523         * platform/HolePunch.cmake: Added.
1524         * platform/graphics/MediaPlayer.cpp:
1525         (WebCore::buildMediaEnginesVector):
1526         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
1527         (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
1528         (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
1529         (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
1530         (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
1531         (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
1532         (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
1533         (WebCore::MediaPlayerPrivateHolePunch::proxy const):
1534         (WebCore::mimeTypeCache):
1535         (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
1536         (WebCore::MediaPlayerPrivateHolePunch::supportsType):
1537         (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
1538         (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
1539         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
1540         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1541         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
1542
1543 2019-02-24  Zalan Bujtas  <zalan@apple.com>
1544
1545         Introduce ContentChangeObserver class
1546         https://bugs.webkit.org/show_bug.cgi?id=194977
1547         <rdar://problem/48338115>
1548
1549         Reviewed by Simon Fraser.
1550
1551         This patch is about piping through all the related WK* calls. 
1552
1553         * SourcesCocoa.txt:
1554         * WebCore.xcodeproj/project.pbxproj:
1555         * dom/Document.cpp:
1556         (WebCore::Document::scheduleStyleRecalc):
1557         (WebCore::Document::updateStyleIfNeeded):
1558         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1559         * loader/FrameLoader.cpp:
1560         * page/DOMTimer.cpp:
1561         (WebCore::DOMTimer::install):
1562         (WebCore::DOMTimer::fired):
1563         * page/DOMWindow.cpp:
1564         (WebCore::DOMWindow::clearTimeout):
1565         * page/Frame.cpp:
1566         (WebCore::Frame::willDetachPage):
1567         * page/Page.h:
1568         (WebCore::Page::contentChangeObserver):
1569         * page/ios/EventHandlerIOS.mm:
1570         (WebCore::EventHandler::mouseMoved):
1571         * rendering/updating/RenderTreeUpdater.cpp:
1572         (WebCore::RenderTreeUpdater::updateElementRenderer):
1573         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
1574         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1575
1576 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
1577
1578         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
1579         https://bugs.webkit.org/show_bug.cgi?id=194984
1580
1581         Reviewed by Sam Weinig.
1582
1583         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
1584
1585         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
1586         current layout viewport rect. Instead, set the layout viewport on the root
1587         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
1588
1589         * page/scrolling/ScrollingTree.cpp:
1590         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1591         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
1592         * page/scrolling/ScrollingTree.h:
1593         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1594         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
1595         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1596         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1597         * page/scrolling/ScrollingTreeNode.h:
1598         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1599         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
1600         * page/scrolling/ScrollingTreeScrollingNode.h:
1601         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1602         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1603         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1604         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1605         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1606         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
1607         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1608         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1609         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1610         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
1611         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
1612
1613 2019-02-24  Devin Rousso  <drousso@apple.com>
1614
1615         Web Inspector: Change the InspectorOverlay to use native rather than canvas
1616         https://bugs.webkit.org/show_bug.cgi?id=105023
1617         <rdar://problem/13443692>
1618
1619         Reviewed by Brian Burg.
1620
1621         Should be no change in observed functionality.
1622
1623         * inspector/InspectorOverlay.h:
1624         * inspector/InspectorOverlay.cpp:
1625         (WebCore::truncateWithEllipsis): Added.
1626         (WebCore::localPointToRootPoint): Added.
1627         (WebCore::contentsQuadToCoordinateSystem):
1628         (WebCore::effectiveElementForNode): Added.
1629         (WebCore::quadToPath): Added.
1630         (WebCore::drawOutlinedQuadWithClip): Added.
1631         (WebCore::drawOutlinedQuad): Added.
1632         (WebCore::drawFragmentHighlight): Added.
1633         (WebCore::drawShapeHighlight): Added.
1634         (WebCore::InspectorOverlay::paint):
1635         (WebCore::InspectorOverlay::setIndicating):
1636         (WebCore::InspectorOverlay::shouldShowOverlay const):
1637         (WebCore::InspectorOverlay::update):
1638         (WebCore::InspectorOverlay::setShowPaintRects): Added.
1639         (WebCore::InspectorOverlay::showPaintRect):
1640         (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
1641         (WebCore::InspectorOverlay::drawNodeHighlight):
1642         (WebCore::InspectorOverlay::drawQuadHighlight):
1643         (WebCore::InspectorOverlay::drawPaintRects):
1644         (WebCore::InspectorOverlay::drawBounds): Added.
1645         (WebCore::InspectorOverlay::drawRulers):
1646         (WebCore::InspectorOverlay::drawElementTitle): Added.
1647         (WebCore::contentsQuadToPage): Deleted.
1648         (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
1649         (WebCore::buildObjectForPoint): Deleted.
1650         (WebCore::buildObjectForRect): Deleted.
1651         (WebCore::buildArrayForQuad): Deleted.
1652         (WebCore::buildObjectForHighlight): Deleted.
1653         (WebCore::buildObjectForSize): Deleted.
1654         (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
1655         (WebCore::buildArrayForRendererFragments): Deleted.
1656         (WebCore::localPointToRoot): Deleted.
1657         (WebCore::appendPathCommandAndPoints): Deleted.
1658         (WebCore::appendPathSegment): Deleted.
1659         (WebCore::buildObjectForShapeOutside): Deleted.
1660         (WebCore::buildObjectForElementData): Deleted.
1661         (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
1662         (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
1663         (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
1664         (WebCore::InspectorOverlay::overlayPage): Deleted.
1665         (WebCore::InspectorOverlay::forcePaint): Deleted.
1666         (WebCore::InspectorOverlay::reset): Deleted.
1667         (WebCore::evaluateCommandInOverlay): Deleted.
1668         (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
1669         (WebCore::InspectorOverlay::freePage): Deleted.
1670
1671         * inspector/agents/InspectorPageAgent.cpp:
1672         (WebCore::InspectorPageAgent::disable):
1673         (WebCore::InspectorPageAgent::setShowPaintRects):
1674         Drive-by: rename `setShowingPaintRects` to better match the protocol.
1675
1676         * inspector/agents/page/PageDebuggerAgent.h:
1677         * inspector/agents/page/PageDebuggerAgent.cpp:
1678         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
1679         (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
1680         Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
1681
1682         * inspector/InspectorController.h:
1683         * inspector/InspectorController.cpp:
1684         (WebCore::InspectorController::createLazyAgents):
1685         (WebCore::InspectorController::disconnectFrontend):
1686         (WebCore::InspectorController::disconnectAllFrontends):
1687         (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
1688
1689         * testing/Internals.h:
1690         * testing/Internals.idl:
1691         * testing/Internals.cpp:
1692         (WebCore::Internals::inspectorHighlightObject): Deleted.
1693
1694         * inspector/InspectorOverlayPage.css: Removed.
1695         * inspector/InspectorOverlayPage.html: Removed.
1696         * inspector/InspectorOverlayPage.js: Removed.
1697
1698         * CMakeLists.txt:
1699         * DerivedSources-input.xcfilelist:
1700         * DerivedSources-output.xcfilelist:
1701         * DerivedSources.make:
1702         * WebCore.xcodeproj/project.pbxproj:
1703
1704 2019-02-20  Darin Adler  <darin@apple.com>
1705
1706         Finish removing String::format
1707         https://bugs.webkit.org/show_bug.cgi?id=194893
1708
1709         Reviewed by Daniel Bates.
1710
1711         * dom/Document.cpp:
1712         (WebCore::Document::lastModified const): Use makeString and pad.
1713         * html/FTPDirectoryDocument.cpp:
1714         (WebCore::processFileDateString): Ditto.
1715
1716         * mathml/MathMLElement.cpp:
1717         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
1718
1719         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1720         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
1721
1722         * page/linux/ResourceUsageOverlayLinux.cpp:
1723         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
1724         (WebCore::gcTimerString): Use String::number.
1725
1726         * platform/DateComponents.cpp:
1727         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
1728         (WebCore::DateComponents::toString const): Ditto.
1729
1730         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
1731         and that was also inaccurate.
1732
1733         * platform/audio/HRTFElevation.cpp:
1734         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1735         Use makeString and pad.
1736         * platform/mock/MockRealtimeVideoSource.cpp:
1737         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1738         * rendering/RenderLayerCompositor.cpp:
1739         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1740         * rendering/RenderTheme.cpp:
1741         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
1742
1743 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1744
1745         [WPE][GTK] Remove user agent quirk for washingtonpost.com
1746         https://bugs.webkit.org/show_bug.cgi?id=194981
1747
1748         Reviewed by Žan Doberšek.
1749
1750         Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
1751
1752         * platform/UserAgentQuirks.cpp:
1753         (WebCore::urlRequiresChromeBrowser):
1754
1755 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
1756
1757         Remove remnants of iOS WK1 scrolling tree code
1758         https://bugs.webkit.org/show_bug.cgi?id=194980
1759
1760         Reviewed by Sam Weinig.
1761
1762         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
1763         to reduce maintenance costs and simplify.
1764
1765         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
1766         since that was the only concrete subclass, removing code which never applies to iOS WK2
1767         (e.g. the synchronous scrolling code path).
1768
1769         * SourcesCocoa.txt:
1770         * WebCore.xcodeproj/project.pbxproj:
1771         * page/FrameView.h:
1772         * page/scrolling/ScrollingCoordinator.cpp:
1773         * page/scrolling/ScrollingTree.h:
1774         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1775         * page/scrolling/ScrollingTreeNode.h:
1776         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1777         (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
1778         * page/scrolling/ScrollingTreeScrollingNode.h:
1779         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
1780         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
1781         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
1782         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
1783         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
1784         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
1785         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
1786         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
1787         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
1788         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
1789         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
1790         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
1791         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
1792         (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
1793         (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
1794         (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
1795         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
1796         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
1797         (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
1798         (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
1799         (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
1800         (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
1801         (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
1802         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
1803         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
1804         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
1805         * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
1806         * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
1807         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
1808         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
1809         * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
1810         * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
1811         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1812         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
1813
1814 2019-02-23  Justin Fan  <justin_fan@apple.com>
1815
1816         [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
1817         https://bugs.webkit.org/show_bug.cgi?id=194665
1818
1819         Reviewed by Dean Jackson.
1820
1821         Test: map-write-buffers.html. Other tests updated to match new API.
1822
1823         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
1824         (WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
1825         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
1826         * Modules/webgpu/WebGPUBindGroupDescriptor.h:
1827         * Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
1828         (WebCore::WebGPUBuffer::create):
1829         (WebCore::WebGPUBuffer::WebGPUBuffer):
1830         (WebCore::WebGPUBuffer::mapReadAsync):
1831         (WebCore::WebGPUBuffer::mapWriteAsync):
1832         (WebCore::WebGPUBuffer::unmap):
1833         (WebCore::WebGPUBuffer::destroy):
1834         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
1835         * Modules/webgpu/WebGPUBuffer.h:
1836         (WebCore::WebGPUBuffer::buffer const):
1837         (WebCore::WebGPUBuffer::mapping const): Deleted.
1838         * Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
1839         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1840         (WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
1841         * Modules/webgpu/WebGPUDevice.cpp:
1842         (WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
1843         (WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
1844         * Modules/webgpu/WebGPUDevice.h:
1845         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
1846         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
1847         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1848         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
1849         * platform/graphics/gpu/GPUBuffer.cpp: Added.
1850         (WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
1851         * platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
1852         (WebCore::GPUBuffer::isVertex const):
1853         (WebCore::GPUBuffer::isUniform const):
1854         (WebCore::GPUBuffer::isStorage const):
1855         (WebCore::GPUBuffer::isReadOnly const):
1856         (WebCore::GPUBuffer::PendingMapPromise::create):
1857         (WebCore::GPUBuffer::isMappable const):
1858         (WebCore::GPUBuffer::isMapWriteable const):
1859         (WebCore::GPUBuffer::isMapReadable const):
1860         (WebCore::GPUBuffer::mapping const): Deleted.
1861         * platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
1862         * platform/graphics/gpu/GPUDevice.cpp:
1863         (WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer. 
1864         (WebCore::GPUDevice::createBuffer const): Deleted.
1865         * platform/graphics/gpu/GPUDevice.h:
1866         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1867         (WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
1868         (WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
1869         (WebCore::GPUBuffer::GPUBuffer):
1870         (WebCore::GPUBuffer::~GPUBuffer):
1871         (WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
1872         (WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
1873         (WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
1874         (WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
1875         (WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
1876         (WebCore::GPUBuffer::create): Deleted.
1877         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
1878         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
1879
1880         Add symbols for new files:
1881         * Sources.txt:
1882         * WebCore.xcodeproj/project.pbxproj:
1883
1884 2019-02-23  Keith Miller  <keith_miller@apple.com>
1885
1886         Add new mac target numbers
1887         https://bugs.webkit.org/show_bug.cgi?id=194955
1888
1889         Reviewed by Tim Horton.
1890
1891         * Configurations/Base.xcconfig:
1892         * Configurations/DebugRelease.xcconfig:
1893
1894 2019-02-23  chris fleizach  <cfleizach@apple.com>
1895
1896         AX: WebKit is incorrectly mapping the <meter> element to progressbar
1897         https://bugs.webkit.org/show_bug.cgi?id=164051
1898         <rdar://problem/29055615>
1899
1900         Reviewed by Joanmarie Diggs.
1901
1902         Add a specific role for meter and map that to the appropriate mac role. 
1903
1904         * accessibility/AccessibilityNodeObject.cpp:
1905         (WebCore::AccessibilityNodeObject::canHaveChildren const):
1906         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
1907         * accessibility/AccessibilityObject.cpp:
1908         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
1909         (WebCore::AccessibilityObject::isRangeControl const):
1910         (WebCore::AccessibilityObject::computedRoleString const):
1911         * accessibility/AccessibilityObjectInterface.h:
1912         * accessibility/AccessibilityProgressIndicator.cpp:
1913         (WebCore::AccessibilityProgressIndicator::roleValue const):
1914         * accessibility/AccessibilityProgressIndicator.h:
1915         * accessibility/AccessibilityRenderObject.cpp:
1916         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
1917         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1918         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1919         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1920         (createAccessibilityRoleMap):
1921
1922 2019-02-22  Ryosuke Niwa  <rniwa@webkit.org>
1923
1924         Crash in SWServerJobQueue::runNextJobSynchronously
1925         https://bugs.webkit.org/show_bug.cgi?id=194974
1926
1927         Reviewed by Geoffrey Garen.
1928
1929         We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
1930         or there is a timer heap corruption again :(
1931
1932         Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
1933         but convert an existing release assert to a debug assert since this appears to be hitting
1934         too frequently in wild.
1935
1936         * workers/service/server/SWServerJobQueue.cpp:
1937         (WebCore::SWServerJobQueue::runNextJobSynchronously):
1938
1939 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
1940
1941         Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
1942         https://bugs.webkit.org/show_bug.cgi?id=194968
1943
1944         Reviewed by Antti Koivisto.
1945
1946         Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
1947         you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
1948
1949         ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
1950         reduce that.
1951
1952         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1953         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
1954         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1955         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1956         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
1957         (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
1958         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1959         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
1960         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
1961         * page/scrolling/ScrollingTreeScrollingNode.h:
1962         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
1963         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1964         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
1965         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
1966         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1967         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1968         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1969         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1970         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
1971         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
1972         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1973         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1974         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
1975         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
1976         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1977         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
1978         * platform/PlatformWheelEvent.h:
1979         (WebCore::PlatformWheelEvent::delta const):
1980         * platform/ScrollTypes.h:
1981
1982 2019-02-22  Eric Liang  <ericliang@apple.com>
1983
1984         AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
1985         https://bugs.webkit.org/show_bug.cgi?id=194923
1986
1987         Reviewed by Chris Fleizach.
1988
1989         Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
1990
1991         Test: accessibility/mac/children-in-navigation-order-returns-children.html
1992
1993         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1994         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1995
1996 2019-02-22  Tim Horton  <timothy_horton@apple.com>
1997
1998         ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
1999         https://bugs.webkit.org/show_bug.cgi?id=194963
2000
2001         Reviewed by Dean Jackson.
2002
2003         Tested by existing failing API test.
2004
2005         * page/Page.cpp:
2006         (WebCore::Page::installedPageOverlaysChanged): Deleted.
2007         * page/Page.h:
2008         (WebCore::Page::pageOverlayController):
2009         * page/PageOverlayController.cpp:
2010         (WebCore::PageOverlayController::installedPageOverlaysChanged):
2011         (WebCore::PageOverlayController::detachViewOverlayLayers):
2012         (WebCore::PageOverlayController::installPageOverlay):
2013         (WebCore::PageOverlayController::uninstallPageOverlay):
2014         (WebCore::PageOverlayController::willDetachRootLayer): Deleted.
2015         * page/PageOverlayController.h:
2016         As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
2017         Also, make it ignore isInWindow state; otherwise, if you install a overlay
2018         and then come into window, nothing installs the root layer. There is no
2019         need for this code to follow in-window state manually anymore since
2020         the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
2021
2022         Make some methods private, and make detachViewOverlayLayers only touch
2023         *view* overlays, so that we don't detach the document-relative root
2024         layer when you drop to having no view overlays. This maintains
2025         existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
2026
2027         Now there are no callers of willDetachRootLayer, so remove it.
2028
2029 2019-02-22  Andy Estes  <aestes@apple.com>
2030
2031         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
2032         https://bugs.webkit.org/show_bug.cgi?id=194964
2033         <rdar://problem/48279441>
2034
2035         Reviewed by Alex Christensen.
2036
2037         When a document's QuickLook preview is loaded, a reference cycle is created between
2038         PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
2039         ResourceLoader::releaseResources().
2040
2041         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
2042
2043         * loader/ResourceLoader.cpp:
2044         (WebCore::ResourceLoader::releaseResources):
2045
2046 2019-02-22  Sihui Liu  <sihui_liu@apple.com>
2047
2048         Crash under IDBServer::IDBConnectionToClient::identifier() const
2049         https://bugs.webkit.org/show_bug.cgi?id=194843
2050         <rdar://problem/48203102>
2051
2052         Reviewed by Geoffrey Garen.
2053
2054         UniqueIDBDatabase should ignore requests from connections that are already closed.
2055
2056         Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. 
2057         One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
2058         disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
2059         may start a version change transaction and ask for identifier from the connection that is already gone.
2060
2061         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2062         (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
2063         * Modules/indexeddb/server/IDBConnectionToClient.h:
2064         (WebCore::IDBServer::IDBConnectionToClient::isClosed):
2065         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2066         (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
2067         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2068         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
2069         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2070
2071 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2072
2073         Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
2074         https://bugs.webkit.org/show_bug.cgi?id=194703
2075         <rdar://problem/48111775>
2076
2077         Reviewed by Ryosuke Niwa.
2078
2079         Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
2080         even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
2081         scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
2082         "Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
2083
2084         To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
2085         EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
2086
2087         Tests: fast/events/before-input-events-prevent-block-text-direction.html
2088                fast/events/before-input-events-prevent-inline-text-direction.html
2089
2090         * editing/CompositeEditCommand.cpp:
2091         (WebCore::CompositeEditCommand::apply):
2092         * editing/EditAction.cpp:
2093         (WebCore::undoRedoLabel):
2094         * editing/EditAction.h:
2095         * editing/EditCommand.cpp:
2096         (WebCore::inputTypeNameForEditingAction):
2097         * editing/Editor.cpp:
2098         (WebCore::inputEventDataForEditingStyleAndAction):
2099         (WebCore::Editor::setBaseWritingDirection):
2100         * editing/EditorCommand.cpp:
2101         (WebCore::executeMakeTextWritingDirectionLeftToRight):
2102         (WebCore::executeMakeTextWritingDirectionNatural):
2103         (WebCore::executeMakeTextWritingDirectionRightToLeft):
2104
2105 2019-02-22  Rob Buis  <rbuis@igalia.com>
2106
2107         Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
2108         https://bugs.webkit.org/show_bug.cgi?id=160172
2109
2110         Reviewed by Frédéric Wang.
2111
2112         Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
2113         from HTTPParsers instead.
2114
2115         No new tests, already covered by MathML tests.
2116
2117         * mathml/MathMLElement.cpp:
2118         (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
2119         * mathml/MathMLElement.h:
2120         * mathml/MathMLPresentationElement.cpp:
2121         (WebCore::MathMLPresentationElement::parseMathMLLength):
2122         * mathml/MathMLTokenElement.cpp:
2123         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
2124
2125 2019-02-22  Eric Carlson  <eric.carlson@apple.com>
2126
2127         Update some media logging
2128         https://bugs.webkit.org/show_bug.cgi?id=194915
2129
2130         Reviewed by Jer Noble.
2131
2132         No new tests, no functional change.
2133
2134         * Modules/mediasource/SourceBuffer.cpp:
2135         (WebCore::SourceBuffer::evictCodedFrames):
2136         (WebCore::SourceBuffer::provideMediaData):
2137         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
2138
2139         * html/HTMLMediaElement.cpp:
2140         (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
2141         (WebCore::HTMLMediaElement::loadResource):
2142         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2143         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
2144         (WebCore::HTMLMediaElement::seekTask):
2145         (WebCore::HTMLMediaElement::playInternal):
2146         (WebCore::HTMLMediaElement::pauseInternal):
2147         (WebCore::HTMLMediaElement::setLoop):
2148         (WebCore::HTMLMediaElement::setControls):
2149         (WebCore::HTMLMediaElement::sourceWasRemoved):
2150
2151         * html/MediaElementSession.cpp:
2152         (WebCore::convertEnumerationToString):
2153
2154         * html/MediaElementSession.h:
2155         (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
2156
2157         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2158         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2159
2160 2019-02-22  Rob Buis  <rbuis@igalia.com>
2161
2162         Fix unitless usage of mathsize
2163         https://bugs.webkit.org/show_bug.cgi?id=194940
2164
2165         Reviewed by Frédéric Wang.
2166
2167         Convert unitless lengths to percentage values to correct the computed
2168         font size.
2169
2170         * mathml/MathMLElement.cpp:
2171         (WebCore::convertToPercentageIfNeeded):
2172         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
2173
2174 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
2175
2176         Hardcode Visual Viewports on everywhere except iOS WK1
2177         https://bugs.webkit.org/show_bug.cgi?id=194928
2178
2179         Reviewed by Zalan Bujtas.
2180
2181         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
2182         change the default value of the Setting to 'true', and hardcode WebView on iOS to
2183         set it to false. The setting has shipped for several years and there's no need to turn
2184         it off now.
2185
2186         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
2187         Visual Viewports are not enabled.
2188         
2189         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
2190         that only runs in WK2
2191
2192         * page/Settings.yaml:
2193         * page/scrolling/AsyncScrollingCoordinator.cpp:
2194         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2195         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2196         (WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
2197         * page/scrolling/AsyncScrollingCoordinator.h:
2198         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2199         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2200         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2201         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2202         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
2203         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2204         * page/scrolling/ScrollingTree.cpp:
2205         (WebCore::ScrollingTree::commitTreeState):
2206         * page/scrolling/ScrollingTree.h:
2207         (WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
2208         (WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
2209         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2210         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
2211         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2212         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2213         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2214
2215 2019-02-21  Darin Adler  <darin@apple.com>
2216
2217         Some refinements for Node and Document
2218         https://bugs.webkit.org/show_bug.cgi?id=194764
2219
2220         Reviewed by Ryosuke Niwa.
2221
2222         * accessibility/AccessibilityObject.cpp:
2223         (WebCore::AccessibilityObject::press): Use shadowHost instead of
2224         deprecatedShadowAncestorNode.
2225         (WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
2226         (WebCore::AccessibilityObject::focusedUIElement const): Use existing page
2227         function to streamline.
2228
2229         * accessibility/AccessibilityRenderObject.cpp:
2230         (WebCore::AccessibilityRenderObject::accessKey const): Use
2231         attributeWithoutSynchronization for efficiency and consistency with other
2232         code working with the accesskey attribute.
2233
2234         * dom/ContainerNode.cpp:
2235         (WebCore::ContainerNode::childrenChanged): Added call to
2236         invalidateAccessKeyCache, replacing old scheme tied to style recalculation.
2237
2238         * dom/DecodedDataDocumentParser.cpp:
2239         (WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
2240         type change of createDecoderIfNeeded to decoder.
2241         (WebCore::DecodedDataDocumentParser::flush): Ditto.
2242
2243         * dom/Document.cpp:
2244         (WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
2245         to match WebKit coding style. Changed to use unique_ptr instead of separate
2246         boolean to keep track of map validity status.
2247         (WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
2248         clarify that this is a cache. Changed to use composedTreeDescendants rather
2249         than explicit calls to shadowRoot. Use add instead of set so that first element
2250         in document order wins, instead of last element in document order. Updated
2251         to make a new map in a new unique_ptr instead of populating a map.
2252         (WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
2253         invalidateAccessKeyMap, and left an inline part in the header so the fast case
2254         of quickly checking for a null pointer can be inlined.
2255         (WebCore::Document::doctype const): Use downcast instead of static_cast.
2256         (WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
2257         from here to childrenChanged and accesskey attribute change handling.
2258         (WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
2259         directly since this is the only place that does it and we don't need to factor
2260         that one line of code into a function.
2261         (WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
2262         that always returns nullptr and can be inlined.
2263         (WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
2264         (WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
2265         the create function, since Document::create now always involves no frame.
2266         (WebCore::Document::didAssociateFormControl): Changed argument type to a reference
2267         and simplified the logic with a local variable.
2268         (WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
2269         checks and rearranged things so that m_associatedFormControls will always
2270         get cleared even if the document is no longer associated with a page.
2271
2272         * dom/Document.h: Removed unnnecessary explicit values for enumerations (first
2273         value is always zero, etc.) and formatted simple enumerations in a single line
2274         for easier reading. Moved Document::create fucntion bodies out of line, removed
2275         the frame argument from the simple "create with URL" overload and made the frame
2276         argument for createNonRenderedPlaceholder be a reference rather than a pointer.
2277         Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
2278         invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
2279         m_elementsByAccessKey to m_accessKeyCache and changed its type.
2280         Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
2281         setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.
2282
2283         * dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
2284         placeholder returning null.
2285
2286         * dom/Element.cpp:
2287         (WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
2288         value of the accesskey attribute is changed. Also moved the class attribute code
2289         so the attributes here are in alphabetical order (only class and id were out of
2290         alphabetical order).
2291
2292         * dom/Node.cpp:
2293         (WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
2294         use deprecatedShadowAncestorNode and used boolean operators to make it a
2295         single line and easier to understand. Also added a FIXME since the
2296         containsIncludingShadowDOM function is so similar, yet differently written.
2297         (WebCore::Node::contains const): Rewrote as a single line to make this easier
2298         to read and to *slightly* improve the speed in the "this == node" case.
2299         (WebCore::Node::containsIncludingHostElements const): Use downcast.
2300         (WebCore::Node::deprecatedShadowAncestorNode const): Deleted.
2301
2302         * dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.
2303
2304         * editing/ReplaceSelectionCommand.cpp:
2305         (WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
2306         instead of deprecatedShadowAncestorNode.
2307
2308         * html/FormAssociatedElement.cpp:
2309         (WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
2310         didAssociateFormControl.
2311         (WebCore::FormAssociatedElement::formAttributeChanged): Ditto.
2312
2313         * html/HTMLAreaElement.cpp:
2314         (WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
2315         attribute, because we want to call the base class parseAttribute in that case.
2316
2317         * html/HTMLFormElement.cpp:
2318         (WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
2319         didAssociateFormControl.
2320
2321         * html/HTMLSelectElement.cpp:
2322         (WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
2323         attribute with mysterious FIXME, because we want to call the base class
2324         parseAttribute in that case. The old code had no effect before; the access key
2325         logic would still find the attribute; if the goal is to ignore the attribute
2326         for these elements we will need a different solution.
2327         * html/HTMLTextAreaElement.cpp:
2328         (WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
2329
2330         * loader/DocumentLoader.cpp:
2331         (WebCore::DocumentLoader::DocumentLoader): Removed code that was always passing
2332         nullptr as the frame for the newly created DocumentWriter. It used m_frame, but
2333         m_frame was always null.
2334         (WebCore::DocumentLoader::attachToFrame): Pass reference to DocumentWriter::setFrame.
2335
2336         * loader/DocumentWriter.cpp:
2337         (WebCore::DocumentWriter::DocumentWriter): Deleted. The old version set m_frame to
2338         the passed in frame, which was always nullptr, and initialized some booleans and an
2339         enumeration, which are now initialized in the class definition.
2340         (WebCore::DocumentWriter::createDocument): Pass a reference for the frame.
2341         (WebCore::DocumentWriter::begin): Updated now that State is an enum class.
2342         (WebCore::DocumentWriter::decoder): Renamed from createDecoderIfNeeded and changed
2343         to return a reference.
2344         (WebCore::DocumentWriter::addData): Use RELEASE_ASSERT instead of if/CRASH and
2345         updated now that State is an enum class.
2346         (WebCore::DocumentWriter::insertDataSynchronously): Updated now that State is an
2347         enum class.
2348         (WebCore::DocumentWriter::end): Ditto.
2349
2350         * loader/DocumentWriter.h: Removed unneeded include and forward declaration.
2351         Removed the frame pointer argument to the constructor, caller was always passing a
2352         nullptr. Changed argument to setFrame to be a reference. Renamed createDecoderIfNeeded
2353         to decoder and changed it to return a reference. Initialized m_frame,
2354         m_hasReceivedSomeData, m_encodingWasChosenByUser, and m_state here so we don't need
2355         to initialize them in a constructor. Renamed the enum from WriterState to State since
2356         it's a member of DocumentWriter already, and made it an enum class rather than ending
2357         each enumeration value with WritingState.
2358
2359         * page/DragController.cpp:
2360         (WebCore::isEnabledColorInput): Removed boolean argument setToShadowAncestor. The
2361         one caller that formerly passed true now calls the new hasEnabledColorInputAsShadowHost
2362         function instead.
2363         (WebCore::hasEnabledColorInputAsShadowHost): Added.
2364         (WebCore::elementUnderMouse): Use shadowHost instead of deprecatedShadowAncestorNode.
2365         Also added FIXME since it seems this should instead be using parentElementInComposedTree.
2366         (WebCore::DragController::concludeEditDrag): Removed "false" argument to isEnabledColorInput.
2367         (WebCore::DragController::canProcessDrag): Removed "true" argument to isEnabledColorInput
2368         and added call to hasEnabledColorInputAsShadowHost. Also put the value of the node to drag
2369         into a local variable to simplify code.
2370         (WebCore::DragController::draggableElement const): Removed "false" argument to isEnabledColorInput.
2371
2372         * page/EventHandler.cpp:
2373         (WebCore::EventHandler::handleAccessKey): Update name of elementForAccessKey.
2374
2375         * page/FocusController.cpp:
2376         (WebCore::clearSelectionIfNeeded): Use shadowHost instead of deprecatedShadowAncestorNode.
2377
2378         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2379         (WebCore::createPageForServiceWorker): Pass reference instead of pointer for frame to
2380         Document::createNonRenderedPlaceholder.
2381
2382 2019-02-21  Daniel Bates  <dabates@apple.com>
2383
2384         Same Site Lax cookies are not sent with cross-site redirect from client-initiated load
2385         https://bugs.webkit.org/show_bug.cgi?id=194906
2386         <rdar://problem/44305947>
2387
2388         Reviewed by Brent Fulgham.
2389
2390         Ensure that a request for a top-level navigation is annotated as such regardless of whether
2391         the request has a computed Same Site policy.
2392
2393         "New loads" initiated by a the client (Safari) either by API or a human either explicitly
2394         typing a URL in the address bar or Command + clicking a hyperlink to open it in a new window/tab
2395         are always considered Same Site. This is by definition from the spec. [1] as we aren't navigating
2396         from an existing page. (Command + click should be thought of as a convenience to the user from
2397         having to copy the hyperlink's URL, create a new window, and paste the URL into the address bar).
2398         Currently the frame loader marks a request as a top-level navigation if and only if the request
2399         does not have a pre-computed Same Site policy. However, "New loads" have a pre-computed Same Site
2400         policy. So, these loads would never be marked as a top-level navigation by the frame loading code.
2401         Therefore, if the "new load" turned out to be a cross-site redirect then WebKit would incorrectly
2402         tell the networking stack that the load was a cross-site, non-top-level navigation, and per the
2403         Same Site spec [2], the networking stack would not send Same Site Lax cookies. Instead,
2404         WebKit should unconditionally ensure that requests are marked as a top-level navigation, if applicable.
2405
2406         [1] See Note for (1) in  <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.2>
2407         [2] <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7.1>
2408
2409         Test: http/tests/cookies/same-site/user-load-cross-site-redirect.php
2410
2411         * loader/FrameLoader.cpp:
2412         (WebCore::FrameLoader::addExtraFieldsToRequest): Unconditionally update the request's top-
2413         level navigation bit.
2414         * platform/network/ResourceRequestBase.cpp:
2415         (WebCore::ResourceRequestBase::setAsIsolatedCopy): Unconditionally copy a request's top-
2416         level navigation bit.
2417
2418 2019-02-21  Per Arne Vollan  <pvollan@apple.com>
2419
2420         Layout Test fast/text/international/khmer-selection.html is crashing
2421         https://bugs.webkit.org/show_bug.cgi?id=191368
2422
2423         Reviewed by Brent Fulgham.
2424
2425         GlyphBuffer's offset array wasn't getting filled by UniscribeController.
2426         Our underlining code requires this array.
2427
2428         Uniscribe gives us a character -> glyph mapping, so we just have to compute
2429         the inverse and give it to the GlyphBuffer.
2430
2431         This patch is written by Myles C. Maxfield.
2432
2433         Test: fast/text/international/khmer-selection.html.
2434
2435         * platform/graphics/GlyphBuffer.h:
2436         (WebCore::GlyphBuffer::add):
2437         * platform/graphics/displaylists/DisplayListItems.cpp:
2438         (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):
2439         * platform/graphics/win/UniscribeController.cpp:
2440         (WebCore::UniscribeController::advance):
2441         (WebCore::UniscribeController::itemizeShapeAndPlace):
2442         (WebCore::UniscribeController::shapeAndPlaceItem):
2443         * platform/graphics/win/UniscribeController.h:
2444
2445 2019-02-21  Sihui Liu  <sihui_liu@apple.com>
2446
2447         IndexedDB: leak UniqueIDBDatabase in layout tests
2448         https://bugs.webkit.org/show_bug.cgi?id=194870
2449         <rdar://problem/48163812>
2450
2451         Reviewed by Geoffrey Garen.
2452
2453         UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it 
2454         receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
2455         pointer should be released when a database task finishes, but it didn't perform a check when a confirm message 
2456         is received. 
2457
2458         No new test as the order of task completion and confirmation arrival is uncertain.
2459
2460         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2461         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
2462
2463 2019-02-21  Andy Estes  <aestes@apple.com>
2464
2465         contentfiltering tests leak documents
2466         https://bugs.webkit.org/show_bug.cgi?id=189434
2467         <rdar://44239943>
2468
2469         Reviewed by Simon Fraser.
2470
2471         Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.
2472
2473         This fixes world leaks in several tests in LayoutTests/contentfiltering/.
2474
2475         * bindings/js/ScriptController.h:
2476         * loader/ContentFilter.cpp:
2477         (WebCore::ContentFilter::didDecide):
2478
2479 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
2480
2481         [CMake][Win] Fix !USE(CF) build of WebCore
2482         https://bugs.webkit.org/show_bug.cgi?id=194879
2483
2484         Reviewed by Konstantin Tokarev.
2485
2486         * PlatformAppleWin.cmake:
2487         * PlatformWin.cmake:
2488         * PlatformWinCairo.cmake:
2489
2490 2019-02-21  Zalan Bujtas  <zalan@apple.com>
2491
2492         [LFC][Floats] Add support for placing formatting roots in-between floats.
2493         https://bugs.webkit.org/show_bug.cgi?id=194902
2494
2495         Reviewed by Antti Koivisto.
2496
2497         This patch add support for placing a formatting root box in-between existing floats.
2498         The initial vertical position of a formatting root is its static position which can make the box
2499         placed above exsiting floats (whereas we can never place a regular float above existing floats.)
2500
2501         Test: fast/block/block-only/floats-and-block-formatting-roots.html
2502
2503         * layout/blockformatting/BlockFormattingContext.cpp:
2504         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2505         * layout/floats/FloatingContext.cpp:
2506         (WebCore::Layout::FloatPair::LeftRightIndex::isEmpty const):
2507         (WebCore::Layout::FloatPair::isEmpty const):
2508         (WebCore::Layout::FloatPair::operator* const):
2509         (WebCore::Layout::Iterator::operator* const):
2510         (WebCore::Layout::begin):
2511         (WebCore::Layout::end):
2512         (WebCore::Layout::FloatingContext::positionForFloat const):
2513         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2514         (WebCore::Layout::findAvailablePosition):
2515         (WebCore::Layout::FloatingContext::findPositionForFloatBox const):
2516         (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
2517         (WebCore::Layout::FloatPair::FloatPair):
2518         (WebCore::Layout::FloatPair::left const):
2519         (WebCore::Layout::FloatPair::right const):
2520         (WebCore::Layout::FloatPair::intersects const):
2521         (WebCore::Layout::FloatPair::operator == const):
2522         (WebCore::Layout::FloatPair::horizontalConstraints const):
2523         (WebCore::Layout::FloatPair::bottom const):
2524         (WebCore::Layout::Iterator::operator++):
2525         (WebCore::Layout::Iterator::set):
2526         (WebCore::Layout::FloatingPair::isEmpty const): Deleted.
2527         (WebCore::Layout::FloatingPair::verticalConstraint const): Deleted.
2528         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): Deleted.
2529         (WebCore::Layout::FloatingContext::floatingPosition const): Deleted.
2530         (WebCore::Layout::FloatingPair::FloatingPair): Deleted.
2531         (WebCore::Layout::FloatingPair::left const): Deleted.
2532         (WebCore::Layout::FloatingPair::right const): Deleted.
2533         (WebCore::Layout::FloatingPair::intersects const): Deleted.
2534         (WebCore::Layout::FloatingPair::operator == const): Deleted.
2535         (WebCore::Layout::FloatingPair::horizontalConstraints const): Deleted.
2536         (WebCore::Layout::FloatingPair::bottom const): Deleted.
2537         * layout/floats/FloatingContext.h:
2538
2539 2019-02-21  Rob Buis  <rbuis@igalia.com>
2540
2541         Update MIME type parser
2542         https://bugs.webkit.org/show_bug.cgi?id=180526
2543
2544         Reviewed by Darin Adler.
2545
2546         Further testing showed the MIME parser needs these fixes:
2547         - stripWhitespace is wrong for removing HTTP whitespace, use
2548           stripLeadingAndTrailingHTTPSpaces instead.
2549         - HTTP Token code points checking for Rfc2045 and Mimesniff were
2550           mixed up, use the dedicated isValidHTTPToken for Mimesniff mode.
2551         - Quoted Strings were not unescaped/escaped, this seems ok for
2552           serializing but is wrong when gettings individual parameter values.
2553           Implement [1] and [2] Step 2.4 to properly unescape and escape.
2554
2555         This change also tries to avoid hard to read uses of find.
2556
2557         Test: ParsedContentType.Serialize
2558
2559         [1] https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
2560         [2] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
2561
2562         * platform/network/ParsedContentType.cpp:
2563         (WebCore::skipSpaces):
2564         (WebCore::parseToken):
2565         (WebCore::isNotQuoteOrBackslash):
2566         (WebCore::collectHTTPQuotedString):
2567         (WebCore::containsNonTokenCharacters):
2568         (WebCore::parseQuotedString):
2569         (WebCore::ParsedContentType::parseContentType):
2570         (WebCore::ParsedContentType::create):
2571         (WebCore::ParsedContentType::setContentType):
2572         (WebCore::containsNonQuoteStringTokenCharacters):
2573         (WebCore::ParsedContentType::setContentTypeParameter):
2574         (WebCore::ParsedContentType::serialize const):
2575         (WebCore::substringForRange): Deleted.
2576         (WebCore::isNonTokenCharacter): Deleted.
2577         (WebCore::isNonQuotedStringTokenCharacter): Deleted.
2578         * platform/network/ParsedContentType.h:
2579
2580 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
2581
2582         REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
2583         https://bugs.webkit.org/show_bug.cgi?id=194889
2584         rdar://problem/47755552
2585
2586         Reviewed by Tim Horton.
2587         
2588         After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
2589         position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
2590         with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
2591         update, we'd update the fixed scrolling node with the new viewport, and an old layer position.
2592         
2593         Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
2594         layer.
2595
2596         Not currently testable.
2597
2598         * rendering/RenderLayerCompositor.cpp:
2599         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2600
2601 2019-02-20  Dean Jackson  <dino@apple.com>
2602
2603         Rotation animations sometimes use the wrong origin (affects apple.com)
2604         https://bugs.webkit.org/show_bug.cgi?id=194878
2605         <rdar://problem/43908047>
2606
2607         Reviewed by Simon Fraser.
2608
2609         Some versions of CoreAnimation apply additive animations in reverse
2610         order. Detect this and reverse the list of animations we provide.
2611
2612         Update the existing animations/additive-transform-animations.html test to
2613         be a ref-test that would identify this failure. Previously it relied on
2614         a pixel test.
2615
2616         * platform/graphics/ca/GraphicsLayerCA.cpp: Use 
2617             HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
2618             not to flip the list of animations (and mark the correct ones as
2619             additive).
2620         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2621         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2622
2623 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
2624
2625         [Win] Guard CF usage in RenderThemeWin
2626         https://bugs.webkit.org/show_bug.cgi?id=194875
2627
2628         Reviewed by Alex Christensen.
2629
2630         No new tests. No change in behavior.
2631
2632         Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.
2633
2634         * rendering/RenderThemeWin.cpp:
2635         (WebCore::RenderThemeWin::stringWithContentsOfFile):
2636         (WebCore::RenderThemeWin::mediaControlsStyleSheet):
2637         (WebCore::RenderThemeWin::mediaControlsScript):
2638         * rendering/RenderThemeWin.h:
2639
2640 2019-02-20  Ryosuke Niwa  <rniwa@webkit.org>
2641
2642         Crash in DOMWindowExtension::suspendForPageCache
2643         https://bugs.webkit.org/show_bug.cgi?id=194871
2644
2645         Reviewed by Chris Dumez.
2646
2647         This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.
2648
2649         We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
2650         dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
2651         Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
2652         to avoid the crash.
2653
2654         * page/DOMWindow.cpp:
2655         (WebCore::DOMWindow::willDestroyCachedFrame):
2656         (WebCore::DOMWindow::willDestroyDocumentInFrame):
2657         (WebCore::DOMWindow::willDetachDocumentFromFrame):
2658         (WebCore::DOMWindow::suspendForPageCache):
2659         (WebCore::DOMWindow::resumeFromPageCache):
2660         * page/DOMWindowExtension.cpp:
2661         (WebCore::DOMWindowExtension::suspendForPageCache):
2662
2663 2019-02-20  Alex Christensen  <achristensen@webkit.org>
2664
2665         Always call CompletionHandlers after r240909
2666         https://bugs.webkit.org/show_bug.cgi?id=194823
2667
2668         Reviewed by Ryosuke Niwa.
2669
2670         * loader/PolicyChecker.cpp:
2671         (WebCore::PolicyChecker::checkNavigationPolicy):
2672         (WebCore::PolicyChecker::checkNewWindowPolicy):
2673
2674 2019-02-20  Andy Estes  <aestes@apple.com>
2675
2676         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
2677         https://bugs.webkit.org/show_bug.cgi?id=194869
2678
2679         Rubber-stamped by Jer Noble.
2680
2681         * WebCore.xcodeproj/project.pbxproj:
2682
2683 2019-02-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2684
2685         drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
2686         https://bugs.webkit.org/show_bug.cgi?id=194746
2687
2688         Reviewed by Dean Jackson.
2689
2690         Test: fast/canvas/canvas-drawImage-composite-copy.html
2691
2692         If the source canvas of drawImage() is the same as the destination and
2693         globalCompositeOperation is set to "copy", copy the srcRect from the 
2694         canvas to a temporary buffer before calling clearCanvas() then drawImage
2695         from this temporary buffer.
2696
2697         * html/canvas/CanvasRenderingContext2DBase.cpp:
2698         (WebCore::CanvasRenderingContext2DBase::drawImage):
2699         * platform/graphics/ImageBuffer.cpp:
2700         (WebCore::ImageBuffer::copyRectToBuffer):
2701         * platform/graphics/ImageBuffer.h:
2702
2703 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
2704
2705         REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
2706         https://bugs.webkit.org/show_bug.cgi?id=194866
2707
2708         Reviewed by Antti Koivisto.
2709
2710         r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
2711         a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
2712         the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.
2713
2714         * rendering/RenderLayerCompositor.cpp:
2715         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
2716
2717 2019-02-20  Daniel Bates  <dabates@apple.com>
2718
2719         [iOS] Tweak UI for focus rings
2720         https://bugs.webkit.org/show_bug.cgi?id=194864
2721         <rdar://problem/47831886>
2722
2723         Reviewed by Brent Fulgham.
2724
2725         Make use of UIKit constants to make focus rings pretty.
2726
2727         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2728         (WebCore::drawFocusRingAtTime):
2729
2730 2019-02-20  Timothy Hatcher  <timothy@apple.com>
2731
2732         RenderThemeIOS should use RenderTheme's color cache instead of its own.
2733         https://bugs.webkit.org/show_bug.cgi?id=194822
2734         rdar://problem/48208296
2735
2736         Reviewed by Tim Horton.
2737
2738         Tested by fast/css/apple-system-colors.html.
2739
2740         * css/CSSValueKeywords.in:
2741         * css/parser/CSSPropertyParser.cpp:
2742         (WebCore::isAppleLegacyCssValueKeyword):
2743         * platform/graphics/Color.h:
2744         * platform/graphics/cg/ColorCG.cpp:
2745         (WebCore::makeRGBAFromCGColor):
2746         (WebCore::Color::Color):
2747         * rendering/RenderThemeIOS.h:
2748         * rendering/RenderThemeIOS.mm:
2749         (WebCore::RenderThemeIOS::systemColor const):
2750         * rendering/RenderThemeMac.mm:
2751         (WebCore::RenderThemeMac::systemColor const):
2752
2753 2019-02-20  Loïc Yhuel  <loic.yhuel@softathome.com>
2754
2755         Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
2756         https://bugs.webkit.org/show_bug.cgi?id=194819
2757
2758         Reviewed by Joseph Pecoraro.
2759
2760         Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html
2761
2762         * Modules/websockets/WebSocketChannel.h:
2763         (WebCore::WebSocketChannel::hasCreatedHandshake):
2764         * inspector/agents/page/PageNetworkAgent.cpp:
2765         Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.
2766
2767 2019-02-20  Zalan Bujtas  <zalan@apple.com>
2768
2769         [LFC][Floats] Make FloatAvoider::resetPosition implicit
2770         https://bugs.webkit.org/show_bug.cgi?id=194855
2771
2772         Reviewed by Antti Koivisto.
2773
2774         Let's compute the initial top/left position during c'tor time.
2775         This is in preparation for fixing formatting root box placement in a float context.
2776
2777         * layout/floats/FloatAvoider.cpp:
2778         (WebCore::Layout::FloatAvoider::resetPosition): Deleted.
2779         * layout/floats/FloatAvoider.h:
2780         (WebCore::Layout::FloatAvoider::displayBox):
2781         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
2782         * layout/floats/FloatBox.cpp:
2783         (WebCore::Layout::FloatBox::FloatBox):
2784         (WebCore::Layout::FloatBox::initialVerticalPosition const):
2785         * layout/floats/FloatBox.h:
2786         * layout/floats/FloatingContext.cpp:
2787         (WebCore::Layout::FloatingContext::floatingPosition const):
2788
2789 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
2790
2791         [MSVC] Fix compilation errors with lambdas in Service Workers
2792         https://bugs.webkit.org/show_bug.cgi?id=194841
2793
2794         Reviewed by Alex Christensen.
2795
2796         No new tests. No change in behavior.
2797
2798         MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is
2799         referring to the enclosing lambda according to MSVC. This patch works around this behavior
2800         through by using the `protectedThis` pattern in WebKit code.
2801
2802         * workers/service/server/RegistrationDatabase.cpp:
2803         (WebCore::RegistrationDatabase::openSQLiteDatabase):
2804
2805 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
2806
2807         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
2808         https://bugs.webkit.org/show_bug.cgi?id=167941
2809
2810         Reviewed by Carlos Garcia Campos.
2811
2812         * platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp
2813         to the list of files with translatable strings.
2814
2815 2019-02-19  Simon Fraser  <simon.fraser@apple.com>
2816
2817         REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
2818         https://bugs.webkit.org/show_bug.cgi?id=194827
2819         rdar://problem/47620594
2820
2821         Reviewed by Antti Koivisto.
2822
2823         Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
2824         layer configurations, since a repaint implies that a layer gains painted content. This is done
2825         via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
2826         The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
2827         for the root. The configuration state that matters here is whether the layer contains painted content,
2828         and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
2829         and feeds into GraphicsLayer::drawsContent().
2830
2831         However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
2832         then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
2833         causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.
2834
2835         Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
2836         the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
2837         to always return false for the RenderView's layer (the root).
2838         
2839         Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
2840         properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
2841         LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
2842         respect it.
2843
2844         Test: compositing/visibility/root-visibility-toggle.html
2845
2846         * page/Frame.h:
2847         * platform/graphics/GraphicsLayer.cpp:
2848         (WebCore::GraphicsLayer::dumpProperties const):
2849         * platform/graphics/GraphicsLayerClient.h:
2850         (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):
2851         * rendering/RenderLayerBacking.cpp:
2852         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
2853         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):
2854         * rendering/RenderLayerBacking.h:
2855         * rendering/RenderLayerCompositor.cpp:
2856         (WebCore::RenderLayerCompositor::layerTreeAsText):
2857         * testing/Internals.cpp:
2858         (WebCore::toLayerTreeFlags):
2859         * testing/Internals.h:
2860         * testing/Internals.idl:
2861
2862 2019-02-19  Ryosuke Niwa  <rniwa@webkit.org>
2863
2864         REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
2865         https://bugs.webkit.org/show_bug.cgi?id=194820
2866
2867         Reviewed by Geoffrey Garen.
2868
2869         This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
2870         doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
2871         continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
2872         and we don't rely on PolicyChecker's load type until then.
2873
2874         Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.
2875
2876         This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
2877         invoking checkNewWindowPolicy which is not the right assumption.
2878
2879         Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
2880
2881         * loader/FrameLoader.cpp:
2882         (WebCore::FrameLoader::loadURL):
2883         (WebCore::FrameLoader::load):
2884         (WebCore::FrameLoader::loadPostRequest):
2885
2886 2019-02-19  Zalan Bujtas  <zalan@apple.com>
2887
2888         Fix post-commit feedback.
2889
2890         Unreviewed. 
2891
2892         * layout/floats/FloatingContext.cpp:
2893         (WebCore::Layout::FloatingPair::intersects const):
2894
2895 2019-02-19  Zalan Bujtas  <zalan@apple.com>
2896
2897         [LFC][Floats] Remove redundant intersecting logic
2898         https://bugs.webkit.org/show_bug.cgi?id=194804
2899
2900         Reviewed by Antti Koivisto.
2901
2902         floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
2903
2904         * layout/floats/FloatingContext.cpp:
2905         (WebCore::Layout::FloatingContext::floatingPosition const):
2906         (WebCore::Layout::FloatingPair::intersects const):
2907
2908 2019-02-19  Commit Queue  <commit-queue@webkit.org>
2909
2910         Unreviewed, rolling out r241722.
2911         https://bugs.webkit.org/show_bug.cgi?id=194801
2912
2913         Causing time outs and EWS failures after expectation file was
2914         added. (Requested by ShawnRoberts on #webkit).
2915
2916         Reverted changeset:
2917
2918         "IndexedDB: leak IDBDatabase and IDBTransacstion in layout
2919         tests"
2920         https://bugs.webkit.org/show_bug.cgi?id=194709
2921         https://trac.webkit.org/changeset/241722
2922
2923 2019-02-16  Darin Adler  <darin@apple.com>
2924
2925         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
2926         https://bugs.webkit.org/show_bug.cgi?id=194752
2927
2928         Reviewed by Daniel Bates.
2929
2930         * Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously
2931         got included because of Logger.h, but that no longer pulls in HexNumber.h.
2932
2933         * css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
2934         * css/CSSPrimitiveValue.cpp: Ditto.
2935
2936         * css/CSSUnicodeRangeValue.cpp:
2937         (WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
2938         of String::format and "%x".
2939
2940         * html/HTMLMediaElement.h:
2941         (WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
2942         TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.
2943
2944         * html/canvas/WebGLRenderingContextBase.cpp:
2945         (GetErrorString): Use makeString and hex instead of String::format and "%04x".
2946
2947         * html/track/TextTrackCue.cpp:
2948         (WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
2949         from HTMLMediaElement.h and use makeString instead of String::format. Also use
2950         the word "debug" to make it clear that it's not OK to use this string, with a
2951         pointer value serialized into it, outside of debugging.
2952         * html/track/TextTrackCue.h: Added TextTrackCue::debugString.
2953
2954         * page/linux/ResourceUsageOverlayLinux.cpp:
2955         (WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
2956         instead of String::format and "%.1f" etc.
2957
2958         * platform/cocoa/KeyEventCocoa.mm:
2959         (WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
2960         the old code that did each of the four characters explicitly.
2961
2962         * platform/gamepad/mac/HIDGamepad.cpp:
2963         (WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.
2964
2965         * platform/graphics/Color.cpp:
2966         (WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
2967         digit separately.
2968
2969         * platform/graphics/FloatPolygon.cpp:
2970         (WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
2971         from the header and use makeString instead of String::format. Also use
2972         the word "debug" to make it clear that it's not OK to use this string, with a
2973         pointer value serialized into it, outside of debugging.
2974         * platform/graphics/FloatPolygon.h: Updated for the above.
2975
2976         * platform/graphics/ca/GraphicsLayerCA.cpp:
2977         (WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
2978         (WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.
2979         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2980         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
2981         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.
2982         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2983         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.
2984         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
2985         (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
2986         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2987         (WebCore::GStreamerVideoEncoder::makeElement): Ditto.
2988         (WebCore::GStreamerVideoEncoder::InitEncode): Ditto.
2989
2990         * platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h
2991         and "using namespace WTF".
2992
2993         * platform/win/GDIObjectCounter.cpp:
2994         (WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.
2995         * platform/win/KeyEventWin.cpp:
2996         (WebCore::keyIdentifierForWindowsKeyCode): Ditto.
2997
2998         * rendering/FloatingObjects.cpp:
2999         (WebCore::FloatingObject::debugString const): Added. Moved string conversion here
3000         from the header and use makeString instead of String::format. Also use
3001         the word "debug" to make it clear that it's not OK to use this string, with a
3002         pointer value serialized into it, outside of debugging.
3003         * rendering/FloatingObjects.h: Updated for the above.
3004
3005         * rendering/RenderFragmentContainer.cpp:
3006         (WebCore::RenderFragmentContainer::debugString const): Added. Moved string
3007         conversion here from the header and use makeString instead of String::format.
3008         Also use the word "debug" to make it clear that it's not OK to use this string,
3009         with a pointer value serialized into it, outside of debugging.
3010         * rendering/RenderFragmentContainer.h: Updated for the above.
3011         * rendering/RenderFragmentedFlow.h: Ditto.
3012
3013         * testing/Internals.cpp:
3014         (WebCore::Internals::address): Use makeString instead of String::format.
3015
3016 2019-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3017
3018         [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
3019         https://bugs.webkit.org/show_bug.cgi?id=194670
3020         <rdar://problem/39066529>
3021
3022         Reviewed by Tim Horton.
3023
3024         Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
3025         switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
3026         special codepath in WebContentReader::readImage.
3027
3028         This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
3029         attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
3030         contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
3031         attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
3032         conforms to "public.content", we take this codepath instead of first attempting the web content reading types
3033         supported by default in WebKit.
3034
3035         See below for more detail.
3036
3037         Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
3038
3039         * editing/Editor.cpp:
3040         (WebCore::Editor::clientReplacementURLForResource): Deleted.
3041         * editing/Editor.h:
3042         * editing/WebContentReader.h:
3043         * editing/cocoa/WebContentReaderCocoa.mm:
3044         (WebCore::mimeTypeFromContentType):
3045         (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
3046         (WebCore::createFragmentAndAddResources):
3047         (WebCore::sanitizeMarkupWithArchive):
3048
3049         Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
3050
3051         (WebCore::WebContentReader::readImage):
3052         (WebCore::attachmentForFilePath):
3053         (WebCore::attachmentForData):
3054
3055         Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
3056         quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
3057         of their similarities into helper functions.
3058
3059         (WebCore::WebContentReader::readDataBuffer):
3060         (WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.
3061
3062         Remove more logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
3063
3064         * loader/EmptyClients.cpp:
3065         * page/EditorClient.h:
3066         * platform/Pasteboard.h:
3067         * platform/PasteboardItemInfo.h:
3068         (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
3069         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
3070         (WebCore::PasteboardItemInfo::encode const):
3071         (WebCore::PasteboardItemInfo::decode):
3072
3073         Add contentTypesByFidelity to PasteboardItemInfo, instead of requesting this information using a separate IPC
3074         message. This means we can also remove getTypesByFidelityForItemAtIndex, and just use the item's types in
3075         fidelity order instead.
3076
3077         * platform/PasteboardStrategy.h:
3078         * platform/PlatformPasteboard.h:
3079         * platform/ios/AbstractPasteboard.h:
3080         * platform/ios/PasteboardIOS.mm:
3081         (WebCore::Pasteboard::read):
3082
3083         Shave off (potentially many) sync IPC messages to the UI process by pulling each call to
3084         informationForItemAtIndex out of the inner loop when reading web content.
3085
3086         (WebCore::Pasteboard::readRespectingUTIFidelities):
3087
3088         Shave off one extraneous sync IPC message by rolling the types in fidelity order into the request for
3089         PasteboardItemInfo, instead of being sent in a separate message.
3090
3091         * platform/ios/PlatformPasteboardIOS.mm:
3092         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3093
3094         Populate contentTypesForFileUpload in the case where UIPasteboard is used (i.e. copy and paste).
3095
3096         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex): Deleted.
3097         * platform/ios/WebItemProviderPasteboard.h:
3098         * platform/ios/WebItemProviderPasteboard.mm:
3099         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]): Deleted.
3100
3101 2019-02-18  Daniel Bates  <dabates@apple.com>
3102
3103         Clean up and modernize RenderThemeIOS::paintCheckboxDecorations()
3104         https://bugs.webkit.org/show_bug.cgi?id=194785
3105
3106         Reviewed by Simon Fraser.
3107
3108         Change from early return to else-clause to make the states clearer and make it more straightforward
3109         to share more common code. Use constexpr, allocate temporary vectors with inline capacity, and
3110         switch to uniform initializer syntax.
3111
3112         * rendering/RenderThemeIOS.mm:
3113         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
3114
3115 2019-02-18  Daniel Bates  <dabates@apple.com>
3116
3117         [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
3118         https://bugs.webkit.org/show_bug.cgi?id=193599
3119         <rdar://problem/47399602>
3120
3121         Reviewed by Simon Fraser.
3122
3123         For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS
3124         for text fields, textareas, keygens, and selects so as to match the visual appearance of all
3125         the other controls.
3126
3127         Tests: fast/forms/ios/focus-button.html
3128                fast/forms/ios/focus-checkbox.html
3129                fast/forms/ios/focus-checked-checkbox.html
3130                fast/forms/ios/focus-checked-radio.html
3131                fast/forms/ios/focus-radio.html
3132                fast/forms/ios/focus-reset-button.html
3133                fast/forms/ios/focus-search-field.html
3134                fast/forms/ios/focus-submit-button.html
3135                fast/forms/ios/focus-text-field.html
3136                fast/forms/ios/focus-textarea.html
3137
3138         * css/html.css:
3139         (:focus): Use 3px outline width.
3140         (input:focus, textarea:focus, keygen:focus, select:focus): Guard this code to exclude it when building for iOS.
3141         * rendering/RenderBox.cpp:
3142         (WebCore::RenderBox::paintBoxDecorations): Add FIXME comment.
3143         * rendering/RenderElement.cpp:
3144         (WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect.
3145         Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug.
3146
3147 2019-02-18  Oriol Brufau  <obrufau@igalia.com>
3148
3149         [css-grid] Handle indefinite percentages in fit-content()
3150         https://bugs.webkit.org/show_bug.cgi?id=194509
3151
3152         Reviewed by Javier Fernandez.
3153
3154         Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html
3155
3156         If the size of the grid container depends on the size of its tracks,
3157         a percentage in fit-content() is indefinite. Without this patch, some
3158         places treated this case as fit-content(0), which prevented the grid
3159         container from growing enough to contain the max-content contribution
3160         of its grid items.
3161
3162         This patch treats such fit-content() as minmax(auto, max-content),
3163         but once the size of the grid container is known and it is laid out
3164         "for real", then the percentage is definite and it's used.
3165
3166         * rendering/GridTrackSizingAlgorithm.cpp:
3167         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
3168         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
3169
3170 2019-02-18  John Wilander  <wilander@apple.com>
3171
3172         Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
3173         https://bugs.webkit.org/show_bug.cgi?id=194777
3174         <rdar://problem/47731945>
3175
3176         Reviewed by Geoffrey Garen and Chris Dumez.
3177
3178         Test: http/tests/storageAccess/remove-requesting-iframe.html
3179
3180         * dom/Document.cpp:
3181         (WebCore::Document::hasFrameSpecificStorageAccess const):
3182             Now checks for the existence of the frame.
3183         (WebCore::Document::setHasFrameSpecificStorageAccess):
3184             Now checks for the existence of the frame.
3185         * loader/ResourceLoadObserver.cpp:
3186         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3187             Now checks that the session ID is valid.
3188
3189 2019-02-18  Jer Noble  <jer.noble@apple.com>
3190
3191         -[AVSampleBufferDisplayLayer player]: Unrecognized selector crash
3192         https://bugs.webkit.org/show_bug.cgi?id=194790
3193         <rdar://problem/33866742>
3194
3195         Reviewed by Jon Lee.
3196
3197         Ensure that a WebVideoContainerLayer's sole sublayer is actually an AVPlayerLayer (and not
3198         an AVSampleBufferDisplayLayer) before reporting that the layer type is LayerTypeAVPlayerLayer.
3199
3200         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3201         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
3202
3203 2019-02-18  Joseph Pecoraro  <pecoraro@apple.com>
3204
3205         Web Inspector: Better categorize CPU usage per-thread / worker
3206         https://bugs.webkit.org/show_bug.cgi?id=194564
3207
3208         Reviewed by Devin Rousso.
3209
3210         Test: inspector/cpu-profiler/threads.html
3211
3212         * workers/WorkerThread.cpp:
3213         (WebCore::WorkerThread::workerThreadsMutex):
3214         (WebCore::WorkerThread::workerThreadCount):
3215         (WebCore::WorkerThread::WorkerThread):
3216         (WebCore::WorkerThread::~WorkerThread):
3217         (WebCore::WorkerThread::workerThread):
3218         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
3219         * workers/WorkerThread.h:
3220         (WebCore::WorkerThread::identifier const):
3221         Expose the set of all WorkerThreads.
3222
3223         * inspector/agents/InspectorCPUProfilerAgent.cpp:
3224         (WebCore::InspectorCPUProfilerAgent::collectSample):
3225         Send inspector additional per-thread data.
3226
3227         * page/ResourceUsageData.h:
3228         (WebCore::WorkerCPUInfo::WorkerCPUInfo):
3229         * page/cocoa/ResourceUsageThreadCocoa.mm:
3230         (WebCore::ThreadInfo::ThreadInfo):
3231         (WebCore::threadInfos):
3232         (WebCore::ResourceUsageThread::platformCollectCPUData):
3233         (WebCore::threadSendRights): Deleted.
3234         (WebCore::cpuUsage): Deleted.
3235         Compute per-thread values on cocoa ports.
3236
3237         * page/linux/ResourceUsageThreadLinux.cpp:
3238         (WebCore::ResourceUsageThread::platformCollectCPUData):
3239         Stub per-thread values on linux ports.
3240
3241 2019-02-18  Jer Noble  <jer.noble@apple.com>
3242
3243         Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus()
3244         https://bugs.webkit.org/show_bug.cgi?id=194786
3245
3246         Reviewed by Eric Carlson.
3247
3248         Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:]
3249         in an exception handler.
3250
3251         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3252         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
3253
3254 2019-02-18  Daniel Bates  <dabates@apple.com>
3255
3256         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
3257         https://bugs.webkit.org/show_bug.cgi?id=192824
3258         <rdar://problem/47100332>
3259
3260         Reviewed by Wenson Hsieh.
3261
3262         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
3263         now that hardware key events to non-editable elements use the same code path as for editable elements. 
3264
3265         * platform/ios/KeyEventIOS.mm:
3266         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
3267         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
3268         (WebCore::isFunctionKey): Ditto.
3269         * platform/ios/WebEvent.mm:
3270         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
3271         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
3272
3273 2019-02-18  Eric Carlson  <eric.carlson@apple.com>
3274
3275         Add MSE logging configuration
3276         https://bugs.webkit.org/show_bug.cgi?id=194719
3277         <rdar://problem/48122151>
3278
3279         Reviewed by Joseph Pecoraro.
3280
3281         No new tests, updated inspector/console/webcore-logging.html.
3282
3283         * dom/Document.cpp:
3284         (WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
3285
3286         * inspector/agents/WebConsoleAgent.cpp:
3287         (WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
3288
3289 2019-02-18  Antoine Quint  <graouts@apple.com>
3290
3291         [iOS] Dispatch additional events along with pointerdown and pointerup
3292         https://bugs.webkit.org/show_bug.cgi?id=194776
3293         <rdar://problem/48164284>
3294
3295         Reviewed by Brent Fulgham.
3296
3297         The Pointer Events specification mandates that "pointerover" and "pointerenter" events precede a "pointerdown" event and that "pointerout"
3298         and "pointerleave" events follow a "pointerup" event. We remove the EventHandler::dispatchPointerEventForTouchAtIndex() method and replace
3299         it with a PointerCaptureController::dispatchEventForTouchAtIndex() that can handle the dispatch of such additional events correctly, also
3300         allowing for two PointerCaptureController methods (pointerEventWillBeDispatched and pointerEventWasDispatched) to become private.
3301
3302         Test: pointerevents/ios/over-enter-out-leave.html
3303
3304         * dom/EventNames.h: Add the new "pointerover", "pointerenter", "pointerout" and "pointerleave" event types.
3305         * dom/PointerEvent.h:
3306         * dom/ios/PointerEventIOS.cpp:
3307         (WebCore::PointerEvent::create):
3308         * page/EventHandler.cpp:
3309         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex): Deleted.
3310         * page/EventHandler.h:
3311         * page/PointerCaptureController.cpp:
3312         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Take the existing code from EventHandler::dispatchPointerEventForTouchAtIndex()
3313         and extend it to dispatch additional events as mandated. Since several events may be dispatched we check whether the dispatch of any of those events
3314         had defaultPrevented() or defaultHanded() return true and return those values as a pair.
3315         (WebCore::PointerCaptureController::pointerEventWasDispatched):
3316         * page/PointerCaptureController.h:
3317
3318 2019-02-18  Sihui Liu  <sihui_liu@apple.com>
3319
3320         IndexedDB: leak IDBDatabase and IDBTransacstion in layout tests
3321         https://bugs.webkit.org/show_bug.cgi?id=194709
3322
3323         Reviewed by Geoffrey Garen.
3324
3325         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
3326         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
3327
3328         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
3329         between IDBOpenDBRequest and IDBTransaction.
3330
3331         Test: storage/indexeddb/IDBObject-leak.html
3332
3333         * Modules/indexeddb/IDBDatabase.cpp:
3334         (WebCore::IDBDatabase::connectionToServerLost):
3335         * Modules/indexeddb/IDBTransaction.cpp:
3336         (WebCore::IDBTransaction::IDBTransaction):
3337         (WebCore::IDBTransaction::~IDBTransaction):
3338         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
3339         (WebCore::IDBTransaction::connectionClosedFromServer):
3340         * Modules/indexeddb/IDBTransaction.h:
3341         * testing/Internals.cpp:
3342         (WebCore::Internals::numberOfIDBTransactions const):
3343         * testing/Internals.h:
3344         * testing/Internals.idl:
3345
3346 2019-02-18  Chris Fleizach  <cfleizach@apple.com>
3347
3348         AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
3349         https://bugs.webkit.org/show_bug.cgi?id=194742
3350
3351         Reviewed by Chris Dumez.
3352
3353         With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
3354         had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
3355
3356         This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
3357         receive notifications.
3358
3359         It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
3360         page load.
3361
3362         * accessibility/mac/AXObjectCacheMac.mm:
3363         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
3364
3365 2019-02-18  Megan Gardner  <megan_gardner@apple.com>
3366
3367         Turn On Smart Delete
3368         https://bugs.webkit.org/show_bug.cgi?id=194320
3369
3370         Reviewed by Ryosuke Niwa.
3371
3372         Updated the following tests to work with iOS:
3373         * editing/deleting/smart-delete-001.html:
3374         * editing/deleting/smart-delete-002.html:
3375         * editing/deleting/smart-delete-003.html:
3376         * editing/deleting/smart-delete-004.html:
3377         * editing/deleting/smart-delete-across-editable-boundaries-2.html:
3378         * editing/selection/delete-word-granularity-text-control.html:
3379
3380         Turn on Smart delete for iOS at all times. Modify checks to allow Mac and