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