Non-unified build fixes, late September 2020 edition
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-09-25  Adrian Perez de Castro  <aperez@igalia.com>
2
3         Non-unified build fixes, late September 2020 edition
4         https://bugs.webkit.org/show_bug.cgi?id=216950
5
6         Unreviewed build fix.
7
8         No new tests needed.
9
10         * Modules/webaudio/AudioNodeInput.cpp: Add missing AudioUtilities.h include.
11         * Modules/webaudio/AudioNodeOutput.cpp: Ditto.
12         * Modules/webaudio/BiquadProcessor.cpp: Ditto.
13         * Modules/webaudio/GainNode.cpp: Ditto.
14         * Modules/webaudio/PannerNode.cpp: Ditto.
15         * page/PerformanceUserTiming.cpp: Add missing JavaScriptCore/JSCJSValueInlines.h include.
16         * platform/audio/AudioUtilities.h: Add missing <cmath> include.
17
18 2020-09-24  Zalan Bujtas  <zalan@apple.com>
19
20         [LFC][IFC] Add helper functions to create LineBox::InlineBox objects for inline level boxes.
21         https://bugs.webkit.org/show_bug.cgi?id=216957
22
23         Reviewed by Simon Fraser.
24
25         The overloaded LineBox::InlineBox constructors were representing different types of inline level boxes.
26         These new helper functions make it easier to figure out how to initiate LineBox::InlineBox objects depending on the type of
27         the inline level box.
28         This patch also removes an incorrect ASSERT on the inline box's height. It is okay to have a zero height inline box.  
29
30         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
31         (WebCore::Layout::LineBoxBuilder::constructInlineBoxes):
32         * layout/inlineformatting/InlineLineBox.cpp:
33         (WebCore::Layout::LineBox::InlineBox::InlineBox):
34         (WebCore::Layout::m_baseline):
35         * layout/inlineformatting/InlineLineBox.h:
36         (WebCore::Layout::LineBox::InlineBox::createBoxForRootInlineBox):
37         (WebCore::Layout::LineBox::InlineBox::createBoxForAtomicInlineLevelBox):
38         (WebCore::Layout::LineBox::InlineBox::createBoxForInlineBox):
39
40 2020-09-24  Keith Miller  <keith_miller@apple.com>
41
42         CSS angle unit conversions should consistently use the same associativity
43         https://bugs.webkit.org/show_bug.cgi?id=216906
44
45         Reviewed by Simon Fraser.
46
47         Right now we inconsistently associate our floating point math for
48         angle unit conversions. In particular,
49         conversionToCanonicalUnitsScaleFactor expects there to be a single
50         fixed constant we can multiply by to change units. However, the
51         various conversion functions in WTF are not associated in this
52         way. e.g.  rad2deg does ((radian * 180) / pi) rather than
53         (radian * (180 / pi)). Since FP math is NOT associative these
54         produce different results. For example, 1.57 radians is
55         89.954373835539258 degrees in the first case but
56         89.954373835539243 in the second.
57
58         This patch changes the WTF functions to operate on a single scale
59         factor when converting to/from the canonical unit. Conversions
60         between non-canonical units first convert to the canonical unit
61         (degree). Also, conversionToCanonicalUnitsScaleFactor now gets the
62         scale factor from WTF to ensure we get the same associativity
63         everywhere.
64
65         * css/CSSPrimitiveValue.cpp:
66         (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
67
68 2020-09-24  Fujii Hironori  <Hironori.Fujii@sony.com>
69
70         [SVG2] Remove color-profile tag
71         https://bugs.webkit.org/show_bug.cgi?id=216910
72
73         Reviewed by Darin Adler.
74
75         SVG2 removed color-profile element.
76
77         * dom/Document.cpp:
78         (WebCore::Document::validateCustomElementName):
79         * svg/svgtags.in:
80
81 2020-09-24  Chris Dumez  <cdumez@apple.com>
82
83         Use more inline initialization and constexpr in WebAudio code
84         https://bugs.webkit.org/show_bug.cgi?id=216939
85
86         Reviewed by Darin Adler.
87
88         Use more inline initialization and constexpr in WebAudio code.
89
90         * Modules/webaudio/AudioBufferSourceNode.cpp:
91         * Modules/webaudio/AudioDestinationNode.cpp:
92         (WebCore::AudioDestinationNode::AudioDestinationNode):
93         * Modules/webaudio/AudioDestinationNode.h:
94         * Modules/webaudio/AudioNodeOutput.cpp:
95         (WebCore::AudioNodeOutput::AudioNodeOutput):
96         * Modules/webaudio/AudioNodeOutput.h:
97         * Modules/webaudio/AudioParamTimeline.h:
98         * Modules/webaudio/AudioScheduledSourceNode.cpp:
99         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
100         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
101         * Modules/webaudio/AudioScheduledSourceNode.h:
102         * Modules/webaudio/AudioSummingJunction.cpp:
103         (WebCore::AudioSummingJunction::AudioSummingJunction):
104         * Modules/webaudio/AudioSummingJunction.h:
105         * Modules/webaudio/BiquadDSPKernel.cpp:
106         * Modules/webaudio/BiquadProcessor.cpp:
107         (WebCore::BiquadProcessor::BiquadProcessor):
108         * Modules/webaudio/BiquadProcessor.h:
109         * Modules/webaudio/ConvolverNode.cpp:
110         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
111         * Modules/webaudio/DelayNode.cpp:
112         * Modules/webaudio/DynamicsCompressorNode.cpp:
113         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
114         * Modules/webaudio/PeriodicWave.cpp:
115         (WebCore::PeriodicWave::PeriodicWave):
116         (WebCore::PeriodicWave::waveDataForFundamentalFrequency):
117         (WebCore::PeriodicWave::numberOfPartialsForRange const):
118         * Modules/webaudio/PeriodicWave.h:
119         * Modules/webaudio/RealtimeAnalyser.cpp:
120         (WebCore::RealtimeAnalyser::RealtimeAnalyser):
121         * Modules/webaudio/RealtimeAnalyser.h:
122         * Modules/webaudio/ScriptProcessorNode.cpp:
123         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
124         * Modules/webaudio/ScriptProcessorNode.h:
125         * Modules/webaudio/WaveShaperProcessor.cpp:
126         (WebCore::WaveShaperProcessor::WaveShaperProcessor):
127         * Modules/webaudio/WaveShaperProcessor.h:
128         * Modules/webaudio/WebKitAudioContext.cpp:
129         * Modules/webaudio/WebKitAudioPannerNode.cpp:
130         (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode):
131         * Modules/webaudio/WebKitAudioPannerNode.h:
132         * platform/audio/AudioBus.cpp:
133         (WebCore::AudioBus::AudioBus):
134         * platform/audio/AudioBus.h:
135         * platform/audio/AudioChannel.h:
136         * platform/audio/AudioDSPKernelProcessor.cpp:
137         (WebCore::AudioDSPKernelProcessor::AudioDSPKernelProcessor):
138         * platform/audio/AudioDSPKernelProcessor.h:
139         * platform/audio/AudioHardwareListener.cpp:
140         (WebCore::AudioHardwareListener::AudioHardwareListener):
141         * platform/audio/AudioHardwareListener.h:
142         * platform/audio/AudioResampler.cpp:
143         (WebCore::AudioResampler::AudioResampler):
144         * platform/audio/AudioResampler.h:
145         * platform/audio/AudioResamplerKernel.cpp:
146         (WebCore::AudioResamplerKernel::AudioResamplerKernel):
147         * platform/audio/AudioResamplerKernel.h:
148         * platform/audio/Biquad.cpp:
149         * platform/audio/Cone.cpp:
150         * platform/audio/Cone.h:
151         * platform/audio/Distance.cpp:
152         * platform/audio/Distance.h:
153         * platform/audio/DownSampler.cpp:
154         (WebCore::DownSampler::DownSampler):
155         * platform/audio/DownSampler.h:
156         * platform/audio/DynamicsCompressorKernel.cpp:
157         (WebCore::DynamicsCompressorKernel::DynamicsCompressorKernel):
158         * platform/audio/DynamicsCompressorKernel.h:
159         * platform/audio/EqualPowerPanner.cpp:
160         (WebCore::EqualPowerPanner::EqualPowerPanner):
161         * platform/audio/EqualPowerPanner.h:
162         * platform/audio/FFTConvolver.cpp:
163         (WebCore::FFTConvolver::FFTConvolver):
164         * platform/audio/FFTConvolver.h:
165         * platform/audio/HRTFDatabase.cpp:
166         (WebCore::HRTFDatabase::HRTFDatabase):
167         * platform/audio/HRTFDatabase.h:
168         * platform/audio/HRTFElevation.cpp:
169         * platform/audio/HRTFElevation.h:
170         * platform/audio/HRTFKernel.cpp:
171         (WebCore::HRTFKernel::HRTFKernel):
172         * platform/audio/HRTFKernel.h:
173         * platform/audio/HRTFPanner.cpp:
174         (WebCore::HRTFPanner::HRTFPanner):
175         * platform/audio/HRTFPanner.h:
176         * platform/audio/PlatformMediaSession.cpp:
177         (WebCore::PlatformMediaSession::PlatformMediaSession):
178         * platform/audio/PlatformMediaSession.h:
179         * platform/audio/PushPullFIFO.cpp:
180         (WebCore::PushPullFIFO::PushPullFIFO):
181         * platform/audio/PushPullFIFO.h:
182         * platform/audio/Reverb.cpp:
183         * platform/audio/ReverbAccumulationBuffer.cpp:
184         (WebCore::ReverbAccumulationBuffer::ReverbAccumulationBuffer):
185         * platform/audio/ReverbAccumulationBuffer.h:
186         * platform/audio/ReverbConvolver.cpp:
187         * platform/audio/ReverbConvolverStage.cpp:
188         (WebCore::ReverbConvolverStage::ReverbConvolverStage):
189         * platform/audio/ReverbConvolverStage.h:
190         * platform/audio/ReverbInputBuffer.cpp:
191         (WebCore::ReverbInputBuffer::ReverbInputBuffer):
192         * platform/audio/ReverbInputBuffer.h:
193
194 2020-09-24  Chris Dumez  <cdumez@apple.com>
195
196         Simplify AudioNode::addInput() / addOutput() call sites
197         https://bugs.webkit.org/show_bug.cgi?id=216941
198
199         Reviewed by Darin Adler.
200
201         Simplify AudioNode::addInput() / addOutput() call sites by moving the input / output
202         node construction from the call site to the function implementation.
203
204         * Modules/webaudio/AnalyserNode.cpp:
205         (WebCore::AnalyserNode::AnalyserNode):
206         * Modules/webaudio/AudioBasicInspectorNode.cpp:
207         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
208         * Modules/webaudio/AudioBasicProcessorNode.cpp:
209         (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode):
210         * Modules/webaudio/AudioBufferSourceNode.cpp:
211         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode):
212         * Modules/webaudio/AudioDestinationNode.cpp:
213         (WebCore::AudioDestinationNode::AudioDestinationNode):
214         * Modules/webaudio/AudioNode.cpp:
215         (WebCore::AudioNode::addInput):
216         (WebCore::AudioNode::addOutput):
217         * Modules/webaudio/AudioNode.h:
218         * Modules/webaudio/ChannelMergerNode.cpp:
219         (WebCore::ChannelMergerNode::ChannelMergerNode):
220         * Modules/webaudio/ChannelSplitterNode.cpp:
221         (WebCore::ChannelSplitterNode::ChannelSplitterNode):
222         * Modules/webaudio/ConstantSourceNode.cpp:
223         (WebCore::ConstantSourceNode::ConstantSourceNode):
224         * Modules/webaudio/ConvolverNode.cpp:
225         (WebCore::ConvolverNode::ConvolverNode):
226         * Modules/webaudio/DynamicsCompressorNode.cpp:
227         (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
228         * Modules/webaudio/GainNode.cpp:
229         (WebCore::GainNode::GainNode):
230         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
231         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
232         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
233         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
234         * Modules/webaudio/OscillatorNode.cpp:
235         (WebCore::OscillatorNode::OscillatorNode):
236         * Modules/webaudio/PannerNode.cpp:
237         (WebCore::PannerNode::PannerNode):
238         * Modules/webaudio/ScriptProcessorNode.cpp:
239         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
240         * Modules/webaudio/StereoPannerNode.cpp:
241         (WebCore::StereoPannerNode::StereoPannerNode):
242         * Modules/webaudio/WebKitAudioPannerNode.cpp:
243         (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode):
244
245 2020-09-24  Chris Dumez  <cdumez@apple.com>
246
247         Declare render quantum size constant in AudioUtilities.h
248         https://bugs.webkit.org/show_bug.cgi?id=216935
249
250         Reviewed by Eric Carlson.
251
252         Declare render quantum size [1] constant in AudioUtilities.h so that it can be used in both
253         platform/ and Modules/webaudio/. Also update the code so that we have a single constant
254         instead of many.
255
256         [1] https://www.w3.org/TR/webaudio/#render-quantum-size
257
258         * Modules/webaudio/AudioListener.cpp:
259         (WebCore::AudioListener::AudioListener):
260         * Modules/webaudio/AudioNode.h:
261         * Modules/webaudio/AudioNodeInput.cpp:
262         (WebCore::AudioNodeInput::AudioNodeInput):
263         (WebCore::AudioNodeInput::updateInternalBus):
264         * Modules/webaudio/AudioNodeOutput.cpp:
265         (WebCore::AudioNodeOutput::AudioNodeOutput):
266         (WebCore::AudioNodeOutput::updateInternalBus):
267         * Modules/webaudio/AudioParam.cpp:
268         (WebCore::AudioParam::calculateFinalValues):
269         (WebCore::AudioParam::calculateTimelineValues):
270         * Modules/webaudio/AudioParamTimeline.cpp:
271         (WebCore::AudioParamTimeline::valueForContextTime):
272         * Modules/webaudio/AudioScheduledSourceNode.cpp:
273         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
274         * Modules/webaudio/BiquadDSPKernel.cpp:
275         (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary):
276         * Modules/webaudio/BiquadProcessor.cpp:
277         (WebCore::BiquadProcessor::processOnlyAudioParams):
278         * Modules/webaudio/ConstantSourceNode.cpp:
279         (WebCore::ConstantSourceNode::ConstantSourceNode):
280         * Modules/webaudio/ConstantSourceNode.h:
281         * Modules/webaudio/ConvolverNode.cpp:
282         (WebCore::ConvolverNode::setBuffer):
283         * Modules/webaudio/DelayDSPKernel.cpp:
284         (WebCore::DelayDSPKernel::DelayDSPKernel):
285         (WebCore::DelayDSPKernel::processOnlyAudioParams):
286         * Modules/webaudio/DynamicsCompressorNode.cpp:
287         (WebCore::DynamicsCompressorNode::processOnlyAudioParams):
288         * Modules/webaudio/GainNode.cpp:
289         (WebCore::GainNode::GainNode):
290         (WebCore::GainNode::processOnlyAudioParams):
291         * Modules/webaudio/OfflineAudioContext.cpp:
292         (WebCore::OfflineAudioContext::suspendOfflineRendering):
293         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
294         (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode):
295         (WebCore::OfflineAudioDestinationNode::offlineRender):
296         * Modules/webaudio/OfflineAudioDestinationNode.h:
297         * Modules/webaudio/OscillatorNode.cpp:
298         (WebCore::OscillatorNode::OscillatorNode):
299         * Modules/webaudio/OscillatorNode.h:
300         * Modules/webaudio/PannerNode.cpp:
301         (WebCore::PannerNode::processOnlyAudioParams):
302         (WebCore::PannerNode::processSampleAccurateValues):
303         * Modules/webaudio/RealtimeAnalyser.cpp:
304         (WebCore::RealtimeAnalyser::RealtimeAnalyser):
305         * Modules/webaudio/ScriptProcessorNode.cpp:
306         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
307         * Modules/webaudio/StereoPannerNode.cpp:
308         (WebCore::StereoPannerNode::StereoPannerNode):
309         (WebCore::StereoPannerNode::processOnlyAudioParams):
310         * Modules/webaudio/StereoPannerNode.h:
311         * Modules/webaudio/WaveShaperDSPKernel.cpp:
312         (WebCore::WaveShaperDSPKernel::lazyInitializeOversampling):
313         (WebCore::WaveShaperDSPKernel::processCurve2x):
314         (WebCore::WaveShaperDSPKernel::processCurve4x):
315         * platform/audio/AudioResamplerKernel.cpp:
316         (WebCore::AudioResamplerKernel::AudioResamplerKernel):
317         (WebCore::AudioResamplerKernel::getSourcePointer):
318         (WebCore::AudioResamplerKernel::process):
319         * platform/audio/AudioResamplerKernel.h:
320         * platform/audio/AudioUtilities.h:
321         * platform/audio/Biquad.cpp:
322         (WebCore::Biquad::Biquad):
323         * platform/audio/Biquad.h:
324         * platform/audio/HRTFPanner.cpp:
325         (WebCore::HRTFPanner::HRTFPanner):
326         (WebCore::HRTFPanner::pan):
327         * platform/audio/IIRFilter.cpp:
328         (WebCore::IIRFilter::tailTime):
329         * platform/audio/cocoa/AudioDestinationCocoa.cpp:
330         (WebCore::AudioDestinationCocoa::AudioDestinationCocoa):
331         (WebCore::AudioDestinationCocoa::render):
332         (WebCore::AudioDestinationCocoa::provideInput):
333         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
334         (WebCore::MediaSessionManagerCocoa::updateSessionState):
335         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
336         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
337         (WebCore::AudioDestinationGStreamer::framesPerBuffer const):
338         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
339         (webkit_web_audio_src_class_init):
340
341 2020-09-24  Youenn Fablet  <youenn@apple.com>
342
343         Add libwebrtc.dylib version check
344         https://bugs.webkit.org/show_bug.cgi?id=216884
345         <rdar://problem/69441354>
346
347         Reviewed by Eric Carlson.
348
349         Use webrtc::isMatchingBundleVersion to check for libwebrtc.dylib presence and for version matching.
350         If version does not match, crash the web process.
351         No change of behavior.
352
353         * SourcesCocoa.txt:
354         * WebCore.xcodeproj/project.pbxproj:
355         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
356         (WebCore::LibWebRTCProvider::webRTCAvailable):
357         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
358         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.mm:
359
360 2020-09-24  Chris Dumez  <cdumez@apple.com>
361
362         Drop AudioNode::reset() and all its overrides
363         https://bugs.webkit.org/show_bug.cgi?id=216932
364
365         Reviewed by Eric Carlson.
366
367         Drop AudioNode::reset() and all its overrides. This is dead code.
368
369         * Modules/webaudio/AnalyserNode.cpp:
370         * Modules/webaudio/AnalyserNode.h:
371         * Modules/webaudio/AudioBasicProcessorNode.cpp:
372         * Modules/webaudio/AudioBasicProcessorNode.h:
373         * Modules/webaudio/AudioBufferSourceNode.cpp:
374         * Modules/webaudio/AudioBufferSourceNode.h:
375         * Modules/webaudio/AudioDestinationNode.h:
376         * Modules/webaudio/AudioNode.h:
377         * Modules/webaudio/ChannelMergerNode.cpp:
378         * Modules/webaudio/ChannelMergerNode.h:
379         * Modules/webaudio/ChannelSplitterNode.cpp:
380         * Modules/webaudio/ChannelSplitterNode.h:
381         * Modules/webaudio/ConstantSourceNode.h:
382         * Modules/webaudio/ConvolverNode.cpp:
383         * Modules/webaudio/ConvolverNode.h:
384         * Modules/webaudio/DynamicsCompressorNode.cpp:
385         * Modules/webaudio/DynamicsCompressorNode.h:
386         * Modules/webaudio/GainNode.cpp:
387         * Modules/webaudio/GainNode.h:
388         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
389         * Modules/webaudio/MediaElementAudioSourceNode.h:
390         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
391         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
392         * Modules/webaudio/MediaStreamAudioSourceNode.h:
393         * Modules/webaudio/OscillatorNode.cpp:
394         * Modules/webaudio/OscillatorNode.h:
395         * Modules/webaudio/PannerNode.cpp:
396         * Modules/webaudio/PannerNode.h:
397         * Modules/webaudio/RealtimeAnalyser.cpp:
398         * Modules/webaudio/RealtimeAnalyser.h:
399         * Modules/webaudio/ScriptProcessorNode.cpp:
400         * Modules/webaudio/ScriptProcessorNode.h:
401         * Modules/webaudio/StereoPannerNode.h:
402         * Modules/webaudio/WebKitAudioPannerNode.cpp:
403         * Modules/webaudio/WebKitAudioPannerNode.h:
404
405 2020-09-24  Carlos Garcia Campos  <cgarcia@igalia.com>
406
407         [GTK][WPE] Move proxy settings from WebKitContext to WebKitWebsiteDataManager
408         https://bugs.webkit.org/show_bug.cgi?id=216927
409
410         Reviewed by Alex Christensen.
411
412         Make proxySettings a member of SoupNetworkSession, instead of being global.
413
414         * platform/network/soup/SoupNetworkSession.cpp:
415         (WebCore::SoupNetworkSession::SoupNetworkSession):
416         (WebCore::SoupNetworkSession::setProxySettings):
417         (WebCore::proxySettings): Deleted.
418         (WebCore::SoupNetworkSession::setupProxy): Deleted.
419         * platform/network/soup/SoupNetworkSession.h:
420
421 2020-09-24  Chris Dumez  <cdumez@apple.com>
422
423         web audio api outputs silence for 302 redirected resource in safari
424         https://bugs.webkit.org/show_bug.cgi?id=214932
425         <rdar://problem/66300050>
426
427         Reviewed by Darin Adler.
428
429         If the resource is redirected to another origin, treat it as tainted only if the crossorigin attribute
430         is not set. This is done for consistency with Blink:
431         - https://github.com/chromium/chromium/blob/master/media/blink/webmediaplayer_impl.cc (see WouldTaintOrigin())
432
433         The new behavior also seems to match Firefox.
434
435         Tests: http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html
436                http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html
437
438         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
439         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
440
441 2020-09-24  Youenn Fablet  <youenn@apple.com>
442
443         Regression(r265280) Web Audio sources malfunction when disconnected from the audio graph
444         https://bugs.webkit.org/show_bug.cgi?id=216703
445         <rdar://problem/69158436>
446
447         Reviewed by Eric Carlson.
448
449         In case of an audio source that stops producing data, but does not end or mute the track,
450         we would continuously try to read the data until getting to the end of the data.
451         When reaching the end of the data, we would return silence and go back in time a little bit
452         to restart playing with some margin. This allows to read just one chunk of audio until we are back to the end of data.
453
454         We fix this by storing the end of the data counter when reaching it.
455         When trying to pull some more data, we will go back in time a little bit only if some more data was added in the meantime.
456         Otherwise, we just output silence.
457
458         Covered by manual test.
459
460         * platform/audio/mac/AudioSampleDataSource.h:
461         * platform/audio/mac/AudioSampleDataSource.mm:
462         (WebCore::AudioSampleDataSource::pullSamplesInternal):
463
464 2020-09-24  Antti Koivisto  <antti@apple.com>
465
466         currentColor isn't recalculated when a text node doesn't exist
467         https://bugs.webkit.org/show_bug.cgi?id=216780
468         <rdar://problem/69320933>
469
470         Reviewed by Antoine Quint.
471
472         We fail to repaint with the new background color when 'background-color' property has value 'currentColor' and the current color changes.
473
474         Test case by Cory LaViska.
475
476         Test: fast/css/currentColor-background-paint.html
477
478         * rendering/style/RenderStyle.cpp:
479         (WebCore::RenderStyle::changeRequiresRepaint const):
480         * rendering/style/StyleBackgroundData.cpp:
481         (WebCore::StyleBackgroundData::isEquivalentForPainting const):
482         * rendering/style/StyleBackgroundData.h:
483
484 2020-09-24  Cathie Chen  <cathiechen@igalia.com>
485
486         Root node with stateless wheel event isn't always scrollable
487         https://bugs.webkit.org/show_bug.cgi?id=216875
488
489         Reviewed by Simon Fraser.
490
491         Root nodes are not always capable of handling wheel event. When it is a stateless wheel event which
492         does not trigger rubber-band, we should check the scroll content of the root node.
493
494         * page/scrolling/ScrollingTreeScrollingNode.cpp:
495         (WebCore::ScrollingTreeScrollingNode::canHandleWheelEvent const): Stateless wheel event
496         doesn't trigger rubber-band, should check the scroll content.
497
498 2020-09-24  Commit Queue  <commit-queue@webkit.org>
499
500         Unreviewed, reverting r267495 and r267512.
501         https://bugs.webkit.org/show_bug.cgi?id=216924
502
503         Broke transform-stream.html test
504
505         Reverted changesets:
506
507         "Missing scope release in JSDOMBuiltinConstructorBase"
508         https://bugs.webkit.org/show_bug.cgi?id=216851
509         https://trac.webkit.org/changeset/267495
510
511         "Unreviewed, we should put it under js/dom since it is not
512         usable in JSC shell"
513         https://bugs.webkit.org/show_bug.cgi?id=216851
514         https://trac.webkit.org/changeset/267512
515
516 2020-09-24  Commit Queue  <commit-queue@webkit.org>
517
518         Unreviewed, reverting r267507.
519         https://bugs.webkit.org/show_bug.cgi?id=216923
520
521         Broke two layout tests on windows
522
523         Reverted changeset:
524
525         "web audio api outputs silence for 302 redirected resource in
526         safari"
527         https://bugs.webkit.org/show_bug.cgi?id=214932
528         https://trac.webkit.org/changeset/267507
529
530 2020-09-24  Youenn Fablet  <youenn@apple.com>
531
532         REGRESSION (iOS/Safari 14): MediaRecorder produces invalid video files
533         https://bugs.webkit.org/show_bug.cgi?id=216832
534         <rdar://problem/69377550>
535
536         Reviewed by Eric Carlson.
537
538         Start the audio and video timestamps at zero.
539         Compute the audio timestamp based on the sample count and the video timestamp based
540         on the time at which the video sample is received.
541
542         Covered by manually testing Safari generated videos on VLC, Chrome and Firefox.
543
544         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
545         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
546         (WebCore::MediaRecorderPrivateWriter::initialize):
547         (WebCore::MediaRecorderPrivateWriter::startAssetWriter):
548         (WebCore::copySampleBufferWithCurrentTimeStamp):
549         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
550         (WebCore::createAudioSampleBuffer):
551         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
552
553 2020-09-23  Peng Liu  <peng.liu6@apple.com>
554
555         Add feature flags for GPU Process features
556         https://bugs.webkit.org/show_bug.cgi?id=216901
557
558         Reviewed by Tim Horton.
559
560         Rename useGPUProcessForMedia to useGPUProcessForMediaEnabled.
561
562         No new tests since no functional changes.
563
564         * page/Settings.yaml:
565
566 2020-09-23  Zalan Bujtas  <zalan@apple.com>
567
568         [LFC][Integration] Line layout logic should consult LayoutState whether remove trailing letter spacing.
569         https://bugs.webkit.org/show_bug.cgi?id=216905
570
571         Reviewed by Sam Weinig.
572
573         This is in preparation for completely moving away from the RuntimeEnabledFeatures check. 
574
575         * layout/LayoutState.cpp:
576         (WebCore::Layout::LayoutState::shouldIgnoreTrailingLetterSpacing const):
577         * layout/LayoutState.h:
578         * layout/inlineformatting/InlineLine.cpp:
579         (WebCore::Layout::Line::Line):
580         (WebCore::Layout::Line::appendTextContent):
581         * layout/inlineformatting/InlineLine.h:
582         * layout/inlineformatting/InlineLineBuilder.cpp:
583         (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem):
584
585 2020-09-20  Simon Fraser  <simon.fraser@apple.com>
586
587         [LFC Display] Add the beginnings of a CSS display box hierarchy and CSS painter
588         https://bugs.webkit.org/show_bug.cgi?id=216752
589
590         Reviewed by Zalan Bujtas.
591
592         Add some Display::Box subclasses to display/css, a Display::Tree class to own the
593         display tree, and a DisplayTreeBuilder. Also add css/DisplayCSSPainter which is
594         the beginnings of a class that knows how to paint a CSS stacking context.
595
596         This code other than DisplayCSSPainter is deliberately vague about how much is
597         CSS specific. It's likely that some box classes will be shared with SVG painting.
598
599         * CMakeLists.txt:
600         * Headers.cmake:
601         * Sources.txt:
602         * WebCore.xcodeproj/project.pbxproj:
603         * display/DisplayLayerController.cpp:
604         (WebCore::Display::LayerController::RootLayerClient::paintContents):
605         (WebCore::Display::LayerController::RootLayerClient::deviceScaleFactor const):
606         (WebCore::Display::LayerController::prepareForDisplay):
607         (WebCore::Display::LayerController::ensureRootLayer):
608         (WebCore::Display::LayerController::updateRootLayerGeometry):
609         * display/DisplayLayerController.h:
610         * display/DisplayTree.cpp: Copied from Source/WebCore/display/DisplayView.h.
611         (WebCore::Display::Tree::Tree):
612         * display/DisplayTree.h: Copied from Source/WebCore/display/DisplayView.h.
613         (WebCore::Display::Tree::rootBox const):
614         * display/DisplayTreeBuilder.cpp: Added.
615         (WebCore::Display::TreeBuilder::TreeBuilder):
616         (WebCore::Display::TreeBuilder::build const):
617         (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const):
618         (WebCore::Display::TreeBuilder::displayBoxForRootBox const):
619         (WebCore::Display::TreeBuilder::displayBoxForLayoutBox const):
620         (WebCore::Display::outputDisplayBox):
621         (WebCore::Display::outputDisplayTree):
622         (WebCore::Display::showDisplayTree):
623         * display/DisplayTreeBuilder.h: Copied from Source/WebCore/display/DisplayView.h.
624         * display/DisplayView.cpp:
625         (WebCore::Display::View::prepareForDisplay):
626         (WebCore::Display::View::deviceScaleFactor const):
627         * display/DisplayView.h:
628         * display/css/DisplayBox.cpp: Copied from Source/WebCore/display/DisplayView.h.
629         (WebCore::Display::Box::Box):
630         (WebCore::Display::Box::setNextSibling):
631         (WebCore::Display::Box::debugDescription const):
632         * display/css/DisplayBox.h: Copied from Source/WebCore/display/DisplayView.h.
633         (WebCore::Display::Box::Box):
634         (WebCore::Display::Box::style const):
635         (WebCore::Display::Box::borderBoxFrame const):
636         (WebCore::Display::Box::isContainerBox const):
637         (WebCore::Display::Box::isImageBox const):
638         (WebCore::Display::Box::isReplacedBox const):
639         (WebCore::Display::Box::nextSibling const):
640         * display/css/DisplayCSSPainter.cpp: Added.
641         (WebCore::Display::CSSPainter::paintBoxDecorations):
642         (WebCore::Display::CSSPainter::paintBoxContent):
643         (WebCore::Display::CSSPainter::paintBox):
644         (WebCore::Display::CSSPainter::recursivePaintDescendants):
645         (WebCore::Display::CSSPainter::paintStackingContext):
646         (WebCore::Display::CSSPainter::isStackingContextPaintingBoundary):
647         (WebCore::Display::CSSPainter::recursiveCollectLayers):
648         (WebCore::Display::CSSPainter::paintTree):
649         * display/css/DisplayCSSPainter.h: Copied from Source/WebCore/display/DisplayView.h.
650         * display/css/DisplayContainerBox.cpp: Copied from Source/WebCore/display/DisplayView.h.
651         (WebCore::Display::ContainerBox::ContainerBox):
652         (WebCore::Display::ContainerBox::setFirstChild):
653         (WebCore::Display::ContainerBox::debugDescription const):
654         * display/css/DisplayContainerBox.h: Copied from Source/WebCore/display/DisplayView.h.
655         (WebCore::Display::ContainerBox::firstChild const):
656         * display/css/DisplayImageBox.cpp: Copied from Source/WebCore/display/DisplayView.h.
657         (WebCore::Display::ImageBox::ImageBox):
658         (WebCore::Display::ImageBox::setImage):
659         (WebCore::Display::ImageBox::debugDescription const):
660         * display/css/DisplayImageBox.h: Copied from Source/WebCore/display/DisplayView.h.
661         (WebCore::Display::ImageBox::image const):
662         * display/css/DisplayReplacedBox.cpp: Copied from Source/WebCore/display/DisplayView.h.
663         (WebCore::Display::ReplacedBox::ReplacedBox):
664         * display/css/DisplayReplacedBox.h: Copied from Source/WebCore/display/DisplayView.h.
665         (WebCore::Display::ReplacedBox::replacedContentRect const):
666         * display/css/DisplayStyle.cpp: Copied from Source/WebCore/display/DisplayView.cpp.
667         (WebCore::Display::Style::Style):
668         (WebCore::Display::Style::hasBackground const):
669         (WebCore::Display::Style::hasVisibleBorder const):
670         * display/css/DisplayStyle.h: Added.
671         (WebCore::Display::Style::backgroundColor const):
672         (WebCore::Display::Style::hasBackgroundImage const):
673         (WebCore::Display::Style::borderLeft const):
674         (WebCore::Display::Style::borderRight const):
675         (WebCore::Display::Style::borderTop const):
676         (WebCore::Display::Style::borderBottom const):
677         (WebCore::Display::Style::zIndex const):
678         (WebCore::Display::Style::isStackingContext const):
679         (WebCore::Display::Style::isPositioned const):
680         (WebCore::Display::Style::isFloating const):
681         (WebCore::Display::Style::participatesInZOrderSorting const):
682         (WebCore::Display::Style::setIsPositioned):
683         (WebCore::Display::Style::setIsFloating):
684         * layout/displaytree/DisplayBox.cpp: Removed.
685         * layout/displaytree/DisplayBox.h: Removed.
686         * layout/layouttree/LayoutIterator.h: Unified sources build fix.
687
688 2020-09-23  Chris Dumez  <cdumez@apple.com>
689
690         web audio api outputs silence for 302 redirected resource in safari
691         https://bugs.webkit.org/show_bug.cgi?id=214932
692         <rdar://problem/66300050>
693
694         Reviewed by Darin Adler.
695
696         If the resource is redirected to another origin, treat it as tainted only if the crossorigin attribute
697         is not set. This is done for consistency with Blink:
698         - https://github.com/chromium/chromium/blob/master/media/blink/webmediaplayer_impl.cc (see WouldTaintOrigin())
699
700         The new behavior also seems to match Firefox.
701
702         Tests: http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html
703                http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html
704
705         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
706         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
707
708 2020-09-23  Chris Dumez  <cdumez@apple.com>
709
710         Use less explicit ref() / deref() calls in WebAudio code
711         https://bugs.webkit.org/show_bug.cgi?id=216894
712
713         Reviewed by Darin Adler.
714
715         * Modules/webaudio/BaseAudioContext.cpp:
716         (WebCore::BaseAudioContext::clearPendingActivity):
717         (WebCore::BaseAudioContext::makePendingActivity):
718         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
719         (WebCore::MediaElementAudioSourceNode::setFormat):
720         (WebCore::MediaElementAudioSourceNode::process):
721         * Modules/webaudio/MediaElementAudioSourceNode.h:
722         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
723         (WebCore::OfflineAudioDestinationNode::startRendering):
724         * html/HTMLMediaElement.cpp:
725         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
726         (WebCore::HTMLMediaElement::createMediaPlayer):
727
728 2020-09-23  Chris Dumez  <cdumez@apple.com>
729
730         Turn off the legacy prefixed WebAudio API
731         https://bugs.webkit.org/show_bug.cgi?id=216886
732
733         Reviewed by Sam Weinig.
734
735         Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled
736         in r267488.
737
738         No new tests, rebaselined existing tests.
739
740         * Modules/webaudio/AudioBufferSourceNode.idl:
741         Make sure legacy constants get unexposed if the PrefixedWebAudio setting is disabled.
742
743         * bindings/scripts/CodeGeneratorJS.pm:
744         (GenerateImplementation):
745         (GetRuntimeEnabledStaticProperties):
746         * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp:
747         (WebCore::JSTestConditionalIncludesConstructor::initializeProperties):
748         (WebCore::JSTestConditionalIncludesPrototype::finishCreation):
749         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
750         (WebCore::JSTestEnabledBySettingConstructor::prototypeForStructure):
751         (WebCore::JSTestEnabledBySettingConstructor::initializeProperties):
752         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
753         * bindings/scripts/test/TestEnabledBySetting.idl:
754         Add support for using [EnabledBySetting=X] on constants.
755
756 2020-09-23  obrufau@igalia.com  <obrufau@igalia.com>
757
758         [css-grid] Clear the override width for computing percent margins
759         https://bugs.webkit.org/show_bug.cgi?id=209461
760
761         Reviewed by Manuel Rego Casasnovas.
762
763         When calculating the min-content contribution of a grid item of an auto
764         sized grid track we must consider the grid item's margin. When the grid
765         item's area is indefinite, a percent margin is resolved to zero.
766         However, when performing a relayout, the percent margin may be solved
767         against the previously computed grid area, since the grid item has
768         already an OverrideContainingBlockLogicalWidth value.
769
770         In order to re-compute the percent margin properly, we need to clear
771         the previously override value. It's important to be careful of not
772         clearing the override value set during intrinsic size, since we need
773         it for the actual layout phase. Hence, we only reset the 'override'
774         value when we are executing a definite strategy.
775
776         This is a reland of r261841, which was reverted because it broke spotify.
777         This problem is now avoided thanks to bug 210089.
778
779         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html
780                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-dynamic-min-contribution-001.html
781                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html
782                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-003.html
783                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-004.html
784                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-005.html
785                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-006.html
786                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-007.html
787                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-008.html
788                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-009.html
789                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-010.html
790                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-005.html
791                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-006.html
792                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-009.html
793                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-010.html
794                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002.html
795                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002.html
796
797         * rendering/GridTrackSizingAlgorithm.cpp:
798         (WebCore::hasRelativeMarginOrPaddingForChild):
799         (WebCore::hasRelativeOrIntrinsicSizeForChild):
800         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
801         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
802         (WebCore::GridTrackSizingAlgorithmStrategy::minLogicalSizeForChild const):
803         (WebCore::DefiniteSizeStrategy::minLogicalSizeForChild const):
804         (WebCore::DefiniteSizeStrategy::minContentForChild const):
805         * rendering/GridTrackSizingAlgorithm.h:
806
807 2020-09-23  Carlos Garcia Campos  <cgarcia@igalia.com>
808
809         [GTK][WPE] Move TLS errors API from WebKitContext to WebKitWebsiteDataManager
810         https://bugs.webkit.org/show_bug.cgi?id=216822
811
812         Reviewed by Alex Christensen.
813
814         Make ignoreTLSErrors a member of SoupNetworkSession, instead of being global.
815
816         * platform/network/soup/SoupNetworkSession.cpp:
817         (WebCore::SoupNetworkSession::setIgnoreTLSErrors):
818         (WebCore::SoupNetworkSession::checkTLSErrors):
819         (WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors): Deleted.
820         * platform/network/soup/SoupNetworkSession.h:
821         * testing/InternalSettings.cpp:
822         (WebCore::InternalSettings::setAllowsAnySSLCertificate): Do not use SoupNetworkSession in the web process.
823
824 2020-09-23  Tim Horton  <timothy_horton@apple.com>
825
826         Fix some typo'd wheel event listener logging
827         https://bugs.webkit.org/show_bug.cgi?id=216892
828
829         Reviewed by Wenson Hsieh.
830
831         * rendering/EventRegion.cpp:
832         (WebCore::EventRegion::uniteEventListeners):
833         Wheel is passive, NonPassiveWheel is active.
834
835 2020-09-23  Fujii Hironori  <Hironori.Fujii@sony.com>
836
837         Remove ENABLE_SVG_FONTS macro
838         https://bugs.webkit.org/show_bug.cgi?id=216850
839
840         Reviewed by Don Olmstead.
841
842         * CMakeLists.txt:
843         * css/CSSFontFace.cpp:
844         (WebCore::CSSFontFace::appendSources):
845         (WebCore::CSSFontFace::hasSVGFontFaceSource const):
846         * css/CSSFontFace.h:
847         * css/CSSFontFaceSource.cpp:
848         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
849         (WebCore::CSSFontFaceSource::load):
850         (WebCore::CSSFontFaceSource::font):
851         (WebCore::CSSFontFaceSource::isSVGFontFaceSource const):
852         * css/CSSFontFaceSource.h:
853         * css/CSSFontFaceSrcValue.cpp:
854         (WebCore::CSSFontFaceSrcValue::isSVGFontTarget const):
855         (WebCore::CSSFontFaceSrcValue::isSupportedFormat const):
856         * css/CSSFontFaceSrcValue.h:
857         * inspector/agents/InspectorPageAgent.cpp:
858         (WebCore::InspectorPageAgent::inspectorResourceType):
859         * loader/LinkLoader.cpp:
860         (WebCore::createLinkPreloadResourceClient):
861         * loader/ResourceLoadInfo.cpp:
862         (WebCore::ContentExtensions::toResourceType):
863         * loader/SubresourceLoader.cpp:
864         (WebCore::logResourceLoaded):
865         * loader/cache/CachedResource.cpp:
866         (WebCore::CachedResource::defaultPriorityForResourceType):
867         (WebCore::CachedResource::isCORSSameOrigin const):
868         * loader/cache/CachedResource.h:
869         * loader/cache/CachedResourceLoader.cpp:
870         (WebCore::createResource):
871         (WebCore::CachedResourceLoader::requestFont):
872         (WebCore::contentTypeFromResourceType):
873         (WebCore::CachedResourceLoader::checkInsecureContent const):
874         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
875         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
876         (WebCore::destinationForType):
877         * loader/cache/CachedSVGFont.cpp:
878         * loader/cache/CachedSVGFont.h:
879         * loader/cache/MemoryCache.cpp:
880         (WebCore::MemoryCache::getStatistics):
881         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
882         * style/StyleResolver.cpp:
883         (WebCore::Style::Resolver::addCurrentSVGFontFaceRules):
884         * svg/SVGAltGlyphDefElement.cpp:
885         * svg/SVGAltGlyphDefElement.h:
886         * svg/SVGAltGlyphDefElement.idl:
887         * svg/SVGAltGlyphElement.cpp:
888         * svg/SVGAltGlyphElement.h:
889         * svg/SVGAltGlyphElement.idl:
890         * svg/SVGAltGlyphItemElement.cpp:
891         * svg/SVGAltGlyphItemElement.h:
892         * svg/SVGAltGlyphItemElement.idl:
893         * svg/SVGDocumentExtensions.cpp:
894         * svg/SVGDocumentExtensions.h:
895         * svg/SVGElement.cpp:
896         (WebCore::SVGElement::childShouldCreateRenderer const):
897         * svg/SVGFontElement.cpp:
898         * svg/SVGFontElement.h:
899         * svg/SVGFontElement.idl:
900         * svg/SVGFontFaceElement.cpp:
901         * svg/SVGFontFaceElement.h:
902         * svg/SVGFontFaceElement.idl:
903         * svg/SVGFontFaceFormatElement.cpp:
904         * svg/SVGFontFaceFormatElement.h:
905         * svg/SVGFontFaceFormatElement.idl:
906         * svg/SVGFontFaceNameElement.cpp:
907         * svg/SVGFontFaceNameElement.h:
908         * svg/SVGFontFaceNameElement.idl:
909         * svg/SVGFontFaceSrcElement.cpp:
910         * svg/SVGFontFaceSrcElement.h:
911         * svg/SVGFontFaceSrcElement.idl:
912         * svg/SVGFontFaceUriElement.cpp:
913         * svg/SVGFontFaceUriElement.h:
914         * svg/SVGFontFaceUriElement.idl:
915         * svg/SVGGlyphElement.cpp:
916         * svg/SVGGlyphElement.h:
917         * svg/SVGGlyphElement.idl:
918         * svg/SVGGlyphRefElement.cpp:
919         * svg/SVGGlyphRefElement.h:
920         * svg/SVGGlyphRefElement.idl:
921         * svg/SVGHKernElement.cpp:
922         * svg/SVGHKernElement.h:
923         * svg/SVGHKernElement.idl:
924         * svg/SVGMissingGlyphElement.cpp:
925         * svg/SVGMissingGlyphElement.h:
926         * svg/SVGMissingGlyphElement.idl:
927         * svg/SVGTRefElement.cpp:
928         (WebCore::SVGTRefElement::rendererIsNeeded):
929         * svg/SVGTSpanElement.cpp:
930         (WebCore::SVGTSpanElement::childShouldCreateRenderer const):
931         (WebCore::SVGTSpanElement::rendererIsNeeded):
932         * svg/SVGTests.cpp:
933         (WebCore::supportedSVGFeatures):
934         * svg/SVGTextElement.cpp:
935         (WebCore::SVGTextElement::childShouldCreateRenderer const):
936         * svg/SVGTextPositioningElement.cpp:
937         (WebCore::SVGTextPositioningElement::elementFromRenderer):
938         * svg/SVGToOTFFontConversion.cpp:
939         * svg/SVGVKernElement.cpp:
940         * svg/SVGVKernElement.h:
941         * svg/SVGVKernElement.idl:
942         * svg/svgtags.in:
943
944 2020-09-23  Tadeu Zagallo  <tzagallo@apple.com>
945
946         Missing scope release in JSDOMBuiltinConstructorBase
947         https://bugs.webkit.org/show_bug.cgi?id=216851
948         <rdar://problem/69144642>
949
950         Reviewed by Yusuke Suzuki.
951
952         In JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments, we should release the
953         ThrowScope before calling into JavaScript since we don't intend to handle the exception.
954
955         Test: js/transform-stream.html
956
957         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
958         (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
959
960 2020-09-23  Zalan Bujtas  <zalan@apple.com>
961
962         [LFC][IFC] Precompute the collapsible trailing width for LineBreaker
963         https://bugs.webkit.org/show_bug.cgi?id=216881
964
965         Reviewed by Antti Koivisto.
966
967         Let's just compute the collapsible trailing width while adding inline content to LineCandidate instead of
968         reverse looping through the runs in LineBreaker.
969         This is also in preparation for reducing the number of RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled calls.
970
971         * layout/inlineformatting/InlineLineBreaker.cpp:
972         (WebCore::Layout::ContinuousContent::hasTrailingCollapsibleContent const):
973         (WebCore::Layout::ContinuousContent::isFullyCollapsible const):
974         (WebCore::Layout::LineBreaker::shouldKeepEndOfLineWhitespace const):
975         (WebCore::Layout::LineBreaker::shouldWrapInlineContent):
976         (WebCore::Layout::LineBreaker::tryWrappingInlineContent const):
977         (WebCore::Layout::ContinuousContent::ContinuousContent):
978         (WebCore::Layout::ContinuousContent::nonCollapsibleLogicalWidth const):
979         (WebCore::Layout::ContinuousContent::isTrailingContentFullyCollapsible const): Deleted.
980         (WebCore::Layout::ContinuousContent::TrailingCollapsibleContent::reset): Deleted.
981         * layout/inlineformatting/InlineLineBreaker.h:
982         * layout/inlineformatting/InlineLineBuilder.cpp:
983         (WebCore::Layout::LineCandidate::InlineContent::collapsibleTrailingWidth const):
984         (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem):
985         (WebCore::Layout::LineCandidate::InlineContent::reset):
986         (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent):
987
988 2020-09-23  Peng Liu  <peng.liu6@apple.com>
989
990         [Media in GPU Process] Implement caption support in video fullscreen and PiP
991         https://bugs.webkit.org/show_bug.cgi?id=208752
992
993         Reviewed by Eric Carlson.
994
995         Export TextTrackRepresentation so that WebKit can use it. Also, update the
996         interface of VideoLayerManagerObjC related to text track representation to
997         use PlatformLayer* instead of TextTrackRepresentation*.
998
999         Manually tested.
1000
1001         * WebCore.xcodeproj/project.pbxproj:
1002         Change target membership of TextTrackRepresentation.h.
1003
1004         * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
1005         * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
1006         (WebCore::VideoLayerManagerObjC::setTextTrackRepresentationLayer):
1007         (WebCore::VideoLayerManagerObjC::setTextTrackRepresentation): Deleted.
1008         Replace setTextTrackRepresentation() with setTextTrackRepresentationLayer().
1009
1010         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1011         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
1012         Use VideoLayerManagerObjC::setTextTrackRepresentationLayer() instead of
1013         VideoLayerManagerObjC::setTextTrackRepresentation().
1014
1015         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1016         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation): Ditto.
1017
1018 2020-09-23  Chris Dumez  <cdumez@apple.com>
1019
1020         webaudio/AudioBufferSource/audiobuffersource-playbackrate.html is crashing
1021         https://bugs.webkit.org/show_bug.cgi?id=216827
1022
1023         Reviewed by Darin Adler.
1024
1025         AudioBufferSourceNode::renderSilenceAndFinishIfNotLooping() would hit an assertion inside
1026         finish() because finish() was already called earlier when calling updateSchedulingInfo().
1027         updateSchedulingInfo() already takes care of calling finish() when we're done playing.
1028         Address the issue by only calling finish() if hasFinished() returns false.
1029
1030         No new tests, unskipped existing test.
1031
1032         * Modules/webaudio/AudioBufferSourceNode.cpp:
1033         (WebCore::AudioBufferSourceNode::renderSilenceAndFinishIfNotLooping):
1034
1035 2020-09-23  Andres Gonzalez  <andresg_22@apple.com>
1036
1037         Fix for accessibility/aria-combobox-control-owns-elements.html in isolated tree mode.
1038         https://bugs.webkit.org/show_bug.cgi?id=216878
1039
1040         Reviewed by Chris Fleizach.
1041
1042         Test: accessibility/aria-combobox-control-owns-elements.html.
1043
1044         * accessibility/AXObjectCache.cpp:
1045         (WebCore::AXObjectCache::updateIsolatedTree): Update the isolated tree
1046         node for ActiveDescendant and SelectedChildren notifications.
1047         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1048         (WebCore::AXIsolatedObject::initializeAttributeData): Only cache
1049         selectedChildren for those AXObjects that canHaveSelectedChildren.
1050
1051 2020-09-23  Philippe Normand  <pnormand@igalia.com>
1052
1053         media/can-play-av1.html is not spec compliant
1054         https://bugs.webkit.org/show_bug.cgi?id=216873
1055
1056         Reviewed by Eric Carlson.
1057
1058         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
1059         (WebCore::GStreamerRegistryScanner::initialize): Add the "av1" codec in the codecs mapping.
1060
1061 2020-09-23  Youenn Fablet  <youenn@apple.com>
1062
1063         Add support for HTMLMediaElement.setSinkId
1064         https://bugs.webkit.org/show_bug.cgi?id=216696
1065
1066         Reviewed by Eric Carlson.
1067
1068         Implement setSinkId and sinkId as per https://w3c.github.io/mediacapture-output/#htmlmediaelement-extensions.
1069         Introduce a setting to expose these methods and to enable/disable user gesture requirement.
1070         Add interfaces to change device output for specific media players.
1071         Add support for HLS, MSE and MediaStreamTrack renderers on MacOS.
1072         In case of setting the empty string, the default output device is used
1073
1074         Tests: http/wpt/audio-output/setSinkId.https.html
1075                imported/w3c/web-platform-tests/audio-output/idlharness.https.window.html
1076                imported/w3c/web-platform-tests/audio-output/setSinkId.https.html
1077
1078         * CMakeLists.txt:
1079         * DerivedSources.make:
1080         * Modules/mediastream/MediaDevices.cpp:
1081         (WebCore::MediaDevices::exposeDevices):
1082         * Modules/mediastream/MediaDevices.h:
1083         * WebCore.xcodeproj/project.pbxproj:
1084         * html/HTMLMediaElement.cpp:
1085         (WebCore::HTMLMediaElement::audioOutputDevice const):
1086         (WebCore::HTMLMediaElement::setAudioOutputDevice):
1087         (WebCore::HTMLMediaElement::audioOutputDeviceId const):
1088         * html/HTMLMediaElement.h:
1089         (WebCore::HTMLMediaElement::audioOutputHashedDeviceId const):
1090         * html/HTMLMediaElementAudioOutput.idl: Added.
1091         * page/Settings.yaml:
1092         * platform/graphics/MediaPlayer.cpp:
1093         (WebCore::MediaPlayer::audioOutputDeviceChanged):
1094         * platform/graphics/MediaPlayer.h:
1095         (WebCore::MediaPlayerClient::audioOutputDeviceId const):
1096         (WebCore::MediaPlayerClient::audioOutputDeviceIdOverride const):
1097         (WebCore::MediaPlayer::audioOutputDeviceId const):
1098         (WebCore::MediaPlayer::audioOutputDeviceIdOverride const):
1099         * platform/graphics/MediaPlayerPrivate.h:
1100         (WebCore::MediaPlayerPrivateInterface::audioOutputDeviceChanged):
1101         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1102         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1103         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1104         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioOutputDeviceChanged):
1105         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1106         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1107         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::audioOutputDeviceChanged):
1108         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1109         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1110         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
1111         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioOutputDeviceChanged):
1112         * platform/mediastream/AudioMediaStreamTrackRenderer.h:
1113         (WebCore::AudioMediaStreamTrackRenderer::setAudioOutputDevice):
1114         * platform/mediastream/AudioTrackPrivateMediaStream.cpp:
1115         (WebCore::AudioTrackPrivateMediaStream::setAudioOutputDevice):
1116         * platform/mediastream/AudioTrackPrivateMediaStream.h:
1117         * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:
1118         (WebCore::AudioMediaStreamTrackRendererCocoa::setAudioOutputDevice):
1119         (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples):
1120         * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h:
1121         * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.cpp:
1122         (WebCore::AudioMediaStreamTrackRendererUnit::setAudioOutputDevice):
1123         (WebCore::AudioMediaStreamTrackRendererUnit::createAudioUnitIfNeeded):
1124         * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h:
1125
1126 2020-09-23  Philippe Normand  <pnormand@igalia.com>
1127
1128         REGRESSION(r267383): fast/mediastream/getUserMedia-webaudio.html is failing
1129         https://bugs.webkit.org/show_bug.cgi?id=216813
1130
1131         Reviewed by Adrian Perez de Castro.
1132
1133         Revert r267428 and fixup the GStreamer FFT implementation which broke in r267383.
1134
1135         * platform/audio/FFTFrame.cpp:
1136         (WebCore::FFTFrame::multiply):
1137         * platform/audio/FFTFrameStub.cpp:
1138         (WebCore::FFTFrame::multiply): Deleted.
1139         * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
1140         (WebCore::FFTFrame::doFFT): Update the real and imaginary arrays after applying the FFT.
1141         (WebCore::FFTFrame::multiply): Deleted.
1142         * platform/audio/mac/FFTFrameMac.cpp:
1143         (WebCore::FFTFrame::multiply): Deleted.
1144
1145 2020-09-23  Philippe Normand  <pnormand@igalia.com>
1146
1147         Unreviewed, prospective GTK build fix after r267449.
1148
1149         * svg/SVGPathBlender.cpp: Include <functional>, needed for std::invoke().
1150
1151 2020-09-23  Cathie Chen  <cathiechen@igalia.com>
1152
1153         Wheel event phases of FrameView are not handled correctly
1154         https://bugs.webkit.org/show_bug.cgi?id=216870
1155
1156         Reviewed by Simon Fraser.
1157
1158         In AsyncScrollingCoordinator::handleWheelEventPhase, the scrollAnimator of a FrameView should be from FrameView itself, not ScrollableArea.
1159         It doesn't call nodeDidHandleEvent to handle wheel event phases when !asyncFrameOrOverflowScrollingEnabled. Should call it after handleWheelEvent.
1160
1161         * page/scrolling/AsyncScrollingCoordinator.cpp:
1162         (WebCore::AsyncScrollingCoordinator::handleWheelEventPhase): When nodeID is FrameView, we should use the scrollAnimator of FrameView instead.
1163         * page/scrolling/ScrollingTree.cpp:
1164         (WebCore::ScrollingTree::handleWheelEvent): If wheelEvent is handled, we should call nodeDidHandleEvent to handle the phases.
1165
1166 2020-09-23  Antti Koivisto  <antti@apple.com>
1167
1168         [LFC][Integration] Add canUseFor functions
1169         https://bugs.webkit.org/show_bug.cgi?id=216869
1170
1171         Reviewed by Zalan Bujtas.
1172
1173         Copy the SLL canUseFor code.
1174
1175         * Sources.txt:
1176         * WebCore.xcodeproj/project.pbxproj:
1177         * layout/integration/LayoutIntegrationCoverage.cpp: Added.
1178         (WebCore::LayoutIntegration::canUseForCharacter):
1179         (WebCore::LayoutIntegration::canUseForText):
1180         (WebCore::LayoutIntegration::canUseForFontAndText):
1181         (WebCore::LayoutIntegration::canUseForStyle):
1182         (WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
1183         (WebCore::LayoutIntegration::canUseForLineLayout):
1184         (WebCore::LayoutIntegration::canUseForLineLayoutAfterStyleChange):
1185         * layout/integration/LayoutIntegrationCoverage.h: Added.
1186
1187         Also switch to OptionSet.
1188
1189         * layout/integration/LayoutIntegrationLineLayout.cpp:
1190         (WebCore::LayoutIntegration::LineLayout::isEnabled):
1191         (WebCore::LayoutIntegration::LineLayout::canUseFor):
1192         (WebCore::LayoutIntegration::LineLayout::canUseForAfterStyleChange):
1193         * layout/integration/LayoutIntegrationLineLayout.h:
1194         (WebCore::LayoutIntegration::LineLayout::canUseFor): Deleted.
1195         * rendering/RenderBlockFlow.cpp:
1196         (WebCore::RenderBlockFlow::layoutInlineChildren):
1197
1198 2020-09-23  Zalan Bujtas  <zalan@apple.com>
1199
1200         [LFC][IFC] Remove redundant RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled from Line::Run::hasTrailingLetterSpacing
1201         https://bugs.webkit.org/show_bug.cgi?id=216867
1202
1203         Reviewed by Simon Fraser.
1204
1205         This codepath is only triggered when Line::TrimmableTrailingContent has a partially trimmable run.
1206         However we don't add such runs unless m_shouldIgnoreTrailingLetterSpacing is false (which is already based on the RuntimeEnabledFeatures flag).
1207
1208         * layout/inlineformatting/InlineLine.cpp:
1209         (WebCore::Layout::Line::Run::hasTrailingLetterSpacing const):
1210         (WebCore::Layout::Line::Run::trailingLetterSpacing const):
1211
1212 2020-09-22  Patrick Angle  <pangle@apple.com>
1213
1214         Web Inspector: Change `InspectorAnimationAgent->startTracking` to not error on repeated calls
1215         https://bugs.webkit.org/show_bug.cgi?id=216385
1216
1217         Reviewed by Devin Rousso.
1218
1219         InpsectorAnimationAgent now mirrors the behavior of other timeline agents by no longer returning an error on a
1220         repeated invocation of `startTracking`.
1221
1222         * inspector/agents/InspectorAnimationAgent.cpp:
1223         (WebCore::InspectorAnimationAgent::startTracking):
1224
1225 2020-09-22  Antti Koivisto  <antti@apple.com>
1226
1227         [LFC][Integration] Basic pagination support
1228         https://bugs.webkit.org/show_bug.cgi?id=215451
1229         <rdar://problem/67482721>
1230
1231         Reviewed by Zalan Bujtas.
1232
1233         Port the Simple Line Layout pagination code to LFC integration layer.
1234         Pagination is the last remaining use of SLL so this patch turns it into dead code.
1235
1236         * Sources.txt:
1237         * WebCore.xcodeproj/project.pbxproj:
1238         * layout/displaytree/DisplayInlineContent.h:
1239         (WebCore::Display::InlineContent::create):
1240         * layout/integration/LayoutIntegrationLineLayout.cpp:
1241         (WebCore::LayoutIntegration::LineLayout::canUseFor):
1242
1243         This now the same as SLL test, covering all cases.
1244
1245         (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
1246         (WebCore::LayoutIntegration::LineLayout::adjustForPagination):
1247         (WebCore::LayoutIntegration::LineLayout::ensureDisplayInlineContent):
1248
1249         This is fairly direct copy of the SLL code. It is not future proof or otherwise great but it serves the job for now.
1250
1251         * layout/integration/LayoutIntegrationLineLayout.h:
1252         (WebCore::LayoutIntegration::LineLayout::isPaginated const):
1253         * layout/integration/LayoutIntegrationPagination.cpp: Added.
1254         (WebCore::LayoutIntegration::computeLineTopAndBottomWithOverflow):
1255         (WebCore::LayoutIntegration::computeLineBreakIndex):
1256         (WebCore::LayoutIntegration::computeOffsetAfterLineBreak):
1257         (WebCore::LayoutIntegration::setPageBreakForLine):
1258         (WebCore::LayoutIntegration::updateMinimumPageHeight):
1259         (WebCore::LayoutIntegration::makeAdjustedContent):
1260         (WebCore::LayoutIntegration::adjustLinePositionsForPagination):
1261         * layout/integration/LayoutIntegrationPagination.h: Copied from Source/WebCore/layout/displaytree/DisplayInlineContent.h.
1262         * rendering/RenderBlockFlow.cpp:
1263         (WebCore::RenderBlockFlow::layoutLFCLines):
1264         (WebCore::RenderBlockFlow::ensureLineBoxes):
1265
1266 2020-09-22  Zalan Bujtas  <zalan@apple.com>
1267
1268         [LFC][Integration] Move RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check out from LineBuilder::constraintsForLine
1269         https://bugs.webkit.org/show_bug.cgi?id=216862
1270
1271         Reviewed by Simon Fraser.
1272
1273         * layout/LayoutState.cpp:
1274         (WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild):
1275         * layout/LayoutState.h:
1276         (WebCore::Layout::LayoutState::isIntegratedRootBoxFirstChild const):
1277         * layout/inlineformatting/InlineFormattingContext.cpp:
1278         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
1279         * layout/inlineformatting/InlineLineBuilder.cpp:
1280         (WebCore::Layout::LineBuilder::constraintsForLine):
1281
1282 2020-09-22  Zalan Bujtas  <zalan@apple.com>
1283
1284         [LFC][Floats] Remove the redundant RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check from FloatingState::append
1285         https://bugs.webkit.org/show_bug.cgi?id=216866
1286
1287         Reviewed by Simon Fraser.
1288
1289         The no-layout-box-for-the-FloatItem codepath is reserved for the IFC integration. This is temporary anyway.
1290
1291         * layout/floats/FloatingState.cpp:
1292         (WebCore::Layout::FloatingState::append):
1293
1294 2020-09-22  Lauro Moura  <lmoura@igalia.com>
1295
1296         [GTK] REGRESSION(r267329): imported/blink/editing/undo/crash-redo-with-iframes.html is crashing
1297         https://bugs.webkit.org/show_bug.cgi?id=216778
1298
1299         Reviewed by Darin Adler.
1300
1301         Covered by existing tests.
1302
1303         * editing/markup.cpp:
1304         (WebCore::serializePreservingVisualAppearanceInternal): Return early
1305         also for "negative" ranges to avoid hitting an assertion inside
1306         serializeNodes, as suggested by Darin.
1307
1308 2020-09-22  Chris Dumez  <cdumez@apple.com>
1309
1310         Slightly improve AudioBufferSourceNode resampling
1311         https://bugs.webkit.org/show_bug.cgi?id=216859
1312
1313         Reviewed by Eric Carlson.
1314
1315         Slightly improve AudioBufferSourceNode resampling. Use simple linear extrapolation
1316         to resample the data when we reach the end of the buffer. Previously, the last
1317         sample would just be repeated enough times.
1318
1319         This is a merge of the following Blink change by Raymond Toy:
1320         - https://chromium-review.googlesource.com/c/chromium/src/+/1211910/
1321
1322         No new tests, rebaselined existing tests.
1323
1324         * Modules/webaudio/AudioBufferSourceNode.cpp:
1325         (WebCore::AudioBufferSourceNode::renderFromBuffer):
1326
1327 2020-09-22  Sam Weinig  <weinig@apple.com>
1328
1329         [WebIDL] Switch to new file name convention for partial interfaces
1330         https://bugs.webkit.org/show_bug.cgi?id=216843
1331
1332         Reviewed by Tim Horton.
1333
1334         Updates all 'partial interface' IDLs to use the new naming convention adopted
1335         in https://webkit.org/b/216729, where they are name as the construction of the
1336         base interface '+' the supplementing spec. So, additions to Document from the
1337         Web Animations spec becomes Document+WebAnimations.idl.
1338         
1339         * accessibility/AccessibilityRenderObject.cpp:
1340         * bindings/js/JSDocumentCustom.cpp:
1341         * bindings/js/JSXMLDocumentCustom.cpp:
1342         * html/HTMLFrameOwnerElement.h:
1343         * loader/FrameLoader.cpp:
1344         * page/FrameView.cpp:
1345         * svg/DocumentSVG.cpp: Added.
1346         * svg/DocumentSVG.h: Added.
1347         * svg/SVGDocument.cpp:
1348         * svg/SVGDocument.h:
1349         * svg/SVGTRefElement.cpp:
1350         * svg/graphics/SVGImage.cpp:
1351         * style/StyleAdjuster.cpp:
1352         * svg/Document+SVG.idl: Added.
1353         * svg/SVGDocument.idl: Removed.
1354         Fix weirdness around SVGDocument. Previously, additions to the Document
1355         interface were in a class that was also a document subclass. Now the two
1356         are split, so the additions are in DocumentSVG.h/cpp, matching convention,
1357         and the subclass remains SVGDocument.h/cpp, also matching convention.
1358
1359         * CMakeLists.txt:
1360         * DerivedSources-input.xcfilelist:
1361         * DerivedSources-output.xcfilelist:
1362         * DerivedSources.make:
1363         * Sources.txt:
1364         * WebCore.xcodeproj/project.pbxproj:
1365         Update for renames.
1366
1367         * Modules/async-clipboard/Navigator+Clipboard.idl: Added.
1368         * Modules/async-clipboard/NavigatorClipboard.idl: Removed.
1369         * Modules/beacon/Navigator+Beacon.idl: Added.
1370         * Modules/beacon/NavigatorBeacon.idl: Removed.
1371         * Modules/cache/DOMWindow+Caches.idl: Added.
1372         * Modules/cache/DOMWindowCaches.idl: Removed.
1373         * Modules/cache/WorkerGlobalScope+Caches.idl: Added.
1374         * Modules/cache/WorkerGlobalScopeCaches.idl: Removed.
1375         * Modules/credentialmanagement/Navigator+Credentials.idl: Added.
1376         * Modules/credentialmanagement/NavigatorCredentials.idl: Removed.
1377         * Modules/encryptedmedia/Navigator+EME.idl: Added.
1378         * Modules/encryptedmedia/NavigatorEME.idl: Removed.
1379         * Modules/entriesapi/HTMLInputElement+EntriesAPI.idl: Added.
1380         * Modules/entriesapi/HTMLInputElementEntriesAPI.idl: Removed.
1381         * Modules/fetch/WindowOrWorkerGlobalScope+Fetch.idl: Added.
1382         * Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl: Removed.
1383         * Modules/gamepad/Navigator+Gamepad.idl: Added.
1384         * Modules/gamepad/NavigatorGamepad.idl: Removed.
1385         * Modules/geolocation/Navigator+Geolocation.idl: Added.
1386         * Modules/geolocation/NavigatorGeolocation.idl: Removed.
1387         * Modules/indexeddb/DOMWindow+IndexedDatabase.idl: Added.
1388         * Modules/indexeddb/DOMWindowIndexedDatabase.idl: Removed.
1389         * Modules/indexeddb/WorkerGlobalScope+IndexedDatabase.idl: Added.
1390         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: Removed.
1391         * Modules/mediacapabilities/Navigator+MediaCapabilities.idl: Added.
1392         * Modules/mediacapabilities/NavigatorMediaCapabilities.idl: Removed.
1393         * Modules/mediasession/HTMLMediaElement+MediaSession.idl: Added.
1394         * Modules/mediasession/HTMLMediaElementMediaSession.idl: Removed.
1395         * Modules/mediasource/AudioTrack+MediaSource.idl: Added.
1396         * Modules/mediasource/AudioTrackMediaSource.idl: Removed.
1397         * Modules/mediasource/DOMURL+MediaSource.idl: Added.
1398         * Modules/mediasource/DOMURLMediaSource.idl: Removed.
1399         * Modules/mediasource/TextTrack+MediaSource.idl: Added.
1400         * Modules/mediasource/TextTrackMediaSource.idl: Removed.
1401         * Modules/mediasource/VideoTrack+MediaSource.idl: Added.
1402         * Modules/mediasource/VideoTrackMediaSource.idl: Removed.
1403         * Modules/mediastream/Navigator+MediaDevices.idl: Added.
1404         * Modules/mediastream/NavigatorMediaDevices.idl: Removed.
1405         * Modules/pictureinpicture/Document+PictureInPicture.idl: Added.
1406         * Modules/pictureinpicture/DocumentOrShadowRoot+PictureInPicture.idl: Added.
1407         * Modules/pictureinpicture/DocumentOrShadowRootPictureInPicture.idl: Removed.
1408         * Modules/pictureinpicture/DocumentPictureInPicture.idl: Removed.
1409         * Modules/pictureinpicture/HTMLVideoElement+PictureInPicture.idl: Added.
1410         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.idl: Removed.
1411         * Modules/quota/DOMWindow+Quota.idl: Added.
1412         * Modules/quota/DOMWindowQuota.idl: Removed.
1413         * Modules/quota/Navigator+StorageQuota.idl: Added.
1414         * Modules/quota/NavigatorStorageQuota.idl: Removed.
1415         * Modules/quota/WorkerNavigator+StorageQuota.idl: Added.
1416         * Modules/quota/WorkerNavigatorStorageQuota.idl: Removed.
1417         * Modules/remoteplayback/HTMLMediaElement+RemotePlayback.idl: Added.
1418         * Modules/remoteplayback/HTMLMediaElementRemotePlayback.idl: Removed.
1419         * Modules/speech/DOMWindow+SpeechSynthesis.idl: Added.
1420         * Modules/speech/DOMWindowSpeechSynthesis.idl: Removed.
1421         * Modules/webdatabase/DOMWindow+WebDatabase.idl: Added.
1422         * Modules/webdatabase/DOMWindowWebDatabase.idl: Removed.
1423         * Modules/webdriver/Navigator+WebDriver.idl: Added.
1424         * Modules/webdriver/NavigatorWebDriver.idl: Removed.
1425         * Modules/webgpu/Navigator+GPU.idl: Added.
1426         * Modules/webgpu/NavigatorGPU.idl: Removed.
1427         * Modules/webgpu/WorkerNavigator+GPU.idl: Added.
1428         * Modules/webgpu/WorkerNavigatorGPU.idl: Removed.
1429         * Modules/webxr/Navigator+WebXR.idl: Added.
1430         * Modules/webxr/NavigatorWebXR.idl: Removed.
1431         * animation/Document+WebAnimations.idl: Added.
1432         * animation/DocumentAnimations.idl: Removed.
1433         * animation/DocumentOrShadowRoot+WebAnimations.idl: Added.
1434         * animation/DocumentOrShadowRootAnimations.idl: Removed.
1435         * animation/GlobalEventHandlers+CSSAnimations.idl: Added.
1436         * animation/GlobalEventHandlers+CSSTransitions.idl: Added.
1437         * animation/GlobalEventHandlersCSSAnimations.idl: Removed.
1438         * animation/GlobalEventHandlersCSSTransitions.idl: Removed.
1439         * css/DOMCSSNamespace+CSSPainting.idl: Added.
1440         * css/DOMCSSNamespace+CSSPropertiesandValues.idl: Added.
1441         * css/DOMCSSPaintWorklet.idl: Removed.
1442         * css/DOMCSSRegisterCustomProperty.idl: Removed.
1443         * css/DocumentOrShadowRoot+CSSOM.idl: Added.
1444         * css/DocumentOrShadowRootStyleSheets.idl: Removed.
1445         * dom/Document+CSSOMView.idl: Added.
1446         * dom/Document+Fullscreen.idl: Added.
1447         * dom/Document+HTML.idl: Added.
1448         * dom/Document+HTMLObsolete.idl: Added.
1449         * dom/Document+PageVisibility.idl: Added.
1450         * dom/Document+PointerLock.idl: Added.
1451         * dom/Document+Selection.idl: Added.
1452         * dom/Document+StorageAccess.idl: Added.
1453         * dom/Document+Touch.idl: Added.
1454         * dom/Document+UndoMananger.idl: Added.
1455         * dom/DocumentFullscreen.idl: Removed.
1456         * dom/DocumentHTML.idl: Removed.
1457         * dom/DocumentHTMLObsolete.idl: Removed.
1458         * dom/DocumentOrShadowRoot+PointerLock.idl: Added.
1459         * dom/DocumentOrShadowRootPointerLock.idl: Removed.
1460         * dom/DocumentPageVisibility.idl: Removed.
1461         * dom/DocumentPointerLock.idl: Removed.
1462         * dom/DocumentScrolling.idl: Removed.
1463         * dom/DocumentSelection.idl: Removed.
1464         * dom/DocumentStorageAccess.idl: Removed.
1465         * dom/DocumentTouch.idl: Removed.
1466         * dom/DocumentUndoMananger.idl: Removed.
1467         * dom/Element+DOMParsing.idl: Added.
1468         * dom/ElementDOMParsing.idl: Removed.
1469         * dom/GlobalEventHandlers+PointerEvents.idl: Added.
1470         * dom/GlobalEventHandlersPointerEvents.idl: Removed.
1471         * page/Navigator+IsLoggedIn.idl: Added.
1472         * page/NavigatorIsLoggedIn.idl: Removed.
1473         Rename IDLs.
1474
1475 2020-09-22  Zalan Bujtas  <zalan@apple.com>
1476
1477         [LFC][IFC] Used geometry for inline level boxes should be in the coordinate system of the formatting context root
1478         https://bugs.webkit.org/show_bug.cgi?id=216854
1479
1480         Reviewed by Simon Fraser.
1481
1482         Convert inline level box geometry from relative to the line box to relative to the formatting context root.
1483
1484         * layout/inlineformatting/InlineFormattingContext.cpp:
1485         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
1486
1487 2020-09-22  Chris Dumez  <cdumez@apple.com>
1488
1489         Fix BiquadFilterNode's lowpass & highpass filters
1490         https://bugs.webkit.org/show_bug.cgi?id=216852
1491
1492         Reviewed by Eric Carlson.
1493
1494         Fix BiquadFilterNode's lowpass & highpass filters. They incorrectly clamp the
1495         resonance to make it positive.
1496
1497         Formulas for the filters are specified here:
1498         - https://www.w3.org/TR/webaudio/#filters-characteristics
1499
1500         No new tests, rebaselined existing tests.
1501
1502         * platform/audio/Biquad.cpp:
1503         (WebCore::pow10):
1504         (WebCore::Biquad::setLowpassParams):
1505         (WebCore::Biquad::setHighpassParams):
1506
1507 2020-09-22  Chris Dumez  <cdumez@apple.com>
1508
1509         Merge AudioBufferSourceNode loop fixes from Blink
1510         https://bugs.webkit.org/show_bug.cgi?id=216849
1511
1512         Reviewed by Eric Carlson.
1513
1514         Merge AudioBufferSourceNode loop fixes from Blink, the following one in particular:
1515         - https://codereview.chromium.org/723823002
1516
1517         This allows us to pass all the checks in:
1518         webaudio/AudioBufferSource/audiobuffersource-loop-comprehensive.html.
1519
1520         No new tests, rebaselined existing test.
1521
1522         * Modules/webaudio/AudioBufferSourceNode.cpp:
1523         (WebCore::AudioBufferSourceNode::renderFromBuffer):
1524         (WebCore::AudioBufferSourceNode::adjustGrainParameters):
1525         Merge loop fixes from Blink.
1526
1527         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1528         (WebCore::AudioScheduledSourceNode::stopLater):
1529         Stop throwing when m_endTime is already set. Our behavior did not match
1530         Chrome and Firefox here. This was causing some existing tests to start
1531         failing now that providing a grain duration when calling start() would
1532         set m_endTime if loop() returns true.
1533
1534 2020-09-22  Sihui Liu  <sihui_liu@apple.com>
1535
1536         REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath
1537         https://bugs.webkit.org/show_bug.cgi?id=216846
1538
1539         Reviewed by Wenson Hsieh.
1540
1541         TextIterator does not visit node that has no renderer, so if node has become hidden, TextManipulationController 
1542         will not find content node in paragraph range during replacement.
1543
1544         API Test: TextManipulation.CompleteTextManipulationParagraphBecomesHidden
1545
1546         * editing/TextManipulationController.cpp:
1547         (WebCore::TextManipulationController::replace):
1548
1549 2020-09-22  Zalan Bujtas  <zalan@apple.com>
1550
1551         [LFC][IFC] Atomic inline-level box with margin is mispositioned
1552         https://bugs.webkit.org/show_bug.cgi?id=216842
1553
1554         Reviewed by Antti Koivisto.
1555
1556         The inline box that an atomic inline-level box generates has the height of the margin box. Therefore the inline box's logical top position
1557         is the position of the top edge of the margin box.
1558         When converting the inline box geometry back to the layout box, we need to offset the top position (border box top edge)
1559         with the value of the used margin before.
1560
1561         * layout/inlineformatting/InlineFormattingContext.cpp:
1562         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
1563
1564 2020-09-22  Chris Dumez  <cdumez@apple.com>
1565
1566         AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end
1567         https://bugs.webkit.org/show_bug.cgi?id=216839
1568
1569         Reviewed by Eric Carlson.
1570
1571         AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end,
1572         as specified here:
1573         - https://www.w3.org/TR/webaudio/#dom-audioparam-setvaluecurveattime
1574
1575         """
1576         An implicit call to setValueAtTime() is made at time π‘‡0+𝑇𝐷 with value π‘‰[π‘βˆ’1] so that
1577         following automations will start from the end of the setValueCurveAtTime() event.
1578         """
1579
1580         No new tests, rebaselined existing test.
1581
1582         * Modules/webaudio/AudioParamTimeline.cpp:
1583         (WebCore::AudioParamTimeline::setValueCurveAtTime):
1584
1585 2020-09-22  Zalan Bujtas  <zalan@apple.com>
1586
1587         [LFC][IFC] Add support for multiline inline box geometry.
1588         https://bugs.webkit.org/show_bug.cgi?id=216835
1589
1590         Reviewed by Antti Koivisto.
1591
1592         This patch computes the geometry for inline boxes spanning multiple lines (e.g. <span>first line<br>next line</span).
1593         However this is not the getBoundingClientRect() type of geometry where we provide geometry for each fragments. This is more like the
1594         element.offset* geometry where we compute the enclosing rectangle for all the fragments.
1595
1596         * layout/inlineformatting/InlineFormattingContext.cpp:
1597         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): Decouple the run construction and inline box geometry update logic,
1598         where we loop through the runs and create "line runs" when needed and then we loop through the inline boxes on the current line and
1599         update the box geometries.
1600  
1601         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
1602         * layout/inlineformatting/InlineFormattingState.h:
1603         (WebCore::Layout::InlineFormattingState::lineBoxes const):
1604         (WebCore::Layout::InlineFormattingState::addLineBox):
1605         (WebCore::Layout::InlineFormattingState::clearLineAndRuns):
1606         (WebCore::Layout::InlineFormattingState::shrinkToFit):
1607         * layout/inlineformatting/InlineLineBox.h:
1608         (WebCore::Layout::LineBox::containsInlineLevelBox const):
1609
1610 2020-09-22  Chris Dumez  <cdumez@apple.com>
1611
1612         AudioParams with automations must process timelines
1613         https://bugs.webkit.org/show_bug.cgi?id=216837
1614
1615         Reviewed by Darin Adler.
1616
1617         Currently, if an AudioNode has no inputs connected, any automations
1618         (or connections) to an AudioParam of the node is not processed. Thus,
1619         time never advances on the AudioParam, and any upstream graph
1620         connected to the AudioParam never gets pulled for data.
1621
1622         AudioParam should get processed so that time progresses. Normal
1623         processing of the node causes AudioParams to be processed, so we were
1624         only missing the case where the node has silent inputs (silent or no
1625         inputs). Then we just need to update the AudioParams, without having
1626         to do the full processing associated with the node.
1627
1628         See https://webaudio.github.io/web-audio-api/#rendering-loop, step 8.1.1
1629         in particular that says any inputs connected to an AudioParam are 
1630         processed. There are no conditions on when this happens.
1631
1632         This is a merge of the following Blink change by Raymond Toy:
1633         - https://codereview.chromium.org/2420983002
1634
1635         No new tests, rebaselined existing test.
1636
1637         * Modules/webaudio/AudioBasicProcessorNode.cpp:
1638         (WebCore::AudioBasicProcessorNode::processOnlyAudioParams):
1639         * Modules/webaudio/AudioBasicProcessorNode.h:
1640         * Modules/webaudio/AudioListener.h:
1641         * Modules/webaudio/AudioNode.cpp:
1642         (WebCore::AudioNode::processIfNecessary):
1643         * Modules/webaudio/AudioNode.h:
1644         (WebCore::AudioNode::processOnlyAudioParams):
1645         * Modules/webaudio/BiquadFilterNode.cpp:
1646         (WebCore::BiquadFilterNode::BiquadFilterNode):
1647         * Modules/webaudio/BiquadProcessor.cpp:
1648         (WebCore::BiquadProcessor::processOnlyAudioParams):
1649         * Modules/webaudio/BiquadProcessor.h:
1650         * Modules/webaudio/DelayDSPKernel.cpp:
1651         (WebCore::DelayDSPKernel::processOnlyAudioParams):
1652         * Modules/webaudio/DelayDSPKernel.h:
1653         * Modules/webaudio/DelayNode.cpp:
1654         (WebCore::DelayNode::DelayNode):
1655         * Modules/webaudio/DynamicsCompressorNode.cpp:
1656         (WebCore::DynamicsCompressorNode::processOnlyAudioParams):
1657         * Modules/webaudio/DynamicsCompressorNode.h:
1658         * Modules/webaudio/GainNode.cpp:
1659         (WebCore::GainNode::processOnlyAudioParams):
1660         * Modules/webaudio/GainNode.h:
1661         * Modules/webaudio/PannerNode.cpp:
1662         (WebCore::PannerNode::processOnlyAudioParams):
1663         * Modules/webaudio/PannerNode.h:
1664         * Modules/webaudio/StereoPannerNode.cpp:
1665         (WebCore::StereoPannerNode::processOnlyAudioParams):
1666         * Modules/webaudio/StereoPannerNode.h:
1667         * platform/audio/AudioDSPKernel.h:
1668         (WebCore::AudioDSPKernel::processOnlyAudioParams):
1669         * platform/audio/AudioDSPKernelProcessor.cpp:
1670         (WebCore::AudioDSPKernelProcessor::processOnlyAudioParams):
1671         * platform/audio/AudioDSPKernelProcessor.h:
1672         * platform/audio/AudioProcessor.h:
1673         (WebCore::AudioProcessor::processOnlyAudioParams):
1674
1675 2020-09-22  Chris Dumez  <cdumez@apple.com>
1676
1677         Unreviewed, partial revert of r267383.
1678
1679         Restore GStreamer-specific implementation of FFTFrame::multiply() since it appears
1680         r267383 introduced test failures on GTK port.
1681
1682         * platform/audio/FFTFrame.cpp:
1683         (WebCore::FFTFrame::multiply): Deleted.
1684         * platform/audio/FFTFrameStub.cpp:
1685         (WebCore::FFTFrame::multiply):
1686         * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
1687         (WebCore::FFTFrame::multiply):
1688         * platform/audio/mac/FFTFrameMac.cpp:
1689         (WebCore::FFTFrame::multiply):
1690
1691 2020-09-22  Zalan Bujtas  <zalan@apple.com>
1692
1693         [LFC] FormattingState should never be copied.
1694         https://bugs.webkit.org/show_bug.cgi?id=216833
1695
1696         Reviewed by Antti Koivisto.
1697
1698         Even when running a throw-away layout, we should not copy the state object but instead generate a new one for the subtree.
1699         These objects should never be copied in general.
1700
1701         * layout/FormattingState.h:
1702         * layout/LayoutState.h:
1703         * layout/tableformatting/TableFormattingContextGeometry.cpp:
1704         (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):
1705
1706 2020-09-22  Youenn Fablet  <youenn@apple.com>
1707
1708         Implement a default prompt for getUserMedia
1709         https://bugs.webkit.org/show_bug.cgi?id=216821
1710
1711         Reviewed by Eric Carlson.
1712
1713         Manually tested by running Minibrowser.
1714
1715         * en.lproj/Localizable.strings:
1716
1717 2020-09-22  Chris Dumez  <cdumez@apple.com>
1718
1719         webaudio/AudioParam/audioparam-setTarget-timeConstant-0.html is crashing
1720         https://bugs.webkit.org/show_bug.cgi?id=216824
1721
1722         Reviewed by Darin Adler.
1723
1724         If the time constant pass to AudioParam.setTargetAtTime() is 0, then insert a SetValue event in
1725         the timeline instead of a SetTarget one, causing us to instantly jump to the target value. This
1726         matches the Blink behavior.
1727
1728         No new tests, unskipped existing test.
1729
1730         * Modules/webaudio/AudioParamTimeline.cpp:
1731         (WebCore::AudioParamTimeline::setTargetAtTime):
1732
1733 2020-09-22  Brian Burg  <bburg@apple.com>
1734
1735         [Cocoa] _WKInspectorDelegate should handle showing external resources
1736         https://bugs.webkit.org/show_bug.cgi?id=216334
1737
1738         Reviewed by Devin Rousso.
1739
1740         Adapt to the rename of InspectorFrontendHost.{openInNewTab => openURLExternally}.
1741
1742         * inspector/InspectorFrontendClient.h:
1743         * inspector/InspectorFrontendClientLocal.cpp:
1744         (WebCore::InspectorFrontendClientLocal::openURLExternally):
1745         (WebCore::InspectorFrontendClientLocal::openInNewTab): Deleted.
1746         * inspector/InspectorFrontendClientLocal.h:
1747         * inspector/InspectorFrontendHost.cpp:
1748         (WebCore::InspectorFrontendHost::openURLExternally):
1749         (WebCore::InspectorFrontendHost::openInNewTab): Deleted.
1750         * inspector/InspectorFrontendHost.h:
1751         * inspector/InspectorFrontendHost.idl:
1752
1753 2020-09-22  Sam Weinig  <weinig@apple.com>
1754
1755         [WebIDL] Split up Performance.idl into component partials
1756         https://bugs.webkit.org/show_bug.cgi?id=216729
1757
1758         Reviewed by Darin Adler.
1759
1760         Split additions to the Peformance interface from the Navagation Timing,
1761         Resource Timing, User Timing and Performance Timeline specs into their
1762         own IDL files. Trying something new with the naming (using Performance
1763         '+' name of the spec supplying the addition) for these partials to test
1764         the waters.
1765
1766         * CMakeLists.txt:
1767         * DerivedSources-input.xcfilelist:
1768         * DerivedSources-output.xcfilelist:
1769         * DerivedSources.make:
1770         * WebCore.xcodeproj/project.pbxproj:
1771         * page/Performance+NavigationTiming.idl: Added.
1772         * page/Performance+PerformanceTimeline.idl: Added.
1773         * page/Performance+ResourceTiming.idl: Added.
1774         * page/Performance+UserTiming.idl: Added.
1775         * page/Performance.idl:
1776
1777 2020-09-22  Zalan Bujtas  <zalan@apple.com>
1778
1779         [LFC][IFC] TextUtil::split needs logical left
1780         https://bugs.webkit.org/show_bug.cgi?id=216798
1781
1782         Reviewed by Antti Koivisto.
1783
1784         Measuring text content requires logical left offset (e.g. tab size depends on the logical position).
1785         Let's pass in the current logical left position to TextUtil::split.
1786
1787         * layout/inlineformatting/InlineLineBreaker.cpp:
1788         (WebCore::Layout::ContinuousContent::runs const):
1789         (WebCore::Layout::ContinuousContent::isEmpty const):
1790         (WebCore::Layout::ContinuousContent::logicalWidth const):
1791         (WebCore::Layout::ContinuousContent::logicalLeft const):
1792         (WebCore::Layout::ContinuousContent::nonCollapsibleLogicalWidth const):
1793         (WebCore::Layout::LineBreaker::isContentWrappingAllowed const):
1794         (WebCore::Layout::LineBreaker::shouldKeepEndOfLineWhitespace const):
1795         (WebCore::Layout::LineBreaker::shouldWrapInlineContent):
1796         (WebCore::Layout::LineBreaker::tryWrappingInlineContent const):
1797         (WebCore::Layout::LineBreaker::wrapTextContent const):
1798         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
1799         (WebCore::Layout::ContinuousContent::ContinuousContent):
1800         (WebCore::Layout::ContinuousContent::hasTextContentOnly const):
1801         (WebCore::Layout::ContinuousContent::isVisuallyEmptyWhitespaceContentOnly const):
1802         (WebCore::Layout::ContinuousContent::firstTextRunIndex const):
1803         (WebCore::Layout::ContinuousContent::lastContentRunIndex const):
1804         (WebCore::Layout::ContinuousContent::hasNonContentRunsOnly const):
1805         (WebCore::Layout::ContinuousContent::size const): Deleted.
1806         (WebCore::Layout::ContinuousContent::width const): Deleted.
1807         (WebCore::Layout::ContinuousContent::nonCollapsibleWidth const): Deleted.
1808         * layout/inlineformatting/InlineLineBreaker.h:
1809         * layout/inlineformatting/InlineLineBuilder.cpp:
1810         (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent):
1811
1812 2020-09-22  Sam Weinig  <weinig@apple.com>
1813
1814         Update User Timing interfaces to User Timing Level 3
1815         https://bugs.webkit.org/show_bug.cgi?id=216787
1816
1817         Reviewed by Alex Christensen.
1818
1819         Adds support for User Timing Level 3 which adds more flexibility in how PerformanceMarks
1820         and PerformanceMeasures are created via synthetic start/end times and associate 'details'
1821         values serialized with events themselves.
1822
1823         Updates results to existing WPT and standalone tests.
1824
1825         * CMakeLists.txt:
1826         * DerivedSources-input.xcfilelist:
1827         * DerivedSources-output.xcfilelist:
1828         * DerivedSources.make:
1829         * Sources.txt:
1830         * WebCore.xcodeproj/project.pbxproj:
1831         Add new files.
1832
1833         * page/Performance.cpp:
1834         (WebCore::Performance::mark):
1835         (WebCore::Performance::clearMarks):
1836         (WebCore::Performance::measure):
1837         (WebCore::Performance::clearMeasures):
1838         * page/Performance.h:
1839         * page/Performance.idl:
1840         Update for new signatures for mark and measure, and rename of UserTiming to PerformanceUserTiming.
1841
1842         * page/PerformanceMark.cpp: Added.
1843         (WebCore::peformanceNow):
1844         (WebCore::PerformanceMark::create):
1845         (WebCore::PerformanceMark::PerformanceMark):
1846         (WebCore::PerformanceMark::detail):
1847         * page/PerformanceMark.h:
1848         * page/PerformanceMark.idl:
1849         Add support for PerformanceMark's constructor `detail` getter. While the spec says to
1850         serialize and the deserialize in the constructor, we only serialize, and delay deserialization
1851         until the first access, which is a non-observable difference. We also utilize [CachedAttribute]
1852         to only ever deserialize once per wrapper world (and also greatly simplify the GC shenanigans).
1853         
1854         * page/PerformanceMarkOptions.h: Added.
1855         * page/PerformanceMarkOptions.idl: Added.
1856         Import and bind PerformanceMarkOptions dictionary to a new struct.
1857         
1858         * page/PerformanceMeasure.cpp: Added.
1859         (WebCore::PerformanceMeasure::create):
1860         (WebCore::PerformanceMeasure::PerformanceMeasure):
1861         (WebCore::PerformanceMeasure::detail):
1862         * page/PerformanceMeasure.h:
1863         * page/PerformanceMeasure.idl:
1864         Like with PerformanceMark, but there is no constructor here, so we only need to handle adding
1865         support for the detail getter.
1866
1867         * page/PerformanceMeasureOptions.h: Added.
1868         * page/PerformanceMeasureOptions.idl: Added.
1869         Import and bind PerformanceMeasureOptions dictionary to a new struct.
1870         
1871         * page/PerformanceUserTiming.cpp:
1872         (WebCore::restrictedMarkNamesToNavigationTimingFunctionMap):
1873         (WebCore::restrictedMarkFunction):
1874         (WebCore::isRestrictedMarkNameNonMainThread):
1875         (WebCore::PerformanceUserTiming::isRestrictedMarkName):
1876         Split up existing map to enable accessing it safely from a worker using conservative
1877         callOnMainThreadAndWait approach, though since the map is immutable after initialization,
1878         we can probably optimize this to allow concurrent querying in the future.
1879
1880         (WebCore::addPerformanceEntry):
1881         Add helper, mirroring clearPerformanceEntries, to add entries.
1882
1883         (WebCore::PerformanceUserTiming::mark):
1884         Matching the spec language, utilize the new PerformanceMark constructor to create
1885         the mark.
1886
1887         (WebCore::PerformanceUserTiming::convertMarkToTimestamp const):
1888         (WebCore::isNonEmptyDictionary):
1889         (WebCore::PerformanceUserTiming::measure):
1890         Implement measure support by dispatching various combinations of arguments to
1891         overloads manually by inspecting the Variant.
1892
1893         * page/PerformanceUserTiming.h:
1894         Renames class from UserTiming to PerformanceUserTiming to match file names.
1895
1896 2020-09-22  Youenn Fablet  <youenn@apple.com>
1897
1898         toRTCIceProtocol should handle ssltcp candidates
1899         https://bugs.webkit.org/show_bug.cgi?id=216762
1900
1901         Reviewed by Darin Adler.
1902
1903         Covered by mock WebRTC backend pushing ssltcp candidates.
1904
1905         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1906         (WebCore::toRTCIceProtocol):
1907         * testing/MockLibWebRTCPeerConnection.cpp:
1908
1909 2020-09-21  Adrian Perez de Castro  <aperez@igalia.com>
1910
1911         [GTK] Bump cairo version to support HiDPI
1912         https://bugs.webkit.org/show_bug.cgi?id=133378
1913
1914         Reviewed by Carlos Garcia Campos.
1915
1916         Remove conditional compilation around cairo_{g,s}et_device_scale() as there is no need to
1917         support older versions of Cairo which lack the functions. The minimum version of Cairo
1918         being required by CMake is 1.14.0, which already includes them.
1919
1920         No new tests needed.
1921
1922         * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:
1923         (WebCore::createCairoImageSurfaceWithFastMalloc): Use cairo_surface_set_device_scale()
1924         directly.
1925         (WebCore::BackingStoreBackendCairoImpl::scroll): Use cairo_surface_get_device_scale()
1926         directly.
1927         * platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:
1928         (WebCore::BackingStoreBackendCairoX11::BackingStoreBackendCairoX11): Use
1929         cairo_surface_set_device_scale() directly.
1930         (WebCore::BackingStoreBackendCairoX11::scroll): Use cairo_surface_get_device_scale()
1931         directly.
1932         * platform/graphics/cairo/CairoUtilities.cpp: Remove helper functions
1933         cairoSurfaceSetDeviceScale() and cairoSurfaceGetDeviceScale().
1934         * platform/graphics/cairo/CairoUtilities.h: Ditto.
1935
1936 2020-09-21  Tim Horton  <timothy_horton@apple.com>
1937
1938         paper.io ad close buttons cannot be iteracted with via trackpad on iPad
1939         https://bugs.webkit.org/show_bug.cgi?id=216812
1940         <rdar://problem/68738585>
1941
1942         Reviewed by Wenson Hsieh.
1943
1944         * platform/RuntimeApplicationChecks.h:
1945         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1946         (WebCore::IOSApplication::isPaperIO):
1947
1948 2020-09-21  Chris Dumez  <cdumez@apple.com>
1949
1950         Value returned by AudioParamTimeline::valuesForTimeRange() is sometimes incorrect for exponential ramps
1951         https://bugs.webkit.org/show_bug.cgi?id=216811
1952
1953         Reviewed by Darin Adler.
1954
1955         AudioParamTimeline::valuesForTimeRangeImpl() always need to return the *last* value since this is
1956         what will be used to update AudioParam::m_value to its latest value. We had a bug in our exponential
1957         ramp processing causing value to be multiplied one extra time.
1958
1959         No new tests, rebaselined existing test.
1960
1961         * Modules/webaudio/AudioParamTimeline.cpp:
1962         (WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
1963
1964 2020-09-21  Chris Dumez  <cdumez@apple.com>
1965
1966         AudioBufferSourceNode should update grain parameters when buffer is set after rendering has started
1967         https://bugs.webkit.org/show_bug.cgi?id=216808
1968
1969         Reviewed by Eric Carlson.
1970
1971         AudioBufferSourceNode should update grain parameters when buffer is set after rendering has
1972         started. The grain parameters need to be adjusted so that they make sense given the buffer
1973         length. Previously, we would only update grain parameters in AudioBufferSourceNode::startPlaying(),
1974         when a buffer is set. We would fail to update those grain parameters when the buffer is set,
1975         in setBuffer(), if startPlaying() has already been called.
1976
1977         No new tests, rebaselined existing test.
1978
1979         * Modules/webaudio/AudioBufferSourceNode.cpp:
1980         (WebCore::AudioBufferSourceNode::setBuffer):
1981         (WebCore::AudioBufferSourceNode::startLater):
1982         (WebCore::AudioBufferSourceNode::startPlaying):
1983         (WebCore::AudioBufferSourceNode::updateGrainParameters):
1984         * Modules/webaudio/AudioBufferSourceNode.h:
1985
1986 2020-09-21  Chris Dumez  <cdumez@apple.com>
1987
1988         Values returned by FFTFrame::doFFT() are twice as large as they should be
1989         https://bugs.webkit.org/show_bug.cgi?id=216781
1990
1991         Reviewed by Darin Adler.
1992
1993         To provide the best possible execution speeds, the vDSP library's functions don't always adhere strictly
1994         to textbook formulas for Fourier transforms, and must be scaled accordingly [1].
1995
1996         In the case of a Real forward Transform like in FFTFrame::doFFT(): RFimp = RFmath * 2 so we need to
1997         divide the output by 2 to get the correct value. We were failing to do this scaling and this was causing
1998         AnalyserNode tests to fail.
1999
2000         [1] See https://developer.apple.com/library/archive/documentation/Performance/Conceptual/vDSP_Programming_Guide/UsingFourierTransforms/UsingFourierTransforms.html#//apple_ref/doc/uid/TP40005147-CH3-SW5
2001
2002         No new tests, rebaselined existing tests.
2003
2004         * Modules/webaudio/PeriodicWave.cpp:
2005         (WebCore::PeriodicWave::createBandLimitedTables):
2006         Update normalization factor now that FFTFrame::doInverseFFT() has been fixed. The new normalization factor
2007         matches the value used by blink at:
2008         - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/periodic_wave.cc
2009
2010         * platform/audio/FFTFrame.cpp:
2011         (WebCore::FFTFrame::multiply):
2012         We were applying a 0.5 scaling factor to the output of vDSP_zvmul(). However, the documentation for vDSP_zvmul()
2013         does not indicate that its output is twice as large as expected. Odds are that this was done because we used
2014         to have a bug in FFTFrame::doFFT() that was returning values twice as large as expected. SInce this function
2015         relies on VectorMath, there is no need for its implementation to be platform-specific.
2016
2017         * platform/audio/FFTFrameStub.cpp:
2018         * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
2019         (WebCore::FFTFrame::doFFT):
2020         (WebCore::FFTFrame::doInverseFFT):
2021         Drop 2 factor in the GStreamer implementation that was added to try and be consistent with the incorrect Mac
2022         implementation.
2023
2024         * platform/audio/mac/FFTFrameMac.cpp:
2025         (WebCore::FFTFrame::doFFT):
2026         Fix issue where the values returned by doFFT() were twice as large as expected due to the odd behavior of
2027         vDSP_fft_zrip().
2028
2029         (WebCore::FFTFrame::doInverseFFT):
2030         Drop 2 factor in doInverseFFT that was added because the output of doFFT() was twice as large as expected
2031         and we wanted x == InverseFFT(FFT(x)).
2032
2033 2020-09-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2034
2035         [GPU Process] Several tests in canvas/philip/tests are failing with text diffs
2036         https://bugs.webkit.org/show_bug.cgi?id=216800
2037
2038         Reviewed by Darin Adler.
2039
2040         When using the GPU process to render canvas elements, we currently fail the 7 tests in `canvas/philip/tests`
2041         below, due to gradient and pattern fill/stroke styles lingering on the 2D graphics context state after a fill or
2042         stroke color is set, respectively.
2043
2044         This happens when:
2045         1. The fill color is set to a color `C`.
2046         2. A fill pattern or gradient is applied.
2047         3. The fill color is set to the color `C` again.
2048
2049         In this case, after step (2), we propagate a graphics context state change indicating that the fill pattern has
2050         changed, but we leave the fill color unchanged (i.e., it remains equal to `C`). In step (3), we then set the
2051         fill color to `C` again, which doesn't propagate a state change to the GPU process, since the fill color is the
2052         same (`C`). As such, the state in the GPU process keeps its fill gradient, and we end up filling with this old
2053         gradient instead of the fill color `C`.
2054
2055         To fix this, we simply revert `fillColor` and `strokeColor` to the invalid color when setting a gradient or
2056         pattern in the same way that we currently clear out the fill/stroke gradient and pattern when setting a fill/
2057         stroke color, which ensures that a state change will be sent to the GPU process during step (3).
2058
2059         Fixes the following canvas-related layout tests when using the GPU process:
2060         - canvas/philip/tests/2d.gradient.radial.cone.shape2.html
2061         - canvas/philip/tests/2d.pattern.basic.nocontext.html
2062         - canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html
2063         - canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html
2064         - canvas/philip/tests/2d.pattern.paint.repeatx.outside.html
2065         - canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html
2066         - canvas/philip/tests/2d.pattern.paint.repeaty.outside.html
2067
2068         The entire canvas/ directory is currently skipped when enabling the GPU process for canvas rendering, but once
2069         we're down to a smaller number of failures, I intend to unskip these directories for GPU process, and
2070         individually track any remaining test failures.
2071
2072         * platform/graphics/GraphicsContext.cpp:
2073         (WebCore::GraphicsContext::setStrokePattern):
2074         (WebCore::GraphicsContext::setFillPattern):
2075         (WebCore::GraphicsContext::setStrokeGradient):
2076         (WebCore::GraphicsContext::setFillGradient):
2077
2078 2020-09-21  Chris Dumez  <cdumez@apple.com>
2079
2080         Properly handle AudioParam.setTargetAtTime() followed by a ramp
2081         https://bugs.webkit.org/show_bug.cgi?id=216804
2082
2083         Reviewed by Darin Adler.
2084
2085         Properly handle AudioParam.setTargetAtTime() followed by a ramp:
2086         - https://www.w3.org/TR/webaudio/#dom-audioparam-settargetattime
2087         - https://www.w3.org/TR/webaudio/#dom-audioparam-linearramptovalueattime
2088         - https://www.w3.org/TR/webaudio/#dom-audioparam-exponentialramptovalueattime
2089
2090         This is a merge of the following Blink change:
2091         - https://codereview.chromium.org/1485003002
2092
2093         No new tests, rebaselined existing test.
2094
2095         * Modules/webaudio/AudioParamTimeline.cpp:
2096         (WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
2097         (WebCore::AudioParamTimeline::processSetTargetFollowedByRamp):
2098         * Modules/webaudio/AudioParamTimeline.h:
2099
2100 2020-09-21  Antoine Quint  <graouts@webkit.org>
2101
2102         Remove unused NodeFlag::HasCSSAnimation
2103         https://bugs.webkit.org/show_bug.cgi?id=216785
2104
2105         Reviewed by Antti Koivisto.
2106
2107         * dom/Element.h:
2108         (WebCore::Element::hasCSSAnimation const): Deleted.
2109         (WebCore::Element::setHasCSSAnimation): Deleted.
2110         (WebCore::Element::clearHasCSSAnimation): Deleted.
2111         * dom/Node.h:
2112
2113 2020-09-21  Chris Dumez  <cdumez@apple.com>
2114
2115         Throw when AudioConnect::connect() is called for an output that has no channels
2116         https://bugs.webkit.org/show_bug.cgi?id=216802
2117
2118         Reviewed by Darin Adler.
2119
2120         Throw when AudioConnect::connect() is called for an output that has no channels, for consistency
2121         with Blink. The ScriptProcessorNode cannot have an output node that has zero channels.
2122
2123         No new tests, rebaselined existing tests.
2124
2125         * Modules/webaudio/AudioNode.cpp:
2126         (WebCore::AudioNode::connect):
2127
2128 2020-09-21  Yusuke Suzuki  <ysuzuki@apple.com>
2129
2130         [JSC] BigInt should work with Map / Set
2131         https://bugs.webkit.org/show_bug.cgi?id=216667
2132         <rdar://problem/69107221>
2133
2134         Reviewed by Robin Morisset.
2135
2136         Strongly ensure that BigInt32 is always selected since Map / Set could use it as a key.
2137
2138         * bindings/js/SerializedScriptValue.cpp:
2139         (WebCore::CloneDeserializer::readBigInt):
2140
2141 2020-09-21  Peng Liu  <peng.liu6@apple.com>
2142
2143         Tapping to zoom in and out causes video to become very small on some iPhone models
2144         https://bugs.webkit.org/show_bug.cgi?id=216635
2145
2146         Reviewed by Jer Noble.
2147
2148         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2149         (-[WebAVPlayerLayer resolveBounds]): On some iPhone models, AVKit does not
2150         change "bounds" of WebAVPlayerLayer after changing its video gravity. Therefore,
2151         in this function, "modelVideoLayerFrame" and "bounds" might be the same. But we
2152         still need to update the video layer frame in the Web process.
2153
2154         (-[WebAVPlayerLayer setVideoGravity:]): On some iPhone models, AVKit does
2155         not call -[WebAVPlayerLayer:layoutSublayers] immediately after changing
2156         the video gravity. Forcing a layout can fix that.
2157
2158 2020-09-21  Jiewen Tan  <jiewen_tan@apple.com>
2159
2160         [WebAuthn] Don't set the UV option if the authenticator doesn't support it
2161         https://bugs.webkit.org/show_bug.cgi?id=215836
2162         <rdar://problem/67817359>
2163
2164         Reviewed by Darin Adler.
2165
2166         Covered by new API tests.
2167
2168         UV in the the CTAP 2.0 spec only means internal UV:
2169         https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorGetInfo
2170
2171         If an authenticator supports ClientPin, it can set the uv bit in the responses to true but it
2172         will not advertise itself supporting internal UV, which is the uv in the options.
2173         https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorMakeCredential
2174
2175         Hence, setting it to true could result in error if the authenticator doesn't support internal UV even if it supports ClientPin.
2176         It's not a way to ask the authenticator to set the uv bit in the response.
2177
2178         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
2179         (fido::encodeMakeCredenitalRequestAsCBOR):
2180         (fido::encodeGetAssertionRequestAsCBOR):
2181
2182 2020-09-21  Chris Dumez  <cdumez@apple.com>
2183
2184         AudioParam.exponentialRampToValueAtTime() does not properly deal with negative values
2185         https://bugs.webkit.org/show_bug.cgi?id=216790
2186
2187         Reviewed by Eric Carlson.
2188
2189         AudioParam.exponentialRampToValueAtTime() does not properly deal with negative values.
2190         The specification [1] says:
2191         "If V0 and V1 have opposite signs or if V0 is zero, then v(t) = V0 for T0 <= t < T1."
2192
2193         Our implementation did not match the specification and would just special-case if either
2194         V0 or V1 was negative.
2195
2196         [1] https://www.w3.org/TR/webaudio/#dom-audioparam-exponentialramptovalueattime
2197
2198         No new tests, rebaselined existing test.
2199
2200         * Modules/webaudio/AudioParamTimeline.cpp:
2201         (WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
2202
2203 2020-09-21  Youenn Fablet  <youenn@apple.com>
2204
2205         [iOS] MediaRecorder incorrect screen orientation handling
2206         https://bugs.webkit.org/show_bug.cgi?id=198912
2207         <rdar://problem/51802521>
2208
2209         Reviewed by Eric Carlson.
2210
2211         Update MediaRecorderPrivateWriterCocoa to pass a MediaSample down to handle rotation.
2212         Set AVAssetWriterInput transform according the first MediaSample rotation value.
2213
2214         Test: http/wpt/mediarecorder/video-rotation.html
2215
2216         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
2217         (WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable):
2218         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2219         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2220         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2221
2222 2020-09-21  Keith Miller  <keith_miller@apple.com>
2223
2224         Functions should consistently enumerate length before name
2225         https://bugs.webkit.org/show_bug.cgi?id=216789
2226
2227         Reviewed by Yusuke Suzuki.
2228
2229         RuntimeMethod inherits from InternalFunction which now sets length by default.
2230         RuntimeMethod intercepts length in getOwnPropertySlot so the value we pick
2231         doesn't actually matter. Technically, this uses a little extra memory but
2232         that's not too big of a deal because RuntimeMethod's are rare (and I believe
2233         deprecated).
2234
2235         * bridge/runtime_method.cpp:
2236         (JSC::RuntimeMethod::finishCreation):
2237
2238 2020-09-20  Darin Adler  <darin@apple.com>
2239
2240         Next step towards eliminating deprecated legacy positions
2241         https://bugs.webkit.org/show_bug.cgi?id=216751
2242
2243         Reviewed by Sam Weinig.
2244
2245         Eliminating our old deprecated legacy editing positions is probably a relatively long
2246         road. This next step starts using the makeContainerOffsetPosition function in more
2247         places, requesting that we not use any of the deprecated legacy position logic. Also
2248         renames createLegacyEditingPosition to makeDeprecatedLegacyPosition. The hard part of
2249         this project will be removing code that is not inside Position that depends on the old
2250         style of position/offset pairs. For this patch, tried to stick to converting cases
2251         where it seems clear we don't depend on the legacy behavior. Flaw in that is that we
2252         might still depend on legacy behavior where it's unconditionally implemented, without
2253         checking the flag on the m_isLegacyEditingPosition Position class; that will be a
2254         problem long term, should not be in this patch.
2255
2256         * dom/Position.h:
2257         (WebCore::createLegacyEditingPosition): Deleted.
2258
2259         * accessibility/AXObjectCache.cpp:
2260         (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
2261         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
2262         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
2263         (WebCore::AXObjectCache::localCaretRectForCharacterOffset):
2264         (WebCore::AXObjectCache::indexForCharacterOffset):
2265         * accessibility/AccessibilityObject.cpp:
2266         (WebCore::AccessibilityObject::stringForRange const):
2267         * accessibility/AccessibilityRenderObject.cpp:
2268         (WebCore::AccessibilityRenderObject::linkClickPoint):
2269         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
2270         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const):
2271         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2272         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
2273         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2274         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
2275         * dom/Position.cpp:
2276         (WebCore::Position::previous const):
2277         (WebCore::Position::next const):
2278         (WebCore::Position::downstream const):
2279         * dom/PositionIterator.cpp:
2280         (WebCore::PositionIterator::operator Position const):
2281         * dom/Range.cpp:
2282         (WebCore::Range::expand):
2283         * editing/AlternativeTextController.cpp:
2284         (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
2285         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
2286         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2287         * editing/ApplyStyleCommand.cpp:
2288         (WebCore::ApplyStyleCommand::applyBlockStyle):
2289         * editing/CompositeEditCommand.cpp:
2290         (WebCore::CompositeEditCommand::moveParagraphs):
2291         * editing/DeleteSelectionCommand.cpp:
2292         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
2293         * editing/Editing.cpp:
2294         (WebCore::visiblePositionForIndex):
2295         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2296         (WebCore::isNodeVisiblyContainedWithin):
2297         * editing/Editor.cpp:
2298         (WebCore::Editor::canDeleteRange const):
2299         (WebCore::Editor::selectComposition):
2300         (WebCore::Editor::advanceToNextMisspelling):
2301         (WebCore::Editor::markAndReplaceFor):
2302         (WebCore::Editor::firstRectForRange const):
2303         (WebCore::extendSelection):
2304         (WebCore::Editor::adjustedSelectionRange):
2305         * editing/FrameSelection.cpp:
2306         (WebCore::FrameSelection::elementRangeContainingCaretSelection const):
2307         * editing/InsertListCommand.cpp:
2308         (WebCore::InsertListCommand::doApplyForSingleParagraph):
2309         * editing/RenderedPosition.cpp:
2310         (WebCore::RenderedPosition::positionAtLeftBoundaryOfBiDiRun const):
2311         (WebCore::RenderedPosition::positionAtRightBoundaryOfBiDiRun const):
2312         * editing/TextCheckingHelper.cpp:
2313         (WebCore::expandToParagraphBoundary):
2314         (WebCore::TextCheckingParagraph::expandRangeToNextEnd):
2315         (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const):
2316         * editing/TextIterator.cpp:
2317         (WebCore::resolveCharacterRange):
2318         * editing/VisiblePosition.cpp:
2319         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
2320         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
2321         * editing/VisibleSelection.cpp:
2322         (WebCore::VisibleSelection::appendTrailingWhitespace):
2323         * editing/VisibleUnits.cpp:
2324         (WebCore::previousRootInlineBoxCandidatePosition):
2325         (WebCore::nextRootInlineBoxCandidatePosition):
2326         (WebCore::previousBoundary):
2327         (WebCore::nextBoundary):
2328         (WebCore::startOfDocument):
2329         (WebCore::endOfDocument):
2330         (WebCore::closestWordBoundaryForPosition):
2331         (WebCore::wordBoundaryForPositionWithoutCrossingLine):
2332         * editing/cocoa/HTMLConverter.mm:
2333         (HTMLConverter::HTMLConverter):
2334         * editing/ios/EditorIOS.mm:
2335         (WebCore::Editor::setTextAsChildOfElement):
2336         * editing/markup.cpp:
2337         (WebCore::serializePreservingVisualAppearance):
2338         (WebCore::contextPreservesNewline):
2339         (WebCore::createFragmentFromText):
2340         * page/DragController.cpp:
2341         (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret):
2342         * page/Page.cpp:
2343         (WebCore::Page::replaceRangesWithText):
2344         * page/ios/FrameIOS.mm:
2345         (WebCore::Frame::interpretationsForCurrentRoot const):
2346         * platform/DragImage.cpp:
2347         (WebCore::createDragImageForRange):
2348         * rendering/RenderBlockFlow.cpp:
2349         (WebCore::RenderBlockFlow::positionForBox const):
2350         * rendering/RenderObject.cpp:
2351         (WebCore::RenderObject::createVisiblePosition const):
2352         (WebCore::RenderObject::collectSelectionRectsInternal):
2353         * testing/Internals.cpp:
2354         (WebCore::Internals::setSelectionWithoutValidation):
2355         Replaced calls to createLegacyEditingPosition with calls to
2356         makeDeprecatedLegacyPosition or makeContainerOffsetPosition.
2357
2358 2020-09-20  Darin Adler  <darin@apple.com>
2359
2360         Selection API: A few more refinements to DOMSelection and VisibleSelection to pass all WPT tests
2361         https://bugs.webkit.org/show_bug.cgi?id=216756
2362
2363         Reviewed by Ryosuke Niwa.
2364
2365         After these changes, we pass all the tests in imported/w3c/web-platform-tests/selection
2366         with no failures except for one due to the rules about absorbing newlines at the start
2367         and end <style> and <script> elements.
2368
2369         However, that's with the live selection range feature enabled, and there are likely issues
2370         with other tests in that mode, so that testing still needs to be done. Then we also have to
2371         decide how we are going to deal with the compatibility risk of changing the behavior to
2372         match the standard.
2373
2374         * editing/VisibleSelection.cpp:
2375         (WebCore::VisibleSelection::VisibleSelection): Updated to rename m_baseIsFirst to
2376         m_anchorIsFirst. Not required for the fix, but helpful for clarity.
2377         (WebCore::VisibleSelection::uncanonicalizedStart const): Ditto.
2378         (WebCore::VisibleSelection::uncanonicalizedEnd const): Ditto.
2379         (WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents): Compute whether
2380         the anchor is first *before* canonicalization, otherwise we will reverse the two
2381         if their canonical values are equal. Canonicalization is not allowed to change
2382         the ordering other than making two values equal.
2383         (WebCore::VisibleSelection::validate): Updated for name.
2384         (WebCore::VisibleSelection::setWithoutValidation): Ditto, also tweaked other names in the
2385         function and removed an if statement.
2386         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): Ditto.
2387         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): Ditto.
2388
2389         * editing/VisibleSelection.h: Renamed m_baseIsFirst to m_anchorIsFirst and improved the
2390         comment about m_isDirectional.
2391
2392         * page/DOMSelection.cpp:
2393         (WebCore::DOMSelection::anchorPosition const): Removed use of parentAnchoredEquivalent.
2394         The name makes it sound like it would be useful, but really it just triggers some
2395         editing behaviors that don't belong in Position code.
2396         (WebCore::DOMSelection::focusPosition const): Ditto.
2397         (WebCore::DOMSelection::basePosition const): Ditto.
2398         (WebCore::DOMSelection::extentPosition const): Ditto.
2399         (WebCore::DOMSelection::collapse): Reversed the order of the document check and the
2400         check for invalid nodes and offsets. There are some inconsistencies between the
2401         specification and WPT but for now matching WPT seems like the way to go.
2402         (WebCore::DOMSelection::setBaseAndExtent): Ditto.
2403         (WebCore::DOMSelection::extend): Use VisibleSelection::setExtent, which does exactly
2404         what we want, rather than FrameSelection::setExtent, which does not. In the future
2405         we may want to cut down on the number of subtly-different selection functions,
2406         like these two, but for now this fixes this DOM method to work as specified.
2407
2408 2020-09-21  Chris Dumez  <cdumez@apple.com>
2409
2410         Remove emphasis/de-emphasis filters from DynamicsCompressor
2411         https://bugs.webkit.org/show_bug.cgi?id=216796
2412
2413         Reviewed by Darin Adler.
2414
2415         Remove emphasis/de-emphasis filters from DynamicsCompressor as these have been removed
2416         from the specification.
2417
2418         This is a merge of the following Blink change:
2419         - https://codereview.chromium.org/152333003 
2420
2421         No new tests, rebaselined existing tests.
2422
2423         * platform/audio/DynamicsCompressor.cpp:
2424         (WebCore::DynamicsCompressor::DynamicsCompressor):
2425         (WebCore::DynamicsCompressor::process):
2426         (WebCore::DynamicsCompressor::reset):
2427         (WebCore::DynamicsCompressor::setNumberOfChannels):
2428         * platform/audio/DynamicsCompressor.h:
2429         * platform/audio/DynamicsCompressorKernel.cpp:
2430         (WebCore::DynamicsCompressorKernel::process):
2431         (WebCore::DynamicsCompressorKernel::tailTime const):
2432         * platform/audio/DynamicsCompressorKernel.h:
2433
2434 2020-09-21  Chris Dumez  <cdumez@apple.com>
2435
2436         Vectorize linearRampToValueAtTime processing in AudioParamTimeline
2437         https://bugs.webkit.org/show_bug.cgi?id=216788
2438
2439         Reviewed by Darin Adler.
2440
2441         Vectorize linearRampToValueAtTime processing in AudioParamTimeline. This patch is based on
2442         the Blink implementation at [1] but updated to use VectorMath to work on more platforms.
2443
2444         We were failing some tests due to precision issues in our linearRampToValueAtTime implementation.
2445         Those tests are now passing since our implementation matches Blink's more closely.
2446
2447         [1] https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc
2448
2449         No new tests, rebaselined existing tests.
2450
2451         * Modules/webaudio/AudioParamTimeline.cpp:
2452         (WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
2453         (WebCore::AudioParamTimeline::processLinearRamp):
2454         * Modules/webaudio/AudioParamTimeline.h:
2455
2456 2020-09-21  Chris Dumez  <cdumez@apple.com>
2457
2458         AnalyserNode's getByteFrequencyData() / getFloatFrequencyData() should only do FFT analysis once per render quantum
2459         https://bugs.webkit.org/show_bug.cgi?id=216735
2460
2461         Reviewed by Darin Adler.
2462
2463         AnalyserNode's getByteFrequencyData() / getFloatFrequencyData() should only do FFT analysis once per render quantum:
2464         - https://www.w3.org/TR/webaudio/#dom-analysernode-getbytefrequencydata
2465
2466         """
2467         If another call to getByteFrequencyData() or getFloatFrequencyData() occurs within the same render quantum as a
2468         previous call, the current frequency data is not updated with the same data. Instead, the previously computed data
2469         is returned.
2470         """
2471
2472         No new tests, rebaselined existing test.
2473
2474         * Modules/webaudio/RealtimeAnalyser.cpp:
2475         (WebCore::RealtimeAnalyser::writeInput):
2476         (WebCore::RealtimeAnalyser::doFFTAnalysisIfNecessary):
2477         (WebCore::RealtimeAnalyser::getFloatFrequencyData):
2478         (WebCore::RealtimeAnalyser::getByteFrequencyData):
2479         * Modules/webaudio/RealtimeAnalyser.h:
2480
2481 2020-09-21  Antoine Quint  <graouts@webkit.org>
2482
2483         Remove dedicated HashSet<Element*> for DocumentTimeline::runningAnimationsForElementAreAllAccelerated()
2484         https://bugs.webkit.org/show_bug.cgi?id=216775
2485
2486         Reviewed by Antti Koivisto.
2487
2488         * animation/AnimationTimeline.h:
2489         * animation/DocumentTimeline.cpp:
2490         (WebCore::DocumentTimeline::detachFromDocument):
2491         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
2492         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const):
2493         (WebCore::DocumentTimeline::animationWasAddedToElement): Deleted.
2494         (WebCore::DocumentTimeline::animationWasRemovedFromElement): Deleted.
2495         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Deleted.
2496         * animation/DocumentTimeline.h:
2497
2498 2020-09-21  Chris Dumez  <cdumez@apple.com>
2499
2500         AnalyserNode should downmix input audio to mono
2501         https://bugs.webkit.org/show_bug.cgi?id=216736
2502
2503         Reviewed by Sam Weinig.
2504
2505         AnalyserNode should downmix input audio to mono:
2506         - https://www.w3.org/TR/webaudio/#current-time-domain-data
2507
2508         This patch is based on the following Blink change:
2509         - https://codereview.chromium.org/1803233002
2510
2511         No new tests, rebaselined existing test.
2512
2513         * Modules/webaudio/RealtimeAnalyser.cpp:
2514         (WebCore::RealtimeAnalyser::RealtimeAnalyser):
2515         (WebCore::RealtimeAnalyser::writeInput):
2516         * Modules/webaudio/RealtimeAnalyser.h:
2517
2518 2020-09-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2519
2520         REGRESSION (r257839): Can't add a memo when transferring funds in First Tech Credit Union App
2521         https://bugs.webkit.org/show_bug.cgi?id=216754
2522         <rdar://problem/67045862>
2523
2524         Reviewed by Antti Koivisto.
2525
2526         After r257839, attempting to add a memo by tapping on a text box in the First Tech Credit Union app on iOS fails
2527         to cause the text box (a `textarea` element) to be focused. This is because the `textarea` is initially hidden
2528         away in a `display: none;` parent container, which becomes `display: block;` immediately before `focus()` is
2529         called from the page's script.
2530
2531         Augment the mechanism added in r266887, so that we avoid consulting stale computed styles when checking for
2532         hidden ancestors in `Element::isVisibleWithoutResolvingFullStyle()`. To do this, we pull logic to get or compute
2533         the `RenderStyle` for the current element or one of its composed ancestors (which respects
2534         `IsComputedStyleInvalidFlag`) into a lambda function, and use this lambda function below, when we walk up the
2535         ancestor chain in search of a hidden element.
2536
2537         Note that in Speedometer 2.0, this change does not have any significant impact on the number of partial (i.e.
2538         `RenderedOnly`) style resolutions we attempt to perform underneath `Element::resolveComputedStyle` (a little
2539         over 3000 before and after this change).
2540
2541         Test: fast/forms/programmatic-focus-after-displaying-parent.html
2542
2543         * dom/Element.cpp:
2544         (WebCore::Element::isVisibleWithoutResolvingFullStyle const):
2545
2546 2020-09-21  Zalan Bujtas  <zalan@apple.com>
2547
2548         [LFC][BFC] Move hasClearance out of BoxGeometry
2549         https://bugs.webkit.org/show_bug.cgi?id=216757
2550
2551         Reviewed by Antti Koivisto.
2552
2553         Do not cache the hasClearance state in BoxGeometry.
2554
2555         * layout/blockformatting/BlockFormattingContext.cpp:
2556         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
2557         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
2558         * layout/blockformatting/BlockFormattingState.h:
2559         (WebCore::Layout::BlockFormattingState::setHasClearance):
2560         (WebCore::Layout::BlockFormattingState::clearClearance):
2561         (WebCore::Layout::BlockFormattingState::hasClearance const):
2562         * layout/blockformatting/BlockMarginCollapse.cpp:
2563         (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
2564         * layout/layouttree/LayoutBoxGeometry.cpp:
2565         (WebCore::Layout::BoxGeometry::BoxGeometry):
2566         * layout/layouttree/LayoutBoxGeometry.h:
2567         (WebCore::Layout::BoxGeometry::hasClearance const): Deleted.
2568         (WebCore::Layout::BoxGeometry::setHasClearance): Deleted.
2569
2570 2020-09-21  Zalan Bujtas  <zalan@apple.com>
2571
2572         [LFC] Remove unused EscapeReason::StrokeOverflowNeedsViewportGeometry
2573         https://bugs.webkit.org/show_bug.cgi?id=216759
2574
2575         Reviewed by Antti Koivisto.
2576
2577         This escape reason was used to read ICB geometry to compute ink overflow (prior to r267325).
2578
2579         * layout/FormattingContext.cpp:
2580         (WebCore::Layout::FormattingContext::geometryForBox const):
2581         * layout/FormattingContext.h:
2582
2583 2020-09-21  Zalan Bujtas  <zalan@apple.com>
2584
2585         [LFC][MarginCollapse] The block level box passed in to MarginCollapse::positiveNegativeValues is in the current formatting context
2586         https://bugs.webkit.org/show_bug.cgi?id=216758
2587
2588         Reviewed by Antti Koivisto.
2589
2590         Let's use the current formatting state when grabbing vertical margin values.
2591
2592         * layout/blockformatting/BlockMarginCollapse.cpp:
2593         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
2594
2595 2020-09-21  Philippe Normand  <pnormand@igalia.com>
2596
2597         [GStreamer] media/media-can-play-mp3.html fails
2598         https://bugs.webkit.org/show_bug.cgi?id=216692
2599
2600         Reviewed by Darin Adler.
2601
2602         Add mp3 to supported codecs map when a valid decoder has been
2603         found by the GStreamer registry scanner.
2604
2605         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
2606         (WebCore::GStreamerRegistryScanner::initialize):
2607
2608 2020-09-20  Sam Weinig  <weinig@apple.com>
2609
2610         Performance.navigation and Performance.timing are incorrectly exposed to workers
2611         https://bugs.webkit.org/show_bug.cgi?id=216732
2612
2613         Reviewed by Simon Fraser.
2614
2615         * page/Performance.idl:
2616         Only expose Performance.navigation and Performance.timing to the Window.
2617
2618 2020-09-20  Sam Weinig  <weinig@apple.com>
2619
2620         Using [Exposed=Window] with [Default] object toJSON() doesn't work
2621         https://bugs.webkit.org/show_bug.cgi?id=216731
2622
2623         Reviewed by Simon Fraser.
2624
2625         Fixes filtering an attribute out of [Default] toJSON operation based
2626         on which which global objects it is exposed to by ensuring we always
2627         pass a global object pointer accessor function to 
2628         GenerateRuntimeEnableConditionalStringForExposed. For good measure,
2629         we now always pass the global object object pointer to 
2630         GenerateRuntimeEnableConditionalString as well so that it is always
2631         explicit.
2632         
2633         This is needed to support filtering out Performance.navigation and
2634         Performance.timing from the Performance interface's toJSON implementation
2635         which will be addressed in a separate change.
2636  
2637         * bindings/scripts/CodeGeneratorJS.pm:
2638         (GenerateRuntimeEnableConditionalStringForExposed):
2639         (GenerateRuntimeEnableConditionalString):
2640         Remove implicit global object accessor string construction by always
2641         requiring it to be passed.
2642
2643         * bindings/scripts/test/DOMWindowConstructors.idl:
2644         * bindings/scripts/test/JS/JSDOMWindow.cpp:
2645         * bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp: Added.
2646         * bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.h: Added.
2647         * bindings/scripts/test/JS/JSWorkerGlobalScope.cpp:
2648         * bindings/scripts/test/SupplementalDependencies.dep:
2649         * bindings/scripts/test/TestDefaultToJSONFilteredByExposed.idl: Added.
2650         * bindings/scripts/test/WorkerGlobalScopeConstructors.idl:
2651         Add new test for updated behavior. I couldn't add it to the existing
2652         TestDefaultToJSON.idl test as that test requires the interface only be exposed
2653         to Window to support testing EnabledBySetting.
2654
2655 2020-09-20  Darin Adler  <darin@apple.com>
2656
2657         Selection API: Further improvements to VisibleSelection, FrameSelection, and DOMSelection to preserve anchor and focus
2658         https://bugs.webkit.org/show_bug.cgi?id=216739
2659
2660         Reviewed by Ryosuke Niwa.
2661
2662         If done correctly, these changes should have almost no effect unless live range selection
2663         is enabled. This adds a feature where VisibleSelection tracks the original points,
2664         before the VisiblePosition-style canonicalization. It also starts a transition from
2665         the base/extent terminology to the slightly-easier-to-understand anchor/focus terminology
2666         that is used in the selection specification. New functions name them anchor and focus,
2667         even though we still have some old ones that call them base and extent. In addition,
2668         made some other small related improvements to live range selection mode, without changing
2669         behavior when not in that mode. Have been testing these locally by turning on that mode
2670         and running various tests.
2671
2672         * editing/FrameSelection.cpp:
2673         (WebCore::FrameSelection::isInDocumentTree const): Added. Used by DOMSelection to
2674         correctly handle cases where the selection is in a shadow tree without requiring it
2675         actually create the associated live range just to query.
2676         (WebCore::FrameSelection::associatedLiveRange): Use the new VisibleSelection::range,
2677         which gives us non-canonicalized points, rather than the deprecated
2678         VisibleSelection::firstRange, which we will eventually be renaming or deleting.
2679         (WebCore::FrameSelection::updateFromAssociatedLiveRange): Use
2680         makeContainerOffsetPosition instead of implicitly using makeDeprecatedLegacyPosition.
2681         Also removed the FIXME about normalization of endpoints, which is what this patch
2682         mostly addresses; no need to track with a comment now.
2683         (WebCore::FrameSelection::updateAssociatedLiveRange): Use VisibleSelection::range
2684         for the same reason as above.
2685
2686         * editing/FrameSelection.h: Added isInDocumentTree.
2687
2688         * editing/VisibleSelection.cpp:
2689         (WebCore::VisibleSelection::VisibleSelection): Updated the primary constructor to set
2690         m_anchor/focus and let the validate function set m_base/extent/start/end/baseIsFirst.
2691         Changed most other constructors to call that primary one.
2692         (WebCore::VisibleSelection::anchor const): Added. This is a non-canonicalized position.
2693         (WebCore::VisibleSelection::focus const): Ditto.
2694         (WebCore::VisibleSelection::uncanonicalizedStart const): Added. This non-canonicalized
2695         version of start is used by new DOMSelection code, but eventually should be used
2696         elsewhere as well, and we may eventually eliminate the canonicalized version.
2697         (WebCore::VisibleSelection::uncanonicalizedEnd const): Ditto.
2698         (WebCore::VisibleSelection::range const): Added. This non-canonicalized version of
2699         firstRange has many of the same considerations as the other four functions above.
2700         (WebCore::VisibleSelection::setBase): Set m_anchor instead of m_base. Eventually we
2701         will want to rename this function, too, but there is no need to do that now.
2702         (WebCore::VisibleSelection::setExtent): Ditto.
2703         (WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents): Rewrote to take
2704         m_anchor and m_focus as inputs and now m_base and m_extent are pure outputs.
2705         May want to rename this later, because "deep equivalents" is a funny way to say
2706         that this function sets base and extent to canonicalized values.
2707         (WebCore::VisibleSelection::adjustSelectionRespectingGranularity): Renamed from
2708         setStartAndEndFromBaseAndExtentRespectingGranularity. This now takes m_start/end
2709         as input as well as output, because the validate function needs to check
2710         if the function changes m_start/end so it can update m_anchor/focus. Also did a tiny
2711         bit of refactoring to use std::swap.
2712         (WebCore::VisibleSelection::validate): Refined the code to handle canonicalization
2713         differently from expanding due to granularity. Canonicalization is done preserving
2714         the original m_anchor/focus as it mostly always has been. But expansion due to
2715         granularity now changes m_anchor/focus/base/extent rather than just m_start/end.
2716         This makes sense because granularity changes actually affect what is selected,
2717         while canonicalization just changes how the selection is expressed and tracked.
2718         (WebCore::VisibleSelection::setWithoutValidation): Set m_anchor/focus. In the future,
2719         we can probably get rid of this eventually, because the "validation" talked about
2720         here is the unwanted canonicalization. But that's a refinement for the future.
2721         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
2722         Update m_focus, not just m_extent, if we have to adjust. Also removed an unnnecessary
2723         null check from the start of the function.
2724         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): Ditto.
2725         Also removed the assertions because these situations can indeed arise and it's not
2726         necessarily an indication of a bug in editing code.
2727
2728         * editing/VisibleSelection.h: Rearranged constructors to make it slightly more clear
2729         which is the main one and that the others are simply convenience shorthands. Might
2730         want to come back later and remove some unused ones. Added uncanonicalizedStart,
2731         uncanonicalizedEnd, anchor, focus, and range. Renamed the private function called
2732         setStartAndEndFromBaseAndExtentRespectingGranularity to the new name
2733         adjustSelectionRespectingGranularity. Added m_anchor and m_focus and refined the
2734         comments about the position data members. We should eventually be able to cut down
2735         on the number of these again, but it's fine to have two more for now.
2736
2737         * page/DOMSelection.cpp:
2738         (WebCore::DOMSelection::range const): Use range rather than firstRange when live
2739         range selection is enabled, for proper round-tripping of selection endpoints,
2740         unaffected by canonicalization. The other changes below are for the same reason.
2741         (WebCore::DOMSelection::anchorPosition const): Use anchor.
2742         (WebCore::DOMSelection::focusPosition const): Use focus.
2743         (WebCore::DOMSelection::basePosition const): Use anchor.
2744         (WebCore::DOMSelection::extentPosition const): Use focus.
2745         (WebCore::DOMSelection::type const): Use isInDocumentTree and range rather than
2746         isNone/isCaret/isRange when live range selection is enabled, because this needs
2747         to report "Caret" when the range is not collapsed, even if the canonicalized
2748         range is collapsed and "None" when the selection is in a shadow tree.
2749         (WebCore::DOMSelection::rangeCount const): Use isInDocumentTree to check if
2750         there is a selection rather than isNone to correctly handle the shadow tree case.
2751         (WebCore::DOMSelection::collapseToEnd): Use uncanonicalizedEnd.
2752         (WebCore::DOMSelection::collapseToStart): Use uncanonicalizedStart.
2753         (WebCore::DOMSelection::containsNode const): Updated the comment for clarity.
2754
2755 2020-09-20  Simon Fraser  <simon.fraser@apple.com>
2756
2757         [LFC Display] Move LFC Display infrastructure files into a new 'display' directory
2758         https://bugs.webkit.org/show_bug.cgi?id=216747
2759
2760         Reviewed by Zalan Bujtas.
2761
2762         WebCore/Source/display will become the home for all the LFC painting code; move
2763         DisplayView and DisplayLayerController into it.
2764         
2765         Also fix some unified build include issues.
2766
2767         * CMakeLists.txt:
2768         * Headers.cmake:
2769         * Sources.txt:
2770         * WebCore.xcodeproj/project.pbxproj:
2771         * display/DisplayLayerController.cpp: Renamed from Source/WebCore/layout/display/DisplayLayerController.cpp.
2772         * display/DisplayLayerController.h: Renamed from Source/WebCore/layout/display/DisplayLayerController.h.
2773         * display/DisplayView.cpp: Renamed from Source/WebCore/layout/display/DisplayView.cpp.
2774         * display/DisplayView.h: Renamed from Source/WebCore/layout/display/DisplayView.h.
2775         * layout/flexformatting/FlexFormattingContext.cpp:
2776         * layout/inlineformatting/InlineLineBox.cpp:
2777
2778 2020-09-20  Darin Adler  <darin@apple.com>
2779
2780         Selection API: Fix selectAllChilden to return InvalidNodeTypeError when passed a DocumentType node
2781         https://bugs.webkit.org/show_bug.cgi?id=216741
2782
2783         Reviewed by Ryosuke Niwa.
2784
2785         This is covered by tests, but the fix itself is only testable when live range
2786         selection is enabled. So for now the other tests are simply checking that no
2787         regression or behavior change was introduced by accident.
2788
2789         * page/DOMSelection.cpp:
2790         (WebCore::DOMSelection::selectAllChildren): Return the value returned by
2791         setBaseAndExtent so we don't discard any exception it might throw. In
2792         practice, that's only this one.
2793         * page/DOMSelection.h: Updated return type so we can throw an exception.
2794         * page/DOMSelection.idl: Added MayThrowException.
2795
2796 2020-09-20  Zalan Bujtas  <zalan@apple.com>
2797
2798         [LFC][IFC] InlineFormattingState should not store display lines and runs
2799         https://bugs.webkit.org/show_bug.cgi?id=216742
2800
2801         Reviewed by Antti Koivisto.
2802
2803         In this patch,
2804         1. Display related structures are completely moved out from Layout namespace
2805           - InlineFormattingContext does not generate display structures.
2806           - InlineFormattingState only stores layout data.
2807           - Layout tree verification works on layout geometry.
2808           - Layout structures do not embed Display types.
2809         2. LayoutIntegration creates and maintains the required Display structures for painting and hittesting.
2810         3. Display::Run does not use Layout types (InlineLayoutRect, InlineLayoutUnit).
2811
2812         FIXME: We need to start constructing display content for the Display::Painter.
2813
2814         * WebCore.xcodeproj/project.pbxproj:
2815         * layout/Verification.cpp:
2816         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2817         (WebCore::Layout::checkForMatchingNonTextRuns):
2818         (WebCore::Layout::checkForMatchingTextRuns):
2819         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2820         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
2821         * layout/displaytree/DisplayInlineContent.h:
2822         (WebCore::Display::InlineContent::shrinkToFit):
2823         * layout/displaytree/DisplayLine.h:
2824         (WebCore::Display::Line::horizontalAlignmentOffset const):
2825         (WebCore::Display::Line::Line):
2826         * layout/displaytree/DisplayPainter.cpp:
2827         (WebCore::Display::paintInlineContent):
2828         * layout/displaytree/DisplayRun.h:
2829         (WebCore::Display::Run::TextContent::start const):
2830         (WebCore::Display::Run::TextContent::end const):
2831         (WebCore::Display::Run::TextContent::length const):
2832         (WebCore::Display::Run::TextContent::content const):
2833         (WebCore::Display::Run::TextContent::needsHyphen const):
2834         (WebCore::Display::Run::rect const):
2835         (WebCore::Display::Run::inkOverflow const):
2836         (WebCore::Display::Run::Run):
2837         (WebCore::Display::Run::TextContent::TextContent):
2838         (WebCore::Display::Run::TextContent::setNeedsHyphen): Deleted.
2839         (WebCore::Display::Run::TextContent::expand): Deleted.
2840         (WebCore::Display::Run::TextContent::shrink): Deleted.
2841         (WebCore::Display::Run::topLeft const): Deleted.
2842         (WebCore::Display::Run::left const): Deleted.
2843         (WebCore::Display::Run::right const): Deleted.
2844         (WebCore::Display::Run::top const): Deleted.
2845         (WebCore::Display::Run::bottom const): Deleted.
2846         (WebCore::Display::Run::width const): Deleted.
2847         (WebCore::Display::Run::height const): Deleted.
2848         (WebCore::Display::Run::moveVertically): Deleted.
2849         * layout/flexformatting/FlexFormattingContext.cpp:
2850         (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
2851         * layout/inlineformatting/InlineFormattingContext.cpp:
2852         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
2853         * layout/inlineformatting/InlineFormattingState.h:
2854         (WebCore::Layout::InlineFormattingState::lineRuns const):
2855         (WebCore::Layout::InlineFormattingState::lineRuns):
2856         (WebCore::Layout::InlineFormattingState::addLineRun):
2857         (WebCore::Layout::InlineFormattingState::clearLineAndRuns):
2858         (WebCore::Layout::InlineFormattingState::shrinkToFit):
2859         (WebCore::Layout::InlineFormattingState::displayInlineContent const): Deleted.
2860         (WebCore::Layout::InlineFormattingState::ensureDisplayInlineContent): Deleted.
2861         (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent): Deleted.
2862         * layout/inlineformatting/InlineLine.h:
2863         (WebCore::Layout::Line::Run::textContent const):
2864         (WebCore::Layout::Line::Run::expansion const):
2865         * layout/inlineformatting/InlineLineGeometry.h:
2866         (WebCore::Layout::InlineLineGeometry::horizontalAlignmentOffset const):
2867         (WebCore::Layout::InlineLineGeometry::InlineLineGeometry):
2868         * layout/integration/LayoutIntegrationLineLayout.cpp:
2869         (WebCore::LayoutIntegration::LineLayout::layout):
2870         (WebCore::LayoutIntegration::LineLayout::constructDisplayContent):
2871         (WebCore::LayoutIntegration::LineLayout::ensureDisplayInlineContent):
2872         (WebCore::LayoutIntegration::LineLayout::paint):
2873         (WebCore::LayoutIntegration::LineLayout::displayInlineContent const): Deleted.
2874         * layout/integration/LayoutIntegrationLineLayout.h:
2875         (WebCore::LayoutIntegration::LineLayout::displayInlineContent const):
2876         * layout/layouttree/LayoutTreeBuilder.cpp:
2877         (WebCore::Layout::outputInlineRuns):
2878         * layout/tableformatting/TableFormattingContext.cpp:
2879         (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
2880         * rendering/line/LineLayoutTraversalDisplayRunPath.h:
2881         (WebCore::LineLayoutTraversal::DisplayRunPath::rect const):
2882
2883 2020-09-19  Andres Gonzalez  <andresg_22@apple.com>
2884
2885         Implementation for AXIsolatedObject::nextSibling and previousSibling.
2886         https://bugs.webkit.org/show_bug.cgi?id=216710
2887
2888         Reviewed by Chris Fleizach.
2889
2890         Implementation for AXIsolatedObject::previousSibling and nextSibling which
2891         are invoked by VoiceOver in Safari Reader mode.
2892
2893         * accessibility/AccessibilityRenderObject.cpp:
2894         (WebCore::AccessibilityRenderObject::previousSibling const):
2895         - Fixed crash caused by dereferencing m_renderer->parent() which can be null.
2896         - Added check for the AXObjectCache that can become null.
2897         (WebCore::AccessibilityRenderObject::nextSibling const):
2898         - Code style cleanup.
2899         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2900         (WebCore::AXIsolatedObject::initializeAttributeData):
2901         - Added caching of next/previousSiblling objects.
2902         (WebCore::AXIsolatedObject::previousSibling const): Inlined in header..
2903         (WebCore::AXIsolatedObject::nextSibling const): Inlined in header.
2904         * accessibility/isolatedtree/AXIsolatedObject.h:
2905         * accessibility/isolatedtree/AXIsolatedTree.h:
2906
2907 2020-09-19  Sam Weinig  <weinig@apple.com>
2908
2909         Performance and PerformanceNavigation interfaces are missing toJSON operations
2910         https://bugs.webkit.org/show_bug.cgi?id=216728
2911
2912         Reviewed by Darin Adler.
2913
2914         Add missing toJSON operations to Performance and PerformanceNavigation and update
2915         comments in related IDLs.
2916         
2917         Updates results for existing tests, more of which now pass.
2918
2919         * page/Performance.idl:
2920         * page/PerformanceMark.idl:
2921         * page/PerformanceMeasure.idl:
2922         * page/PerformanceNavigation.idl:
2923         * page/PerformanceTiming.idl:
2924
2925 2020-09-19  Zalan Bujtas  <zalan@apple.com>
2926
2927         [LFC][IFC] InlineFormattingContext::computeGeometryForLineContent should not construct Display::Lines
2928         https://bugs.webkit.org/show_bug.cgi?id=216723
2929
2930         Reviewed by Antti Koivisto.
2931
2932         Display::Lines construction should live in the display builder. However currently we don't yet have a real builder, so let's
2933         just use the integration layer.
2934         This is also in preparation for removing all the Display::InlineContent code from the Layout namespace.
2935
2936         * layout/displaytree/DisplayPainter.cpp:
2937         (WebCore::Display::paintInlineContent):
2938         * layout/inlineformatting/InlineFormattingContext.cpp:
2939         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
2940         * layout/integration/LayoutIntegrationLineLayout.cpp:
2941         (WebCore::LayoutIntegration::LineLayout::layout):
2942         (WebCore::LayoutIntegration::LineLayout::constructDisplayContent):
2943         * layout/integration/LayoutIntegrationLineLayout.h:
2944
2945 2020-09-18  Darin Adler  <darin@apple.com>
2946
2947         Selection API: Extend lifetime of selection live range to preserve expando properties
2948         https://bugs.webkit.org/show_bug.cgi?id=216721
2949
2950         Reviewed by Ryosuke Niwa.
2951
2952         Test: editing/selection/expando.html
2953
2954         * dom/Range.cpp:
2955         (WebCore::Range::window): Added. Returns window if range is associated with selection.
2956         * dom/Range.h: Added window.
2957         * dom/Range.idl: Added GenerateIsReachable=ReachableFromDOMWindow.
2958
2959         * editing/FrameSelection.cpp:
2960         (WebCore::FrameSelection::disassociateLiveRange): Removed a FIXME comment about the
2961         need for this fix.
2962         (WebCore::FrameSelection::updateAssociatedLiveRange): Added a comment explaining
2963         why an associated live range might not be contained in the document.
2964
2965 2020-09-19  Sam Weinig  <weinig@apple.com>
2966
2967         Add support for Settings equivilent of RuntimeConditionallyReadWrite
2968         https://bugs.webkit.org/show_bug.cgi?id=216697
2969
2970         Reviewed by Darin Adler.
2971
2972         Adds a new extended attribute, [SettingsConditionallyReadWrite] to allow users of 
2973         [RuntimeConditionallyReadWrite] to convert from RuntimeEnabledFeatures to Settings.
2974
2975         * bindings/scripts/CodeGeneratorJS.pm:
2976         (NeedsRuntimeReadWriteCheck):
2977         (GeneratePropertiesHashTable):
2978         (GenerateRuntimeEnableConditionalString):
2979         (GenerateImplementation):
2980         * bindings/scripts/IDLAttributes.json:
2981         Adds new extended attribute.
2982         
2983         * bindings/scripts/test/DOMWindowConstructors.idl:
2984         * bindings/scripts/test/JS/JSDOMWindow.cpp:
2985         * bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp: Added.
2986         * bindings/scripts/test/JS/JSTestConditionallyReadWrite.h: Added.
2987         * bindings/scripts/test/JS/JSTestObj.cpp:
2988         * bindings/scripts/test/SupplementalDependencies.dep:
2989         * bindings/scripts/test/TestConditionallyReadWrite.idl: Added.
2990         * bindings/scripts/test/TestObj.idl:
2991         Move conditionally read-write tests to a new test, TestConditionallyReadWrite.idl and
2992         update results.
2993
2994 2020-09-19  Sam Weinig  <weinig@apple.com>
2995
2996         Remove runtime setting for enabling/disabling the CrossOriginResourcePolicy API
2997         https://bugs.webkit.org/show_bug.cgi?id=216561
2998
2999         Reviewed by Darin Adler.
3000
3001         Remove runtime setting for enabling/disabling CrossOriginResourcePolicy. It has been
3002         enabled by default for a while and there are no known reasons one would need to
3003         disable it.
3004
3005         * page/RuntimeEnabledFeatures.h:
3006         (WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled): Deleted.
3007         (WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const): Deleted.
3008
3009 2020-09-19  Simon Fraser  <simon.fraser@apple.com>
3010
3011         ASSERTION FAILED: &formattingContextRoot == m_rootContainer.get() in WebCore::Layout::LayoutState::establishedInlineFormattingState
3012         https://bugs.webkit.org/show_bug.cgi?id=216668
3013
3014         Reviewed by Zalan Bujtas.
3015
3016         Display::View didn't unparent the GraphicsLayers when Document::documentWillBecomeInactive() was called,
3017         so a layer pointing to an old LayoutState would try to paint.
3018
3019         Fix by plumbing setIsInWindow() through to Display::View and using it to detach the root layer.
3020
3021         * dom/Document.cpp:
3022         (WebCore::Document::documentWillBecomeInactive): The ASSERT_IMPLIES() is there to ensure that this isn't
3023         a behavior change; we used to go to RenderView directly, and now go via FrameView.
3024         * layout/display/DisplayLayerController.cpp:
3025         (WebCore::Display::LayerController::detachRootLayer):
3026         (WebCore::Display::LayerController::setIsInWindow):
3027         * layout/display/DisplayLayerController.h:
3028         * layout/display/DisplayView.cpp:
3029         (WebCore::Display::View::setIsInWindow):
3030         * layout/display/DisplayView.h:
3031         * page/FrameView.cpp:
3032         (WebCore::FrameView::setIsInWindow):
3033
3034 2020-09-18  Zalan Bujtas  <zalan@apple.com>
3035
3036         [LFC][IFC] Do not use Display::Line geometry in layout
3037         https://bugs.webkit.org/show_bug.cgi?id=216711
3038
3039         Reviewed by Simon Fraser.
3040
3041         This patch introduces Layout::LineGeometry.
3042         LineGeometry is used to hold the logical geometry of line and it is input to subsequent layouts.
3043         This patch is also in preparation for moving out the "displayInlineItem" construction from Layout::InlineFormattingContext.
3044
3045         * WebCore.xcodeproj/project.pbxproj:
3046         * layout/FormattingContextGeometry.cpp:
3047         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
3048         * layout/Verification.cpp:
3049         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3050         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3051         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3052         * layout/blockformatting/BlockMarginCollapse.cpp:
3053         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
3054         * layout/displaytree/DisplayLine.h:
3055         (WebCore::Display::Line::rect const):
3056         (WebCore::Display::Line::scrollableOverflow const):
3057         (WebCore::Display::Line::inkOverflow const):
3058         (WebCore::Display::Line::baseline const):
3059         (WebCore::Display::Line::Line):
3060         (WebCore::Display::Line::left const): Deleted.
3061         (WebCore::Display::Line::right const): Deleted.
3062         (WebCore::Display::Line::top const): Deleted.
3063         (WebCore::Display::Line::bottom const): Deleted.
3064         (WebCore::Display::Line::width const): Deleted.
3065         (WebCore::Display::Line::height const): Deleted.
3066         (WebCore::Display::Line::moveVertically): Deleted.
3067         * layout/displaytree/DisplayPainter.cpp:
3068         (WebCore::Display::paintInlineContent):
3069         * layout/inlineformatting/InlineFormattingContext.cpp:
3070         (WebCore::Layout::InlineFormattingContext::lineLayout):
3071         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
3072         (WebCore::Layout::InlineFormattingContext::invalidateFormattingState):
3073         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3074         (WebCore::Layout::LineBoxBuilder::constructInlineBoxes):
3075         * layout/inlineformatting/InlineFormattingState.h:
3076         (WebCore::Layout::InlineFormattingState::lines const):
3077         (WebCore::Layout::InlineFormattingState::lines):
3078         (WebCore::Layout::InlineFormattingState::addLine):
3079         (WebCore::Layout::InlineFormattingState::clearLineAndRuns):
3080         (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent):
3081         (WebCore::Layout::InlineFormattingState::clearDisplayInlineContent): Deleted.
3082         * layout/inlineformatting/InlineLineBuilder.cpp:
3083         * layout/inlineformatting/InlineLineBuilder.h:
3084         * layout/inlineformatting/InlineLineGeometry.h: Added.
3085         (WebCore::Layout::InlineLineGeometry::logicalLeft const):
3086         (WebCore::Layout::InlineLineGeometry::logicalRight const):
3087         (WebCore::Layout::InlineLineGeometry::logicalTop const):
3088         (WebCore::Layout::InlineLineGeometry::logicalBottom const):
3089         (WebCore::Layout::InlineLineGeometry::logicalWidth const):
3090         (WebCore::Layout::InlineLineGeometry::logicalHeight const):
3091         (WebCore::Layout::InlineLineGeometry::logicalRect const):
3092         (WebCore::Layout::InlineLineGeometry::lineBoxLogicalRect const):
3093         (WebCore::Layout::InlineLineGeometry::baseline const):
3094         (WebCore::Layout::InlineLineGeometry::moveVertically):
3095         (WebCore::Layout::InlineLineGeometry::InlineLineGeometry):
3096         * layout/inlineformatting/InlineTextItem.h:
3097         * layout/integration/LayoutIntegrationLineLayout.cpp:
3098         (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
3099         (WebCore::LayoutIntegration::LineLayout::lineCount const):
3100         (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
3101         (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):
3102         (WebCore::LayoutIntegration::LineLayout::paint):
3103         * layout/layouttree/LayoutTreeBuilder.cpp:
3104         (WebCore::Layout::outputInlineRuns):
3105         * layout/tableformatting/TableFormattingContext.cpp:
3106         (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
3107         * layout/tableformatting/TableFormattingContextGeometry.cpp:
3108         (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):
3109
3110 2020-09-18  Zalan Bujtas  <zalan@apple.com>
3111
3112         [LFC][FFC] Add flex box/item to showLayoutTree
3113         https://bugs.webkit.org/show_bug.cgi?id=216694
3114
3115         Reviewed by Sam Weinig.
3116
3117         * layout/layouttree/LayoutTreeBuilder.cpp:
3118         (WebCore::Layout::outputLayoutBox): 'Table principal' -> 'Table wrapper box' for consistency sake.
3119
3120 2020-09-18  Saam Barati  <sbarati@apple.com>
3121
3122         console APIs shouldn't crash making a string that's too long for a console warning when using user provided labels
3123         https://bugs.webkit.org/show_bug.cgi?id=216709
3124         <rdar://problem/68275357>
3125
3126         Reviewed by Mark Lam and Devin Rousso.
3127
3128         Test: inspector/console/console-oom.html
3129
3130         * inspector/agents/InspectorTimelineAgent.cpp:
3131         (WebCore::InspectorTimelineAgent::startFromConsole):
3132         (WebCore::InspectorTimelineAgent::stopFromConsole):
3133         * inspector/agents/WebConsoleAgent.cpp:
3134         (WebCore::WebConsoleAgent::didReceiveResponse):
3135
3136 2020-09-18  Don Olmstead  <don.olmstead@sony.com>
3137
3138         [WebGPU] Add ENABLE(WHLSL_COMPILER) guard
3139         https://bugs.webkit.org/show_bug.cgi?id=216713
3140
3141         Reviewed by Myles C. Maxfield.
3142
3143         Replaces the ENABLE(WEBGPU) guards in the Modules/webgpu/WHLSL with ENABLE(WHLSL_COMPILER)
3144         since not all ports need a WHLSL compiler to support WebGPU.
3145
3146         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
3147         * Modules/webgpu/WHLSL/AST/WHLSLAddressEscapeMode.h:
3148         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
3149         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
3150         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
3151         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
3152         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
3153         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
3154         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
3155         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
3156         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
3157         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
3158         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
3159         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
3160         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
3161         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
3162         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
3163         * Modules/webgpu/WHLSL/AST/WHLSLDefaultDelete.h:
3164         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
3165         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
3166         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
3167         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
3168         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
3169         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
3170         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
3171         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
3172         * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp:
3173         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3174         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
3175         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
3176         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
3177         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
3178         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
3179         * Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h:
3180         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
3181         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
3182         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
3183         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
3184         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
3185         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp:
3186         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
3187         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
3188         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
3189         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
3190         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
3191         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
3192         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
3193         * Modules/webgpu/WHLSL/AST/WHLSLNameSpace.h:
3194         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
3195         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
3196         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
3197         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
3198         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
3199         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
3200         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h:
3201         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
3202         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
3203         * Modules/webgpu/WHLSL/AST/WHLSLReplaceWith.h:
3204         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
3205         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
3206         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
3207         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
3208         * Modules/webgpu/WHLSL/AST/WHLSLSemantic.h:
3209         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
3210         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
3211         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
3212         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
3213         * Modules/webgpu/WHLSL/AST/WHLSLStatement.cpp:
3214         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
3215         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
3216         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
3217         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
3218         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
3219         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
3220         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
3221         * Modules/webgpu/WHLSL/AST/WHLSLType.cpp:
3222         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
3223         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp:
3224         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
3225         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
3226         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
3227         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
3228         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp:
3229         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
3230         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h:
3231         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp:
3232         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
3233         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
3234         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
3235         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
3236         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
3237         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
3238         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
3239         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
3240         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
3241         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3242         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
3243         * Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h:
3244         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
3245         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
3246         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3247         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
3248         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
3249         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.h:
3250         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
3251         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
3252         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp:
3253         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h:
3254         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
3255         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
3256         * Modules/webgpu/WHLSL/WHLSLBuildStandardLibraryFunctionMap.py:
3257         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
3258         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h:
3259         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp:
3260         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h:
3261         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
3262         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h:
3263         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3264         * Modules/webgpu/WHLSL/WHLSLChecker.h:
3265         * Modules/webgpu/WHLSL/WHLSLCodeLocation.h:
3266         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:
3267         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h:
3268         * Modules/webgpu/WHLSL/WHLSLError.h:
3269         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp:
3270         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h:
3271         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
3272         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
3273         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
3274         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h:
3275         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
3276         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
3277         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
3278         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
3279         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
3280         * Modules/webgpu/WHLSL/WHLSLLexer.h:
3281         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
3282         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h:
3283         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
3284         * Modules/webgpu/WHLSL/WHLSLNameContext.h:
3285         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3286         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
3287         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3288         * Modules/webgpu/WHLSL/WHLSLParser.h:
3289         * Modules/webgpu/WHLSL/WHLSLParsingMode.h:
3290         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
3291         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3292         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
3293         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
3294         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h:
3295         * Modules/webgpu/WHLSL/WHLSLProgram.cpp:
3296         * Modules/webgpu/WHLSL/WHLSLProgram.h:
3297         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3298         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h:
3299         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:
3300         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h:
3301         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
3302         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h:
3303         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
3304         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h:
3305         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
3306         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
3307         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
3308         * Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h:
3309         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
3310         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h:
3311         * Modules/webgpu/WHLSL/WHLSLStandardLibraryFunctionMap.h:
3312         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
3313         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
3314         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
3315         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h:
3316         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
3317         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h:
3318         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
3319         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h:
3320         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3321         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
3322
3323 2020-09-18  Chris Dumez  <cdumez@apple.com>
3324
3325         Crash under WebCore::shouldResetFocusNavigationStartingNode()
3326         https://bugs.webkit.org/show_bug.cgi?id=216714
3327         <rdar://problem/68132047>
3328
3329         Reviewed by Darin Adler.
3330
3331         Protect anchorElement in FrameView::scrollToFragmentInternal() to make sure
3332         it stays alive until the time we pass it to setFocusNavigationStartingNode().
3333
3334         * page/FrameView.cpp:
3335         (WebCore::FrameView::scrollToFragmentInternal):
3336
3337 2020-09-18  Aditya Keerthi  <akeerthi@apple.com>
3338
3339         Date/time inputs should not use user-specified formats
3340         https://bugs.webkit.org/show_bug.cgi?id=216484
3341         <rdar://problem/68864815>
3342
3343         Reviewed by Wenson Hsieh.
3344
3345         On macOS, users can specify custom date and time formats through System
3346         Preferences. These formats can be different from the default for the
3347         user’s current locale. Using these formats when rendering date and time
3348         inputs is a potential fingerprinting vector, as sites can apply CSS to
3349         components of the input, and measure the size of the input.
3350
3351         To fix, we create a new NSLocale even if the identifier matches
3352         [NSLocale currentLocale]. This ensures that m_locale does not contain
3353         the user's changes to the locale.
3354
3355         * platform/text/cocoa/LocaleCocoa.h:
3356         * platform/text/cocoa/LocaleCocoa.mm:
3357         (WebCore::Locale::create):
3358         (WebCore::LocaleCocoa::LocaleCocoa):
3359
3360 2020-09-18  Aditya Keerthi  <akeerthi@apple.com>
3361
3362         [macOS] Date/time inputs should focus the next editable component when entering a separator key
3363         https://bugs.webkit.org/show_bug.cgi?id=216661
3364         <rdar://problem/69091856>
3365
3366         Reviewed by Wenson Hsieh.
3367
3368         NSDatePicker focuses the next editable field when entering a separator
3369         key. We should match this behavior to be consistent with the rest of
3370         the system.
3371
3372         * html/shadow/DateTimeFieldElement.cpp:
3373         (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler):
3374
3375 2020-09-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3376
3377         REGRESSION(r267137): PaintFrequencyTracker needs to track all the painting
3378         https://bugs.webkit.org/show_bug.cgi?id=216677
3379
3380         Reviewed by Simon Fraser.
3381
3382         r267137 removed all the optimizations which the Design test got from
3383         r230544 because it resets the renderingUpdateTimestamp to zero when it
3384      &