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