Keyframe animation doesn't 't show up in the Animations timeline
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-06-23  Devin Rousso  <drousso@apple.com>
2
3         Keyframe animation doesn't 't show up in the Animations timeline
4         https://bugs.webkit.org/show_bug.cgi?id=213441
5
6         Reviewed by Brian Burg.
7
8         Test: inspector/animation/lifecycle-css-animation.html
9
10         * inspector/agents/InspectorAnimationAgent.cpp:
11         (WebCore::buildObjectForEffect):
12
13 2020-06-23  Sergio Villar Senin  <svillar@igalia.com>
14
15         [css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them
16         https://bugs.webkit.org/show_bug.cgi?id=212264
17
18         Reviewed by Manuel Rego Casasnovas.
19
20         Implement https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8 which modified
21         the way percentages were resolved in flexible items with indefinite sizes. From now on we can pretend that
22         they're really definite.
23
24         This allows us to mark 3 tests which were testing percentages in flex items as correct.
25
26         Based on Blink's crrev.com/1247184 by <cbiesinger@chromium.org>
27
28         This is a reland of r262124 which got reverted due to the bug fixed in r263389.
29
30         * rendering/RenderFlexibleBox.cpp:
31         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Do only check flex container main size
32         definiteness when computing the main size for percentage resolution, no need to check flex basis at all.
33
34 2020-06-18  Sergio Villar Senin  <svillar@igalia.com>
35
36         REGRESSION (r262124): Twitter videos go blank after exiting fullscreen
37         https://bugs.webkit.org/show_bug.cgi?id=213110
38
39         Reviewed by Darin Adler.
40
41         Test: fullscreen/video-inside-flex-item.html
42
43         Setting/unsetting position:absolute on a flex/grid item can potentially create/remove flex/grid items because
44         absolutely positioned children of those containers are out-of-flow and thus, do not generate flex/grid items.
45         Flex/grid items are potentially stretched by their containers so the style recalculation is not enough to get
46         a correct layout because the override size set by flex/grid containers is not reset.
47         In the particular case of this bug we had this hierarchy (highly simplified from twitter page):
48
49         Flexbox container
50         |___DIV (absolutelly positioned)
51             |___<video> (height: 100% width: 100%)
52
53         When the <video> goes fullscreen the FullscreenManager replaces the
54         style of the DIV because it inserts a RenderFullScreen object in between
55         the DIV and the <video> (along with some anonymous blocks). This means
56         that the DIV which was not a flex item (as it was absolutely positioned)
57         became a flex item and thus its size is stretched as the flexbox
58         container mandates. When exiting fullscreen, the original style is
59         restored (and thus the position absolute). The DIV is then no longer a
60         flex item but the stretched size (overrideContentSize) is still set,
61         causing issues with the sizes of the <video>.
62
63         Note that it isn't possible to reproduce this bug with the current trunk because there is a bug in the flexbox
64         implementation (see bug 212264) preventing this to happen. However it becomes 100% reproducible with the patch for bug 212264
65         which is correct and fixes several tests related to wrapping in flexbox. It's also reproducible when the FULLSCREEN_API is
66         enabled, otherwise the codepath for full screen is totally different (there are no placeholders).
67
68         * rendering/RenderBox.cpp:
69         (WebCore::RenderBox::styleDidChange): clear the override sizes for grid/flex when flex/grid items become out-of-flow,
70         for example by changing position to absolute.
71
72 2020-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
73
74         REGRESSION(r258741): [GTK] anchor-file-blob-download-includes-backslash.html is failing
75         https://bugs.webkit.org/show_bug.cgi?id=209329
76
77         Reviewed by Adrian Perez de Castro.
78
79         Sanitize the suggested filename. We replace characters that can be problematic in filenames with '_' to match
80         what Chromium and Firefox do.
81
82         * platform/network/soup/ResourceResponseSoup.cpp:
83         (WebCore::sanitizeFilename):
84         (WebCore::ResourceResponse::platformSuggestedFilename const):
85
86 2020-06-22  John Wilander  <wilander@apple.com>
87
88         Storage Access API: Add the capability to call the Storage Access API as a quirk, on behalf of websites that should be doing it themselves
89         https://bugs.webkit.org/show_bug.cgi?id=213418
90         <rdar://problem/64549429>
91
92         Reviewed by Alex Christensen.
93
94         No new tests. This patch adds quirks for specific websites.
95         The general functionality that's touched has tests under
96         LayoutTests/http/tests/storageAccess/.
97
98         * dom/Document.h:
99         (WebCore::Document::isTopDocument const):
100             New convenience function.
101         (WebCore::Document::setUserDidInteractWithPage):
102             Use of the new convenience function.
103         (WebCore::Document::userDidInteractWithPage const):
104             Use of the new convenience function.
105         * dom/DocumentStorageAccess.cpp:
106         (WebCore::DocumentStorageAccess::hasStorageAccessQuickCheck):
107         (WebCore::DocumentStorageAccess::hasStorageAccess):
108         (WebCore::DocumentStorageAccess::hasStorageAccessForDocumentQuirk):
109         (WebCore::DocumentStorageAccess::requestStorageAccess):
110         (WebCore::DocumentStorageAccess::requestStorageAccessQuickCheck):
111         (WebCore::DocumentStorageAccess::requestStorageAccessForDocumentQuirk):
112         (WebCore::DocumentStorageAccess::requestStorageAccessForNonDocumentQuirk):
113         (WebCore::DocumentStorageAccess::requestStorageAccessQuirk):
114             These functions are split up to allow quirks to call directly into the
115             implementation of the Storage Access API without the JavaScript
116             promise that goes with the web API. It also allows for quirks to call
117             the API without an iframe document.
118         * dom/DocumentStorageAccess.h:
119         * dom/Element.cpp:
120         (WebCore::Element::dispatchMouseEvent):
121             The two existing quirks are for click events.
122         * loader/ResourceLoadObserver.h:
123         (WebCore::ResourceLoadObserver::setDomainsWithUserInteraction):
124         (WebCore::ResourceLoadObserver::hasHadUserInteraction const):
125             These two new functions allow the Storage Access API quirks
126             to synchronously check if it's worth calling the API or not.
127             If there has been no user interaction for the requesting
128             domain, there is no need to call the API.
129         * page/Quirks.cpp:
130         (WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
131             This is the new quirks function, hiding the specifics of
132             certain elements clicked and for which websites. It also
133             calls the Storage Access API.
134         * page/Quirks.h:
135
136 2020-06-22  Chris Dumez  <cdumez@apple.com>
137
138         Introduce BaseAudioContext interface
139         https://bugs.webkit.org/show_bug.cgi?id=213491
140
141         Reviewed by Geoffrey Garen.
142
143         Introduce BaseAudioContext interface as per W3C WebAudio specification:
144         - https://www.w3.org/TR/webaudio/#BaseAudioContext
145
146         No new tests, rebaselined existing test.
147
148         * CMakeLists.txt:
149         * DerivedSources-input.xcfilelist:
150         * DerivedSources-output.xcfilelist:
151         * DerivedSources.make:
152         * Modules/webaudio/AudioContext.cpp:
153         (WebCore::AudioContext::AudioContext):
154         (WebCore::AudioContext::close):
155         (WebCore::AudioContext::createMediaElementSource):
156         (WebCore::AudioContext::createMediaStreamSource):
157         (WebCore::AudioContext::createMediaStreamDestination):
158         * Modules/webaudio/AudioContext.h:
159         * Modules/webaudio/AudioContext.idl:
160         * Modules/webaudio/AudioNode.cpp:
161         (WebCore::AudioNode::contextForBindings const):
162         * Modules/webaudio/AudioNode.h:
163         * Modules/webaudio/AudioNode.idl:
164         * Modules/webaudio/BaseAudioContext.cpp: Copied from Source/WebCore/Modules/webaudio/AudioContext.cpp.
165         (WebCore::BaseAudioContext::isSampleRateRangeGood):
166         (WebCore::AudioContextBase::AudioContextBase):
167         (WebCore::BaseAudioContext::BaseAudioContext):
168         (WebCore::BaseAudioContext::constructCommon):
169         (WebCore::BaseAudioContext::~BaseAudioContext):
170         (WebCore::BaseAudioContext::lazyInitialize):
171         (WebCore::BaseAudioContext::clear):
172         (WebCore::BaseAudioContext::uninitialize):
173         (WebCore::BaseAudioContext::isInitialized const):
174         (WebCore::BaseAudioContext::addReaction):
175         (WebCore::BaseAudioContext::setState):
176         (WebCore::BaseAudioContext::stop):
177         (WebCore::BaseAudioContext::suspend):
178         (WebCore::BaseAudioContext::resume):
179         (WebCore::BaseAudioContext::activeDOMObjectName const):
180         (WebCore::AudioContextBase::document const):
181         (WebCore::BaseAudioContext::hostingDocumentIdentifier const):
182         (WebCore::BaseAudioContext::isSuspended const):
183         (WebCore::BaseAudioContext::visibilityStateChanged):
184         (WebCore::BaseAudioContext::wouldTaintOrigin const):
185         (WebCore::BaseAudioContext::createBuffer):
186         (WebCore::BaseAudioContext::decodeAudioData):
187         (WebCore::BaseAudioContext::createBufferSource):
188         (WebCore::BaseAudioContext::createScriptProcessor):
189         (WebCore::BaseAudioContext::createBiquadFilter):
190         (WebCore::BaseAudioContext::createWaveShaper):
191         (WebCore::BaseAudioContext::createPanner):
192         (WebCore::BaseAudioContext::createConvolver):
193         (WebCore::BaseAudioContext::createDynamicsCompressor):
194         (WebCore::BaseAudioContext::createAnalyser):
195         (WebCore::BaseAudioContext::createGain):
196         (WebCore::BaseAudioContext::createDelay):
197         (WebCore::BaseAudioContext::createChannelSplitter):
198         (WebCore::BaseAudioContext::createChannelMerger):
199         (WebCore::BaseAudioContext::createOscillator):
200         (WebCore::BaseAudioContext::createPeriodicWave):
201         (WebCore::BaseAudioContext::notifyNodeFinishedProcessing):
202         (WebCore::BaseAudioContext::derefFinishedSourceNodes):
203         (WebCore::BaseAudioContext::refNode):
204         (WebCore::BaseAudioContext::derefNode):
205         (WebCore::BaseAudioContext::derefUnfinishedSourceNodes):
206         (WebCore::BaseAudioContext::lock):
207         (WebCore::BaseAudioContext::tryLock):
208         (WebCore::BaseAudioContext::unlock):
209         (WebCore::BaseAudioContext::isAudioThread const):
210         (WebCore::BaseAudioContext::isGraphOwner const):
211         (WebCore::BaseAudioContext::addDeferredFinishDeref):
212         (WebCore::BaseAudioContext::handlePreRenderTasks):
213         (WebCore::BaseAudioContext::handlePostRenderTasks):
214         (WebCore::BaseAudioContext::handleDeferredFinishDerefs):
215         (WebCore::BaseAudioContext::markForDeletion):
216         (WebCore::BaseAudioContext::scheduleNodeDeletion):
217         (WebCore::BaseAudioContext::deleteMarkedNodes):
218         (WebCore::BaseAudioContext::markSummingJunctionDirty):
219         (WebCore::BaseAudioContext::removeMarkedSummingJunction):
220         (WebCore::BaseAudioContext::eventTargetInterface const):
221         (WebCore::BaseAudioContext::markAudioNodeOutputDirty):
222         (WebCore::BaseAudioContext::handleDirtyAudioSummingJunctions):
223         (WebCore::BaseAudioContext::handleDirtyAudioNodeOutputs):
224         (WebCore::BaseAudioContext::addAutomaticPullNode):
225         (WebCore::BaseAudioContext::removeAutomaticPullNode):
226         (WebCore::BaseAudioContext::updateAutomaticPullNodes):
227         (WebCore::BaseAudioContext::processAutomaticPullNodes):
228         (WebCore::AudioContextBase::scriptExecutionContext const):
229         (WebCore::BaseAudioContext::nodeWillBeginPlayback):
230         (WebCore::shouldDocumentAllowWebAudioToAutoPlay):
231         (WebCore::BaseAudioContext::willBeginPlayback):
232         (WebCore::BaseAudioContext::willPausePlayback):
233         (WebCore::BaseAudioContext::startRendering):
234         (WebCore::BaseAudioContext::mediaCanStart):
235         (WebCore::BaseAudioContext::mediaState const):
236         (WebCore::BaseAudioContext::pageMutedStateDidChange):
237         (WebCore::BaseAudioContext::isPlayingAudioDidChange):
238         (WebCore::BaseAudioContext::finishedRendering):
239         (WebCore::BaseAudioContext::dispatchEvent):
240         (WebCore::BaseAudioContext::incrementActiveSourceCount):
241         (WebCore::BaseAudioContext::decrementActiveSourceCount):
242         (WebCore::BaseAudioContext::suspendRendering):
243         (WebCore::BaseAudioContext::resumeRendering):
244         (WebCore::BaseAudioContext::suspendPlayback):
245         (WebCore::BaseAudioContext::mayResumePlayback):
246         (WebCore::BaseAudioContext::postTask):
247         (WebCore::BaseAudioContext::origin const):
248         (WebCore::BaseAudioContext::addConsoleMessage):
249         (WebCore::BaseAudioContext::clearPendingActivity):
250         (WebCore::BaseAudioContext::makePendingActivity):
251         (WebCore::BaseAudioContext::logChannel const):
252         * Modules/webaudio/BaseAudioContext.h: Copied from Source/WebCore/Modules/webaudio/AudioContext.h.
253         (WebCore::AudioContextBase::AutoLocker::AutoLocker):
254         (WebCore::AudioContextBase::AutoLocker::~AutoLocker):
255         (WebCore::BaseAudioContext::destination):
256         (WebCore::BaseAudioContext::activeSourceCount const):
257         (WebCore::BaseAudioContext::listener):
258         (WebCore::BaseAudioContext::state const):
259         (WebCore::BaseAudioContext::isClosed const):
260         (WebCore::BaseAudioContext::connectionCount const):
261         (WebCore::BaseAudioContext::audioThread const):
262         (WebCore::BaseAudioContext::maxNumberOfChannels):
263         (WebCore::BaseAudioContext::destinationNode const):
264         (WebCore::BaseAudioContext::userGestureRequiredForAudioStart const):
265         (WebCore::BaseAudioContext::pageConsentRequiredForAudioStart const):
266         (isType):
267         * Modules/webaudio/BaseAudioContext.idl: Copied from Source/WebCore/Modules/webaudio/AudioContext.idl.
268         * Modules/webaudio/OfflineAudioContext.cpp:
269         (WebCore::OfflineAudioContext::OfflineAudioContext):
270         * Modules/webaudio/OfflineAudioContext.h:
271         * Modules/webaudio/OfflineAudioContext.idl:
272         * Modules/webaudio/PannerNode.cpp:
273         (WebCore::PannerNode::PannerNode):
274         * Modules/webaudio/PannerNode.h:
275         * Sources.txt:
276         * WebCore.xcodeproj/project.pbxproj:
277         * bindings/js/WebCoreBuiltinNames.h:
278         * dom/EventTargetFactory.in:
279         * testing/Internals.cpp:
280         (WebCore::Internals::setAudioContextRestrictions):
281         * testing/Internals.h:
282         * testing/Internals.idl:
283
284 2020-06-22  Andres Gonzalez  <andresg_22@apple.com>
285
286         AXIsolatedTree::generateSubtree should properly assign the generated subtree to its parent node.
287         https://bugs.webkit.org/show_bug.cgi?id=213435
288
289         Reviewed by Darin Adler.
290
291         AXIsolatedTree::generateSubtree now properly updates the children IDs
292         of the parent node of the subtree being generated.
293
294         * accessibility/AXObjectCache.cpp:
295         (WebCore::AXObjectCache::generateIsolatedTree):
296         * accessibility/isolatedtree/AXIsolatedTree.cpp:
297         (WebCore::AXIsolatedTree::updateChildrenIDs):
298         (WebCore::AXIsolatedTree::generateSubtree): Takes the parent object
299         instead of the parent ID. This allows to retrieve the children IDs of
300         the parent object.
301         (WebCore::AXIsolatedTree::createSubtree):
302         (WebCore::AXIsolatedTree::updateSubtree):
303         (WebCore::AXIsolatedTree::updateChildren):
304         (WebCore::AXIsolatedTree::setRootNode):
305         (WebCore::AXIsolatedTree::removeSubtree):
306         (WebCore::AXIsolatedTree::appendNodeChanges): R-value parameter instead
307         of by reference.
308         * accessibility/isolatedtree/AXIsolatedTree.h:
309
310 2020-06-22  Tim Horton  <timothy_horton@apple.com>
311
312         Update macOS version macros
313         https://bugs.webkit.org/show_bug.cgi?id=213484
314
315         Reviewed by Alexey Proskuryakov.
316
317         * Configurations/Base.xcconfig:
318         * Configurations/DebugRelease.xcconfig:
319         * Configurations/Version.xcconfig:
320         * Configurations/WebKitTargetConditionals.xcconfig:
321
322 2020-06-22  Clark Wang  <clark_wang@apple.com>
323
324         Added getFloatTimeDomainData method to AnalyserNode
325         https://bugs.webkit.org/show_bug.cgi?id=213393
326
327         Reviewed by Chris Dumez.
328
329         Added getFloatTimeDomainData method, as per spec: https://www.w3.org/TR/webaudio/#analysernode.
330         Implementation of RealtimeAnalyser::getFloatTimeDomainData(Float32Array* destinationArray) is based on:
331         https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/webaudio/realtime_analyser.cc.
332         Removed nullable option from some AnalyserNode methods.
333
334         Re-baselined existing tests to show new passing test.
335
336         * Modules/webaudio/AnalyserNode.h:
337         * Modules/webaudio/AnalyserNode.idl:
338         * Modules/webaudio/RealtimeAnalyser.cpp:
339         (WebCore::RealtimeAnalyser::getFloatFrequencyData):
340         (WebCore::RealtimeAnalyser::getByteFrequencyData):
341         (WebCore::RealtimeAnalyser::getFloatTimeDomainData):
342         (WebCore::RealtimeAnalyser::getByteTimeDomainData):
343         * Modules/webaudio/RealtimeAnalyser.h:
344
345 2020-06-22  Rob Buis  <rbuis@igalia.com>
346
347         Add referrerpolicy attribute support for <link>
348         https://bugs.webkit.org/show_bug.cgi?id=213342
349
350         Reviewed by Darin Adler.
351
352         Add support for referrerpolicy attribute handling on
353         link prefetch/preload/stylesheet.
354
355         Tests: http/tests/security/referrer-policy-attribute-style-no-referrer.html
356                http/wpt/preload/refferer-policy.html
357
358         * html/HTMLLinkElement.cpp:
359         (WebCore::HTMLLinkElement::process):
360         (WebCore::HTMLLinkElement::setReferrerPolicyForBindings):
361         (WebCore::HTMLLinkElement::referrerPolicyForBindings const):
362         (WebCore::HTMLLinkElement::referrerPolicy const):
363         * html/HTMLLinkElement.h:
364         * html/parser/HTMLPreloadScanner.cpp:
365         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
366         * html/parser/HTMLResourcePreloader.cpp:
367         (WebCore::PreloadRequest::resourceRequest):
368         * loader/LinkLoader.cpp:
369         (WebCore::LinkLoader::loadLinksFromHeader):
370         (WebCore::LinkLoader::preloadIfNeeded):
371         (WebCore::LinkLoader::prefetchIfNeeded):
372         * loader/LinkLoader.h:
373
374 2020-06-22  Simon Fraser  <simon.fraser@apple.com>
375
376         Fix build error with release build and "#define LOG_DISABLED 0"
377         https://bugs.webkit.org/show_bug.cgi?id=213420
378
379         Reviewed by Sam Weinig.
380
381         AnimationBase::updateStateMachine() uses LOG_ERROR so needs to test ERROR_DISABLED not LOG_DISABLED.
382
383         * page/animation/AnimationBase.cpp:
384         (WebCore::AnimationBase::updateStateMachine):
385
386 2020-06-22  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
387
388         Fix the case of "null type Blob slice" in wpt/FileAPI/blob/Blob-slice.html
389         https://bugs.webkit.org/show_bug.cgi?id=213370
390
391         Reviewed by Darin Adler.
392
393         * fileapi/Blob.h:
394         (WebCore::Blob::slice const):
395         Remove unnecessary default arguments
396         These default arguments are introduced in r83873
397         but we don't need them because WebIDL binding handles them.
398
399         * fileapi/Blob.idl:
400         - Update the definition of `Blob.slice()` to match the latest spec.
401           https://w3c.github.io/FileAPI/#blob-section
402
403         - We should use empty string as a default value by step 4-a of
404           https://w3c.github.io/FileAPI/#dfn-slice
405
406         - In the previous code, we use `optional DOMString?` for the
407           _contentType_ arguments for `Blob.slice()`.
408           Then, our codegen generates a code which uses `convert<IDLNullable<IDLDOMString>>`
409           and it returns `String()` if the JS value is `null`.
410           This caused the failure case in this change.
411
412
413 2020-06-22  Andres Gonzalez  <andresg_22@apple.com>
414
415         Code cleanup in WebAccessibilityObjectWrapper updateObjectBackingStore and position.
416         https://bugs.webkit.org/show_bug.cgi?id=213438
417
418         Reviewed by Darin Adler.
419
420         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
421         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
422         Removed unnecessary call to axBackingObject.
423
424         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
425         (-[WebAccessibilityObjectWrapper position]):
426         Check for isIsolatedTreeEnabled instead of for the request thread,
427         since isolated tree mode = 1 runs on the main thread.
428
429 2020-06-22  Youenn Fablet  <youenn@apple.com>
430
431         [WebRTC] Add support for freeze/pause receiver stats
432         https://bugs.webkit.org/show_bug.cgi?id=212938
433         <rdar://problem/64141493>
434
435         Reviewed by Eric Carlson.
436
437         Covered by updated tests.
438
439         Receiver stats are useful to check for freezes.
440         Let's introduce it in 'track' stats for now, we will later on move all
441         'receiver' stats to its own object once we fully align with spec.
442
443         * Modules/mediastream/RTCStatsReport.h:
444         * Modules/mediastream/RTCStatsReport.idl:
445         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
446         (WebCore::fillRTCMediaStreamTrackStats):
447
448 2020-06-22  Rob Buis  <rbuis@igalia.com>
449
450         Image `crossorigin` mutations should be considered "relevant mutations"
451         https://bugs.webkit.org/show_bug.cgi?id=213335
452
453         Reviewed by Darin Adler.
454
455         As follow up to r263345, this check is not needed after all since the for loop
456         already does the same check.
457
458         * html/HTMLImageElement.cpp:
459         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
460
461 2020-06-22  Jason Lawrence  <lawrence.j@apple.com>
462
463         Unreviewed, reverting r263331.
464
465         This commit was causing 50+ iOS debug tests to crash.
466
467         Reverted changeset:
468
469         "Convert DateComponents parsing code to use Optional based
470         return values rather than out-parameters"
471         https://bugs.webkit.org/show_bug.cgi?id=213440
472         https://trac.webkit.org/changeset/263331
473
474 2020-06-10  Sergio Villar Senin  <svillar@igalia.com>
475
476         [WebXR] Add a preliminary implementation of XRWebGLLayer
477         https://bugs.webkit.org/show_bug.cgi?id=213022
478
479         Reviewed by Carlos Garcia Campos.
480
481         Added a preliminary implementation of XRWebGLLayer. It does not have any functionality at the moment so
482         it cannot be used to render WebXR stuff. This patch adds all the machinery required to create and properly
483         initialize the layer according to the spec.
484
485         Two new wpt tests are passing now.
486
487         * Modules/webxr/WebXRSession.h: Expose session mode.
488         * Modules/webxr/WebXRWebGLLayer.cpp:
489         (WebCore::WebXRWebGLLayer::create): Implemented spec for XRWebGLLayer creation.
490         (WebCore::WebXRWebGLLayer::computeNativeWebGLFramebufferResolution): Added with mock implementation.
491         (WebCore::WebXRWebGLLayer::computeRecommendedWebGLFramebufferResolution): Added.
492         (WebCore::WebXRWebGLLayer::WebXRWebGLLayer):
493         (WebCore::WebXRWebGLLayer::framebuffer const): Returned type should be a pointer.
494         (WebCore::WebXRWebGLLayer::framebufferWidth const): Return framebuffer width if available, otherwise return
495         the base context width.
496         (WebCore::WebXRWebGLLayer::framebufferHeight const): Ditto but with heights.
497         (WebCore::WebXRWebGLLayer::getNativeFramebufferScaleFactor): Implemented.
498         * Modules/webxr/WebXRWebGLLayer.h: New methods and type adjustments.
499
500 2020-06-22  Rob Buis  <rbuis@igalia.com>
501
502         Image `crossorigin` mutations should be considered "relevant mutations"
503         https://bugs.webkit.org/show_bug.cgi?id=213335
504
505         Reviewed by Darin Adler.
506
507         Make crossorigin attribute's state changes relevant mutations [1]. This change
508         also fixes several picture related mutations to be relevant [2].
509
510         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
511
512         [1] https://html.spec.whatwg.org/#reacting-to-dom-mutations:attr-img-crossorigin
513         [2] https://html.spec.whatwg.org/#reacting-to-dom-mutations
514
515         * html/HTMLImageElement.cpp:
516         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
517         (WebCore::HTMLImageElement::evaluateDynamicMediaQueryDependencies):
518         (WebCore::HTMLImageElement::selectImageSource):
519         (WebCore::parseCrossoriginState):
520         (WebCore::HTMLImageElement::attributeChanged):
521         (WebCore::HTMLImageElement::parseAttribute):
522         (WebCore::HTMLImageElement::insertedIntoAncestor):
523         (WebCore::HTMLImageElement::removedFromAncestor):
524         * html/HTMLImageElement.h:
525         * html/HTMLPictureElement.cpp:
526         (WebCore::HTMLPictureElement::sourcesChanged):
527         * html/HTMLSourceElement.cpp:
528         (WebCore::HTMLSourceElement::insertedIntoAncestor):
529         (WebCore::HTMLSourceElement::removedFromAncestor):
530         (WebCore::HTMLSourceElement::parseAttribute):
531         * html/HTMLSourceElement.h:
532         * loader/ImageLoader.h:
533
534 2020-06-21  Sam Weinig  <weinig@apple.com>
535
536         Convert much of the SVG string parsing code to use Optional based return values rather than out-parameters
537         https://bugs.webkit.org/show_bug.cgi?id=213416
538
539         Reviewed by Darin Adler.
540
541         Update SVG parsers to use Optional style return programming rather than out parameters.
542         To make things even nicer, SVGPathSource based parsers now have a type per-parse function,
543         which makes working with them much easier. In the future, we should consider exanding these
544         new types to be used by SVGPathConsumer family of classes as well.
545
546         * WebCore.xcodeproj/project.pbxproj:
547         Add SVGPathSegValue.h, which was missing from the Xcode project.
548
549         * svg/SVGAngleValue.cpp:
550         (WebCore::parseAngleType): 
551         (WebCore::SVGAngleValue::setValueAsString):
552         Adopt updated parseNumber() function, and do a drive by removal of an easy to remove
553         upconvertedCharacters.
554  
555         * svg/SVGAnimateMotionElement.cpp:
556         (WebCore::SVGAnimateMotionElement::calculateToAtEndOfDurationValue):
557         (WebCore::SVGAnimateMotionElement::calculateFromAndToValues):
558         (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
559         (WebCore::SVGAnimateMotionElement::calculateDistance):
560         Now uses new parsePoint() function. Using Optional.valueOr() where
561         the old code would have had parsePoint() doing the clearing.
562     
563         * svg/SVGAnimationElement.cpp:
564         (WebCore::parseKeySplines):
565         Now returns an Optional<Vector<UnitBezier>>.
566         (WebCore::SVGAnimationElement::parseAttribute):
567         Now uses new parseKeySplines, and does an explicit clear on parse failure (old code 
568         did it implicitly in the parse function).
569
570         * svg/SVGFEConvolveMatrixElement.cpp:
571         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
572         * svg/SVGFEDiffuseLightingElement.cpp:
573         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
574         * svg/SVGFEDropShadowElement.cpp:
575         (WebCore::SVGFEDropShadowElement::parseAttribute):
576         * svg/SVGFEGaussianBlurElement.cpp:
577         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
578         * svg/SVGFEMorphologyElement.cpp:
579         (WebCore::SVGFEMorphologyElement::parseAttribute):
580         * svg/SVGFESpecularLightingElement.cpp:
581         (WebCore::SVGFESpecularLightingElement::parseAttribute):
582         * svg/SVGFETurbulenceElement.cpp:
583         (WebCore::SVGFETurbulenceElement::parseAttribute):
584         Adopt Optional based parseNumberOptionalNumber.
585
586         * svg/SVGImageElement.cpp:
587         (WebCore::SVGImageElement::parseAttribute):
588         * svg/SVGFEImageElement.cpp:
589         (WebCore::SVGFEImageElement::parseAttribute):
590         Simplify by using the SVGPreserveAspectRatioValue constructor
591         which calls parse. No need for three lines.
592
593         * svg/SVGFitToViewBox.cpp:
594         (WebCore::SVGFitToViewBox::parseAttribute):
595         Adopt new Optional based parseViewBox.
596         Simplify by using the SVGPreserveAspectRatioValue constructor
597         which calls parse. No need for three lines.
598
599         (WebCore::SVGFitToViewBox::parseViewBox):
600         Convert to be Optional based, and adopt new parseNumber functions.
601
602         * svg/SVGFitToViewBox.h:
603         Updated signatures for new Optional based functions.
604
605         * svg/SVGGlyphRefElement.cpp:
606         (WebCore::parseFloat):
607         Adopt Optional based parseNumber.
608         
609         * svg/SVGHKernElement.cpp:
610         (WebCore::SVGHKernElement::buildHorizontalKerningPair const):
611         * svg/SVGHKernElement.h:
612         * svg/SVGVKernElement.cpp:
613         (WebCore::SVGVKernElement::buildVerticalKerningPair const):
614         * svg/SVGVKernElement.h:
615         Convert to be Optional based. Update a few callers to use makeString.
616
617         * svg/SVGToOTFFontConversion.cpp:
618         (WebCore::SVGToOTFFontConverter::addKerningPair const):
619         (WebCore::SVGToOTFFontConverter::appendKERNSubtable):
620         Adopt new Optional based kerning pair builders. Add some moves
621         to avoid some copies.
622
623         * svg/SVGLengthValue.cpp:
624         (WebCore::SVGLengthValue::setValueAsString):
625         Adopt Optional based parseNumber.
626
627         * svg/SVGNumberList.h:
628         (WebCore::SVGNumberList::parse):
629         Adopt Optional based parseNumber.
630
631         * svg/SVGParserUtilities.cpp:
632         (WebCore::genericParseNumber):
633         (WebCore::parseNumber):
634         (WebCore::genericParseArcFlag):
635         (WebCore::parseArcFlag):
636         (WebCore::parseNumberOptionalNumber):
637         (WebCore::parsePoint):
638         (WebCore::parseRect):
639         (WebCore::parseGlyphName):
640         (WebCore::parseUnicodeRange):
641         (WebCore::parseKerningUnicodeString):
642         (WebCore::genericParseFloatPoint):
643         (WebCore::parseFloatPoint):
644         (WebCore::parseSVGNumber): Deleted.
645         (WebCore::parseNumberFromString): Deleted.
646         (WebCore::parseDelimitedString): Deleted.
647         (WebCore::parseFloatPoint2): Deleted.
648         (WebCore::parseFloatPoint3): Deleted.
649         * svg/SVGParserUtilities.h:
650         (WebCore::isSVGSpace):
651         (WebCore::skipOptionalSVGSpaces):
652         (WebCore::skipOptionalSVGSpacesOrDelimiter):
653         - Converts parse* functions to return Optional values rather than using outparameters.
654         - Removes unused parseSVGNumber and parseDelimitedString.
655         - Removes parseFloatPoint2 and parseFloatPoint3. They weren't useful enough to keep around.
656         - Renames parseNumberFromString to parseNumber. The argument is a String, it's clear enough.
657         - Replace boolean skip parameters with new enum SuffixSkippingPolicy.
658         - Make parseFloatPoint have two overloads rather than being templatized to be consistent.
659
660
661         * svg/SVGPathBlender.cpp:
662         (WebCore::pullFromSources):
663         (WebCore::SVGPathBlender::blendMoveToSegment):
664         (WebCore::SVGPathBlender::blendLineToSegment):
665         (WebCore::SVGPathBlender::blendLineToHorizontalSegment):
666         (WebCore::SVGPathBlender::blendLineToVerticalSegment):
667         (WebCore::SVGPathBlender::blendCurveToCubicSegment):
668         (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment):
669         (WebCore::SVGPathBlender::blendCurveToQuadraticSegment):
670         (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment):
671         (WebCore::SVGPathBlender::blendArcToSegment):
672         (WebCore::SVGPathBlender::canBlendPaths):
673         (WebCore::SVGPathBlender::blendAnimatedPath):
674         Update to adopt new SVGPathSource interface. Added pullFromSources helper
675         which substantially simplifies pulling from both the from and to source at
676         the same time and is now possible due to all the SVGPathSource functions
677         returning the segment types rather than taking them as out parameters.
678
679         * svg/SVGPathByteStreamSource.cpp:
680         (WebCore::SVGPathByteStreamSource::nextCommand):
681         (WebCore::SVGPathByteStreamSource::parseSVGSegmentType):
682         (WebCore::SVGPathByteStreamSource::parseMoveToSegment):
683         (WebCore::SVGPathByteStreamSource::parseLineToSegment):
684         (WebCore::SVGPathByteStreamSource::parseLineToHorizontalSegment):
685         (WebCore::SVGPathByteStreamSource::parseLineToVerticalSegment):
686         (WebCore::SVGPathByteStreamSource::parseCurveToCubicSegment):
687         (WebCore::SVGPathByteStreamSource::parseCurveToCubicSmoothSegment):
688         (WebCore::SVGPathByteStreamSource::parseCurveToQuadraticSegment):
689         (WebCore::SVGPathByteStreamSource::parseCurveToQuadraticSmoothSegment):
690         (WebCore::SVGPathByteStreamSource::parseArcToSegment):
691         * svg/SVGPathByteStreamSource.h:
692         Adopt new SVGPathSource interface.
693
694         * svg/SVGPathParser.cpp:
695         (WebCore::SVGPathParser::parseMoveToSegment):
696         (WebCore::SVGPathParser::parseLineToSegment):
697         (WebCore::SVGPathParser::parseLineToHorizontalSegment):
698         (WebCore::SVGPathParser::parseLineToVerticalSegment):
699         (WebCore::SVGPathParser::parseCurveToCubicSegment):
700         (WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
701         (WebCore::SVGPathParser::parseCurveToQuadraticSegment):
702         (WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
703         (WebCore::SVGPathParser::parseArcToSegment):
704         (WebCore::SVGPathParser::parsePathData):
705         Adapt to new SVGPathSource interface. Code reads a bit nicer now
706         that we don't have a ton of local variables in each method. Could
707         be made nicer in the future by adopting Segment types in the path
708         consumer code.
709
710         * svg/SVGPathSegListSource.cpp:
711         (WebCore::SVGPathSegListSource::nextCommand):
712         (WebCore::SVGPathSegListSource::parseSVGSegmentType):
713         (WebCore::SVGPathSegListSource::parseMoveToSegment):
714         (WebCore::SVGPathSegListSource::parseLineToSegment):
715         (WebCore::SVGPathSegListSource::parseLineToHorizontalSegment):
716         (WebCore::SVGPathSegListSource::parseLineToVerticalSegment):
717         (WebCore::SVGPathSegListSource::parseCurveToCubicSegment):
718         (WebCore::SVGPathSegListSource::parseCurveToCubicSmoothSegment):
719         (WebCore::SVGPathSegListSource::parseCurveToQuadraticSegment):
720         (WebCore::SVGPathSegListSource::parseCurveToQuadraticSmoothSegment):
721         (WebCore::SVGPathSegListSource::parseArcToSegment):
722         * svg/SVGPathSegListSource.h:
723         Adopt new SVGPathSource interface.
724
725         * svg/SVGPathSource.h:
726         Update interface to return Optionals, with a specific type for
727         segment kind that be parsed.
728
729         * svg/SVGPathStringSource.cpp:
730         (WebCore::nextCommandHelper):
731         (WebCore::SVGPathStringSource::nextCommand):
732         (WebCore::parseSVGSegmentTypeHelper):
733         (WebCore::SVGPathStringSource::parseSVGSegmentType):
734         (WebCore::SVGPathStringSource::parseMoveToSegment):
735         (WebCore::SVGPathStringSource::parseLineToSegment):
736         (WebCore::SVGPathStringSource::parseLineToHorizontalSegment):
737         (WebCore::SVGPathStringSource::parseLineToVerticalSegment):
738         (WebCore::SVGPathStringSource::parseCurveToCubicSegment):
739         (WebCore::SVGPathStringSource::parseCurveToCubicSmoothSegment):
740         (WebCore::SVGPathStringSource::parseCurveToQuadraticSegment):
741         (WebCore::SVGPathStringSource::parseCurveToQuadraticSmoothSegment):
742         (WebCore::SVGPathStringSource::parseArcToSegment):
743         (WebCore::parseArcToSegmentHelper): Deleted.
744         * svg/SVGPathStringSource.h:
745         Adopt new SVGPathSource interface. Replace out of line helpers (or use of things
746         like parseFloatPoint2) with generic lambda helpers, helping to keep the code more
747         localized.
748     
749         * svg/SVGPointList.h:
750         (WebCore::SVGPointList::parse):
751         Adopt Optional based parseNumber.
752
753         * svg/SVGTransformList.h:
754         * svg/SVGTransformable.cpp:
755         (WebCore::parseTransformParamList):
756         (WebCore::SVGTransformable::parseTransformValue):
757         (WebCore::SVGTransformable::parseAndSkipType):
758         (WebCore::SVGTransformable::parseTransformType):
759         * svg/SVGTransformable.h:
760         Convert parseTransformValue/parseAndSkipType to be Optional based.
761
762         * svg/SVGViewSpec.cpp:
763         (WebCore::SVGViewSpec::parseViewSpec):
764         Adopt Optional based parseViewBox.
765
766         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
767         Adopt Optional based parseNumber.
768
769         * svg/properties/SVGPropertyTraits.h:
770         (WebCore::SVGPropertyTraits<float>::fromString):
771         (WebCore::SVGPropertyTraits<float>::parse):
772         (WebCore::SVGPropertyTraits<FloatPoint>::fromString):
773         (WebCore::SVGPropertyTraits<FloatPoint>::parse):
774         (WebCore::SVGPropertyTraits<FloatRect>::fromString):
775         (WebCore::SVGPropertyTraits<FloatRect>::parse):
776         Adopt Optional based parsers.
777
778 2020-06-21  Sam Weinig  <weinig@apple.com>
779
780         Convert DateComponents parsing code to use Optional based return values rather than out-parameters
781         https://bugs.webkit.org/show_bug.cgi?id=213440
782
783         Reviewed by Darin Adler.
784
785         Rework DateComponents and Date/Time related InputTypes to use Optional based programming
786         for parsing results. Also take the opportunity to remove unicode upconversion from 
787         DateComponent parsing and instead separate UChar and LChar variants via templates. 
788
789         * html/BaseDateAndTimeInputType.cpp:
790         * html/BaseDateAndTimeInputType.h:
791         * html/DateInputType.cpp:
792         * html/DateInputType.h:
793         * html/DateTimeInputType.cpp:
794         * html/DateTimeInputType.h:
795         * html/DateTimeLocalInputType.cpp:
796         * html/DateTimeLocalInputType.h:
797         * html/HTMLInputElement.cpp:
798         * html/HTMLInputElement.h:
799         * html/InputType.cpp:
800         * html/InputType.h:
801         * html/MonthInputType.cpp:
802         * html/MonthInputType.h:
803         * html/TimeInputType.cpp:
804         * html/TimeInputType.h:
805         * html/WeekInputType.cpp:
806         * html/WeekInputType.h:
807             - Removes parseToDateComponentsInternal. No need it and parseToDateComponents.
808             - Makes parseToDateComponents pure virtual. The old code had a default implementations
809               down in InputType, but it had no callers.
810             - Remove iOS vs. non-iOS difference for dateType(). It is now available on InputType
811               on all platforms. 
812             - Make setMillisecondToDateComponents and parseToDateComponents return an Optional.
813         
814         * platform/DateComponents.cpp:
815         * platform/DateComponents.h:
816             - Replace member function based interfaces for parsing/setting explicit time offsets
817               with new factory functions that return Optional<DateComponents>.
818             - These factories are implemented using the existing member functions, which are
819               now private.
820             - Make max/min constants constexpr.
821             - Make parse* member functions templates to allow factory parse functions to
822               call them without upconverting.
823             - Replace header guard with #pragma once.
824
825 2020-06-21  Zalan Bujtas  <zalan@apple.com>
826
827         [LFC] Add basic support for width: fit-content
828         https://bugs.webkit.org/show_bug.cgi?id=213444
829
830         Reviewed by Antti Koivisto.
831
832         At this point this is just a shrink-to-fit sizing (missing the case when the available horizontal space is not specified).
833
834         Test: fast/layoutformattingcontext/fit-content-width-simple.html
835
836         * layout/FormattingContextGeometry.cpp:
837         (WebCore::Layout::FormattingContext::Geometry::computedWidthValue):
838
839 2020-06-21  Jer Noble  <jer.noble@apple.com>
840
841         WebKit fails to leave audio routing arbitration during navigation, closing.
842         https://bugs.webkit.org/show_bug.cgi?id=213426
843         <rdar://problem/64395051>
844
845         Reviewed by Eric Carlson.
846
847         When setting the AudioSession category, make sure to leave routing arbitration before bailing out early. Also,
848         HTMLMediaElement::canProduceAudio() should return `false` when the element's document is suspended or stopped.
849         Otherwise, the AudioSession will continue in the `MediaPlayback` category indefinitely, and routing arbitration
850         will remain active.
851
852         * html/HTMLMediaElement.cpp:
853         (WebCore::HTMLMediaElement::canProduceAudio const):
854         * platform/audio/mac/AudioSessionMac.mm:
855         (WebCore::AudioSession::setCategory):
856
857 2020-06-21  Zalan Bujtas  <zalan@apple.com>
858
859         [LFC][TFC] Add support for percentage min/max-width
860         https://bugs.webkit.org/show_bug.cgi?id=213436
861
862         Reviewed by Antti Koivisto.
863
864         1. The table generates a principal block container box called the table wrapper box that contains the table box itself and any caption boxes.
865         2. The table wrapper box establishes a block formatting context, and the table box establishes a table formatting context.
866         3. The computed values of properties 'position', 'float', 'margin-*', 'top', 'right', 'bottom', and 'left' on
867            the table element are used on the table wrapper box and not the table box; all other values of non-inheritable
868            properties are used on the table box and not the table wrapper box.
869         4. In a block formatting context, each box's left outer edge touches the left edge of the containing block.
870            This is true even in the presence of floats, unless the box establishes a new block formatting context (in which case the
871            box itself may become narrower due to the floats)
872
873         Now consider the following case:
874         <div style="display: block; width: 500px;">
875             <div style="float: left; width: 100px;"></div>
876             <div style="display: table; width: 10%;"></div>
877         </div>
878         1. We create a table wrapper box to wrap the "display: table" block level box (#1).
879         2. The table wrapper box's width property is set to auto (#3).
880         3. Since it establishes a new block formatting context, the available horizontal space gets shrunk by the float (#4)
881         4. The table wrapper box's used width computes to 500px - 100px -> 400px;
882
883         Now we are inside the BFC established by the table wrapper box and try to resolve the table's width -> %10.
884         According to the normal BFC rules, it should compute to 10% of the containing block's logical width: 400px -> 40px.
885         However in practice it computes to 50px (10% of 500px).
886
887         Similar setup with non-table content would resolve the inner block level box's width to 40px;
888         <div style="display: block; width: 500px">
889             <div style="float: left; width: 100px;"></div>
890             <div style="display: block; overflow: hidden;">
891                 <div style="display: block; width: 10%"></div>
892             </div>
893         </div>
894         This needs clarification.
895
896         Test: fast/layoutformattingcontext/float-avoider-available-horizontal-space3.html
897
898         * layout/FormattingContext.h:
899         (WebCore::Layout::FormattingContext::isTableWrapperBlockFormattingContext const):
900         * layout/blockformatting/BlockFormattingContext.cpp:
901         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
902         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
903         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
904         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h:
905
906 2020-06-20  Jer Noble  <jer.noble@apple.com>
907
908         RecoveryOS: PAL::getAVPlayerLayerClass() will crash when AVFoundation is missing
909         https://bugs.webkit.org/show_bug.cgi?id=213437
910         <rdar://problem/64563064>
911
912         Reviewed by Eric Carlson.
913
914         Check PAL::isAVFoundationAvailable() before calling PAL::getAVPlayerLayerClass();
915
916         * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
917         (WebCore::VideoLayerManagerObjC::setVideoLayer):
918         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
919         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
920         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
921         (WebCore::PlatformCALayerCocoa::clone const):
922         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
923
924 2020-06-20  Simon Fraser  <simon.fraser@apple.com>
925
926         Crash under ScrollController::startSnapRubberbandTimer() firing
927         https://bugs.webkit.org/show_bug.cgi?id=213439
928         <rdar://problem/63986013>
929
930         Reviewed by Tim Horton.
931
932         A wholesale destruction of the ScrollingTree (e.g. via ScrollingCoordinatorMac::pageDestroyed()) never
933         ran the code to stop CFRunLoopTimers in ScrollController, which could lead to this crash.
934         Fix by calling removeAllNodes() in ThreadedScrollingTree::invalidate().
935
936         Add an assertion in ScrollController's destructor that stopAllTimers() has been called, and have
937         ScrollAnimator's destructor call stopAllTimers() too.
938
939         * page/scrolling/ScrollingTree.h:
940         * page/scrolling/ThreadedScrollingTree.cpp:
941         (WebCore::ThreadedScrollingTree::invalidate):
942         * platform/ScrollAnimator.cpp:
943         (WebCore::ScrollAnimator::~ScrollAnimator):
944         * platform/cocoa/ScrollController.h:
945         * platform/cocoa/ScrollController.mm:
946         (WebCore::ScrollController::~ScrollController):
947         (WebCore::ScrollController::stopAllTimers):
948
949 2020-06-20  Zalan Bujtas  <zalan@apple.com>
950
951         [LFC][TFC][Quirk] Table height needs quirk handling
952         https://bugs.webkit.org/show_bug.cgi?id=213430
953
954         Reviewed by Antti Koivisto.
955
956         In quirks mode the used table height of an empty table is 0, while in standards mode
957         we take the specified value into account and size the table accordingly.   
958
959         Tests: fast/layoutformattingcontext/empty-table-with-specified-height-quirk-simple.html
960                fast/layoutformattingcontext/empty-table-with-specified-height-standards-simple.html
961
962         * Sources.txt:
963         * WebCore.xcodeproj/project.pbxproj:
964         * layout/FormattingContext.h:
965         * layout/blockformatting/BlockFormattingContext.h:
966         (WebCore::Layout::BlockFormattingContext::Quirks::geometry const):
967         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
968         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
969         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
970         (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
971         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h:
972         (WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::Quirks):
973         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp: Copied from Source/WebCore/layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h.
974         (WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::usedTableHeight const):
975
976 2020-06-19  Chris Dumez  <cdumez@apple.com>
977
978         [Cocoa] Delay issuing ManagedSession & Network Extension sandbox extensions until a load is actually issued
979         https://bugs.webkit.org/show_bug.cgi?id=213414
980         <rdar://problem/64548684>
981
982         Reviewed by Per Arne Vollan.
983
984         setHasConsumedSandboxExtensions() can now get called several times, every time a WebPage is created.
985         Once a sandbox extension has been consumed, there is no going back so return early if the state is
986         already "Consumed".
987
988         * platform/cocoa/NetworkExtensionContentFilter.mm:
989         (WebCore::NetworkExtensionContentFilter::setHasConsumedSandboxExtensions):
990         * platform/cocoa/ParentalControlsContentFilter.mm:
991         (WebCore::ParentalControlsContentFilter::setHasConsumedSandboxExtension):
992
993 2020-06-19  Zalan Bujtas  <zalan@apple.com>
994
995         [AutoSizing] Resolve viewport units against the preferred content size
996         https://bugs.webkit.org/show_bug.cgi?id=213408
997         <rdar://problem/64267539>
998
999         Reviewed by Tim Horton.
1000
1001         Instead of resolving the viewport units against the maximum content size constraints, let's use the preferred content size.
1002         It ensures that content with vw, vh units does not grow beyond the preferred content size.
1003
1004         Test: fast/dynamic/size-to-content-autosize-with-viewport-units.html
1005
1006         * page/FrameView.cpp:
1007         (WebCore::FrameView::performSizeToContentAutoSize):
1008         (WebCore::FrameView::enableAutoSizeMode): Let's "ignore" viewport units during the initial
1009         pass and use the preferred width to finalize the vw vh unit values (we don't really ignore them, but they are resolved against a [ 1, 1 ] viewport).
1010         This approach fails if the main content has 100vw with overflow hidden. Such content would end up with a [ 1, 1 ] size (we might want to detect it 
1011         and resolved the values against the horizontal constraint).
1012         (WebCore::FrameView::overrideViewportWidthForCSSViewportUnits):
1013         (WebCore::FrameView::resetOverriddenViewportWidthForCSSViewportUnits):
1014         * page/FrameView.h:
1015         * testing/Internals.cpp:
1016         (WebCore::Internals::enableSizeToContentAutoSizeMode):
1017         * testing/Internals.h:
1018         * testing/Internals.idl:
1019
1020 2020-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1021
1022         [macOS] Move progress bar painting code off of Carbon API
1023         https://bugs.webkit.org/show_bug.cgi?id=213405
1024         <rdar://problem/63958537>
1025
1026         Reviewed by Tim Horton.
1027
1028         Adopts CoreUI constants and AppKit SPI (`-[NSAppearance _drawInRect:context:options:]`) when painting progress
1029         elements. This is being done in light of recent changes around how `HIThemeDrawTrack` draws progress bars on
1030         recent versions of macOS; it has been recommended to us that we move away from using Carbon, and instead use
1031         AppKit.
1032
1033         * rendering/RenderThemeMac.mm:
1034         (WebCore::RenderThemeMac::paintProgressBar):
1035
1036         The `NSControlSize` to `CUISize` mapping here looks counterintuitive, but matches our current behavior. This is
1037         because `kThemeLargeProgressBar` and `kThemeLargeIndeterminateBar` both map to `kCUISizeRegular`, while
1038         `kThemeMediumIndeterminateBar` and `kThemeMediumProgressBar` map to `kCUISizeSmall`.
1039
1040 2020-06-19  Clark Wang  <clark_wang@apple.com>
1041
1042         Remove setVelocity() from PannerNode
1043         https://bugs.webkit.org/show_bug.cgi?id=213360
1044
1045         Reviewed by Chris Dumez.
1046
1047         Removed setVelocity() and other velocity dependencies, as per spec: https://www.w3.org/TR/webaudio/#pannernode.
1048         Simplified dopplerRate, since sourceVelocity is always zero.
1049
1050         Re-baselined previous test that now passes with velocity removed.
1051
1052         * Modules/webaudio/PannerNode.cpp:
1053         (WebCore::PannerNode::PannerNode):
1054         (WebCore::PannerNode::dopplerRate):
1055         * Modules/webaudio/PannerNode.h:
1056         * Modules/webaudio/PannerNode.idl:
1057
1058 2020-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1059
1060         REGRESSION (r263253): Search field results and cancel buttons have their own focus rings
1061         https://bugs.webkit.org/show_bug.cgi?id=213413
1062         <rdar://problem/64548419>
1063
1064         Reviewed by Tim Horton.
1065
1066         After r263253, `paintCellAndSetFocusedElementNeedsRepaintIfNecessary` is used when painting the buttons in a
1067         search field's shadow root. However, the renderer that is passed in (which is used to determine whether we
1068         should additionally draw focus rings) is the input element's renderer rather than the renderers of the results
1069         and cancel buttons themselves. This means that when the search field is focused, we will draw focus rings around
1070         each of the buttons in the shadow root as well.
1071
1072         Address this by using `box` (the buttons' RenderBoxes) instead.
1073
1074         Test: fast/forms/search-field-buttons-do-not-have-focus-rings.html
1075
1076         * rendering/RenderThemeMac.mm:
1077         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1078         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1079
1080 2020-06-19  Pinki Gyanchandani  <pgyanchandani@apple.com>
1081
1082         Crash in WebCore::Range::borderAndTextRects
1083         https://bugs.webkit.org/show_bug.cgi?id=209379
1084
1085         Reviewed by Darin Adler.
1086
1087         When a parentless node is moved to a new document, then all ranges associated with this node and its children also should
1088         be updated with new document information.
1089
1090         Test woould be submitted later. 
1091
1092         * dom/Document.cpp:
1093         (WebCore::Document::parentlessNodeMoveToNewDocument):
1094         * dom/Document.h:
1095         * dom/Node.cpp:
1096         (WebCore::Node::moveNodeToNewDocument):
1097         * dom/Range.cpp:
1098         (WebCore::Range::parentlessNodeMoveToNewDocumentAffectsRange):
1099         (WebCore::Range::updateRangeForParentlessNodeMoveToNewDocument):
1100         * dom/Range.h:
1101
1102 2020-06-19  Truitt Savell  <tsavell@apple.com>
1103
1104         Unreviewed, reverting r263121.
1105
1106         Broke media/video-fullscreen-only-playback.html on Catalina
1107         Debug
1108
1109         Reverted changeset:
1110
1111         "Don't claim to support fullscreen mode unless
1112         fullScreenEnabled setting is enabled"
1113         https://bugs.webkit.org/show_bug.cgi?id=213142
1114         https://trac.webkit.org/changeset/263121
1115
1116 2020-06-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
1117
1118         [CG] REGRESSION (r256892): Luminance SVG mask is not applied when accelerated drawing is enabled
1119         https://bugs.webkit.org/show_bug.cgi?id=213403
1120         <rdar://problem/64489419>
1121
1122         Reviewed by Simon Fraser.
1123
1124         Test: svg/masking/mask-css-luminance.html
1125
1126         If the ImageBuffer is backed by an IOSurface, its context has to be flushed
1127         out before convertToLuminanceMask() can access its data.
1128
1129         * platform/graphics/ConcreteImageBuffer.h:
1130
1131 2020-06-19  Chris Dumez  <cdumez@apple.com>
1132
1133         Avoid initializing RenderTheme singleton unnecessarily in the UIProcess
1134         https://bugs.webkit.org/show_bug.cgi?id=213406
1135
1136         Reviewed by Per Arne Vollan.
1137
1138         Avoid initializing RenderTheme singleton unnecessarily in the UIProcess. Instead, introduce
1139         a static function to get the focus ring color on iOS.
1140
1141         * rendering/RenderThemeIOS.h:
1142         * rendering/RenderThemeIOS.mm:
1143         (WebCore::RenderThemeIOS::systemFocusRingColor):
1144         (WebCore::RenderThemeIOS::platformFocusRingColor const):
1145
1146 2020-06-19  Andres Gonzalez  <andresg_22@apple.com>
1147
1148         AX: web process crash in AXObjectCache::postNotification.
1149         https://bugs.webkit.org/show_bug.cgi?id=213398
1150
1151         Reviewed by Chris Fleizach.
1152
1153         AXObjectCache was being instantiated on the AX secondary thread.
1154         Therefore the timers for the different delayed notifications where
1155         initialized with the secondary thread. When postNotification was triggered
1156         on the main thread as it should, and the timer was accessed, the timer
1157         would assert/crash for being accessed in a thread different than where
1158         it was created. This change guaranties that AXObjectCache is always
1159         created on the main thread.
1160
1161         * accessibility/AXObjectCache.cpp:
1162         (WebCore::AXObjectCache::enableAccessibility):
1163         (WebCore::AXObjectCache::AXObjectCache):
1164         (WebCore::AXObjectCache::postNotification):
1165
1166 2020-06-19  Chris Dumez  <cdumez@apple.com>
1167
1168         [iOS] RenderThemeIOS::cssValueToSystemColorMap() does an unnecessary linear search under systemColorFromCSSValueID()
1169         https://bugs.webkit.org/show_bug.cgi?id=213396
1170
1171         Reviewed by Timothy Hatcher.
1172
1173         RenderThemeIOS::cssValueToSystemColorMap() does an unnecessary linear search under systemColorFromCSSValueID().
1174         cssValueToSystemColorMap() already has the selector, yet it passes a CSSValueID to systemColorFromCSSValueID() which
1175         then does a linear search to match the CSSValueID to a selector. This was very inefficient / unfortunate.
1176
1177         This patch introduces a systemColorFromCSSValueIDSelector() which takes in a selector instead of a CSSValueID. I have
1178         also moved the constructor of the LocalCurrentTraitCollection variable to the call site so that we don't keep
1179         constructing / destroying it for each loop iteration. The traces show us spending a lot of time in its constructor /
1180         destructor.
1181
1182         * rendering/RenderThemeIOS.mm:
1183         (WebCore::systemColorFromCSSValueIDSelector):
1184         (WebCore::RenderThemeIOS::cssValueToSystemColorMap):
1185
1186 2020-06-19  James Darpinian  <jdarpinian@chromium.org>
1187
1188         [WebGL2] Uniform Buffer Objects
1189         https://bugs.webkit.org/show_bug.cgi?id=209518
1190
1191         Reviewed by Dean Jackson.
1192
1193         All uniform buffer object conformance tests pass.
1194
1195         Implemented Uniform Buffer Object related functions:
1196         bindBufferBase, bindBufferRange, getUniformIndices, getActiveUniforms, getUniformBlockIndex,
1197         getActiveUniformBlockParameter, getActiveUniformBlockName, uniformBlockBinding
1198
1199         Additionally, fixed many tangentially related issues:
1200         getIntegeri_v and getInteger64i_v were not present.
1201         drawArraysInstances and drawElementsInstanced did not work for WebGL 2.
1202         drawRangeElements was not implemented.
1203         WebGLAny did not support Vector<unsigned>, so Uint32Arrays could not be returned from WebGL functions.
1204         The maximum uniform location length was wrong for WebGL 2.
1205         Transform feedback indexed binding points weren't being tracked.
1206         Some functions in ExtensionsGLANGLE didn't call makeContextCurrent.
1207         New WebGL 2 buffer usage types COPY and READ weren't supported in bufferData.
1208         pause/resumeTransformFeedback were unimplemented.
1209         getParameter(READ_BUFFER) was unimplemented.
1210         readBuffer conformance test was incorrect.
1211
1212         * bindings/js/JSDOMConvertWebGL.cpp:
1213         (WebCore::convertToJSValue):
1214         * html/canvas/WebGL2RenderingContext.cpp:
1215         (WebCore::WebGL2RenderingContext::~WebGL2RenderingContext):
1216         (WebCore::WebGL2RenderingContext::initializeNewContext):
1217         (WebCore::WebGL2RenderingContext::drawRangeElements):
1218         (WebCore::WebGL2RenderingContext::setIndexedBufferBinding):
1219         (WebCore::WebGL2RenderingContext::bindBufferBase):
1220         (WebCore::WebGL2RenderingContext::bindBufferRange):
1221         (WebCore::WebGL2RenderingContext::getIndexedParameter):
1222         (WebCore::WebGL2RenderingContext::getUniformIndices):
1223         (WebCore::WebGL2RenderingContext::getActiveUniforms):
1224         (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
1225         (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
1226         (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
1227         (WebCore::WebGL2RenderingContext::uniformBlockBinding):
1228         * html/canvas/WebGL2RenderingContext.h:
1229         * html/canvas/WebGLAny.h:
1230         * html/canvas/WebGLRenderingContextBase.cpp:
1231         (WebCore::WebGLRenderingContextBase::validateLocationLength):
1232         (WebCore::WebGLRenderingContextBase::validateBufferDataParameters):
1233         * loader/SubresourceLoader.cpp:
1234         (WebCore::SubresourceLoader::didFinishLoading):
1235         * platform/graphics/GraphicsContextGL.h:
1236         * platform/graphics/angle/ExtensionsGLANGLE.cpp:
1237         (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE):
1238         (WebCore::ExtensionsGLANGLE::blitFramebuffer):
1239         (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisample):
1240         (WebCore::ExtensionsGLANGLE::drawBuffersEXT):
1241         (WebCore::ExtensionsGLANGLE::getBooleanvRobustANGLE):
1242         (WebCore::ExtensionsGLANGLE::getBufferParameterivRobustANGLE):
1243         (WebCore::ExtensionsGLANGLE::getFloatvRobustANGLE):
1244         (WebCore::ExtensionsGLANGLE::getFramebufferAttachmentParameterivRobustANGLE):
1245         (WebCore::ExtensionsGLANGLE::getIntegervRobustANGLE):
1246         (WebCore::ExtensionsGLANGLE::getProgramivRobustANGLE):
1247         (WebCore::ExtensionsGLANGLE::getRenderbufferParameterivRobustANGLE):
1248         (WebCore::ExtensionsGLANGLE::getShaderivRobustANGLE):
1249         (WebCore::ExtensionsGLANGLE::getTexParameterfvRobustANGLE):
1250         (WebCore::ExtensionsGLANGLE::getTexParameterivRobustANGLE):
1251         (WebCore::ExtensionsGLANGLE::getUniformfvRobustANGLE):
1252         (WebCore::ExtensionsGLANGLE::getUniformivRobustANGLE):
1253         (WebCore::ExtensionsGLANGLE::getVertexAttribfvRobustANGLE):
1254         (WebCore::ExtensionsGLANGLE::getVertexAttribivRobustANGLE):
1255         (WebCore::ExtensionsGLANGLE::getVertexAttribPointervRobustANGLE):
1256         (WebCore::ExtensionsGLANGLE::readPixelsRobustANGLE):
1257         (WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE):
1258         (WebCore::ExtensionsGLANGLE::texParameterfvRobustANGLE):
1259         (WebCore::ExtensionsGLANGLE::texParameterivRobustANGLE):
1260         (WebCore::ExtensionsGLANGLE::texSubImage2DRobustANGLE):
1261         (WebCore::ExtensionsGLANGLE::compressedTexImage2DRobustANGLE):
1262         (WebCore::ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE):
1263         (WebCore::ExtensionsGLANGLE::compressedTexImage3DRobustANGLE):
1264         (WebCore::ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE):
1265         (WebCore::ExtensionsGLANGLE::texImage3DRobustANGLE):
1266         (WebCore::ExtensionsGLANGLE::texSubImage3DRobustANGLE):
1267         (WebCore::ExtensionsGLANGLE::getQueryivRobustANGLE):
1268         (WebCore::ExtensionsGLANGLE::getQueryObjectuivRobustANGLE):
1269         (WebCore::ExtensionsGLANGLE::getBufferPointervRobustANGLE):
1270         (WebCore::ExtensionsGLANGLE::getIntegeri_vRobustANGLE):
1271         (WebCore::ExtensionsGLANGLE::getInternalformativRobustANGLE):
1272         (WebCore::ExtensionsGLANGLE::getVertexAttribIivRobustANGLE):
1273         (WebCore::ExtensionsGLANGLE::getVertexAttribIuivRobustANGLE):
1274         (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE):
1275         (WebCore::ExtensionsGLANGLE::getActiveUniformBlockivRobustANGLE):
1276         (WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE):
1277         (WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE):
1278         (WebCore::ExtensionsGLANGLE::getBufferParameteri64vRobustANGLE):
1279         (WebCore::ExtensionsGLANGLE::samplerParameterivRobustANGLE):
1280         (WebCore::ExtensionsGLANGLE::samplerParameterfvRobustANGLE):
1281         (WebCore::ExtensionsGLANGLE::getSamplerParameterivRobustANGLE):
1282         (WebCore::ExtensionsGLANGLE::getSamplerParameterfvRobustANGLE):
1283         (WebCore::ExtensionsGLANGLE::getFramebufferParameterivRobustANGLE):
1284         (WebCore::ExtensionsGLANGLE::getProgramInterfaceivRobustANGLE):
1285         (WebCore::ExtensionsGLANGLE::getBooleani_vRobustANGLE):
1286         (WebCore::ExtensionsGLANGLE::getMultisamplefvRobustANGLE):
1287         (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE):
1288         (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE):
1289         (WebCore::ExtensionsGLANGLE::getPointervRobustANGLERobustANGLE):
1290         (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE):
1291         (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE):
1292         (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE):
1293         (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE):
1294         (WebCore::ExtensionsGLANGLE::texParameterIivRobustANGLE):
1295         (WebCore::ExtensionsGLANGLE::texParameterIuivRobustANGLE):
1296         (WebCore::ExtensionsGLANGLE::getTexParameterIivRobustANGLE):
1297         (WebCore::ExtensionsGLANGLE::getTexParameterIuivRobustANGLE):
1298         (WebCore::ExtensionsGLANGLE::samplerParameterIivRobustANGLE):
1299         (WebCore::ExtensionsGLANGLE::samplerParameterIuivRobustANGLE):
1300         (WebCore::ExtensionsGLANGLE::getSamplerParameterIivRobustANGLE):
1301         (WebCore::ExtensionsGLANGLE::getSamplerParameterIuivRobustANGLE):
1302         (WebCore::ExtensionsGLANGLE::getQueryObjectivRobustANGLE):
1303         (WebCore::ExtensionsGLANGLE::getQueryObjecti64vRobustANGLE):
1304         (WebCore::ExtensionsGLANGLE::getQueryObjectui64vRobustANGLE):
1305         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
1306         (WebCore::GraphicsContextGLOpenGL::getIntegeri_v):
1307         (WebCore::GraphicsContextGLOpenGL::getInteger64v):
1308         (WebCore::GraphicsContextGLOpenGL::getInteger64i_v):
1309         (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced):
1310         (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced):
1311         (WebCore::GraphicsContextGLOpenGL::getUniformBlockIndex):
1312         (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockiv):
1313         (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName):
1314         (WebCore::GraphicsContextGLOpenGL::uniformBlockBinding):
1315         (WebCore::GraphicsContextGLOpenGL::drawRangeElements):
1316         (WebCore::GraphicsContextGLOpenGL::pauseTransformFeedback):
1317         (WebCore::GraphicsContextGLOpenGL::resumeTransformFeedback):
1318         (WebCore::GraphicsContextGLOpenGL::bindBufferRange):
1319         (WebCore::GraphicsContextGLOpenGL::getUniformIndices):
1320         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
1321         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
1322         (WebCore::GraphicsContextGLOpenGL::getIntegeri_v):
1323         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
1324         (WebCore::GraphicsContextGLOpenGL::getInteger64v):
1325         (WebCore::GraphicsContextGLOpenGL::getInteger64i_v):
1326
1327 2020-06-19  Chris Dumez  <cdumez@apple.com>
1328
1329         [iOS] Drop std::call_once() from RenderThemeIOS::cssValueToSystemColorMap()
1330         https://bugs.webkit.org/show_bug.cgi?id=213392
1331
1332         Reviewed by Geoffrey Garen.
1333
1334         Drop std::call_once() from RenderThemeIOS::cssValueToSystemColorMap() since this function
1335         is always called from the main thread.
1336
1337         * rendering/RenderThemeIOS.mm:
1338         (WebCore::RenderThemeIOS::cssValueToSystemColorMap):
1339
1340 2020-06-19  Rob Buis  <rbuis@igalia.com>
1341
1342         Enable referrer policy attribute support by default
1343         https://bugs.webkit.org/show_bug.cgi?id=213285
1344
1345         Reviewed by Youenn Fablet.
1346
1347         Enable referrer policy attribute support by default by flipping the switch.
1348
1349         * page/RuntimeEnabledFeatures.h:
1350
1351 2020-06-19  Chris Dumez  <cdumez@apple.com>
1352
1353         Move Prefixed WebAudio interfaces behind their own feature flag
1354         https://bugs.webkit.org/show_bug.cgi?id=213356
1355
1356         Reviewed by Darin Adler.
1357
1358         Move Prefixed WebAudio interfaces behind their own feature flag, on by default. This will
1359         allow us to easily disable the prefixed API and will also allow it to live independently
1360         from the unprefixed API.
1361
1362         * Modules/webaudio/AudioContext.idl:
1363         * Modules/webaudio/WebKitAudioContext.idl:
1364         * Modules/webaudio/WebKitAudioPannerNode.idl:
1365         * Modules/webaudio/WebKitOfflineAudioContext.idl:
1366         * bindings/js/WebCoreBuiltinNames.h:
1367         * page/Settings.yaml:
1368
1369 2020-06-19  Zalan Bujtas  <zalan@apple.com>
1370
1371         [LFC][TFC] Do not special-case empty tables
1372         https://bugs.webkit.org/show_bug.cgi?id=213378
1373
1374         Reviewed by Antti Koivisto.
1375
1376         Now that min/max-width support is added, empty tables can just go through the normal width computation path. 
1377
1378         Test: fast/layoutformattingcontext/table-min-max-width-empty-content-simple.html
1379
1380         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
1381         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
1382
1383 2020-06-10  Sergio Villar Senin  <svillar@igalia.com>
1384
1385         REGRESSION(r262254?): [WPE] imported/w3c/web-platform-tests/webxr/idlharness.https.window.html is failing
1386         https://bugs.webkit.org/show_bug.cgi?id=212897
1387
1388         Reviewed by Youenn Fablet.
1389
1390         WPT tests were updated in r262254 and they already include the latest changes in the specs. Among others the
1391         XR interface was renamed to XRSystem. We were already using that name in the C++ code but not in the JS interface.
1392         The WPT update brings in another set of changes like the new XRLayer which is already not supported (I am
1393         adding it soon in another patch). Last but not least, the new tests include checks for the XRPermissionStatus interface
1394         which is not going to be implemented soon as it requires the Permission API which is not supported in WebKit yet. All in
1395         all, this patch renames XR to XRSystem and marks as failing the XRLayer (temporarily) and XRPermissionStatus checks.
1396
1397         No new tests as there is no change in functionality.
1398
1399         * Modules/webxr/WebXRSystem.idl: Rename XR to XRSystem.
1400         * bindings/js/WebCoreBuiltinNames.h: Ditto.
1401
1402 2020-06-19  Zalan Bujtas  <zalan@apple.com>
1403
1404         [LFC][BFC] Min/max-width should always be resolved against the containing block width
1405         https://bugs.webkit.org/show_bug.cgi?id=213365
1406
1407         Reviewed by Antti Koivisto.
1408
1409         Even when neighboring floats shrink the available horizontal space, the min/max(normal) widths should
1410         be resolved against the containing block's logical width.
1411
1412         Test: fast/layoutformattingcontext/float-avoider-available-horizontal-space2.html
1413
1414         * layout/blockformatting/BlockFormattingContext.cpp:
1415         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1416         * layout/blockformatting/BlockFormattingContext.h:
1417         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1418         (WebCore::Layout::BlockFormattingContext::Geometry::computedWidthAndMargin):
1419         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
1420         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
1421
1422 2020-06-10  Sergio Villar Senin  <svillar@igalia.com>
1423
1424         [WebXR] unsigned long in IDL should be translated as unsigned in C++ code
1425         https://bugs.webkit.org/show_bug.cgi?id=213020
1426
1427         Reviewed by Darin Adler.
1428
1429         The "unsigned long" type definition in IDL must be translated to unsigned in C++ code.
1430
1431         I'm also replacing the very long XRFrameRequestCallback::Identifier by simply unsigned as it
1432         isn't adding anything.
1433
1434         No new test required as there is no change in functionality, just removing an alias.
1435
1436         * Modules/webxr/WebXRSession.cpp:
1437         (WebCore::WebXRSession::requestAnimationFrame):
1438         (WebCore::WebXRSession::cancelAnimationFrame):
1439         * Modules/webxr/WebXRSession.h:
1440         * Modules/webxr/XRFrameRequestCallback.h:
1441         (WebCore::XRFrameRequestCallback::callbackId):
1442         (WebCore::XRFrameRequestCallback::setCallbackId):
1443
1444 2020-06-19  Myles C. Maxfield  <mmaxfield@apple.com>
1445
1446         [Cocoa] Unify "font:" CSS shorthand values between macOS and iOS family
1447         https://bugs.webkit.org/show_bug.cgi?id=213332
1448         <rdar://problem/64479189>
1449
1450         Reviewed by Tim Horton and Darin Adler.
1451
1452         They exist on all Cocoa platforms, so we might as well hook them up.
1453
1454         This unifies the shorthand CSS value handling from RenderThemeMac and
1455         RenderThemeIOS into RenderThemeCocoa. This has two effects:
1456
1457         - It hooks up the -apple-system keywords on macOS (they previously were
1458           only implemented for the iOS family).
1459         - It hooks up the CSS2 keywords (caption, menu, etc.) on the iOS family
1460           (they previously were only implemented on Mac).
1461
1462         All these fonts have been around since Mojave, so there is no need to
1463         introduce any new platform guards.
1464
1465         Tests: fast/text/text-styles/-apple-system/-apple-system-body.html
1466                fast/text/text-styles/-apple-system/-apple-system-caption1.html
1467                fast/text/text-styles/-apple-system/-apple-system-caption2.html
1468                fast/text/text-styles/-apple-system/-apple-system-footnote.html
1469                fast/text/text-styles/-apple-system/-apple-system-headline.html
1470                fast/text/text-styles/-apple-system/-apple-system-short-body.html
1471                fast/text/text-styles/-apple-system/-apple-system-short-caption1.html
1472                fast/text/text-styles/-apple-system/-apple-system-short-footnote.html
1473                fast/text/text-styles/-apple-system/-apple-system-short-headline.html
1474                fast/text/text-styles/-apple-system/-apple-system-short-subheadline.html
1475                fast/text/text-styles/-apple-system/-apple-system-subheadline.html
1476                fast/text/text-styles/-apple-system/-apple-system-tall-body.html
1477                fast/text/text-styles/-apple-system/-apple-system-title0.html
1478                fast/text/text-styles/-apple-system/-apple-system-title1.html
1479                fast/text/text-styles/-apple-system/-apple-system-title2.html
1480                fast/text/text-styles/-apple-system/-apple-system-title3.html
1481                fast/text/text-styles/-apple-system/-apple-system-title4.html
1482                fast/text/text-styles/-webkit-control.html
1483                fast/text/text-styles/-webkit-mini-control.html
1484                fast/text/text-styles/-webkit-small-control.html
1485                fast/text/text-styles/bogus.html
1486                fast/text/text-styles/caption.html
1487                fast/text/text-styles/icon.html
1488                fast/text/text-styles/menu.html
1489                fast/text/text-styles/message-box.html
1490                fast/text/text-styles/small-caption.html
1491                fast/text/text-styles/status-bar.html
1492
1493         * css/CSSValueKeywords.in: All Cocoa ports should be able to parse these values
1494         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1495         (WebCore::fontWithFamilySpecialCase): Move code that used to be in the Mac and
1496         iOS implementations of platformFontWithFamilySpecialCase() (inside FontCacheMac.mm
1497         and FontCacheIOS.mm) to be shared to be shared inside fontWithFamilySpecialCase().
1498         * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Remove platform guards.
1499         (WebCore::convertArray):
1500         (WebCore::matchSystemFontUse):
1501         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Ditto.
1502         (WebCore::SystemFontDatabaseCoreText::createTextStyleFont):
1503         * platform/graphics/ios/FontCacheIOS.mm: Move code from here into FontCacheCoreText.
1504         (WebCore::platformFontWithFamilySpecialCase):
1505         * platform/graphics/mac/FontCacheMac.mm: Ditto.
1506         (WebCore::platformFontWithFamilySpecialCase):
1507         * platform/mac/ThemeMac.h: Delete systemFontSizeFor(NSControlSize) because
1508         <rdar://problem/60350699> is fixed.
1509         * platform/mac/ThemeMac.mm: Ditto.
1510         (WebCore::ThemeMac::controlFont const):
1511         (WebCore::ThemeMac::systemFontSizeFor): Deleted.
1512         * rendering/RenderThemeCocoa.h: Previously, code was calling
1513         RenderThemeIOS::contentSizeCategory(), which was a static function. Now, both Mac
1514         and iOS need to be able to call this. However, the implementation of this function
1515         is different between Mac and iOS. So, turn it from a static function in RenderThemeIOS
1516         into a method in RenderThemeCocoa, and give RenderThemeCocoa a singleton() function
1517         that downcasts the return of RenderTheme::singleton(). This way, instead of calling
1518         RenderThemeIOS::contentSizeCategory(), code can call
1519         RenderThemeCocoa::singleton().contentSizeCategory().
1520         * rendering/RenderThemeCocoa.mm: Move code from RenderThemeIOS and RenderThemeMac
1521         into RenderThemeCocoa.
1522         (WebCore::RenderThemeCocoa::singleton):
1523         (WebCore::RenderThemeCocoa::cachedSystemFontDescription const):
1524         (WebCore::cssWeightOfSystemFont):
1525         (WebCore::RenderThemeCocoa::updateCachedSystemFontDescription const):
1526         * rendering/RenderThemeIOS.h: Ditto.
1527         * rendering/RenderThemeIOS.mm: Ditto.
1528         (WebCore::RenderThemeIOS::contentSizeCategory const):
1529         (WebCore::attachmentActionFont):
1530         (WebCore::attachmentTitleFont):
1531         (WebCore::RenderThemeIOS::contentSizeCategory): Deleted.
1532         (WebCore::RenderThemeIOS::cachedSystemFontDescription const): Deleted.
1533         (WebCore::cssWeightOfSystemFont): Deleted.
1534         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription const): Deleted.
1535         * rendering/RenderThemeMac.h: Ditto.
1536         * rendering/RenderThemeMac.mm: Ditto.
1537         (WebCore::RenderThemeMac::contentSizeCategory const):
1538         (WebCore::RenderThemeMac::setFontFromControlSize const):
1539         (WebCore::RenderThemeMac::controlSizeForSystemFont const):
1540         (WebCore::toFontWeight): Deleted.
1541         (WebCore::RenderThemeMac::updateCachedSystemFontDescription const): Deleted.
1542
1543 2020-06-18  Doug Kelly  <dougk@apple.com>
1544
1545         Use paintCellAndSetFocusedElementNeedsRepaintIfNecessary() for search field buttons
1546         https://bugs.webkit.org/show_bug.cgi?id=213352
1547         <rdar://problem/57129008>
1548
1549         Reviewed by Simon Fraser.
1550
1551         The search fields cancel and results buttons should use the common
1552         paintCellAndSetFocusedElementNeedsRepaintIfNecessary() function instead of directly painting the cell.
1553         This allows for an image buffer to be used for drawing specifically in cases when it becomes needed,
1554         when a scale (either via zoom or CSS transform) is applied.
1555
1556         This also moves the logic for determining if an image buffer should be used into
1557         ThemeMac::drawCellOrFocusRingWithViewIntoContext(), which uses the current user-defined CTM
1558         (inverting the base CTM to negate the effect of a device-specific scale factor).  This also negates
1559         the need for the page scale factor and the effective zoom applied to the renderer style, since it is
1560         computed into the CTM already.
1561
1562         * platform/mac/ThemeMac.h:
1563         * platform/mac/ThemeMac.mm:
1564         (WebCore::paintToggleButton):
1565         (WebCore::paintButton):
1566         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1567         (WebCore::paintColorWell):
1568         (WebCore::ThemeMac::paint):
1569         * rendering/RenderThemeMac.mm:
1570         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
1571         (WebCore::RenderThemeMac::paintSliderThumb):
1572         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1573         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1574
1575 2020-06-18  Devin Rousso  <drousso@apple.com>
1576
1577         Web Inspector: ASSERTION FAILED: decodedLength >= dataLength at WebCore::NetworkResourcesData::ResourceData::decodeDataToContent()
1578         https://bugs.webkit.org/show_bug.cgi?id=213271
1579         <rdar://problem/64168350>
1580
1581         Reviewed by Brian Burg.
1582
1583         Remove the invalid `ASSERT(decodedLength >= dataLength)` as it's very possible for decoded
1584         content to be smaller than encoded content (e.g. something gzipped).
1585
1586         Use `String::sizeInBytes` instead of `StringImpl::sizeInBytes` as the latter also includes
1587         `sizeof(*this)`, which is not really part of the resource's size, as it's really more of an
1588         implementation detail.
1589
1590         * inspector/NetworkResourcesData.h:
1591         * inspector/NetworkResourcesData.cpp:
1592         (WebCore::NetworkResourcesData::ResourceData::removeContent):
1593         (WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
1594         (WebCore::NetworkResourcesData::setResourceContent):
1595         (WebCore::NetworkResourcesData::maybeDecodeDataToContent):
1596         (WebCore::contentSizeInBytes): Deleted.
1597
1598 2020-06-18  Andy Estes  <aestes@apple.com>
1599
1600         [Apple Pay] Fix a log message typo in PaymentCoordinator::didAuthorizePayment
1601
1602         Rubber-stamped by Beth Dakin.
1603
1604         * Modules/applepay/PaymentCoordinator.cpp:
1605         (WebCore::PaymentCoordinator::didAuthorizePayment): Logged the correct function name.
1606
1607 2020-06-18  Zalan Bujtas  <zalan@apple.com>
1608
1609         [LFC][BFC] Available space computation for the float avoider needs coordinate mapping
1610         https://bugs.webkit.org/show_bug.cgi?id=213339
1611
1612         Reviewed by Antti Koivisto.
1613
1614         The FloatConstraints position values are in formatting root coordinates but the available space
1615         requires containing block coordinates.
1616
1617         Test: fast/layoutformattingcontext/float-avoider-available-horizontal-space.html
1618
1619         * layout/blockformatting/BlockFormattingContext.cpp:
1620         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider):
1621
1622 2020-06-18  Stephan Szabo  <stephan.szabo@sony.com>
1623
1624         [PlayStation] Build fix for errors with structured bindings to const structure
1625         https://bugs.webkit.org/show_bug.cgi?id=213323
1626
1627         Reviewed by Fujii Hironori.
1628
1629         Our system seems to have trouble with these structured bindings,
1630         similar to what was previously seen for clang-cl.
1631
1632         No new tests, build fix.
1633
1634         * inspector/agents/InspectorNetworkAgent.cpp:
1635
1636 2020-06-18  Youenn Fablet  <youenn@apple.com>
1637
1638         REGRESSION (r263098): [Win10] http/tests/security/cross-origin-clean-css-resource-timing.html and http/tests/security/cross-origin-css-resource-timing.html are failing
1639         https://bugs.webkit.org/show_bug.cgi?id=213303
1640         <rdar://problem/64452203>
1641
1642         Reviewed by Alex Christensen.
1643
1644         Covered by existing tests.
1645
1646         * loader/ResourceLoaderOptions.h:
1647         Reverting part of https://trac.webkit.org/changeset/263098/webkit that might have broken win10 bots.
1648
1649 2020-06-18  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1650
1651         [GStreamer] Avoid setting GstContext twice in GLVideoSinkGStreamer
1652         https://bugs.webkit.org/show_bug.cgi?id=213029
1653
1654         Reviewed by Xabier Rodriguez-Calvar.
1655
1656         There is a reported issued in GStrearGL < 1.17 for GLBaseFilter
1657         can't handle its GLContext and Display reassignation. This patch
1658         aims to to avoid setting Display or GL Context in GL video sink
1659         multiple times by checking if the video sink bin already has those
1660         contexts.
1661
1662         Also, instead of relying on an assert if something goes wrong at
1663         fetching the GL parameters, it returns an error at state change.
1664
1665         No new tests required.
1666
1667         * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
1668         (requestGLContext):
1669         (setGLContext): new function.
1670         (webKitGLVideoSinkChangeState):
1671
1672 2020-06-18  Doug Kelly  <dougk@apple.com>
1673
1674         Clamp text run width to zero
1675         https://bugs.webkit.org/show_bug.cgi?id=212655
1676         <rdar://problem/61462335>
1677
1678         Reviewed by Said Abou-Hallawa.
1679
1680         It's possible to end up with a text run with negative width, if the text run is relatively short
1681         and the character spacing is relatively large (but negative).  If this occurs, clamp the value to
1682         zero.  This also adds additional asserts and checks to ensure the value remains non-negative.
1683
1684         * platform/graphics/cg/GraphicsContextCG.cpp:
1685         (WebCore::GraphicsContext::drawLinesForText):
1686         * rendering/ComplexLineLayout.cpp:
1687         (WebCore::setLogicalWidthForTextRun):
1688         * rendering/RenderText.cpp:
1689         (WebCore::RenderText::width const):
1690
1691 2020-06-18  David Kilzer  <ddkilzer@apple.com>
1692
1693         Fix misspellings of "namespace" in comments
1694
1695         * page/SpatialNavigation.h:
1696         * platform/gtk/RenderThemeScrollbar.cpp:
1697
1698 2020-06-18  David Kilzer  <ddkilzer@apple.com>
1699
1700         [IPC hardening] OptionSet<> values should be validated
1701         <https://webkit.org/b/213199>
1702         <rdar://problem/64369963>
1703
1704         Reviewed by Anders Carlsson.
1705
1706         Summary:
1707         - Add WTF::EnumTraits<> for all OptionSet<> enums.
1708         - Specify unsigned backing types for enum classes.
1709
1710         * loader/CrossOriginAccessControl.h:
1711         * page/ActivityState.h:
1712         * page/AutoplayEvent.h:
1713         * page/CrossSiteNavigationDataTransfer.h:
1714         * page/LayoutMilestone.h:
1715         * page/TextIndicator.h:
1716         * platform/PlatformEvent.h:
1717         * platform/graphics/GraphicsContext.h:
1718
1719 2020-06-17  Clark Wang  <clark_wang@apple.com>
1720
1721         Added missing orientation attributes to PannerNode
1722         https://bugs.webkit.org/show_bug.cgi?id=213301
1723
1724         Reviewed by Chris Dumez.
1725
1726         Implemented orientation attributes in PannerNode interface, as per spec: https://www.w3.org/TR/webaudio/#pannernode.
1727         Added FIXME comments for removing velocity later.
1728
1729         Re-baselined previous tests that now have passing test cases.
1730
1731         * Modules/webaudio/PannerNode.cpp:
1732         (WebCore::PannerNode::PannerNode):
1733         (WebCore::PannerNode::orientation const):
1734         (WebCore::PannerNode::setOrientation):
1735         (WebCore::PannerNode::distanceConeGain):
1736         * Modules/webaudio/PannerNode.h:
1737         * Modules/webaudio/PannerNode.idl:
1738
1739 2020-06-17  Chris Dumez  <cdumez@apple.com>
1740
1741         Add experimental feature flag for modern & unprefixed WebAudio API
1742         https://bugs.webkit.org/show_bug.cgi?id=213268
1743
1744         Reviewed by Jer Noble.
1745
1746         Add experimental feature flag for modern & unprefixed WebAudio API,
1747         off by default.
1748
1749         This patch split the AudioContext, OfflineAudioContext and PannerNode
1750         IDL interfaces into their prefixed and unprefixed versions. The
1751         unprefixed versions are behind the new experimental feature flag that
1752         is currently off by default but automatically gets turned on in the
1753         context of layout tests.
1754
1755         This will give us more flexibility when working on the modern and
1756         unprefixed WebAudio API as we will not have to worry about backward
1757         compatibility. This also allows us to easily turn it on or off via
1758         the experimental features menu in Safari.
1759
1760         No new tests, rebaselined existing tests.
1761
1762         * CMakeLists.txt:
1763         * DerivedSources-input.xcfilelist:
1764         * DerivedSources-output.xcfilelist:
1765         * DerivedSources.make:
1766         * Modules/webaudio/AnalyserNode.cpp:
1767         (WebCore::AnalyserNode::AnalyserNode):
1768         * Modules/webaudio/AnalyserNode.h:
1769         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1770         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
1771         * Modules/webaudio/AudioBasicInspectorNode.h:
1772         * Modules/webaudio/AudioBasicProcessorNode.cpp:
1773         (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode):
1774         * Modules/webaudio/AudioBasicProcessorNode.h:
1775         * Modules/webaudio/AudioBufferSourceNode.cpp:
1776         (WebCore::AudioBufferSourceNode::create):
1777         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode):
1778         (WebCore::AudioBufferSourceNode::setBuffer):
1779         (WebCore::AudioBufferSourceNode::setPannerNode):
1780         * Modules/webaudio/AudioBufferSourceNode.h:
1781         * Modules/webaudio/AudioContext.cpp:
1782         (WebCore::AudioContextBase::AudioContextBase):
1783         (WebCore::AudioContext::AudioContext):
1784         (WebCore::AudioContextBase::document const):
1785         (WebCore::AudioContextBase::scriptExecutionContext const):
1786         * Modules/webaudio/AudioContext.h:
1787         (WebCore::AudioContextBase::AutoLocker::AutoLocker):
1788         (WebCore::AudioContextBase::AutoLocker::~AutoLocker):
1789         (WebCore::AudioContext::maxNumberOfChannels):
1790         (isType):
1791         * Modules/webaudio/AudioContext.idl:
1792         * Modules/webaudio/AudioContextState.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl.
1793         * Modules/webaudio/AudioContextState.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl.
1794         * Modules/webaudio/AudioDestinationNode.cpp:
1795         (WebCore::AudioDestinationNode::AudioDestinationNode):
1796         * Modules/webaudio/AudioDestinationNode.h:
1797         * Modules/webaudio/AudioNode.cpp:
1798         (WebCore::AudioNode::AudioNode):
1799         (WebCore::AudioNode::connect):
1800         (WebCore::AudioNode::disconnect):
1801         (WebCore::AudioNode::setChannelCount):
1802         (WebCore::AudioNode::setChannelCountMode):
1803         (WebCore::AudioNode::setChannelInterpretation):
1804         (WebCore::AudioNode::enableOutputsIfNecessary):
1805         (WebCore::AudioNode::deref):
1806         (WebCore::AudioNode::contextForBindings const):
1807         * Modules/webaudio/AudioNode.h:
1808         (WebCore::AudioNode::context):
1809         (WebCore::AudioNode::context const):
1810         * Modules/webaudio/AudioNode.idl:
1811         * Modules/webaudio/AudioNodeOutput.h:
1812         (WebCore::AudioNodeOutput::context):
1813         * Modules/webaudio/AudioParam.cpp:
1814         (WebCore::AudioParam::AudioParam):
1815         * Modules/webaudio/AudioParam.h:
1816         * Modules/webaudio/AudioParamTimeline.cpp:
1817         (WebCore::AudioParamTimeline::valueForContextTime):
1818         * Modules/webaudio/AudioParamTimeline.h:
1819         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1820         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
1821         * Modules/webaudio/AudioScheduledSourceNode.h:
1822         * Modules/webaudio/AudioSummingJunction.cpp:
1823         (WebCore::AudioSummingJunction::AudioSummingJunction):
1824         * Modules/webaudio/AudioSummingJunction.h:
1825         (WebCore::AudioSummingJunction::context):
1826         * Modules/webaudio/BiquadFilterNode.cpp:
1827         (WebCore::BiquadFilterNode::BiquadFilterNode):
1828         * Modules/webaudio/BiquadFilterNode.h:
1829         * Modules/webaudio/BiquadProcessor.cpp:
1830         (WebCore::BiquadProcessor::BiquadProcessor):
1831         * Modules/webaudio/BiquadProcessor.h:
1832         * Modules/webaudio/ChannelMergerNode.cpp:
1833         (WebCore::ChannelMergerNode::create):
1834         (WebCore::ChannelMergerNode::ChannelMergerNode):
1835         * Modules/webaudio/ChannelMergerNode.h:
1836         * Modules/webaudio/ChannelSplitterNode.cpp:
1837         (WebCore::ChannelSplitterNode::create):
1838         (WebCore::ChannelSplitterNode::ChannelSplitterNode):
1839         * Modules/webaudio/ChannelSplitterNode.h:
1840         * Modules/webaudio/ConvolverNode.cpp:
1841         (WebCore::ConvolverNode::ConvolverNode):
1842         * Modules/webaudio/ConvolverNode.h:
1843         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1844         (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode):
1845         * Modules/webaudio/DefaultAudioDestinationNode.h:
1846         * Modules/webaudio/DelayNode.cpp:
1847         (WebCore::DelayNode::DelayNode):
1848         (WebCore::DelayNode::create):
1849         * Modules/webaudio/DelayNode.h:
1850         * Modules/webaudio/DelayProcessor.cpp:
1851         (WebCore::DelayProcessor::DelayProcessor):
1852         * Modules/webaudio/DelayProcessor.h:
1853         * Modules/webaudio/DistanceModelType.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl.
1854         * Modules/webaudio/DistanceModelType.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl.
1855         * Modules/webaudio/DynamicsCompressorNode.cpp:
1856         (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
1857         * Modules/webaudio/DynamicsCompressorNode.h:
1858         * Modules/webaudio/GainNode.cpp:
1859         (WebCore::GainNode::GainNode):
1860         * Modules/webaudio/GainNode.h:
1861         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1862         (WebCore::MediaElementAudioSourceNode::create):
1863         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
1864         (WebCore::MediaElementAudioSourceNode::setFormat):
1865         * Modules/webaudio/MediaElementAudioSourceNode.h:
1866         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1867         (WebCore::MediaStreamAudioDestinationNode::create):
1868         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
1869         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
1870         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1871         (WebCore::MediaStreamAudioSourceNode::create):
1872         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
1873         * Modules/webaudio/MediaStreamAudioSourceNode.h:
1874         * Modules/webaudio/OfflineAudioContext.idl:
1875         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1876         (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode):
1877         * Modules/webaudio/OfflineAudioDestinationNode.h:
1878         * Modules/webaudio/OscillatorNode.cpp:
1879         (WebCore::OscillatorNode::create):
1880         (WebCore::OscillatorNode::OscillatorNode):
1881         * Modules/webaudio/OscillatorNode.h:
1882         * Modules/webaudio/PannerNode.cpp:
1883         (WebCore::PannerNodeBase::PannerNodeBase):
1884         (WebCore::PannerNode::PannerNode):
1885         * Modules/webaudio/PannerNode.h:
1886         * Modules/webaudio/PannerNode.idl:
1887         * Modules/webaudio/PanningModelType.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl.
1888         * Modules/webaudio/PanningModelType.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl.
1889         * Modules/webaudio/ScriptProcessorNode.cpp:
1890         (WebCore::ScriptProcessorNode::create):
1891         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
1892         * Modules/webaudio/ScriptProcessorNode.h:
1893         * Modules/webaudio/WaveShaperNode.cpp:
1894         (WebCore::WaveShaperNode::WaveShaperNode):
1895         * Modules/webaudio/WaveShaperNode.h:
1896         * Modules/webaudio/WebKitAudioContext.cpp: Copied from Source/WebCore/Modules/webaudio/AudioContext.cpp.
1897         (WebCore::WebKitAudioContext::isSampleRateRangeGood):
1898         (WebCore::WebKitAudioContext::create):
1899         (WebCore::WebKitAudioContext::WebKitAudioContext):
1900         (WebCore::WebKitAudioContext::constructCommon):
1901         (WebCore::WebKitAudioContext::~WebKitAudioContext):
1902         (WebCore::WebKitAudioContext::lazyInitialize):
1903         (WebCore::WebKitAudioContext::clear):
1904         (WebCore::WebKitAudioContext::uninitialize):
1905         (WebCore::WebKitAudioContext::isInitialized const):
1906         (WebCore::WebKitAudioContext::addReaction):
1907         (WebCore::WebKitAudioContext::setState):
1908         (WebCore::WebKitAudioContext::stop):
1909         (WebCore::WebKitAudioContext::suspend):
1910         (WebCore::WebKitAudioContext::resume):
1911         (WebCore::WebKitAudioContext::activeDOMObjectName const):
1912         (WebCore::WebKitAudioContext::hostingDocumentIdentifier const):
1913         (WebCore::WebKitAudioContext::isSuspended const):
1914         (WebCore::WebKitAudioContext::visibilityStateChanged):
1915         (WebCore::WebKitAudioContext::wouldTaintOrigin const):
1916         (WebCore::WebKitAudioContext::createBuffer):
1917         (WebCore::WebKitAudioContext::decodeAudioData):
1918         (WebCore::WebKitAudioContext::createBufferSource):
1919         (WebCore::WebKitAudioContext::createMediaElementSource):
1920         (WebCore::WebKitAudioContext::createMediaStreamSource):
1921         (WebCore::WebKitAudioContext::createMediaStreamDestination):
1922         (WebCore::WebKitAudioContext::createScriptProcessor):
1923         (WebCore::WebKitAudioContext::createBiquadFilter):
1924         (WebCore::WebKitAudioContext::createWaveShaper):
1925         (WebCore::WebKitAudioContext::createPanner):
1926         (WebCore::WebKitAudioContext::createConvolver):
1927         (WebCore::WebKitAudioContext::createDynamicsCompressor):
1928         (WebCore::WebKitAudioContext::createAnalyser):
1929         (WebCore::WebKitAudioContext::createGain):
1930         (WebCore::WebKitAudioContext::createDelay):
1931         (WebCore::WebKitAudioContext::createChannelSplitter):
1932         (WebCore::WebKitAudioContext::createChannelMerger):
1933         (WebCore::WebKitAudioContext::createOscillator):
1934         (WebCore::WebKitAudioContext::createPeriodicWave):
1935         (WebCore::WebKitAudioContext::notifyNodeFinishedProcessing):
1936         (WebCore::WebKitAudioContext::derefFinishedSourceNodes):
1937         (WebCore::WebKitAudioContext::refNode):
1938         (WebCore::WebKitAudioContext::derefNode):
1939         (WebCore::WebKitAudioContext::derefUnfinishedSourceNodes):
1940         (WebCore::WebKitAudioContext::lock):
1941         (WebCore::WebKitAudioContext::tryLock):
1942         (WebCore::WebKitAudioContext::unlock):
1943         (WebCore::WebKitAudioContext::isAudioThread const):
1944         (WebCore::WebKitAudioContext::isGraphOwner const):
1945         (WebCore::WebKitAudioContext::addDeferredFinishDeref):
1946         (WebCore::WebKitAudioContext::handlePreRenderTasks):
1947         (WebCore::WebKitAudioContext::handlePostRenderTasks):
1948         (WebCore::WebKitAudioContext::handleDeferredFinishDerefs):
1949         (WebCore::WebKitAudioContext::markForDeletion):
1950         (WebCore::WebKitAudioContext::scheduleNodeDeletion):
1951         (WebCore::WebKitAudioContext::deleteMarkedNodes):
1952         (WebCore::WebKitAudioContext::markSummingJunctionDirty):
1953         (WebCore::WebKitAudioContext::removeMarkedSummingJunction):
1954         (WebCore::WebKitAudioContext::markAudioNodeOutputDirty):
1955         (WebCore::WebKitAudioContext::handleDirtyAudioSummingJunctions):
1956         (WebCore::WebKitAudioContext::handleDirtyAudioNodeOutputs):
1957         (WebCore::WebKitAudioContext::addAutomaticPullNode):
1958         (WebCore::WebKitAudioContext::removeAutomaticPullNode):
1959         (WebCore::WebKitAudioContext::updateAutomaticPullNodes):
1960         (WebCore::WebKitAudioContext::processAutomaticPullNodes):
1961         (WebCore::WebKitAudioContext::nodeWillBeginPlayback):
1962         (WebCore::shouldDocumentAllowWebAudioToAutoPlay):
1963         (WebCore::WebKitAudioContext::willBeginPlayback):
1964         (WebCore::WebKitAudioContext::willPausePlayback):
1965         (WebCore::WebKitAudioContext::startRendering):
1966         (WebCore::WebKitAudioContext::mediaCanStart):
1967         (WebCore::WebKitAudioContext::mediaState const):
1968         (WebCore::WebKitAudioContext::pageMutedStateDidChange):
1969         (WebCore::WebKitAudioContext::isPlayingAudioDidChange):
1970         (WebCore::WebKitAudioContext::finishedRendering):
1971         (WebCore::WebKitAudioContext::dispatchEvent):
1972         (WebCore::WebKitAudioContext::incrementActiveSourceCount):
1973         (WebCore::WebKitAudioContext::decrementActiveSourceCount):
1974         (WebCore::WebKitAudioContext::suspendRendering):
1975         (WebCore::WebKitAudioContext::resumeRendering):
1976         (WebCore::WebKitAudioContext::close):
1977         (WebCore::WebKitAudioContext::suspendPlayback):
1978         (WebCore::WebKitAudioContext::mayResumePlayback):
1979         (WebCore::WebKitAudioContext::postTask):
1980         (WebCore::WebKitAudioContext::origin const):
1981         (WebCore::WebKitAudioContext::addConsoleMessage):
1982         (WebCore::WebKitAudioContext::clearPendingActivity):
1983         (WebCore::WebKitAudioContext::makePendingActivity):
1984         (WebCore::WebKitAudioContext::logChannel const):
1985         * Modules/webaudio/WebKitAudioContext.h: Copied from Source/WebCore/Modules/webaudio/AudioContext.h.
1986         (WebCore::WebKitAudioContext::destination):
1987         (WebCore::WebKitAudioContext::activeSourceCount const):
1988         (WebCore::WebKitAudioContext::listener):
1989         (WebCore::WebKitAudioContext::isClosed const):
1990         (WebCore::WebKitAudioContext::connectionCount const):
1991         (WebCore::WebKitAudioContext::audioThread const):
1992         (WebCore::WebKitAudioContext::maxNumberOfChannels):
1993         (WebCore::WebKitAudioContext::userGestureRequiredForAudioStart const):
1994         (WebCore::WebKitAudioContext::pageConsentRequiredForAudioStart const):
1995         (WebCore::WebKitAudioContext::state const):
1996         (isType):
1997         * Modules/webaudio/WebKitAudioContext.idl: Copied from Source/WebCore/Modules/webaudio/AudioContext.idl.
1998         * Modules/webaudio/WebKitAudioPannerNode.cpp: Copied from Source/WebCore/Modules/webaudio/PannerNode.cpp.
1999         (WebCore::fixNANs):
2000         (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode):
2001         (WebCore::WebKitAudioPannerNode::~WebKitAudioPannerNode):
2002         (WebCore::WebKitAudioPannerNode::pullInputs):
2003         (WebCore::WebKitAudioPannerNode::process):
2004         (WebCore::WebKitAudioPannerNode::reset):
2005         (WebCore::WebKitAudioPannerNode::initialize):
2006         (WebCore::WebKitAudioPannerNode::uninitialize):
2007         (WebCore::WebKitAudioPannerNode::listener):
2008         (WebCore::WebKitAudioPannerNode::setPanningModel):
2009         (WebCore::WebKitAudioPannerNode::distanceModel const):
2010         (WebCore::WebKitAudioPannerNode::setDistanceModel):
2011         (WebCore::WebKitAudioPannerNode::getAzimuthElevation):
2012         (WebCore::WebKitAudioPannerNode::dopplerRate):
2013         (WebCore::WebKitAudioPannerNode::distanceConeGain):
2014         (WebCore::WebKitAudioPannerNode::notifyAudioSourcesConnectedToNode):
2015         * Modules/webaudio/WebKitAudioPannerNode.h: Copied from Source/WebCore/Modules/webaudio/PannerNode.h.
2016         * Modules/webaudio/WebKitAudioPannerNode.idl: Copied from Source/WebCore/Modules/webaudio/PannerNode.idl.
2017         * Modules/webaudio/WebKitOfflineAudioContext.cpp: Copied from Source/WebCore/Modules/webaudio/DelayNode.cpp.
2018         (WebCore::WebKitOfflineAudioContext::WebKitOfflineAudioContext):
2019         (WebCore::WebKitOfflineAudioContext::create):
2020         * Modules/webaudio/WebKitOfflineAudioContext.h: Copied from Source/WebCore/Modules/webaudio/DelayNode.h.
2021         * Modules/webaudio/WebKitOfflineAudioContext.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl.
2022         * Sources.txt:
2023         * WebCore.xcodeproj/project.pbxproj:
2024         * bindings/js/WebCoreBuiltinNames.h:
2025         * dom/EventTargetFactory.in:
2026         * page/Settings.yaml:
2027         * testing/Internals.cpp:
2028         (WebCore::Internals::setAudioContextRestrictions):
2029         * testing/Internals.h:
2030         * testing/Internals.idl:
2031
2032 2020-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2033
2034         [macOS] Shift-tab in a bullet list in Mail Compose jumps back to Subject field
2035         https://bugs.webkit.org/show_bug.cgi?id=213320
2036         <rdar://problem/63831962>
2037
2038         Reviewed by Tim Horton.
2039
2040         After the changes in r262051, pressing shift-tab in a bulleted list in Mail compose on macOS no longer triggers
2041         an outdent command. This is because the default behavior of the "keydown" event will now relinquish focus to the
2042         embedding client (i.e. the "chrome"). In this case, Mail makes the Subject field above the compose web view the
2043         first responder.
2044
2045         This is necessary on iOS, where Mail does not attempt to intercept shift+tab and move focus to the subject line.
2046         However, Mail on macOS intercepts the keypress event, and either triggers outdent (if the selection is inside a
2047         list or blockquote) or focuses the Subject line. Since focus is relinquished during "keydown", this logic no
2048         longer runs, and hitting shift+tab in a list always relinquishes focus.
2049
2050         To address this, refactor the changes made in r262051 so that we treat the default behavior of the "keypress"
2051         event (rather than "keydown") as relinquishing focus. See WebKit/ChangeLog for more details.
2052
2053         Test: WebKit.ShiftTabDoesNotTakeFocusFromEditableWebViewWhenPreventingKeyPress
2054
2055         * page/EventHandler.cpp:
2056         (WebCore::EventHandler::defaultTabEventHandler):
2057
2058         Remove a call to relinquish focus when handling tab.
2059
2060         * page/FocusController.h:
2061
2062 2020-06-16  Antoine Quint  <graouts@webkit.org>
2063
2064         quikr.com: unable to select item from dropdown
2065         https://bugs.webkit.org/show_bug.cgi?id=213260
2066         <rdar://problem/58106011>
2067
2068         Reviewed by Zalan Bujtas.
2069
2070         Only account for box-shadow when computing the background rect if the clipping element itself has non-zero used width and height.
2071
2072         Tests: fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-height-clipping-container.html
2073                fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-width-clipping-container.html
2074                fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container.html
2075                fast/box-shadow/hit-test-box-shadow-on-zero-width-clipping-container.html
2076
2077         * rendering/RenderBox.cpp:
2078         (WebCore::RenderBox::addVisualEffectOverflow):
2079
2080 2020-06-17  David Kilzer  <ddkilzer@apple.com>
2081
2082         Replace OptionSetTraits/OptionSetValues with EnumTraits/EnumValues
2083         <https://webkit.org/b/213264>
2084
2085         Reviewed by Brent Fulgham.
2086
2087         * page/DragActions.h:
2088         (EnumTraits<WebCore::DragDestinationAction>):
2089         - Rename from OptionSetTraits<WebCore::DragDestinationAction>.
2090         (OptionSetTraits<WebCore::DragOperation>):
2091         (OptionSetTraits<WebCore::DragSourceAction>):
2092         - Remove since EnumTraits<> already exist for both.
2093
2094 2020-06-17  Geoffrey Garen  <ggaren@apple.com>
2095
2096         media/remoteplayback-target-availability.html was a flaky failure after r262904
2097         https://bugs.webkit.org/show_bug.cgi?id=213294
2098
2099         Reviewed by Sam Weinig.
2100
2101         AirPlay availability is a global that depends on a timer (and/or an
2102         external piece of hardware). Therefore, the first value RemotePlayback
2103         sees for AirPlay availability, while usually 'unavailable', is sometimes
2104         'available'. Flaky!
2105
2106         In this case, media/remoteplayback-prompt.html triggered an AirPlay
2107         availability check, and then media/remoteplayback-target-availability.html,
2108         if run in the same process, sometimes saw 'available' as its initial
2109         availability state.
2110
2111         Make RemotePlayback's initial availability state deterministic by
2112         recording availability state at the time we enqueue our task, rather
2113         than at the time we dequeue our task. (By specification and
2114         implementation, RemotePlayback's initial availability state is always
2115         'unavailable', regardless of AirPlay state.) This is OK to do because,
2116         if the state ever changes after we enqueue our task, we'll get an update
2117         notification and enqueue a new task.
2118
2119         * Modules/remoteplayback/RemotePlayback.cpp:
2120         (WebCore::RemotePlayback::watchAvailability): Copy the availability
2121         state when we enqueue our task, and do not update it when we dequeue our
2122         task. This is the heart of the bug fix.
2123
2124         Make sure to manually update availability state when we first register
2125         to monitor availability, since we never got an update notification for
2126         the current state.
2127
2128         (WebCore::RemotePlayback::prompt): For consistency with
2129         watchAvailability, do not update availability state when we dequeue our
2130         task. (This means that prompting before watching availability is always
2131         an error, which is fine, and consistent with the spec, which says, "If
2132         the user agent stops monitoring the list of available remote playback
2133         devices... It SHOULD also set the availability value for all media
2134         elements to false.")
2135
2136         Make sure to manually update availability state when we first register
2137         to monitor availability, since we never got an update notification for
2138         the current state.
2139
2140         (WebCore::RemotePlayback::availabilityChanged): For consistency with
2141         watchAvailability, do not update availability state when we dequeue our
2142         task.
2143
2144         (WebCore::RemotePlayback::updateAvailability): Deleted. We never
2145         synchronously update our state anymore. All state changes are queued and
2146         processed in order.
2147         * Modules/remoteplayback/RemotePlayback.h:
2148
2149 2020-06-17  Rob Buis  <rbuis@igalia.com>
2150
2151         Image `referrerpolicy` mutations should be considered "relevant mutations"
2152         https://bugs.webkit.org/show_bug.cgi?id=209970
2153
2154         Reviewed by Youenn Fablet.
2155
2156         Make referrerpolicy state changes a relevant mutation [1]. In order to indicate
2157         that we are dealing with a relevant mutation add an enum to updateFromElement, in
2158         order to run "update the image data" algorithm [2] in case it is a relevant mutation.
2159
2160         Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html
2161                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-referrerpolicy-change.sub.html
2162
2163         [1] https://html.spec.whatwg.org/#reacting-to-dom-mutations:attr-img-referrerpolicy
2164         [2] https://html.spec.whatwg.org/#when-to-obtain-images
2165
2166         * html/HTMLImageElement.cpp:
2167         (WebCore::HTMLImageElement::attributeChanged):
2168         * html/HTMLImageElement.h:
2169         * loader/ImageLoader.cpp:
2170         (WebCore::ImageLoader::updateFromElement):
2171         (WebCore::ImageLoader::updateFromElementIgnoringPreviousError):
2172         (WebCore::ImageLoader::loadDeferredImage):
2173         * loader/ImageLoader.h:
2174
2175 2020-06-17  Chris Dumez  <cdumez@apple.com>
2176
2177         Unreviewed attempt to fix internal macOS build after r263157.
2178
2179         * rendering/RenderThemeMac.mm:
2180
2181 2020-06-17  Sam Weinig  <weinig@apple.com>
2182
2183         Use constructor operations in WebIDL
2184         https://bugs.webkit.org/show_bug.cgi?id=201397
2185
2186         Reviewed by Eric Carlson.
2187         
2188         Add support for constructor syntax in WebIDL (https://heycam.github.io/webidl/#idl-constructors)
2189         
2190         - [Constructor(...)] extended attributes become constructor(...) operations
2191         - [JSBuiltinConstructor] becomes [JSBuiltin] constructor(...)
2192         - [CustomConstructor] becomes [Custom] constructor(...)
2193         - [ConstructorMayThrowException] becomes [MayThrowException] constructor(...) and can 
2194           now be unique per-overload
2195         - [ConstructorCallWith=Foo] becomes [CallWith=Foo] constructor(...) and can now also be
2196           unique per-overload
2197           
2198         This change leaves NamedConstructor as is, but a subsequent change will replace it with the
2199         specified LegacyFactoryFunction extended attribute. 
2200
2201         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
2202         * Modules/applepay/ApplePayError.idl:
2203         * Modules/applepay/ApplePaySession.idl:
2204         * Modules/applepay/ApplePaySetup.idl:
2205         * Modules/async-clipboard/ClipboardItem.idl:
2206         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
2207         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
2208         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
2209         * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
2210         * Modules/fetch/FetchHeaders.idl:
2211         * Modules/fetch/FetchRequest.idl:
2212         * Modules/fetch/FetchResponse.idl:
2213         * Modules/gamepad/GamepadEvent.idl:
2214         * Modules/highlight/HighlightMap.idl:
2215         * Modules/highlight/HighlightRangeGroup.idl:
2216         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2217         * Modules/mediarecorder/BlobEvent.idl:
2218         * Modules/mediarecorder/MediaRecorder.idl:
2219         * Modules/mediarecorder/MediaRecorderErrorEvent.idl:
2220         * Modules/mediasession/MediaRemoteControls.idl:
2221         * Modules/mediasession/MediaSession.idl:
2222         * Modules/mediasource/MediaSource.idl:
2223         * Modules/mediastream/MediaStream.idl:
2224         * Modules/mediastream/MediaStreamTrackEvent.idl:
2225         * Modules/mediastream/OverconstrainedError.idl:
2226         * Modules/mediastream/OverconstrainedErrorEvent.idl:
2227         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
2228         * Modules/mediastream/RTCDataChannelEvent.idl:
2229         * Modules/mediastream/RTCIceCandidate.idl:
2230         * Modules/mediastream/RTCPeerConnection.idl:
2231         * Modules/mediastream/RTCPeerConnectionIceEvent.idl:
2232         * Modules/mediastream/RTCSessionDescription.idl:
2233         * Modules/mediastream/RTCTrackEvent.idl:
2234         * Modules/notifications/Notification.idl:
2235         * Modules/paymentrequest/MerchantValidationEvent.idl:
2236         * Modules/paymentrequest/PaymentMethodChangeEvent.idl:
2237         * Modules/paymentrequest/PaymentRequest.idl:
2238         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
2239         * Modules/pictureinpicture/EnterPictureInPictureEvent.idl:
2240         * Modules/speech/SpeechSynthesisUtterance.idl:
2241         * Modules/streams/ByteLengthQueuingStrategy.idl:
2242         * Modules/streams/CountQueuingStrategy.idl:
2243         * Modules/streams/ReadableByteStreamController.idl:
2244         * Modules/streams/ReadableStream.idl:
2245         * Modules/streams/ReadableStreamBYOBReader.idl:
2246         * Modules/streams/ReadableStreamBYOBRequest.idl:
2247         * Modules/streams/ReadableStreamDefaultController.idl:
2248         * Modules/streams/ReadableStreamDefaultReader.idl:
2249         * Modules/streams/WritableStream.idl:
2250         * Modules/webaudio/AudioContext.idl:
2251         * Modules/webaudio/OfflineAudioContext.idl:
2252         * Modules/webgpu/GPUOutOfMemoryError.idl:
2253         * Modules/webgpu/GPUUncapturedErrorEvent.idl:
2254         * Modules/webgpu/GPUValidationError.idl:
2255         * Modules/websockets/CloseEvent.idl:
2256         * Modules/websockets/WebSocket.idl:
2257         * Modules/webxr/WebXRRigidTransform.idl:
2258         * Modules/webxr/WebXRWebGLLayer.idl:
2259         * Modules/webxr/XRInputSourceEvent.idl:
2260         * Modules/webxr/XRInputSourcesChangeEvent.idl:
2261         * Modules/webxr/XRReferenceSpaceEvent.idl:
2262         * Modules/webxr/XRSessionEvent.idl:
2263         * animation/AnimationPlaybackEvent.idl:
2264         * animation/DocumentTimeline.idl:
2265         * animation/KeyframeEffect.idl:
2266         * animation/WebAnimation.idl:
2267         * bindings/scripts/CodeGeneratorJS.pm:
2268         (ShouldGenerateToJSDeclaration):
2269         (GetFullyQualifiedImplementationCallName):
2270         (GenerateParametersCheck):
2271         (GetConstructorTemplateClassName):
2272         (GenerateConstructorDefinition):
2273         (GenerateConstructorHelperMethods):
2274         (HasCustomConstructor):
2275         (IsConstructable):
2276         (HasJSBuiltinConstructor):
2277         (AddJSBuiltinIncludesIfNeeded):
2278         (IsJSBuiltinConstructor): Deleted.
2279         * bindings/scripts/IDLAttributes.json:
2280         * bindings/scripts/IDLParser.pm:
2281         (assertExtendedAttributesValidForContext):
2282         (copyExtendedAttributes):
2283         (cloneOperation):
2284         (applyTypedefs):
2285         (parseInterfaceMember):
2286         (parseConstructor):
2287         (parseExtendedAttributeRest):
2288         (applyMemberList):
2289         (applyExtendedAttributeList):
2290         * bindings/scripts/test/JS/JSTestInterface.cpp:
2291         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2292         (WebCore::JSTestNamedConstructorConstructor::initializeProperties):
2293         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
2294         (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
2295         * bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl:
2296         * bindings/scripts/test/TestEventConstructor.idl:
2297         * bindings/scripts/test/TestInterface.idl:
2298         * bindings/scripts/test/TestJSBuiltinConstructor.idl:
2299         * bindings/scripts/test/TestNamedConstructor.idl:
2300         * bindings/scripts/test/TestNode.idl:
2301         * bindings/scripts/test/TestObj.idl:
2302         * bindings/scripts/test/TestOverloadedConstructors.idl:
2303         * bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl:
2304         * bindings/scripts/test/TestPromiseRejectionEvent.idl:
2305         * bindings/scripts/test/TestTypedefs.idl:
2306         * css/DOMMatrix.idl:
2307         * css/DOMMatrixReadOnly.idl:
2308         * css/FontFace.idl:
2309         * css/FontFaceSet.idl:
2310         * css/MediaQueryListEvent.idl:
2311         * css/WebKitCSSMatrix.idl:
2312         * css/typedom/TypedOMCSSUnitValue.idl:
2313         * css/typedom/TypedOMCSSUnparsedValue.idl:
2314         * dom/AbortController.idl:
2315         * dom/AnimationEvent.idl:
2316         * dom/BeforeLoadEvent.idl:
2317         * dom/ClipboardEvent.idl:
2318         * dom/Comment.idl:
2319         * dom/CompositionEvent.idl:
2320         * dom/CustomEvent.idl:
2321         * dom/DOMException.idl:
2322         * dom/DOMPoint.idl:
2323         * dom/DOMPointReadOnly.idl:
2324         * dom/DOMQuad.idl:
2325         * dom/DOMRect.idl:
2326         * dom/DOMRectReadOnly.idl:
2327         * dom/Document.idl:
2328         * dom/DocumentFragment.idl:
2329         * dom/DragEvent.idl:
2330         * dom/ErrorEvent.idl:
2331         * dom/Event.idl:
2332         * dom/EventTarget.idl:
2333         * dom/FocusEvent.idl:
2334         * dom/HashChangeEvent.idl:
2335         * dom/InputEvent.idl:
2336         * dom/KeyboardEvent.idl:
2337         * dom/MessageChannel.idl:
2338         * dom/MessageEvent.idl:
2339         * dom/MouseEvent.idl:
2340         * dom/MutationObserver.idl:
2341         * dom/OverflowEvent.idl:
2342         * dom/PageTransitionEvent.idl:
2343         * dom/PointerEvent.idl:
2344         * dom/PopStateEvent.idl:
2345         * dom/ProgressEvent.idl:
2346         * dom/PromiseRejectionEvent.idl:
2347         * dom/Range.idl:
2348         * dom/SecurityPolicyViolationEvent.idl:
2349         * dom/StaticRange.idl:
2350         * dom/Text.idl:
2351         * dom/TextDecoder.idl:
2352         * dom/TextEncoder.idl:
2353         * dom/TransitionEvent.idl:
2354         * dom/UIEvent.idl:
2355         * dom/WebKitAnimationEvent.idl:
2356         * dom/WebKitTransitionEvent.idl:
2357         * dom/WheelEvent.idl:
2358         * fileapi/Blob.idl:
2359         * fileapi/File.idl:
2360         * fileapi/FileReader.idl:
2361         * fileapi/FileReaderSync.idl:
2362         * html/DOMFormData.idl:
2363         * html/DOMURL.idl:
2364         * html/HTMLElement.idl:
2365         * html/HTMLOptionElement.idl:
2366         * html/ImageData.idl:
2367         * html/MediaController.idl:
2368         * html/MediaEncryptedEvent.idl:
2369         * html/OffscreenCanvas.idl:
2370         * html/URLSearchParams.idl:
2371         * html/canvas/Path2D.idl:
2372         * html/canvas/WebGLContextEvent.idl:
2373         * html/track/DataCue.idl:
2374         * html/track/TextTrackCue.idl:
2375         * html/track/TrackEvent.idl:
2376         * html/track/VTTCue.idl:
2377         * html/track/VTTRegion.idl:
2378         * page/EventSource.idl:
2379         * page/IntersectionObserver.idl:
2380         * page/IntersectionObserverEntry.idl:
2381         * page/PerformanceObserver.idl:
2382         * page/ResizeObserver.idl:
2383         * page/UndoItem.idl:
2384         * page/WebKitPoint.idl:
2385         * storage/StorageEvent.idl:
2386         * workers/Worker.idl:
2387         * workers/service/ExtendableEvent.idl:
2388         * workers/service/ExtendableMessageEvent.idl:
2389         * workers/service/FetchEvent.idl:
2390         * xml/DOMParser.idl:
2391         * xml/XMLHttpRequest.idl:
2392         * xml/XMLSerializer.idl:
2393         * xml/XPathEvaluator.idl:
2394         * xml/XSLTProcessor.idl:
2395
2396 2020-06-17  Darryl Pogue  <darryl@dpogue.ca>
2397
2398         IndexedDB: Support IDBFactory databases method
2399         https://bugs.webkit.org/show_bug.cgi?id=211043
2400
2401         Reviewed by Youenn Fablet.
2402
2403         Add support for fetching the list of IDB database names and versions
2404         from the IDBServer, and expose the functionality as
2405         `IDBFactory.prototype.databases()`.
2406
2407         Spec: https://w3c.github.io/IndexedDB/#dom-idbfactory-databases
2408
2409         * Headers.cmake:
2410         * Modules/indexeddb/IDBActiveDOMObject.h:
2411         (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread):
2412         * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.cpp: Added.
2413         (WebCore::IDBDatabaseNameAndVersionRequest::create):
2414         (WebCore::IDBDatabaseNameAndVersionRequest::IDBDatabaseNameAndVersionRequest):
2415         (WebCore::IDBDatabaseNameAndVersionRequest::~IDBDatabaseNameAndVersionRequest):
2416         (WebCore::IDBDatabaseNameAndVersionRequest::complete):
2417         (WebCore::IDBDatabaseNameAndVersionRequest::activeDOMObjectName const):
2418         (WebCore::IDBDatabaseNameAndVersionRequest::virtualHasPendingActivity const):
2419         (WebCore::IDBDatabaseNameAndVersionRequest::stop):
2420         * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.h: Added.
2421         * Modules/indexeddb/IDBFactory.cpp:
2422         (WebCore::IDBFactory::databases):
2423         (WebCore::IDBFactory::getAllDatabaseNames):
2424         * Modules/indexeddb/IDBFactory.h:
2425         * Modules/indexeddb/IDBFactory.idl:
2426         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2427         (WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost):
2428         (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNamesAndVersions):
2429         (WebCore::IDBClient::IDBConnectionProxy::didGetAllDatabaseNamesAndVersions):
2430         (WebCore::IDBClient::IDBConnectionProxy::forgetActivityForCurrentThread):
2431         (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames): Deleted.
2432         * Modules/indexeddb/client/IDBConnectionProxy.h:
2433         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2434         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNamesAndVersions):
2435         (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNamesAndVersions):
2436         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames): Deleted.
2437         (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNames): Deleted.
2438         * Modules/indexeddb/client/IDBConnectionToServer.h:
2439         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2440         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2441         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNamesAndVersions):
2442         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames): Deleted.
2443         * Modules/indexeddb/server/IDBConnectionToClient.h:
2444         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2445         * Modules/indexeddb/server/IDBServer.cpp:
2446         (WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions):
2447         (WebCore::IDBServer::IDBServer::getAllDatabaseNames): Deleted.
2448         * Modules/indexeddb/server/IDBServer.h:
2449         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2450         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile):
2451         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile): Deleted.
2452         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2453         * Modules/indexeddb/shared/IDBDatabaseNameAndVersion.h: Added.
2454         (WebCore::IDBDatabaseNameAndVersion::encode const):
2455         (WebCore::IDBDatabaseNameAndVersion::decode):
2456         (WebCore::IDBDatabaseNameAndVersion::isolatedCopy const):
2457         * Sources.txt:
2458         * WebCore.xcodeproj/project.pbxproj:
2459         * inspector/agents/InspectorIndexedDBAgent.cpp:
2460         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2461         * loader/EmptyClients.cpp:
2462
2463 2020-06-17  Sam Weinig  <weinig@apple.com>
2464
2465         [WPT] infrastructure/assumptions/html-elements.html fails due to changes in style when all: initial is used
2466         https://bugs.webkit.org/show_bug.cgi?id=213171
2467
2468         Reviewed by Antti Koivisto.
2469
2470         Update existing test results that now pass.
2471
2472         * css/CSSProperties.json:
2473         Use initialStrokeColor (the default) rather than hardcoding the incorrect currentColor. The spec (and initialStrokeColor)
2474         say this should be transparent.
2475
2476         * style/StyleBuilderCustom.h:
2477         (WebCore::Style::ApplyPropertyBorderImageModifier::applyInitialValue):
2478         Match the mask image NinePieceImage constructor, and set fill to true for mask image slices.
2479
2480 2020-06-17  Zalan Bujtas  <zalan@apple.com>
2481
2482         [LFC][Float] Move float avoiders' final position compute next to when the static position is computed
2483         https://bugs.webkit.org/show_bug.cgi?id=213250
2484
2485         Reviewed by Antti Koivisto.
2486
2487         Now that the float avoider's final position has no dependecy on the computed height, we can
2488         move it all the way up, next to where we computed the static position.
2489
2490         * layout/blockformatting/BlockFormattingContext.cpp:
2491         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
2492         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
2493         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
2494         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForAncestors): Deleted.
2495         * layout/blockformatting/BlockFormattingContext.h:
2496
2497 2020-06-17  Antoine Quint  <graouts@webkit.org>
2498
2499         [Modern Media Controls] CSS "cursor" property shoud be respected in media controls shadow root
2500         https://bugs.webkit.org/show_bug.cgi?id=213295
2501         <rdar://problem/61911638>
2502
2503         Reviewed by Timothy Hatcher.
2504
2505         Allow the "cursor" property to be inherited in the media controls shadow root, but still overriden
2506         for interactive objects in the media controls as well as placard text.
2507
2508         Test: media/modern-media-controls/css/cursor.html
2509
2510         * Modules/modern-media-controls/controls/controls-bar.css:
2511         (.controls-bar):
2512         * Modules/modern-media-controls/controls/media-controls.css:
2513         (.media-controls-container):
2514         (.media-controls):
2515         * Modules/modern-media-controls/controls/placard.css:
2516         (.placard .title,):
2517
2518 2020-06-08  Andy Estes  <aestes@apple.com>
2519
2520         [Apple Pay] Enable layout tests on more platforms
2521         https://bugs.webkit.org/show_bug.cgi?id=212955
2522         <rdar://problem/64174156>
2523
2524         Reviewed by Alex Christensen.
2525
2526         Added runtime checks to determine the Apple Pay API version when installments are enabled.
2527
2528         Enabled tests in http/tests/ssl/applepay on iOS.
2529
2530         * Modules/applepay/ApplePayInstallmentConfiguration.idl:
2531         * Modules/applepay/ApplePayInstallmentConfigurationWebCore.h:
2532         * Modules/applepay/ApplePayInstallmentItem.h:
2533         * Modules/applepay/ApplePayInstallmentItem.idl:
2534         * Modules/applepay/ApplePayInstallmentItemType.h:
2535         * Modules/applepay/ApplePayInstallmentItemType.idl:
2536         * Modules/applepay/ApplePayInstallmentRetailChannel.h:
2537         * Modules/applepay/ApplePayInstallmentRetailChannel.idl: Removed uses of
2538         APPLE_PAY_INSTALLMENT_IDENTIFIERS and APPLE_PAY_INSTALLMENT_ITEMS (or replaced with
2539         APPLE_PAY_INSTALLMENTS).
2540
2541         * Modules/applepay/PaymentAPIVersion.h:
2542         * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm:
2543         (WebCore::PaymentAPIVersion::current): Moved the computation of current API version from
2544         PaymentCoordinatorClient::supportsVersion to here. Added runtime checks to determine the
2545         level of PassKit installments support since we don't have enough information to tell at
2546         compile time.
2547
2548         * Modules/applepay/PaymentCoordinatorClient.cpp:
2549         (WebCore::PaymentCoordinatorClient::supportsVersion): Changed to call
2550         PaymentAPIVersion::current.
2551
2552         * Modules/applepay/PaymentInstallmentConfiguration.mm:
2553         (WebCore::makeNSArrayElement):
2554         (WebCore::createPlatformConfiguration):
2555         (WebCore::PaymentInstallmentConfiguration::create):
2556         (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): Removed
2557         uses of HAVE_PASSKIT_INSTALLMENT_ITEMS and HAVE_PASSKIT_INSTALLMENT_IDENTIFIERS. Used
2558         runtime checks to determine support for PKPaymentInstallmentConfiguration and
2559         PKPaymentInstallmentItem.
2560
2561         * SourcesCocoa.txt:
2562         * WebCore.xcodeproj/project.pbxproj: Added source files for PaymentAPIVersion.
2563
2564 2020-06-17  Zalan Bujtas  <zalan@apple.com>
2565
2566         [LFC][Floats] Remove redundant mapping functions
2567         https://bugs.webkit.org/show_bug.cgi?id=213249
2568
2569         Reviewed by Antti Koivisto.
2570
2571         It's incorrect to map the entire display box when the height is no even computed yet.
2572
2573         * layout/floats/FloatingContext.cpp:
2574         (WebCore::Layout::FloatingContext::positionForFloat const):
2575         (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):
2576         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2577         (WebCore::Layout::FloatingContext::append):
2578         (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
2579         (WebCore::Layout::FloatingContext::mapTopLeftToFloatingStateRoot const):
2580         (WebCore::Layout::FloatingContext::mapToFloatingStateRoot const): Deleted.
2581         (WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const): Deleted.
2582         * layout/floats/FloatingContext.h:
2583
2584 2020-06-17  Zalan Bujtas  <zalan@apple.com>
2585
2586         [LFC]Floats] Cleanup FloatAvoider interface
2587         https://bugs.webkit.org/show_bug.cgi?id=213195
2588
2589         Reviewed by Antti Koivisto.
2590
2591         Remove redundant functions/parameters.
2592
2593         * layout/blockformatting/BlockFormattingContext.cpp:
2594         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
2595         * layout/floats/FloatAvoider.cpp:
2596         (WebCore::Layout::FloatAvoider::FloatAvoider):
2597         (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): Deleted.
2598         * layout/floats/FloatAvoider.h:
2599         * layout/floats/FloatingContext.cpp:
2600         (WebCore::Layout::findAvailablePosition):
2601         (WebCore::Layout::FloatingContext::positionForFloat const):
2602         (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):
2603         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const): Deleted.
2604         (WebCore::Layout::FloatingContext::findPositionForFloatBox const): Deleted.
2605         * layout/floats/FloatingContext.h:
2606
2607 2020-06-17  Zalan Bujtas  <zalan@apple.com>
2608
2609         [LFC][Floats] Remove FloatBox class
2610         https://bugs.webkit.org/show_bug.cgi?id=213184
2611
2612         Reviewed by Antti Koivisto.
2613
2614         Apparently the only difference between a non-floating float avoider (regular formatting context root)
2615         and a float box is that while float boxes intersect their margin box, simple float avoiders use their border box.
2616         We can do that without subclassing FloatAvoider.
2617
2618         This patch is also in preparation for moving "computeFloatPosition" next to the static position computation when
2619         the height value is not computed yet. So instead of passing in the display box, let's just pass in top/left and width.
2620
2621         * Sources.txt:
2622         * WebCore.xcodeproj/project.pbxproj:
2623         * layout/floats/FloatAvoider.cpp:
2624         (WebCore::Layout::FloatAvoider::FloatAvoider):
2625         (WebCore::Layout::FloatAvoider::setHorizontalPosition):
2626         (WebCore::Layout::FloatAvoider::setVerticalPosition):
2627         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
2628         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
2629         (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const):
2630         (WebCore::Layout::FloatAvoider::setHorizontalConstraints): Deleted.
2631         (WebCore::Layout::FloatAvoider::setVerticalConstraint): Deleted.
2632         (WebCore::Layout::FloatAvoider::horizontalPositionCandidate): Deleted.
2633         (WebCore::Layout::FloatAvoider::verticalPositionCandidate): Deleted.
2634         (WebCore::Layout::FloatAvoider::rectInContainingBlock const): Deleted.
2635         * layout/floats/FloatAvoider.h:
2636         (WebCore::Layout::FloatAvoider::resetHorizontalPosition):
2637         (WebCore::Layout::FloatAvoider::isLeftAligned const):
2638         (WebCore::Layout::FloatAvoider::borderBoxWidth const):
2639         (WebCore::Layout::FloatAvoider::marginBefore const):
2640         (WebCore::Layout::FloatAvoider::marginAfter const):
2641         (WebCore::Layout::FloatAvoider::marginStart const):
2642         (WebCore::Layout::FloatAvoider::marginEnd const):
2643         (WebCore::Layout::FloatAvoider::marginBoxWidth const):
2644         (WebCore::Layout::FloatAvoider::isFloatingBox const):
2645         (WebCore::Layout::FloatAvoider::layoutBox const):
2646         (WebCore::Layout::FloatAvoider::top const):
2647         (WebCore::Layout::FloatAvoider::left const):
2648         (WebCore::Layout::FloatAvoider::right const):
2649         (WebCore::Layout::FloatAvoider::rect const): Deleted.
2650         (WebCore::Layout::FloatAvoider::displayBox const): Deleted.
2651         (WebCore::Layout::FloatAvoider::displayBox): Deleted.
2652         * layout/floats/FloatBox.cpp: Removed.
2653         * layout/floats/FloatBox.h: Removed.
2654         * layout/floats/FloatingContext.cpp:
2655         (WebCore::Layout::FloatingContext::positionForFloat const):
2656         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2657         (WebCore::Layout::findAvailablePosition):
2658         (WebCore::Layout::FloatingContext::findPositionForFloatBox const):
2659         (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
2660         (WebCore::Layout::FloatPair::intersects const):
2661         (WebCore::Layout::FloatPair::horizontalConstraints const):
2662         * layout/floats/FloatingContext.h:
2663
2664 2020-06-17  Youenn Fablet  <youenn@apple.com>
2665
2666         Make ReadableStream robust against user code
2667         https://bugs.webkit.org/show_bug.cgi?id=212915
2668         <rdar://problem/64133221>
2669
2670         Reviewed by Darin Adler.
2671
2672         Create tee source with private slots instead of public ones.
2673         When source has one of this private slot, we directly go to the creation of a ReadableStream.
2674         Covered by existing tests.
2675
2676         * Modules/streams/ReadableStream.js:
2677         (initializeReadableStream):
2678         * Modules/streams/ReadableStreamInternals.js:
2679         (setupReadableStreamDefaultController):
2680         (readableStreamTee):
2681         (readableStreamDefaultControllerCallPullIfNeeded):
2682         (readableStreamDefaultControllerCancel):
2683         * Modules/streams/StreamInternals.js:
2684         (promiseInvokeOrNoopMethodNoCatch):
2685         (promiseInvokeOrNoopNoCatch):
2686         (promiseInvokeOrNoopMethod):
2687         (promiseInvokeOrNoop):
2688         * bindings/js/WebCoreBuiltinNames.h:
2689
2690 2020-06-17  Antti Koivisto  <antti@apple.com>
2691
2692         Fix spelling of evaluteDynamicMediaQueryRules
2693         https://bugs.webkit.org/show_bug.cgi?id=213287
2694
2695         Unreviewed.
2696
2697         * style/RuleSet.cpp:
2698         (WebCore::Style::RuleSet::addRulesFromSheet):
2699         (WebCore::Style::RuleSet::evaluateDynamicMediaQueryRules):
2700         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules): Deleted.
2701         * style/RuleSet.h:
2702         * style/StyleResolver.cpp:
2703         (WebCore::Style::Resolver::evaluateDynamicMediaQueries):
2704         * style/StyleScopeRuleSets.cpp:
2705         (WebCore::Style::ScopeRuleSets::evaluateDynamicMediaQueryRules):
2706         (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules): Deleted.
2707         * style/StyleScopeRuleSets.h:
2708
2709 2020-06-17  Diego Pino Garcia  <dpino@igalia.com>
2710
2711         REGRESSION(r262994): [GTK] More than 100 tests are failing
2712         https://bugs.webkit.org/show_bug.cgi?id=213173
2713
2714         Unreviewed gardening.
2715
2716         Add default initialization for WebCore::PluginInfo::clientLoadPolicy and
2717         WebCore::PluginInfo::isApplicationPlugin.
2718
2719         * plugins/PluginData.h:
2720
2721 2020-06-16  Simon Fraser  <simon.fraser@apple.com>
2722
2723         REGRESSION (r255037): Broken position while comparing watch bands on www.apple.com/shop/studio/apple-watch
2724         https://bugs.webkit.org/show_bug.cgi?id=213282
2725
2726         Reviewed by Antti Koivisto.
2727
2728         Test: fast/scrolling/ios/user-then-programmatic-scroll.html
2729
2730         * page/scrolling/ScrollingTree.cpp:
2731         (WebCore::ScrollingTree::applyLayerPositionsAfterCommit):
2732         * page/scrolling/ScrollingTree.h:
2733         (WebCore::ScrollingTree::setNeedsApplyLayerPositionsAfterCommit):
2734         (WebCore::ScrollingTree::didScrollByDelegatedScrolling): Deleted.
2735         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2736         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
2737
2738 2020-06-16  Zalan Bujtas  <zalan@apple.com>
2739
2740         [Subpixel] Replaced content bleeds over content box when border radius is set
2741         https://bugs.webkit.org/show_bug.cgi?id=213275
2742         <rdar://problem/64320995>
2743
2744         Reviewed by Simon Fraser.
2745
2746         Snap the border to device pixels on the replaced box when border radius is set.
2747
2748         * rendering/RenderReplaced.cpp:
2749         (WebCore::RenderReplaced::paint):
2750
2751 2020-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2752
2753         Text manipulation should not re-extract elements whose children have been manipulated
2754         https://bugs.webkit.org/show_bug.cgi?id=213276
2755         <rdar://problem/64193446>
2756
2757         Reviewed by Tim Horton.
2758
2759         After an element has undergone text manipulation, we have a mechanism for not extracting that element again,
2760         if the element is later hidden and shown, or relocated in the DOM. This works by adding the inserted text
2761         manipulation node to a weak element map (`m_manipulatedElements`) if the inserted node is an element. However,
2762         this mechanism is bypassed in the case where text nodes are inserted, since these child nodes are not elements.
2763         This means that if the element containing this manipulated text is hidden and later shown, we'll attempt to re-
2764         extract its contents, which is problematic for text manipulation clients.
2765
2766         To mitigate this, when inserting content during text manipulation, if a new parent of the inserted content
2767         contains _only_ manipulated child nodes, then avoid trying to manipulate it in the future by adding it to
2768         `m_manipulatedElements`.
2769
2770         Test: TextManipulation.CompleteTextManipulationAvoidExtractingManipulatedTextAfterManipulation
2771
2772         * editing/TextManipulationController.cpp:
2773         (WebCore::TextManipulationController::updateInsertions):
2774
2775         Drive-by style fix: add a space after the assignment operator.
2776
2777         (WebCore::TextManipulationController::replace):
2778
2779         If the parent node that we're inserting a text manipulation node underneath has only 1 child (i.e. the node that
2780         we've just inserted), then flag it as having only manipulated children. This parent may be un-flagged later when
2781         applying `NodeInsertion`s, if the `NodeInsertion`'s child has not been manipulated.
2782
2783 2020-06-16  Andy Estes  <aestes@apple.com>
2784
2785         FileListCreator should only be used for resolving directories
2786         https://bugs.webkit.org/show_bug.cgi?id=213259
2787         <rdar://problem/64375709>
2788
2789         Reviewed by David Kilzer.
2790
2791         Depending on whether directories should be resolved, FileListCreator::create would either
2792         synchronously execute its completion handler then return nullptr or asynchronously dispatch
2793         its completion handler then return a non-null RefPtr. Interfaces with sometimes-synchronous
2794         callbacks can be hard to use correctly; e.g., r262962 fixes a problem where
2795         FileInputType::m_fileListCreator was being modified in an unexpected order.
2796
2797         This patch makes the interface between FileInputType and FileListCreator less error-prone
2798         and more explicit by renaming FileListCreator to DirectoryFileListCreator, making its job
2799         solely to create directory FileLists on a background queue, and giving it an explicit start
2800         member function. For non-directories, FileInputType::filesChosen now bypasses
2801         DirectoryFileListCreator and directly converts from Vector<FileChooserFileInfo> to FileList.
2802
2803         Covered by existing tests.
2804
2805         * Sources.txt:
2806         * WebCore.xcodeproj/project.pbxproj:
2807
2808         * html/DirectoryFileListCreator.cpp: Renamed from html/FileListCreator.cpp.
2809         (WebCore::createFileList): Removed the template and ShouldResolveDirectories parameter.
2810         (WebCore::DirectoryFileListCreator::DirectoryFileListCreator): Moved the work queue
2811         dispatching to DirectoryFileListCreator::start.
2812         (WebCore::DirectoryFileListCreator::start): Added; moved the work queue dispatching here
2813         from the ctor.
2814
2815         * html/DirectoryFileListCreator.h: Renamed from html/FileListCreator.h.
2816         (WebCore::DirectoryFileListCreator::create): Stopped performing non-directory creation and
2817         changed the return value back to Ref<>.
2818
2819         * html/FileInputType.cpp:
2820         (WebCore::FileInputType::filesChosen): Moved most of the work done in the FileListCreator
2821         completion handler to didCreateFileList. When !FileInputType::allowsDirectories, used
2822         Vector::map to convert paths to a Vector<Ref<File>>, used that to create a FileList, then
2823         called didCreateFileList. Otherwise, created and started a DirectoryFileListCreator that
2824         calls didCreateFileList in its completion handler.
2825         (WebCore::FileInputType::didCreateFileList): Added; sets the new file list and icon and
2826         clears m_directoryFileListCreator.
2827
2828         * html/FileInputType.h:
2829
2830 2020-06-16  Dean Jackson  <dino@apple.com>
2831
2832         REGRESSION (r262643): DumpRenderTree at com.apple.WebCore: WebCore::Document::prepareCanvasesForDisplayIfNeeded
2833         https://bugs.webkit.org/show_bug.cgi?id=213221
2834         rdar://64260400
2835
2836         Reviewed by Simon Fraser.
2837
2838         A Document could still be holding a pointer to an HTMLCanvasElement after the
2839         canvas had been deleted because the CanvasObserver protocol was disconnected
2840         too early. The fix is to explicitly clear the canvas from the Document as it
2841         stops observing.
2842
2843         Test: webgl/preparation-removed-from-document.html
2844
2845         * dom/Document.cpp:
2846         (WebCore::Document::prepareCanvasesForDisplayIfNeeded): Copy the HashSet to a Vector
2847         just in case something weird happens to the set during iteration.
2848         (WebCore::Document::clearCanvasPreparation): Remove the canvas from the list of
2849         of elements that need preparation.
2850         * dom/Document.h: Add the new clearCanvasPreparation method.
2851
2852         * html/HTMLCanvasElement.cpp:
2853         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Clear the document.
2854         (WebCore::HTMLCanvasElement::didMoveToNewDocument): Ditto.
2855         (WebCore::HTMLCanvasElement::removedFromAncestor): Ditto.
2856
2857 2020-06-16  Dean Jackson  <dino@apple.com>
2858
2859         [WebGL] Lose the context if IOSurface allocation fails
2860         https://bugs.webkit.org/show_bug.cgi?id=213265
2861         <rdar://problem/64424742>
2862
2863         Reviewed by Simon Fraser.
2864
2865         If we are unable to allocate the backing store for the WebGL
2866         content, we should immediately lose the context.
2867
2868         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
2869         (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): Lose the context if the
2870         call to allocateIOSurfaceBackingStore didn't work.
2871         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
2872         (WebCore::GraphicsContextGLOpenGL::allocateIOSurfaceBackingStore):
2873         * platform/graphics/cocoa/WebGLLayer.h:
2874         * platform/graphics/cocoa/WebGLLayer.mm:
2875         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Return a boolean
2876         so that we can detect if the allocation failed.
2877         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2878         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
2879         (WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
2880
2881 2020-06-16  Eric Carlson  <eric.carlson@apple.com>
2882
2883         Don't claim to support fullscreen mode unless fullScreenEnabled setting is enabled
2884         https://bugs.webkit.org/show_bug.cgi?id=213142
2885         <rdar://63753327>
2886
2887         Reviewed by Jer Noble.
2888
2889         Test: media/video-supports-fullscreen.html
2890
2891         * html/HTMLVideoElement.cpp:
2892         (WebCore::HTMLVideoElement::supportsFullscreen const): Check settings.fullScreenEnabled.
2893
2894 2020-06-16  Andres Gonzalez  <andresg_22@apple.com>
2895
2896         Fix for accessibility/textarea-selected-text-range.html in isolated tree mode.
2897         https://bugs.webkit.org/show_bug.cgi?id=213257
2898
2899         Reviewed by Chris Fleizach.
2900
2901         accessibility/textarea-selected-text-range.html.
2902
2903         Implementation of AXIsolatedObject::selectedTextRange.
2904
2905         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2906         (WebCore::AXIsolatedObject::selectedTextRange const):
2907         * accessibility/isolatedtree/AXIsolatedObject.h:
2908
2909 2020-06-16  Pavel Feldman  <pavel.feldman@gmail.com>
2910
2911         Web Inspector: replace completion handler with a function in interception.
2912         https://bugs.webkit.org/show_bug.cgi?id=213252
2913
2914         Reviewed by Devin Rousso.
2915
2916         Don't use a `CompletionHandler` as it asserts that it's been called when it's destroyed.
2917         Both `Network.interceptRequestWithResponse` and `Network.interceptRequestWithError` essentially
2918         "skip" the network pipeline, so the `CompletionHandler` is not invoked for those commands.
2919
2920         * inspector/InspectorInstrumentation.cpp:
2921         (WebCore::InspectorInstrumentation::interceptRequestImpl):
2922         * inspector/InspectorInstrumentation.h:
2923         (WebCore::InspectorInstrumentation::interceptRequest):
2924         * inspector/InspectorInstrumentationWebKit.cpp:
2925         (WebCore::InspectorInstrumentationWebKit::interceptRequestInternal):
2926         * inspector/InspectorInstrumentationWebKit.h:
2927         (WebCore::InspectorInstrumentationWebKit::interceptRequest):
2928         * inspector/agents/InspectorNetworkAgent.cpp:
2929         (WebCore::InspectorNetworkAgent::interceptRequest):
2930         (WebCore::InspectorNetworkAgent::interceptRequestWithResponse):
2931         (WebCore::InspectorNetworkAgent::interceptRequestWithError):
2932         * inspector/agents/InspectorNetworkAgent.h:
2933         (WebCore::InspectorNetworkAgent::PendingInterceptRequest::PendingInterceptRequest):
2934         (WebCore::InspectorNetworkAgent::PendingInterceptRequest::continueAsHandled):
2935
2936 2020-06-16  Clark Wang  <clark_wang@apple.com>
2937
2938         Added missing position attributes to PannerNode
2939         https://bugs.webkit.org/show_bug.cgi?id=213151
2940
2941         Reviewed by Chris Dumez.
2942
2943         Implemented position attributes in PannerNode interface, as per spec: 
2944         https://www.w3.org/TR/webaudio/#pannernode.
2945
2946         Re-baselined tests previous tests that either now pass, or fail at a further stage than before.
2947
2948         * Modules/webaudio/PannerNode.cpp:
2949         (WebCore::PannerNode::PannerNode):
2950         (WebCore::PannerNode::position const):
2951         (WebCore::PannerNode::setPosition):
2952         (WebCore::PannerNode::getAzimuthElevation):
2953         (WebCore::PannerNode::dopplerRate):
2954         (WebCore::PannerNode::distanceConeGain):
2955         * Modules/webaudio/PannerNode.h:
2956         * Modules/webaudio/PannerNode.idl:
2957
2958 2020-06-16  Mark Lam  <mark.lam@apple.com>
2959
2960         Make Options::useJIT() be the canonical source of truth on whether we should use the JIT.
2961         https://bugs.webkit.org/show_bug.cgi?id=212556
2962         <rdar://problem/63780436>
2963
2964         Reviewed by Saam Barati.
2965
2966         * cssjit/SelectorCompiler.cpp:
2967         (WebCore::SelectorCompiler::compileSelector):
2968
2969 2020-06-16  Sam Weinig  <weinig@apple.com>
2970
2971         [WPT] form.action does not return document.url when unset (part of https://wpt.live/html/dom/reflection-forms.html)
2972         https://bugs.webkit.org/show_bug.cgi?id=213205
2973
2974         Reviewed by David Kilzer.
2975
2976         Update existing test results that now pass.
2977
2978         * html/HTMLFormControlElement.cpp:
2979         (WebCore::HTMLFormControlElement::formAction const):
2980         Call document.completeURL() directly rather than getURLAttribute() as that 
2981         will cause the attribute to have to be looked up again.
2982
2983         * html/HTMLFormElement.cpp:
2984         (WebCore::HTMLFormElement::action const):
2985         Match HTMLFormControlElement::formAction (and the spec) and return the document's
2986         url if the attribute value is missing.
2987
2988         * html/HTMLFormElement.idl:
2989         Remove Reflect/URL extended attributes, as we need custom handling for the empty
2990         case.
2991
2992 2020-06-16  David Kilzer  <ddkilzer@apple.com>
2993
2994         REGRESSION (r262994): Web Inspector is killed when context-clicking anywhere
2995         <https://webkit.org/b/213224>
2996         <rdar://problem/64383320>
2997
2998         Reviewed by Darin Adler.
2999
3000         Test: TestWebKitAPI.WebCore.ContextMenuAction_IsValidEnum
3001
3002         The issue is that using WTF::isValidEnum() with
3003         WTF::EnumTraits<WebCore::ContextMenuAction> didn't explicitly
3004         list all 1000 custom tags, or any application tags (besides the
3005         base), so the unlisted tags were marked as invalid during enum
3006         validation.
3007
3008         The fix is to define a custom validation function for
3009         WebCore::ContextMenuAction enum values.
3010
3011         * platform/ContextMenuItem.h:
3012         (WTF::isValidEnum):
3013
3014         * platform/ContextMenuItem.cpp:
3015         (WebCore::isValidContextMenuAction): Add.
3016         - Validates CustomTag and ApplicationTag ranges.
3017         * platform/ContextMenuItem.h:
3018         (WebCore::isValidContextMenuAction): Add declaration.
3019         (WTF::EnumTraits<WebCore::ContextMenuAction>): Delete.
3020         (WTF::HasCustomIsValidEnum<WebCore::ContextMenuAction>): Add.
3021         (WTF::isValidEnum): Add.
3022         - Call WebCore::isValidContextMenuAction() to validate all enum
3023           values.
3024
3025 2020-06-16  Fujii Hironori  <Hironori.Fujii@sony.com>
3026
3027         [CMake][Visual Studio] CSSPropertyNames.h is generated twice in WebCore.vcxproj and WebCore_CopyPrivateHeaders.vcxproj
3028         https://bugs.webkit.org/show_bug.cgi?id=213226
3029
3030         Reviewed by Don Olmstead.
3031
3032         WebCore_CopyPrivateHeaders needs to have a direct or indirect
3033         dependency of WebCore target for CMake Visual Studio generator to
3034         eliminate duplicated custom commands.
3035
3036         * CMakeLists.txt: Added add_dependencies(WebCore_CopyPrivateHeaders WebCore).
3037
3038 2020-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3039
3040         Text manipulation should handle nested item boundary elements
3041         https://bugs.webkit.org/show_bug.cgi?id=213251
3042         <rdar://problem/63371514>
3043
3044         Reviewed by Sihui Liu.
3045
3046         In the case where there are nested item boundary elements (e.g. block-level list items or links), text
3047         manipulation will currently only observe that we've crossed the top-level item boundary, and proceed to extract
3048         text from the nested boundary elements as tokens in the same item.
3049
3050         Address this by maintaining a stack of boundary elements rather than just a single item. Additionally, create
3051         and add an item when crossing into a new item boundary, rather than only when we exit a boundary; this handles
3052         the case where we descend from one boundary element into another boundary element that is a child.
3053
3054         Test: TextManipulation.StartTextManipulationTreatsNestedInlineBlockListItemsAndLinksAsParagraphs
3055
3056         * editing/TextManipulationController.cpp:
3057         (WebCore::TextManipulationController::observeParagraphs):
3058
3059 2020-06-16  Youenn Fablet  <youenn@apple.com>
3060
3061         Loads triggered by an opaque stylesheet should not be visible to service workers
3062         https://bugs.webkit.org/show_bug.cgi?id=213246
3063
3064         Reviewed by Alex Christensen.
3065
3066         Test: http/wpt/service-workers/no-cors-css-with-subresources.https.html
3067
3068         * loader/ResourceLoaderOptions.h:
3069         Move it to boolean
3070
3071 2020-06-16  Chris Fleizach  <cfleizach@apple.com>
3072
3073         AX: <address> element should no longer map to ARIA `contentinfo` role
3074         https://bugs.webkit.org/show_bug.cgi?id=212617
3075         <rdar://problem/63848604>
3076
3077         Reviewed by Joanmarie Diggs.
3078
3079         Change the mapping of <address> to be a basic group. Update tests.
3080
3081         * accessibility/AccessibilityRenderObject.cpp:
3082         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3083
3084 2020-06-16  Truitt Savell  <tsavell@apple.com>
3085
3086         Unreviewed, reverting r263079.
3087
3088         Broke Internal builds.
3089
3090         Reverted changeset:
3091
3092         "IndexedDB: Support IDBFactory databases method"
3093         https://bugs.webkit.org/show_bug.cgi?id=211043
3094         https://trac.webkit.org/changeset/263079
3095
3096 2020-06-16  Antti Koivisto  <antti@apple.com>
3097
3098         O(n^2) behavior in media query resolution
3099         https://bugs.webkit.org/show_bug.cgi?id=213243
3100
3101         Reviewed by Anders Carlsson.
3102
3103         We were traversing all rules in a RuleSet inside a loop over all media queries that change value.
3104         This becomes problematic when you have thousands of media queries.
3105
3106         * style/RuleSet.cpp:
3107         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
3108
3109         Instead collect the rule positions that need flipping into a map and then traverse only once
3110         to do the actual flipping.
3111
3112         Longer term we should maintain a data stucture that can map directly from a position to RuleDatas.
3113         This will require some data structure rethink so this patch takes a simpler approach.
3114
3115         (WebCore::Style::RuleSet::MediaQueryCollector::pop):
3116         * style/RuleSet.h:
3117
3118 2020-06-16  Per Arne Vollan  <pvollan@apple.com>
3119
3120         [iOS] Collecting screen properties in the UI process introduced a Safari launch time regression.
3121         https://bugs.webkit.org/show_bug.cgi?id=213217
3122         <rdar://problem/64374461>
3123
3124         Reviewed by Brent Fulgham.
3125
3126         Calling collectScreenProperties() in WebProcessPool::platformInitializeWebProcess() introduced a Safari launch time regression on iOS.
3127         It turns out that calling screenIsMonochrome on iOS is expensive, but this call can still be done in the WebContent process, since there
3128         are no sandbox restrictions making that call fail in the WebContent process. Call this function in the WebContent process instead of in
3129         the UI process.
3130
3131         No new tests, since this change should not introduce a change in behavior. It goes back to calling the screenIsMonochrome function in the
3132         WebContent process.
3133
3134         * platform/ScreenProperties.h:
3135         (WebCore::ScreenData::encode const):
3136         (WebCore::ScreenData::decode):
3137         * platform/ios/PlatformScreenIOS.mm:
3138         (WebCore::screenIsMonochrome):
3139         (WebCore::collectScreenProperties):
3140         * platform/mac/PlatformScreenMac.mm:
3141         (WebCore::collectScreenProperties):
3142
3143 2020-06-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3144
3145         [EME] Create CDMProxyFactory
3146         https://bugs.webkit.org/show_bug.cgi?id=212695
3147
3148         Reviewed by Youenn Fablet.
3149
3150         Currently in the GStreamer port we have the CDMProxy cabled in the
3151         player private and set to the instance. Setting this too late can
3152         create key sync issues that are worked around. This does not seem
3153         to be needed because it can be created in the constructor from a
3154         CDMProxyFactory if we just use the key system that we already
3155         have.
3156
3157         This patch declares a CDMProxyFactory that is used in the
3158         CDMInstanceProxy to instantiate the proper CDMProxy in its
3159         constructor.
3160
3161         CDMProxyFactoryClearKey is created and added to the GStreamer
3162         platform CDMProxyFactories.
3163
3164         Initializing too fast creates flakyness in several ClearKey tests
3165         because of asking for protected memory so we need to initialize it
3166         in a lazy way.
3167
3168         No new tests, just a rework.
3169
3170         * platform/encryptedmedia/CDMProxy.cpp:
3171         (WebCore::CDMProxyFactory::registerFactory):
3172         (WebCore::CDMProxyFactory::unregisterFactory):
3173         (WebCore::CDMProxyFactory::createCDMProxyForKeySystem):
3174         (WebCore::CDMProxyFactory::platformRegisterFactories):
3175         * platform/encryptedmedia/CDMProxy.h:
3176         (WebCore::CDMProxyFactory::~CDMProxyFactory):
3177         (WebCore::CDMInstanceProxy::CDMInstanceProxy):
3178         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3179         (WebCore::CDMInstanceClearKey::CDMInstanceClearKey):
3180         (WebCore::CDMInstanceClearKey::keySystem const):
3181         * platform/encryptedmedia/clearkey/CDMClearKey.h:
3182         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3183         (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceAttached):
3184         * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
3185         (WebCore::CDMProxyFactory::platformRegisterFactories):
3186         * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp:
3187         (WebCore::CDMProxyFactoryClearKey::singleton):
3188         (WebCore::CDMProxyFactoryClearKey::createCDMProxy):
3189         (WebCore::CDMProxyFactoryClearKey::supportsKeySystem):
3190         * platform/graphics/gstreamer/eme/CDMProxyClearKey.h:
3191
3192 2020-06-16  youenn fablet  <youenn@apple.com>
3193
3194         Make sure MediaRecorder.requestData returns data with the new writer backend
3195         https://bugs.webkit.org/show_bug.cgi?id=206929
3196
3197         Reviewed by Darin Adler.
3198
3199         Test: http/wpt/mediarecorder/MediaRecorder-requestData.html
3200
3201         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3202         (WebCore::MediaRecorderPrivateWriter::fetchData):
3203         Flush data whenever calling fetchData.
3204
3205 2020-06-16  Darryl Pogue  <darryl@dpogue.ca>
3206
3207         IndexedDB: Support IDBFactory databases method
3208         https://bugs.webkit.org/show_bug.cgi?id=211043
3209
3210         Reviewed by Youenn Fablet.
3211
3212         Add support for fetching the list of IDB database names and versions
3213         from the IDBServer, and expose the functionality as
3214         `IDBFactory.prototype.databases()`.
3215
3216         Spec: https://w3c.github.io/IndexedDB/#dom-idbfactory-databases
3217
3218         * Headers.cmake:
3219         * Modules/indexeddb/IDBActiveDOMObject.h:
3220         (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread):
3221         * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.cpp: Added.
3222         (WebCore::IDBDatabaseNameAndVersionRequest::create):
3223         (WebCore::IDBDatabaseNameAndVersionRequest::IDBDatabaseNameAndVersionRequest):
3224         (WebCore::IDBDatabaseNameAndVersionRequest::~IDBDatabaseNameAndVersionRequest):
3225         (WebCore::IDBDatabaseNameAndVersionRequest::complete):
3226         (WebCore::IDBDatabaseNameAndVersionRequest::activeDOMObjectName const):
3227         (WebCore::IDBDatabaseNameAndVersionRequest::virtualHasPendingActivity const):
3228         (WebCore::IDBDatabaseNameAndVersionRequest::stop):
3229         * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.h: Added.
3230         * Modules/indexeddb/IDBFactory.cpp:
3231         (WebCore::IDBFactory::databases):
3232         (WebCore::IDBFactory::getAllDatabaseNames):
3233         * Modules/indexeddb/IDBFactory.h:
3234         * Modules/indexeddb/IDBFactory.idl:
3235         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3236         (WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost):
3237         (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNamesAndVersions):
3238         (WebCore::IDBClient::IDBConnectionProxy::didGetAllDatabaseNamesAndVersions):
3239         (WebCore::IDBClient::IDBConnectionProxy::forgetActivityForCurrentThread):
3240         (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames): Deleted.
3241         * Modules/indexeddb/client/IDBConnectionProxy.h:
3242         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3243         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNamesAndVersions):
3244         (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNamesAndVersions):
3245         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames): Deleted.
3246         (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNames): Deleted.
3247         * Modules/indexeddb/client/IDBConnectionToServer.h:
3248         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3249         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3250         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNamesAndVersions):
3251         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames): Deleted.
3252         * Modules/indexeddb/server/IDBConnectionToClient.h:
3253         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3254         * Modules/indexeddb/server/IDBServer.cpp:
3255         (WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions):
3256         (WebCore::IDBServer::IDBServer::getAllDatabaseNames): Deleted.
3257         * Modules/indexeddb/server/IDBServer.h:
3258         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3259         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile):
3260         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile): Deleted.
3261         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3262         * Modules/indexeddb/shared/IDBDatabaseNameAndVersion.h: Added.
3263         (WebCore::IDBDatabaseNameAndVersion::encode const):
3264         (WebCore::IDBDatabaseNameAndVersion::decode):
3265         (WebCore::IDBDatabaseNameAndVersion::isolatedCopy const):
3266         * Sources.txt:
3267         * WebCore.xcodeproj/project.pbxproj:
3268         * inspector/agents/InspectorIndexedDBAgent.cpp:
3269         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
3270         * loader/EmptyClients.cpp:
3271
3272 2020-06-15  ChangSeok Oh  <changseok@webkit.org>
3273
3274         [GTK] Rename GC3D to GCGL.
3275         https://bugs.webkit.org/show_bug.cgi?id=211117
3276
3277         Reviewed by Fujii Hironori.
3278
3279         GraphicsContext3D has been renamed to GraphicsContextGL after r254103 but some files
3280         still follow the old name. This change reflects the new name to them for consistency.
3281
3282         No new tests because of no new functionalities.
3283
3284         * platform/TextureMapper.cmake:
3285         * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DANGLELayer.cpp.
3286         (Nicosia::GCGLANGLELayer::ANGLEContext::errorString):
3287         (Nicosia::GCGLANGLELayer::ANGLEContext::lastErrorString):
3288         (Nicosia::GCGLANGLELayer::ANGLEContext::createContext):
3289         (Nicosia::GCGLANGLELayer::ANGLEContext::ANGLEContext):
3290         (Nicosia::GCGLANGLELayer::ANGLEContext::~ANGLEContext):
3291         (Nicosia::GCGLANGLELayer::ANGLEContext::makeContextCurrent):
3292         (Nicosia::GCGLANGLELayer::ANGLEContext::platformContext const):
3293         (Nicosia::GCGLANGLELayer::GCGLANGLELayer):
3294         (Nicosia::GCGLANGLELayer::~GCGLANGLELayer):
3295         (Nicosia::GCGLANGLELayer::makeContextCurrent):
3296         (Nicosia::GCGLANGLELayer::platformContext const):
3297         * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DANGLELayer.h.
3298         * platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp.
3299         (Nicosia::GCGLLayer::GCGLLayer):
3300         (Nicosia::GCGLLayer::~GCGLLayer):
3301         (Nicosia::GCGLLayer::makeContextCurrent):
3302         (Nicosia::GCGLLayer::platformContext const):
3303         (Nicosia::GCGLLayer::swapBuffersIfNeeded):
3304         * platform/graphics/nicosia/texmap/NicosiaGCGLLayer.h: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h.
3305         (Nicosia::GCGLLayer::contentLayer const):
3306         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
3307         * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
3308         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
3309         * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: Renamed from Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp.
3310         (WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer):
3311         (WebCore::TextureMapperGCGLPlatformLayer::~TextureMapperGCGLPlatformLayer):
3312         (WebCore::TextureMapperGCGLPlatformLayer::makeContextCurrent):
3313         (WebCore::TextureMapperGCGLPlatformLayer::platformContext const):
3314         (WebCore::TextureMapperGCGLPlatformLayer::proxy const):
3315         (WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded):
3316         (WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
3317         * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h: Renamed from Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h.
3318
3319 2020-06-15  Megan Gardner  <megan_gardner@apple.com>
3320
3321         Text form controls can scroll by 1px when value is the same length as size. No scrolling should happen.
3322         https://bugs.webkit.org/show_bug.cgi?id=212856
3323         <rdar://problem/63541707>
3324
3325         Reviewed by Zalan Bujtas.
3326
3327         We were only adding caret width to an input when determining if the input should start to be scrolled,
3328         but that additional width was not included in the initial calculation, which could result in fields being
3329         scrollable by 1px when they had the same number of fixed-width characters as the size of the field. This was
3330         incorrect, and caused fast/forms/password-scrolled-after-caps-lock-toggled.html to fail when the default size
3331         of the security dots increased to be the same as the average character width. Adding the caret width when the
3332         size of the input field is calculated brings consistency to when an input field is scrollable.
3333
3334         Tested by fixing:
3335         fast/forms/password-scrolled-after-caps-lock-toggled.html
3336         
3337         And rebasing:
3338         * editing/editable-region/overflow-scroll-text-field-and-contenteditable-expected.txt:
3339         * editing/editable-region/search-field-basic-expected.txt:
3340         * editing/editable-region/text-field-basic-expected.txt:
3341         * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly-expected.html:
3342         * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html:
3343         * fast/forms/auto-fill-button/input-credit-card-auto-fill-button-expected.txt:
3344         * fast/forms/fieldset/fieldset-elements-htmlcollection-expected.txt:
3345         * fast/forms/fieldset/fieldset-elements-htmlcollection.html:
3346         * fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html:
3347         * fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html:
3348         * fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html:
3349         * fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html:
3350         * platform/ios-simulator/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt:
3351         * platform/ios-simulator/fast/forms/auto-fill-button/input-credit-card-auto-fill-button-expected.txt:
3352         * platform/ios-simulator/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt:
3353         * platform/ios-simulator/fast/forms/datalist/datalist-searchinput-appearance-expected.txt:
3354         * platform/ios-simulator/fast/forms/datalist/datalist-textinput-appearance-expected.txt:
3355         * platform/ios-wk2/editing/input/caret-at-the-edge-of-contenteditable-expected.txt:
3356         * platform/ios-wk2/editing/input/caret-at-the-edge-of-input-expected.txt:
3357         * platform/ios-wk2/editing/inserting/before-after-input-element-expected.txt:
3358         * platform/ios-wk2/editing/pasteboard/input-field-1-expected.txt:
3359         * platform/ios-wk2/editing/selection/4895428-3-expected.txt:
3360         * platform/ios-wk2/editing/selection/drag-select-1-expected.txt:
3361         * platform/ios-wk2/editing/selection/select-from-textfield-outwards-expected.txt:
3362         * platform/ios-wk2/fast/forms/input-appearance-preventDefault-expected.txt:
3363         * platform/ios-wk2/fast/forms/input-text-click-inside-expected.txt:
3364         * platform/ios-wk2/fast/forms/input-text-click-outside-expected.txt:
3365         * platform/ios-wk2/fast/forms/input-text-double-click-expected.txt:
3366         * platform/ios-wk2/fast/forms/input-text-drag-down-expected.txt:
3367         * platform/ios-wk2/fast/forms/input-text-option-delete-expected.txt:
3368         * platform/ios-wk2/fast/forms/input-text-self-emptying-click-expected.txt:
3369         * platform/ios-wk2/fast/forms/tabbing-input-iframe-expected.txt:
3370         * platform/ios-wk2/fast/forms/textfield-outline-expected.txt:
3371         * platform/ios-wk2/fast/overflow/overflow-focus-ring-expected.txt:
3372         * platform/ios-wk2/fast/repaint/placeholder-after-caps-lock-hidden-expected.txt:
3373         * platform/ios-wk2/fast/transforms/transformed-focused-text-input-expected.txt:
3374         * platform/ios/editing/pasteboard/4806874-expected.txt:
3375         * platform/ios/editing/selection/3690703-2-expected.txt:
3376         * platform/ios/editing/selection/3690703-expected.txt:
3377         * platform/ios/editing/selection/3690719-expected.txt:
3378         * platform/ios/editing/selection/4975120-expected.txt: