Change "InvalidStateError" to "NotSupportedError" for attachShadow()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Change "InvalidStateError" to "NotSupportedError" for attachShadow()
4         https://bugs.webkit.org/show_bug.cgi?id=197948
5
6         Reviewed by Wenson Hsieh.
7
8         Match the latest spec. See https://github.com/whatwg/dom/pull/761
9
10         * dom/Element.cpp:
11         (WebCore::Element::attachShadow): Throw NotSupportedError when there is already a shadow tree.
12
13 2019-10-04  Chris Dumez  <cdumez@apple.com>
14
15         Allow pages using EventSource to enter the back/forward cache
16         https://bugs.webkit.org/show_bug.cgi?id=202370
17         <rdar://problem/55853142>
18
19         Reviewed by Geoffrey Garen.
20
21         Allow pages using EventSource to enter the back/forward cache. If the EventSource is
22         connecting at the time it enters PageCache, it will resume connecting after restoring
23         from PageCache (by making m_connectTimer a SuspendableTimer, which is PageCache-aware).
24         If the EventSource is was open upon navigating, it gets closed upon navigating (since
25         all pending loads get cancelled on navigation). To help the page recover, we fire an
26         error event and attempt to reconnect automatically when restoring the page from page
27         cache. It is allowed by the specification to attempt reconnection in case of non-fatal
28         network errors.
29
30         Tests: http/tests/eventsource/eventsource-page-cache-connected.html
31                http/tests/eventsource/eventsource-page-cache-connecting.html
32
33         * page/EventSource.cpp:
34         (WebCore::EventSource::EventSource):
35         (WebCore::EventSource::scheduleReconnect):
36         (WebCore::EventSource::close):
37         (WebCore::EventSource::didReceiveResponse):
38         (WebCore::EventSource::dispatchErrorEvent):
39         (WebCore::EventSource::didReceiveData):
40         (WebCore::EventSource::didFinishLoading):
41         (WebCore::EventSource::didFail):
42         (WebCore::EventSource::abortConnectionAttempt):
43         (WebCore::EventSource::doExplicitLoadCancellation):
44         (WebCore::EventSource::canSuspendForDocumentSuspension const):
45         (WebCore::EventSource::suspend):
46         (WebCore::EventSource::resume):
47         (WebCore::EventSource::dispatchMessageEvent):
48         * page/EventSource.h:
49
50 2019-10-04  Chris Dumez  <cdumez@apple.com>
51
52         ServiceWorkerContainer should never prevent a page from entering the back/forward cache
53         https://bugs.webkit.org/show_bug.cgi?id=202603
54
55         Reviewed by Geoff Garen.
56
57         Make it so that ServiceWorkerContainer can suspend, even if they have pending promises.
58         We now queue all promise resolutions to a SuspendableTaskQueue to make sure that those
59         promises do not get resolved while in the page cache.
60
61         Test: http/tests/workers/service/page-cache-service-worker-pending-promise.https.html
62
63         * workers/service/ServiceWorkerContainer.cpp:
64         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
65         (WebCore::ServiceWorkerContainer::ready):
66         (WebCore::ServiceWorkerContainer::getRegistration):
67         (WebCore::ServiceWorkerContainer::getRegistrations):
68         (WebCore::ServiceWorkerContainer::jobFailedWithException):
69         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
70         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
71         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
72         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
73         * workers/service/ServiceWorkerContainer.h:
74
75 2019-10-04  Chris Dumez  <cdumez@apple.com>
76
77         Allow pages using IDBIndex to enter the PageCache
78         https://bugs.webkit.org/show_bug.cgi?id=202430
79         <rdar://problem/55887918>
80
81         Reviewed by Geoffrey Garen.
82
83         There is no reason to prevent PageCaching when an IDBIndex object is alive.
84         No events are fired by IDBIndex and its API returns IDBRequest objects, which
85         are already PageCache-aware.
86
87         I have seen Yahoo.com failing to enter the back/forward cache because of this.
88
89         No new tests, updated existing test.
90
91         * Modules/indexeddb/IDBIndex.cpp:
92         (WebCore::IDBIndex::canSuspendForDocumentSuspension const):
93
94 2019-10-04  Heiko Becker  <heirecka@exherbo.org>
95
96         Fix build with icu 65.1
97         https://bugs.webkit.org/show_bug.cgi?id=202600
98
99         Reviewed by Konstantin Tokarev.
100
101         * dom/Document.cpp:
102         (WebCore::isValidNameNonASCII):
103         (WebCore::Document::parseQualifiedName):
104
105 2019-10-04  James Darpinian  <jdarpinian@chromium.org>
106
107         Allow using WebGL 2 when USE_ANGLE=1
108         https://bugs.webkit.org/show_bug.cgi?id=202593
109
110         Reviewed by Alex Christensen.
111
112         * html/canvas/WebGLRenderingContextBase.cpp:
113         (WebCore::WebGLRenderingContextBase::create):
114             Disable irrelevant extension check.
115         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
116         (WebCore::GraphicsContext3D::GraphicsContext3D):
117             Use ES3 ANGLE context when WebGL 2 is requested.
118
119 2019-10-04  Alex Christensen  <achristensen@webkit.org>
120
121         Stop sending list of display-isolated schemes to NetworkProcess
122         https://bugs.webkit.org/show_bug.cgi?id=202557
123
124         Reviewed by Youenn Fablet.
125
126         They are only ever used in the WebProcess in SecurityOrigin::canDisplay.
127         If someone adds code that uses them in the NetworkProcess, they will hit my new assertion.
128
129         No change in behavior.
130
131         * page/SecurityOrigin.cpp:
132         (WebCore::SecurityOrigin::canDisplay const):
133         * platform/RuntimeApplicationChecks.h:
134         (WebCore::isInNetworkProcess):
135         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
136         (WebCore::isInNetworkProcess):
137
138 2019-10-04  Alex Christensen  <achristensen@webkit.org>
139
140         Rename SchemeRegistry to LegacySchemeRegistry
141         https://bugs.webkit.org/show_bug.cgi?id=202586
142
143         Reviewed by Tim Horton.
144
145         SchemeRegistry is process-global.  We need to replace it with a non-process-global registry, but Rome wasn't built in a day.
146         This rename allows me to call the replacement object that will have ownership and configuration "SchemeRegistry"
147         and it also indicates that new development should use the owned object instead of the global object.
148
149         * Headers.cmake:
150         * Modules/mediastream/UserMediaController.cpp:
151         (WebCore::isSecure):
152         * Modules/mediastream/UserMediaRequest.cpp:
153         * Modules/webauthn/AuthenticatorCoordinator.cpp:
154         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
155         * Modules/webdatabase/DatabaseContext.cpp:
156         (WebCore::DatabaseContext::allowDatabaseAccess const):
157         * Sources.txt:
158         * WebCore.xcodeproj/project.pbxproj:
159         * dom/Document.cpp:
160         (WebCore::Document::setDomain):
161         * dom/ScriptExecutionContext.cpp:
162         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
163         * html/HTMLPlugInImageElement.cpp:
164         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
165         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
166         * loader/CrossOriginAccessControl.cpp:
167         (WebCore::isValidCrossOriginRedirectionURL):
168         * loader/DocumentLoader.cpp:
169         (WebCore::DocumentLoader::matchRegistration):
170         (WebCore::DocumentLoader::disallowWebArchive const):
171         (WebCore::DocumentLoader::commitData):
172         (WebCore::DocumentLoader::maybeLoadEmpty):
173         * loader/DocumentThreadableLoader.cpp:
174         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
175         (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
176         * loader/archive/mhtml/MHTMLArchive.cpp:
177         (WebCore::MHTMLArchive::create):
178         * loader/cache/CachedResource.cpp:
179         (WebCore::CachedResource::freshnessLifetime const):
180         * page/Page.cpp:
181         (WebCore::Page::userStyleSheetLocationChanged):
182         * page/SecurityOrigin.cpp:
183         (WebCore::shouldTreatAsUniqueOrigin):
184         (WebCore::shouldTreatAsPotentiallyTrustworthy):
185         (WebCore::SecurityOrigin::SecurityOrigin):
186         (WebCore::SecurityOrigin::isSecure):
187         (WebCore::SecurityOrigin::canDisplay const):
188         (WebCore::SecurityOrigin::domainForCachePartition const):
189         * page/csp/ContentSecurityPolicy.cpp:
190         (WebCore::ContentSecurityPolicy::allowObjectFromSource const):
191         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
192         (WebCore::ContentSecurityPolicy::allowResourceFromSource const):
193         (WebCore::ContentSecurityPolicy::allowConnectToSource const):
194         (WebCore::ContentSecurityPolicy::allowBaseURI const):
195         * platform/LegacySchemeRegistry.cpp: Copied from Source/WebCore/platform/SchemeRegistry.cpp.
196         (WebCore::allBuiltinSchemes):
197         (WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal):
198         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal):
199         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
200         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess):
201         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
202         (WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated):
203         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
204         (WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure):
205         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
206         (WebCore::LegacySchemeRegistry::registerURLSchemeAsEmptyDocument):
207         (WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
208         (WebCore::LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme):
209         (WebCore::LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme):
210         (WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
211         (WebCore::LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
212         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):
213         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs):
214         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):
215         (WebCore::LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing):
216         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
217         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
218         (WebCore::LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
219         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
220         (WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
221         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
222         (WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
223         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCachePartitioned):
224         (WebCore::LegacySchemeRegistry::shouldPartitionCacheForURLScheme):
225         (WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
226         (WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme):
227         (WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme):
228         (WebCore::LegacySchemeRegistry::isUserExtensionScheme):
229         (WebCore::LegacySchemeRegistry::isBuiltinScheme):
230         (WebCore::SchemeRegistry::registerURLSchemeAsLocal): Deleted.
231         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Deleted.
232         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Deleted.
233         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Deleted.
234         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Deleted.
235         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Deleted.
236         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Deleted.
237         (WebCore::SchemeRegistry::registerURLSchemeAsSecure): Deleted.
238         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Deleted.
239         (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Deleted.
240         (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Deleted.
241         (WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Deleted.
242         (WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Deleted.
243         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Deleted.
244         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Deleted.
245         (WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Deleted.
246         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Deleted.
247         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Deleted.
248         (WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Deleted.
249         (WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Deleted.
250         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Deleted.
251         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Deleted.
252         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Deleted.
253         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Deleted.
254         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Deleted.
255         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Deleted.
256         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Deleted.
257         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Deleted.
258         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
259         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
260         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
261         (WebCore::SchemeRegistry::isUserExtensionScheme): Deleted.
262         (WebCore::SchemeRegistry::isBuiltinScheme): Deleted.
263         * platform/LegacySchemeRegistry.h: Copied from Source/WebCore/platform/SchemeRegistry.h.
264         * platform/SchemeRegistry.cpp: Removed.
265         * platform/SchemeRegistry.h: Removed.
266         * platform/ios/QuickLook.mm:
267         * storage/Storage.cpp:
268         * testing/Internals.cpp:
269         (WebCore::Internals::registerURLSchemeAsBypassingContentSecurityPolicy):
270         (WebCore::Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
271         * workers/service/ServiceWorkerContainer.cpp:
272         (WebCore::ServiceWorkerContainer::addRegistration):
273         * workers/service/ServiceWorkerProvider.cpp:
274         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
275         * workers/service/server/SWServerJobQueue.cpp:
276         (WebCore::SWServerJobQueue::runRegisterJob):
277
278 2019-10-04  Antoine Quint  <graouts@apple.com>
279
280         Crash in debug build with imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html
281         https://bugs.webkit.org/show_bug.cgi?id=202583
282
283         Reviewed by Dean Jackson.
284
285         Ensure we remove the animation from the timeline it's currently associated with since it may have changed since its creation. This caused
286         a crash because we have an assertion in AnimationTimeline::removeAnimation() to check that the animation belonged to the timeline it's called on.
287
288         * animation/DocumentTimeline.cpp:
289         (WebCore::DocumentTimeline::removeReplacedAnimations):
290
291 2019-10-04  Tim Horton  <timothy_horton@apple.com>
292
293         Clean up some includes to make the build a bit faster: DOMPromise
294         https://bugs.webkit.org/show_bug.cgi?id=202570
295
296         Reviewed by Chris Dumez.
297
298         No new tests, just reorganizing.
299
300         Apply some profile-guided optimizations to our headers.
301
302         Get JSDOMPromiseDeferred.h and DOMPromiseProxy.h out of WebCore headers.
303         One remains (FetchBodyConsumer.h); I leave it as an exercise to the reader.
304         In my testing, this is worth a reliable 5-6% on the WebCore Build Benchmark.
305
306         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
307         * Modules/encryptedmedia/MediaKeySession.cpp:
308         * Modules/encryptedmedia/MediaKeySession.h:
309         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
310         * Modules/encryptedmedia/MediaKeySystemAccess.h:
311         * Modules/encryptedmedia/MediaKeys.cpp:
312         * Modules/encryptedmedia/MediaKeys.h:
313         * Modules/encryptedmedia/NavigatorEME.cpp:
314         * Modules/encryptedmedia/NavigatorEME.h:
315         * Modules/fetch/DOMWindowFetch.cpp:
316         * Modules/fetch/DOMWindowFetch.h:
317         * Modules/fetch/FetchBody.cpp:
318         * Modules/fetch/FetchBody.h:
319         * Modules/fetch/FetchLoader.cpp:
320         * Modules/fetch/FetchLoader.h:
321         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
322         * Modules/fetch/WorkerGlobalScopeFetch.h:
323         * Modules/mediacapabilities/MediaCapabilities.cpp:
324         * Modules/mediacapabilities/MediaCapabilities.h:
325         * Modules/mediastream/MediaDevices.cpp:
326         * Modules/mediastream/MediaDevices.h:
327         * Modules/mediastream/MediaStreamTrack.cpp:
328         * Modules/mediastream/MediaStreamTrack.h:
329         * Modules/mediastream/PeerConnectionBackend.cpp:
330         * Modules/mediastream/PeerConnectionBackend.h:
331         * Modules/mediastream/RTCPeerConnection.cpp:
332         * Modules/mediastream/RTCRtpReceiver.h:
333         * Modules/mediastream/RTCRtpSenderBackend.h:
334         * Modules/mediastream/UserMediaRequest.cpp:
335         * Modules/mediastream/UserMediaRequest.h:
336         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
337         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
338         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
339         * Modules/paymentrequest/PaymentRequest.cpp:
340         * Modules/paymentrequest/PaymentRequest.h:
341         * Modules/paymentrequest/PaymentResponse.cpp:
342         * Modules/paymentrequest/PaymentResponse.h:
343         * Modules/streams/ReadableStreamSource.h:
344         * Modules/webaudio/AudioContext.h:
345         * Modules/webauthn/AuthenticatorCoordinator.cpp:
346         * Modules/webauthn/AuthenticatorCoordinator.h:
347         * Modules/webauthn/PublicKeyCredential.h:
348         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
349         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
350         * Modules/webgpu/WebGPU.cpp:
351         * Modules/webgpu/WebGPU.h:
352         * Modules/webgpu/WebGPUAdapter.cpp:
353         * Modules/webgpu/WebGPUAdapter.h:
354         * Modules/webgpu/WebGPUBuffer.cpp:
355         * Modules/webgpu/WebGPUBuffer.h:
356         * Modules/webgpu/WebGPUDevice.cpp:
357         * Modules/webgpu/WebGPUDevice.h:
358         * Modules/webvr/NavigatorWebVR.cpp:
359         * Modules/webvr/NavigatorWebVR.h:
360         * Modules/webvr/VRDisplay.cpp:
361         * Modules/webvr/VRDisplay.h:
362         * Sources.txt:
363         * WebCore.xcodeproj/project.pbxproj:
364         * animation/KeyframeEffect.cpp:
365         * animation/WebAnimation.cpp:
366         * animation/WebAnimation.h:
367         * bindings/js/CachedModuleScriptLoader.cpp:
368         * bindings/js/CachedModuleScriptLoaderClient.h:
369         * bindings/js/JSDOMPromiseDeferred.h:
370         * bindings/js/JSHTMLTemplateElementCustom.cpp:
371         * bindings/js/JSImageDataCustom.cpp:
372         * bindings/js/JSReadableStreamSourceCustom.cpp:
373         * bindings/js/JSWebAnimationCustom.cpp:
374         * bindings/js/JSWorkerGlobalScopeBase.cpp:
375         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
376         * bindings/js/JSWorkletGlobalScopeBase.cpp:
377         * bindings/js/ScriptModuleLoader.cpp:
378         * css/FontFace.cpp:
379         * css/FontFace.h:
380         * css/FontFaceSet.cpp:
381         * css/FontFaceSet.h:
382         * dom/CustomElementRegistry.cpp:
383         * dom/DeviceOrientationOrMotionEvent.cpp:
384         * dom/DeviceOrientationOrMotionEvent.h:
385         * dom/MouseEvent.cpp:
386         * dom/MouseEvent.h:
387         * html/CustomPaintCanvas.h:
388         * html/ImageBitmap.cpp:
389         * html/ImageBitmap.h:
390         * html/OffscreenCanvas.cpp:
391         * html/OffscreenCanvas.h:
392         * loader/ImageLoader.cpp:
393         * loader/ImageLoader.h:
394         * page/DOMWindow.cpp:
395         * page/Navigator.h:
396         * platform/graphics/CustomPaintImage.cpp:
397         * testing/Internals.cpp:
398         * testing/Internals.h:
399         * testing/ServiceWorkerInternals.h:
400         * testing/ServiceWorkerInternals.mm:
401         * workers/service/ServiceWorkerContainer.cpp:
402         * workers/service/ServiceWorkerContainer.h:
403         * workers/service/ServiceWorkerJob.h:
404         * workers/service/ServiceWorkerRegistration.cpp:
405         * workers/service/ServiceWorkerRegistration.h:
406         * worklets/PaintWorkletGlobalScope.cpp:
407
408 2019-10-04  Sihui Liu  <sihui_liu@apple.com>
409
410         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a Flaky Failure
411         https://bugs.webkit.org/show_bug.cgi?id=201481
412         <rdar://problem/55046055>
413
414         Reviewed by Alex Christensen.
415
416         We should not schedule timer if we know the timer function will be no-op.
417
418         * Modules/indexeddb/IDBTransaction.cpp:
419         (WebCore::IDBTransaction::removeRequest):
420         (WebCore::IDBTransaction::scheduleOperation):
421         (WebCore::IDBTransaction::trySchedulePendingOperationTimer):
422         (WebCore::IDBTransaction::pendingOperationTimerFired):
423         (WebCore::IDBTransaction::didStart):
424         (WebCore::IDBTransaction::operationCompletedOnClient):
425         (WebCore::IDBTransaction::deactivate):
426         (WebCore::IDBTransaction::schedulePendingOperationTimer): Deleted.
427         * Modules/indexeddb/IDBTransaction.h:
428
429 2019-10-04  Chris Dumez  <cdumez@apple.com>
430
431         Unreviewed follow-up fix for r250693 to address assertion hits in debug.
432
433         * css/FontFaceSet.cpp:
434         (WebCore::FontFaceSet::didFirstLayout):
435         (WebCore::FontFaceSet::completedLoading):
436         Make sure the ready promise is not already resolved before resolving it.
437
438         * platform/SuspendableTaskQueue.cpp:
439         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
440         * platform/SuspendableTaskQueue.h:
441         (WebCore::SuspendableTaskQueue::create):
442         Add a new constructor that takes in a Document since the ActiveDOMObject's
443         constructor taking a Document has some useful logic.
444
445 2019-10-04  Joonghun Park  <jh718.park@samsung.com>
446
447         Negative radii in radial gradients should be rejected.
448         https://bugs.webkit.org/show_bug.cgi?id=202412
449
450         Per the spec, https://drafts.csswg.org/css-images-3/#radial-gradients
451         "Negative values are invalid.",
452         we reject negative radii values in radial-gradient.
453
454         This patch rejects negative radii during radial-gradient parsing
455         for both webkit prefixed and non-prefixed ones.
456
457         Reviewed by Antti Koivisto.
458
459         Tests: imported/blink/css-parser/webkit-gradient.html
460                imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii.html
461                imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html
462
463         * css/parser/CSSPropertyParserHelpers.cpp:
464         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
465         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
466         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
467
468 2019-10-04  Alex Christensen  <achristensen@webkit.org>
469
470         Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration
471         https://bugs.webkit.org/show_bug.cgi?id=202553
472
473         Reviewed by Youenn Fablet.
474
475         * workers/service/server/SWServer.cpp:
476         (WebCore::SWServer::SWServer):
477         * workers/service/server/SWServer.h:
478         (WebCore::SWServer::registeredSchemes const):
479         * workers/service/server/SWServerJobQueue.cpp:
480         (WebCore::SWServerJobQueue::runRegisterJob):
481
482 2019-10-04  youenn fablet  <youenn@apple.com>
483
484         AbortSignal does not always emit the abort signal
485         https://bugs.webkit.org/show_bug.cgi?id=201871
486         <rdar://problem/55451712>
487
488         Reviewed by Chris Dumez.
489
490         Make sure a JSAbortSignal is not GCed until objects that can abort it are gone.
491         This includes a followed signal and an AbortController.
492         Current WebKit implementation only uses following of one signal at a time.
493
494         Test: http/tests/fetch/abort-signal-gc.html
495
496         * Sources.txt:
497         * WebCore.xcodeproj/project.pbxproj:
498         * bindings/js/JSAbortControllerCustom.cpp: Added.
499         (WebCore::JSAbortController::visitAdditionalChildren):
500         * bindings/js/JSAbortSignalCustom.cpp: Added.
501         (WebCore::JSAbortSignalOwner::isReachableFromOpaqueRoots):
502         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
503         * dom/AbortController.idl:
504         * dom/AbortSignal.cpp:
505         (WebCore::AbortSignal::follow):
506         * dom/AbortSignal.h:
507         * dom/AbortSignal.idl:
508
509 2019-10-04  youenn fablet  <youenn@apple.com>
510
511         Allow to suspend RTCPeerConnection when not connected
512         https://bugs.webkit.org/show_bug.cgi?id=202403
513
514         Reviewed by Chris Dumez.
515
516         Implement suspend/resume in RTCPeerConnection by sending suspend/resume to the libwebrtc media endpoint,
517         which suspends/resumes its socket factory.
518
519         We allow suspension when the connection is not connected.
520         Pages with connected connections will not go in page cache yet.
521
522         Tests: webrtc/datachannel/datachannel-page-cache-send.html
523                webrtc/datachannel/datachannel-page-cache.html
524
525         * Modules/mediastream/PeerConnectionBackend.h:
526         (WebCore::PeerConnectionBackend::suspend):
527         (WebCore::PeerConnectionBackend::resume):
528         * Modules/mediastream/RTCPeerConnection.cpp:
529         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
530         (WebCore::RTCPeerConnection::suspend):
531         (WebCore::RTCPeerConnection::resume):
532         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
533         (WebCore::LibWebRTCMediaEndpoint::suspend):
534         (WebCore::LibWebRTCMediaEndpoint::resume):
535         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
536         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
537         (WebCore::LibWebRTCPeerConnectionBackend::suspend):
538         (WebCore::LibWebRTCPeerConnectionBackend::resume):
539         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
540         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
541
542 2019-10-04  Truitt Savell  <tsavell@apple.com>
543
544         Unreviewed, rolling out r250583.
545
546         Broke multiple internal API tests
547
548         Reverted changeset:
549
550         "[JSC] Place VM* in TLS"
551         https://bugs.webkit.org/show_bug.cgi?id=202391
552         https://trac.webkit.org/changeset/250583
553
554 2019-10-04  Alex Christensen  <achristensen@webkit.org>
555
556         Simplify sandbox enabling macros
557         https://bugs.webkit.org/show_bug.cgi?id=202536
558
559         Reviewed by Brent Fulgham.
560
561         * Configurations/FeatureDefines.xcconfig:
562
563 2019-10-04  Chris Lord  <clord@igalia.com>
564
565         ImageBitmap should be serializable
566         https://bugs.webkit.org/show_bug.cgi?id=202394
567
568         Reviewed by Žan Doberšek.
569
570         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable.html
571
572         * bindings/js/SerializedScriptValue.cpp:
573         (WebCore::CloneSerializer::dumpImageBitmap):
574         (WebCore::CloneDeserializer::readTransferredImageBitmap):
575         (WebCore::CloneDeserializer::readImageBitmap):
576         (WebCore::CloneDeserializer::readTerminal):
577
578 2019-10-03  Antoine Quint  <graouts@apple.com>
579
580         AppleTV named as XSS-payloads trigger when AirPlay is used
581         https://bugs.webkit.org/show_bug.cgi?id=202534
582         <rdar://55931262>
583
584         Reviewed by Eric Carlson.
585
586         Ensure we escape an AirPlay's device name before inserting its name into the DOM.
587
588         * Modules/modern-media-controls/media/placard-support.js:
589         (PlacardSupport.prototype._updateAirPlayPlacard):
590         (PlacardSupport):
591         (escapeHTML):
592
593 2019-10-04  Oriol Brufau  <obrufau@igalia.com>
594
595         [css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
596         https://bugs.webkit.org/show_bug.cgi?id=202258
597
598         Reviewed by Javier Fernandez.
599
600         Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
601                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
602                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
603                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
604
605         Usually, the resolved value of grid-template-rows/columns is the used
606         value, expanding the repeat() notation. But for elements with a non-grid
607         display, the resolved value is just the computed value, with repeat(),
608         since the used value doesn't exist.
609         Before this patch, the repeat() was dropped, and line names after it
610         appeared at the wrong position or were also dropped. There was also an
611         assert failure in debug. This patch fixes the serialization for auto
612         repeat(). Integer repeat() is still expanded at computed-value time, so
613         it's not preserved in getComputedStyle().
614
615         * css/CSSComputedStyleDeclaration.cpp:
616         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
617         (WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat):
618         (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
619         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const):
620         (WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const):
621         (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
622         (WebCore::populateGridTrackList):
623         (WebCore::valueForGridTrackList):
624
625 2019-10-04  Antti Koivisto  <antti@apple.com>
626
627         [CSS Shadow Parts] Support 'exportparts' attribute
628         https://bugs.webkit.org/show_bug.cgi?id=202520
629
630         Reviewed by Ryosuke Niwa.
631
632         Support 'exportparts' attribute for exporting part mappings from subcomponents.
633
634         * css/ElementRuleCollector.cpp:
635         (WebCore::ElementRuleCollector::matchAuthorRules):
636         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
637
638         Recurse to containing scopes to collect part rules if there are exported mappings.
639
640         (WebCore::ElementRuleCollector::ruleMatches):
641         * css/ElementRuleCollector.h:
642         * css/SelectorChecker.cpp:
643         (WebCore::SelectorChecker::matchRecursively const):
644
645         Make ShadowDescendant fake combinator skip directly to the scope where the part rules are coming from.
646
647         (WebCore::SelectorChecker::checkOne const):
648
649         Resolve names via mappings if needed.
650
651         * css/SelectorChecker.h:
652         * dom/Element.cpp:
653         (WebCore::Element::attributeChanged):
654
655         Invalidate mappings as needed.
656
657         * dom/ShadowRoot.cpp:
658         (WebCore::parsePartMappings):
659
660         Parse the mappings microsyntax.
661
662         (WebCore::ShadowRoot::partMappings const):
663         (WebCore::ShadowRoot::invalidatePartMappings):
664         * dom/ShadowRoot.h:
665         * html/HTMLAttributeNames.in:
666
667 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
668
669         A newly inserted element doesn't get assigned to a named slot if slot assignments had already happened
670         https://bugs.webkit.org/show_bug.cgi?id=199733
671
672         Reviewed by Antti Koivisto.
673
674         The bug was caused by addSlotElementByName not invalidating slot assignments when a new slot element
675         is inserted after corresponding elements with the slot content attribute had already been inserted.
676
677         Fixed the bug by always invalidating the slot assignment when a new slot element is inserted.
678
679         Tests: fast/shadow-dom/add-slotted-element-after-assignment-1.html
680                fast/shadow-dom/add-slotted-element-after-assignment-2.html
681                fast/shadow-dom/add-slotted-element-after-assignment-3.html
682
683         * dom/SlotAssignment.cpp:
684         (WebCore::SlotAssignment::addSlotElementByName):
685
686 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
687
688         Radio button groups are not scoped by shadow boundaries
689         https://bugs.webkit.org/show_bug.cgi?id=199568
690
691         Reviewed by Antti Koivisto.
692
693         Fixed the bug that radio button groups are not scoped to each shadow tree by moving
694         RadioButtonGroups from FormController, which is a per-document object, to TreeScope.
695
696         Test: imported/w3c/web-platform-tests/shadow-dom/input-type-radio.html
697
698         * dom/RadioButtonGroups.h:
699         (WebCore::RadioButtonGroups): Made this bmalloc'ed now that it's allocated standalone.
700         * dom/TreeScope.cpp:
701         (WebCore::TreeScope::radioButtonGroups): Added.
702         * dom/TreeScope.h:
703         * html/FormController.h:
704         (WebCore::FormController::radioButtonGroups): Deleted.
705         * html/HTMLInputElement.cpp:
706         (WebCore::HTMLInputElement::~HTMLInputElement):
707         (WebCore::HTMLInputElement::removedFromAncestor): Update the radio button group here.
708         (WebCore::HTMLInputElement::didMoveToNewDocument): Removed the code to update radio
709         button group here since it's done in removedFromAncestor now. Note that insertion case
710         is alrady taken care of by HTMLInputElement::didFinishInsertingNode.
711         (WebCore::HTMLInputElement::radioButtonGroups const): Ditto.
712
713 2019-10-03  Antti Koivisto  <antti@apple.com>
714
715         [CSS Shadow Parts] Correct interaction with other pseudo elements
716         https://bugs.webkit.org/show_bug.cgi?id=202526
717
718         Reviewed by Ryosuke Niwa.
719
720         Cases like foo::part(bar)::before should work.
721
722         This patch doesn't cover ::placeholder which is implemented as PseudoElementWebKitCustom (like internal -webkit-* properties).
723
724         * css/CSSSelector.h:
725         (WebCore::isTreeStructuralPseudoClass):
726
727         Add a helper.
728
729         * css/parser/CSSSelectorParser.cpp:
730
731         Allow non-structural pseudo classes after ::part().
732         Allow other pseudo elements after ::part().
733
734         (WebCore::CSSSelectorParser::consumePseudo):
735
736         No need for DisallowPseudoElementsScope, we are just parsing identifiers.
737
738 2019-10-03  James Darpinian  <jdarpinian@chromium.org>
739
740         Fix WebGL 1 conformance regressions when USE_ANGLE=1
741         https://bugs.webkit.org/show_bug.cgi?id=202545
742
743         Prevent ANGLE from automatically using ES3 when ES2 is requested.
744
745         WEBGL_debug_shaders extension should not accept or return null.
746
747         Enable ANGLE's new support for emulating RGB on RGBA IOSurfaces.
748
749         Reviewed by Alex Christensen.
750
751         * html/canvas/WebGLDebugShaders.cpp:
752         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
753         * html/canvas/WebGLDebugShaders.h:
754         * html/canvas/WebGLDebugShaders.idl:
755         * html/canvas/WebGLRenderingContextBase.cpp:
756         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
757         * platform/graphics/angle/Extensions3DANGLE.cpp:
758         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
759         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
760         (WebCore::GraphicsContext3D::GraphicsContext3D):
761         * platform/graphics/cocoa/WebGLLayer.mm:
762         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
763
764 2019-10-03  Jer Noble  <jer.noble@apple.com>
765
766     [iOS] WebContent process can be interrupted during suspension; loses "Now Playing" status
767     https://bugs.webkit.org/show_bug.cgi?id=202537
768     <rdar://problem/55952707>
769
770     Reviewed by Eric Carlson.
771
772     Always deactivate the AVAudioSession when the last playing PlatformAudioSession ends playback and the application is in the background.
773
774     * platform/audio/PlatformMediaSessionManager.cpp:
775     (WebCore::PlatformMediaSessionManager::removeSession):
776     (WebCore::PlatformMediaSessionManager::processWillSuspend):
777     (WebCore::PlatformMediaSessionManager::maybeDeactivateAudioSession):
778     * platform/audio/PlatformMediaSessionManager.h:
779     (WebCore::PlatformMediaSessionManager::isApplicationInBackground const):
780     * platform/audio/ios/MediaSessionManagerIOS.h:
781     * platform/audio/ios/MediaSessionManagerIOS.mm:
782     (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
783
784 2019-10-03  Chris Dumez  <cdumez@apple.com>
785
786         Allow pages using FontFaceSet to enter the back/forward cache
787         https://bugs.webkit.org/show_bug.cgi?id=202476
788
789         Reviewed by Myles C. Maxfield.
790
791         Allow pages using FontFaceSet to enter the back/forward cache by updating its
792         implementation to queue all its tasks that run script to a SuspendableTaskQueue.
793         The SuspendableTaskQueue makes sure to properly suspend while in PageCache and
794         run the tasks when resuming from PageCache.
795
796         Test: http/tests/navigation/page-cache-fontfaceset.html
797
798         * PlatformWin.cmake:
799         * Sources.txt:
800         * WebCore.xcodeproj/project.pbxproj:
801         * css/CSSFontFace.cpp:
802         (WebCore::CSSFontFace::fontLoadEventOccurred):
803         * css/FontFaceSet.cpp:
804         (WebCore::FontFaceSet::FontFaceSet):
805         (WebCore::FontFaceSet::canSuspendForDocumentSuspension const):
806         (WebCore::FontFaceSet::didFirstLayout):
807         (WebCore::FontFaceSet::completedLoading):
808         (WebCore::FontFaceSet::faceFinished):
809         * css/FontFaceSet.h:
810
811         * platform/SuspendableTaskQueue.cpp: Added.
812         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
813         (WebCore::SuspendableTaskQueue::close):
814         (WebCore::SuspendableTaskQueue::cancelAllTasks):
815         (WebCore::SuspendableTaskQueue::enqueueTask):
816         (WebCore::SuspendableTaskQueue::runOneTask):
817         (WebCore::SuspendableTaskQueue::activeDOMObjectName const):
818         (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const):
819         (WebCore::SuspendableTaskQueue::stop):
820         (WebCore::SuspendableTaskQueue::suspend):
821         (WebCore::SuspendableTaskQueue::resume):
822         * platform/SuspendableTaskQueue.h: Added.
823         (WebCore::SuspendableTaskQueue::create):
824         (WebCore::SuspendableTaskQueue::isClosed const):
825         (WebCore::SuspendableTaskQueue::hasPendingTasks const):
826         Add a SuspendableTaskQueue class which is Page-Cache aware and can be used to queue
827         generic tasks as WTF::Function<void<>> lambdas.
828
829 2019-10-03  Chris Dumez  <cdumez@apple.com>
830
831         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache
832         https://bugs.webkit.org/show_bug.cgi?id=202474
833
834         Reviewed by Alex Christensen.
835
836         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache.
837         To address the issue, we now make sure to stop all loads before checking for PageCache eligibility.
838
839         Test: fast/history/page-cache-quick-redirect-iframe.html
840
841         * history/PageCache.cpp:
842         (WebCore::PageCache::addIfCacheable):
843         * loader/FrameLoader.cpp:
844         (WebCore::FrameLoader::stopForPageCache):
845         * loader/FrameLoader.h:
846
847 2019-10-03  Chris Dumez  <cdumez@apple.com>
848
849         XMLHttpRequest sometimes prevents pages from entering the back/forward cache
850         https://bugs.webkit.org/show_bug.cgi?id=202434
851         <rdar://problem/55890340>
852
853         Reviewed by Geoffrey Garen.
854
855         XMLHttpRequest::canSuspendForDocumentSuspension() was returning false if the document has not fired
856         the window's load event, with a comment explaining that cancelling the XHR in the upon suspension
857         may cause the load event to get fired and thus run script when forbidden. However, we should only
858         return false if the XMLHttpRequest is actually loading (m_loader is not null). XHRs that are not
859         loading should never prevent page caching.
860
861         I saw failures to enter the back/forward cache on yandex.ru and taobao.com because of this.
862
863         Test: http/tests/navigation/page-cache-failed-xhr.html
864
865         * xml/XMLHttpRequest.cpp:
866         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const):
867
868 2019-10-03  John Wilander  <wilander@apple.com>
869
870         Resource Load Statistics: Downgrade document.referrer for all third-party iframes
871         https://bugs.webkit.org/show_bug.cgi?id=202506
872         <rdar://problem/55786397>
873
874         Reviewed by Brent Fulgham.
875
876         This change downgrades document.referrer for all third-party iframes if ITP/Resource Load Statistics
877         is enabled. The behavior matches the downgrade of all HTTP referrers for third-party resources
878         which landed in https://trac.webkit.org/changeset/250413/webkit.
879
880         Tests: http/tests/resourceLoadStatistics/downgrade-document-referrer-nested-third-party-iframe.html
881                http/tests/resourceLoadStatistics/downgrade-document-referrer-third-party-iframe.html
882                http/tests/resourceLoadStatistics/leave-empty-document-referrer-alone-third-party-iframe.html
883
884         * dom/Document.cpp:
885         (WebCore::Document::referrer):
886         (WebCore::Document::referrer const): Deleted.
887             Can no longer be const since it lazily downgrades and saves the referrer on read.
888         * dom/Document.h:
889
890 2019-10-03  Devin Rousso  <drousso@apple.com>
891
892         Web Inspector: remove `InspectorInstrumentationCookie`
893         https://bugs.webkit.org/show_bug.cgi?id=202487
894
895         Reviewed by Matt Baker.
896
897         All it does is create a shallow-copy of the `InstrumentingAgents` (it copies a pointer to
898         the `InstrumentingAgents` object, so any of the pointers to the `InspectorAgent` that are
899         contained therein are shared between each instance) and save the tracking
900         `InspectorTimelineAgent`'s id (monotonically increasing integer).
901
902         All uses of `InspectorInstrumentationCookie` are local values, so there's no way that the
903         `InspectorTimelineAgent` (or the id) could change in between an
904         `InspectorInstrumentation::will*` and an `InspectorInstrumentation::did*`, as both the
905         tracking state and id are controlled by the frontend and cannot "interrupt".
906
907         Removing `InspectorInstrumentationCookie` _can_ cause issues is in situations where the
908         `ScriptExecutionContext` (or `Page`) changes between the `InspectorInstrumentation::will*`
909         and the `InspectorInstrumentation::did*`, but this can be avoided so long as a pointer to
910         the "context" used for `InspectorInstrumentation::will*` is saved.
911
912         Covered by existing tests: inspector/timeline/*
913
914         * inspector/InspectorInstrumentationCookie.h: Removed.
915         * inspector/InspectorInstrumentationCookie.cpp: Removed.
916
917         * inspector/agents/InspectorTimelineAgent.h:
918         * inspector/agents/InspectorTimelineAgent.cpp:
919         (WebCore::InspectorTimelineAgent::internalStop):
920         (WebCore::InspectorTimelineAgent::didDispatchEvent):
921         (WebCore::InspectorTimelineAgent::didPaint):
922         (WebCore::InspectorTimelineAgent::clearRecordStack): Deleted.
923
924         * bindings/js/JSCallbackData.cpp:
925         (WebCore::JSCallbackData::invokeCallback):
926         * bindings/js/JSCustomElementInterface.cpp:
927         (WebCore::constructCustomElementSynchronously):
928         (WebCore::JSCustomElementInterface::upgradeElement):
929         (WebCore::JSCustomElementInterface::invokeCallback):
930         * bindings/js/JSErrorHandler.cpp:
931         (WebCore::JSErrorHandler::handleEvent):
932         * bindings/js/JSEventListener.cpp:
933         (WebCore::JSEventListener::handleEvent):
934         * bindings/js/JSExecState.h:
935         * bindings/js/JSExecStateInstrumentation.h:
936         (WebCore::JSExecState::instrumentFunctionInternal):
937         (WebCore::JSExecState::instrumentFunctionCall):
938         (WebCore::JSExecState::instrumentFunctionConstruct):
939         * bindings/js/ScheduledAction.cpp:
940         (WebCore::ScheduledAction::executeFunctionInContext):
941         * bindings/js/ScriptController.cpp:
942         (WebCore::ScriptController::evaluateInWorld):
943         (WebCore::ScriptController::evaluateModule):
944         * dom/Document.cpp:
945         (WebCore::Document::resolveStyle):
946         * dom/EventTarget.cpp:
947         (WebCore::EventTarget::innerInvokeEventListeners):
948         * dom/MutationObserver.cpp:
949         (WebCore::MutationObserver::deliver):
950         * dom/ScriptedAnimationController.cpp:
951         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
952         * page/DOMTimer.cpp:
953         (WebCore::DOMTimer::fired):
954         * page/DOMWindow.cpp:
955         (WebCore::DOMWindow::dispatchEvent):
956         * page/FrameViewLayoutContext.cpp:
957         (WebCore::FrameViewLayoutContext::layout):
958         * page/IntersectionObserver.cpp:
959         (WebCore::IntersectionObserver::notify):
960         * page/PerformanceObserver.cpp:
961         (WebCore::PerformanceObserver::deliver):
962
963         * inspector/InspectorInstrumentation.h:
964         (WebCore::InspectorInstrumentation::willCallFunction):
965         (WebCore::InspectorInstrumentation::didCallFunction):
966         (WebCore::InspectorInstrumentation::willDispatchEvent):
967         (WebCore::InspectorInstrumentation::didDispatchEvent):
968         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
969         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
970         (WebCore::InspectorInstrumentation::willEvaluateScript):
971         (WebCore::InspectorInstrumentation::didEvaluateScript):
972         (WebCore::InspectorInstrumentation::willFireTimer):
973         (WebCore::InspectorInstrumentation::didFireTimer):
974         (WebCore::InspectorInstrumentation::willLayout):
975         (WebCore::InspectorInstrumentation::didLayout):
976         (WebCore::InspectorInstrumentation::willRecalculateStyle):
977         (WebCore::InspectorInstrumentation::didRecalculateStyle):
978         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
979         (WebCore::InspectorInstrumentation::didFireAnimationFrame):
980         (WebCore::InspectorInstrumentation::willFireObserverCallback):
981         (WebCore::InspectorInstrumentation::didFireObserverCallback):
982         * inspector/InspectorInstrumentation.cpp:
983         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
984         (WebCore::InspectorInstrumentation::didCallFunctionImpl):
985         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
986         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
987         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
988         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
989         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
990         (WebCore::InspectorInstrumentation::didEvaluateScriptImpl):
991         (WebCore::InspectorInstrumentation::willFireTimerImpl):
992         (WebCore::InspectorInstrumentation::didFireTimerImpl):
993         (WebCore::InspectorInstrumentation::willLayoutImpl):
994         (WebCore::InspectorInstrumentation::didLayoutImpl):
995         (WebCore::InspectorInstrumentation::willRecalculateStyleImpl):
996         (WebCore::InspectorInstrumentation::didRecalculateStyleImpl):
997         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
998         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
999         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
1000         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
1001         (WebCore::InspectorInstrumentation::retrieveTimelineAgent): Deleted.
1002
1003         * Sources.txt:
1004         * WebCore.xcodeproj/project.pbxproj:
1005
1006 2019-10-03  Sihui Liu  <sihui_liu@apple.com>
1007
1008         IndexedDB: add size estimate for key path when estimate task size
1009         https://bugs.webkit.org/show_bug.cgi?id=202480
1010
1011         Reviewed by Geoffrey Garen.
1012
1013         No observable behavior change.
1014
1015         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1016         (WebCore::IDBServer::estimateSize):
1017
1018 2019-10-03  youenn fablet  <youenn@apple.com>
1019
1020         Regression: iOS 13.1 MediaStreamTrack.enabled = false kills audio track
1021         https://bugs.webkit.org/show_bug.cgi?id=202405
1022         <rdar://problem/55922616>
1023
1024         Reviewed by Eric Carlson.
1025
1026         When the web page is setting enabled to false, media session might change from PlayRecord to None.
1027         This might trigger CoreAudio to no longer output audio samples, thus triggering our audio capture failure timer.
1028         This would end the track after 2 seconds.
1029         Given audio tracks can be reenabled by a web page, we should not change the Media Session setup based on that.
1030         This patch updates MediaStream::mediaType to return independently of the enabled state.
1031
1032         Add internals API to write a cross platform test.
1033
1034         Test: fast/mediastream/audio-track-enabled.html
1035         Manually tested as well.
1036
1037         * Modules/mediastream/MediaStream.cpp:
1038         (WebCore::MediaStream::mediaType const):
1039         * platform/mediastream/MediaStreamPrivate.cpp:
1040         (WebCore::MediaStreamPrivate::hasCaptureAudioSource const):
1041         * testing/Internals.cpp:
1042         (WebCore::Internals::supportsAudioSession const):
1043         (WebCore::Internals::audioSessionCategory const):
1044         * testing/Internals.h:
1045         * testing/Internals.idl:
1046
1047 2019-10-03  youenn fablet  <youenn@apple.com>
1048
1049         http/tests/security/navigate-when-restoring-cached-page.html should not use RTCPeerConnection to not enter in page cache
1050         https://bugs.webkit.org/show_bug.cgi?id=202521
1051
1052         Reviewed by Chris Dumez.
1053
1054         Introduce a dummy ActiveDOMObject which can never be suspended for document suspension.
1055         Allow a page to create this dummy ActiveDOMObject through internals.
1056         Covered by updated test.
1057
1058         * dom/ActiveDOMObject.h:
1059         * testing/Internals.cpp:
1060         (WebCore::Internals::preventDocumentForEnteringPageCache):
1061         * testing/Internals.h:
1062         * testing/Internals.idl:
1063
1064 2019-10-03  Tim Horton  <timothy_horton@apple.com>
1065
1066         WebKit doesn't build with trunk clang
1067         https://bugs.webkit.org/show_bug.cgi?id=202511
1068
1069         Reviewed by Anders Carlsson.
1070
1071         * Modules/fetch/FetchLoader.h:
1072         * Modules/geolocation/Geolocation.h:
1073         * Modules/indexeddb/IDBTransaction.h:
1074         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1075         * Modules/indexeddb/shared/InProcessIDBServer.h:
1076         * Modules/notifications/Notification.cpp:
1077         * Modules/notifications/Notification.h:
1078         * platform/graphics/ca/TileController.h:
1079         * workers/service/context/ServiceWorkerThreadProxy.h:
1080         Fix the build by exporting destructors and custom delete operators.
1081         I don't know why this changed, but trunk clang insists.
1082         There are also some new warnings; this only fixes the hard errors.
1083
1084 2019-10-03  Tim Horton  <timothy_horton@apple.com>
1085
1086         Yet another build fix
1087
1088         * css/typedom/TypedOMCSSImageValue.h:
1089         Forward declare Document.
1090
1091 2019-10-03  Jiewen Tan  <jiewen_tan@apple.com>
1092
1093         Support googleLegacyAppidSupport extension
1094         https://bugs.webkit.org/show_bug.cgi?id=202427
1095         <rdar://problem/55887473>
1096
1097         Reviewed by Brent Fulgham.
1098
1099         This patch adds support for googleLegacyAppidSupport extension, when set:
1100         1) user agent should only use the U2F transport protocol,
1101         2) should only communicate with roaming authenticators, and
1102         3) should use a hard-coded appID of https://www.gstatic.com/securitykey/origins.json.
1103         To be noticed as the name implies, this extension is exclusively for RP ID = google.com.
1104
1105         Implementation wise, all operations are captured in methods with name processGoogleLegacyAppIdSupportExtension.
1106         1) AuthenticatorCoordinator takes care of setting the value.
1107         2) U2fCommandConstructor takes care of hard coding the AppID.
1108         3) AuthenticatorManager takes care of removing AuthenticatorTransport::Internal from TransportSet, so startDiscovery
1109         will not poke platform authenticators.
1110         4) CtapAuthenticator takes care of downgrading to U2fAuthenticator.
1111         5) U2fAuthenticator takes care of setting the AppID in the response.
1112
1113         Partially covered by new test cases in existing tests, and remaining will be covered by manual tests.
1114
1115         * Modules/webauthn/AuthenticationExtensionsClientInputs.h:
1116         (WebCore::AuthenticationExtensionsClientInputs::encode const):
1117         (WebCore::AuthenticationExtensionsClientInputs::decode):
1118         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl:
1119         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1120         (WebCore::AuthenticatorCoordinatorInternal::processGoogleLegacyAppIdSupportExtension):
1121         (WebCore::AuthenticatorCoordinator::create const):
1122         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1123         (WebCore::PublicKeyCredentialCreationOptions::encode const):
1124         (WebCore::PublicKeyCredentialCreationOptions::decode):
1125         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
1126         (fido::convertToU2fRegisterCommand):
1127         (fido::processGoogleLegacyAppIdSupportExtension):
1128         * Modules/webauthn/fido/U2fCommandConstructor.h:
1129
1130 2019-10-03  Yury Semikhatsky  <yurys@chromium.org>
1131
1132         Web Inspector: tests under LayoutTests/inspector/debugger are flaky
1133         https://bugs.webkit.org/show_bug.cgi?id=137131
1134         <rdar://problem/18461335>
1135
1136         Reviewed by Devin Rousso.
1137
1138         Fix debugger tests on GTK. All tests that pause on breakpoint didn't work because
1139         in layout tests InspectorFrontendClientLocal was using Timer to dispatch commands
1140         sent from the local front-end page to the inspected one. When paused inside a script
1141         triggered by the front-end nested timer event would be scheduled but never fired
1142         because in glib implementation of RunLoop::TimerBase uses event source which doesn't
1143         allow recursion (g_source_set_can_recurse is not called on the source), so dispatching
1144         Debugger.resume command didn't work when paused inside another inspector command (e.g.
1145         eval). RunLoop itself uses event source which does allow recursion. So instead of using
1146         a timer for asynchronous command dispatching with delay=0 we now schedule a task in
1147         RunLoop's queue.
1148
1149         * inspector/InspectorFrontendClientLocal.cpp:
1150         (WebCore::InspectorBackendDispatchTask::dispatch):
1151         (WebCore::InspectorBackendDispatchTask::reset):
1152         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
1153         (WebCore::InspectorBackendDispatchTask::scheduleOneShot): ensures that there is one inspector
1154         dispatch task in the queue.
1155         (WebCore::InspectorBackendDispatchTask::dispatchOneMessage): this is mostly the same behavior
1156         as was with timerFired, we should be able to dispatch all accumulated messages from the queue
1157         in one batch but for now I'd like to keep it one per iteration.
1158
1159 2019-10-03  Joonghun Park  <pjh0718@gmail.com>
1160
1161         CSS ellipse() doesn't accept single <shape-radius>
1162         https://bugs.webkit.org/show_bug.cgi?id=181745
1163
1164         CSS ellipse() should only accept 0 or 2 radii.
1165         The corresponding csswg discussion is
1166         https://github.com/w3c/csswg-drafts/issues/2175.
1167
1168         Reviewed by Antti Koivisto.
1169
1170         Tests: imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed.html
1171                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-invalid.html
1172                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid.html
1173                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-computed.html
1174                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-invalid.html
1175                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-valid.html
1176
1177         * css/CSSBasicShapes.cpp:
1178         (WebCore::CSSBasicShapeEllipse::cssText const):
1179         * css/parser/CSSPropertyParser.cpp:
1180         (WebCore::consumeBasicShapeEllipse):
1181
1182 2019-10-03  Zan Dobersek  <zdobersek@igalia.com>
1183
1184         [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling
1185         https://bugs.webkit.org/show_bug.cgi?id=202509
1186
1187         Reviewed by Carlos Garcia Campos.
1188
1189         Add build guards that would enable runtime checks of the asynchronous
1190         frame scrolling setting in the ScrollingCoordinator and
1191         RenderLayerCompositor classes for the Nicosia-using ports.
1192
1193         The check in ScrollingCoordinator avoids bailing on coordinating
1194         scrolling for non-main frames when the setting is enabled. The check in
1195         RenderLayerCompositor avoids imposing a requirement for a composition
1196         layer for any non-main frame when the setting is disabled.
1197
1198         * page/scrolling/ScrollingCoordinator.cpp:
1199         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
1200         * rendering/RenderLayerCompositor.cpp:
1201         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
1202
1203 2019-10-02  Antti Koivisto  <antti@apple.com>
1204
1205         [CSS Shadow Parts] Support multiple arguments for ::part()
1206         https://bugs.webkit.org/show_bug.cgi?id=202482
1207
1208         Reviewed by Ryosuke Niwa.
1209
1210         Support ::part(foo bar).
1211
1212         * css/CSSSelector.cpp:
1213         (WebCore::CSSSelector::selectorText const):
1214         (WebCore::CSSSelector::setArgumentList):
1215         (WebCore::CSSSelector::setLangArgumentList): Deleted.
1216
1217         Give this a more generic name and use it for ::part() too.
1218
1219         * css/CSSSelector.h:
1220         (WebCore::CSSSelector::argumentList const):
1221         (WebCore::CSSSelector::langArgumentList const): Deleted.
1222         * css/SelectorChecker.cpp:
1223         (WebCore::SelectorChecker::checkOne const):
1224
1225         Match only if all parts are found from the element 'part' attribute.
1226
1227         * css/parser/CSSParserSelector.cpp:
1228         (WebCore::CSSParserSelector::setArgumentList):
1229         (WebCore::CSSParserSelector::setLangArgumentList): Deleted.
1230         * css/parser/CSSParserSelector.h:
1231         * css/parser/CSSSelectorParser.cpp:
1232         (WebCore::CSSSelectorParser::consumePseudo):
1233
1234         Parse the list.
1235
1236         * cssjit/SelectorCompiler.cpp:
1237         (WebCore::SelectorCompiler::addPseudoClassType):
1238
1239 2019-10-02  Andy Estes  <aestes@apple.com>
1240
1241         [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable
1242         https://bugs.webkit.org/show_bug.cgi?id=202498
1243         <rdar://problem/54723131>
1244
1245         Reviewed by Tim Horton.
1246
1247         When the user selects a context menu action, WebKit performs a hit test in order to find the
1248         acted-on element on the page. This is separate from the hit test performed to generate the
1249         context menu's targeted preview. Since an arbitrary amount of time can elapse between
1250         preview generation and action selection, this second hit-tests might return a different
1251         element.
1252
1253         One case where we know a different element can be returned is in apps that dynamically
1254         enable and disable editing. If editing is disabled when the first hit test occurs but is
1255         enabled when the second one occurs, different elements will be returned due to
1256         Frame::qualifyingNodeAtViewportLocation preferring to return the root editable element when
1257         the approximate node is contenteditable.
1258
1259         While the appropriate long-term fix is to only hit-test once and use that element for both
1260         preview generation and action selection, this patch implements a short-term fix to address
1261         the specific problem in rdar://problem/54723131 by disabling the contenteditable behavior
1262         described above for context menu interaction hit testing.
1263
1264         The long-term fix is tracked by <https://webkit.org/b/202499>.
1265
1266         * page/Frame.h:
1267         * page/ios/FrameIOS.mm:
1268         (WebCore::Frame::qualifyingNodeAtViewportLocation):
1269         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
1270         (WebCore::ancestorRespondingToClickEventsNodeQualifier):
1271         (WebCore::Frame::nodeRespondingToClickEvents):
1272         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
1273         (WebCore::Frame::nodeRespondingToInteraction):
1274         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
1275
1276 2019-10-02  Antti Koivisto  <antti@apple.com>
1277
1278         [CSS Shadow Parts] Basic ::part() pseudo element support
1279         https://bugs.webkit.org/show_bug.cgi?id=202456
1280
1281         Reviewed by Ryosuke Niwa.
1282
1283         Implement basic parsing and selector matching for ::part() pseudo element.
1284
1285         * css/CSSSelector.cpp:
1286         (WebCore::CSSSelector::pseudoId):
1287         (WebCore::CSSSelector::parsePseudoElementType):
1288         (WebCore::CSSSelector::selectorText const):
1289         * css/CSSSelector.h:
1290         * css/ElementRuleCollector.cpp:
1291         (WebCore::ElementRuleCollector::matchAuthorRules):
1292         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
1293         * css/ElementRuleCollector.h:
1294         * css/RuleSet.cpp:
1295         (WebCore::RuleSet::addRule):
1296         * css/RuleSet.h:
1297         (WebCore::RuleSet::partPseudoElementRules const):
1298         * css/SelectorChecker.cpp:
1299         (WebCore::SelectorChecker::checkOne const):
1300         * css/SelectorPseudoElementTypeMap.in:
1301         * css/parser/CSSParserSelector.cpp:
1302         (WebCore::CSSParserSelector::parsePseudoElementSelector):
1303
1304         Also added ::slotted to SelectorPseudoElementTypeMap.in to resolve a FIXME here.
1305
1306         * css/parser/CSSParserSelector.h:
1307         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
1308         * css/parser/CSSSelectorParser.cpp:
1309         (WebCore::isOnlyPseudoElementFunction):
1310         (WebCore::CSSSelectorParser::consumePseudo):
1311
1312         Parse single values only, multipart ::part(foo bar) case is not yet handled.
1313
1314         * dom/Element.cpp:
1315         (WebCore::Element::partNames const):
1316
1317 2019-10-02  Antoine Quint  <graouts@apple.com>
1318
1319         Adopt copyToVector() in AnimationTimeline::animationsForElement()
1320         https://bugs.webkit.org/show_bug.cgi?id=202488
1321
1322         Reviewed by Wenson Hsieh.
1323
1324         * animation/AnimationTimeline.cpp:
1325         (WebCore::AnimationTimeline::animationsForElement const):
1326
1327 2019-10-02  Thibault Saunier  <tsaunier@igalia.com>
1328
1329         [GStreamer] Let playbin handle redirects for us when appropriate
1330         https://bugs.webkit.org/show_bug.cgi?id=195326
1331
1332         A simplified mechanism has been added in GStreamer to handle corner cases.
1333
1334         Reviewed by Xabier Rodriguez-Calvar.
1335
1336         Not easily testable at our level
1337
1338         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1339         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1340
1341 2019-10-02  Tim Horton  <timothy_horton@apple.com>
1342
1343         Another build fix
1344
1345         * css/typedom/TypedOMCSSImageValue.cpp:
1346         (WebCore::TypedOMCSSImageValue::TypedOMCSSImageValue):
1347         * css/typedom/TypedOMCSSImageValue.h:
1348         I feel like I am actively being thwarted.
1349
1350 2019-10-02  Tim Horton  <timothy_horton@apple.com>
1351
1352         Another build fix
1353
1354         * css/typedom/TypedOMCSSImageValue.h:
1355
1356 2019-10-02  Tim Horton  <timothy_horton@apple.com>
1357
1358         Try to fix the Windows build
1359
1360         * css/typedom/TypedOMCSSImageValue.cpp:
1361         (WebCore::TypedOMCSSImageValue::document const):
1362         * css/typedom/TypedOMCSSImageValue.h:
1363         Out-of-line this instead of including Document.h in TypedOMCSSImageValue,
1364         which was an earlier build fix from r250610.
1365
1366         * platform/graphics/cg/GradientCG.cpp:
1367         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
1368         * platform/graphics/win/GraphicsContextCGWin.cpp:
1369         Try to fix the build.
1370
1371 2019-10-02  Keith Rollin  <krollin@apple.com>
1372
1373         Unreviewed build fix after r250595.
1374
1375         macCatalyst appears to have triggered the the problem where the build
1376         can sometimes fail if the unified sources mechanism doesn't group
1377         together the right set of files.
1378
1379         * css/typedom/TypedOMCSSImageValue.h:
1380
1381 2019-10-02  Antoine Quint  <graouts@apple.com>
1382
1383         [Web Animations] Implement replaced animations
1384         https://bugs.webkit.org/show_bug.cgi?id=202190
1385         <rdar://55697719>
1386
1387         Reviewed by Dean Jackson.
1388
1389         Implementing section "5.5 Replacing Animations" (https://drafts.csswg.org/web-animations/#replacing-animations) of the Web Animations
1390         specification which allows for Web Animations to be destroyed when they are superseded by another animation and the developer doesn't
1391         explicitly opt into persisting them using the persist() method.
1392
1393         An animation is marked as replaceable (to sum up) when it's finished and another animation for the same property takes precedence.
1394         As part of DocumentTimeline::internalUpdateAnimationsAndSendEvents(), we'll go through all replaceable animations, dispatch a "remove"
1395         DOM event, and remove them from our list of animations.
1396
1397         We also make a couple of fixes in this patch that were uncovered while working on the WPT tests for replaced animations:
1398         
1399         - we would incorrectly parse single values for a property that allows lists (change in KeyframeEffect's processKeyframeLikeObject())
1400         - we didn't account for the position in the global animation list when sorted animations by composite order (AnimationTimeline::animationsForElement())
1401
1402         Finally, to get more readable results, we implement a stub of commitStyles(). Its full implementation is tracked by http://wkb.ug/202193.
1403
1404         * animation/AnimationTimeline.cpp:
1405         (WebCore::AnimationTimeline::animationTimingDidChange): Mark the position of the animation in the global animation list, to which it may only be added once.
1406         (WebCore::AnimationTimeline::animationsForElement const): Account for the animation's position in the global animation when sorting.
1407         * animation/DeclarativeAnimation.cpp:
1408         (WebCore::DeclarativeAnimation::bindingsReplaceState const): Flush pending styles when querying the ready state for a declarative animation.
1409         * animation/DeclarativeAnimation.h:
1410         * animation/DocumentTimeline.cpp:
1411         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Run the "remove replaced animations" procedure as the second step in the "update animations
1412         and send events" procedure.
1413         (WebCore::DocumentTimeline::animationCanBeRemoved): Determine whether a given animation may be removed based on its finished state, replace state and whether
1414         it is fully superseded by another animation targeting the same property on the same target element.
1415         (WebCore::DocumentTimeline::removeReplacedAnimations): Remove any removable animation and dispatch a "remove" DOM event for each removed animation. 
1416         * animation/DocumentTimeline.h:
1417         * animation/KeyframeEffect.cpp:
1418         (WebCore::processKeyframeLikeObject): Fix an issue found in a replaced animations WPT test that showed that we didn't record the value of an animation that allows lists.
1419         * animation/WebAnimation.cpp:
1420         (WebCore::WebAnimation::isReplaceable const):
1421         (WebCore::WebAnimation::persist): Mark the replace state as "persisted" and ensure the animation is set on the animation list for its target element in case it had already
1422         been removed based on its persisted state.
1423         (WebCore::WebAnimation::commitStyles): Stub for a new function.
1424         * animation/WebAnimation.h:
1425         (WebCore::WebAnimation::replaceState const):
1426         (WebCore::WebAnimation::setReplaceState):
1427         (WebCore::WebAnimation::bindingsReplaceState const):
1428         (WebCore::WebAnimation::globalPosition const):
1429         (WebCore::WebAnimation::setGlobalPosition):
1430         * animation/WebAnimation.idl:
1431         * dom/EventNames.h: Add the new "remove" event so that the "onremove" DOM property is available on Animation objects. 
1432
1433 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
1434
1435         Unreviewed build fix in Nicosia's ScrollingTreePositionedNode class.
1436
1437         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
1438         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1439         Fix the name of the variable included in the log call.
1440
1441 2019-10-02  youenn fablet  <youenn@apple.com>
1442
1443         Use strongly typed identifiers for webrtc sockets
1444         https://bugs.webkit.org/show_bug.cgi?id=202400
1445
1446         Reviewed by Chris Dumez.
1447
1448         No observable change of behavior.
1449
1450         * Headers.cmake:
1451         * WebCore.xcodeproj/project.pbxproj:
1452         * platform/mediastream/libwebrtc/LibWebRTCSocketIdentifier.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocket.h.
1453
1454 2019-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1455
1456         [GTK][WPE] Stop using legacy custom protocol implementation
1457         https://bugs.webkit.org/show_bug.cgi?id=202407
1458
1459         Reviewed by Žan Doberšek.
1460
1461         Remove the code to setup custom protocols in soup session.
1462
1463         * platform/network/soup/SoupNetworkSession.cpp:
1464         (WebCore::SoupNetworkSession::SoupNetworkSession):
1465         * platform/network/soup/SoupNetworkSession.h:
1466
1467 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
1468
1469         [Nicosia] Enable async scrolling at build-time for Nicosia-using ports
1470         https://bugs.webkit.org/show_bug.cgi?id=202397
1471
1472         Reviewed by Carlos Garcia Campos.
1473
1474         * PlatformPlayStation.cmake: Add missing build targets.
1475         * SourcesGTK.txt: Ditto.
1476
1477 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1478
1479         Clean up some includes to make the build a bit faster
1480         https://bugs.webkit.org/show_bug.cgi?id=202444
1481
1482         Reviewed by Geoff Garen.
1483
1484         No new tests, just reorganizing.
1485
1486         Apply some profile-guided optimizations to our headers.
1487
1488         * bindings/js/CallTracerTypes.h:
1489         * css/typedom/TypedOMCSSImageValue.h:
1490         * html/canvas/WebGLObject.h:
1491         * html/canvas/WebGLVertexArrayObjectBase.h:
1492         * inspector/InspectorInstrumentation.cpp:
1493         (WebCore::InspectorInstrumentation::instrumentingAgentsForWebGPUDevice):
1494         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
1495         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
1496         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
1497         * inspector/InspectorInstrumentation.h:
1498         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice):
1499         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice):
1500         (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline):
1501         * platform/graphics/BitmapImage.cpp:
1502         * platform/graphics/Font.h:
1503         * platform/graphics/cg/GraphicsContextCG.cpp:
1504         (WebCore::getUserToBaseCTM):
1505         * platform/graphics/cg/GraphicsContextCG.h:
1506         (WebCore::getUserToBaseCTM): Deleted.
1507         * platform/graphics/cg/ImageBufferCG.cpp:
1508         * platform/graphics/cocoa/IOSurface.h:
1509         * platform/graphics/mac/PDFDocumentImageMac.mm:
1510         InspectorInstrumentation.h is one of the most expensive headers in the entire project.
1511         While not included in many places (70), it is fairly straightforward to reduce
1512         its per-inclusion cost by rougly 80%.
1513
1514 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1515
1516         Progress towards a functioning CMake build on Mac
1517         https://bugs.webkit.org/show_bug.cgi?id=202443
1518
1519         Rubber-stamped by Tim Horton.
1520
1521         * testing/Internals.mm:
1522
1523 2019-10-01  John Wilander  <wilander@apple.com>
1524
1525         Storage Access API: document.hasStorageAccess() should return true when the cookie policy allows access
1526         https://bugs.webkit.org/show_bug.cgi?id=202435
1527         <rdar://problem/55718526>
1528
1529         Reviewed by Brent Fulgham.
1530
1531         WebKit's Storage Access API implementation has so far only looked at whether ITP is
1532         blocking cookie access or not. However, the default cookie policy is still in
1533         effect underneath ITP. document.hasStorageAccess() should return true if the
1534         third-party:
1535         a) is not classified by ITP, and
1536         b) has cookies which implies it can use cookies as third-party according to the
1537         default cookie policy.
1538
1539         Tests: http/tests/storageAccess/has-storage-access-false-by-default-ephemeral.html
1540                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html
1541                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies.html
1542
1543         * platform/network/NetworkStorageSession.h:
1544         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1545         (WebCore::NetworkStorageSession::hasCookies const):
1546         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1547         (WebCore::NetworkStorageSession::hasCookies const):
1548             Not yet implemented. Always says false.
1549         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1550         (WebCore::NetworkStorageSession::hasCookies const):
1551             Not yet implemented. Always says false.
1552
1553 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1554
1555         Clean up some includes to make the build a bit faster
1556         https://bugs.webkit.org/show_bug.cgi?id=202437
1557
1558         Reviewed by Jer Noble.
1559
1560         * Modules/webaudio/PannerNode.h:
1561         * Modules/webaudio/RealtimeAnalyser.h:
1562         * platform/audio/HRTFPanner.h:
1563         FFTFrame includes Accelerate.h, which is quite expensive.
1564
1565 2019-10-01  Antti Koivisto  <antti@apple.com>
1566
1567         [CSS Shadow Parts] Parse 'part' attribute
1568         https://bugs.webkit.org/show_bug.cgi?id=202409
1569
1570         Reviewed by Ryosuke Niwa.
1571
1572         Add parsing for Element 'part' attribute and the IDL interface.
1573         Also add a feature flag for CSS Shadow Parts.
1574
1575         * dom/Element.cpp:
1576         (WebCore::Element::attributeChanged):
1577         (WebCore::isNonEmptyTokenList):
1578         (WebCore::Element::classAttributeChanged):
1579         (WebCore::Element::partAttributeChanged):
1580         (WebCore::Element::partNames const):
1581         (WebCore::Element::part):
1582         (WebCore::classStringHasClassName): Deleted.
1583         * dom/Element.h:
1584         * dom/Element.idl:
1585         * dom/ElementRareData.cpp:
1586         * dom/ElementRareData.h:
1587         (WebCore::ElementRareData::partList const):
1588         (WebCore::ElementRareData::setPartList):
1589         (WebCore::ElementRareData::partNames const):
1590         (WebCore::ElementRareData::setPartNames):
1591         * html/HTMLAttributeNames.in:
1592         * page/RuntimeEnabledFeatures.h:
1593         (WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled):
1594         (WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const):
1595
1596 2019-10-01  Yusuke Suzuki  <ysuzuki@apple.com>
1597
1598         [JSC] Place VM* in TLS
1599         https://bugs.webkit.org/show_bug.cgi?id=202391
1600
1601         Reviewed by Mark Lam.
1602
1603         Use JSLockHolder instead. It automatically puts VM* in TLS.
1604
1605         * bindings/js/IDBBindingUtilities.cpp:
1606         (WebCore::toJS):
1607         (WebCore::deserializeIDBValueToJSValue):
1608
1609 2019-10-01  youenn fablet  <youenn@apple.com>
1610
1611         Queue events and promise resolution in RTCPeerConnection when suspended for page cache
1612         https://bugs.webkit.org/show_bug.cgi?id=202396
1613
1614         Reviewed by Chris Dumez.
1615
1616         This patch prepares RTCPeerConnection to be suspendable to enter page cache.
1617         For that purpose, we queue events and promise resolution/rejection tasks if the RTCPeerConnection m_shouldDelayTasks is set to true.
1618         This queueing is enabled when RTCPeerConnection is asked to suspend itself.
1619         The queued tasks are then executed at resume time.
1620         Renamed fireEvent to dispatchEventWhenFeasible.
1621         No change of behavior for now.
1622
1623         * Modules/mediastream/PeerConnectionBackend.cpp:
1624         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1625         (WebCore::PeerConnectionBackend::createOfferFailed):
1626         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1627         (WebCore::PeerConnectionBackend::createAnswerFailed):
1628         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
1629         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
1630         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
1631         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1632         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1633         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1634         * Modules/mediastream/RTCPeerConnection.cpp:
1635         (WebCore::RTCPeerConnection::doClose):
1636         (WebCore::RTCPeerConnection::suspend):
1637         (WebCore::RTCPeerConnection::resume):
1638         (WebCore::RTCPeerConnection::updateIceGatheringState):
1639         (WebCore::RTCPeerConnection::updateIceConnectionState):
1640         (WebCore::RTCPeerConnection::updateConnectionState):
1641         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
1642         (WebCore::RTCPeerConnection::doTask):
1643         (WebCore::RTCPeerConnection::fireEvent):
1644         * Modules/mediastream/RTCPeerConnection.h:
1645
1646 2019-10-01  Brent Fulgham  <bfulgham@apple.com>
1647
1648         [FTW] Correct additional canvas test failures
1649         https://bugs.webkit.org/show_bug.cgi?id=202388
1650
1651         Reviewed by Fujii Hironori.
1652
1653         This patch corrects a handful of errors in Direct2D's drawing code.
1654
1655         * platform/graphics/win/Direct2DOperations.cpp:
1656         (WebCore::Direct2D::clearRect): Use the transformed dimensions of
1657         rects to determine whether they intersect with the render target.
1658         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1659         (WebCore::ImageBufferData::copyRectFromData const):
1660         (WebCore::ImageBufferData::loadDataToBitmapIfNeeded): It is not
1661         necessary (or correct) to 'endDraw' when loading image data to the
1662         Bitmap target.
1663         * platform/graphics/win/PathDirect2D.cpp:
1664         (WebCore::Path::strokeBoundingRect const): Provide an implementation.
1665
1666 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1667
1668         Progress towards successful CMake build on Mac
1669         https://bugs.webkit.org/show_bug.cgi?id=202426
1670
1671         Rubber-stamped by Tim Horton.
1672
1673         * PlatformMac.cmake:
1674
1675 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1676
1677         Clean up some includes to make the build a bit faster
1678         https://bugs.webkit.org/show_bug.cgi?id=202417
1679
1680         Reviewed by Jer Noble.
1681
1682         No new tests, just reorganizing.
1683
1684         Apply some profile-guided optimizations to our headers.
1685
1686         * Modules/mediasource/SourceBuffer.cpp:
1687         * WebCorePrefix.h:
1688         Add HashMap, which ends up included in all source files.
1689
1690         * html/HTMLImageElement.cpp:
1691         (WebCore::HTMLImageElement::HTMLImageElement):
1692         (WebCore::HTMLImageElement::selectImageSource):
1693         (WebCore::HTMLImageElement::didAttachRenderers):
1694         (WebCore::HTMLImageElement::insertedIntoAncestor):
1695         (WebCore::HTMLImageElement::width):
1696         (WebCore::HTMLImageElement::height):
1697         (WebCore::HTMLImageElement::naturalWidth const):
1698         (WebCore::HTMLImageElement::naturalHeight const):
1699         (WebCore::HTMLImageElement::complete const):
1700         (WebCore::HTMLImageElement::decode):
1701         (WebCore::HTMLImageElement::didMoveToNewDocument):
1702         (WebCore::HTMLImageElement::cachedImage const):
1703         (WebCore::HTMLImageElement::setLoadManually):
1704         (WebCore::HTMLImageElement::hasPendingActivity const):
1705         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const):
1706         * html/HTMLImageElement.h:
1707         (WebCore::HTMLImageElement::cachedImage const): Deleted.
1708         (WebCore::HTMLImageElement::setLoadManually): Deleted.
1709         (WebCore::HTMLImageElement::hasPendingActivity const): Deleted.
1710         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const): Deleted.
1711         HTMLImageLoader brings in JSDOMPromiseDeferred, which is known to be horribly expensive.
1712         Out-of-line m_imageLoader.
1713
1714         * platform/graphics/GraphicsLayer.h:
1715         Swap Animation for TimingFunction, which is much smaller.
1716
1717         * platform/graphics/MediaPlayer.h:
1718         InbandTextTrackPrivate brings in SerializedPlatformRepresentation.h,
1719         which is very expensive. MediaPlayer.h is included in many places.
1720         Break the link.
1721
1722         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1723
1724 2019-10-01  youenn fablet  <youenn@apple.com>
1725
1726         RTCDataChannel should not prevent entering page cache except if in open state
1727         https://bugs.webkit.org/show_bug.cgi?id=202395
1728
1729         Reviewed by Chris Dumez.
1730
1731         Only prevent entering page cache in open state.
1732         Enqueue message through the document event queue to handle suspension properly.
1733
1734         We cannot yet write page cache tests as a data channel requires a peer connection which
1735         currently forbids entering page cache.
1736
1737         * Modules/mediastream/RTCDataChannel.cpp:
1738         (WebCore::RTCDataChannel::RTCDataChannel):
1739         (WebCore::RTCDataChannel::didReceiveStringData):
1740         (WebCore::RTCDataChannel::didReceiveRawData):
1741         (WebCore::RTCDataChannel::didDetectError):
1742         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
1743         (WebCore::RTCDataChannel::scheduleDispatchEvent):
1744         (WebCore::RTCDataChannel::scheduledEventTimerFired): Deleted.
1745         * Modules/mediastream/RTCDataChannel.h:
1746
1747 2019-10-01  Rob Buis  <rbuis@igalia.com>
1748
1749         [Mac] Layout Test imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html fails
1750         https://bugs.webkit.org/show_bug.cgi?id=202350
1751
1752         Reviewed by Alex Christensen.
1753
1754         In some cases didReceiveResponse will deliver redirects (normally willSendRequestInternal will be used for redirects).
1755         When this is done in manual redirect mode make sure the response type is opaque redirect.
1756
1757         Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html
1758
1759         * loader/SubresourceLoader.cpp:
1760         (WebCore::SubresourceLoader::didReceiveResponse):
1761
1762 2019-10-01  Keith Rollin  <krollin@apple.com>
1763
1764         Remove some support for < iOS 13
1765         https://bugs.webkit.org/show_bug.cgi?id=202386
1766         <rdar://problem/55863017>
1767
1768         Reviewed by Eric Carlson.
1769
1770         Remove some support for iOS versions less than 13.0.
1771
1772         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
1773         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
1774         values >= 130000. This means that expressions like
1775         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
1776         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
1777
1778         This removal is part of a series of patches effecting the removal of
1779         dead code for old versions of iOS. This particular pass involves
1780         changes in which Jer Noble was involved. These changes are isolated
1781         from other similar changes in order to facilitate the reviewing
1782         process.
1783
1784         No new tests -- no new or changed functionality.
1785
1786         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1787         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const):
1788         (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const):
1789
1790 2019-10-01  Chris Dumez  <cdumez@apple.com>
1791
1792         Unreviewed attempt to fix Windows build after r250527.
1793
1794         * dom/GenericEventQueue.cpp:
1795         (WebCore::TaskQueueConstructor::construct):
1796         (WebCore::TaskQueueConstructor<Timer>::construct):
1797         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
1798         (WebCore::GenericEventQueueBase<T>::close):
1799         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
1800         (WebCore::GenericEventQueueBase<T>::setPaused):
1801         (WebCore::GenericEventQueueBase<T>::suspend):
1802         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
1803         * dom/GenericEventQueue.h:
1804         * platform/GenericTaskQueue.h:
1805
1806 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1807
1808         Fix internal build after r250549
1809         https://bugs.webkit.org/show_bug.cgi?id=202390
1810
1811         There is an internal #define confirm on some systems, so rename DOMWindow::confirm to DOMWindow::confirmForBindings.
1812
1813         * page/DOMWindow.cpp:
1814         (WebCore::DOMWindow::confirmForBindings):
1815         (WebCore::DOMWindow::confirm): Deleted.
1816         * page/DOMWindow.h:
1817         * page/DOMWindow.idl:
1818
1819 2019-10-01  Chris Dumez  <cdumez@apple.com>
1820
1821         Unreviewed attempt to fix Windows build after r250527.
1822
1823         * platform/GenericTaskQueue.h:
1824
1825 2019-10-01  Zan Dobersek  <zdobersek@igalia.com>
1826
1827         [CoordGraphics] Implement sync methods for position, bounds origin
1828         https://bugs.webkit.org/show_bug.cgi?id=202398
1829
1830         Reviewed by Carlos Garcia Campos.
1831
1832         Add the CoordinatedGraphicsLayer::syncPosition() and
1833         CoordinatedGraphicsLayer::syncBoundsOrigin() method overrides, both
1834         performing a synchronization of the given GraphicsLayer attribute.
1835
1836         These methods are used by the scrolling code to reflect changes in these
1837         attributes without causing a layer flush (which is not necessary since
1838         the changes have already been applied in an equivalent way).
1839
1840         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1841         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
1842         (WebCore::CoordinatedGraphicsLayer::syncPosition):
1843         (WebCore::CoordinatedGraphicsLayer::syncBoundsOrigin):
1844         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1845
1846 2019-10-01  Joonghun Park  <jh718.park@samsung.com>
1847
1848         Make table's clientWidth/Height include its border sizes.
1849         https://bugs.webkit.org/show_bug.cgi?id=200974
1850
1851         WebKit doesn't have table wrapper box currently
1852         while Gecko has it,
1853         so this CL tries to mimic the behavior that
1854         clientWidth/Height refers to table wrapper box
1855         which doesn't have borders applied to itself
1856         and table grid box has the borders.
1857
1858         This CL adds table's border sizes
1859         to clientWidth/Height
1860         at |LayoutBox::PixelSnappedClientWidth/Height|.
1861
1862         As a result of this CL, table's clientWidth/Height
1863         and offsetWidth/Height are equal now, respectively.
1864
1865         The corresponding csswg discussion is
1866         https://github.com/w3c/csswg-drafts/issues/4245.
1867
1868         Reviewed by Antti Koivisto.
1869
1870         Tests: fast/table/border-collapsing/bug236727.html
1871                imported/w3c/web-platform-tests/css/cssom-view/table-border-collapse-client-width-height.html
1872                imported/w3c/web-platform-tests/css/cssom-view/table-border-separate-client-width-height.html
1873                imported/w3c/web-platform-tests/css/cssom-view/table-with-border-client-width-height.html
1874
1875         * dom/Element.cpp:
1876         (WebCore::Element::clientWidth):
1877         (WebCore::Element::clientHeight):
1878
1879 2019-10-01  youenn fablet  <youenn@apple.com>
1880
1881         Remove races condition when validating capture sandbox extension revocation
1882         https://bugs.webkit.org/show_bug.cgi?id=202133
1883         <rdar://problem/55660905>
1884
1885         Reviewed by Eric Carlson.
1886
1887         Covered by existing tests.
1888
1889         * Modules/mediastream/MediaStreamTrack.cpp:
1890         (WebCore::MediaStreamTrack::endCapture):
1891         Synchronously update document media state when capture is ended.
1892         This allows to validate the fact that no document is capturing while we revoke sandbox extensions.
1893
1894 2019-10-01  youenn fablet  <youenn@apple.com>
1895
1896         MediaDevices should be SecureContext
1897         https://bugs.webkit.org/show_bug.cgi?id=202267
1898
1899         Reviewed by Eric Carlson.
1900
1901         Manually tested since 127.0.0.1/localhost are secure contexts.
1902
1903         * Modules/mediastream/MediaDevices.idl:
1904         * bindings/js/WebCoreBuiltinNames.h:
1905
1906 2019-09-30  Alex Christensen  <achristensen@webkit.org>
1907
1908         Resurrect Mac CMake build
1909         https://bugs.webkit.org/show_bug.cgi?id=202384
1910
1911         Rubber-stamped by Tim Horton.
1912
1913         * PlatformMac.cmake:
1914
1915 2019-09-30  Chris Dumez  <cdumez@apple.com>
1916
1917         Make GenericEventQueue an ActiveDOMObject
1918         https://bugs.webkit.org/show_bug.cgi?id=202373
1919
1920         Reviewed by Eric Carlson.
1921
1922         Make GenericEventQueue an ActiveDOMObject so that it is guaranteed to never fire any events while
1923         suspended without requiring the client to explicitly suspend/resume the event queue.
1924
1925         * Modules/encryptedmedia/MediaKeySession.cpp:
1926         (WebCore::MediaKeySession::MediaKeySession):
1927         (WebCore::MediaKeySession::enqueueMessage):
1928         (WebCore::MediaKeySession::updateKeyStatuses):
1929         * Modules/encryptedmedia/MediaKeySession.h:
1930         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1931         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
1932         (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
1933         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
1934         (WebCore::WebKitMediaKeySession::sendMessage):
1935         (WebCore::WebKitMediaKeySession::sendError):
1936         (WebCore::WebKitMediaKeySession::hasPendingActivity const):
1937         (WebCore::WebKitMediaKeySession::stop):
1938         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1939         * Modules/mediasource/MediaSource.cpp:
1940         (WebCore::MediaSource::MediaSource):
1941         (WebCore::MediaSource::hasPendingActivity const):
1942         (WebCore::MediaSource::stop):
1943         (WebCore::MediaSource::canSuspendForDocumentSuspension const):
1944         (WebCore::MediaSource::scheduleEvent):
1945         * Modules/mediasource/MediaSource.h:
1946         * Modules/mediasource/SourceBuffer.cpp:
1947         (WebCore::SourceBuffer::SourceBuffer):
1948         (WebCore::SourceBuffer::hasPendingActivity const):
1949         (WebCore::SourceBuffer::stop):
1950         (WebCore::SourceBuffer::scheduleEvent):
1951         * Modules/mediasource/SourceBuffer.h:
1952         * Modules/mediasource/SourceBufferList.cpp:
1953         (WebCore::SourceBufferList::SourceBufferList):
1954         (WebCore::SourceBufferList::scheduleEvent):
1955         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
1956         * Modules/mediasource/SourceBufferList.h:
1957         * Modules/webaudio/AudioContext.cpp:
1958         (WebCore::AudioContext::AudioContext):
1959         (WebCore::AudioContext::stop):
1960         * Modules/webaudio/AudioContext.h:
1961         * animation/DeclarativeAnimation.cpp:
1962         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
1963         (WebCore::DeclarativeAnimation::tick):
1964         (WebCore::DeclarativeAnimation::needsTick const):
1965         (WebCore::DeclarativeAnimation::remove):
1966         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
1967         (WebCore::DeclarativeAnimation::stop):
1968         (WebCore::DeclarativeAnimation::suspend):
1969         (WebCore::DeclarativeAnimation::resume):
1970         * animation/DeclarativeAnimation.h:
1971         * dom/GenericEventQueue.cpp:
1972         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
1973         (WebCore::GenericEventQueueBase<T>::setPaused):
1974         (WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const):
1975         (WebCore::GenericEventQueueBase<T>::suspend):
1976         (WebCore::GenericEventQueueBase<T>::resume):
1977         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
1978         (WebCore::GenericEventQueueBase<T>::stop):
1979         (WebCore::GenericEventQueueBase<T>::activeDOMObjectName const):
1980         (WebCore::GenericEventQueue::create):
1981         (WebCore::MainThreadGenericEventQueue::create):
1982         * dom/GenericEventQueue.h:
1983         * dom/MessagePort.cpp:
1984         (WebCore::MessagePort::MessagePort):
1985         (WebCore::MessagePort::close):
1986         (WebCore::MessagePort::dispatchMessages):
1987         * dom/MessagePort.h:
1988         * html/HTMLMediaElement.cpp:
1989         (WebCore::HTMLMediaElement::HTMLMediaElement):
1990         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1991         (WebCore::HTMLMediaElement::scheduleEvent):
1992         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1993         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
1994         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
1995         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
1996         (WebCore::HTMLMediaElement::closeTaskQueues):
1997         (WebCore::HTMLMediaElement::suspend):
1998         (WebCore::HTMLMediaElement::resume):
1999         (WebCore::HTMLMediaElement::hasPendingActivity const):
2000         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
2001         * html/HTMLMediaElement.h:
2002         * html/track/TrackListBase.cpp:
2003         (WebCore::TrackListBase::TrackListBase):
2004         (WebCore::TrackListBase::scheduleTrackEvent):
2005         (WebCore::TrackListBase::scheduleChangeEvent):
2006         (WebCore::TrackListBase::isChangeEventScheduled const):
2007         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
2008         * html/track/TrackListBase.h:
2009         * workers/Worker.cpp:
2010         (WebCore::Worker::Worker):
2011         (WebCore::Worker::terminate):
2012         (WebCore::Worker::stop):
2013         (WebCore::Worker::hasPendingActivity const):
2014         (WebCore::Worker::enqueueEvent):
2015         (WebCore::Worker::dispatchEvent):
2016         * workers/Worker.h:
2017         * workers/service/ServiceWorkerContainer.cpp:
2018         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2019         (WebCore::ServiceWorkerContainer::startMessages):
2020         (WebCore::ServiceWorkerContainer::postMessage):
2021         (WebCore::ServiceWorkerContainer::stop):
2022         * workers/service/ServiceWorkerContainer.h:
2023
2024 2019-09-30  Chris Dumez  <cdumez@apple.com>
2025
2026         IDBTransaction / IDBObjectStore should not prevent a page from entering the back / forward cache
2027         https://bugs.webkit.org/show_bug.cgi?id=202291
2028         <rdar://problem/55760106>
2029
2030         Reviewed by Geoffrey Garen.
2031
2032         IDBObjectStore does not fire any events and should therefore not cause any problem while in PageCache.
2033         IDBTransaction can only fire abort/complete/error events, all of which are being enqueued to the
2034         DocumentEventQueue. The DocumentEventQueue subclasses SuspendableTimer which will correctly suspend
2035         while the document is in page cache. IDBTransaction will therefore not cause events to fire (and JS
2036         to run) while in page cache.
2037
2038         Test: storage/indexeddb/IDBTransaction-page-cache.html
2039
2040         * Modules/indexeddb/IDBObjectStore.cpp:
2041         (WebCore::IDBObjectStore::canSuspendForDocumentSuspension const):
2042         * Modules/indexeddb/IDBTransaction.cpp:
2043         (WebCore::IDBTransaction::canSuspendForDocumentSuspension const):
2044
2045 2019-09-30  Chris Dumez  <cdumez@apple.com>
2046
2047         Refine restrictions for X-Temp-Tablet HTTP header experiment
2048         https://bugs.webkit.org/show_bug.cgi?id=202367
2049         <rdar://problem/55849139>
2050
2051         Reviewed by Geoffrey Garen.
2052
2053         Refine restrictions for X-Temp-Tablet HTTP header experiment:
2054         1. Only send the header if the embedding application is MobileSafari.
2055         2. Only send the header if the first party is google.com
2056         3. Only send the header if the current date is before 2/1/2020
2057         4. Send the header even if using an ephemeral session
2058
2059         * loader/cache/CachedResourceLoader.cpp:
2060         (WebCore::isXTempTabletHeaderExperimentOver):
2061         (WebCore::CachedResourceLoader::CachedResourceLoader):
2062         (WebCore::isGoogleSearch):
2063         (WebCore::CachedResourceLoader::shouldSendXTempTabletHeader const):
2064         (WebCore::CachedResourceLoader::requestResource):
2065         * loader/cache/CachedResourceLoader.h:
2066
2067 2019-09-30  Chris Dumez  <cdumez@apple.com>
2068
2069         Pages with Web Workers cannot enter the back / forward cache
2070         https://bugs.webkit.org/show_bug.cgi?id=202296
2071         <rdar://problem/55764073>
2072
2073         Reviewed by Jer Noble.
2074
2075         Allow pages that use Web Workers to enter the back / forward cache.
2076         This involves adding an EventQueue for all event firing on Woker
2077         objects and suspending this EventQueue while in the page cache.
2078
2079         This was preventing some of the pages on weather.com to enter the
2080         back / forward cache.
2081
2082         Test: fast/workers/worker-page-cache.html
2083
2084         * Modules/encryptedmedia/MediaKeySession.h:
2085         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
2086         * Modules/mediasource/MediaSource.h:
2087         * Modules/mediasource/SourceBuffer.h:
2088         * Modules/mediasource/SourceBufferList.h:
2089         * Modules/webaudio/AudioContext.cpp:
2090         (WebCore::AudioContext::AudioContext):
2091         * Modules/webaudio/AudioContext.h:
2092         * animation/DeclarativeAnimation.h:
2093
2094         * dom/GenericEventQueue.cpp:
2095         (WebCore::TaskQueueConstructor::construct):
2096         (WebCore::TaskQueueConstructor<Timer>::construct):
2097         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
2098         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
2099         (WebCore::GenericEventQueueBase<T>::dispatchOneEvent):
2100         (WebCore::GenericEventQueueBase<T>::close):
2101         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
2102         (WebCore::GenericEventQueueBase<T>::hasPendingEvents const):
2103         (WebCore::GenericEventQueueBase<T>::hasPendingEventsOfType const):
2104         (WebCore::GenericEventQueueBase<T>::suspend):
2105         (WebCore::GenericEventQueueBase<T>::resume):
2106         * dom/GenericEventQueue.h:
2107         (WebCore::GenericEventQueueBase::isSuspended const):
2108         (WebCore::MainThreadGenericEventQueue::MainThreadGenericEventQueue):
2109         (WebCore::GenericEventQueue::GenericEventQueue):
2110         Rename GenericEventQueue to MainThreadGenericEventQueue since its implementation relies
2111         on a global shared Timer to fire events. Introduce a new GenericEventQueue which can
2112         actually be used from any thread. This is useful for MessagePort, which is used both
2113         on the main thread and on worker threads.
2114
2115         * dom/MessagePort.cpp:
2116         (WebCore::MessagePort::MessagePort):
2117         (WebCore::MessagePort::close):
2118         (WebCore::MessagePort::suspend):
2119         (WebCore::MessagePort::resume):
2120         (WebCore::MessagePort::dispatchMessages):
2121         * dom/MessagePort.h:
2122         Use an GenericEventQueue in MessagePort for consistency with Worker.
2123         MessagePort is an ActiveDOMobject which returns true in canSuspend(),
2124         we therefore need to make sure it suspends event firing while
2125         suspended.
2126
2127         * html/HTMLMediaElement.h:
2128         * html/track/TrackListBase.h:
2129         * workers/Worker.cpp:
2130         (WebCore::Worker::Worker):
2131         (WebCore::Worker::terminate):
2132         (WebCore::Worker::canSuspendForDocumentSuspension const):
2133         (WebCore::Worker::suspend):
2134         (WebCore::Worker::resume):
2135         (WebCore::Worker::stop):
2136         (WebCore::Worker::hasPendingActivity const):
2137         (WebCore::Worker::notifyFinished):
2138         (WebCore::Worker::enqueueEvent):
2139         (WebCore::Worker::dispatchEvent):
2140         * workers/Worker.h:
2141         * workers/WorkerMessagingProxy.cpp:
2142         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
2143         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
2144
2145 2019-09-27  Keith Rollin  <krollin@apple.com>
2146
2147         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
2148         https://bugs.webkit.org/show_bug.cgi?id=202119
2149         <rdar://problem/55638792>
2150
2151         Unreviewed, address post landing review comments for r248533 from
2152         Darin Adler.
2153
2154         No new tests -- no new or changed functionality.
2155
2156         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2157         (WebCore::convert):
2158         (WebCore::subLocality): Deleted.
2159         (WebCore::setSubLocality): Deleted.
2160         (WebCore::subAdministrativeArea): Deleted.
2161         (WebCore::setSubAdministrativeArea): Deleted.
2162
2163 2019-09-30  Antti Koivisto  <antti@apple.com>
2164
2165         RenderLineBreak should use LineLayoutTraversal
2166         https://bugs.webkit.org/show_bug.cgi?id=202316
2167
2168         Reviewed by Zalan Bujtas.
2169
2170         Replace more path specific code with LineLayoutTraversal.
2171
2172         * Headers.cmake:
2173         * rendering/RenderLineBreak.cpp:
2174         (WebCore::RenderLineBreak::linesBoundingBox const):
2175         (WebCore::RenderLineBreak::absoluteRects const):
2176         (WebCore::RenderLineBreak::absoluteQuads const):
2177         (WebCore::simpleLineLayout): Deleted.
2178         * rendering/RenderTreeAsText.cpp:
2179         (WebCore::RenderTreeAsText::writeRenderObject):
2180         (WebCore::writeTextBox):
2181         * rendering/SimpleLineLayoutFunctions.cpp:
2182         (WebCore::SimpleLineLayout::computeBoundingBox): Deleted.
2183         (WebCore::SimpleLineLayout::collectAbsoluteRects): Deleted.
2184         (WebCore::SimpleLineLayout::rendererForPosition): Deleted.
2185         * rendering/SimpleLineLayoutFunctions.h:
2186         * rendering/line/LineLayoutTraversal.cpp:
2187         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
2188         (WebCore::LineLayoutTraversal::ElementBoxIterator::atEnd const):
2189         (WebCore::LineLayoutTraversal::elementBoxFor):
2190         (WebCore::LineLayoutTraversal::TextBox::rect const): Deleted.
2191         (WebCore::LineLayoutTraversal::TextBox::logicalRect const): Deleted.
2192         (WebCore::LineLayoutTraversal::TextBox::hasHyphen const): Deleted.
2193         (WebCore::LineLayoutTraversal::TextBox::isLeftToRightDirection const): Deleted.
2194         (WebCore::LineLayoutTraversal::TextBox::dirOverride const): Deleted.
2195         (WebCore::LineLayoutTraversal::TextBox::text const): Deleted.
2196         (WebCore::LineLayoutTraversal::TextBox::isLineBreak const): Deleted.
2197         (WebCore::LineLayoutTraversal::TextBox::localStartOffset const): Deleted.
2198         (WebCore::LineLayoutTraversal::TextBox::localEndOffset const): Deleted.
2199         (WebCore::LineLayoutTraversal::TextBox::length const): Deleted.
2200         (WebCore::LineLayoutTraversal::TextBox::isLastOnLine const): Deleted.
2201         (WebCore::LineLayoutTraversal::TextBox::isLast const): Deleted.
2202         (WebCore::LineLayoutTraversal::TextBox::iterator const): Deleted.
2203
2204         Move to header as templates.
2205
2206         * rendering/line/LineLayoutTraversal.h:
2207         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
2208         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator bool const):
2209         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator* const):
2210         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator-> const):
2211
2212         Add a new iterator type for element boxes.
2213         It doesn't currently really iterate, is just allows testing for end.
2214
2215         (WebCore::LineLayoutTraversal::Box<Iterator>::rect const):
2216         (WebCore::LineLayoutTraversal::Box<Iterator>::logicalRect const):
2217         (WebCore::LineLayoutTraversal::Box<Iterator>::isLeftToRightDirection const):
2218         (WebCore::LineLayoutTraversal::Box<Iterator>::dirOverride const):
2219         (WebCore::LineLayoutTraversal::Box<Iterator>::isLineBreak const):
2220         (WebCore::LineLayoutTraversal::Box<Iterator>::iterator const):
2221
2222         Split properties that all inline boxes have out from TextBox.
2223         Make it a template class.
2224
2225         (WebCore::LineLayoutTraversal::TextBox<Iterator>::hasHyphen const):
2226         (WebCore::LineLayoutTraversal::TextBox<Iterator>::text const):
2227         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localStartOffset const):
2228         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localEndOffset const):
2229         (WebCore::LineLayoutTraversal::TextBox<Iterator>::length const):
2230         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLastOnLine const):
2231         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLast const):
2232
2233         Make a template class.
2234
2235         (WebCore::LineLayoutTraversal::hasTextBoxes): Deleted.
2236
2237 2019-09-30  Rob Buis  <rbuis@igalia.com>
2238
2239         No-Cors check should take into account same-origin
2240         https://bugs.webkit.org/show_bug.cgi?id=202353
2241
2242         Reviewed by Youenn Fablet.
2243
2244         No-Cors check should take into account same-origin, in that case the
2245         check should bail out, since same-origin is already handled in
2246         the first step of [1].
2247
2248         Test: imported/web-platform-tests/fetch/api/redirect/redirect-mode.any.html
2249
2250         [1] https://fetch.spec.whatwg.org/#main-fetch Step 5
2251
2252         * loader/cache/CachedResourceLoader.cpp:
2253         (WebCore::CachedResourceLoader::canRequest):
2254
2255 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
2256
2257         [Nicosia] Complete ScrollingTreeNicosia::createScrollingTreeNode()
2258         https://bugs.webkit.org/show_bug.cgi?id=202358
2259
2260         Reviewed by Carlos Garcia Campos.
2261
2262         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
2263         (WebCore::ScrollingTreeNicosia::createScrollingTreeNode):
2264         Return appropriate objects for the remaining node types.
2265
2266 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
2267
2268         [Nicosia] Add missing conversion casts for LayerRepresentation objects
2269         https://bugs.webkit.org/show_bug.cgi?id=202357
2270
2271         Reviewed by Carlos Garcia Campos.
2272
2273         After r250491, we have to request explicit conversion of
2274         LayerRepresentation objects to Nicosia::PlatformLayer pointers.
2275
2276         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp:
2277         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2278         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
2279         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
2280         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
2281         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
2282         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp:
2283         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2284         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
2285         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
2286         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
2287         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
2288         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2289         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp:
2290         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2291
2292 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
2293
2294         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
2295         https://bugs.webkit.org/show_bug.cgi?id=202256
2296         <rdar://problem/55772092>
2297
2298         Reviewed by Simon Fraser.
2299
2300         Make the scroll container and scrolled contents layer holders
2301         platform-independent by using the LayerRepresentation as the underlying
2302         type for the two member variables in ScrollingTreeScrollingNode.
2303
2304         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2305         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2306         * page/scrolling/ScrollingTreeScrollingNode.h:
2307         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2308         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
2309         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2310         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
2311
2312 2019-09-28  Brent Fulgham  <bfulgham@apple.com>
2313
2314         [FTW] Correct compositing, shadow, and radial gradient implementations
2315         https://bugs.webkit.org/show_bug.cgi?id=202177
2316
2317         Reviewed by Fujii Hironori.
2318
2319         This patch corrects a number of implementation errors in basic Canvas
2320         drawing operations.
2321
2322         Tested by canvas/philip/tests 
2323
2324         * platform/graphics/win/Direct2DOperations.cpp:
2325         (WebCore::Direct2D::State::setCompositeOperation): Initialize blend and
2326         composite modes to correct defaults.
2327         (WebCore::Direct2D::drawWithShadowHelper): Correct value used for blur
2328         standard deviation to more closely match other browser output.
2329         * platform/graphics/win/Direct2DUtilities.cpp:
2330         (WebCore::Direct2D::createBitmapCopyFromContext): Added helper function.
2331         * platform/graphics/win/Direct2DUtilities.h:
2332         * platform/graphics/win/GradientDirect2D.cpp:
2333         (WebCore::Gradient::generateGradient): Properly handle the case of a non-zero
2334         initial gradient radius. Properly compute the final radius.
2335         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2336         (WebCore::ImageBufferData::readDataFromBitmapIfNeeded const): Update to use ID2D1DeviceContext
2337         from platformContext, rather than searching for it each time.
2338         (WebCore::ImageBufferData::compatibleBitmap): Ditto.
2339         * platform/graphics/win/PlatformContextDirect2D.cpp:
2340         (WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Grab the ID2D1DeviceContext for
2341         the RenderTarget at construction time.
2342         (WebCore::PlatformContextDirect2D::setRenderTarget): Ditto.
2343         (WebCore::PlatformContextDirect2D::endDraw): Perform compositing operations when needed.
2344         (WebCore::PlatformContextDirect2D::compositeIfNeeded): Added.
2345         (WebCore::PlatformContextDirect2D::setBlendAndCompositeMode): Update to properly set the
2346         blend and compositing mode (depending on global value set for the canvas.)
2347         * platform/graphics/win/PlatformContextDirect2D.h:
2348         (WebCore::PlatformContextDirect2D::deviceContext):
2349         (WebCore::PlatformContextDirect2D::setRenderTarget): Deleted.
2350         (WebCore::PlatformContextDirect2D::setBlendMode): Deleted.
2351         (WebCore::PlatformContextDirect2D::setCompositeMode): Deleted.
2352
2353 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
2354
2355         Tighten up LayerRepresentation operators
2356         https://bugs.webkit.org/show_bug.cgi?id=202344
2357
2358         Reviewed by Simon Fraser.
2359
2360         Make the operators on the LayerRepresentation class explicit.
2361         Additionally, the bool operator is added to the class, allowing objects
2362         of this class to be safely used in boolean contexts like null checks.
2363         Before, use in such contexts fell back to using the
2364         GraphicsLayer::PlatformLayerID operator which caused asserts when the
2365         internal representation was of different type.
2366
2367         While the explicit operators prevent misuse, they do require additional
2368         conversion casts to retrieve the internal LayerRepresentation value.
2369
2370         * page/scrolling/ScrollingStateNode.h:
2371         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
2372         (WebCore::LayerRepresentation::operator PlatformLayer* const):
2373         (WebCore::LayerRepresentation::operator GraphicsLayer::PlatformLayerID const):
2374         (WebCore::LayerRepresentation::operator bool const):
2375         (WebCore::LayerRepresentation::toRepresentation const):
2376         Add a missing ASSERT_NOT_REACHED() invocation.
2377         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2378         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2379         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2380         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2381         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
2382         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2383         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2384         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2385         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2386         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2387         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2388         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2389
2390 2019-09-29  Zalan Bujtas  <zalan@apple.com>
2391
2392         [LFC][IFC] Remove InlineLayout abstraction layer
2393         https://bugs.webkit.org/show_bug.cgi?id=202352
2394         <rdar://problem/55811532>
2395
2396         Reviewed by Antti Koivisto.
2397
2398         Move InlineLayout functions to InlineFormattingContext. Now inline layout has
2399         1. InlineFormattingContext -high level layout and preferred width computation, collecting inline content, constructing display boxes
2400         2. LineLayout -responsible for placing inline content on the current line (partial inline content handling, line breaking etc)
2401         3. Line -represents an actual line, turns inline content into runs.
2402
2403         * Sources.txt:
2404         * WebCore.xcodeproj/project.pbxproj:
2405         * layout/inlineformatting/InlineFormattingContext.cpp:
2406         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2407         (WebCore::Layout::InlineFormattingContext::lineLayout):
2408         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2409         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2410         (WebCore::Layout::InlineFormattingContext::initialConstraintsForLine):
2411         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
2412         * layout/inlineformatting/InlineFormattingContext.h:
2413         (WebCore::Layout::InlineFormattingContext::InlineLayout::layoutState const): Deleted.
2414         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const): Deleted.
2415         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const): Deleted.
2416         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingState): Deleted.
2417         (WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const): Deleted.
2418         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: Removed.
2419         * layout/inlineformatting/InlineFormattingState.h:
2420         (WebCore::Layout::InlineFormattingState::inlineItems const):
2421         * layout/inlineformatting/InlineLineLayout.cpp: Added.
2422         (WebCore::Layout::inlineItemWidth):
2423         (WebCore::Layout::LineLayout::LineInput::LineInput):
2424         (WebCore::Layout::LineLayout::UncommittedContent::add):
2425         (WebCore::Layout::LineLayout::UncommittedContent::reset):
2426         (WebCore::Layout::LineLayout::LineLayout):
2427         (WebCore::Layout::LineLayout::commitPendingContent):
2428         (WebCore::Layout::LineLayout::close):
2429         (WebCore::Layout::LineLayout::placeInlineItem):
2430         (WebCore::Layout::LineLayout::layout):
2431         * layout/inlineformatting/InlineLineLayout.h: Added.
2432         (WebCore::Layout::LineLayout::formattingContext const):
2433         (WebCore::Layout::LineLayout::UncommittedContent::runs):
2434         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
2435         (WebCore::Layout::LineLayout::UncommittedContent::size const):
2436         (WebCore::Layout::LineLayout::UncommittedContent::width const):
2437
2438 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
2439
2440         [Nicosia] Add overflow, overflow proxy node implementations
2441         https://bugs.webkit.org/show_bug.cgi?id=202306
2442
2443         Reviewed by Carlos Garcia Campos.
2444
2445         Add the ScrollingTreeOverflowScrollProxyNode and
2446         ScrollingTreeOverflowScrollingNodeNicosia classes, implementing the
2447         missing overlfow node types. Both implementations are based on the
2448         corresponsing classes for Cocoa/Mac platforms and should ideally
2449         share most of the platform-agnostic logic.
2450
2451         * SourcesWPE.txt:
2452         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp: Added.
2453         (WebCore::ScrollingTreeOverflowScrollProxyNode::create):
2454         (WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
2455         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2456         (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
2457         (WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
2458         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h: Added.
2459         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: Added.
2460         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::create):
2461         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia):
2462         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren):
2463         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::adjustedScrollPosition const):
2464         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
2465         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
2466         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: Added.
2467
2468 2019-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2469
2470         Crash when removing the target element while animating its attributes
2471         https://bugs.webkit.org/show_bug.cgi?id=202247
2472
2473         Reviewed by Darin Adler.
2474
2475         If SMIL is animating a CSS attribute, there is a chance the animation is
2476         ended while it is being started or progressed. For that reason, the member
2477         SVGAnimateElementBase::m_animator has to be made RefPtr and it has to be
2478         be protected in resetAnimatedType() and calculateAnimatedValue().
2479
2480         While SMILTimeContainer::updateAnimations() is calling progress() for the
2481         scheduled animation elements, SMILTimeContainer::unschedule() might get
2482         called if processing an animation causes events to be dispatched. For that
2483         reason we need to copy the scheduled animations Vector before processing
2484         them so we avoid changing the Vector while looping through its items.
2485
2486         Remove the guard SMILTimeContainer::m_preventScheduledAnimationsChanges
2487         which was added in r129670 for debugging purposes. In some situations, 
2488         the scheduled animations map could be modified out from under some of the
2489         functions of SMILTimeContainer.
2490
2491         Test: svg/animations/animate-and-remove-target-element.html
2492
2493         * svg/SVGAnimateElementBase.cpp:
2494         (WebCore::SVGAnimateElementBase::resetAnimatedType):
2495         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2496         * svg/SVGAnimateElementBase.h:
2497         * svg/SVGElement.cpp:
2498         (WebCore::SVGElement::createAnimator):
2499         * svg/SVGElement.h:
2500         * svg/animation/SMILTimeContainer.cpp:
2501         (WebCore::SMILTimeContainer::schedule):
2502         (WebCore::SMILTimeContainer::unschedule):
2503         (WebCore::SMILTimeContainer::setElapsed):
2504         (WebCore::SMILTimeContainer::sortByPriority):
2505         (WebCore::SMILTimeContainer::processAnimations):
2506         (WebCore::SMILTimeContainer::processScheduledAnimations):
2507         (WebCore::SMILTimeContainer::updateAnimations):
2508         (WebCore::SMILTimeContainer::~SMILTimeContainer): Deleted.
2509         * svg/animation/SMILTimeContainer.h:
2510         * svg/animation/SVGSMILElement.cpp:
2511         (WebCore::SVGSMILElement::calculateNextProgressTime const):
2512         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2513         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2514         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
2515         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
2516         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
2517         * svg/properties/SVGAttributeAnimator.h:
2518         * svg/properties/SVGMemberAccessor.h:
2519         (WebCore::SVGMemberAccessor::createAnimator const):
2520         * svg/properties/SVGPrimitivePropertyAnimator.h:
2521         (WebCore::SVGPrimitivePropertyAnimator::create):
2522         * svg/properties/SVGPropertyAnimatorFactory.h:
2523         (WebCore::SVGPropertyAnimatorFactory::createAnimator):
2524         * svg/properties/SVGPropertyOwnerRegistry.h:
2525         * svg/properties/SVGPropertyRegistry.h:
2526         * svg/properties/SVGValuePropertyAnimatorImpl.h:
2527         * svg/properties/SVGValuePropertyListAnimatorImpl.h:
2528
2529 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2530
2531         [LFC][IFC] Move horizontal alignment to Line
2532         https://bugs.webkit.org/show_bug.cgi?id=202351
2533         <rdar://problem/55810139>
2534
2535         Reviewed by Antti Koivisto.
2536
2537         Line should be able to finalize the run placement including horizontal alignment.
2538
2539         * layout/Verification.cpp:
2540         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2541         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2542         (WebCore::Layout::LineInput::LineInput):
2543         (WebCore::Layout::LineLayout::LineLayout):
2544         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
2545         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2546         * layout/inlineformatting/InlineLine.cpp:
2547         (WebCore::Layout::Line::Line):
2548         (WebCore::Layout::Line::isVisuallyEmpty const):
2549         (WebCore::Layout::Line::close):
2550         (WebCore::Layout::Line::verticalAlignContent):
2551         (WebCore::Layout::Line::horizontalAlignContent):
2552         (WebCore::Layout::Line::appendInlineContainerStart):
2553         (WebCore::Layout::Line::appendTextContent):
2554         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2555         (WebCore::Layout::Line::appendHardLineBreak):
2556         (WebCore::Layout::Line::inlineItemContentHeight const):
2557         * layout/inlineformatting/InlineLine.h:
2558
2559 2019-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2560
2561         [IDL] Support record<DOMString, *Callback> in bindings
2562         https://bugs.webkit.org/show_bug.cgi?id=202326
2563
2564         Reviewed by Sam Weinig.
2565
2566         Currently, IDLRecord's converter assumes that the value type (template argument V) can be converted by passing
2567         in only an ExecState and the JSValue, since it calls `auto typedValue = Converter<V>::convert(state, subValue)`.
2568         However, IDLCallbackFunctions additionally require the JSDOMGlobalObject (see JSDOMConverterCallbacks.h). This
2569         results in a compilation error in generated code, when attempting to convert the record.
2570
2571         To fix this, teach Converter<IDLRecord<K, V>> to accept three arguments (the ExecState, value, and global
2572         object) in the case where V requires the global object. Additionally, let the bindings generator know that
2573         JSValue to native object conversion requires the global object, by returning whether or not the value type of
2574         the IDL record requires the global object, in the case where the given type is a record.
2575
2576         * bindings/js/JSDOMConvertRecord.h:
2577         * bindings/scripts/CodeGeneratorJS.pm:
2578         (JSValueToNativeDOMConvertNeedsGlobalObject):
2579         * bindings/scripts/test/JS/JSTestObj.cpp:
2580
2581         Test this scenario by augmenting TestObj.idl with record<DOMString, VoidCallback>.
2582
2583         (WebCore::jsTestObjStringVoidCallbackRecordAttrGetter):
2584         (WebCore::jsTestObjStringVoidCallbackRecordAttr):
2585         (WebCore::setJSTestObjStringVoidCallbackRecordAttrSetter):
2586         (WebCore::setJSTestObjStringVoidCallbackRecordAttr):
2587         * bindings/scripts/test/TestObj.idl:
2588
2589 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2590
2591         [LFC][IFC] Line::InitialConstraints's heightAndBaseline should be optional
2592         https://bugs.webkit.org/show_bug.cgi?id=202348
2593
2594         Reviewed by Antti Koivisto.
2595
2596         Vertical properties are undefined while computing the preferred width.
2597
2598         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2599         (WebCore::Layout::LineInput::LineInput):
2600         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2601         * layout/inlineformatting/InlineLine.cpp:
2602         (WebCore::Layout::Line::Line):
2603         * layout/inlineformatting/InlineLine.h:
2604
2605 2019-09-28  Chris Dumez  <cdumez@apple.com>
2606
2607         [Experiment][iOS] Add temporary HTTP header to distinguish iPads for requests to Google
2608         https://bugs.webkit.org/show_bug.cgi?id=202335
2609         <rdar://problem/55790994>
2610
2611         Reviewed by Maciej Stachowiak.
2612
2613         * loader/cache/CachedResourceLoader.cpp:
2614         (WebCore::CachedResourceLoader::requestResource):
2615         * platform/network/HTTPHeaderNames.in:
2616
2617 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2618
2619         [LFC][IFC] Line::Box should have a const public interface
2620         https://bugs.webkit.org/show_bug.cgi?id=202336
2621         <rdar://problem/55798628>
2622
2623         Reviewed by Antti Koivisto.
2624
2625         Clean up Line::Box interface.
2626
2627         * layout/inlineformatting/InlineLine.cpp:
2628         (WebCore::Layout::Line::close):
2629         * layout/inlineformatting/InlineLine.h:
2630         (WebCore::Layout::Line::Run::displayRun const):
2631         (WebCore::Layout::Line::Run::isVisuallyEmpty const):
2632         (WebCore::Layout::Line::Run::expand):
2633         (WebCore::Layout::Line::Run::displayRun): Deleted.
2634
2635 2019-09-27  Chris Dumez  <cdumez@apple.com>
2636
2637         Pages using WebGLRenderingContext fail to enter the back/forward cache
2638         https://bugs.webkit.org/show_bug.cgi?id=202318
2639         <rdar://problem/55783612>
2640
2641         Reviewed by Tim Horton.
2642
2643         Allow pages with a WebGLRenderingContext to enter the back/forward cache by updating the
2644         implementation to use SuspendableTimers to fire JS events. This guarantees that no events
2645         will be fired (and thus no JS will run) while in the page cache.
2646
2647         This was preventing some of the pages on weather.com and facebook.com from entering the
2648         back/forward cache.
2649
2650         Test: fast/canvas/webgl/canvas-webgl-page-cache.html
2651
2652         * dom/DocumentEventQueue.cpp:
2653         * html/canvas/WebGLRenderingContextBase.cpp:
2654         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2655         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const):
2656         (WebCore::WebGLRenderingContextBase::suspend):
2657         (WebCore::WebGLRenderingContextBase::resume):
2658         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
2659         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2660         (WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification):
2661         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
2662         * html/canvas/WebGLRenderingContextBase.h:
2663         * page/DOMTimer.cpp:
2664         (WebCore::DOMTimer::DOMTimer):
2665         * page/DOMTimer.h:
2666         * page/SuspendableTimer.cpp:
2667         (WebCore::SuspendableTimerBase::SuspendableTimerBase):
2668         (WebCore::SuspendableTimerBase::hasPendingActivity const):
2669         (WebCore::SuspendableTimerBase::stop):
2670         (WebCore::SuspendableTimerBase::suspend):
2671         (WebCore::SuspendableTimerBase::resume):
2672         (WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const):
2673         (WebCore::SuspendableTimerBase::didStop):
2674         (WebCore::SuspendableTimerBase::cancel):
2675         (WebCore::SuspendableTimerBase::startRepeating):
2676         (WebCore::SuspendableTimerBase::startOneShot):
2677         (WebCore::SuspendableTimerBase::repeatInterval const):
2678         (WebCore::SuspendableTimerBase::augmentFireInterval):
2679         (WebCore::SuspendableTimerBase::augmentRepeatInterval):
2680         (WebCore::SuspendableTimer::activeDOMObjectName const):
2681         * page/SuspendableTimer.h:
2682
2683 2019-09-27  Adrian Perez de Castro  <aperez@igalia.com>
2684
2685         [GTK][WPE] Fixes for non-unified builds after r249714
2686         https://bugs.webkit.org/show_bug.cgi?id=202304
2687
2688         Reviewed by Youenn Fablet.
2689
2690         No new tests needed.
2691
2692         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: Add missing inclusion of Frame.h
2693         to make the compiler stop complaining about Frame being used without being defined.
2694         * inspector/InspectorShaderProgram.h: Add missing inclusion of wtf/Variant.h, where
2695         WTF::Monostate is defined; and prefixed the usage with its namespace.
2696
2697 2019-09-27  Andres Gonzalez  <andresg_22@apple.com>
2698
2699         Support accessibility for <figure> element on iOS.
2700         https://bugs.webkit.org/show_bug.cgi?id=202272
2701         <rdar://problem/54789907>
2702
2703         Reviewed by Chris Fleizach.
2704
2705         Test: accessibility/ios-simulator/figure-element.html
2706
2707         Added a role description for the <figure> element.
2708         * accessibility/AccessibilityObject.cpp:
2709         (WebCore::AccessibilityObject::roleDescription const):
2710
2711 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2712
2713         [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
2714         https://bugs.webkit.org/show_bug.cgi?id=202331
2715         <rdar://problem/55629493>
2716
2717         Reviewed by Tim Horton.
2718
2719         Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
2720         This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.
2721
2722         * page/Quirks.cpp:
2723         (WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
2724         * page/Quirks.h:
2725
2726 2019-09-27  Per Arne Vollan  <pvollan@apple.com>
2727
2728         [Win] Crash under FontCache::lastResortFallbackFont
2729         https://bugs.webkit.org/show_bug.cgi?id=202325
2730         <rdar://problem/47856730>
2731
2732         Reviewed by Brent Fulgham.
2733
2734         As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font  
2735         on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.
2736  
2737         No new tests. I have not been able to reproduce this issue. 
2738
2739         * platform/graphics/win/FontCacheWin.cpp:
2740         (WebCore::FontCache::lastResortFallbackFont):
2741
2742 2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>
2743
2744         Unreviewed, rolling out r250397.
2745
2746         caused failure on iOS 13
2747
2748         Reverted changeset:
2749
2750         "REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-
2751         credential-create-success-u2f.https.html is failing"
2752         https://bugs.webkit.org/show_bug.cgi?id=201620
2753         https://trac.webkit.org/changeset/250397
2754
2755 2019-09-27  Jer Noble  <jer.noble@apple.com>
2756
2757         [iOS] Vimeo fails to AirPlay in desktop mode
2758         https://bugs.webkit.org/show_bug.cgi?id=202322
2759
2760         Reviewed by Eric Carlson.
2761
2762         Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
2763         second video element containing a HLS stream to correctly start AirPlaying when the
2764         system route changes.
2765
2766         * html/HTMLMediaElement.cpp:
2767         (WebCore::HTMLMediaElement::finishInitialization):
2768         * page/Quirks.cpp:
2769         (WebCore::Quirks::needsPreloadAutoQuirk const):
2770         * page/Quirks.h:
2771
2772 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2773
2774         [LFC][IFC] Line::close should merge the text runs.
2775         https://bugs.webkit.org/show_bug.cgi?id=202319
2776         <rdar://problem/55785949>
2777
2778         Reviewed by Antti Koivisto.
2779
2780         Now Line::close returns the final Display::Run list.
2781
2782         * layout/displaytree/DisplayRect.h:
2783         (WebCore::Display::Rect::expandHorizontally):
2784         (WebCore::Display::Rect::expandVertically):
2785         (WebCore::Display::Rect::expand):
2786         * layout/displaytree/DisplayRun.h:
2787         (WebCore::Display::Run::expandVertically):
2788         (WebCore::Display::Run::expandHorizontally):
2789         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2790         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2791         * layout/inlineformatting/InlineLine.cpp:
2792         (WebCore::Layout::Line::close):
2793         * layout/inlineformatting/InlineLine.h:
2794         (WebCore::Layout::Line::Run::displayRun):
2795
2796 2019-09-27  Chris Dumez  <cdumez@apple.com>
2797
2798         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
2799         https://bugs.webkit.org/show_bug.cgi?id=202314
2800         <rdar://problem/55783482>
2801
2802         Reviewed by Alex Christensen.
2803
2804         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache.
2805         This was preventing all pages on Facebook.com to enter the back/forward cache.
2806
2807         No new tests, updated existing test.
2808
2809         * history/PageCache.cpp:
2810         (WebCore::canCacheFrame):
2811
2812 2019-09-27  Devin Rousso  <drousso@apple.com>
2813
2814         Flaky Test: inspector/canvas/updateShader.html
2815         https://bugs.webkit.org/show_bug.cgi?id=202186
2816         <rdar://problem/55716053>
2817
2818         Reviewed by Joseph Pecoraro.
2819
2820         If the `WebGLProgram` outlives it's `WebGLRenderingContext`, the `ScriptExecutionContext*`
2821         that was provided in the constructor won't be invalidated leading to the bad access crash.
2822
2823         Rather than pass the `ScriptExecutionContext*` directly, have `WebGLProgram` inherit from
2824         `ContextDestructionObserver` so that it can propertly invalidate (and notify Web Inspector)
2825         when the related context is about to be destroyed.
2826
2827         Test: inspector/canvas/updateShader.html
2828
2829         * html/canvas/WebGLProgram.h:
2830         (WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
2831         * html/canvas/WebGLProgram.cpp:
2832         (WebCore::WebGLProgram::WebGLProgram):
2833         (WebCore::WebGLProgram::contextDestroyed): Added.
2834
2835 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2836
2837         [LFC][IFC] Replace Line::Run's logicalRect/textContext with Display::Run
2838         https://bugs.webkit.org/show_bug.cgi?id=202313
2839         <rdar://problem/55782430>
2840
2841         Reviewed by Antti Koivisto.
2842
2843         Display::Run is a container for logical rect and text context. Let's replace Line::Run's logical rect/text context with Display::Run.
2844
2845         * layout/Verification.cpp:
2846         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2847         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2848         * layout/displaytree/DisplayRun.h:
2849         (WebCore::Display::Run::logicalRect const):
2850         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2851         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2852         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
2853         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2854         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2855         * layout/inlineformatting/InlineFormattingState.h:
2856         (WebCore::Layout::InlineFormattingState::addInlineRun):
2857         * layout/inlineformatting/InlineLine.cpp:
2858         (WebCore::Layout::Line::Run::Run):
2859         (WebCore::Layout::Line::isVisuallyEmpty const):
2860         (WebCore::Layout::Line::appendNonBreakableSpace):
2861         (WebCore::Layout::Line::appendTextContent):
2862         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2863         (WebCore::Layout::Line::appendHardLineBreak):
2864         * layout/inlineformatting/InlineLine.h:
2865         (WebCore::Layout::Line::Run::displayRun const):
2866         (WebCore::Layout::Line::Run::logicalRect const):
2867         (WebCore::Layout::Line::Run::adjustLogicalTop):
2868         (WebCore::Layout::Line::Run::moveVertically):
2869         (WebCore::Layout::Line::Run::moveHorizontally):
2870         (WebCore::Layout::Line::Run::textContext const): Deleted.
2871         * layout/layouttree/LayoutTreeBuilder.cpp:
2872         (WebCore::Layout::outputInlineRuns):
2873
2874 2019-09-27  Truitt Savell  <tsavell@apple.com>
2875
2876         Unreviewed, rolling out r250415.
2877
2878         Broke iOS debug testing with 50 crashes and 850 API failure
2879
2880         Reverted changeset:
2881
2882         "ScrollingTreeScrollingNode: use LayerRepresentation for
2883         scroll container, scrolled contents layers"
2884         https://bugs.webkit.org/show_bug.cgi?id=202256
2885         https://trac.webkit.org/changeset/250415
2886
2887 2019-09-27  Alex Christensen  <achristensen@webkit.org>
2888
2889         Move service worker process termination delay disabling from process pool to website data store
2890         https://bugs.webkit.org/show_bug.cgi?id=202308
2891
2892         Reviewed by Chris Dumez.
2893
2894         * workers/service/server/SWServer.cpp:
2895         (WebCore::SWServer::SWServer):
2896         (WebCore::SWServer::unregisterServiceWorkerClient):
2897         * workers/service/server/SWServer.h:
2898         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay): Deleted.
2899
2900 2019-09-27  Chris Dumez  <cdumez@apple.com>
2901
2902         IDBRequest should not prevent a page from entering the back/forward cache
2903         https://bugs.webkit.org/show_bug.cgi?id=202270
2904         <rdar://problem/55744717>
2905
2906         Reviewed by Youenn Fablet.
2907
2908         Update IDBRequest::canSuspendForDocumentSuspension() to return true instead of
2909         false. IDBRequest can only fire 2 events (error / success) and for both its
2910         merely enqueues the Event to the DocumentEventQueue. The DocumentEventQueue
2911         uses a SuspendableTimer (which will be suspended while the document is in the
2912         page cache) so there is no risk of firing the events (and thus running script)
2913         while in the page cache.
2914
2915         Test: storage/indexeddb/IDBRequest-page-cache.html
2916
2917         * Modules/indexeddb/IDBRequest.cpp:
2918         (WebCore::IDBRequest::canSuspendForDocumentSuspension const):
2919
2920 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2921
2922         [LFC][IFC] Remove redundant Line::TextContext member variables
2923         https://bugs.webkit.org/show_bug.cgi?id=202300
2924         <rdar://problem/55769916>
2925
2926         Reviewed by Antti Koivisto.
2927
2928         This is in preparation for using Display::Run in Line::Run instead of Display::Rect + TextContext.
2929
2930         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2931         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
2932         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2933         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2934         * layout/inlineformatting/InlineLine.cpp:
2935         (WebCore::Layout::Line::Run::isWhitespace const):
2936         (WebCore::Layout::Line::Run::canBeExtended const):
2937         (WebCore::Layout::Line::isVisuallyEmpty const):
2938         (WebCore::Layout::Line::removeTrailingTrimmableContent):
2939         (WebCore::Layout::Line::trailingTrimmableWidth const):
2940         (WebCore::Layout::Line::appendTextContent):
2941         * layout/inlineformatting/InlineLine.h:
2942         (WebCore::Layout::Line::Run::isVisuallyEmpty const):
2943         (WebCore::Layout::Line::Run::setVisuallyIsEmpty):
2944         (WebCore::Layout::Line::Run::setTextIsCollapsed): Deleted.
2945
2946 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
2947
2948         [Nicosia] Implement frame scrolling functionality
2949         https://bugs.webkit.org/show_bug.cgi?id=202201
2950
2951         Reviewed by Carlos Garcia Campos.
2952
2953         Implement logic in the ScrollingTreeFrameScrollingNodeNicosia class,
2954         largely following the Mac port's implementation but skipping areas we
2955         don't support or can keep simple, like CSS scroll snap, frame pinning
2956         and more complex wheel event handling through the platform-specific
2957         delegate behavior.
2958
2959         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
2960         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
2961         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
2962         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
2963         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::adjustedScrollPosition const):
2964         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
2965         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
2966         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers):
2967         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
2968
2969 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
2970
2971         [Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the main thread
2972         https://bugs.webkit.org/show_bug.cgi?id=202275
2973
2974         Reviewed by Carlos Garcia Campos.
2975
2976         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
2977         (WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
2978         Handle wheel events that get rerouted through the main thread,
2979         dispatching them back to the scrolling thread so that they end up
2980         performing the desired scroll if possible.
2981
2982 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
2983
2984         [CoordinatedGraphics] support bounds origin
2985         https://bugs.webkit.org/show_bug.cgi?id=198998
2986
2987         Reviewed by Carlos Garcia Campos.
2988
2989         Add bounds-origin support to the CoordinatedGraphics stack. Currently we
2990         take the short-cut implementation of just combining the bounds origin
2991         and the position value and incorporating them into the layer transform
2992         we calculate in TextureMapperLayer.
2993
2994         Additional boilerplate code is added, as required, to relay the
2995         WebCore::GraphicsLayer change of bounds origin to the rendering system.
2996
2997         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2998         (Nicosia::CompositionLayer::flushState):
2999         * platform/graphics/texmap/TextureMapperLayer.cpp:
3000         (WebCore::TextureMapperLayer::computeTransformsRecursive):
3001         (WebCore::TextureMapperLayer::setBoundsOrigin):
3002         * platform/graphics/texmap/TextureMapperLayer.h:
3003         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3004         (WebCore::CoordinatedGraphicsLayer::setBoundsOrigin):
3005         (WebCore::CoordinatedGraphicsLayer::computePositionRelativeToBase):
3006         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3007
3008 2019-09-26  Zan Dobersek  <zdobersek@igalia.com>
3009
3010         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
3011         https://bugs.webkit.org/show_bug.cgi?id=202256
3012
3013         Reviewed by Simon Fraser.
3014
3015         Make the scroll container and scrolled contents layer holders
3016         platform-independent by using the LayerRepresentation as the underlying
3017         type for the two member variables in ScrollingTreeScrollingNode.
3018
3019         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3020         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
3021         * page/scrolling/ScrollingTreeScrollingNode.h:
3022         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3023         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
3024         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3025         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
3026
3027 2019-09-26  Chris Dumez  <cdumez@apple.com>
3028
3029         Pages frequently fails to enter the back/forward cache due to pending loads
3030         https://bugs.webkit.org/show_bug.cgi?id=202289
3031         <rdar://problem/55758506>
3032
3033         Reviewed by Geoffrey Garen.
3034
3035         Allow pages to enter the back / forward cache, even if they have pending loads.
3036         Note that these pending loads get cancelled. Also note that we won't enter page
3037         cache unless the 'load' event has been fired in the main frame, since a
3038         HistoryItem would not get created otherwise. This was causing frequent transient
3039         failures to enter the back / forward cache while browsing (e.g. on weather.com).
3040
3041         Test: http/tests/navigation/page-cache-pending-load.html
3042
3043         * history/PageCache.cpp:
3044         (WebCore::canCacheFrame):
3045         * loader/CrossOriginPreflightChecker.cpp:
3046         * loader/CrossOriginPreflightChecker.h:
3047         * loader/DocumentLoader.cpp:
3048         (WebCore::DocumentLoader::setMainDocumentError):
3049         (WebCore::DocumentLoader::stopLoading):
3050         * loader/DocumentLoader.h:
3051         * loader/DocumentThreadableLoader.cpp:
3052         * loader/DocumentThreadableLoader.h:
3053         * loader/cache/CachedResource.cpp:
3054         * loader/cache/CachedResource.h:
3055         * loader/cache/CachedResourceClient.h:
3056         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
3057         * page/DiagnosticLoggingKeys.cpp:
3058         (WebCore::DiagnosticLoggingKeys::mainFrameHasNotFinishedLoadingKey):
3059         * page/DiagnosticLoggingKeys.h:
3060
3061 2019-09-26  Zalan Bujtas  <zalan@apple.com>
3062
3063         [LFC][IFC] Line::Run should have a reference to the associated InlineItem
3064         https://bugs.webkit.org/show_bug.cgi?id=202288
3065         <rdar://problem/55758112>
3066
3067         Reviewed by Antti Koivisto.
3068
3069         It makes it clearer where the type and the layout box come from.
3070
3071         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3072         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3073         * layout/inlineformatting/InlineLine.cpp:
3074         (WebCore::Layout::Line::Run::Run):
3075         * layout/inlineformatting/InlineLine.h:
3076         (WebCore::Layout::Line::Run::layoutBox const):
3077         (WebCore::Layout::Line::Run::textContext const):
3078         (WebCore::Layout::Line::Run::isText const):
3079         (WebCore::Layout::Line::Run::isBox const):
3080         (WebCore::Layout::Line::Run::isLineBreak const):
3081         (WebCore::Layout::Line::Run::isContainerStart const):
3082         (WebCore::Layout::Line::Run::isContainerEnd const):
3083         (WebCore::Layout::Line::Run::type const): Deleted.
3084
3085 2019-09-26  Zalan Bujtas  <zalan@apple.com>
3086
3087         [LFC][IFC] Remove redundant Line::Content
3088         https://bugs.webkit.org/show_bug.cgi?id=202284
3089         <rdar://problem/55757187>
3090
3091         Reviewed by Antti Koivisto.
3092
3093         Line::Content is really just a list or runs at this point.
3094
3095         * layout/inlineformatting/InlineFormattingContext.h:
3096         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3097         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3098         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3099         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3100         * layout/inlineformatting/InlineLine.cpp:
3101         (WebCore::Layout::Line::Run::Run):
3102         (WebCore::Layout::Line::Line):
3103         (WebCore::Layout::Line::isVisuallyEmpty const):
3104         (WebCore::Layout::Line::close):
3105         (WebCore::Layout::Line::appendNonBreakableSpace):
3106         (WebCore::Layout::Line::appendTextContent):
3107         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3108         (WebCore::Layout::Line::appendHardLineBreak):
3109         (WebCore::Layout::Line::Content::Run::Run): Deleted.
3110         * layout/inlineformatting/InlineLine.h:
3111         (WebCore::Layout::Line::Run::layoutBox const):
3112         (WebCore::Layout::Line::Run::logicalRect const):
3113         (WebCore::Layout::Line::Run::textContext const):
3114         (WebCore::Layout::Line::Run::type const):
3115         (WebCore::Layout::Line::Run::isText const):
3116         (WebCore::Layout::Line::Run::isBox const):
3117         (WebCore::Layout::Line::Run::isLineBreak const):
3118         (WebCore::Layout::Line::Run::isContainerStart const):
3119         (WebCore::Layout::Line::Run::isContainerEnd const):
3120         (WebCore::Layout::Line::Run::adjustLogicalTop):
3121         (WebCore::Layout::Line::Run::moveVertically):
3122         (WebCore::Layout::Line::Run::moveHorizontally):
3123         (WebCore::Layout::Line::Run::setTextIsCollapsed):
3124         (WebCore::Layout::Line::Content::Run::layoutBox const): Deleted.
3125         (WebCore::Layout::Line::Content::Run::logicalRect const): Deleted.
3126         (WebCore::Layout::Line::Content::Run::textContext const): Deleted.
3127         (WebCore::Layout::Line::Content::Run::type const): Deleted.
3128         (WebCore::Layout::Line::Content::Run::isText const): Deleted.
3129         (WebCore::Layout::Line::Content::Run::isBox const): Deleted.
3130         (WebCore::Layout::Line::Content::Run::isLineBreak const): Deleted.
3131         (WebCore::Layout::Line::Content::Run::isContainerStart const): Deleted.
3132         (WebCore::Layout::Line::Content::Run::isContainerEnd const): Deleted.
3133         (WebCore::Layout::Line::Content::Run::adjustLogicalTop): Deleted.
3134         (WebCore::Layout::Line::Content::Run::moveVertically): Deleted.
3135         (WebCore::Layout::Line::Content::Run::moveHorizontally): Deleted.
3136         (WebCore::Layout::Line::Content::Run::setTextIsCollapsed): Deleted.
3137         (WebCore::Layout::Line::Content::runs const): Deleted.
3138         (WebCore::Layout::Line::Content::runs): Deleted.
3139
3140 2019-09-26  Zalan Bujtas  <zalan@apple.com>
3141
3142         [LFC][IFC] Move Line::Content::m_lineBox to Line.
3143         https://bugs.webkit.org/show_bug.cgi?id=202280
3144         <rdar://problem/55755798>
3145
3146         Reviewed by Antti Koivisto.
3147
3148         This is in preparation for Line producing Display::Runs instead of Line::Runs.
3149
3150         * layout/inlineformatting/InlineFormattingContext.h:
3151         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3152         (WebCore::Layout::LineLayout::close):
3153         (WebCore::Layout::LineLayout::placeInlineItem):
3154         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
3155         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
3156         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3157         * layout/inlineformatting/InlineLine.cpp:
3158         (WebCore::Layout::Line::Line):
3159         (WebCore::Layout::Line::close):
3160         (WebCore::Layout::Line::removeTrailingTrimmableContent):
3161         (WebCore::Layout::Line::moveLogicalLeft):
3162         (WebCore::Layout::Line::appendNonBreakableSpace):
3163         (WebCore::Layout::Line::appendTextContent):
3164         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3165         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
3166         * layout/inlineformatting/InlineLine.h:
3167         (WebCore::Layout::Line::Content::runs const):
3168         (WebCore::Layout::Line::availableWidth const):
3169         (WebCore::Layout::Line::lineBox const):
3170         (WebCore::Layout::Line::logicalTop const):
3171         (WebCore::Layout::Line::logicalBottom const):
3172         (WebCore::Layout::Line::logicalLeft const):
3173         (WebCore::Layout::Line::logicalHeight const):
3174         (WebCore::Layout::Line::contentLogicalWidth const):
3175         (WebCore::Layout::Line::contentLogicalRight const):
3176         (WebCore::Layout::Line::baselineOffset const):
3177         (WebCore::Layout::Line::Content::lineBox const): Deleted.
3178         (WebCore::Layout::Line::Content::lineBox): Deleted.
3179         (WebCore::Layout::Line::Content::setLineBox): Deleted.
3180
3181 2019-09-26  Jiewen Tan  <jiewen_tan@apple.com>
3182
3183         REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success-u2f.https.html is failing
3184         https://bugs.webkit.org/show_bug.cgi?id=201620
3185
3186         Unreviewed, roll back part of r249737 to confirm the cause.
3187
3188         * Modules/webauthn/fido/U2fResponseConverter.cpp:
3189         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
3190
3191 2019-09-26  Truitt Savell  <tsavell@apple.com>
3192
3193         Unreviewed, rolling out r250385.
3194
3195         Broke imported/w3c/web-platform-tests/svg/animations/syncbase-
3196         remove-add-while-running.html on all platforms. Which was
3197         caught by EWS
3198
3199         Reverted changeset:
3200
3201         "Non-callable "handleEvent" property is silently ignored"
3202         https://bugs.webkit.org/show_bug.cgi?id=200066
3203         https://trac.webkit.org/changeset/250385
3204
3205 2019-09-26  Kate Cheney  <katherine_cheney@apple.com>
3206
3207         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
3208         https://bugs.webkit.org/show_bug.cgi?id=195420
3209         <rdar://problem/54213551> 
3210
3211         Reviewed by Brent Fulgham.
3212
3213         Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html
3214                http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
3215                http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
3216                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
3217                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
3218                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
3219                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
3220                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
3221                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
3222                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
3223                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
3224                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
3225                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
3226                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
3227                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
3228                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
3229                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
3230                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
3231                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
3232                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
3233                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
3234                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
3235                http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
3236                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
3237                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
3238                http/tests/resourceLoadStatistics/cookie-deletion-database.html
3239                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
3240                http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
3241                http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
3242                http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
3243                http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
3244                http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
3245                http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
3246                http/tests/resourceLoadStatistics/enable-debug-mode-database.html
3247                http/tests/resourceLoadStatistics/grandfathering-database.html
3248                http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
3249                http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
3250                http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
3251                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3252                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3253                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3254                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3255                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3256                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3257                http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
3258                http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
3259                http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
3260                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
3261                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
3262                http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
3263                http/tests/resourceLoadStatistics/prune-statistics-database.html
3264                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3265                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3266                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3267                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3268                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
3269                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
3270                http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
3271                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
3272                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
3273                http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
3274                http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
3275                http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
3276                http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html
3277
3278         * platform/sql/SQLiteDatabase.h:
3279         Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database 
3280         to clear out the database.
3281
3282 2019-09-26  Antti Koivisto  <antti@apple.com>
3283
3284         Use LineLayoutTraversal for RenderText functions
3285         https://bugs.webkit.org/show_bug.cgi?id=202266
3286
3287         Reviewed by Zalan Bujtas.
3288
3289         Replace a bunch of functions that have separate simple and complex line layout versions with
3290         shared functions that use LineLayoutTraversal.
3291
3292         * rendering/RenderText.cpp:
3293         (WebCore::RenderText::absoluteRects const):
3294         (WebCore::RenderText::firstRunLocation const):
3295         (WebCore::RenderText::linesBoundingBox const):
3296
3297         This is substantially simpler than RenderTextLineBoxes::boundingBox because it uses physical rects for all computations
3298         instead of using logical rects and flipping to physical at the end.
3299
3300         (WebCore::RenderText::caretMinOffset const):
3301         (WebCore::RenderText::caretMaxOffset const):
3302         (WebCore::RenderText::countRenderedCharacterOffsetsUntil const):
3303         (WebCore::containsOffset):
3304         (WebCore::RenderText::containsRenderedCharacterOffset const):
3305         (WebCore::RenderText::containsCaretOffset const):
3306         (WebCore::RenderText::hasRenderedText const):
3307         * rendering/RenderTextLineBoxes.cpp:
3308         (WebCore::RenderTextLineBoxes::boundingBox const): Deleted.
3309         (WebCore::RenderTextLineBoxes::firstRunLocation const): Deleted.
3310         (WebCore::RenderTextLineBoxes::hasRenderedText const): Deleted.
3311         (WebCore::RenderTextLineBoxes::caretMinOffset const): Deleted.
3312         (WebCore::RenderTextLineBoxes::caretMaxOffset const): Deleted.
3313         (WebCore::RenderTextLineBoxes::containsOffset const): Deleted.
3314         (WebCore::RenderTextLineBoxes::countCharacterOffsetsUntil const): Deleted.
3315         (WebCore::RenderTextLineBoxes::absoluteRects const): Deleted.
3316         * rendering/RenderTreeAsText.cpp:
3317         (WebCore::write):
3318         * rendering/SimpleLineLayout.cpp:
3319         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
3320         * rendering/SimpleLineLayout.h:
3321         (WebCore::SimpleLineLayout::Run::Run):
3322         * rendering/SimpleLineLayoutFunctions.cpp:
3323         (WebCore::SimpleLineLayout::computeFirstRunLocation): Deleted.
3324         * rendering/SimpleLineLayoutFunctions.h:
3325         (WebCore::SimpleLineLayout::findCaretMinimumOffset): Deleted.
3326         (WebCore::SimpleLineLayout::findCaretMaximumOffset): Deleted.
3327         (WebCore::SimpleLineLayout::containsOffset): Deleted.
3328         (WebCore::SimpleLineLayout::isTextRendered): Deleted.
3329         * rendering/SimpleLineLayoutResolver.h:
3330         (WebCore::SimpleLineLayout::RunResolver::Run::isLineBreak const):
3331         * rendering/line/LineLayoutTraversal.cpp:
3332         (WebCore::LineLayoutTraversal::TextBox::isLineBreak const):
3333         (WebCore::LineLayoutTraversal::firstTextBoxFor):
3334         (WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
3335         (WebCore::LineLayoutTraversal::textBoxesFor):
3336         (WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor): Deleted.
3337         (WebCore::LineLayoutTraversal::textBoxRangeFor): Deleted.
3338         * rendering/line/LineLayoutTraversal.h:
3339         (WebCore::LineLayoutTraversal::hasTextBoxes):
3340
3341 2019-09-26  Truitt Savell  <tsavell@apple.com>
3342
3343         Unreviewed, rolling out r250381.
3344
3345         broke multiple webgpu/ tests on Mojave WK2
3346
3347         Reverted changeset:
3348
3349         "Flaky Test: inspector/canvas/updateShader.html"
3350         https://bugs.webkit.org/show_bug.cgi?id=202186
3351         https://trac.webkit.org/changeset/250381
3352
3353 2019-09-26  Alexey Shvayka  <shvaikalesh@gmail.com>
3354
3355         Non-callable "handleEvent" property is silently ignored
3356         https://bugs.webkit.org/show_bug.cgi?id=200066
3357
3358         Reviewed by Darin Adler.
3359
3360         Tests: imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html
3361                imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
3362                imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
3363                imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html
3364
3365         * bindings/js/JSEventListener.cpp:
3366         (WebCore::JSEventListener::handleEvent): Report TypeError if "handleEvent" is not callable.
3367
3368 2019-09-26  Zalan Bujtas  <zalan@apple.com>
3369
3370         [LFC][IFC] Decouple Display::Run and Display::Box initializations.
3371         https://bugs.webkit.org/show_bug.cgi?id=202255
3372         <rdar://problem/55731445>
3373
3374         Reviewed by Antti Koivisto.
3375
3376         This is in preparation for moving Display::Run initialization to Line class.
3377
3378         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3379         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3380
3381 2019-09-26  Devin Rousso  <drousso@apple.com>
3382
3383         Flaky Test: inspector/canvas/updateShader.html
3384         https://bugs.webkit.org/show_bug.cgi?id=202186
3385         <rdar://problem/55716053>
3386
3387         Reviewed by Joseph Pecoraro.
3388
3389         If the `WebGPUPipeline`/`WebGLProgram` outlives it's `WebGPUDevice`/`WebGLRenderingContext`,
3390         the `ScriptExecutionContext*` that was provided in the constructor won't be invalidated
3391         leading to the bad access crash.
3392
3393         Rather than pass the `ScriptExecutionContext*` directly, have `WebGPUPipeline`/`WebGLProgram`
3394         extend from `ContextDestructionObserver` so that it can propertly invalidate (and notify Web
3395         Inspector) when the related context is about to be destroyed.
3396
3397         Test: inspector/canvas/updateShader.html
3398
3399         * Modules/webgpu/WebGPUPipeline.h:
3400         (WebCore::WebGPUPipeline::scriptExecutionContext const): Deleted.
3401         * Modules/webgpu/WebGPUPipeline.cpp:
3402         (WebCore::WebGPUPipeline::WebGPUPipeline):
3403         (WebCore::WebGPUPipeline::contextDestroyed): Added.
3404
3405         * html/canvas/WebGLProgram.h:
3406         (WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
3407         * html/canvas/WebGLProgram.cpp:
3408         (WebCore::WebGLProgram::WebGLProgram):
3409         (WebCore::WebGLProgram::contextDestroyed): Added.
3410
3411 2019-09-25  Chris Dumez  <cdumez@apple.com>
3412
3413         Add very basic PageCache support for RTCPeerConnection
3414         https://bugs.webkit.org/show_bug.cgi?id=202244