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