e2351542157ab8ad49b754710a9063258c2cf3b7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-10  Yury Semikhatsky  <yurys@chromium.org>
2
3         Web Inspector: use more C++ keywords for defining agents
4         https://bugs.webkit.org/show_bug.cgi?id=200959
5         <rdar://problem/54735374>
6
7         Reviewed by Joseph Pecoraro.
8
9         Add override annotation to overrided virtual methods in inspector code. This
10         change is automatically generated by the following command:
11         clang-tidy -checks='-*,modernize-use-override' -header-filter='.*inspector.*' -fix -p WebKitBuild/Release/
12             WebKitBuild/Release/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-84c9f43f-*.cpp
13             WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource-84c9f43f-*.cpp
14
15         No new tests. No behavior changes.
16
17         * inspector/InspectorController.h:
18         * inspector/InspectorFrontendClientLocal.h:
19         * inspector/InspectorFrontendHost.cpp:
20         * inspector/PageScriptDebugServer.h:
21         * inspector/WebInjectedScriptManager.h:
22         * inspector/WorkerInspectorController.h:
23         * inspector/WorkerScriptDebugServer.h:
24         * inspector/WorkerToPageFrontendChannel.h:
25         * inspector/agents/InspectorApplicationCacheAgent.h:
26         * inspector/agents/InspectorCPUProfilerAgent.h:
27         * inspector/agents/InspectorCSSAgent.h:
28         * inspector/agents/InspectorCanvasAgent.h:
29         * inspector/agents/InspectorDOMAgent.h:
30         * inspector/agents/InspectorDOMDebuggerAgent.h:
31         * inspector/agents/InspectorDOMStorageAgent.h:
32         * inspector/agents/InspectorDatabaseAgent.h:
33         * inspector/agents/InspectorIndexedDBAgent.cpp:
34         * inspector/agents/InspectorIndexedDBAgent.h:
35         * inspector/agents/InspectorLayerTreeAgent.h:
36         * inspector/agents/InspectorMemoryAgent.h:
37         * inspector/agents/InspectorNetworkAgent.cpp:
38         * inspector/agents/InspectorNetworkAgent.h:
39         * inspector/agents/InspectorPageAgent.h:
40         * inspector/agents/InspectorTimelineAgent.h:
41         * inspector/agents/InspectorWorkerAgent.h:
42         * inspector/agents/WebConsoleAgent.h:
43         * inspector/agents/WebDebuggerAgent.h:
44         * inspector/agents/WebHeapAgent.h:
45         * inspector/agents/page/PageAuditAgent.h:
46         * inspector/agents/page/PageConsoleAgent.h:
47         * inspector/agents/page/PageDOMDebuggerAgent.h:
48         * inspector/agents/page/PageDebuggerAgent.h:
49         * inspector/agents/page/PageHeapAgent.h:
50         * inspector/agents/page/PageNetworkAgent.h:
51         * inspector/agents/page/PageRuntimeAgent.h:
52         * inspector/agents/worker/ServiceWorkerAgent.h:
53         * inspector/agents/worker/WorkerAuditAgent.h:
54         * inspector/agents/worker/WorkerConsoleAgent.h:
55         * inspector/agents/worker/WorkerDOMDebuggerAgent.h:
56         * inspector/agents/worker/WorkerDebuggerAgent.h:
57         * inspector/agents/worker/WorkerNetworkAgent.h:
58         * inspector/agents/worker/WorkerRuntimeAgent.h:
59
60 2019-10-10  Tim Horton  <timothy_horton@apple.com>
61
62         Use HAVE(IOSURFACE_RGB10) instead of PLATFORM(IOS_FAMILY) where appropriate
63         https://bugs.webkit.org/show_bug.cgi?id=202823
64
65         Reviewed by Wenson Hsieh.
66
67         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
68         (WebCore::layerContentsFormat):
69         * platform/ios/LegacyTileGridTile.mm:
70         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
71
72 2019-10-10  Jer Noble  <jer.noble@apple.com>
73
74         [Catalina] LayoutTest fast/canvas/webgl/texImage2D-mse-flip-{true,false}.html failing
75         https://bugs.webkit.org/show_bug.cgi?id=202771
76         <rdar://problem/49441298>
77
78         Reviewed by Eric Carlson.
79
80         Catalina no longer creates IOSurface-backed CVPixelBuffers by default for certain
81         codecs; make the CVPixelBuffers generated by WebCoreDecompressionSession IOSurface-backed
82         explicitly by passing in the correct attributes when creating the VTDecompressionSession.
83
84         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
85         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
86
87 2019-10-10  Myles C. Maxfield  <mmaxfield@apple.com>
88
89         [Cocoa] font-family:system-ui on Chinese systems don't get Chinese quote marks
90         https://bugs.webkit.org/show_bug.cgi?id=202778
91         <rdar://problem/52594556>
92
93         Reviewed by Simon Fraser.
94
95         This was caught by fast/text/international/system-language/han-quotes.html,
96         but we didn't have time to fix it until now.
97
98         Test: fast/text/international/system-language/han-quotes.html
99
100         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
101         (WebCore::SystemFontDatabaseCoreText::createSystemUIFont):
102
103 2019-10-10  Myles C. Maxfield  <mmaxfield@apple.com>
104
105         FontFaceSet's ready promise is not always resolved
106         https://bugs.webkit.org/show_bug.cgi?id=202548
107
108         Reviewed by Youenn Fablet.
109
110         When we do layout on an element, FontRanges::glyphDataForCharacter() will cause the first
111         available font to start loading, but will continue looking at subsequent fonts to see if
112         there's a good one we can render while the load is happening. When looking for a fallback
113         font, it calls FontRanges::Range::font() with a ExternalResourceDownloadPolicy set to
114         Forbid. This is fine, except that a side effect of calling this function is that the
115         CSSFontFace marks itself as Loading, which means document.fonts.ready is deferred. Then,
116         the load finishes, and the subsequent CSSFontFace is never actually used, meaning it never
117         exits the Loading state, which means document.fonts.ready never fires.
118
119         The solution to this is to just only allow the font to enter the Loading state if it's not
120         one of these "subsequent" fonts.
121
122         Test: fast/text/fontfaceset-ready-not-fired.html
123
124         * css/CSSFontFace.cpp:
125         (WebCore::CSSFontFace::pump):
126
127 2019-10-10  youenn fablet  <youenn@apple.com>
128
129         MockRealtimeVideoSource::setFrameRateWithPreset should not use preset after moving it
130         https://bugs.webkit.org/show_bug.cgi?id=202800
131
132         Reviewed by Alexey Proskuryakov.
133
134         This does not affect behavior right now since clients typically get the intrinsic size through media samples.
135         But this could create some inconsistencies.
136
137         * platform/mock/MockRealtimeVideoSource.cpp:
138         (WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
139
140 2019-10-10  Devin Rousso  <drousso@apple.com>
141
142         Web Inspector: Timelines: don't call willDispatchEvent/didDispatchEvent unless there is a listener for the event
143         https://bugs.webkit.org/show_bug.cgi?id=202713
144
145         Reviewed by Joseph Pecoraro.
146
147         Fixes failing inspector/timeline/timeline-recording.html after r250672. This was because the
148         `InspectorTimelineAgent` expected a corresponding `willDispatchEvent` before it was told
149         about the `didDispatchEvent`, which wasn't happening since only `willDispatchEvent` would
150         early-return if the `DOMWindow` didn't have any event listeners for the dispatched event. By
151         making the `DOMWindow::dispatchEvent` itself early-return in that case, it now handles both
152         `willDispatchEvent` and `didDispatchEvent`, ensuring that they are always called in pairs.
153
154         * page/DOMWindow.cpp:
155         (WebCore::DOMWindow::dispatchEvent):
156
157         * dom/EventTarget.cpp:
158         (WebCore::EventTarget::innerInvokeEventListeners):
159         * inspector/InspectorInstrumentation.h:
160         (WebCore::InspectorInstrumentation::willDispatchEvent):
161         (WebCore::InspectorInstrumentation::didDispatchEvent):
162         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
163         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
164         * inspector/InspectorInstrumentation.cpp:
165         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
166         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
167         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
168         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
169         `InspectorInstrumentation::willDispatchEventImpl` was always called with `hasEventListeners`
170         as `true`, so there's no reason to keep that parameter around. Similarly, the change inside
171         `DOMWindow::dispatchEvent` will make it so that the same is true for
172         `InspectorInstrumentation::willDispatchEventOnWindowImpl` as well.
173
174 2019-10-10  Chris Dumez  <cdumez@apple.com>
175
176         Flaky Test: media/media-source/media-source-page-cache.html
177         https://bugs.webkit.org/show_bug.cgi?id=202775
178
179         Reviewed by Eric Carlson.
180
181         SourceBufferList should never prevent entering the page cache, even if it has
182         pending events in its queue. Its queue is a MainThreadGenericEventQueue, which
183         is Page Cache-aware and will properly suspend the firing of events when needed.
184
185         No new tests, covered by flaky test which should no longer be.
186
187         * Modules/mediasource/SourceBufferList.cpp:
188         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
189
190 2019-10-10  Sihui Liu  <sihui_liu@apple.com>
191
192         Add a unit test for StorageQuotaManager
193         https://bugs.webkit.org/show_bug.cgi?id=202755
194
195         Reviewed by Youenn Fablet.
196
197         Expose state of StorageQuotaManager for newly added unit test.
198
199         * storage/StorageQuotaManager.h:
200         (WebCore::StorageQuotaManager::state const):
201
202 2019-10-10  Wenson Hsieh  <wenson_hsieh@apple.com>
203
204         Support programmatic paste requests on macOS
205         https://bugs.webkit.org/show_bug.cgi?id=202773
206         <rdar://problem/48957166>
207
208         Reviewed by Tim Horton.
209
210         Adds support for programmatic paste requests on macOS. See below for more details.
211
212         Tests: editing/pasteboard/dom-paste/dom-paste-confirmation.html
213                editing/pasteboard/dom-paste/dom-paste-consecutive-confirmations.html
214                editing/pasteboard/dom-paste/dom-paste-rejection.html
215                editing/pasteboard/dom-paste/dom-paste-requires-user-gesture.html
216                editing/pasteboard/dom-paste/dom-paste-same-origin.html
217
218         * editing/EditorCommand.cpp:
219         (WebCore::defaultValueForSupportedPaste):
220         (WebCore::supportedPaste):
221         (WebCore::allowPasteFromDOM):
222         (WebCore::enabledPaste):
223
224         Fixes an existing bug uncovered by the layout test editing/execCommand/clipboard-access.html, which tests the
225         results of `document.queryCommandEnabled("copy")` and `document.queryCommandEnabled("paste")`. The problem here
226         is that document.queryCommandEnabled("paste") returns true if DOM paste access requests are enabled, regardless
227         of whether or not there is an active user gesture. This is inconsistent with the behavior of "copy" and "cut",
228         which return false in the case where there is no user gesture (and the clipboard access policy is also equal to
229         ClipboardAccessPolicy::RequiresUserGesture -- refer to `allowCopyCutFromDOM`).
230
231         When pasting, we only DOM paste access requests to be triggered only in the case where there is a user gesture.
232         This means that enabledPaste should additionally be gated on a user gesture check. For consistency with the
233         implementation of `enabledCopy`, we introduce a `allowPasteFromDOM` helper that is similar to
234         `allowCopyCutFromDOM`, and additionally check this constraint when the paste command's source is the DOM (as
235         opposed to a menu or key binding).
236
237         This adjustment also adds a missing canDHTMLPaste() check prior to consulting canPaste(). This ensures that when
238         evaluating document.queryCommandEnabled("Paste"), we'll dispatch a "beforepaste" event, similar to how
239         evaluating document.queryCommandEnabled("Copy") dispatches a "beforecopy" event.
240
241         * platform/LocalizedStrings.h:
242
243         Mark a function as WEBCORE_EXPORT.
244
245 2019-10-10  Eric Carlson  <eric.carlson@apple.com>
246
247         [GTK][WPE] Lots of media related tests crashing or flaky after r250918 - [ Mac WK2 ] Layout Test fast/mediastream/MediaStreamTrack-getSettings.html is a flaky failure
248         https://bugs.webkit.org/show_bug.cgi?id=202784
249
250         Unreviewed, fix GTK and WPE test crashes.
251
252         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
253         (WebCore::WrappedMockRealtimeAudioSource::render): Reconfigure if necessary.
254         (WebCore::WrappedMockRealtimeAudioSource::reconfigure): New, setup for rendering.
255         (WebCore::WrappedMockRealtimeAudioSource::settingsDidChange): Call reconfigure.
256
257 2019-10-10  youenn fablet  <youenn@apple.com>
258
259         Remove unified plan runtime flag
260         https://bugs.webkit.org/show_bug.cgi?id=202721
261
262         Reviewed by Geoffrey Garen.
263
264         Covered by existing tests.
265
266         * Modules/mediastream/RTCRtpSender.cpp:
267         (WebCore::RTCRtpSender::RTCRtpSender):
268         * Modules/mediastream/RTCRtpTransceiver.idl:
269         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
270         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
271         (WebCore::LibWebRTCMediaEndpoint::addTrack):
272         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
273         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
274         (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
275         (WebCore::LibWebRTCMediaEndpoint::OnTrack):
276         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
277         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
278         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
279         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind):
280         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
281         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
282         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
283         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
284         * page/RuntimeEnabledFeatures.h:
285         (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
286         * testing/Internals.cpp:
287         (WebCore::Internals::useMockRTCPeerConnectionFactory):
288
289 2019-10-10  Chris Dumez  <cdumez@apple.com>
290
291         DOMCacheStorage should not prevent pages from entering the back/forward cache
292         https://bugs.webkit.org/show_bug.cgi?id=202608
293
294         Reviewed by Youenn Fablet.
295
296         Make DOMCacheStorage fully suspendable by queueing all its asynchronous promise resolutions
297         to a SuspendableTaskQueue. This makes sure that no promises are resolved while suspended
298         in the page cache.
299
300         Test: http/tests/navigation/page-cache-domcachestorage-pending-promise.html
301
302         * Modules/cache/DOMCacheStorage.cpp:
303         (WebCore::DOMCacheStorage::DOMCacheStorage):
304         (WebCore::DOMCacheStorage::doSequentialMatch):
305         (WebCore::DOMCacheStorage::match):
306         (WebCore::DOMCacheStorage::has):
307         (WebCore::DOMCacheStorage::open):
308         (WebCore::DOMCacheStorage::doOpen):
309         (WebCore::DOMCacheStorage::remove):
310         (WebCore::DOMCacheStorage::doRemove):
311         (WebCore::DOMCacheStorage::keys):
312         (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const):
313         * Modules/cache/DOMCacheStorage.h:
314
315 2019-10-10  youenn fablet  <youenn@apple.com>
316
317         Add asserts to MediaStreamPrivate observer routines
318         https://bugs.webkit.org/show_bug.cgi?id=202724
319
320         Reviewed by Alex Christensen.
321
322         These methods are only to be called in main thread.
323         Add asserts to validate this.
324         No change of behavior.
325
326         * platform/mediastream/MediaStreamPrivate.cpp:
327         (WebCore::MediaStreamPrivate::addObserver):
328         (WebCore::MediaStreamPrivate::removeObserver):
329         (WebCore::MediaStreamPrivate::forEachObserver const):
330
331 2019-10-09  youenn fablet  <youenn@apple.com>
332
333         A service worker process should not be created when enqueuing a service worker job
334         https://bugs.webkit.org/show_bug.cgi?id=202578
335         <rdar://problem/55979690>
336
337         Reviewed by Chris Dumez.
338
339         Ask for a service worker context connection when planning to install or run a service worker.
340         This allows to not spin unnecessarily service worker processes for jobs that do not end up installing a service worker.
341
342         Covered by existing tests.
343
344         * workers/service/server/SWServer.cpp:
345         (WebCore::SWServer::tryInstallContextData):
346         (WebCore::SWServer::runServiceWorkerIfNecessary):
347
348 2019-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
349
350         Unreviewed, fix the internal iOS build
351
352         * page/PointerCaptureController.h: Add some missing forward declarations.
353
354 2019-10-09  Sihui Liu  <sihui_liu@apple.com>
355
356         Unreviewed, fix an asserition after r250937.
357
358         Space increase tasks will be finished once it's started.
359
360         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
361         (WebCore::IDBServer::UniqueIDBDatabase::finishSpaceIncreaseTask):
362         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
363
364 2019-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
365
366         [Clipboard API] Refactor Pasteboard item reading functions to work on both iOS and macOS
367         https://bugs.webkit.org/show_bug.cgi?id=202647
368
369         Reviewed by Tim Horton.
370
371         Moves some pasteboard helper functions out of iOS-specific code, and into platform-agnostic code. See below for
372         more details. There is no change in behavior, as nothing exercises these new pasteboard functions on macOS yet.
373
374         * SourcesCocoa.txt:
375         * WebCore.xcodeproj/project.pbxproj:
376         * platform/Pasteboard.cpp:
377         (WebCore::Pasteboard::allPasteboardItemInfo const):
378         (WebCore::Pasteboard::pasteboardItemInfo const):
379         (WebCore::Pasteboard::readString):
380         (WebCore::Pasteboard::readBuffer):
381         (WebCore::Pasteboard::readURL):
382
383         Add some new helpers on Pasteboard to read Strings, data, and URLs from the platform pasteboard. These forward
384         to the platform strategy which, in WebKit2, are currently implemented using sync IPC, but could be changed in
385         the future to be fully asynchronous.
386
387         * platform/Pasteboard.h:
388         (WebCore::Pasteboard::name const):
389
390         Expose a cross-platform name() getter on Pasteboard. On non-Cocoa platforms, this simply returns the empty
391         string, but on macOS and iOS, this returns the platform pasteboard name, which is stored in m_pasteboardName.
392
393         * platform/PasteboardItemInfo.h:
394         (WebCore::PasteboardItemInfo::pathForContentType const):
395         (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
396         (WebCore::PasteboardItemInfo::encode const):
397         (WebCore::PasteboardItemInfo::decode):
398
399         Adds a couple of new members to PasteboardItemInfo (which represents metadata about a given item in the platform
400         pasteboard). These are changeCount (which is self explanatory), and webSafeTypesByFidelity, which is a list of
401         types in fidelity order which contains the list of pasteboard types that are safe to expose to bindings. These
402         may include types such as "text/plain", "text/html", "text/uri-list", and "image/png".
403
404         To distinguish this list from the existing contentTypesByFidelity list, I've also renamed contentTypesByFidelity
405         to platformTypesByFidelity, to make it more obvious that this other list of types are platform-specific, and not
406         generally safe to expose to the web.
407
408         * platform/PasteboardStrategy.h:
409         * platform/PlatformPasteboard.h:
410
411         Move several helpers out into platform-agnostic code.
412
413         * platform/cocoa/PasteboardCocoa.mm:
414         (WebCore::Pasteboard::fileContentState):
415         * platform/cocoa/PlatformPasteboardCocoa.mm: Added.
416
417         Add a new file to contain the implementation of PlatformPasteboard::allPasteboardItemInfo, which is the same
418         across Cocoa platforms.
419
420         (WebCore::PlatformPasteboard::allPasteboardItemInfo):
421         * platform/ios/PasteboardIOS.mm:
422         (WebCore::Pasteboard::readRespectingUTIFidelities):
423         * platform/ios/PlatformPasteboardIOS.mm:
424         (WebCore::PlatformPasteboard::informationForItemAtIndex):
425         (WebCore::PlatformPasteboard::readBuffer const):
426         (WebCore::PlatformPasteboard::readString const):
427         (WebCore::PlatformPasteboard::readURL const):
428
429         Additionally refactor all methods on PlatformPasteboard that take pasteboard item indices as signed integers
430         (`int`) to receive `size_t` values instead.
431
432         (WebCore::PlatformPasteboard::allPasteboardItemInfo): Deleted.
433         * platform/libwpe/PasteboardLibWPE.cpp:
434         (WebCore::Pasteboard::readString):
435         (WebCore::Pasteboard::read):
436         * platform/libwpe/PlatformPasteboardLibWPE.cpp:
437         (WebCore::PlatformPasteboard::readString const):
438
439         Add an implementation stub for WPE.
440
441         * platform/mac/PlatformPasteboardMac.mm:
442         (WebCore::modernPasteboardTypeForWebSafeMIMEType):
443         (WebCore::webSafeMIMETypeForModernPasteboardType):
444
445         Add helpers to convert between modern NSPasteboardTypes and web-safe types. While some logic exists today on
446         macOS to convert between legacy pasteboard types and web-safe types, conversion between the modern pasteboard
447         types and web-safe types are needed since NSPasteboardItem's types only support NSPasteboardTypes and
448         dynamically declared types that match the format of a universal type identfier (for instance, "com.foo.bar").
449
450         (WebCore::PlatformPasteboard::readBuffer const):
451         (WebCore::PlatformPasteboard::readString const):
452         (WebCore::PlatformPasteboard::readURL const):
453         (WebCore::PlatformPasteboard::count const):
454         (WebCore::PlatformPasteboard::informationForItemAtIndex):
455
456         Implement all of these helpers by looking up the NSPasteboardItem at the given item index and querying it for
457         data for non-legacy pasteboard types.
458
459         (WebCore::PlatformPasteboard::itemAtIndex const):
460
461 2019-10-09  Daniel Bates  <dabates@apple.com>
462
463         Add support for CompactPointerTuple<..., OptionSet<...>>
464         https://bugs.webkit.org/show_bug.cgi?id=201316
465
466         Reviewed by Yusuke Suzuki.
467
468         Use the new CompactPointerTuple capability to replace CompactPointerTuple<RenderObject*, uint8_t>
469         with CompactPointerTuple<RenderObject*, OptionSet<ElementStyleFlag>> in Node.h.
470
471         * dom/Node.h:
472         (WebCore::Node::hasStyleFlag const):
473         (WebCore::Node::setStyleFlag):
474         (WebCore::Node::clearStyleFlags):
475         Update code now that we support CompactPointerTuple<..., OptionSet<...>>.
476
477 2019-10-09  John Wilander  <wilander@apple.com>
478
479         IsLoggedIn: Add as experimental feature
480         https://bugs.webkit.org/show_bug.cgi?id=202707
481         <rdar://problem/56095064>
482
483         Reviewed by Brent Fulgham and Chris Dumez.
484
485         IsLoggedIn was proposed to the WebAppSec WG at TPAC 2019.
486         So far there is only an explainer posted to the mailing list:
487         https://lists.w3.org/Archives/Public/public-webappsec/2019Sep/0004.html
488
489         This patch adds the three experimental web APIs:
490         - Promise<void> setLoggedIn()
491         - Promise<void> setLoggedOut()
492         - Promise<bool> isLoggedIn()
493
494         It also tests that those APIs are only exposed in secure contexts.
495
496         The functionality is implemented as a supplement to Navigator.
497
498         Tests: http/tests/is-logged-in/available-in-secure-contexts.https.html
499                http/tests/is-logged-in/unavailable-in-insecure-contexts.html
500
501         * DerivedSources-input.xcfilelist:
502         * DerivedSources-output.xcfilelist:
503         * DerivedSources.make:
504         * Headers.cmake:
505         * Sources.txt:
506         * WebCore.xcodeproj/project.pbxproj:
507         * page/NavigatorIsLoggedIn.cpp: Added.
508         (WebCore::NavigatorIsLoggedIn::from):
509         (WebCore::NavigatorIsLoggedIn::supplementName):
510         (WebCore::NavigatorIsLoggedIn::setLoggedIn):
511         (WebCore::NavigatorIsLoggedIn::setLoggedOut):
512         (WebCore::NavigatorIsLoggedIn::isLoggedIn):
513         * page/NavigatorIsLoggedIn.h: Added.
514         * page/NavigatorIsLoggedIn.idl: Added.
515         * page/PointerCaptureController.cpp:
516         * page/PointerCaptureController.h:
517         * page/Settings.yaml:
518
519 2019-10-09  Russell Epstein  <repstein@apple.com>
520
521         Unreviewed, rolling out r250930.
522
523         Broke watchOS Builds
524
525         Reverted changeset:
526
527         "Add support for CompactPointerTuple<..., OptionSet<...>>"
528         https://bugs.webkit.org/show_bug.cgi?id=201316
529         https://trac.webkit.org/changeset/250930
530
531 2019-10-09  Jiewen Tan  <jiewen_tan@apple.com>
532
533         [WebAuthn] Move the mock testing entrance to Internals
534         https://bugs.webkit.org/show_bug.cgi?id=202560
535         <rdar://problem/55973793>
536
537         Reviewed by Chris Dumez.
538
539         This patch moves TestRunner.setWebAuthenticationMockConfiguration to
540         Internals.setMockWebAuthenticationConfiguration and removes the old
541         entrance. The purpose of this patch is to allow API tests to use
542         the same mock infrastructure that is used by layout tests.
543
544         No new tests, covered by updates on existing tests.
545
546         * DerivedSources-input.xcfilelist:
547         * DerivedSources-output.xcfilelist:
548         * DerivedSources.make:
549         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
550         * WebCore.xcodeproj/project.pbxproj:
551         * page/ChromeClient.h:
552         (WebCore::ChromeClient::setMockWebAuthenticationConfiguration):
553         * testing/Internals.cpp:
554         (WebCore::Internals::setMockWebAuthenticationConfiguration):
555         * testing/Internals.h:
556         * testing/Internals.idl:
557         * testing/MockWebAuthenticationConfiguration.h: Added.
558         (WebCore::MockWebAuthenticationConfiguration::LocalConfiguration::encode const):
559         (WebCore::MockWebAuthenticationConfiguration::LocalConfiguration::decode):
560         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::encode const):
561         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
562         (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::encode const):
563         (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode):
564         (WebCore::MockWebAuthenticationConfiguration::encode const):
565         (WebCore::MockWebAuthenticationConfiguration::decode):
566         * testing/MockWebAuthenticationConfiguration.idl: Added.
567
568 2019-10-09  Simon Fraser  <simon.fraser@apple.com>
569
570         Rename WheelEventTestTrigger and improve naming in related code
571         https://bugs.webkit.org/show_bug.cgi?id=202772
572
573         Reviewed by Tim Horton.
574
575         Change the "test trigger" terminology to "monitor wheel events"; after all, tests
576         call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
577         a test.
578
579         * Sources.txt:
580         * WebCore.xcodeproj/project.pbxproj:
581         * page/FrameView.cpp:
582         (WebCore::FrameView::adjustScrollbarsForLayout):
583         (WebCore::FrameView::setScrollPosition):
584         (WebCore::FrameView::didAddScrollbar):
585         * page/Page.cpp:
586         (WebCore::Page::ensureWheelEventTestMonitor):
587         (WebCore::Page::ensureTestTrigger): Deleted.
588         * page/Page.h:
589         (WebCore::Page::wheelEventTestMonitor const):
590         (WebCore::Page::clearWheelEventTestMonitor):
591         (WebCore::Page::isMonitoringWheelEvents const):
592         (WebCore::Page::testTrigger const): Deleted.
593         (WebCore::Page::clearTrigger): Deleted.
594         (WebCore::Page::expectsWheelEventTriggers const): Deleted.
595         * page/WheelEventTestMonitor.cpp: Added.
596         (WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
597         (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
598         (WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
599         (WebCore::WheelEventTestMonitor::deferForReason):
600         (WebCore::WheelEventTestMonitor::removeDeferralForReason):
601         (WebCore::WheelEventTestMonitor::triggerTestTimerFired):
602         (WebCore::operator<<):
603         * page/WheelEventTestMonitor.h: Renamed from Source/WebCore/page/WheelEventTestTrigger.h.
604         * page/WheelEventTestTrigger.cpp: Removed.
605         * page/mac/EventHandlerMac.mm:
606         (WebCore::EventHandler::platformPrepareForWheelEvents):
607         * page/scrolling/AsyncScrollingCoordinator.cpp:
608         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
609         (WebCore::AsyncScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
610         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
611         (WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const):
612         (WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const):
613         (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
614         (WebCore::AsyncScrollingCoordinator::deferTestsForReason const): Deleted.
615         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason const): Deleted.
616         * page/scrolling/AsyncScrollingCoordinator.h:
617         * page/scrolling/ScrollingCoordinator.h:
618         (WebCore::ScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
619         (WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
620         * page/scrolling/ScrollingStateScrollingNode.cpp:
621         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
622         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
623         (WebCore::ScrollingStateScrollingNode::setIsMonitoringWheelEvents):
624         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
625         (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Deleted.
626         * page/scrolling/ScrollingStateScrollingNode.h:
627         (WebCore::ScrollingStateScrollingNode::isMonitoringWheelEvents const):
628         (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger const): Deleted.
629         * page/scrolling/ScrollingTree.h:
630         (WebCore::ScrollingTree::deferWheelEventTestCompletionForReason):
631         (WebCore::ScrollingTree::removeWheelEventTestCompletionDeferralForReason):
632         (WebCore::ScrollingTree::deferTestsForReason): Deleted.
633         (WebCore::ScrollingTree::removeTestDeferralForReason): Deleted.
634         * page/scrolling/ScrollingTreeScrollingNode.cpp:
635         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
636         * page/scrolling/ScrollingTreeScrollingNode.h:
637         * page/scrolling/ThreadedScrollingTree.cpp:
638         (WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason):
639         (WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason):
640         (WebCore::ThreadedScrollingTree::deferTestsForReason): Deleted.
641         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Deleted.
642         * page/scrolling/ThreadedScrollingTree.h:
643         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
644         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
645         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
646         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
647         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
648         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const): Deleted.
649         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const): Deleted.
650         * platform/Logging.h:
651         * platform/ScrollAnimator.cpp:
652         (WebCore::ScrollAnimator::deferWheelEventTestCompletionForReason const):
653         (WebCore::ScrollAnimator::removeWheelEventTestCompletionDeferralForReason const):
654         (WebCore::ScrollAnimator::deferTestsForReason const): Deleted.
655         (WebCore::ScrollAnimator::removeTestDeferralForReason const): Deleted.
656         * platform/ScrollAnimator.h:
657         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestMonitor):
658         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger): Deleted.
659         * platform/cocoa/ScrollController.h:
660         (WebCore::ScrollControllerClient::deferWheelEventTestCompletionForReason const):
661         (WebCore::ScrollControllerClient::removeWheelEventTestCompletionDeferralForReason const):
662         (WebCore::ScrollControllerClient::deferTestsForReason const): Deleted.
663         (WebCore::ScrollControllerClient::removeTestDeferralForReason const): Deleted.
664         * platform/cocoa/ScrollController.mm:
665         (WebCore::ScrollController::startSnapRubberbandTimer):
666         (WebCore::ScrollController::stopSnapRubberbandTimer):
667         (WebCore::ScrollController::scheduleStatelessScrollSnap):
668         (WebCore::ScrollController::startDeferringWheelEventTestCompletionDueToScrollSnapping):
669         (WebCore::ScrollController::stopDeferringWheelEventTestCompletionDueToScrollSnapping):
670         (WebCore::ScrollController::startScrollSnapTimer):
671         (WebCore::ScrollController::stopScrollSnapTimer):
672         (WebCore::ScrollController::startDeferringTestsDueToScrollSnapping): Deleted.
673         (WebCore::ScrollController::stopDeferringTestsDueToScrollSnapping): Deleted.
674         * platform/mac/ScrollAnimatorMac.mm:
675         (WebCore::ScrollAnimatorMac::didBeginScrollGesture const):
676         (WebCore::ScrollAnimatorMac::didEndScrollGesture const):
677         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon):
678         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired):
679         * rendering/RenderBox.cpp:
680         (WebCore::setupWheelEventMonitor):
681         (WebCore::RenderBox::setScrollLeft):
682         (WebCore::RenderBox::setScrollTop):
683         (WebCore::setupWheelEventTestTrigger): Deleted.
684         * rendering/RenderLayer.cpp:
685         (WebCore::RenderLayer::createScrollbar):
686         * rendering/RenderListBox.cpp:
687         (WebCore::setupWheelEventTestMonitor):
688         (WebCore::RenderListBox::setScrollTop):
689         (WebCore::RenderListBox::createScrollbar):
690         (WebCore::setupWheelEventTestTrigger): Deleted.
691         * testing/js/WebCoreTestSupport.cpp:
692         (WebCoreTestSupport::monitorWheelEvents):
693         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer):
694         (WebCoreTestSupport::clearWheelEventTestMonitor):
695         (WebCoreTestSupport::clearWheelEventTestTrigger): Deleted.
696         * testing/js/WebCoreTestSupport.h:
697
698 2019-10-09  Sihui Liu  <sihui_liu@apple.com>
699
700         IndexedDB: update size to actual disk usage only when estimated increase is bigger than space available
701         https://bugs.webkit.org/show_bug.cgi?id=201957
702
703         Reviewed by Youenn Fablet.
704
705         For better performance.
706
707         Covered by existing tests.
708
709         * Modules/indexeddb/server/IDBServer.cpp:
710         (WebCore::IDBServer::IDBServer::QuotaUser::resetSpaceUsed): m_estimatedSpaceIncrease will be updated when task
711         is finished, so no need to clear it when doing reset.
712         (WebCore::IDBServer::IDBServer::QuotaUser::computeSpaceUsed):
713         * Modules/indexeddb/server/IDBServer.h:
714
715         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: instead of reading file size after each task, just add the 
716         task size to known usage and get an estimated usage.
717         (WebCore::IDBServer::UniqueIDBDatabase::startSpaceIncreaseTask):
718         (WebCore::IDBServer::UniqueIDBDatabase::finishSpaceIncreaseTask):
719         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
720         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
721         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
722         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
723         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
724         (WebCore::IDBServer::UniqueIDBDatabase::generateUniqueCallbackIdentifier):
725         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
726         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
727         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
728         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
729         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateObjectStore):
730         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
731         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
732         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
733         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex):
734         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
735         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
736         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
737         (WebCore::IDBServer::UniqueIDBDatabase::didPerformPutOrAdd):
738         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
739         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
740         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
741         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
742         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
743         (WebCore::IDBServer::generateUniqueCallbackIdentifier): Deleted.
744         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded): Deleted.
745         * Modules/indexeddb/server/UniqueIDBDatabase.h:
746
747         * storage/StorageQuotaManager.cpp: use m_state to decide what action to take on next request. Previously when a 
748         request asked for size bigger than space available, we would go to ask for more space directly. Now because IDB
749         can be reporting estimated usage, we first ask IDB to compute its actual disk usage and ask for more space if 
750         actual space available is smaller than requested size.
751         (WebCore::StorageQuotaManager::askUserToInitialize):
752         (WebCore::StorageQuotaManager::removeUser):
753         (WebCore::StorageQuotaManager::requestSpace):
754         (WebCore::StorageQuotaManager::askForMoreSpace):
755         (WebCore::StorageQuotaManager::processPendingRequests):
756         * storage/StorageQuotaManager.h:
757         * storage/StorageQuotaUser.h:
758         (WebCore::StorageQuotaUser::computeSpaceUsed):
759
760 2019-10-09  Sihui Liu  <sihui_liu@apple.com>
761
762         IndexedDB: include size of index records in size estimate of put/add task
763         https://bugs.webkit.org/show_bug.cgi?id=202483
764
765         Reviewed by Geoffrey Garen.
766
767         SQLiteIDBBackingStore has two tables IndexRecords and Records. For add operation add(VALUE, KEY), we add a new 
768         record to Records table. If we can extract index value from VALUE for some index, we would add a new record to
769         IndexRecords table.
770
771         We estimated the task szie of add task with (KEY_SIZE + VALUE_SIZE), but we didn't count the size that could be
772         added to the IndexRecords table. This could lead to storage abuse.
773
774         Test: storage/indexeddb/request-size-estimate.html
775
776         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
777         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
778
779 2019-10-09  Chris Dumez  <cdumez@apple.com>
780
781         Youtube.com is unable to enter the back/forward cache on macOS
782         https://bugs.webkit.org/show_bug.cgi?id=202754
783         <rdar://problem/56117666>
784
785         Reviewed by Eric Carlson.
786
787         As of r250542, the MainThreadGenericEventQueue used by both MediaSource and
788         SourceBuffer to fire event is PageCache-aware. As a result, both these
789         ActiveDOMObjects can now safety suspend without risking running script while
790         in the page cache. I did have to update some logic in MediaSource::removeSourceBuffer()
791         to make sure we do not unnecessarily construct new ActiveDOMObjects while
792         suspending, as this is not allowed.
793
794         Test: media/media-source/media-source-page-cache.html
795
796         * Modules/mediasource/MediaSource.cpp:
797         (WebCore::MediaSource::removeSourceBuffer):
798         (WebCore::MediaSource::canSuspendForDocumentSuspension const):
799         * Modules/mediasource/SourceBuffer.cpp:
800         (WebCore::SourceBuffer::canSuspendForDocumentSuspension const):
801         * Modules/mediasource/SourceBuffer.h:
802
803 2019-10-09  Daniel Bates  <dabates@apple.com>
804
805         Add support for CompactPointerTuple<..., OptionSet<...>>
806         https://bugs.webkit.org/show_bug.cgi?id=201316
807
808         Reviewed by Yusuke Suzuki.
809
810         Use the new CompactPointerTuple capability to replace CompactPointerTuple<RenderObject*, uint8_t>
811         with CompactPointerTuple<RenderObject*, OptionSet<ElementStyleFlag>> in Node.h.
812
813         * dom/Node.h:
814         (WebCore::Node::hasStyleFlag const):
815         (WebCore::Node::setStyleFlag):
816         (WebCore::Node::clearStyleFlags):
817         Update code now that we support CompactPointerTuple<..., OptionSet<...>>.
818
819 2019-10-09  Zalan Bujtas  <zalan@apple.com>
820
821         RunResolver::rangeForRendererWithOffsets should check for range end
822         https://bugs.webkit.org/show_bug.cgi?id=202761
823         <rdar://problem/55917924>
824
825         Reviewed by Antti Koivisto.
826
827         This patch ensures that when rangeForRenderer comes back with a collapsed run (empty range), rangeForRendererWithOffsets returns an empty range as well.
828
829         Test: fast/text/simple-line-layout-range-check-end.html
830
831         * rendering/SimpleLineLayoutResolver.cpp:
832         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const):
833
834 2019-10-09  Alicia Boya García  <aboya@igalia.com>
835
836         [MSE][GStreamer] Fix video sometimes not appearing
837         https://bugs.webkit.org/show_bug.cgi?id=201401
838
839         Reviewed by Xabier Rodriguez-Calvar.
840
841         The code in MediaPlayerPrivateGStreamer::changePipelineState() was
842         supposed to call `ensureGLVideoSinkContext()` on upwards transitions
843         to PAUSED but the code did not take into account non-step-by-step
844         state transitions, which happens frequently with playbin3 in the MSE
845         case.
846
847         Before the patch, when playbin3 transitioned from READY to PLAYING
848         without stopping for preroll this call would not be made and the
849         texture IDs received at the sink would not correspond to the
850         compositor GL context, leading to artifacts (often the player controls
851         or a blank screen).
852
853         Test: imported/w3c/web-platform-tests/media-source/mediasource-video-is-visible.html
854
855         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
856         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
857
858 2019-10-09  Eric Carlson  <eric.carlson@apple.com>
859
860         [ Mac WK2 ] Layout Test fast/mediastream/MediaStreamTrack-getSettings.html is a flaky failure
861         https://bugs.webkit.org/show_bug.cgi?id=196400
862         <rdar://problem/49567579>
863
864         Reviewed by Youenn Fablet.
865
866         No new tests, this fixes a broken test.
867
868         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
869         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
870         (WebCore::MockRealtimeAudioSourceMac::reconfigure): Reconfigure buffers as well.
871         (WebCore::MockRealtimeAudioSourceMac::render): Call reconfigure if the buffer isn't
872         configured correctly.
873         (WebCore::MockRealtimeAudioSourceMac::settingsDidChange): Call reconfigure.
874
875         * platform/mock/MockRealtimeAudioSource.cpp:
876         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Set sample rate to default.
877
878 2019-10-09  Chris Dumez  <cdumez@apple.com>
879
880         Unreviewed, address Darin's post-landing comments for r250912.
881
882         The array should be const.
883
884         * css/CSSDefaultStyleSheets.cpp:
885
886 2019-10-09  Daniel Bates  <dabates@apple.com>
887
888         Clean up: Remove pre-macOS Sierra workaround for missing kVK_RightCommand
889         https://bugs.webkit.org/show_bug.cgi?id=202597
890
891         Reviewed by Anders Carlsson.
892
893         kVK_RightCommand has been defined in HIToolbox/Events.h since macOS Sierra. We no longer
894         need to maintain code to manually define it.
895
896         * platform/mac/PlatformEventFactoryMac.mm:
897         (WebCore::keyForKeyEvent):
898
899 2019-10-09  Antti Koivisto  <antti@apple.com>
900
901         [CSS Shadow Parts] Minor exportparts attribute parsing cleanups
902         https://bugs.webkit.org/show_bug.cgi?id=202740
903
904         Reviewed by Zalan Bujtas.
905
906         * dom/ShadowRoot.cpp:
907         (WebCore::parsePartMapping):
908         (WebCore::parsePartMappingsList):
909
910         Return the map as the return value.
911
912         (WebCore::ShadowRoot::partMappings const):
913
914 2019-10-09  Andy Estes  <aestes@apple.com>
915
916         [iOS] Remove redundant uses of USE(UIKIT_EDITING)
917         https://bugs.webkit.org/show_bug.cgi?id=202717
918
919         Reviewed by Anders Carlsson.
920
921         * page/ios/FrameIOS.mm:
922         (WebCore::Frame::qualifyingNodeAtViewportLocation):
923         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
924
925 2019-10-09  Chris Dumez  <cdumez@apple.com>
926
927         [iOS] REGRESSION (r250398) Layout Test fast/history/page-cache-element-state-focused.html is failing
928         https://bugs.webkit.org/show_bug.cgi?id=202712
929         <rdar://problem/56082428>
930
931         Reviewed by Antti Koivisto.
932
933         The test was failing depending on the order in which the tests were executed. The reason is that
934         elements would either use the full UA stylesheet (html.css) or the simple one in CSSDefaultStyleSheets.cpp.
935         Unfortunately, the outline-width was different on iOS between the simple stylesheet and the full one, causing
936         the test output to look different depending on which stylesheet was used.
937
938         Address the issue by making sure that the outline-width is 3px on IOS_FAMILY in the simple stylesheet, to
939         be consistent with the value in the full stylesheet (html.css).
940
941         * css/CSSDefaultStyleSheets.cpp:
942
943 2019-10-09  Zalan Bujtas  <zalan@apple.com>
944
945         [LFC][Painting] Decouple content and decoration painting
946         https://bugs.webkit.org/show_bug.cgi?id=202718
947         <rdar://problem/56104661>
948
949         Reviewed by Antti Koivisto.
950
951         This patch adds support for individual run painting <div><span style="background-color: red">red</span>black</div>.
952         This is pretty much all we can do with the current data structures (lack of context).
953
954         * layout/displaytree/DisplayPainter.cpp:
955         (WebCore::Display::paintBoxDecoration):
956         (WebCore::Display::paintInlineContent):
957         (WebCore::Display::Painter::paint):
958         (WebCore::Display::paintBlockLevelBoxDecoration): Deleted.
959         * layout/inlineformatting/InlineLine.cpp:
960         (WebCore::Layout::Line::appendInlineContainerStart):
961         (WebCore::Layout::Line::appendInlineContainerEnd):
962
963 2019-10-09  Fujii Hironori  <Hironori.Fujii@sony.com>
964
965         Unreviewed build fix for Windows ports
966         https://bugs.webkit.org/show_bug.cgi?id=202630
967         <rdar://problem/56107907>
968
969         dom/Document.cpp(3990): error C2653: 'MediaStreamTrack': is not a class or namespace name
970         dom/Document.cpp(3990): error C3861: 'captureState': identifier not found
971
972         * dom/Document.cpp:
973         (WebCore::Document::updateIsPlayingMedia): Restored #if ENABLE(MEDIA_STREAM).
974
975 2019-10-09  Antti Koivisto  <antti@apple.com>
976
977         [CSS Shadow Parts] Mark as supported in features.json
978         https://bugs.webkit.org/show_bug.cgi?id=202730
979
980         Reviewed Ryosuke Niwa.
981
982         * features.json:
983
984 2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
985
986         [GTK] Wayland: do not use EGL_PLATFORM_WAYLAND_KHR with eglGetPlatformDisplayEXT
987         https://bugs.webkit.org/show_bug.cgi?id=202689
988
989         Reviewed by Žan Doberšek.
990
991         Use EGL_PLATFORM_WAYLAND_EXT instead. It shouldn't really matter because both are the same value.
992
993         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
994         (WebCore::PlatformDisplayWayland::initialize):
995
996 2019-10-09  Antti Koivisto  <antti@apple.com>
997
998         [CSS Shadow Parts] Allow exporting single part with multiple names using exportparts attribute
999         https://bugs.webkit.org/show_bug.cgi?id=202719
1000
1001         Reviewed by Ryosuke Niwa.
1002
1003         Cases like exportparts="part:export1, part:export2" should work.
1004
1005         * css/SelectorChecker.cpp:
1006         (WebCore::SelectorChecker::checkOne const):
1007
1008         Allow one part name to expand into multiple names for matching.
1009
1010         * dom/ShadowRoot.cpp:
1011         (WebCore::parsePartMappingsList):
1012
1013         Allow multiple names per mapping.
1014
1015         (WebCore::ShadowRoot::partMappings const):
1016         * dom/ShadowRoot.h:
1017
1018 2019-10-09  Philippe Normand  <pnormand@igalia.com>
1019
1020         REGRESSION(r246399): [GStreamer] Problems playing AAC streams
1021         https://bugs.webkit.org/show_bug.cgi?id=202204
1022
1023         Reviewed by Xabier Rodriguez-Calvar.
1024
1025         Push the EOS event in the WebKitWebSrc element when the internal
1026         queue is empty only for non-live resources. In the live case the
1027         queue might drain temporarily but that's OK because data would
1028         still be queued in downstream elements.
1029
1030         No new tests, the EOS event was pushed too early because of this
1031         regression but there's no way to differentiate it from an expected
1032         event in a layout test.
1033
1034         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1035         (webKitWebSrcCreate):
1036
1037 2019-10-09  youenn fablet  <youenn@apple.com>
1038
1039         MediaStreamTrack does not need to be a Document audio producer
1040         https://bugs.webkit.org/show_bug.cgi?id=202630
1041
1042         Reviewed by Eric Carlson.
1043
1044         Instead of having all tracks being MediaProducer, we can use the new methods introduced for iOS
1045         to mute/unmute capture tracks and get capture media state.
1046         This allows to not register tracks that are not capture tracks.
1047         Covered by existing tests.
1048
1049         * Modules/mediastream/MediaStreamTrack.cpp:
1050         (WebCore::MediaStreamTrack::MediaStreamTrack):
1051         (WebCore::MediaStreamTrack::~MediaStreamTrack):
1052         (WebCore::MediaStreamTrack::setMuted):
1053         (WebCore::MediaStreamTrack::applyConstraints):
1054         (WebCore::MediaStreamTrack::mediaState const):
1055         (WebCore::MediaStreamTrack::updateCaptureAccordingToMutedState):
1056         (WebCore::MediaStreamTrack::pageMutedStateDidChange): Deleted.
1057         * Modules/mediastream/MediaStreamTrack.h:
1058         * dom/Document.cpp:
1059         (WebCore::Document::updateIsPlayingMedia):
1060         (WebCore::Document::pageMutedStateDidChange):
1061
1062 2019-10-08  Antti Koivisto  <antti@apple.com>
1063
1064         [CSS Shadow Parts] Enable by default
1065         https://bugs.webkit.org/show_bug.cgi?id=202644
1066
1067         Reviewed by Ryosuke Niwa.
1068
1069         Flip the switch.
1070
1071         * page/RuntimeEnabledFeatures.h:
1072
1073 2019-10-08  Jiewen Tan  <jiewen_tan@apple.com>
1074
1075         Partially undo r250811
1076         https://bugs.webkit.org/show_bug.cgi?id=202715
1077         <rdar://problem/56084287>
1078
1079         Reviewed by Chris Dumez.
1080
1081         This patch changes the SerializedScriptValue to always wrap CryptoKey objects again.
1082         CryptoKey objects could belong to an array or another object. In those cases, IDBObjectStore
1083         cannot set the flag for the embedded Cryptokey objects. Neither can postMessage to unset
1084         the flag. Therefore, there is no way to separate the serialization process into two and
1085         this patch restores the old behaviour. However, the hardening part of r250811 is kept
1086         and therefore the crash should still be prevented.
1087
1088         No new test, updated existing test
1089
1090         * Modules/indexeddb/IDBObjectStore.cpp:
1091         (WebCore::IDBObjectStore::putOrAdd):
1092         (WebCore::JSC::setIsWrappingRequiredForCryptoKey): Deleted.
1093         * bindings/js/SerializedScriptValue.cpp:
1094         (WebCore::CloneSerializer::dumpIfTerminal):
1095         (WebCore::CloneDeserializer::readTerminal):
1096         * crypto/CryptoKey.h:
1097         (WebCore::CryptoKey::allows const):
1098         (WebCore::CryptoKey::isWrappingRequired const): Deleted.
1099         (WebCore::CryptoKey::setIsWrappingRequired): Deleted.
1100         (): Deleted.
1101         * dom/ScriptExecutionContext.h:
1102
1103 2019-10-08  Devin Rousso  <drousso@apple.com>
1104
1105         Web Inspector: Canvas: modifications to shader modules can be shared between vertex/fragment shaders
1106         https://bugs.webkit.org/show_bug.cgi?id=202031
1107
1108         Reviewed by Dean Jackson.
1109
1110         Test: inspector/canvas/updateShader-webgpu-sharedVertexFragment.html
1111
1112         * Modules/webgpu/WebGPUPipeline.h:
1113         * Modules/webgpu/WebGPUComputePipeline.cpp:
1114         (WebCore::WebGPUComputePipeline::cloneShaderModules): Added.
1115         (WebCore::WebGPUComputePipeline::recompile):
1116         * Modules/webgpu/WebGPURenderPipeline.cpp:
1117         (WebCore::WebGPURenderPipeline::cloneShaderModules): Added.
1118         (WebCore::WebGPURenderPipeline::recompile):
1119         Recreate the vertex/fragment/compute shader module(s) when recompiling so that modifications
1120         to it via this pipeline don't affect other pipelines that also use the same shader module.
1121
1122         * inspector/InspectorShaderProgram.h:
1123         * inspector/InspectorShaderProgram.cpp:
1124         (WebCore::InspectorShaderProgram::updateShader):
1125         (WebCore::InspectorShaderProgram::buildObjectForShaderProgram): Added.
1126         * inspector/agents/InspectorCanvasAgent.cpp:
1127         (WebCore::InspectorCanvasAgent::didCreateWebGLProgram):
1128         (WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline):
1129         Include as part of the `Canvas.event.programCreated` payload a flag indicating whether the
1130         vertex shader module and fragment shader module are the same for `WebGPURenderPipeline`s.
1131
1132 2019-10-08  Timothy Hatcher  <timothy@apple.com>
1133
1134         Copying white text from dark mode WebKit apps and pasting in a light mode app results in white (invisible) text.
1135         https://bugs.webkit.org/show_bug.cgi?id=202662
1136         rdar://problem/48677354
1137
1138         Reviewed by Megan Gardner.
1139
1140         Covered by new API tests.
1141
1142         HTMLConverter needs to strip white text colors when the document is in dark mode, like it does for black in light mode.
1143
1144         * editing/cocoa/HTMLConverter.mm:
1145         (normalizedColor): Handle dark mode and ignore white.
1146         (HTMLConverterCaches::colorPropertyValueForNode): Pass element to normalizedColor.
1147
1148 2019-10-08  Antti Koivisto  <antti@apple.com>
1149
1150         [CSS Shadow Parts] Fix style invalidation with class selector and ::before and ::after
1151         https://bugs.webkit.org/show_bug.cgi?id=202694
1152
1153         Reviewed by Ryosuke Niwa.
1154
1155         Test: fast/css/shadow-parts/invalidation-class-before-after.html
1156
1157         * style/StyleInvalidator.cpp:
1158         (WebCore::Style::Invalidator::invalidateIfNeeded):
1159         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
1160
1161         Invalidate in the shadow tree if the computed match element is host.
1162
1163         (WebCore::Style::Invalidator::invalidateInShadowTreeIfNeeded):
1164
1165         Factor into a function.
1166
1167         * style/StyleInvalidator.h:
1168
1169 2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>
1170
1171         [GTK][WPE] Fix non-unified builds after r250486
1172         https://bugs.webkit.org/show_bug.cgi?id=202636
1173
1174         Reviewed by Youenn Fablet.
1175
1176         No new tests needed.
1177
1178         * Modules/fetch/FetchLoader.h: Add missing forward declaration of WebCore::SharedBuffer.
1179         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Add missing inclusion of header
1180         wtf/text/StringConcatenateNumbers.h
1181         * Modules/indexeddb/shared/IDBIterateCursorData.cpp: Ditto.
1182         * animation/DocumentTimeline.cpp: Add missing inclusion of the EventNames.h and
1183         JavaScriptCore/VM.h headers.
1184         * bindings/js/JSDOMWindowCustom.cpp: Add missing inclusion of the JSDOMConvertCallbacks.h
1185         header.
1186         * bindings/js/JSIDBRequestCustom.cpp: Add missing inclusion of the JSDOMConvertIndexedDB.h
1187         and JSDOMConvertSequences.h headers.
1188         * bindings/js/JSRemoteDOMWindowCustom.cpp: Add missing inclusion of the
1189         JSDOMExceptionHandling.h header.
1190         * bindings/js/ScriptController.cpp: Add missing inclusion of the
1191         JavaScriptCore/WeakGCMapInlines.h header to avoid missing symbols during linking.
1192         * bindings/js/ScriptModuleLoader.h: Add missing inclusion of the wtf/HashSet.h header
1193         and add a forward declaration for the JSC::JSModuleRecord type.
1194         * bindings/js/WindowProxy.cpp: Add missing inclusion of the JavaScriptCore/StrongInlines.h
1195         header to avoid missing symbols during linking.
1196         * css/FontFaceSet.cpp: Add missing inclusion of the DOMPromiseProxy.h header.
1197         * css/FontFaceSet.h: Add missing inclusion of the IDLTypes.h header.
1198         * dom/IdleDeadline.h: Add missing inclusion of the wtf/Ref.h header.
1199         * history/CachedPage.h: Add missing inclusion of the wtf/MonotonicTime.h header.
1200         * html/canvas/WebGLBuffer.h: Add missing inclusion of the wtf/RefPtr.h header.
1201         * html/canvas/WebGLFramebuffer.h: Add missing inclusion of the wtf/HashMap.h and
1202         wtf/Vector.h headers.
1203         * html/canvas/WebGLProgram.h: Add missing inclusion of the wtf/HashFunctions.h, wtf/Lock.h,
1204         and wtf/Vector.h headers; add the missing namespace to an usage of WTF::LockHolder.
1205         * html/canvas/WebGLShader.h: Add missing inclusion of the wtf/text/WTFString.h header.
1206         * inspector/InspectorController.cpp: Add missing inclusion of the SharedBuffer.h header.
1207         * inspector/agents/InspectorCanvasAgent.cpp: Add missing inclusion of the ImageBitmap.h
1208         header.
1209         * page/DOMWindowExtension.cpp: Add missing inclusion of the Document.h header.
1210         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Add missing inclusion of the
1211         ScrollingTreeFrameScrollingNode.h header.
1212         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Add missing inclusion
1213         of the Logging.h header.
1214         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: Add missing
1215         inclusion of the ScrollingTree.h header.
1216         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Add missing inclusion of the
1217         ScrollingTreeOverflowScrollProxyNode.h header.
1218         * platform/SuspendableTaskQueue.cpp: Add missing inclusion of the ScriptExecutionContext.h
1219         header.
1220         * workers/Worker.cpp: Add missing inclusion of the JavaScriptCore/ScriptCallStack.h header.
1221
1222 2019-10-08  youenn fablet  <youenn@apple.com>
1223
1224         MediaStreamTrack should be a PlatformMediaSessionClient instead of MediaStream
1225         https://bugs.webkit.org/show_bug.cgi?id=202631
1226
1227         Reviewed by Eric Carlson.
1228
1229         Make MediaStreamTrack a PlatformMediaSessionClient, which allows tracking tracks that are not owned by a stream.
1230         MediaStream is no longer a PlatformMediaSessionClient so we move some of MediaStream API implementation to MediaStreamTrack.
1231
1232         Covered by updated test.
1233
1234         * Modules/mediastream/MediaStream.cpp:
1235         (WebCore::MediaStream::MediaStream):
1236         (WebCore::MediaStream::startProducingData):
1237         (WebCore::MediaStream::stopProducingData):
1238         (WebCore::MediaStream::statusDidChange):
1239         (WebCore::MediaStream::mediaType const): Deleted.
1240         (WebCore::MediaStream::presentationType const): Deleted.
1241         (WebCore::MediaStream::characteristics const): Deleted.
1242         (WebCore::MediaStream::mayResumePlayback): Deleted.
1243         (WebCore::MediaStream::suspendPlayback): Deleted.
1244         (WebCore::MediaStream::sourceApplicationIdentifier const): Deleted.
1245         (WebCore::MediaStream::canProduceAudio const): Deleted.
1246         (WebCore::MediaStream::processingUserGestureForMedia const): Deleted.
1247         * Modules/mediastream/MediaStream.h:
1248         * Modules/mediastream/MediaStreamTrack.cpp:
1249         (WebCore::MediaStreamTrack::MediaStreamTrack):
1250         (WebCore::MediaStreamTrack::configureTrackRendering):
1251         (WebCore::MediaStreamTrack::mediaType const):
1252         (WebCore::MediaStreamTrack::presentationType const):
1253         (WebCore::MediaStreamTrack::characteristics const):
1254         (WebCore::MediaStreamTrack::mayResumePlayback):
1255         (WebCore::MediaStreamTrack::suspendPlayback):
1256         (WebCore::MediaStreamTrack::sourceApplicationIdentifier const):
1257         (WebCore::MediaStreamTrack::canProduceAudio const):
1258         (WebCore::MediaStreamTrack::processingUserGestureForMedia const):
1259         * Modules/mediastream/MediaStreamTrack.h:
1260         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1261         (WebCore::MediaPlayerPrivateGStreamer::load):
1262         * platform/mediastream/MediaStreamPrivate.cpp:
1263         (WebCore::MediaStreamPrivate::hasVideo const):
1264         (WebCore::MediaStreamPrivate::hasAudio const):
1265         (WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
1266         (WebCore::MediaStreamPrivate::hasCaptureAudioSource const): Deleted.
1267         * platform/mediastream/MediaStreamPrivate.h:
1268         * platform/mediastream/MediaStreamTrackPrivate.h:
1269
1270 2019-10-08  Brady Eidson  <beidson@apple.com>
1271
1272         Service Worker Fetch events should time out.
1273         https://bugs.webkit.org/show_bug.cgi?id=202188
1274
1275         Reviewed by Alex Christensen.
1276
1277         Test: http/tests/workers/service/basic-timeout.https.html
1278
1279         * workers/service/server/SWServer.h:
1280         * workers/service/server/SWServerWorker.h:
1281         (WebCore::SWServerWorker::setHasTimedOutAnyFetchTasks):
1282         (WebCore::SWServerWorker::hasTimedOutAnyFetchTasks const):
1283
1284 2019-10-08  Alexey Shvayka  <shvaikalesh@gmail.com>
1285
1286         Accept two values in the overflow shorthand
1287         https://bugs.webkit.org/show_bug.cgi?id=184691
1288
1289         Reviewed by Simon Fraser.
1290
1291         In https://github.com/w3c/csswg-drafts/issues/2484 it was resolved to accept one or two values in
1292         the overflow shorthand, instead of only one. If two values are specified, the first would be used
1293         for overflow-x and the second for overflow-y. This change was shipped in Firefox 61 and Chrome 68.
1294         This patch implements new syntax while preserving handling of -webkit-paged-x and -webkit-paged-y.
1295
1296         Tests: fast/css/cssText-shorthand.html
1297                fast/css/getComputedStyle/getComputedStyle-overflow.html
1298                imported/w3c/web-platform-tests/css/css-overflow/overflow-shorthand-001.html
1299                imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-computed.html
1300                imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-valid.html
1301                imported/w3c/web-platform-tests/css/cssom/shorthand-values.html
1302
1303         * css/CSSComputedStyleDeclaration.cpp:
1304         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
1305         * css/CSSProperties.json:
1306         * css/StyleProperties.cpp:
1307         (WebCore::StyleProperties::getPropertyValue const):
1308         * css/parser/CSSPropertyParser.cpp:
1309         (WebCore::CSSPropertyParser::consumeOverflowShorthand):
1310         (WebCore::CSSPropertyParser::parseShorthand):
1311         * css/parser/CSSPropertyParser.h:
1312
1313 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1314
1315         Unreviewed, fix WebCore's features.json after r250824
1316
1317         * features.json: Remove an erroneous "specification" key.
1318
1319 2019-10-08  Chris Dumez  <cdumez@apple.com>
1320
1321         Make sure ActiveDOMObject properly deals with detached documents
1322         https://bugs.webkit.org/show_bug.cgi?id=202596
1323
1324         Reviewed by Geoffrey Garen.
1325
1326         For detached document, the script execution context is their context document.
1327         The ActiveDOMObject constructor taking a Document& would make sure to get the
1328         document's contextDocument. However, if the ActiveDOMObject constructor taking
1329         a ScriptExecutionContext* is called, it would assume this is the right script
1330         execution context, which is unsafe. In this patch, all ActiveDOMObject
1331         constructors now check for detached documents and make sure to use their
1332         context document when necessary.
1333
1334         * dom/ActiveDOMObject.cpp:
1335         (WebCore::suitableScriptExecutionContext):
1336         (WebCore::ActiveDOMObject::ActiveDOMObject):
1337         * dom/ActiveDOMObject.h:
1338         * dom/Document.h:
1339
1340 2019-10-09  Simon Fraser  <simon.fraser@apple.com>
1341
1342         Clean up WheelEventTestTriggers logging
1343         https://bugs.webkit.org/show_bug.cgi?id=202764
1344
1345         Reviewed by Tim Horton.
1346
1347         Make DeferTestTriggerReason a bit set, and use OptionSet<> rather than StdSet. Make
1348         DeferTestTriggerReason and ScrollableAreaReasonMap loggable, and simplify the logging.
1349
1350         * page/WheelEventTestTrigger.cpp:
1351         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
1352         (WebCore::WheelEventTestTrigger::deferTestsForReason):
1353         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
1354         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
1355         (WebCore::operator<<):
1356         (WebCore::dumpState): Deleted.
1357         * page/WheelEventTestTrigger.h:
1358         * page/scrolling/AsyncScrollingCoordinator.cpp:
1359         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1360         (WebCore::AsyncScrollingCoordinator::deferTestsForReason const):
1361         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason const):
1362         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1363         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
1364         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
1365
1366 2019-10-08  Ross Kirsling  <ross.kirsling@sony.com>
1367
1368         Unreviewed. Restabilize non-unified build.
1369
1370         * Modules/fetch/FetchLoader.h:
1371         * animation/DocumentTimeline.cpp:
1372         * bindings/js/JSDOMWindowCustom.cpp:
1373         * bindings/js/JSIDBRequestCustom.cpp:
1374         * bindings/js/JSRemoteDOMWindowCustom.cpp:
1375         * bindings/js/ScriptModuleLoader.h:
1376         * bindings/js/WindowProxy.cpp:
1377         * css/FontFaceSet.cpp:
1378         * css/FontFaceSet.h:
1379         * css/typedom/StylePropertyMapReadOnly.cpp:
1380         * history/CachedPage.h:
1381         * html/canvas/WebGLBuffer.cpp:
1382         * html/canvas/WebGLBuffer.h:
1383         * html/canvas/WebGLFramebuffer.h:
1384         * html/canvas/WebGLProgram.cpp:
1385         * html/canvas/WebGLProgram.h:
1386         * html/canvas/WebGLShader.h:
1387         * inspector/InspectorController.cpp:
1388         * inspector/agents/InspectorCanvasAgent.cpp:
1389         * workers/Worker.cpp:
1390         * workers/service/ServiceWorkerContainer.cpp:
1391         * workers/service/ServiceWorkerGlobalScope.cpp:
1392
1393 2019-10-08  Zalan Bujtas  <zalan@apple.com>
1394
1395         [LFC][Painting] Add very basic block and inline painting
1396         https://bugs.webkit.org/show_bug.cgi?id=202697
1397         <rdar://problem/56076562>
1398
1399         Reviewed by Antti Koivisto.
1400
1401         This is a very basic border/background painting with simple text. No phases/z-index/layers of any kind.
1402
1403         * layout/displaytree/DisplayBox.h: This seems to be getting out of hand.
1404         (WebCore::Display::Box::moveBy):
1405         * layout/displaytree/DisplayPainter.cpp:
1406         (WebCore::Display::paintBlockLevelBoxDecoration):
1407         (WebCore::Display::paintInlineContent):
1408         (WebCore::Display::Painter::paint):
1409         * layout/floats/FloatingContext.h:
1410         * layout/inlineformatting/InlineFormattingState.h:
1411         (WebCore::Layout::InlineFormattingState::inlineRuns const):
1412         (WebCore::Layout::InlineFormattingState::lineBoxes const):
1413
1414 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1415
1416         Unreviewed, try to fix the WinCairo build after r250824
1417
1418         * dom/IdleDeadline.h:
1419
1420         Add a missing include for <wtf/Ref.h>, such that the adoptRef function is defined.
1421
1422 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1423
1424         Unreviewed, try to fix the open source macOS build after r250824
1425
1426         * bindings/js/JSDOMConvertRecord.h:
1427
1428         Add a missing #include for JSDOMGlobalObject. This file utilizes methods on JSDOMGlobalObject, but only ensures
1429         that it has a forward declaration of JSDOMGlobalObject (by way of including JSDOMExceptionHandling.h through
1430         JSDOMConvertBase.h).
1431
1432 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1433
1434         Unreviewed, update DerivedSources xcfilelists after r250816
1435
1436         * DerivedSources-input.xcfilelist:
1437         * DerivedSources-output.xcfilelist:
1438
1439 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1440
1441         [Clipboard API] Introduce bindings for the async Clipboard API
1442         https://bugs.webkit.org/show_bug.cgi?id=202622
1443         <rdar://problem/56038126>
1444
1445         Reviewed by Ryosuke Niwa.
1446
1447         Adds IDL for the async clipboard API (with the exception of delayed item generation interfaces, which
1448         I'll iterate on and introduce separately). See: https://w3c.github.io/clipboard-apis/#async-clipboard-api for
1449         more information.
1450
1451         Tests: editing/async-clipboard/clipboard-interfaces.html
1452                editing/async-clipboard/clipboard-wrapper-stays-alive.html
1453
1454         * CMakeLists.txt:
1455         * DerivedSources-input.xcfilelist:
1456         * DerivedSources-output.xcfilelist:
1457         * DerivedSources.make:
1458         * Modules/async-clipboard/Clipboard.cpp:
1459         (WebCore::Clipboard::create):
1460         (WebCore::Clipboard::Clipboard):
1461         (WebCore::Clipboard::navigator):
1462         (WebCore::Clipboard::eventTargetInterface const):
1463         (WebCore::Clipboard::scriptExecutionContext const):
1464         (WebCore::Clipboard::readText):
1465         (WebCore::Clipboard::writeText):
1466         (WebCore::Clipboard::read):
1467         (WebCore::Clipboard::write):
1468
1469         Stub out these API calls for now by immediately rejecting the given promise.
1470
1471         * Modules/async-clipboard/Clipboard.h:
1472         * Modules/async-clipboard/Clipboard.idl:
1473         * Modules/async-clipboard/ClipboardItem.cpp:
1474         (WebCore::ClipboardItem::ClipboardItem):
1475         (WebCore::ClipboardItem::create):
1476         (WebCore::ClipboardItem::types const):
1477         (WebCore::ClipboardItem::getType):
1478
1479         Stub out these API calls for now by immediately rejecting the given promise.
1480
1481         (WebCore::navigator):
1482         * Modules/async-clipboard/ClipboardItem.h:
1483         (WebCore::ClipboardItem::presentationStyle const):
1484         * Modules/async-clipboard/ClipboardItem.idl:
1485         * Modules/async-clipboard/NavigatorClipboard.cpp:
1486         (WebCore::NavigatorClipboard::NavigatorClipboard):
1487         (WebCore::NavigatorClipboard::clipboard):
1488         (WebCore::NavigatorClipboard::from):
1489         (WebCore::NavigatorClipboard::supplementName):
1490         * Modules/async-clipboard/NavigatorClipboard.h:
1491         * Modules/async-clipboard/NavigatorClipboard.idl:
1492         * Modules/mediastream/MediaStreamTrack.cpp:
1493         * Modules/mediastream/RTCDTMFSender.cpp:
1494         * Modules/mediastream/RTCRtpSender.cpp:
1495         * Modules/webgpu/WebGPUPipeline.h:
1496
1497         More unified sources-related build fixes.
1498
1499         * Sources.txt:
1500         * WebCore.xcodeproj/project.pbxproj:
1501         * bindings/js/WebCoreBuiltinNames.h:
1502         * dom/DeviceOrientationOrMotionEvent.cpp:
1503
1504         Unified sources-related build fix.
1505
1506         * dom/EventTargetFactory.in:
1507         * features.json:
1508
1509         Add Async Clipboard API as a feature in development on webkit.org.
1510
1511         * page/Settings.yaml:
1512
1513 2019-10-08  Rob Buis  <rbuis@igalia.com>
1514
1515         Fetch: data: URL HEAD request should result in empty response body
1516         https://bugs.webkit.org/show_bug.cgi?id=175764
1517
1518         Reviewed by Youenn Fablet.
1519
1520         Do not build the response body for HEAD requests for data urls:
1521         https://fetch.spec.whatwg.org/#concept-main-fetch (Step 13)
1522
1523         Tests: imported/web-platform-tests/fetch/api/basic/scheme-data.any.js
1524                imported/web-platform-tests/xhr/data-uri.html
1525
1526         * loader/ResourceLoader.cpp:
1527         (WebCore::ResourceLoader::loadDataURL):
1528
1529 2019-10-08  Antti Koivisto  <antti@apple.com>
1530
1531         [CSS Shadow Parts] Implement style invalidation
1532         https://bugs.webkit.org/show_bug.cgi?id=202632
1533
1534         Reviewed by Ryosuke Niwa.
1535
1536         Tests: fast/css/shadow-parts/invalidation-class-descendant-combinator-export.html
1537                fast/css/shadow-parts/invalidation-class-descendant-combinator.html
1538                fast/css/shadow-parts/invalidation-class-sibling-combinator-export.html
1539                fast/css/shadow-parts/invalidation-class-sibling-combinator.html
1540
1541         * css/RuleFeature.cpp:
1542         (WebCore::isSiblingOrSubject):
1543
1544         Don't treat crossing to host as moving to ancestor when computing elements impacted by a selector.
1545         StyleInvalidator expects these relations to be about the host element, shadow tree invalidation in handled separately.
1546
1547         * dom/Element.cpp:
1548         (WebCore::Element::attributeChanged):
1549
1550         Invalidate parts in shadow tree on 'exportparts' attribute mutation.
1551
1552         (WebCore::Element::partAttributeChanged):
1553
1554         Invalidate element on 'part' attribute mutation.
1555
1556         * style/StyleInvalidator.cpp:
1557         (WebCore::Style::Invalidator::Invalidator):
1558         (WebCore::Style::Invalidator::invalidateIfNeeded):
1559
1560         Invalidate parts in shadow tree during class and attribute mutation invalidation.
1561
1562         (WebCore::Style::Invalidator::invalidateShadowParts):
1563         * style/StyleInvalidator.h:
1564         (WebCore::Style::Invalidator::dirtiesAllStyle const):
1565         (WebCore::Style::Invalidator::hasShadowPseudoElementRulesInAuthorSheet const): Deleted.
1566
1567         Remove an unncessary bool.
1568
1569 2019-10-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1570
1571         Unreviewed. Remove unused WebKitSoupRequestGeneric after r250597
1572
1573         * platform/Soup.cmake:
1574         * platform/SourcesSoup.txt:
1575         * platform/network/soup/ResourceRequestSoup.cpp:
1576         (WebCore::ResourceRequest::updateSoupRequest const):
1577         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Removed.
1578         * platform/network/soup/WebKitSoupRequestGeneric.h: Removed.
1579         * platform/network/soup/WebKitSoupRequestGenericClient.h: Removed.
1580
1581 2019-10-08  Antti Koivisto  <antti@apple.com>
1582
1583         [CSS Shadow Parts] Internal shadow pseudo elements should work with ::part
1584         https://bugs.webkit.org/show_bug.cgi?id=202620
1585
1586         Reviewed by Ryosuke Niwa.
1587
1588         Selectors like ::part(foo)::placeholder should work.
1589
1590         This involves hop out of a UA shadow tree and then from an author shadow tree.
1591
1592         * css/ElementRuleCollector.cpp:
1593         (WebCore::ElementRuleCollector::matchAuthorRules):
1594         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
1595
1596         If we are matching a pseudo element in a UA shadow tree, see if part rules can match is the surrounding scope.
1597
1598         (WebCore::ElementRuleCollector::matchPartPseudoElementRulesForScope):
1599         * css/ElementRuleCollector.h:
1600         * css/RuleSet.cpp:
1601         (WebCore::RuleSet::addRule):
1602
1603         Sort rules with both internal pseudo element and ::part to the part bucket.
1604
1605         * css/SelectorChecker.cpp:
1606         (WebCore::SelectorChecker::matchRecursively const):
1607         * css/parser/CSSSelectorParser.cpp:
1608         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
1609
1610         Allow multiple ShadowDescendant relations for ::part.
1611
1612 2019-10-07  Ryosuke Niwa  <rniwa@webkit.org>
1613
1614         Add IDL for requestIdleCallback
1615         https://bugs.webkit.org/show_bug.cgi?id=202653
1616
1617         Reviewed by Geoffrey Garen.
1618
1619         Added the basic scaffolding for implementing requestIdleCallback disabled by default:
1620         https://w3c.github.io/requestidlecallback/
1621
1622         This patch just adds the support for calling requestIdleCallback which generates a monotonically increasing number.
1623         The callback is never called for now.
1624
1625         Tests: requestidlecallback/requestidlecallback-enabled.html
1626                requestidlecallback/requestidlecallback-id.html
1627                requestidlecallback/requestidlecallback-not-enabled.html
1628
1629         * CMakeLists.txt:
1630         * DerivedSources.make:
1631         * Sources.txt:
1632         * WebCore.xcodeproj/project.pbxproj:
1633         * bindings/js/WebCoreBuiltinNames.h:
1634         * dom/Document.cpp:
1635         (WebCore::Document::requestIdleCallback):
1636         (WebCore::Document::cancelIdleCallback):
1637         * dom/Document.h:
1638         * dom/IdleCallbackController.cpp: Added.
1639         (WebCore::IdleCallbackController::queueIdleCallback):
1640         (WebCore::IdleCallbackController::removeIdleCallback):
1641         * dom/IdleCallbackController.h: Added.
1642         * dom/IdleDeadline.cpp: Added.
1643         (WebCore::IdleDeadline::timeRemaining const):
1644         (WebCore::IdleDeadline::didTimeout const):
1645         * dom/IdleDeadline.h: Added.
1646         * dom/IdleDeadline.idl: Added.
1647         * dom/IdleRequestCallback.h: Added.
1648         * dom/IdleRequestCallback.idl: Added.
1649         * dom/IdleRequestOptions.h: Added.
1650         * dom/IdleRequestOptions.idl: Added.
1651         * page/DOMWindow.cpp:
1652         (WebCore::DOMWindow::requestIdleCallback):
1653         (WebCore::DOMWindow::cancelIdleCallback):
1654         * page/DOMWindow.h:
1655         * page/DOMWindow.idl:
1656         * page/Settings.yaml:
1657
1658 2019-10-07  Jiewen Tan  <jiewen_tan@apple.com>
1659
1660         Only wrapping CryptoKeys for IDB during serialization
1661         https://bugs.webkit.org/show_bug.cgi?id=202500
1662         <rdar://problem/52445927>
1663
1664         Reviewed by Chris Dumez.
1665
1666         Wrapping CryptoKeys during IDB serialization is a legacy request from Netflix when WebKit was an
1667         early adopter. It is not necessary for other kinds of serialization. However, given existing keys
1668         stored in users' idb are wrapped, the wrapping/unwrapping mechanism cannot be easily discarded.
1669         Therefore, this patch restricts the wrapping/unwrapping mechanism to idb only.
1670
1671         To do so, a isWrappingRequired flag is added to CryptoKey such that whenever idb sees a CryptoKey,
1672         it can set it. SerializedScriptValue will then only wrap a CryptoKey when this flag is set. Otherwise,
1673         a new tag UnwrappedCryptoKeyTag is used to store unwrapped CryptoKeys in order to keep the old CryptoKeyTag
1674         binaries intact. For deserialization, each type will be deserialized differently.
1675
1676         Besides the above, this patch also hardens WorkerGlobalScope::wrapCryptoKey/unwrapCryptoKey for
1677         any potential racy issues. CryptoBooleanContainer is introduced to capture boolean in the lambda.
1678         workerGlobalScope is replaced with workerMessagingProxy. Now, every variables captured in the lambdas
1679         should be either a copy or a thread safe ref of the original object.
1680
1681         Test: crypto/workers/subtle/aes-indexeddb.html
1682
1683         * Modules/indexeddb/IDBObjectStore.cpp:
1684         (WebCore::JSC::setIsWrappingRequiredForCryptoKey):
1685         (WebCore::IDBObjectStore::putOrAdd):
1686         * bindings/js/SerializedScriptValue.cpp:
1687         (WebCore::CloneSerializer::dumpIfTerminal):
1688         (WebCore::CloneDeserializer::readTerminal):
1689         * crypto/CryptoKey.h:
1690         (WebCore::CryptoKey::isWrappingRequired const):
1691         (WebCore::CryptoKey::setIsWrappingRequired):
1692         * dom/ScriptExecutionContext.h:
1693         * workers/WorkerGlobalScope.cpp:
1694         (WebCore::CryptoBooleanContainer::create):
1695         (WebCore::CryptoBooleanContainer::boolean const):
1696         (WebCore::CryptoBooleanContainer::setBoolean):
1697         (WebCore::WorkerGlobalScope::wrapCryptoKey):
1698         (WebCore::WorkerGlobalScope::unwrapCryptoKey):
1699         * workers/WorkerGlobalScope.h:
1700         * workers/WorkerLoaderProxy.h:
1701         (WebCore::WorkerLoaderProxy::isWorkerMessagingProxy const):
1702         * workers/WorkerMessagingProxy.h:
1703         (isType):
1704
1705 2019-10-07  Yusuke Suzuki  <ysuzuki@apple.com>
1706
1707         Unreviewed, build fix for Windows
1708         https://bugs.webkit.org/show_bug.cgi?id=202569
1709
1710         * bindings/js/JSHTMLElementCustom.cpp:
1711         (WebCore::constructJSHTMLElement):
1712         * bindings/js/JSWebAnimationCustom.cpp:
1713         (WebCore::constructJSWebAnimation):
1714
1715 2019-10-07  Yusuke Suzuki  <ysuzuki@apple.com>
1716
1717         [JSC] Change signature of HostFunction to (JSGlobalObject*, CallFrame*)
1718         https://bugs.webkit.org/show_bug.cgi?id=202569
1719
1720         Reviewed by Saam Barati.
1721
1722         No behavior change.
1723
1724         While signature is changed, we still use `state` name for CallFrame* variable since changing this involves massive channge in
1725         CodeGeneratorJS.pm. When replacing `ExecState*` to `JSGlobalObject*`, we just remove these `state` variable and use `globalObject`
1726         instead.
1727
1728         * Modules/applepay/ApplePaySession.h:
1729         * Modules/applepay/PaymentMerchantSession.h:
1730         * Modules/fetch/FetchResponse.h:
1731         * Modules/indexeddb/IDBFactory.h:
1732         * Modules/indexeddb/IDBIndex.h:
1733         * Modules/indexeddb/IDBKeyRange.h:
1734         * Modules/indexeddb/IDBObjectStore.h:
1735         * Modules/indexeddb/server/IDBSerializationContext.h:
1736         * bindings/js/IDBBindingUtilities.h:
1737         * bindings/js/JSDOMBindingSecurity.h:
1738         * bindings/js/JSDOMBuiltinConstructor.h:
1739         (WebCore::JSDOMBuiltinConstructor<JSClass>::construct):
1740         * bindings/js/JSDOMConstructor.h:
1741         * bindings/js/JSDOMConstructorBase.cpp:
1742         (WebCore::callThrowTypeError):
1743         * bindings/js/JSDOMConstructorNotConstructable.h:
1744         (WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
1745         * bindings/js/JSDOMGlobalObject.cpp:
1746         (WebCore::makeThisTypeErrorForBuiltins):
1747         (WebCore::makeGetterTypeErrorForBuiltins):
1748         (WebCore::isReadableByteStreamAPIEnabled):
1749         * bindings/js/JSDOMIterator.h:
1750         (WebCore::IteratorTraits>::next):
1751         * bindings/js/JSDOMNamedConstructor.h:
1752         * bindings/js/JSDOMPromise.cpp:
1753         (WebCore::DOMPromise::whenPromiseIsSettled):
1754         * bindings/js/JSDOMWindowCustom.cpp:
1755         (WebCore::jsDOMWindowInstanceFunctionOpenDatabase):
1756         * bindings/js/JSExtendableMessageEventCustom.cpp:
1757         (WebCore::constructJSExtendableMessageEvent):
1758         * bindings/js/JSHTMLElementCustom.cpp:
1759         (WebCore::constructJSHTMLElement):
1760         * bindings/js/JSPluginElementFunctions.cpp:
1761         (WebCore::callPlugin):
1762         * bindings/js/JSWebAnimationCustom.cpp:
1763         (WebCore::constructJSWebAnimation):
1764         * bindings/js/ScriptController.cpp:
1765         (WebCore::ScriptController::setupModuleScriptHandlers):
1766         * bindings/js/ScriptController.h:
1767         * bindings/js/ScriptModuleLoader.h:
1768         * bindings/js/ScriptState.h:
1769         * bindings/js/StructuredClone.cpp:
1770         (WebCore::cloneArrayBufferImpl):
1771         (WebCore::cloneArrayBuffer):
1772         (WebCore::structuredCloneArrayBuffer):
1773         (WebCore::structuredCloneArrayBufferView):
1774         * bindings/js/StructuredClone.h:
1775         * bindings/scripts/CodeGeneratorJS.pm:
1776         (GenerateHeader):
1777         (GenerateImplementation):
1778         (GenerateOperationTrampolineDefinition):
1779         (GenerateSerializerDefinition):
1780         (GenerateLegacyCallerDefinitions):
1781         (GenerateLegacyCallerDefinition):
1782         (GenerateIterableDefinition):
1783         (GenerateConstructorDefinitions):
1784         (GenerateConstructorDefinition):
1785         * bindings/scripts/test/JS/JSMapLike.cpp:
1786         (WebCore::jsMapLikePrototypeFunctionGet):
1787         (WebCore::jsMapLikePrototypeFunctionHas):
1788         (WebCore::jsMapLikePrototypeFunctionEntries):
1789         (WebCore::jsMapLikePrototypeFunctionKeys):
1790         (WebCore::jsMapLikePrototypeFunctionValues):
1791         (WebCore::jsMapLikePrototypeFunctionForEach):
1792         (WebCore::jsMapLikePrototypeFunctionAdd):
1793         (WebCore::jsMapLikePrototypeFunctionClear):
1794         (WebCore::jsMapLikePrototypeFunctionDelete):
1795         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1796         (WebCore::jsReadOnlyMapLikePrototypeFunctionGet):
1797         (WebCore::jsReadOnlyMapLikePrototypeFunctionHas):
1798         (WebCore::jsReadOnlyMapLikePrototypeFunctionEntries):
1799         (WebCore::jsReadOnlyMapLikePrototypeFunctionKeys):
1800         (WebCore::jsReadOnlyMapLikePrototypeFunctionValues):
1801         (WebCore::jsReadOnlyMapLikePrototypeFunctionForEach):
1802         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1803         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
1804         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
1805         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1806         (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactions):
1807         (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsNotNeeded):
1808         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1809         (WebCore::jsTestCEReactionsStringifierPrototypeFunctionToString):
1810         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1811         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterface):
1812         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecified):
1813         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArguments):
1814         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgument):
1815         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
1816         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgument):
1817         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgument):
1818         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgument):
1819         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1820         (WebCore::jsTestDOMJITPrototypeFunctionGetAttribute):
1821         (WebCore::jsTestDOMJITPrototypeFunctionItem):
1822         (WebCore::jsTestDOMJITPrototypeFunctionHasAttribute):
1823         (WebCore::jsTestDOMJITPrototypeFunctionGetElementById):
1824         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName):
1825         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1826         (WebCore::jsTestEnabledBySettingPrototypeFunctionEnabledBySettingOperation):
1827         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1828         (WebCore::JSTestEventConstructorConstructor::construct):
1829         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1830         (WebCore::jsTestEventTargetPrototypeFunctionItem):
1831         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1832         (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
1833         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
1834         (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStatic):
1835         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorld):
1836         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled):
1837         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabled):
1838         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
1839         (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResult):
1840         (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBoolean):
1841         (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBoolean):
1842         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1843         (WebCore::jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter):
1844         * bindings/scripts/test/JS/JSTestInterface.cpp:
1845         (WebCore::JSTestInterfaceConstructor::construct):
1846         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1):
1847         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1848         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3):
1849         (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4):
1850         (WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
1851         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
1852         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1853         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3):
1854         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
1855         * bindings/scripts/test/JS/JSTestIterable.cpp:
1856         (WebCore::jsTestIterablePrototypeFunctionEntries):
1857         (WebCore::jsTestIterablePrototypeFunctionKeys):
1858         (WebCore::jsTestIterablePrototypeFunctionValues):
1859         (WebCore::jsTestIterablePrototypeFunctionForEach):
1860         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1861         (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction):
1862         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1863         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
1864         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1865         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter):
1866         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter):
1867         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1868         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
1869         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1870         (WebCore::jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleter):
1871         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1872         (WebCore::jsTestNamedGetterWithIdentifierPrototypeFunctionGetterName):
1873         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1874         (WebCore::jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetter):
1875         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1876         (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetter):
1877         (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetter):
1878         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1879         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionNamedSetter):
1880         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter):
1881         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1882         (WebCore::jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperation):
1883         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1884         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperation):
1885         * bindings/scripts/test/JS/JSTestNode.cpp:
1886         (WebCore::JSTestNodeConstructor::construct):
1887         (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
1888         (WebCore::jsTestNodePrototypeFunctionCalculateSecretResult):
1889         (WebCore::jsTestNodePrototypeFunctionGetSecretBoolean):
1890         (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBoolean):
1891         (WebCore::jsTestNodePrototypeFunctionEntries):
1892         (WebCore::jsTestNodePrototypeFunctionKeys):
1893         (WebCore::jsTestNodePrototypeFunctionValues):
1894         (WebCore::jsTestNodePrototypeFunctionForEach):
1895         (WebCore::jsTestNodePrototypeFunctionToJSON):
1896         * bindings/scripts/test/JS/JSTestObj.cpp:
1897         (WebCore::JSTestObjConstructor::construct):
1898         (WebCore::callJSTestObj1):
1899         (WebCore::callJSTestObj2):
1900         (WebCore::callJSTestObj3):
1901         (WebCore::callJSTestObj):
1902         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
1903         (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStatic):
1904         (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled):
1905         (WebCore::jsTestObjPrototypeFunctionWorldSpecificMethod):
1906         (WebCore::jsTestObjPrototypeFunctionCalculateSecretResult):
1907         (WebCore::jsTestObjPrototypeFunctionGetSecretBoolean):
1908         (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBoolean):
1909         (WebCore::jsTestObjPrototypeFunctionVoidMethod):
1910         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1911         (WebCore::jsTestObjPrototypeFunctionByteMethod):
1912         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1913         (WebCore::jsTestObjPrototypeFunctionOctetMethod):
1914         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1915         (WebCore::jsTestObjPrototypeFunctionLongMethod):
1916         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1917         (WebCore::jsTestObjPrototypeFunctionObjMethod):
1918         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1919         (WebCore::jsTestObjInstanceFunctionUnforgeableMethod):
1920         (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
1921         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
1922         (WebCore::jsTestObjPrototypeFunctionNullableStringMethod):
1923         (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod):
1924         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
1925         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
1926         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg):
1927         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
1928         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
1929         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1930         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
1931         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
1932         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
1933         (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArg):
1934         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableByteStringArg):
1935         (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgTreatingNullAsEmptyString):
1936         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
1937         (WebCore::jsTestObjPrototypeFunctionMethodWithRecord):
1938         (WebCore::jsTestObjPrototypeFunctionMethodWithException):
1939         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningLong):
1940         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningObject):
1941         (WebCore::jsTestObjPrototypeFunctionCustomMethod):
1942         (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgs):
1943         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
1944         (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
1945         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
1946         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
1947         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
1948         (WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
1949         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
1950         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
1951         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
1952         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
1953         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
1954         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
1955         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
1956         (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgument):
1957         (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgument):
1958         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
1959         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
1960         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
1961         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
1962         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
1963         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
1964         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomString):
1965         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
1966         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringAndDefaultValue):
1967         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
1968         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
1969         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsNull):
1970         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
1971         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
1972         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsEmptyString):
1973         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
1974         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
1975         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
1976         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
1977         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
1978         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
1979         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
1980         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
1981         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
1982         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
1983         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
1984         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalObject):
1985         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
1986         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
1987         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
1988         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecord):
1989         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromise):
1990         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
1991         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
1992         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
1993         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
1994         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
1995         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArg):
1996         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg):
1997         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
1998         (WebCore::jsTestObjPrototypeFunctionConditionalMethod1):
1999         (WebCore::jsTestObjPrototypeFunctionConditionalMethod2):
2000         (WebCore::jsTestObjPrototypeFunctionConditionalMethod3):
2001         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
2002         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
2003         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion):
2004         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions):
2005         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion):
2006         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
2007         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):
2008         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
2009         (WebCore::jsTestObjConstructorFunctionClassMethod):
2010         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
2011         (WebCore::jsTestObjConstructorFunctionClassMethod2):
2012         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
2013         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
2014         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptional):
2015         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
2016         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptional):
2017         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
2018         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
2019         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
2020         (WebCore::jsTestObjPrototypeFunctionOperationWithOptionalUnionParameter):
2021         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
2022         (WebCore::jsTestObjPrototypeFunctionGetElementById):
2023         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
2024         (WebCore::jsTestObjPrototypeFunctionConvert1):
2025         (WebCore::jsTestObjPrototypeFunctionConvert2):
2026         (WebCore::jsTestObjPrototypeFunctionConvert3):
2027         (WebCore::jsTestObjPrototypeFunctionConvert4):
2028         (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
2029         (WebCore::jsTestObjPrototypeFunctionOrange):
2030         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
2031         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
2032         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
2033         (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
2034         (WebCore::jsTestObjPrototypeFunctionAny):
2035         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
2036         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
2037         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
2038         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
2039         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
2040         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
2041         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
2042         (WebCore::jsTestObjPrototypeFunctionTestCustomPromiseFunction):
2043         (WebCore::jsTestObjConstructorFunctionTestStaticCustomPromiseFunction):
2044         (WebCore::jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunction):
2045         (WebCore::jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunction):
2046         (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
2047         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
2048         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
2049         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
2050         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
2051         (WebCore::jsTestObjPrototypeFunctionLegacyCallerNamed):
2052         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimization):
2053         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithException):
2054         (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowFunction):
2055         (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWorkerFunction):
2056         (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowAndWorkerFunction):
2057         (WebCore::jsTestObjPrototypeFunctionToString):
2058         (WebCore::jsTestObjPrototypeFunctionToJSON):
2059         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2060         (WebCore::constructJSTestOverloadedConstructors1):
2061         (WebCore::constructJSTestOverloadedConstructors2):
2062         (WebCore::constructJSTestOverloadedConstructors3):
2063         (WebCore::constructJSTestOverloadedConstructors4):
2064         (WebCore::constructJSTestOverloadedConstructors5):
2065         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
2066         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2067         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
2068         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
2069         (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::construct):
2070         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2071         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
2072         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2073         (WebCore::JSTestPromiseRejectionEventConstructor::construct):
2074         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2075         (WebCore::jsTestSerializationPrototypeFunctionToJSON):
2076         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2077         (WebCore::jsTestSerializationInheritPrototypeFunctionToJSON):
2078         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2079         (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSON):
2080         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2081         (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunction):
2082         (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning):
2083         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2084         (WebCore::jsTestStringifierPrototypeFunctionToString):
2085         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2086         (WebCore::jsTestStringifierAnonymousOperationPrototypeFunctionToString):
2087         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2088         (WebCore::jsTestStringifierNamedOperationPrototypeFunctionIdentifier):
2089         (WebCore::jsTestStringifierNamedOperationPrototypeFunctionToString):
2090         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2091         (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionIdentifier):
2092         (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionToString):
2093         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2094         (WebCore::jsTestStringifierOperationNamedToStringPrototypeFunctionToString):
2095         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2096         (WebCore::jsTestStringifierReadOnlyAttributePrototypeFunctionToString):
2097         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2098         (WebCore::jsTestStringifierReadWriteAttributePrototypeFunctionToString):
2099         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2100         (WebCore::JSTestTypedefsConstructor::construct):
2101         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
2102         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
2103         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
2104         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
2105         (WebCore::jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg):
2106         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg):
2107         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg):
2108         (WebCore::jsTestTypedefsPrototypeFunctionUnionArg):
2109         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
2110         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef):
2111         (WebCore::jsTestTypedefsPrototypeFunctionPointFunction):
2112         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
2113         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
2114         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
2115         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException):
2116         * bridge/c/c_utility.h:
2117         * bridge/objc/objc_runtime.mm:
2118         (JSC::Bindings::callObjCFallbackObject):
2119         * bridge/runtime_method.cpp:
2120         (JSC::callRuntimeMethod):
2121         * bridge/runtime_object.cpp:
2122         (JSC::Bindings::callRuntimeObject):
2123         (JSC::Bindings::callRuntimeConstructor):
2124         * crypto/SubtleCrypto.h:
2125         * css/CSSFontFace.h:
2126         * dom/CustomElementReactionQueue.h:
2127         * dom/Document.h:
2128         * dom/MessagePort.h:
2129         * dom/MouseEvent.h:
2130         * dom/ScriptExecutionContext.h:
2131         * html/HTMLFrameElementBase.h:
2132         * html/canvas/WebGLAny.h:
2133         * inspector/agents/InspectorDOMAgent.h:
2134         * inspector/agents/page/PageRuntimeAgent.h:
2135         * page/DOMWindow.h:
2136         * page/PageConsoleClient.h:
2137         * page/RemoteDOMWindow.h:
2138         * page/csp/ContentSecurityPolicy.h:
2139         * platform/ThreadGlobalData.h:
2140         * plugins/PluginViewBase.h:
2141         * workers/DedicatedWorkerGlobalScope.h:
2142         * workers/Worker.h:
2143         * workers/WorkerConsoleClient.h:
2144         * workers/service/ExtendableMessageEvent.h:
2145         * worklets/WorkletConsoleClient.h:
2146
2147 2019-10-07  Sihui Liu  <sihui_liu@apple.com>
2148
2149         ASSERTION FAILED: m_transactionOperationsInProgressQueue.first() == &operation in IDBTransaction::operationCompletedOnClient
2150         https://bugs.webkit.org/show_bug.cgi?id=202552
2151
2152         Reviewed by Alex Christensen.
2153
2154         Dispatch task to database thread even if there is QuotaExceededError, to make sure request results are sent in 
2155         order.
2156
2157         Modified existing test to cover this: storage/indexeddb/storage-limit.html. Test would hit this assertion 
2158         without fix.
2159
2160         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2161         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
2162         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
2163         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
2164         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
2165         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
2166         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
2167         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
2168         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
2169         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
2170         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
2171         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
2172         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
2173         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
2174         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
2175         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
2176         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
2177         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
2178         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
2179         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
2180         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2181         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
2182         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
2183         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
2184         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
2185         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
2186         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
2187         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
2188         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
2189         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2190
2191 2019-10-07  Keith Rollin  <krollin@apple.com>
2192
2193         Unreviewed, build fix after r250666. Fix 32- vs. 64-bit mismatch on
2194         32-bit builds.
2195
2196         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2197         (WebCore::IDBServer::estimateSize):
2198
2199 2019-10-07  Ross Kirsling  <ross.kirsling@sony.com>
2200
2201         Unreviewed WinCairo build fix for r250786.
2202
2203         * Modules/cache/DOMCache.cpp:
2204         (WebCore::DOMCache::addAll):
2205
2206 2019-10-07  Tim Horton  <timothy_horton@apple.com>
2207
2208         Fix the Windows build
2209
2210         * html/ImageBitmap.h:
2211
2212 2019-10-07  Ross Kirsling  <ross.kirsling@sony.com>
2213
2214         Unreviewed WinCairo build fix for r250758.
2215
2216         * workers/service/ServiceWorkerContainer.cpp:
2217         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2218
2219 2019-10-07  Ryosuke Niwa  <rniwa@webkit.org>
2220
2221         focus pseudo class should match a shadow host whose shadow tree contains the focused element
2222         https://bugs.webkit.org/show_bug.cgi?id=202432
2223
2224         Reviewed by Antti Koivisto.
2225
2226         Note that focus pseudo class does not match a shadow host when its shadow tree contains a slot element
2227         with a focused element or its ancestor assigned since such a shadow host has the actual focused element
2228         in the same tree as the shadow host. (e.g. the focused element can be a direct child of the host).
2229
2230         In order to preserve the behavior of focus ring, which should be only drawn on the currently focused
2231         element and not any shadow host which contains such an element, this patch introduces a new pseudo class,
2232         -webkit-direct-focus, which is only available in the user agent stylesheet. Putting :host(:focus) rule
2233         isn't sufficient because style rules inside shadow trees always has a lower precendence than rules
2234         outside the shadow tree (the tree of its shadow host).
2235
2236         [1] Also see https://github.com/whatwg/html/pull/4731
2237
2238         Tests: fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet.html
2239                fast/shadow-dom/focus-pseudo-matches-on-shadow-host.html
2240                fast/shadow-dom/focus-pseudo-on-shadow-host-1.html
2241                fast/shadow-dom/focus-pseudo-on-shadow-host-2.html
2242                fast/shadow-dom/focus-pseudo-on-shadow-host-3.html
2243
2244         * css/CSSSelector.cpp:
2245         (WebCore::CSSSelector::selectorText const): Added the support for -webkit-direct-focus.
2246         * css/CSSSelector.h:
2247         * css/RuleSet.cpp:
2248         (WebCore::RuleSet::addRule): Ditto.
2249         * css/SelectorChecker.cpp:
2250         (WebCore::SelectorChecker::checkOne const):: Ditto.
2251         (WebCore::doesShadowTreeContainFocusedElement):: Ditto.
2252         (WebCore::SelectorChecker::matchesFocusPseudoClass): Implemented the new behavior.
2253         (WebCore::SelectorChecker::matchesDirectFocusPseudoClass): Added. Implements the old behavior for
2254         the focus ring via -webkit-direct-focus pseudo class.
2255         * css/SelectorChecker.h:
2256         * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added -webkit-direct-focus.
2257         * css/html.css: Use -webkit-direct-focus pseudo class to preserve the existing behavior of focus ring.
2258         * css/parser/CSSSelectorParser.cpp:
2259         (WebCore::CSSSelectorParser::consumePseudo): Ignore -webkit-direct-focus in author and user stylesheets.
2260         * cssjit/SelectorCompiler.cpp:
2261         (WebCore::SelectorCompiler::addPseudoClassType): Added the support for -webkit-direct-focus.
2262         * dom/Element.cpp:
2263         (WebCore::Element::setFocus): Invoke setContainsFocusedElement on each shadow ancestor root of
2264         the newly focused element. Note that we can't use :focus-within pseudo class since that would also match
2265         the host of a shadow root which contains a slotted focused element, causing both the shadow host and
2266         the slotted element to match :focus pseudo class in the host's tree.
2267         * dom/ShadowRoot.h:
2268
2269 2019-10-07  Rob Buis  <rbuis@igalia.com>
2270
2271         Change Response's statusText's default
2272         https://bugs.webkit.org/show_bug.cgi?id=191879
2273
2274         Reviewed by Youenn Fablet.
2275
2276         Change Response's statusText's default to "".
2277
2278         Tests: web-platform-tests/fetch/api/response/response-clone.html
2279                web-platform-tests/fetch/api/response/response-init-001.html
2280
2281         * Modules/fetch/FetchResponse.h:
2282         * Modules/fetch/FetchResponse.idl:
2283
2284 2019-10-07  Chris Dumez  <cdumez@apple.com>
2285
2286         DOMCache should not prevent pages from entering the back/forward cache
2287         https://bugs.webkit.org/show_bug.cgi?id=202590
2288
2289         Reviewed by Youenn Fablet.
2290
2291         Allow DOMCache to suspend in the back/forward cache unconditionally, by
2292         appending all promise resolutions to a SuspendableTaskQueue. This guarantees
2293         that any asynchronous promise resolution is delayed while in the page cache,
2294         until the page gets resumed.
2295
2296         Test: http/tests/navigation/page-cache-domcache-pending-promise.html
2297
2298         * Modules/cache/DOMCache.cpp:
2299         (WebCore::DOMCache::DOMCache):
2300         (WebCore::DOMCache::match):
2301         (WebCore::DOMCache::matchAll):
2302         (WebCore::DOMCache::addAll):
2303         (WebCore::DOMCache::putWithResponseData):
2304         (WebCore::DOMCache::put):
2305         (WebCore::DOMCache::remove):
2306         (WebCore::DOMCache::keys):
2307         (WebCore::DOMCache::canSuspendForDocumentSuspension const):
2308         * Modules/cache/DOMCache.h:
2309
2310 2019-10-07  Chris Dumez  <cdumez@apple.com>
2311
2312         PendingImageBitmap should not prevent entering the back/forward cache
2313         https://bugs.webkit.org/show_bug.cgi?id=202585
2314
2315         Reviewed by Tim Horton.
2316
2317         Add PageCache support to PendingImageBitmap by doing the promise resolution on a
2318         SuspendableTimer (which properly gets paused while in PageCache).
2319
2320         Test: fast/history/page-cache-createImageBitmap.html
2321
2322         * html/ImageBitmap.cpp:
2323
2324 2019-10-07  Dirk Schulze  <krit@webkit.org>
2325
2326         clip-path: <geometry-box> mapping incorrect
2327         https://bugs.webkit.org/show_bug.cgi?id=202075
2328
2329         Reviewed by Simon Fraser.
2330
2331         For HTML elements:
2332         - stroke-box, view-box consistently compute to border-box
2333         - fill-box computes to content-box
2334
2335         Tests: css3/masking/clip-path-border-radius-fill-box-001.html
2336                css3/masking/clip-path-border-radius-stroke-box-000.html
2337                css3/masking/clip-path-border-radius-view-box-000.html
2338
2339         * rendering/RenderBlock.cpp:
2340         (WebCore::RenderBlock::nodeAtPoint):
2341         * rendering/shapes/BoxShape.cpp:
2342         (WebCore::computeRoundedRectForBoxShape):
2343
2344 2019-10-07  Tim Horton  <timothy_horton@apple.com>
2345
2346         Fix the Windows build
2347
2348         * html/ImageBitmap.h:
2349
2350 2019-10-07  Zalan Bujtas  <zalan@apple.com>
2351
2352         [LFC] Add const version of LayoutState::displayBoxForLayoutBox
2353         https://bugs.webkit.org/show_bug.cgi?id=202623
2354         <rdar://problem/56025259>
2355
2356         Reviewed by Antti Koivisto.
2357
2358         * layout/LayoutState.cpp:
2359         (WebCore::Layout::LayoutState::displayBoxForLayoutBox):
2360         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
2361         * layout/LayoutState.h:
2362         * layout/layouttree/LayoutTreeBuilder.cpp:
2363         (WebCore::Layout::outputLayoutTree):
2364
2365 2019-10-07  youenn fablet  <youenn@apple.com>
2366
2367         [iOS] Unmuting capture of a page is not working
2368         https://bugs.webkit.org/show_bug.cgi?id=202627
2369
2370         Reviewed by Eric Carlson.
2371
2372         Before the patch, we were muting the capture tracks but never unmuting them.
2373         The patch updates the code to make sure we unmute capture tracks based on the document state.
2374         In addition, the iOS code wass process-wide while capture might happen between two documents in the same process.
2375         The patch updates the capturestate computation and muting logic to be Document based.
2376         A follow-up refactoring will merge back iOS and MacOS code paths.
2377         Covered by API test.
2378
2379         * Modules/mediastream/MediaStreamTrack.cpp:
2380         (WebCore::MediaStreamTrack::captureState):
2381         (WebCore::MediaStreamTrack::updateCaptureAccordingMutedState):
2382         (WebCore::MediaStreamTrack::muteCapture): Deleted.
2383         * Modules/mediastream/MediaStreamTrack.h:
2384         * dom/Document.cpp:
2385         (WebCore::Document::updateIsPlayingMedia):
2386         (WebCore::Document::pageMutedStateDidChange):
2387
2388 2019-10-06  Ryosuke Niwa  <rniwa@webkit.org>
2389
2390         attachShadow should support attaching a shadow root to a main element
2391         https://bugs.webkit.org/show_bug.cgi?id=197726
2392
2393         Reviewed by Antti Koivisto.
2394
2395         Added main element to the list of elements that support an author shadow root.
2396
2397         Test: fast/shadow-dom/attach-shadow-to-elements.html
2398
2399         * dom/Element.cpp:
2400         (WebCore::canAttachAuthorShadowRoot):
2401
2402 2019-10-06  Zalan Bujtas  <zalan@apple.com>
2403
2404         [LFC][Painting] Introduce Display::Painter
2405         https://bugs.webkit.org/show_bug.cgi?id=202614
2406         <rdar://problem/56010347>
2407
2408         Reviewed by Antti Koivisto.
2409
2410         Display::Painter is responsible for rendering the nodes in the display tree. Testing purposes/WK1 only at this point.
2411
2412         * Sources.txt:
2413         * WebCore.xcodeproj/project.pbxproj:
2414         * layout/LayoutContext.cpp:
2415         (WebCore::Layout::initializeLayoutState):
2416         (WebCore::Layout::LayoutContext::runLayout):
2417         (WebCore::Layout::LayoutContext::runLayoutAndVerify):
2418         (WebCore::Layout::LayoutContext::runLayoutAndPaint):
2419         (WebCore::Layout::LayoutContext::run): Deleted.
2420         * layout/LayoutContext.h:
2421         * layout/LayoutState.cpp:
2422         (WebCore::Layout::LayoutState::LayoutState):
2423         * layout/LayoutState.h:
2424         (WebCore::Layout::LayoutState::root const):
2425         * layout/Verification.cpp:
2426         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
2427         * layout/displaytree/DisplayPainter.cpp: Added.
2428         (WebCore::Display::Painter::paint):
2429         * layout/displaytree/DisplayPainter.h: Added.
2430         * layout/layouttree/LayoutTreeBuilder.cpp:
2431         (WebCore::Layout::printLayoutTreeForLiveDocuments):
2432         * page/FrameView.cpp:
2433         (WebCore::FrameView::paintContents):
2434         * page/FrameViewLayoutContext.cpp:
2435         (WebCore::layoutUsingFormattingContext):
2436
2437 2019-10-06  Antti Koivisto  <antti@apple.com>
2438
2439         Node::ref/deref should be const
2440         https://bugs.webkit.org/show_bug.cgi?id=202562
2441
2442         Reviewed by Ryosuke Niwa.
2443
2444         This enables RefPtr<const Element> and matches RefCounted.
2445
2446         * css/ElementRuleCollector.cpp:
2447         (WebCore::ElementRuleCollector::collectMatchingRules):
2448         (WebCore::ElementRuleCollector::matchAuthorRules):
2449         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
2450         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
2451         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
2452         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
2453         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
2454         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
2455         (WebCore::ElementRuleCollector::matchUARules):
2456         (WebCore::ElementRuleCollector::ruleMatches):
2457         (WebCore::ElementRuleCollector::matchAllRules):
2458
2459         Use it to ref elements in ElementRuleCollector.
2460
2461         * css/ElementRuleCollector.h:
2462         (WebCore::ElementRuleCollector::element const):
2463         * dom/Node.h:
2464         (WebCore::Node::ref const):
2465         (WebCore::Node::deref const):
2466         (WebCore::Node::ref): Deleted.
2467         (WebCore::Node::deref): Deleted.
2468
2469 2019-10-05  Zalan Bujtas  <zalan@apple.com>
2470
2471         [LFC] LayoutChildtIteratorAdapter -> LayoutChildIteratorAdapter
2472         https://bugs.webkit.org/show_bug.cgi?id=202612
2473         <rdar://problem/56007611>
2474
2475         Reviewed by Anders Carlsson.
2476
2477         * layout/layouttree/LayoutChildIterator.h:
2478         (WebCore::Layout::LayoutChildIterator<T>::LayoutChildIterator):
2479         (WebCore::Layout::LayoutChildIterator<T>::operator):
2480         (WebCore::Layout::LayoutChildIteratorAdapter<T>::LayoutChildIteratorAdapter):
2481         (WebCore::Layout::LayoutChildIteratorAdapter<T>::begin const):
2482         (WebCore::Layout::LayoutChildIteratorAdapter<T>::end const):
2483         (WebCore::Layout::LayoutChildIteratorAdapter<T>::first const):
2484         (WebCore::Layout::LayoutChildIteratorAdapter<T>::last const):
2485         (WebCore::Layout::childrenOfType):
2486         (WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator): Deleted.
2487         (WebCore::Layout::LayoutChildtIterator<T>::operator): Deleted.
2488         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter): Deleted.
2489         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const): Deleted.
2490         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const): Deleted.
2491         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const): Deleted.
2492         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const): Deleted.
2493
2494 2019-10-05  Zalan Bujtas  <zalan@apple.com>
2495
2496         [LFC] Remove redundant includes.
2497         https://bugs.webkit.org/show_bug.cgi?id=202610
2498         <rdar://problem/56003250>
2499
2500         Reviewed by Tim Horton.
2501
2502         * layout/FormattingContext.h:
2503         * layout/FormattingContextGeometry.cpp:
2504         * layout/FormattingContextQuirks.cpp:
2505         * layout/FormattingState.h:
2506         * layout/LayoutContext.h:
2507         * layout/LayoutState.h:
2508         * layout/LayoutUnits.h:
2509         * layout/blockformatting/BlockFormattingContext.cpp:
2510         * layout/blockformatting/BlockFormattingContext.h:
2511         * layout/blockformatting/BlockFormattingState.cpp:
2512         * layout/blockformatting/BlockFormattingState.h:
2513         * layout/blockformatting/BlockInvalidation.h:
2514         * layout/displaytree/DisplayRect.h:
2515         * layout/displaytree/DisplayRun.h:
2516         * layout/floats/FloatAvoider.cpp:
2517         * layout/floats/FloatAvoider.h:
2518         * layout/floats/FloatBox.h:
2519         * layout/floats/FloatingContext.cpp:
2520         * layout/floats/FloatingContext.h:
2521         * layout/floats/FloatingState.h:
2522         * layout/inlineformatting/InlineFormattingContext.cpp:
2523         * layout/inlineformatting/InlineFormattingContext.h:
2524         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2525         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2526         * layout/inlineformatting/InlineInvalidation.h:
2527         * layout/inlineformatting/InlineLine.h:
2528         * layout/inlineformatting/InlineLineBreaker.cpp:
2529         * layout/inlineformatting/InlineLineLayout.cpp:
2530         * layout/layouttree/LayoutBox.h:
2531         * layout/tableformatting/TableFormattingContext.h:
2532         * layout/tableformatting/TableFormattingContextGeometry.cpp:
2533         * layout/tableformatting/TableGrid.h:
2534         * layout/tableformatting/TableInvalidation.h:
2535
2536 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
2537
2538         Change "InvalidStateError" to "NotSupportedError" for attachShadow()
2539         https://bugs.webkit.org/show_bug.cgi?id=197948
2540
2541         Reviewed by Wenson Hsieh.
2542
2543         Match the latest spec. See https://github.com/whatwg/dom/pull/761
2544
2545         * dom/Element.cpp:
2546         (WebCore::Element::attachShadow): Throw NotSupportedError when there is already a shadow tree.
2547
2548 2019-10-04  Chris Dumez  <cdumez@apple.com>
2549
2550         Allow pages using EventSource to enter the back/forward cache
2551         https://bugs.webkit.org/show_bug.cgi?id=202370
2552         <rdar://problem/55853142>
2553
2554         Reviewed by Geoffrey Garen.
2555
2556         Allow pages using EventSource to enter the back/forward cache. If the EventSource is
2557         connecting at the time it enters PageCache, it will resume connecting after restoring
2558         from PageCache (by making m_connectTimer a SuspendableTimer, which is PageCache-aware).
2559         If the EventSource is was open upon navigating, it gets closed upon navigating (since
2560         all pending loads get cancelled on navigation). To help the page recover, we fire an
2561         error event and attempt to reconnect automatically when restoring the page from page
2562         cache. It is allowed by the specification to attempt reconnection in case of non-fatal
2563         network errors.
2564
2565         Tests: http/tests/eventsource/eventsource-page-cache-connected.html
2566                http/tests/eventsource/eventsource-page-cache-connecting.html
2567
2568         * page/EventSource.cpp:
2569         (WebCore::EventSource::EventSource):
2570         (WebCore::EventSource::scheduleReconnect):
2571         (WebCore::EventSource::close):
2572         (WebCore::EventSource::didReceiveResponse):
2573         (WebCore::EventSource::dispatchErrorEvent):
2574         (WebCore::EventSource::didReceiveData):
2575         (WebCore::EventSource::didFinishLoading):
2576         (WebCore::EventSource::didFail):
2577         (WebCore::EventSource::abortConnectionAttempt):
2578         (WebCore::EventSource::doExplicitLoadCancellation):
2579         (WebCore::EventSource::canSuspendForDocumentSuspension const):
2580         (WebCore::EventSource::suspend):
2581         (WebCore::EventSource::resume):
2582         (WebCore::EventSource::dispatchMessageEvent):
2583         * page/EventSource.h:
2584
2585 2019-10-04  Chris Dumez  <cdumez@apple.com>
2586
2587         ServiceWorkerContainer should never prevent a page from entering the back/forward cache
2588         https://bugs.webkit.org/show_bug.cgi?id=202603
2589
2590         Reviewed by Geoff Garen.
2591
2592         Make it so that ServiceWorkerContainer can suspend, even if they have pending promises.
2593         We now queue all promise resolutions to a SuspendableTaskQueue to make sure that those
2594         promises do not get resolved while in the page cache.
2595
2596         Test: http/tests/workers/service/page-cache-service-worker-pending-promise.https.html
2597
2598         * workers/service/ServiceWorkerContainer.cpp:
2599         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2600         (WebCore::ServiceWorkerContainer::ready):
2601         (WebCore::ServiceWorkerContainer::getRegistration):
2602         (WebCore::ServiceWorkerContainer::getRegistrations):
2603         (WebCore::ServiceWorkerContainer::jobFailedWithException):
2604         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2605         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2606         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2607         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
2608         * workers/service/ServiceWorkerContainer.h:
2609
2610 2019-10-04  Chris Dumez  <cdumez@apple.com>
2611
2612         Allow pages using IDBIndex to enter the PageCache
2613         https://bugs.webkit.org/show_bug.cgi?id=202430
2614         <rdar://problem/55887918>
2615
2616         Reviewed by Geoffrey Garen.
2617
2618         There is no reason to prevent PageCaching when an IDBIndex object is alive.
2619         No events are fired by IDBIndex and its API returns IDBRequest objects, which
2620         are already PageCache-aware.
2621
2622         I have seen Yahoo.com failing to enter the back/forward cache because of this.
2623
2624         No new tests, updated existing test.
2625
2626         * Modules/indexeddb/IDBIndex.cpp:
2627         (WebCore::IDBIndex::canSuspendForDocumentSuspension const):
2628
2629 2019-10-04  Heiko Becker  <heirecka@exherbo.org>
2630
2631         Fix build with icu 65.1
2632         https://bugs.webkit.org/show_bug.cgi?id=202600
2633
2634         Reviewed by Konstantin Tokarev.
2635
2636         * dom/Document.cpp:
2637         (WebCore::isValidNameNonASCII):
2638         (WebCore::Document::parseQualifiedName):
2639
2640 2019-10-04  James Darpinian  <jdarpinian@chromium.org>
2641
2642         Allow using WebGL 2 when USE_ANGLE=1
2643         https://bugs.webkit.org/show_bug.cgi?id=202593
2644
2645         Reviewed by Alex Christensen.
2646
2647         * html/canvas/WebGLRenderingContextBase.cpp:
2648         (WebCore::WebGLRenderingContextBase::create):
2649             Disable irrelevant extension check.
2650         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2651         (WebCore::GraphicsContext3D::GraphicsContext3D):
2652             Use ES3 ANGLE context when WebGL 2 is requested.
2653
2654 2019-10-04  Alex Christensen  <achristensen@webkit.org>
2655
2656         Stop sending list of display-isolated schemes to NetworkProcess
2657         https://bugs.webkit.org/show_bug.cgi?id=202557
2658
2659         Reviewed by Youenn Fablet.
2660
2661         They are only ever used in the WebProcess in SecurityOrigin::canDisplay.
2662         If someone adds code that uses them in the NetworkProcess, they will hit my new assertion.
2663
2664         No change in behavior.
2665
2666         * page/SecurityOrigin.cpp:
2667         (WebCore::SecurityOrigin::canDisplay const):
2668         * platform/RuntimeApplicationChecks.h:
2669         (WebCore::isInNetworkProcess):
2670         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2671         (WebCore::isInNetworkProcess):
2672
2673 2019-10-04  Alex Christensen  <achristensen@webkit.org>
2674
2675         Rename SchemeRegistry to LegacySchemeRegistry
2676         https://bugs.webkit.org/show_bug.cgi?id=202586
2677
2678         Reviewed by Tim Horton.
2679
2680         SchemeRegistry is process-global.  We need to replace it with a non-process-global registry, but Rome wasn't built in a day.
2681         This rename allows me to call the replacement object that will have ownership and configuration "SchemeRegistry"
2682         and it also indicates that new development should use the owned object instead of the global object.
2683
2684         * Headers.cmake:
2685         * Modules/mediastream/UserMediaController.cpp:
2686         (WebCore::isSecure):
2687         * Modules/mediastream/UserMediaRequest.cpp:
2688         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2689         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
2690         * Modules/webdatabase/DatabaseContext.cpp:
2691         (WebCore::DatabaseContext::allowDatabaseAccess const):
2692         * Sources.txt:
2693         * WebCore.xcodeproj/project.pbxproj:
2694         * dom/Document.cpp:
2695         (WebCore::Document::setDomain):
2696         * dom/ScriptExecutionContext.cpp:
2697         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
2698         * html/HTMLPlugInImageElement.cpp:
2699         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
2700         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
2701         * loader/CrossOriginAccessControl.cpp:
2702         (WebCore::isValidCrossOriginRedirectionURL):
2703         * loader/DocumentLoader.cpp:
2704         (WebCore::DocumentLoader::matchRegistration):
2705         (WebCore::DocumentLoader::disallowWebArchive const):
2706         (WebCore::DocumentLoader::commitData):
2707         (WebCore::DocumentLoader::maybeLoadEmpty):
2708         * loader/DocumentThreadableLoader.cpp:
2709         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2710         (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
2711         * loader/archive/mhtml/MHTMLArchive.cpp:
2712         (WebCore::MHTMLArchive::create):
2713         * loader/cache/CachedResource.cpp:
2714         (WebCore::CachedResource::freshnessLifetime const):
2715         * page/Page.cpp:
2716         (WebCore::Page::userStyleSheetLocationChanged):
2717         * page/SecurityOrigin.cpp:
2718         (WebCore::shouldTreatAsUniqueOrigin):
2719         (WebCore::shouldTreatAsPotentiallyTrustworthy):
2720         (WebCore::SecurityOrigin::SecurityOrigin):
2721         (WebCore::SecurityOrigin::isSecure):
2722         (WebCore::SecurityOrigin::canDisplay const):
2723         (WebCore::SecurityOrigin::domainForCachePartition const):
2724         * page/csp/ContentSecurityPolicy.cpp:
2725         (WebCore::ContentSecurityPolicy::allowObjectFromSource const):
2726         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
2727         (WebCore::ContentSecurityPolicy::allowResourceFromSource const):
2728         (WebCore::ContentSecurityPolicy::allowConnectToSource const):
2729         (WebCore::ContentSecurityPolicy::allowBaseURI const):
2730         * platform/LegacySchemeRegistry.cpp: Copied from Source/WebCore/platform/SchemeRegistry.cpp.
2731         (WebCore::allBuiltinSchemes):
2732         (WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal):
2733         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal):
2734         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
2735         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess):
2736         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
2737         (WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated):
2738         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
2739         (WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure):
2740         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
2741         (WebCore::LegacySchemeRegistry::registerURLSchemeAsEmptyDocument):
2742         (WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
2743         (WebCore::LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme):
2744         (WebCore::LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme):
2745         (WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
2746         (WebCore::LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
2747         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):
2748         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs):
2749         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):
2750         (WebCore::LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing):
2751         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
2752         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
2753         (WebCore::LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
2754         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
2755         (WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
2756         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
2757         (WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
2758         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCachePartitioned):
2759         (WebCore::LegacySchemeRegistry::shouldPartitionCacheForURLScheme):
2760         (WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
2761         (WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme):
2762         (WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme):
2763         (WebCore::LegacySchemeRegistry::isUserExtensionScheme):
2764         (WebCore::LegacySchemeRegistry::isBuiltinScheme):
2765         (WebCore::SchemeRegistry::registerURLSchemeAsLocal): Deleted.
2766         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Deleted.
2767         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Deleted.
2768         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Deleted.
2769         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Deleted.
2770         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Deleted.
2771         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Deleted.
2772         (WebCore::SchemeRegistry::registerURLSchemeAsSecure): Deleted.
2773         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Deleted.
2774         (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Deleted.
2775         (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Deleted.
2776         (WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Deleted.
2777         (WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Deleted.
2778         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Deleted.
2779         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Deleted.
2780         (WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Deleted.
2781         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Deleted.
2782         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Deleted.
2783         (WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Deleted.
2784         (WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Deleted.
2785         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Deleted.
2786         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Deleted.
2787         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Deleted.
2788         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Deleted.
2789         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Deleted.
2790         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Deleted.
2791         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Deleted.
2792         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Deleted.
2793         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
2794         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
2795         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
2796         (WebCore::SchemeRegistry::isUserExtensionScheme): Deleted.
2797         (WebCore::SchemeRegistry::isBuiltinScheme): Deleted.
2798         * platform/LegacySchemeRegistry.h: Copied from Source/WebCore/platform/SchemeRegistry.h.
2799         * platform/SchemeRegistry.cpp: Removed.
2800         * platform/SchemeRegistry.h: Removed.
2801         * platform/ios/QuickLook.mm:
2802         * storage/Storage.cpp:
2803         * testing/Internals.cpp:
2804         (WebCore::Internals::registerURLSchemeAsBypassingContentSecurityPolicy):
2805         (WebCore::Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
2806         * workers/service/ServiceWorkerContainer.cpp:
2807         (WebCore::ServiceWorkerContainer::addRegistration):
2808         * workers/service/ServiceWorkerProvider.cpp:
2809         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
2810         * workers/service/server/SWServerJobQueue.cpp:
2811         (WebCore::SWServerJobQueue::runRegisterJob):
2812
2813 2019-10-04  Antoine Quint  <graouts@apple.com>
2814
2815         Crash in debug build with imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html
2816         https://bugs.webkit.org/show_bug.cgi?id=202583
2817
2818         Reviewed by Dean Jackson.
2819
2820         Ensure we remove the animation from the timeline it's currently associated with since it may have changed since its creation. This caused
2821         a crash because we have an assertion in AnimationTimeline::removeAnimation() to check that the animation belonged to the timeline it's called on.
2822
2823         * animation/DocumentTimeline.cpp:
2824         (WebCore::DocumentTimeline::removeReplacedAnimations):
2825
2826 2019-10-04  Tim Horton  <timothy_horton@apple.com>
2827
2828         Clean up some includes to make the build a bit faster: DOMPromise
2829         https://bugs.webkit.org/show_bug.cgi?id=202570
2830
2831         Reviewed by Chris Dumez.
2832
2833         No new tests, just reorganizing.
2834
2835         Apply some profile-guided optimizations to our headers.
2836
2837         Get JSDOMPromiseDeferred.h and DOMPromiseProxy.h out of WebCore headers.
2838         One remains (FetchBodyConsumer.h); I leave it as an exercise to the reader.
2839         In my testing, this is worth a reliable 5-6% on the WebCore Build Benchmark.
2840
2841         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2842         * Modules/encryptedmedia/MediaKeySession.cpp:
2843         * Modules/encryptedmedia/MediaKeySession.h:
2844         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
2845         * Modules/encryptedmedia/MediaKeySystemAccess.h:
2846         * Modules/encryptedmedia/MediaKeys.cpp:
2847         * Modules/encryptedmedia/MediaKeys.h:
2848         * Modules/encryptedmedia/NavigatorEME.cpp:
2849         * Modules/encryptedmedia/NavigatorEME.h:
2850         * Modules/fetch/DOMWindowFetch.cpp:
2851         * Modules/fetch/DOMWindowFetch.h:
2852         * Modules/fetch/FetchBody.cpp:
2853         * Modules/fetch/FetchBody.h:
2854         * Modules/fetch/FetchLoader.cpp:
2855         * Modules/fetch/FetchLoader.h:
2856         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
2857         * Modules/fetch/WorkerGlobalScopeFetch.h:
2858         * Modules/mediacapabilities/MediaCapabilities.cpp:
2859         * Modules/mediacapabilities/MediaCapabilities.h:
2860         * Modules/mediastream/MediaDevices.cpp:
2861         * Modules/mediastream/MediaDevices.h:
2862         * Modules/mediastream/MediaStreamTrack.cpp:
2863         * Modules/mediastream/MediaStreamTrack.h:
2864         * Modules/mediastream/PeerConnectionBackend.cpp:
2865         * Modules/mediastream/PeerConnectionBackend.h:
2866         * Modules/mediastream/RTCPeerConnection.cpp:
2867         * Modules/mediastream/RTCRtpReceiver.h:
2868         * Modules/mediastream/RTCRtpSenderBackend.h:
2869         * Modules/mediastream/UserMediaRequest.cpp:
2870         * Modules/mediastream/UserMediaRequest.h:
2871         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2872         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
2873         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
2874         * Modules/paymentrequest/PaymentRequest.cpp:
2875         * Modules/paymentrequest/PaymentRequest.h:
2876         * Modules/paymentrequest/PaymentResponse.cpp:
2877         * Modules/paymentrequest/PaymentResponse.h:
2878         * Modules/streams/ReadableStreamSource.h:
2879         * Modules/webaudio/AudioContext.h:
2880         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2881         * Modules/webauthn/AuthenticatorCoordinator.h:
2882         * Modules/webauthn/PublicKeyCredential.h:
2883         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2884         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
2885         * Modules/webgpu/WebGPU.cpp:
2886         * Modules/webgpu/WebGPU.h:
2887         * Modules/webgpu/WebGPUAdapter.cpp:
2888         * Modules/webgpu/WebGPUAdapter.h:
2889         * Modules/webgpu/WebGPUBuffer.cpp:
2890         * Modules/webgpu/WebGPUBuffer.h:
2891         * Modules/webgpu/WebGPUDevice.cpp:
2892         * Modules/webgpu/WebGPUDevice.h:
2893         * Modules/webvr/NavigatorWebVR.cpp:
2894         * Modules/webvr/NavigatorWebVR.h:
2895         * Modules/webvr/VRDisplay.cpp:
2896         * Modules/webvr/VRDisplay.h:
2897         * Sources.txt:
2898         * WebCore.xcodeproj/project.pbxproj:
2899         * animation/KeyframeEffect.cpp:
2900         * animation/WebAnimation.cpp:
2901         * animation/WebAnimation.h:
2902         * bindings/js/CachedModuleScriptLoader.cpp:
2903         * bindings/js/CachedModuleScriptLoaderClient.h:
2904         * bindings/js/JSDOMPromiseDeferred.h:
2905         * bindings/js/JSHTMLTemplateElementCustom.cpp:
2906         * bindings/js/JSImageDataCustom.cpp:
2907         * bindings/js/JSReadableStreamSourceCustom.cpp:
2908         * bindings/js/JSWebAnimationCustom.cpp:
2909         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2910         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2911         * bindings/js/JSWorkletGlobalScopeBase.cpp:
2912         * bindings/js/ScriptModuleLoader.cpp:
2913         * css/FontFace.cpp:
2914         * css/FontFace.h:
2915         * css/FontFaceSet.cpp:
2916         * css/FontFaceSet.h:
2917         * dom/CustomElementRegistry.cpp:
2918         * dom/DeviceOrientationOrMotionEvent.cpp:
2919         * dom/DeviceOrientationOrMotionEvent.h:
2920         * dom/MouseEvent.cpp:
2921         * dom/MouseEvent.h:
2922         * html/CustomPaintCanvas.h:
2923         * html/ImageBitmap.cpp:
2924         * html/ImageBitmap.h:
2925         * html/OffscreenCanvas.cpp:
2926         * html/OffscreenCanvas.h:
2927         * loader/ImageLoader.cpp:
2928         * loader/ImageLoader.h:
2929         * page/DOMWindow.cpp:
2930         * page/Navigator.h:
2931         * platform/graphics/CustomPaintImage.cpp:
2932         * testing/Internals.cpp:
2933         * testing/Internals.h:
2934         * testing/ServiceWorkerInternals.h:
2935         * testing/ServiceWorkerInternals.mm:
2936         * workers/service/ServiceWorkerContainer.cpp:
2937         * workers/service/ServiceWorkerContainer.h:
2938         * workers/service/ServiceWorkerJob.h:
2939         * workers/service/ServiceWorkerRegistration.cpp:
2940         * workers/service/ServiceWorkerRegistration.h:
2941         * worklets/PaintWorkletGlobalScope.cpp:
2942
2943 2019-10-04  Sihui Liu  <sihui_liu@apple.com>
2944
2945         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a Flaky Failure
2946         https://bugs.webkit.org/show_bug.cgi?id=201481
2947         <rdar://problem/55046055>
2948
2949         Reviewed by Alex Christensen.
2950
2951         We should not schedule timer if we know the timer function will be no-op.
2952
2953         * Modules/indexeddb/IDBTransaction.cpp:
2954         (WebCore::IDBTransaction::removeRequest):
2955         (WebCore::IDBTransaction::scheduleOperation):
2956         (WebCore::IDBTransaction::trySchedulePendingOperationTimer):
2957         (WebCore::IDBTransaction::pendingOperationTimerFired):
2958         (WebCore::IDBTransaction::didStart):
2959         (WebCore::IDBTransaction::operationCompletedOnClient):
2960         (WebCore::IDBTransaction::deactivate):
2961         (WebCore::IDBTransaction::schedulePendingOperationTimer): Deleted.
2962         * Modules/indexeddb/IDBTransaction.h:
2963
2964 2019-10-04  Chris Dumez  <cdumez@apple.com>
2965
2966         Unreviewed follow-up fix for r250693 to address assertion hits in debug.
2967
2968         * css/FontFaceSet.cpp:
2969         (WebCore::FontFaceSet::didFirstLayout):
2970         (WebCore::FontFaceSet::completedLoading):
2971         Make sure the ready promise is not already resolved before resolving it.
2972
2973         * platform/SuspendableTaskQueue.cpp:
2974         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
2975         * platform/SuspendableTaskQueue.h:
2976         (WebCore::SuspendableTaskQueue::create):
2977         Add a new constructor that takes in a Document since the ActiveDOMObject's
2978         constructor taking a Document has some useful logic.
2979
2980 2019-10-04  Joonghun Park  <jh718.park@samsung.com>
2981
2982         Negative radii in radial gradients should be rejected.
2983         https://bugs.webkit.org/show_bug.cgi?id=202412
2984
2985         Per the spec, https://drafts.csswg.org/css-images-3/#radial-gradients
2986         "Negative values are invalid.",
2987         we reject negative radii values in radial-gradient.
2988
2989         This patch rejects negative radii during radial-gradient parsing
2990         for both webkit prefixed and non-prefixed ones.
2991
2992         Reviewed by Antti Koivisto.
2993
2994         Tests: imported/blink/css-parser/webkit-gradient.html
2995                imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii.html
2996                imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html
2997
2998         * css/parser/CSSPropertyParserHelpers.cpp:
2999         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
3000         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
3001         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
3002
3003 2019-10-04  Alex Christensen  <achristensen@webkit.org>
3004
3005         Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration
3006         https://bugs.webkit.org/show_bug.cgi?id=202553
3007
3008         Reviewed by Youenn Fablet.
3009
3010         * workers/service/server/SWServer.cpp:
3011         (WebCore::SWServer::SWServer):
3012         * workers/service/server/SWServer.h:
3013         (WebCore::SWServer::registeredSchemes const):
3014         * workers/service/server/SWServerJobQueue.cpp:
3015         (WebCore::SWServerJobQueue::runRegisterJob):
3016
3017 2019-10-04  youenn fablet  <youenn@apple.com>
3018
3019         AbortSignal does not always emit the abort signal
3020         https://bugs.webkit.org/show_bug.cgi?id=201871
3021         <rdar://problem/55451712>
3022
3023         Reviewed by Chris Dumez.
3024
3025         Make sure a JSAbortSignal is not GCed until objects that can abort it are gone.
3026         This includes a followed signal and an AbortController.
3027         Current WebKit implementation only uses following of one signal at a time.
3028
3029         Test: http/tests/fetch/abort-signal-gc.html
3030
3031         * Sources.txt:
3032         * WebCore.xcodeproj/project.pbxproj:
3033         * bindings/js/JSAbortControllerCustom.cpp: Added.
3034         (WebCore::JSAbortController::visitAdditionalChildren):
3035         * bindings/js/JSAbortSignalCustom.cpp: Added.
3036         (WebCore::JSAbortSignalOwner::isReachableFromOpaqueRoots):
3037         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
3038         * dom/AbortController.idl:
3039         * dom/AbortSignal.cpp:
3040         (WebCore::AbortSignal::follow):
3041         * dom/AbortSignal.h:
3042         * dom/AbortSignal.idl:
3043
3044 2019-10-04  youenn fablet  <youenn@apple.com>
3045
3046         Allow to suspend RTCPeerConnection when not connected
3047         https://bugs.webkit.org/show_bug.cgi?id=202403
3048
3049         Reviewed by Chris Dumez.
3050
3051         Implement suspend/resume in RTCPeerConnection by sending suspend/resume to the libwebrtc media endpoint,
3052         which suspends/resumes its socket factory.
3053
3054         We allow suspension when the connection is not connected.
3055         Pages with connected connections will not go in page cache yet.
3056
3057         Tests: webrtc/datachannel/datachannel-page-cache-send.html
3058                webrtc/datachannel/datachannel-page-cache.html
3059
3060         * Modules/mediastream/PeerConnectionBackend.h:
3061         (WebCore::PeerConnectionBackend::suspend):
3062         (WebCore::PeerConnectionBackend::resume):
3063         * Modules/mediastream/RTCPeerConnection.cpp:
3064         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
3065         (WebCore::RTCPeerConnection::suspend):
3066         (WebCore::RTCPeerConnection::resume):
3067         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3068         (WebCore::LibWebRTCMediaEndpoint::suspend):
3069         (WebCore::LibWebRTCMediaEndpoint::resume):
3070         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3071         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3072         (WebCore::LibWebRTCPeerConnectionBackend::suspend):
3073         (WebCore::LibWebRTCPeerConnectionBackend::resume):
3074         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3075         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3076
3077 2019-10-04  Truitt Savell  <tsavell@apple.com>
3078
3079         Unreviewed, rolling out r250583.
3080
3081         Broke multiple internal API tests
3082
3083         Reverted changeset:
3084
3085         "[JSC] Place VM* in TLS"
3086         https://bugs.webkit.org/show_bug.cgi?id=202391
3087         https://trac.webkit.org/changeset/250583
3088
3089 2019-10-04  Alex Christensen  <achristensen@webkit.org>
3090
3091         Simplify sandbox enabling macros
3092         https://bugs.webkit.org/show_bug.cgi?id=202536
3093
3094         Reviewed by Brent Fulgham.
3095
3096         * Configurations/FeatureDefines.xcconfig:
3097
3098 2019-10-04  Chris Lord  <clord@igalia.com>
3099
3100         ImageBitmap should be serializable
3101         https://bugs.webkit.org/show_bug.cgi?id=202394
3102
3103         Reviewed by Žan Doberšek.
3104
3105         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable.html
3106
3107         * bindings/js/SerializedScriptValue.cpp:
3108         (WebCore::CloneSerializer::dumpImageBitmap):
3109         (WebCore::CloneDeserializer::readTransferredImageBitmap):
3110         (WebCore::CloneDeserializer::readImageBitmap):
3111         (WebCore::CloneDeserializer::readTerminal):
3112
3113 2019-10-03  Antoine Quint  <graouts@apple.com>
3114
3115         AppleTV named as XSS-payloads trigger when AirPlay is used
3116         https://bugs.webkit.org/show_bug.cgi?id=202534
3117         <rdar://55931262>
3118
3119         Reviewed by Eric Carlson.
3120
3121         Ensure we escape an AirPlay's device name before inserting its name into the DOM.
3122
3123         * Modules/modern-media-controls/media/placard-support.js:
3124         (PlacardSupport.prototype._updateAirPlayPlacard):
3125         (PlacardSupport):
3126         (escapeHTML):
3127
3128 2019-10-04  Oriol Brufau  <obrufau@igalia.com>
3129
3130         [css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
3131         https://bugs.webkit.org/show_bug.cgi?id=202258
3132
3133         Reviewed by Javier Fernandez.
3134
3135         Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
3136                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
3137                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
3138                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
3139
3140         Usually, the resolved value of grid-template-rows/columns is the used
3141         value, expanding the repeat() notation. But for elements with a non-grid
3142         display, the resolved value is just the computed value, with repeat(),
3143         since the used value doesn't exist.
3144         Before this patch, the repeat() was dropped, and line names after it
3145         appeared at the wrong position or were also dropped. There was also an
3146         assert failure in debug. This patch fixes the serialization for auto
3147         repeat(). Integer repeat() is still expanded at computed-value time, so
3148         it's not preserved in getComputedStyle().
3149
3150         * css/CSSComputedStyleDeclaration.cpp:
3151         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
3152         (WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat):
3153         (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
3154         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const):
3155         (WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const):
3156         (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
3157         (WebCore::populateGridTrackList):
3158         (WebCore::valueForGridTrackList):
3159
3160 2019-10-04  Antti Koivisto  <antti@apple.com>
3161
3162         [CSS Shadow Parts] Support 'exportparts' attribute
3163         https://bugs.webkit.org/show_bug.cgi?id=202520
3164
3165         Reviewed by Ryosuke Niwa.
3166
3167         Support 'exportparts' attribute for exporting part mappings from subcomponents.
3168
3169         * css/ElementRuleCollector.cpp:
3170         (WebCore::ElementRuleCollector::matchAuthorRules):
3171         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
3172
3173         Recurse to containing scopes to collect part rules if there are exported mappings.
3174
3175         (WebCore::ElementRuleCollector::ruleMatches):
3176         * css/ElementRuleCollector.h:
3177         * css/SelectorChecker.cpp:
3178         (WebCore::SelectorChecker::matchRecursively const):
3179
3180         Make ShadowDescendant fake combinator skip directly to the scope where the part rules are coming from.
3181
3182         (WebCore::SelectorChecker::checkOne const):
3183
3184         Resolve names via mappings if needed.
3185
3186         * css/SelectorChecker.h:
3187         * dom/Element.cpp:
3188         (WebCore::Element::attributeChanged):
3189
3190         Invalidate mappings as needed.
3191
3192         * dom/ShadowRoot.cpp:
3193         (WebCore::parsePartMappings):
3194
3195         Parse the mappings microsyntax.
3196
3197         (WebCore::ShadowRoot::partMappings const):
3198         (WebCore::ShadowRoot::invalidatePartMappings):
3199         * dom/ShadowRoot.h:
3200         * html/HTMLAttributeNames.in:
3201
3202 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
3203
3204         A newly inserted element doesn't get assigned to a named slot if slot assignments had already happened
3205         https://bugs.webkit.org/show_bug.cgi?id=199733
3206
3207         Reviewed by Antti Koivisto.
3208
3209         The bug was caused by addSlotElementByName not invalidating slot assignments when a new slot element
3210         is inserted after corresponding elements with the slot content attribute had already been inserted.
3211
3212         Fixed the bug by always invalidating the slot assignment when a new slot element is inserted.
3213
3214         Tests: fast/shadow-dom/add-slotted-element-after-assignment-1.html
3215                fast/shadow-dom/add-slotted-element-after-assignment-2.html
3216                fast/shadow-dom/add-slotted-element-after-assignment-3.html
3217
3218         * dom/SlotAssignment.cpp:
3219         (WebCore::SlotAssignment::addSlotElementByName):
3220
3221 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
3222
3223         Radio button groups are not scoped by shadow boundaries
3224         https://bugs.webkit.org/show_bug.cgi?id=199568
3225
3226         Reviewed by Antti Koivisto.
3227
3228         Fixed the bug that radio button groups are not scoped to each shadow tree by moving
3229         RadioButtonGroups from FormController, which is a per-document object, to TreeScope.
3230
3231         Test: imported/w3c/web-platform-tests/shadow-dom/input-type-radio.html
3232
3233         * dom/RadioButtonGroups.h:
3234         (WebCore::RadioButtonGroups): Made this bmalloc'ed now that it's allocated standalone.
3235         * dom/TreeScope.cpp:
3236         (WebCore::TreeScope::radioButtonGroups): Added.
3237         * dom/TreeScope.h:
3238         * html/FormController.h:
3239         (WebCore::FormController::radioButtonGroups): Deleted.
3240         * html/HTMLInputElement.cpp:
3241         (WebCore::HTMLInputElement::~HTMLInputElement):
3242         (WebCore::HTMLInputElement::removedFromAncestor): Update the radio button group here.
3243         (WebCore::HTMLInputElement::didMoveToNewDocument): Removed the code to update radio
3244         button group here since it's done in removedFromAncestor now. Note that insertion case
3245         is alrady taken care of by HTMLInputElement::didFinishInsertingNode.
3246         (WebCore::HTMLInputElement::radioButtonGroups const): Ditto.
3247
3248 2019-10-03  Antti Koivisto  <antti@apple.com>
3249
3250         [CSS Shadow Parts] Correct interaction with other pseudo elements
3251         https://bugs.webkit.org/show_bug.cgi?id=202526
3252
3253         Reviewed by Ryosuke Niwa.
3254
3255         Cases like foo::part(bar)::before should work.
3256
3257         This patch doesn't cover ::placeholder which is implemented as PseudoElementWebKitCustom (like internal -webkit-* properties).
3258
3259         * css/CSSSelector.h:
3260         (WebCore::isTreeStructuralPseudoClass):
3261
3262         Add a helper.
3263
3264         * css/parser/CSSSelectorParser.cpp:
3265
3266         Allow non-structural pseudo classes after ::part().
3267         Allow other pseudo elements after ::part().
3268
3269         (WebCore::CSSSelectorParser::consumePseudo):
3270
3271         No need for DisallowPseudoElementsScope, we are just parsing identifiers.
3272
3273 2019-10-03  James Darpinian  <jdarpinian@chromium.org>
3274
3275         Fix WebGL 1 conformance regressions when USE_ANGLE=1
3276         https://bugs.webkit.org/show_bug.cgi?id=202545
3277
3278         Prevent ANGLE from automatically using ES3 when ES2 is requested.
3279
3280         WEBGL_debug_shaders extension should not accept or return null.
3281
3282         Enable ANGLE's new support for emulating RGB on RGBA IOSurfaces.
3283
3284         Reviewed by Alex Christensen.
3285
3286         * html/canvas/WebGLDebugShaders.cpp:
3287         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
3288         * html/canvas/WebGLDebugShaders.h:
3289         * html/canvas/WebGLDebugShaders.idl:
3290         * html/canvas/WebGLRenderingContextBase.cpp:
3291         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
3292         * platform/graphics/angle/Extensions3DANGLE.cpp:
3293         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
3294         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3295         (WebCore::GraphicsContext3D::GraphicsContext3D):
3296         * platform/graphics/cocoa/WebGLLayer.mm:
3297         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
3298
3299 2019-10-03  Jer Noble  <jer.noble@apple.com>
3300
3301     [iOS] WebContent process can be interrupted during suspension; loses "Now Playing" status
3302     https://bugs.webkit.org/show_bug.cgi?id=202537
3303     <rdar://problem/55952707>
3304
3305     Reviewed by Eric Carlson.
3306
3307     Always deactivate the AVAudioSession when the last playing PlatformAudioSession ends playback and the application is in the background.
3308
3309     * platform/audio/PlatformMediaSessionManager.cpp:
3310     (WebCore::PlatformMediaSessionManager::removeSession):
3311     (WebCore::PlatformMediaSessionManager::processWillSuspend):
3312     (WebCore::PlatformMediaSessionManager::maybeDeactivateAudioSession):
3313     * platform/audio/PlatformMediaSessionManager.h:
3314     (WebCore::PlatformMediaSessionManager::isApplicationInBackground const):
3315     * platform/audio/ios/MediaSessionManagerIOS.h:
3316     * platform/audio/ios/MediaSessionManagerIOS.mm:
3317     (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
3318
3319 2019-10-03  Chris Dumez  <cdumez@apple.com>
3320
3321         Allow pages using FontFaceSet to enter the back/forward cache
3322         https://bugs.webkit.org/show_bug.cgi?id=202476
3323
3324         Reviewed by Myles C. Maxfield.
3325
3326         Allow pages using FontFaceSet to enter the back/forward cache by updating its
3327         implementation to queue all its tasks that run script to a SuspendableTaskQueue.
3328         The SuspendableTaskQueue makes sure to properly suspend while in PageCache and
3329         run the tasks when resuming from PageCache.
3330
3331         Test: http/tests/navigation/page-cache-fontfaceset.html
3332
3333         * PlatformWin.cmake:
3334         * Sources.txt:
3335         * WebCore.xcodeproj/project.pbxproj:
3336         * css/CSSFontFace.cpp:
3337         (WebCore::CSSFontFace::fontLoadEventOccurred):
3338         * css/FontFaceSet.cpp:
3339         (WebCore::FontFaceSet::FontFaceSet):
3340         (WebCore::FontFaceSet::canSuspendForDocumentSuspension const):
3341         (WebCore::FontFaceSet::didFirstLayout):
3342         (WebCore::FontFaceSet::completedLoading):
3343         (WebCore::FontFaceSet::faceFinished):
3344         * css/FontFaceSet.h:
3345
3346         * platform/SuspendableTaskQueue.cpp: Added.
3347         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
3348         (WebCore::SuspendableTaskQueue::close):
3349         (WebCore::SuspendableTaskQueue::cancelAllTasks):
3350         (WebCore::SuspendableTaskQueue::enqueueTask):
3351         (WebCore::SuspendableTaskQueue::runOneTask):
3352         (WebCore::SuspendableTaskQueue::activeDOMObjectName const):
3353         (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const):
3354         (WebCore::SuspendableTaskQueue::stop):
3355         (WebCore::SuspendableTaskQueue::suspend):
3356         (WebCore::SuspendableTaskQueue::resume):
3357         * platform/SuspendableTaskQueue.h: Added.
3358         (WebCore::SuspendableTaskQueue::create):
3359         (WebCore::SuspendableTaskQueue::isClosed const):
3360         (WebCore::SuspendableTaskQueue::hasPendingTasks const):
3361         Add a SuspendableTaskQueue class which is Page-Cache aware and can be used to queue
3362         generic tasks as WTF::Function<void<>> lambdas.
3363
3364 2019-10-03  Chris Dumez  <cdumez@apple.com>
3365
3366         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache
3367         https://bugs.webkit.org/show_bug.cgi?id=202474
3368
3369         Reviewed by Alex Christensen.
3370
3371         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache.
3372         To address the issue, we now make sure to stop all loads before checking for PageCache eligibility.
3373
3374         Test: fast/history/page-cache-quick-redirect-iframe.html
3375
3376         * history/PageCache.cpp:
3377         (WebCore::PageCache::addIfCacheable):
3378         * loader/FrameLoader.cpp:
3379         (WebCore::FrameLoader::stopForPageCache):
3380         * loader/FrameLoader.h:
3381
3382 2019-10-03  Chris Dumez  <cdumez@apple.com>
3383
3384         XMLHttpRequest sometimes prevents pages from entering the back/forward cache
3385         https://bugs.webkit.org/show_bug.cgi?id=202434
3386         <rdar://problem/55890340>
3387
3388         Reviewed by Geoffrey Garen.
3389
3390         XMLHttpRequest::canSuspendForDocumentSuspension() was returning false if the document has not fired
3391         the window's load event, with a comment explaining that cancelling the XHR in the upon suspension
3392         may cause the load event to get fired and thus run script when forbidden. However, we should only
3393         return false if the XMLHttpRequest is actually loading (m_loader is not null). XHRs that are not
3394         loading should never prevent page caching.
3395
3396         I saw failures to enter the back/forward cache on yandex.ru and taobao.com because of this.
3397
3398         Test: http/tests/navigation/page-cache-failed-xhr.html
3399
3400         * xml/XMLHttpRequest.cpp:
3401         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const):
3402
3403 2019-10-03  John Wilander  <wilander@apple.com>
3404
3405         Resource Load Statistics: Downgrade document.referrer for all third-party iframes
3406         https://bugs.webkit.org/show_bug.cgi?id=202506
3407         <rdar://problem/55786397>
3408
3409         Reviewed by Brent Fulgham.
3410
3411         This change downgrades document.referrer for all third-party iframes if ITP/Resource Load Statistics
3412         is enabled. The behavior matches the downgrade of all HTTP referrers for third-party resources
3413         which landed in https://trac.webkit.org/changeset/250413/webkit.
3414
3415         Tests: http/tests/resourceLoadStatistics/downgrade-document-referrer-nested-third-party-iframe.html
3416                http/tests/resourceLoadStatistics/downgrade-document-referrer-third-party-iframe.html
3417                http/tests/resourceLoadStatistics/leave-empty-document-referrer-alone-third-party-iframe.html
3418
3419         * dom/Document.cpp:
3420         (WebCore::Document::referrer):
3421         (WebCore::Document::referrer const): Deleted.
3422             Can no longer be const since it lazily downgrades and saves the referrer on read.
3423         * dom/Document.h:
3424
3425 2019-10-03  Devin Rousso  <drousso@apple.com>
3426
3427         Web Inspector: remove `InspectorInstrumentationCookie`
3428         https://bugs.webkit.org/show_bug.cgi?id=202487
3429
3430         Reviewed by Matt Baker.
3431
3432         All it does is create a shallow-copy of the `InstrumentingAgents` (it copies a pointer to
3433         the `InstrumentingAgents` object, so any of the pointers to the `InspectorAgent` that are
3434         contained therein are shared between each instance) and save the tracking
3435         `InspectorTimelineAgent`'s id (monotonically increasing integer).
3436
3437         All uses of `InspectorInstrumentationCookie` are local values, so there's no way that the
3438         `InspectorTimelineAgent` (or the id) could change in between an
3439         `InspectorInstrumentation::will*` and an `InspectorInstrumentation::did*`, as both the
3440         tracking state and id are controlled by the frontend and cannot "interrupt".
3441
3442         Removing `InspectorInstrumentationCookie` _can_ cause issues is in situations where the
3443         `ScriptExecutionContext` (or `Page`) changes between the `InspectorInstrumentation::will*`
3444         and the `InspectorInstrumentation::did*`, but this can be avoided so long as a pointer to
3445         the "context" used for `InspectorInstrumentation::will*` is saved.
3446
3447         Covered by existing tests: inspector/timeline/*
3448
3449         * inspector/InspectorInstrumentationCookie.h: Removed.
3450         * inspector/InspectorInstrumentationCookie.cpp: Removed.
3451
3452         * inspector/agents/InspectorTimelineAgent.h:
3453         * inspector/agents/InspectorTimelineAgent.cpp:
3454         (WebCore::InspectorTimelineAgent::internalStop):
3455         (WebCore::InspectorTimelineAgent::didDispatchEvent):
3456         (WebCore::InspectorTimelineAgent::didPaint):
3457         (WebCore::InspectorTimelineAgent::clearRecordStack): Deleted.
3458
3459         * bindings/js/JSCallbackData.cpp:
3460         (WebCore::JSCallbackData::invokeCallback):
3461         * bindings/js/JSCustomElementInterface.cpp:
3462         (WebCore::constructCustomElementSynchronously):
3463         (WebCore::JSCustomElementInterface::upgradeElement):
3464         (WebCore::JSCustomElementInterface::invokeCallback):
3465         * bindings/js/JSErrorHandler.cpp:
3466         (WebCore::JSErrorHandler::handleEvent):
3467         * bindings/js/JSEventListener.cpp:
3468         (WebCore::JSEventListener::handleEvent):
3469         * bindings/js/JSExecState.h:
3470         * bindings/js/JSExecStateInstrumentation.h:
3471         (WebCore::JSExecState::instrumentFunctionInternal):
3472         (WebCore::JSExecState::instrumentFunctionCall):
3473         (WebCore::JSExecState::instrumentFunctionConstruct):
3474         * bindings/js/ScheduledAction.cpp:
3475         (WebCore::ScheduledAction::executeFunctionInContext):
3476         * bindings/js/ScriptController.cpp:
3477         (WebCore::ScriptController::evaluateInWorld):
3478         (WebCore::ScriptController::evaluateModule):
3479         * dom/Document.cpp:
3480         (WebCore::Document::resolveStyle):
3481         * dom/EventTarget.cpp:
3482         (WebCore::EventTarget::innerInvokeEventListeners):
3483         * dom/MutationObserver.cpp:
3484         (WebCore::MutationObserver::deliver):
3485         * dom/ScriptedAnimationController.cpp:
3486         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
3487         * page/DOMTimer.cpp:
3488         (WebCore::DOMTimer::fired):
3489         * page/DOMWindow.cpp:
3490         (WebCore::DOMWindow::dispatchEvent):
3491         * page/FrameViewLayoutContext.cpp:
3492         (WebCore::FrameViewLayoutContext::layout):
3493         * page/IntersectionObserver.cpp:
3494         (WebCore::IntersectionObserver::notify):
3495         * page/PerformanceObserver.cpp:
3496         (WebCore::PerformanceObserver::deliver):
3497
3498         * inspector/InspectorInstrumentation.h:
3499         (WebCore::InspectorInstrumentation::willCallFunction):
3500         (WebCore::InspectorInstrumentation::didCallFunction):
3501         (WebCore::InspectorInstrumentation::willDispatchEvent):
3502         (WebCore::InspectorInstrumentation::didDispatchEvent):
3503         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
3504         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
3505         (WebCore::InspectorInstrumentation::willEvaluateScript):
3506         (WebCore::InspectorInstrumentation::didEvaluateScript):
3507         (WebCore::InspectorInstrumentation::willFireTimer):
3508         (WebCore::InspectorInstrumentation::didFireTimer):
3509         (WebCore::InspectorInstrumentation::willLayout):
3510         (WebCore::InspectorInstrumentation::didLayout):
3511         (WebCore::InspectorInstrumentation::willRecalculateStyle):
3512         (WebCore::InspectorInstrumentation::didRecalculateStyle):
3513         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
3514         (WebCore::InspectorInstrumentation::didFireAnimationFrame):
3515         (WebCore::InspectorInstrumentation::willFireObserverCallback):
3516         (WebCore::InspectorInstrumentation::didFireObserverCallback):
3517         * inspector/InspectorInstrumentation.cpp:
3518         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
3519         (WebCore::InspectorInstrumentation::didCallFunctionImpl):
3520         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
3521         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
3522         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
3523         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
3524         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
3525         (WebCore::InspectorInstrumentation::didEvaluateScriptImpl):
3526         (WebCore::InspectorInstrumentation::willFireTimerImpl):
3527         (WebCore::InspectorInstrumentation::didFireTimerImpl):
3528         (WebCore::InspectorInstrumentation::willLayoutImpl):
3529         (WebCore::InspectorInstrumentation::didLayoutImpl):
3530         (WebCore::InspectorInstrumentation::willRecalculateStyleImpl):
3531         (WebCore::InspectorInstrumentation::didRecalculateStyleImpl):
3532         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
3533         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
3534         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
3535         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
3536         (WebCore::InspectorInstrumentation::retrieveTimelineAgent): Deleted.
3537
3538         * Sources.txt:
3539         * WebCore.xcodeproj/project.pbxproj:
3540
3541 2019-10-03  Sihui Liu  <sihui_liu@apple.com>
3542
3543         IndexedDB: add size estimate for key path when estimate task size
3544         https://bugs.webkit.org/show_bug.cgi?id=202480
3545
3546         Reviewed by Geoffrey Garen.
3547
3548         No observable behavior change.
3549
3550         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3551         (WebCore::IDBServer::estimateSize):
3552
3553 2019-10-03  youenn fablet  <youenn@apple.com>
3554
3555         Regression: iOS 13.1 MediaStreamTrack.enabled = false kills audio track
3556         https://bugs.webkit.org/show_bug.cgi?id=202405
3557         <rdar://problem/55922616>
3558
3559         Reviewed by Eric Carlson.
3560
3561         When the web page is setting enabled to false, media session might change from PlayRecord to None.
3562         This might trigger CoreAudio to no longer output audio samples, thus triggering our audio capture failure timer.
3563         This would end the track after 2 seconds.
3564         Given audio tracks can be reenabled by a web page, we should not change the Media Session setup based on that.
3565         This patch updates MediaStream::mediaType to return independently of the enabled state.
3566
3567         Add internals API to write a cross platform test.
3568
3569         Test: fast/mediastream/audio-track-enabled.html
3570         Manually tested as well.
3571
3572         * Modules/mediastream/MediaStream.cpp:
3573         (WebCore::MediaStream::mediaType const):
3574         * platform/mediastream/MediaStreamPrivate.cpp:
3575         (WebCore::MediaStreamPrivate::hasCaptureAudioSource const):
3576         * testing/Internals.cpp:
3577         (WebCore::Internals::supportsAudioSession const):
3578         (WebCore::Internals::audioSessionCategory const):
3579         * testing/Internals.h:
3580         * testing/Internals.idl:
3581
3582 2019-10-03  youenn fablet  <youenn@apple.com>
3583
3584         http/tests/security/navigate-when-restoring-cached-page.html should not use RTCPeerConnection to not enter in page cache
3585         https://bugs.webkit.org/show_bug.cgi?id=202521
3586
3587         Reviewed by Chris Dumez.
3588
3589         Introduce a dummy ActiveDOMObject which can never be suspended for document suspension.
3590         Allow a page to create this dummy ActiveDOMObject through internals.
3591         Covered by updated test.
3592
3593         * dom/ActiveDOMObject.h:
3594         * testing/Internals.cpp:
3595         (WebCore::Internals::preventDocumentForEnteringPageCache):
3596         * testing/Internals.h:
3597         * testing/Internals.idl:
3598
3599 2019-10-03  Tim Horton  <timothy_horton@apple.com>
3600
3601         WebKit doesn't build with trunk clang
3602         https://bugs.webkit.org/show_bug.cgi?id=202511
3603
3604         Reviewed by Anders Carlsson.
3605
3606         * Modules/fetch/FetchLoader.h:
3607         * Modules/geolocation/Geolocation.h:
3608         * Modules/indexeddb/IDBTransaction.h:
3609         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3610         * Modules/indexeddb/shared/InProcessIDBServer.h:
3611         * Modules/notifications/Notification.cpp:
3612         * Modules/notifications/Notification.h:
3613         * platform/graphics/ca/TileController.h:
3614         * workers/service/context/ServiceWorkerThreadProxy.h:
3615         Fix the build by exporting destructors and custom delete operators.
3616         I don't know why this changed, but trunk clang insists.
3617         There are also some new warnings; this only fixes the hard errors.
3618
3619 2019-10-03  Tim Horton  <timothy_horton@apple.com>
3620
3621         Yet another build fix
3622
3623         * css/typedom/TypedOMCSSImageValue.h:
3624         Forward declare Document.
3625
3626 2019-10-03  Jiewen Tan  <jiewen_tan@apple.com>
3627
3628         Support googleLegacyAppidSupport extension
3629         https://bugs.webkit.org/show_bug.cgi?id=202427
3630         <rdar://problem/55887473>
3631
3632         Reviewed by Brent Fulgham.
3633
3634         This patch adds support for googleLegacyAppidSupport extension, when set:
3635         1) user agent should only use the U2F transport protocol,
3636         2) should only communicate with roaming authenticators, and
3637         3) should use a hard-coded appID of https://www.gstatic.com/securitykey/origins.json.
3638         To be noticed as the name implies, this extension is exclusively for RP ID = google.com.
3639
3640         Implementation wise, all operations are captured in methods with name processGoogleLegacyAppIdSupportExtension.
3641         1) AuthenticatorCoordinator takes care of setting the value.
3642         2) U2fCommandConstructor takes care of hard coding the AppID.
3643         3) AuthenticatorManager takes care of removing AuthenticatorTransport::Internal from TransportSet, so startDiscovery
3644         will not poke platform authenticators.
3645         4) CtapAuthenticator takes care of downgrading to U2fAuthenticator.
3646         5) U2fAuthenticator takes care of setting the AppID in the response.
3647
3648         Partially covered by new test cases in existing tests, and remaining will be covered by manual tests.
3649
3650         * Modules/webauthn/AuthenticationExtensionsClientInputs.h:
3651         (WebCore::AuthenticationExtensionsClientInputs::encode const):
3652         (WebCore::AuthenticationExtensionsClientInputs::decode):
3653         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl:
3654         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3655         (WebCore::AuthenticatorCoordinatorInternal::processGoogleLegacyAppIdSupportExtension):
3656         (WebCore::AuthenticatorCoordinator::create const):
3657         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3658         (WebCore::PublicKeyCredentialCreationOptions::encode const):
3659         (WebCore::PublicKeyCredentialCreationOptions::decode):
3660         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
3661         (fido::convertToU2fRegisterCommand):
3662         (fido::processGoogleLegacyAppIdSupportExtension):
3663         * Modules/webauthn/fido/U2fCommandConstructor.h:
3664
3665 2019-10-03  Yury Semikhatsky  <yurys@chromium.org>
3666
3667         Web Inspector: tests under LayoutTests/inspector/debugger are flaky
3668         https://bugs.webkit.org/show_bug.cgi?id=137131
3669         <rdar://problem/18461335>
3670
3671         Reviewed by Devin Rousso.
3672
3673         Fix debugger tests on GTK. All tests that pause on breakpoint didn't work because
3674         in layout tests InspectorFrontendClientLocal was using Timer to dispatch commands
3675         sent from the local front-end page to the inspected one. When paused inside a script
3676         triggered by the front-end nested timer event would be scheduled but never fired
3677         because in glib implementation of RunLoop::TimerBase uses event source which doesn't
3678         allow recursion (g_source_set_can_recurse is not called on the source), so dispatching
3679         Debugger.resume command didn't work when paused inside another inspector command (e.g.
3680         eval). RunLoop itself uses event source which does allow recursion. So instead of using
3681         a timer for asynchronous command dispatching with delay=0 we now schedule a task in
3682         RunLoop's queue.
3683
3684         * inspector/InspectorFrontendClientLocal.cpp:
3685         (WebCore::InspectorBackendDispatchTask::dispatch):
3686         (WebCore::InspectorBackendDispatchTask::reset):
3687         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
3688         (WebCore::InspectorBackendDispatchTask::scheduleOneShot): ensures that there is one inspector
3689         dispatch task in the queue.
3690         (WebCore::InspectorBackendDispatchTask::dispatchOneMessage): this is mostly the same behavior
3691         as was with timerFired, we should be able to dispatch all accumulated messages from the queue
3692         in one batch but for now I'd like to keep it one per iteration.
3693
3694 2019-10-03  Joonghun Park  <pjh0718@gmail.com>
3695
3696         CSS ellipse() doesn't accept single <shape-radius>
3697         https://bugs.webkit.org/show_bug.cgi?id=181745
3698
3699         CSS ellipse() should only accept 0 or 2 radii.
3700         The corresponding csswg discussion is
3701         https://github.com/w3c/csswg-drafts/issues/2175.
3702
3703         Reviewed by Antti Koivisto.
3704
3705         Tests: imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed.html
3706                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-invalid.html
3707                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid.html
3708                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-computed.html
3709                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-invalid.html
3710                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-valid.html
3711
3712         * css/CSSBasicShapes.cpp:
3713         (WebCore::CSSBasicShapeEllipse::cssText const):
3714         * css/parser/CSSPropertyParser.cpp:
3715         (WebCore::consumeBasicShapeEllipse):
3716
3717 2019-10-03  Zan Dobersek  <zdobersek@igalia.com>
3718
3719         [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling
3720         https://bugs.webkit.org/show_bug.cgi?id=202509
3721
3722         Reviewed by Carlos Garcia Campos.
3723
3724         Add build guards that would enable runtime checks of the asynchronous
3725         frame scrolling setting in the ScrollingCoordinator and
3726         RenderLayerCompositor classes for the Nicosia-using ports.
3727
3728         The check in ScrollingCoordinator avoids bailing on coordinating
3729         scrolling for non-main frames when the setting is enabled. The check in
3730         RenderLayerCompositor avoids imposing a requirement for a composition
3731         layer for any non-main frame when the setting is disabled.
3732
3733         * page/scrolling/ScrollingCoordinator.cpp:
3734         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
3735         * rendering/RenderLayerCompositor.cpp:
3736         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
3737
3738 2019-10-02  Antti Koivisto  <antti@apple.com>
3739
3740         [CSS Shadow Parts] Support multiple arguments for ::part()
3741         https://bugs.webkit.org/show_bug.cgi?id=202482
3742
3743         Reviewed by Ryosuke Niwa.
3744
3745         Support ::part(foo bar).
3746
3747         * css/CSSSelector.cpp:
3748         (WebCore::CSSSelector::selectorText const):
3749         (WebCore::CSSSelector::setArgumentList):
3750         (WebCore::CSSSelector::setLangArgumentList): Deleted.
3751
3752         Give this a more generic name and use it for ::part() too.
3753
3754         * css/CSSSelector.h:
3755         (WebCore::CSSSelector::argumentList const):
3756         (WebCore::CSSSelector::langArgumentList const): Deleted.
3757         * css/SelectorChecker.cpp:
3758         (WebCore::SelectorChecker::checkOne const):
3759
3760         Match only if all parts are found from the element 'part' attribute.
3761
3762         * css/parser/CSSParserSelector.cpp:
3763         (WebCore::CSSParserSelector::setArgumentList):
3764         (WebCore::CSSParserSelector::setLangArgumentList): Deleted.
3765         * css/parser/CSSParserSelector.h:
3766         * css/parser/CSSSelectorParser.cpp:
3767         (WebCore::CSSSelectorParser::consumePseudo):
3768
3769         Parse the list.
3770
3771         * cssjit/SelectorCompiler.cpp:
3772         (WebCore::SelectorCompiler::addPseudoClassType):
3773
3774 2019-10-02  Andy Estes  <aestes@apple.com>
3775
3776         [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable
3777         https://bugs.webkit.org/show_bug.cgi?id=202498
3778         <rdar://problem/54723131>
3779
3780         Reviewed by Tim Horton.
3781
3782         When the user selects a context menu action, WebKit performs a hit test in order to find the
3783         acted-on element on the page. This is separate from the hit test performed to generate the
3784         context menu's targeted preview. Since an arbitrary amount of time can elapse between
3785         preview generation and action selection, this second hit-tests might return a different
3786         element.
3787
3788         One case where we know a different element can be returned is in apps that dynamically
3789         enable and disable editing. If editing is disabled when the first hit test occurs but is
3790         enabled when the second one occurs, different elements will be returned due to
3791         Frame::qualifyingNodeAtViewportLocation preferring to return the root editable element when
3792         the approximate node is contenteditable.
3793
3794         While the appropriate long-term fix is to only hit-test once and use that element for both
3795         preview generation and action selection, this patch implements a short-term fix to address
3796         the specific problem in rdar://problem/54723131 by disabling the contenteditable behavior
3797         described above for context menu interaction hit testing.
3798
3799         The long-term fix is tracked by <https://webkit.org/b/202499>.
3800
3801         * page/Frame.h:
3802         * page/ios/FrameIOS.mm:
3803         (WebCore::Frame::qualifyingNodeAtViewportLocation):
3804         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
3805         (WebCore::ancestorRespondingToClickEventsNodeQualifier):
3806         (WebCore::Frame::nodeRespondingToClickEvents):
3807         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
3808         (WebCore::Frame::nodeRespondingToInteraction):
3809         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
3810
3811 2019-10-02  Antti Koivisto  <antti@apple.com>
3812
3813         [CSS Shadow Parts] Basic ::part() pseudo element support
3814         https://bugs.webkit.org/show_bug.cgi?id=202456
3815
3816         Reviewed by Ryosuke Niwa.
3817
3818         Implement basic parsing and selector matching for ::part() pseudo element.
3819
3820         * css/CSSSelector.cpp:
3821         (WebCore::CSSSelector::pseudoId):
3822         (WebCore::CSSSelector::parsePseudoElementType):
3823         (WebCore::CSSSelector::selectorText const):
3824         * css/CSSSelector.h:
3825         * css/ElementRuleCollector.cpp:
3826         (WebCore::ElementRuleCollector::matchAuthorRules):
3827         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
3828         * css/ElementRuleCollector.h:
3829         * css/RuleSet.cpp:
3830         (WebCore::RuleSet::addRule):
3831         * css/RuleSet.h:
3832         (WebCore::RuleSet::partPseudoElementRules const):
3833         * css/SelectorChecker.cpp:
3834         (WebCore::SelectorChecker::checkOne const):
3835         * css/SelectorPseudoElementTypeMap.in:
3836         * css/parser/CSSParserSelector.cpp:
3837         (WebCore::CSSParserSelector::parsePseudoElementSelector):
3838
3839         Also added ::slotted to SelectorPseudoElementTypeMap.in to resolve a FIXME here.
3840
3841         * css/parser/CSSParserSelector.h:
3842         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
3843         * css/parser/CSSSelectorParser.cpp:
3844         (WebCore::isOnlyPseudoElementFunction):
3845         (WebCore::CSSSelectorParser::consumePseudo):
3846
3847         Parse single values only, multipart ::part(foo bar) case is not yet handled.
3848
3849         * dom/Element.cpp:
3850         (WebCore::Element::partNames const):
3851
3852 2019-10-02  Antoine Quint  <graouts@apple.com>
3853
3854         Adopt copyToVector() in AnimationTimeline::animationsForElement()
3855         https://bugs.webkit.org/show_bug.cgi?id=202488
3856
3857         Reviewed by Wenson Hsieh.
3858
3859         * animation/AnimationTimeline.cpp:
3860         (WebCore::AnimationTimeline::animationsForElement const):
3861
3862 2019-10-02  Thibault Saunier  <tsaunier@igalia.com>
3863
3864         [GStreamer] Let playbin handle redirects for us when appropriate
3865         https://bugs.webkit.org/show_bug.cgi?id=195326
3866
3867         A simplified mechanism has been added in GStreamer to handle corner cases.
3868
3869         Reviewed by Xabier Rodriguez-Calvar.
3870
3871         Not easily testable at our level
3872
3873         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3874         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
3875
3876 2019-10-02  Tim Horton  <timothy_horton@apple.com>
3877
3878         Another build fix
3879
3880         * css/typedom/TypedOMCSSImageValue.cpp:
3881         (WebCore::TypedOMCSSImageValue::TypedOMCSSImageValue):
3882         * css/typedom/TypedOMCSSImageValue.h:
3883         I feel like I am actively being thwarted.
3884
3885 2019-10-02  Tim Horton  <timothy_horton@apple.com>
3886
3887         Another build fix
3888
3889         * css/typedom/TypedOMCSSImageValue.h:
3890
3891 2019-10-02  Tim Horton  <timothy_horton@apple.com>
3892
3893         Try to fix the Windows build
3894
3895         * css/typedom/TypedOMCSSImageValue.cpp:
3896         (WebCore::TypedOMCSSImageValue::document const):
3897         * css/typedom/TypedOMCSSImageValue.h:
3898         Out-of-line this instead of including Document.h in TypedOMCSSImageValue,
3899         which was an earlier build fix from r250610.
3900
3901         * platform/graphics/cg/GradientCG.cpp:
3902         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
3903         * platform/graphics/win/GraphicsContextCGWin.cpp:
3904         Try to fix the build.
3905
3906 2019-10-02  Keith Rollin  <krollin@apple.com>
3907
3908         Unreviewed build fix after r250595.
3909
3910         macCatalyst appears to have triggered the the problem where the build
3911         can sometimes fail if the unified sources mechanism doesn't group
3912         together the right set of files.
3913
3914         * css/typedom/TypedOMCSSImageValue.h:
3915
3916 2019-10-02  Antoine Quint  <graouts@apple.com>
3917
3918         [Web Animations] Implement replaced animations
3919         https://bugs.webkit.org/show_bug.cgi?id=202190
3920         <rdar://55697719>
3921
3922         Reviewed by Dean Jackson.
3923
3924         Implementing section "5.5 Replacing Animations" (https://drafts.csswg.org/web-animations/#replacing-animations) of the Web Animations
3925         specification which allows for Web Animations to be destroyed when they are superseded by another animation and the developer doesn't
3926         explicitly opt into persisting them using the persist() method.
3927
3928         An animation is marked as replaceable (to sum up) when it's finished and another animation for the same property takes precedence.
3929         As part of DocumentTimeline::internalUpdateAnimationsAndSendEvents(), we'll go through all replaceable animations, dispatch a "remove"
3930         DOM event, and remove them from our list of animations.
3931
3932         We also make a couple of fixes in this patch that were uncovered while working on the WPT tests for replaced animations:
3933         
3934         - we would incorrectly parse single values for a property that allows lists (change in KeyframeEffect's processKeyframeLikeObject())
3935         - we didn't account for the position in the global animation list when sorted animations by composite order (AnimationTimeline::animationsForElement())
3936
3937         Finally, to get more readable results, we implement a stub of commitStyles(). Its full implementation is tracked by http://wkb.ug/202193.
3938
3939         * animation/AnimationTimeline.cpp:
3940         (WebCore::AnimationTimeline::animationTimingDidChange): Mark the position of the animation in the global animation list, to which it may only be added once.
3941         (WebCore::AnimationTimeline::animationsForElement const): Account for the animation's position in the global animation when sorting.
3942         * animation/DeclarativeAnimation.cpp:
3943         (WebCore::DeclarativeAnimation::bindingsReplaceState const): Flush pending styles when querying the ready state for a declarative animation.
3944         * animation/DeclarativeAnimation.h:
3945         * animation/DocumentTimeline.cpp:
3946         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Run the "remove replaced animations" procedure as the second step in the "update animations
3947         and send events" procedure.
3948         (WebCore::DocumentTimeline::animationCanBeRemoved): Determine whether a given animation may be removed based on its finished state, replace state and whether
3949         it is fully superseded by another animation targeting the same property on the same target element.
3950         (WebCore::DocumentTimeline::removeReplacedAnimations): Remove any removable animation and dispatch a "remove" DOM event for each removed animation. 
3951         * animation/DocumentTimeline.h:
3952         * animation/KeyframeEffect.cpp:
3953         (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.
3954         * animation/WebAnimation.cpp:
3955         (WebCore::WebAnimation::isReplaceable const):
3956         (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
3957         been removed based on its persisted state.
3958         (WebCore::WebAnimation::commitStyles): Stub for a new function.
3959         * animation/WebAnimation.h:
3960         (WebCore::WebAnimation::replaceState const):
3961         (WebCore::WebAnimation::setReplaceState):
3962         (WebCore::WebAnimation::bindingsReplaceState const):
3963         (WebCore::WebAnimation::globalPosition const):
3964         (WebCore::WebAnimation::setGlobalPosition):
3965         * animation/WebAnimation.idl:
3966         * dom/EventNames.h: Add the new "remove" event so that the "onremove" DOM property is available on Animation objects. 
3967
3968 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
3969
3970         Unreviewed build fix in Nicosia's ScrollingTreePositionedNode class.
3971
3972         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
3973         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
3974         Fix the name of the variable included in the log call.
3975
3976 2019-10-02  youenn fablet  <youenn@apple.com>
3977
3978         Use strongly typed identifiers for webrtc sockets
3979         https://bugs.webkit.org/show_bug.cgi?id=202400
3980
3981         Reviewed by Chris Dumez.
3982
3983         No observable change of behavior.
3984
3985         * Headers.cmake:
3986         * WebCore.xcodeproj/project.pbxproj:
3987         * platform/mediastream/libwebrtc/LibWebRTCSocketIdentifier.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocket.h.