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