ed577aaf449a86d5caa8a7b1a7278dbada4fee16
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-09-19  Sam Weinig  <weinig@apple.com>
2
3         Performance and PerformanceNavigation interfaces are missing toJSON operations
4         https://bugs.webkit.org/show_bug.cgi?id=216728
5
6         Reviewed by Darin Adler.
7
8         Add missing toJSON operations to Performance and PerformanceNavigation and update
9         comments in related IDLs.
10         
11         Updates results for existing tests, more of which now pass.
12
13         * page/Performance.idl:
14         * page/PerformanceMark.idl:
15         * page/PerformanceMeasure.idl:
16         * page/PerformanceNavigation.idl:
17         * page/PerformanceTiming.idl:
18
19 2020-09-19  Zalan Bujtas  <zalan@apple.com>
20
21         [LFC][IFC] InlineFormattingContext::computeGeometryForLineContent should not construct Display::Lines
22         https://bugs.webkit.org/show_bug.cgi?id=216723
23
24         Reviewed by Antti Koivisto.
25
26         Display::Lines construction should live in the display builder. However currently we don't yet have a real builder, so let's
27         just use the integration layer.
28         This is also in preparation for removing all the Display::InlineContent code from the Layout namespace.
29
30         * layout/displaytree/DisplayPainter.cpp:
31         (WebCore::Display::paintInlineContent):
32         * layout/inlineformatting/InlineFormattingContext.cpp:
33         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
34         * layout/integration/LayoutIntegrationLineLayout.cpp:
35         (WebCore::LayoutIntegration::LineLayout::layout):
36         (WebCore::LayoutIntegration::LineLayout::constructDisplayContent):
37         * layout/integration/LayoutIntegrationLineLayout.h:
38
39 2020-09-18  Darin Adler  <darin@apple.com>
40
41         Selection API: Extend lifetime of selection live range to preserve expando properties
42         https://bugs.webkit.org/show_bug.cgi?id=216721
43
44         Reviewed by Ryosuke Niwa.
45
46         Test: editing/selection/expando.html
47
48         * dom/Range.cpp:
49         (WebCore::Range::window): Added. Returns window if range is associated with selection.
50         * dom/Range.h: Added window.
51         * dom/Range.idl: Added GenerateIsReachable=ReachableFromDOMWindow.
52
53         * editing/FrameSelection.cpp:
54         (WebCore::FrameSelection::disassociateLiveRange): Removed a FIXME comment about the
55         need for this fix.
56         (WebCore::FrameSelection::updateAssociatedLiveRange): Added a comment explaining
57         why an associated live range might not be contained in the document.
58
59 2020-09-19  Sam Weinig  <weinig@apple.com>
60
61         Add support for Settings equivilent of RuntimeConditionallyReadWrite
62         https://bugs.webkit.org/show_bug.cgi?id=216697
63
64         Reviewed by Darin Adler.
65
66         Adds a new extended attribute, [SettingsConditionallyReadWrite] to allow users of 
67         [RuntimeConditionallyReadWrite] to convert from RuntimeEnabledFeatures to Settings.
68
69         * bindings/scripts/CodeGeneratorJS.pm:
70         (NeedsRuntimeReadWriteCheck):
71         (GeneratePropertiesHashTable):
72         (GenerateRuntimeEnableConditionalString):
73         (GenerateImplementation):
74         * bindings/scripts/IDLAttributes.json:
75         Adds new extended attribute.
76         
77         * bindings/scripts/test/DOMWindowConstructors.idl:
78         * bindings/scripts/test/JS/JSDOMWindow.cpp:
79         * bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp: Added.
80         * bindings/scripts/test/JS/JSTestConditionallyReadWrite.h: Added.
81         * bindings/scripts/test/JS/JSTestObj.cpp:
82         * bindings/scripts/test/SupplementalDependencies.dep:
83         * bindings/scripts/test/TestConditionallyReadWrite.idl: Added.
84         * bindings/scripts/test/TestObj.idl:
85         Move conditionally read-write tests to a new test, TestConditionallyReadWrite.idl and
86         update results.
87
88 2020-09-19  Sam Weinig  <weinig@apple.com>
89
90         Remove runtime setting for enabling/disabling the CrossOriginResourcePolicy API
91         https://bugs.webkit.org/show_bug.cgi?id=216561
92
93         Reviewed by Darin Adler.
94
95         Remove runtime setting for enabling/disabling CrossOriginResourcePolicy. It has been
96         enabled by default for a while and there are no known reasons one would need to
97         disable it.
98
99         * page/RuntimeEnabledFeatures.h:
100         (WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled): Deleted.
101         (WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const): Deleted.
102
103 2020-09-19  Simon Fraser  <simon.fraser@apple.com>
104
105         ASSERTION FAILED: &formattingContextRoot == m_rootContainer.get() in WebCore::Layout::LayoutState::establishedInlineFormattingState
106         https://bugs.webkit.org/show_bug.cgi?id=216668
107
108         Reviewed by Zalan Bujtas.
109
110         Display::View didn't unparent the GraphicsLayers when Document::documentWillBecomeInactive() was called,
111         so a layer pointing to an old LayoutState would try to paint.
112
113         Fix by plumbing setIsInWindow() through to Display::View and using it to detach the root layer.
114
115         * dom/Document.cpp:
116         (WebCore::Document::documentWillBecomeInactive): The ASSERT_IMPLIES() is there to ensure that this isn't
117         a behavior change; we used to go to RenderView directly, and now go via FrameView.
118         * layout/display/DisplayLayerController.cpp:
119         (WebCore::Display::LayerController::detachRootLayer):
120         (WebCore::Display::LayerController::setIsInWindow):
121         * layout/display/DisplayLayerController.h:
122         * layout/display/DisplayView.cpp:
123         (WebCore::Display::View::setIsInWindow):
124         * layout/display/DisplayView.h:
125         * page/FrameView.cpp:
126         (WebCore::FrameView::setIsInWindow):
127
128 2020-09-18  Zalan Bujtas  <zalan@apple.com>
129
130         [LFC][IFC] Do not use Display::Line geometry in layout
131         https://bugs.webkit.org/show_bug.cgi?id=216711
132
133         Reviewed by Simon Fraser.
134
135         This patch introduces Layout::LineGeometry.
136         LineGeometry is used to hold the logical geometry of line and it is input to subsequent layouts.
137         This patch is also in preparation for moving out the "displayInlineItem" construction from Layout::InlineFormattingContext.
138
139         * WebCore.xcodeproj/project.pbxproj:
140         * layout/FormattingContextGeometry.cpp:
141         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
142         * layout/Verification.cpp:
143         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
144         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
145         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
146         * layout/blockformatting/BlockMarginCollapse.cpp:
147         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
148         * layout/displaytree/DisplayLine.h:
149         (WebCore::Display::Line::rect const):
150         (WebCore::Display::Line::scrollableOverflow const):
151         (WebCore::Display::Line::inkOverflow const):
152         (WebCore::Display::Line::baseline const):
153         (WebCore::Display::Line::Line):
154         (WebCore::Display::Line::left const): Deleted.
155         (WebCore::Display::Line::right const): Deleted.
156         (WebCore::Display::Line::top const): Deleted.
157         (WebCore::Display::Line::bottom const): Deleted.
158         (WebCore::Display::Line::width const): Deleted.
159         (WebCore::Display::Line::height const): Deleted.
160         (WebCore::Display::Line::moveVertically): Deleted.
161         * layout/displaytree/DisplayPainter.cpp:
162         (WebCore::Display::paintInlineContent):
163         * layout/inlineformatting/InlineFormattingContext.cpp:
164         (WebCore::Layout::InlineFormattingContext::lineLayout):
165         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
166         (WebCore::Layout::InlineFormattingContext::invalidateFormattingState):
167         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
168         (WebCore::Layout::LineBoxBuilder::constructInlineBoxes):
169         * layout/inlineformatting/InlineFormattingState.h:
170         (WebCore::Layout::InlineFormattingState::lines const):
171         (WebCore::Layout::InlineFormattingState::lines):
172         (WebCore::Layout::InlineFormattingState::addLine):
173         (WebCore::Layout::InlineFormattingState::clearLineAndRuns):
174         (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent):
175         (WebCore::Layout::InlineFormattingState::clearDisplayInlineContent): Deleted.
176         * layout/inlineformatting/InlineLineBuilder.cpp:
177         * layout/inlineformatting/InlineLineBuilder.h:
178         * layout/inlineformatting/InlineLineGeometry.h: Added.
179         (WebCore::Layout::InlineLineGeometry::logicalLeft const):
180         (WebCore::Layout::InlineLineGeometry::logicalRight const):
181         (WebCore::Layout::InlineLineGeometry::logicalTop const):
182         (WebCore::Layout::InlineLineGeometry::logicalBottom const):
183         (WebCore::Layout::InlineLineGeometry::logicalWidth const):
184         (WebCore::Layout::InlineLineGeometry::logicalHeight const):
185         (WebCore::Layout::InlineLineGeometry::logicalRect const):
186         (WebCore::Layout::InlineLineGeometry::lineBoxLogicalRect const):
187         (WebCore::Layout::InlineLineGeometry::baseline const):
188         (WebCore::Layout::InlineLineGeometry::moveVertically):
189         (WebCore::Layout::InlineLineGeometry::InlineLineGeometry):
190         * layout/inlineformatting/InlineTextItem.h:
191         * layout/integration/LayoutIntegrationLineLayout.cpp:
192         (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
193         (WebCore::LayoutIntegration::LineLayout::lineCount const):
194         (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
195         (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):
196         (WebCore::LayoutIntegration::LineLayout::paint):
197         * layout/layouttree/LayoutTreeBuilder.cpp:
198         (WebCore::Layout::outputInlineRuns):
199         * layout/tableformatting/TableFormattingContext.cpp:
200         (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
201         * layout/tableformatting/TableFormattingContextGeometry.cpp:
202         (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):
203
204 2020-09-18  Zalan Bujtas  <zalan@apple.com>
205
206         [LFC][FFC] Add flex box/item to showLayoutTree
207         https://bugs.webkit.org/show_bug.cgi?id=216694
208
209         Reviewed by Sam Weinig.
210
211         * layout/layouttree/LayoutTreeBuilder.cpp:
212         (WebCore::Layout::outputLayoutBox): 'Table principal' -> 'Table wrapper box' for consistency sake.
213
214 2020-09-18  Saam Barati  <sbarati@apple.com>
215
216         console APIs shouldn't crash making a string that's too long for a console warning when using user provided labels
217         https://bugs.webkit.org/show_bug.cgi?id=216709
218         <rdar://problem/68275357>
219
220         Reviewed by Mark Lam and Devin Rousso.
221
222         Test: inspector/console/console-oom.html
223
224         * inspector/agents/InspectorTimelineAgent.cpp:
225         (WebCore::InspectorTimelineAgent::startFromConsole):
226         (WebCore::InspectorTimelineAgent::stopFromConsole):
227         * inspector/agents/WebConsoleAgent.cpp:
228         (WebCore::WebConsoleAgent::didReceiveResponse):
229
230 2020-09-18  Don Olmstead  <don.olmstead@sony.com>
231
232         [WebGPU] Add ENABLE(WHLSL_COMPILER) guard
233         https://bugs.webkit.org/show_bug.cgi?id=216713
234
235         Reviewed by Myles C. Maxfield.
236
237         Replaces the ENABLE(WEBGPU) guards in the Modules/webgpu/WHLSL with ENABLE(WHLSL_COMPILER)
238         since not all ports need a WHLSL compiler to support WebGPU.
239
240         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
241         * Modules/webgpu/WHLSL/AST/WHLSLAddressEscapeMode.h:
242         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
243         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
244         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
245         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
246         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
247         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
248         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
249         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
250         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
251         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
252         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
253         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
254         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
255         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
256         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
257         * Modules/webgpu/WHLSL/AST/WHLSLDefaultDelete.h:
258         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
259         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
260         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
261         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
262         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
263         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
264         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
265         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
266         * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp:
267         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
268         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
269         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
270         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
271         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
272         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
273         * Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h:
274         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
275         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
276         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
277         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
278         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
279         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp:
280         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
281         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
282         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
283         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
284         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
285         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
286         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
287         * Modules/webgpu/WHLSL/AST/WHLSLNameSpace.h:
288         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
289         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
290         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
291         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
292         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
293         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
294         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h:
295         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
296         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
297         * Modules/webgpu/WHLSL/AST/WHLSLReplaceWith.h:
298         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
299         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
300         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
301         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
302         * Modules/webgpu/WHLSL/AST/WHLSLSemantic.h:
303         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
304         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
305         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
306         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
307         * Modules/webgpu/WHLSL/AST/WHLSLStatement.cpp:
308         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
309         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
310         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
311         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
312         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
313         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
314         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
315         * Modules/webgpu/WHLSL/AST/WHLSLType.cpp:
316         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
317         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp:
318         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
319         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
320         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
321         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
322         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp:
323         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
324         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h:
325         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp:
326         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
327         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
328         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
329         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
330         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
331         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
332         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
333         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
334         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
335         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
336         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
337         * Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h:
338         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
339         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
340         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
341         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
342         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
343         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.h:
344         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
345         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
346         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp:
347         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h:
348         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
349         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
350         * Modules/webgpu/WHLSL/WHLSLBuildStandardLibraryFunctionMap.py:
351         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
352         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h:
353         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp:
354         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h:
355         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
356         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h:
357         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
358         * Modules/webgpu/WHLSL/WHLSLChecker.h:
359         * Modules/webgpu/WHLSL/WHLSLCodeLocation.h:
360         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:
361         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h:
362         * Modules/webgpu/WHLSL/WHLSLError.h:
363         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp:
364         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h:
365         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
366         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
367         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
368         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h:
369         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
370         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
371         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
372         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
373         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
374         * Modules/webgpu/WHLSL/WHLSLLexer.h:
375         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
376         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h:
377         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
378         * Modules/webgpu/WHLSL/WHLSLNameContext.h:
379         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
380         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
381         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
382         * Modules/webgpu/WHLSL/WHLSLParser.h:
383         * Modules/webgpu/WHLSL/WHLSLParsingMode.h:
384         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
385         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
386         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
387         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
388         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h:
389         * Modules/webgpu/WHLSL/WHLSLProgram.cpp:
390         * Modules/webgpu/WHLSL/WHLSLProgram.h:
391         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
392         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h:
393         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:
394         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h:
395         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
396         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h:
397         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
398         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h:
399         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
400         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
401         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
402         * Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h:
403         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
404         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h:
405         * Modules/webgpu/WHLSL/WHLSLStandardLibraryFunctionMap.h:
406         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
407         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
408         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
409         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h:
410         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
411         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h:
412         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
413         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h:
414         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
415         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
416
417 2020-09-18  Chris Dumez  <cdumez@apple.com>
418
419         Crash under WebCore::shouldResetFocusNavigationStartingNode()
420         https://bugs.webkit.org/show_bug.cgi?id=216714
421         <rdar://problem/68132047>
422
423         Reviewed by Darin Adler.
424
425         Protect anchorElement in FrameView::scrollToFragmentInternal() to make sure
426         it stays alive until the time we pass it to setFocusNavigationStartingNode().
427
428         * page/FrameView.cpp:
429         (WebCore::FrameView::scrollToFragmentInternal):
430
431 2020-09-18  Aditya Keerthi  <akeerthi@apple.com>
432
433         Date/time inputs should not use user-specified formats
434         https://bugs.webkit.org/show_bug.cgi?id=216484
435         <rdar://problem/68864815>
436
437         Reviewed by Wenson Hsieh.
438
439         On macOS, users can specify custom date and time formats through System
440         Preferences. These formats can be different from the default for the
441         user’s current locale. Using these formats when rendering date and time
442         inputs is a potential fingerprinting vector, as sites can apply CSS to
443         components of the input, and measure the size of the input.
444
445         To fix, we create a new NSLocale even if the identifier matches
446         [NSLocale currentLocale]. This ensures that m_locale does not contain
447         the user's changes to the locale.
448
449         * platform/text/cocoa/LocaleCocoa.h:
450         * platform/text/cocoa/LocaleCocoa.mm:
451         (WebCore::Locale::create):
452         (WebCore::LocaleCocoa::LocaleCocoa):
453
454 2020-09-18  Aditya Keerthi  <akeerthi@apple.com>
455
456         [macOS] Date/time inputs should focus the next editable component when entering a separator key
457         https://bugs.webkit.org/show_bug.cgi?id=216661
458         <rdar://problem/69091856>
459
460         Reviewed by Wenson Hsieh.
461
462         NSDatePicker focuses the next editable field when entering a separator
463         key. We should match this behavior to be consistent with the rest of
464         the system.
465
466         * html/shadow/DateTimeFieldElement.cpp:
467         (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler):
468
469 2020-09-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
470
471         REGRESSION(r267137): PaintFrequencyTracker needs to track all the painting
472         https://bugs.webkit.org/show_bug.cgi?id=216677
473
474         Reviewed by Simon Fraser.
475
476         r267137 removed all the optimizations which the Design test got from
477         r230544 because it resets the renderingUpdateTimestamp to zero when it
478         exists. This makes RenderLayer always retrieves this timestamp with value
479         equal to zero. There is no direct call from Page::updateRendering() to
480         RenderLayer::paintLayerContents(). Painting has to be scheduled to the
481         next run-loop. Because SinglePaintFrequencyTracking tracks only the painting
482         whose timestamp is not zero, SinglePaintFrequencyTracking has not been
483         tracking any painting.
484
485         The solution is to track all the painting. When renderingUpdateTimestamp()
486         is zero, SinglePaintFrequencyTracking will use MonotonicTime::now() instead.
487         This will happen in cases like calling updateControlTints() before calling
488         Page::updateRendering().
489
490         * page/Page.cpp:
491         (WebCore::Page::updateRendering):
492         * page/Page.h:
493         (WebCore::Page::lastRenderingUpdateTimestamp const):
494         (WebCore::Page::renderingUpdateTimestamp const): Deleted.
495         * rendering/PaintFrequencyTracker.h:
496         (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
497         (WebCore::SinglePaintFrequencyTracking::~SinglePaintFrequencyTracking):
498         * rendering/RenderLayer.cpp:
499         (WebCore::RenderLayer::paintLayerContents):
500         (WebCore::RenderLayer::calculateClipRects const):
501
502 2020-09-18  Chris Dumez  <cdumez@apple.com>
503
504         webaudio/Analyser/handle-silent-inputs.html test is failing
505         https://bugs.webkit.org/show_bug.cgi?id=216708
506
507         Reviewed by Geoffrey Garen.
508
509         Merge the following fix to AnalyserNode from Blink so that webaudio/Analyser/handle-silent-inputs.html
510         layout test starts passing:
511         - https://codereview.chromium.org/2666063003
512
513         No new tests, rebaselined existing test.
514
515         * Modules/webaudio/AnalyserNode.cpp:
516         (WebCore::AnalyserNode::process):
517         (WebCore::AnalyserNode::updatePullStatus):
518         (WebCore::AnalyserNode::tailTime const):
519         * Modules/webaudio/AnalyserNode.h:
520         * Modules/webaudio/AudioBasicInspectorNode.h:
521
522 2020-09-18  Youenn Fablet  <youenn@apple.com>
523
524         Add internal flag to enable/disable H264 hardware encoder
525         https://bugs.webkit.org/show_bug.cgi?id=216534
526
527         Reviewed by Eric Carlson.
528
529         Update process-wide hardware H264 boolean flag based on internal feature flag.
530         No change of behavior.
531
532         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
533         (WebCore::LibWebRTCProvider::setH264HardwareEncoderAllowed):
534         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
535         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
536         (WebCore::LibWebRTCProvider::setH264HardwareEncoderAllowed):
537         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
538         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed): Deleted.
539         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
540         * testing/Internals.cpp:
541         (WebCore::Internals::resetToConsistentState):
542         (WebCore::Internals::setH264HardwareEncoderAllowed):
543
544 2020-09-18  Youenn Fablet  <youenn@apple.com>
545
546         Hash deviceIds in WebProcess instead of UIProcess to allow audio output device IDs in WebProcess
547         https://bugs.webkit.org/show_bug.cgi?id=216693
548
549         Reviewed by Eric Carlson.
550
551         Make sure to create new MediaDeviceInfo objects everytime enumerateDevices is called.
552         Covered by updated tests.
553
554         * Modules/mediastream/MediaDevices.cpp:
555         (WebCore::MediaDevices::MediaDevices):
556         (WebCore::MediaDevices::stop):
557         (WebCore::MediaDevices::computeDevices):
558         (WebCore::MediaDevices::enumerateDevices):
559         (WebCore::MediaDevices::refreshDevices): Deleted.
560         * Modules/mediastream/MediaDevices.h:
561
562 2020-09-18  Jer Noble  <jer.noble@apple.com>
563
564         REGRESSION(r254031): Captions fail to load on jw.org
565         https://bugs.webkit.org/show_bug.cgi?id=216672
566         <rdar://problem/69016059>
567
568         Reviewed by Eric Carlson.
569
570         Revert r254031.
571
572         * loader/TextTrackLoader.cpp:
573         (WebCore::TextTrackLoader::load):
574
575 2020-09-18  Chris Dumez  <cdumez@apple.com>
576
577         [macOS Big Sur] ASSERTION FAILED: !m_gamepadMap.get(device)./platform/gamepad/mac/HIDGamepadProvider.mm(233) under WebCore::HIDGamepadProvider::deviceAdded
578         https://bugs.webkit.org/show_bug.cgi?id=216665
579         <rdar://problem/68641574>
580
581         Reviewed by Alex Christensen.
582
583         On macOS Big Sur, it appears we get notified multiple times that the Shenzhen Longshengwei Technology Gamepad
584         is getting added during Gamepad.GCFVersusHID API test. This was causing an assertion to be hit under
585         HIDGamepadProvider::deviceAdded() where we expected the device not not already be in the map. In this patch,
586         we work around this HID quirk on Big Sur by ignoring the notification if we already know about the device.
587
588         No new tests, fixes existing API test.
589
590         * platform/gamepad/mac/HIDGamepadProvider.mm:
591         (WebCore::HIDGamepadProvider::deviceAdded):
592
593 2020-09-18  Chris Dumez  <cdumez@apple.com>
594
595         Vectorize SetTargetAtTime processing in AudioParamTimeline
596         https://bugs.webkit.org/show_bug.cgi?id=216673
597         <rdar://problem/69111432>
598
599         Reviewed by Sam Weinig.
600
601         Fix the SSE implementation of VectorMath::vsadd() to properly deal with source
602         and destination alignment, similarly to what is done in other VectorMath functions.
603
604         No new tests, fixes existing crash on GTK bots.
605
606         * platform/audio/VectorMath.cpp:
607         (WebCore::VectorMath::vsadd):
608
609 2020-09-18  Zalan Bujtas  <zalan@apple.com>
610
611         [LFC][IFC] Move computedLineLogicalRect to InlineFormattingContext::Geometry
612         https://bugs.webkit.org/show_bug.cgi?id=216680
613
614         Reviewed by Simon Fraser.
615
616         This function computes line geometry. It belongs in InlineFormattingContext::Geometry. 
617
618         * layout/inlineformatting/InlineFormattingContext.cpp:
619         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
620         (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const): Deleted.
621         * layout/inlineformatting/InlineFormattingContext.h:
622         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
623         (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const):
624
625 2020-09-18  Zalan Bujtas  <zalan@apple.com>
626
627         [LFC][IFC] Move inline box constructing and alignment logic to LineBoxBuilder
628         https://bugs.webkit.org/show_bug.cgi?id=216678
629
630         Reviewed by Simon Fraser.
631
632         Move the LineBox related logic out of the LineBox class to InlineFormattingContext::Geometry::LineBoxBuilder.
633         This makes the LineBox class a light, box like class that we can cache in the InlineFormattingState.
634
635         * layout/inlineformatting/InlineFormattingContext.cpp:
636         (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const):
637         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
638         * layout/inlineformatting/InlineFormattingContext.h:
639         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
640         (WebCore::Layout::LineBoxBuilder::formattingContext const):
641         (WebCore::Layout::LineBoxBuilder::root const):
642         (WebCore::Layout::LineBoxBuilder::layoutState const):
643         (WebCore::Layout::HangingContent::width const):
644         (WebCore::Layout::HangingContent::isConditional const):
645         (WebCore::Layout::HangingContent::setIsConditional):
646         (WebCore::Layout::HangingContent::expand):
647         (WebCore::Layout::HangingContent::reset):
648         (WebCore::Layout::collectHangingContent):
649         (WebCore::Layout::horizontalAlignmentOffset):
650         (WebCore::Layout::LineBoxBuilder::LineBoxBuilder):
651         (WebCore::Layout::LineBoxBuilder::build):
652         (WebCore::Layout::LineBoxBuilder::constructInlineBoxes):
653         (WebCore::Layout::LineBoxBuilder::computeInlineBoxesLogicalHeight):
654         (WebCore::Layout::LineBoxBuilder::alignInlineBoxesVerticallyAndComputeLineBoxHeight):
655         (WebCore::Layout::InlineFormattingContext::Geometry::lineBoxForLineContent):
656         * layout/inlineformatting/InlineLine.cpp:
657         * layout/inlineformatting/InlineLineBox.cpp:
658         (WebCore::Layout::LineBox::InlineBox::InlineBox):
659         (WebCore::Layout::LineBox::LineBox):
660         (WebCore::Layout::m_isLineVisuallyEmpty):
661         (WebCore::Layout::LineBox::addRootInlineBox):
662         (WebCore::Layout::LineBox::addInlineBox):
663         (WebCore::Layout::HangingContent::width const): Deleted.
664         (WebCore::Layout::HangingContent::isConditional const): Deleted.
665         (WebCore::Layout::HangingContent::setIsConditional): Deleted.
666         (WebCore::Layout::HangingContent::expand): Deleted.
667         (WebCore::Layout::HangingContent::reset): Deleted.
668         (WebCore::Layout::collectHangingContent): Deleted.
669         (WebCore::Layout::horizontalAlignmentOffset): Deleted.
670         (WebCore::Layout::m_inlineFormattingContext): Deleted.
671         (WebCore::Layout::LineBox::constructInlineBoxes): Deleted.
672         (WebCore::Layout::LineBox::computeInlineBoxesLogicalHeight): Deleted.
673         (WebCore::Layout::LineBox::alignInlineBoxesVerticallyAndComputeLineBoxHeight): Deleted.
674         (WebCore::Layout::LineBox::formattingContext const): Deleted.
675         (WebCore::Layout::LineBox::root const): Deleted.
676         (WebCore::Layout::LineBox::layoutState const): Deleted.
677         * layout/inlineformatting/InlineLineBox.h:
678         (WebCore::Layout::LineBox::alignmentBaseline const):
679         (WebCore::Layout::LineBox::setLogicalHeight):
680         (WebCore::Layout::LineBox::setHorizontalAlignmentOffset):
681         (WebCore::Layout::LineBox::rootInlineBox):
682         (WebCore::Layout::LineBox::nonRootInlineBoxes const):
683         (WebCore::Layout::LineBox::inlineBoxForLayoutBox):
684         * layout/inlineformatting/InlineLineBuilder.cpp:
685         (WebCore::Layout::LineBuilder::layoutInlineContent):
686         * layout/inlineformatting/InlineLineBuilder.h:
687
688 2020-09-18  Youenn Fablet  <youenn@apple.com>
689
690         XHR.timeout is affected by long tasks
691         https://bugs.webkit.org/show_bug.cgi?id=216266
692         <rdar://problem/68908150>
693
694         Reviewed by Alex Christensen.
695
696         Long tasks may block the main thread, which may block IPC processing of load messages.
697         In that case, even though the load is finished, WebProcess did not know that yet and will cancel the load.
698         To prevent that, in case of XHR timeout, do an explicit check to compute the done flag.
699         https://fetch.spec.whatwg.org/#done-flag
700
701         Tests: imported/w3c/web-platform-tests/xhr/xhr-timeout-longtask.any.html
702                imported/w3c/web-platform-tests/xhr/xhr-timeout-longtask.any.worker.html
703
704         * loader/DocumentThreadableLoader.cpp:
705         (WebCore::DocumentThreadableLoader::computeIsDone):
706         * loader/DocumentThreadableLoader.h:
707         * loader/LoaderStrategy.h:
708         * loader/ThreadableLoader.h:
709         * loader/ThreadableLoaderClient.h:
710         (WebCore::ThreadableLoaderClient::notifyIsDone):
711         * loader/ThreadableLoaderClientWrapper.h:
712         (WebCore::ThreadableLoaderClientWrapper::notifyIsDone):
713         * loader/WorkerThreadableLoader.cpp:
714         (WebCore::WorkerThreadableLoader::computeIsDone):
715         (WebCore::WorkerThreadableLoader::MainThreadBridge::computeIsDone):
716         (WebCore::WorkerThreadableLoader::MainThreadBridge::notifyIsDone):
717         * loader/WorkerThreadableLoader.h:
718         (WebCore::WorkerThreadableLoader::MainThreadBridge::loaderProxy):
719         * xml/XMLHttpRequest.cpp:
720         (WebCore::XMLHttpRequest::didReachTimeout):
721         (WebCore::XMLHttpRequest::notifyIsDone):
722         * xml/XMLHttpRequest.h:
723
724 2020-09-17  Sam Weinig  <weinig@apple.com>
725
726         Remove runtime setting for enabling/disabling the UserTiming and ResourceTiming APIs
727         https://bugs.webkit.org/show_bug.cgi?id=216556
728
729         Reviewed by Darin Adler.
730
731         Remove runtime setting for enabling/disabling UserTiming and ResourceTiming 
732         APIs. They have both been on for a while in WebKit2 and there aren't any
733         known uses cases for disabling them. In addition to removing the setting, 
734         they are now enabled in LegacyWebKit as well.
735
736         In addition to removing UserTiming and ResourceTiming, we can also remove the
737         checks for PerformanceTimelineEnabled, as that was defined entirely in terms
738         of the former.
739
740         * loader/CrossOriginPreflightChecker.cpp:
741         (WebCore::CrossOriginPreflightChecker::startPreflight):
742         * loader/DocumentThreadableLoader.cpp:
743         (WebCore::DocumentThreadableLoader::loadRequest):
744         * loader/ResourceTimingInformation.cpp:
745         (WebCore::ResourceTimingInformation::addResourceTiming):
746         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
747         * loader/SubresourceLoader.cpp:
748         (WebCore::SubresourceLoader::reportResourceTiming):
749         * loader/cache/CachedResourceLoader.cpp:
750         (WebCore::CachedResourceLoader::requestResource):
751         (WebCore::CachedResourceLoader::revalidateResource):
752         (WebCore::CachedResourceLoader::loadResource):
753         * page/Performance.idl:
754         * page/PerformanceEntry.cpp:
755         (WebCore::PerformanceEntry::parseEntryTypeString):
756         * page/PerformanceEntry.idl:
757         * page/PerformanceObserver.idl:
758         * page/PerformanceObserverEntryList.idl:
759         * page/PerformanceResourceTiming.idl:
760         * page/RuntimeEnabledFeatures.h:
761         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled): Deleted.
762         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled const): Deleted.
763         (WebCore::RuntimeEnabledFeatures::setUserTimingEnabled): Deleted.
764         (WebCore::RuntimeEnabledFeatures::userTimingEnabled const): Deleted.
765         (WebCore::RuntimeEnabledFeatures::performanceTimelineEnabled const): Deleted.
766
767 2020-09-16  Darin Adler  <darin@apple.com>
768
769         Selection API: Introduce LiveRangeSelectionEnabled, off by default
770         https://bugs.webkit.org/show_bug.cgi?id=216656
771
772         Reviewed by Sam Weinig.
773
774         For interoperability, the Selection API requires behavior that is quite different
775         from how our Selection object has behaves historically. Specifically, the range
776         returned is a live range that update as the selection updates and the selection,
777         in turn, is updated if the returned range is modified.
778
779         This significant change will have compatibility impact on websites and other
780         content that assumes the legacy  WebKit behavior, so we are developing it behind
781         a feature flag, LiveRangeSelectionEnabled.
782
783         This patch introduces the live range selection behind the flag, but leaves one
784         significant area unresolved, changing selection to keep track of the original
785         endpoints rather than only canonicalized endpoints, and a couple of loose ends,
786         lifetime of ride-along properties on the live range object, and updating test
787         expectations for the new behavior.
788
789         * dom/CharacterData.cpp:
790         (WebCore::CharacterData::setData): Fixed timing of call to Document::textRemoved
791         by letting setDataAndUpdate do it; otherwise it can be called after the selection
792         has been updated, and the range gets updated twice.
793         (WebCore::CharacterData::appendData): Pass UpdateLiveRanges::No to setDataAndUpdate,
794         to preserve the existing "don't update ranges" behavior for now at least.
795         (WebCore::CharacterData::insertData): Fixed timing of call to Document::textInserted
796         by letting setDataAndUpdate do it, for the same reason as above.
797         (WebCore::CharacterData::deleteData): Ditto, for textRemoved.
798         (WebCore::CharacterData::replaceData): Ditto, for textRemoved and textInserted.
799         (WebCore::CharacterData::setDataAndUpdate): Added UpdateLiveRanges argument and
800         calls to textRemoved and textInserted, after setting data, but before other updates.
801
802         * dom/CharacterData.h: Made setDataAndUpdate protected and added UpdateLiveRanges.
803
804         * dom/Document.h: Added optimized version of the Node::contains function. When the
805         node in question is the document we can just check treeScope and isConnected
806         rather than walking up the tree.
807
808         * dom/Node.cpp:
809         (WebCore::Node::isDescendantOf const): Moved special case for document to the top
810         of the function; seems a more important special case than disconnected nodes and
811         nodes with no children.
812         (WebCore::Node::isDescendantOrShadowDescendantOf const): Reworded the FIXME for clarity.
813         (WebCore::Node::contains const): Changed this to toke a reference instead of a pointer.
814         The pointer flavor is now inlined in the header.
815
816         * dom/Node.h: Added an overload of contains that takes a reference, analogous to what
817         we already have for isDescendantOf.
818
819         * dom/Position.cpp:
820         (WebCore::Position::Position): Removed too-strict assertions. When we start using
821         positions to represent arbitrary DOM positions for things outside editing we won't
822         want these assertions any more, and we hit them when we use Position in a more
823         straightforward way, like some cases in this patch.
824         (WebCore::Position::primaryDirection const): Added a missing null check. This case
825         is hit in some test cases in the new mode.
826
827         * dom/Range.cpp: Removed some, but probably not all, of the unneeded headers.
828         (WebCore::Range::~Range): Added an assertion.
829         (WebCore::Range::updateAssociatedSelection): Added. Tells FrameSelection to update
830         the selection when this is the live range associated with the selection.
831         (WebCore::Range::updateDocument): Added an assertion.
832         (WebCore::Range::setStart): Call updateAssociatedSelection.
833         (WebCore::Range::setEnd): Ditto.
834         (WebCore::Range::collapse): Ditto.
835         (WebCore::Range::processContents): Call collapse here to share slightly more
836         code so we don't have to call updateAssociatedSelection here.
837         (WebCore::Range::checkNodeOffsetPair): Made this a static function so it can
838         be used outside the Range class. Also fixed indentation of the switch statement.
839         (WebCore::Range::selectNodeContents): Call updateAssociatedSelection and
840         updateDocument.
841         (WebCore::setBothEndpoints): Added.
842         (WebCore::Range::updateFromSelection): Added. Uses setBothEndpoints.
843         (WebCore::createLiveRange): Refactored to call setBothEndpoints.
844
845         * dom/Range.h: Added didAssociateWithSelection, didDisassociateFromSelection,
846         updateFromSelection, updateAssociatedSelection, and m_isAssociatedWithSelection.
847         Also made checkNodeOffsetPair a public static member function instead of a
848         private non-static member function.
849
850         * dom/Text.cpp:
851         (WebCore::Text::setDataAndUpdate): Update to pass along UpdateLiveRanges argument.
852         * dom/Text.h: Ditto. Also made the override of setDataAndUpdate private.
853
854         * editing/FrameSelection.cpp:
855         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): Call
856         updateAssociatedLiveRange after updating the selection.
857         (WebCore::containsEndpoints): Added. Used to check if a live range still has the
858         document as its root node so it can remain associated this with the selection.
859         (WebCore::FrameSelection::associatedLiveRange): Added.
860         (WebCore::FrameSelection::disassociateLiveRange): Added.
861         (WebCore::FrameSelection::associateLiveRange): Added.
862         (WebCore::FrameSelection::updateFromAssociatedLiveRange): Added.
863         (WebCore::FrameSelection::updateAssociatedLiveRange): Added.
864
865         * editing/FrameSelection.h: Added associatedLiveRange, associateLiveRange,
866         disassociateLiveRange, updateFromAssociatedLiveRange, updateAssociatedLiveRange,
867         and m_associatedLiveRange. Also change m_document to a WeakPtr and do some
868         tidying up.
869
870         * page/DOMSelection.cpp:
871         (WebCore::selectionShadowAncestor): Assert the live range setting is false,
872         since this code is not used in that case. Changed the return type to RefPtr.
873         Address the FIXME here by getting the document in a simpler way.
874         (WebCore::DOMSelection::create): Moved here from the header.
875         (WebCore::DOMSelection::frame const): Added. Returns a RefPtr. This gets rid
876         of the need for various instances of the "protector" pattern in this file.
877         (WebCore::DOMSelection::range const): Added. Returns the selected range, but
878         checks for the shadow tree case and returns null in that case.
879         (WebCore::DOMSelection::anchorPosition const): Redid as a member function.
880         (WebCore::DOMSelection::focusPosition const): Ditto.
881         (WebCore::DOMSelection::basePosition const): Ditto.
882         (WebCore::DOMSelection::extentPosition const): Ditto.
883         (WebCore::DOMSelection::anchorNode const): Rewrote to be simpler using the
884         functions above.
885         (WebCore::DOMSelection::anchorOffset const): Ditto.
886         (WebCore::DOMSelection::focusNode const): Ditto.
887         (WebCore::DOMSelection::focusOffset const): Ditto.
888         (WebCore::DOMSelection::baseNode const): Ditto.
889         (WebCore::DOMSelection::baseOffset const): Ditto.
890         (WebCore::DOMSelection::extentNode const): Ditto.
891         (WebCore::DOMSelection::extentOffset const): Ditto.
892         (WebCore::DOMSelection::isCollapsed const): Rewrote using DOMSelection::range
893         and SimpleRange::collapsed.
894         (WebCore::DOMSelection::type const): Updated since frame returns RefPtr.
895         (WebCore::DOMSelection::rangeCount const): Ditto.
896         (WebCore::DOMSelection::collapse): Added new corrected checking for special
897         cases, guarded by the setting.
898         (WebCore::DOMSelection::collapseToEnd): Updated since frame returns RefPtr.
899         way to do protection. Added a call to disassociateLiveRange. No need to put
900         under a setting guard since it does nothing if feature is not enabled.
901         (WebCore::DOMSelection::collapseToStart): Ditto.
902         (WebCore::DOMSelection::empty): Call removeAllRanges so we don't have two
903         copies of the same function to maintain.
904         (WebCore::DOMSelection::setBaseAndExtent): Use makeRefPtr, added corrected
905         checking for special cases guarded by the setting.
906         (WebCore::DOMSelection::setPosition): Call collapse so we don't have two
907         copies of the same function to maintain.
908         (WebCore::DOMSelection::modify): Updated since frame returns RefPtr.
909         (WebCore::DOMSelection::extend): Ditto. Also added corrected checking for
910         special cases guarded by the setting.
911         (WebCore::DOMSelection::getRangeAt): Added a version of this function that
912         simply returns the associated live range, creating one if needed, guarded
913         by the setting.
914         (WebCore::DOMSelection::removeAllRanges): Updated since frame returns RefPtr.
915         (WebCore::DOMSelection::addRange): Added a version of this function that
916         matches the specification, guarded by the setting.
917         (WebCore::DOMSelection::removeRange): Added.
918         (WebCore::DOMSelection::deleteFromDocument): Added a version of this
919         function that simply calls deleteContents on the associated live range,
920         guarded by the setting.
921         (WebCore::DOMSelection::containsNode const): Put the text node workaround
922         inside a setting check. I also figured out why workaround was added: it
923         works around unwanted range canonicalization in various tests, but also
924         introduces incorrect behavior. Also rewrote to use DOMSelection::range.
925         (WebCore::DOMSelection::toString): Use DOMSelection::range, guarded by
926         the setting, so we return empty string when selection is in the shadow tree.
927         (WebCore::DOMSelection::shadowAdjustedNode const): When the live range
928         setting is enabled, adjust by changing the node to nullptr, not finding an
929         ancestor in the document.
930         (WebCore::DOMSelection::shadowAdjustedOffset const): Ditto, but offset 0.
931         (WebCore::DOMSelection::isValidForPosition const): Assert that the live range
932         selection setting is disabled, because this incorrect check should only be
933         used to preserve legacy behavior until we are ready to turn it on.
934
935         * page/DOMSelection.h: Updated since setBaseAndExtent, setPosition, and
936         collapse can raise exceptions, although they only do so when the live range
937         selection setting is on. Added removeRange. Moved the create function
938         out of the class definition into the .cpp file. Made return values of
939         baseNode, extentNode, anchorNode, focusNode, and shadowAdjustedNode RefPtr.
940         Made toString const. Added frame, range, anchorPosition, focusPosition,
941         basePosition, and extentPosition private functions. Removed visibleSelection.
942
943         * page/DOMSelection.idl: Updated file to match a recent draft of the
944         Selection standard, reordering things to match the order they appear there.
945         Added removeRange, guarded by the setting. Also got rid of the
946         unncecessary "undefined" string defaults for the arguments to the modify
947         method since they have no effect on observed behavior anyway.
948
949         * page/Settings.yaml: Added liveRangeSelectionEnabled.
950
951 2020-09-17  Chris Dumez  <cdumez@apple.com>
952
953         Vectorize SetTargetAtTime processing in AudioParamTimeline
954         https://bugs.webkit.org/show_bug.cgi?id=216673
955
956         Reviewed by Sam Weinig.
957
958         Vectorize SetTargetAtTime processing in AudioParamTimeline.
959
960         The patch is based on the Blink implementation at:
961         - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc
962
963         I have however added the USE(ACCELERATE) and HAVE(ARM_NEON_INTRINSICS) implementations
964         for DARWIN and non-SSE platforms.
965
966         This allows us to pass some more tests that we were failing merely due to precision
967         issues. Now that our implemention matches Blink's, our results are consistent
968         with Blink.
969
970         No new tests, rebaselined existing tests.
971
972         * Modules/webaudio/AudioParamTimeline.cpp:
973         (WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
974         (WebCore::AudioParamTimeline::processSetTarget):
975         * Modules/webaudio/AudioParamTimeline.h:
976         * platform/audio/VectorMath.cpp:
977         (WebCore::VectorMath::vsadd):
978         (WebCore::VectorMath::vsmul):
979         * platform/audio/VectorMath.h:
980
981 2020-09-17  Eric Carlson  <eric.carlson@apple.com>
982
983         [Cocoa] canPlayType('audio/mpeg; codecs="mp3"') returns ""
984         https://bugs.webkit.org/show_bug.cgi?id=147309
985
986         Reviewed by Darin Adler.
987         
988         'audio/mpeg; codecs="mp3"' is not an RFC 3003 compliant MIME type but some big
989         web sites use it. AVFoundation says the type is not supported, but MediaPlayerPrivateMediaSourceAVFObjC
990         previously returned "maybe" for all extended types where the container type is
991         supported. This bug was fixed when we moved the MIME type logic from MediaPlayerPrivateMediaSourceAVFObjC
992         to MIMETypeCache, so add a mechanism to override extended types and use it to
993         support 'audio/mpeg; codecs="mp3"'.
994
995         Test: media/media-can-play-mp3.html
996
997         * platform/graphics/MIMETypeCache.cpp:
998         (WebCore::MIMETypeCache::canDecodeType):
999         (WebCore::MIMETypeCache::overrideExtendedType):
1000         * platform/graphics/MIMETypeCache.h:
1001
1002 2020-09-17  Michael Saboff  <msaboff@apple.com>
1003
1004         Segfault in WebCore::IDBKey::createBinary
1005         https://bugs.webkit.org/show_bug.cgi?id=216501
1006
1007         Reviewed by Youenn Fablet.
1008
1009         If we can't get a copy of the JSBufferView, return an invalid IDBKey.
1010         This can happen if we are low on memory.  The existing calling code already
1011         handles the case where we might produce an invalid IDBKey.
1012
1013         Test: storage/indexeddb/IDBKey-create-array-buffer-view-oom.html
1014
1015         * Modules/indexeddb/IDBKey.cpp:
1016         (WebCore::IDBKey::createBinary):
1017
1018 2020-09-17  Antoine Quint  <graouts@webkit.org>
1019
1020         Remove AnimationTimeline::animationsForElement() and the CSS Transitions and CSS Animations accessors on ElementAnimationRareData
1021         https://bugs.webkit.org/show_bug.cgi?id=216654
1022
1023         Reviewed by Simon Fraser.
1024
1025         Before we implemented the correct way to sort animations using KeyframeEffectStack, we relied on distinct animation collections
1026         for CSS Transtions and CSS Animations and remaining Web Animations on ElementAnimationRareData. We don't need those anymore and
1027         we can use a single collection which we can now name animations() for all animations.
1028
1029         Additionally, the AnimationTimeline::animationsForElement() method where these collections were used when requesting unsorted
1030         animations was unnecessary and an incorrect design. Animations do not belong to a given timeline, so we now use the accessors
1031         on ElementAnimationRareData directly to get the sorted list of effects or the single animations collection.
1032
1033         * animation/AnimationTimeline.cpp:
1034         (WebCore::AnimationTimeline::animationWasAddedToElement):
1035         (WebCore::AnimationTimeline::animationWasRemovedFromElement):
1036         (WebCore::AnimationTimeline::willChangeRendererForElement):
1037         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
1038         (WebCore::AnimationTimeline::animationsForElement const): Deleted.
1039         * animation/AnimationTimeline.h:
1040         * animation/DocumentTimeline.cpp:
1041         (WebCore::DocumentTimeline::animationCanBeRemoved):
1042         (WebCore::DocumentTimeline::computeExtentOfAnimation const):
1043         (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const):
1044         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const):
1045         (WebCore::DocumentTimeline::animatedStyleForRenderer):
1046         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
1047         * animation/ElementAnimationRareData.h:
1048         (WebCore::ElementAnimationRareData::animations):
1049         (WebCore::ElementAnimationRareData::webAnimations): Deleted.
1050         (WebCore::ElementAnimationRareData::cssAnimations): Deleted.
1051         (WebCore::ElementAnimationRareData::transitions): Deleted.
1052         * dom/Element.cpp:
1053         (WebCore::Element::animations const):
1054         (WebCore::Element::ensureAnimations):
1055         (WebCore::Element::getAnimations):
1056         (WebCore::Element::webAnimations const): Deleted.
1057         (WebCore::Element::cssAnimations const): Deleted.
1058         (WebCore::Element::transitions const): Deleted.
1059         (WebCore::Element::ensureWebAnimations): Deleted.
1060         (WebCore::Element::ensureCSSAnimations): Deleted.
1061         (WebCore::Element::ensureTransitions): Deleted.
1062         * dom/Element.h:
1063
1064 2020-09-17  Hoa Dinh  <dvh@apple.com>
1065
1066         Rename ShouldAllowExternalSchemes to ShouldAllowExternalSchemesButNotAppLinks to clarify what this enum value is for.
1067         https://bugs.webkit.org/show_bug.cgi?id=216651
1068
1069         Reviewed by Alex Christensen.
1070
1071         Rename ShouldAllowExternalSchemes to ShouldAllowExternalSchemesButNotAppLinks and reflects the change where it's used.
1072
1073         Source/WebCore:
1074         * loader/FrameLoaderTypes.h:
1075         * page/ContextMenuController.cpp:
1076         (WebCore::ContextMenuController::contextMenuItemSelected):
1077
1078 2020-09-17  Chris Dumez  <cdumez@apple.com>
1079
1080         AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when input is silent
1081         https://bugs.webkit.org/show_bug.cgi?id=216629
1082
1083         Reviewed by Youenn Fablet.
1084
1085         AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when input is silent.
1086         This behavior is consistent with Gecko and Blink. Previously, we'd use AnalyserNode.minDecibels
1087         instead.
1088
1089         No new tests, rebaselined existing test.
1090
1091         * Modules/webaudio/RealtimeAnalyser.cpp:
1092         (WebCore::RealtimeAnalyser::getFloatFrequencyData):
1093         * platform/audio/AudioUtilities.cpp:
1094         (WebCore::AudioUtilities::linearToDecibels):
1095
1096 2020-09-17  Jer Noble  <jer.noble@apple.com>
1097
1098         [iOS] YouTube does not route video to AirPlay the first time
1099         https://bugs.webkit.org/show_bug.cgi?id=216626
1100         <rdar://problem/62222846>
1101
1102         Reviewed by Eric Carlson.
1103
1104         Difficult to test this, since it requires an live AppleTV device.
1105
1106         During a refactor, the order of a couple calls changed. A MediaPlaybackTarget needs to be in place before the MediaPlayer can
1107         be told to start playing to that target. Once the target is in-place, subsequent requests to start playing to that target succeed,
1108         which explains the "only initial AirPlay fails" behavior.
1109
1110         * platform/audio/ios/MediaSessionManagerIOS.mm:
1111         (WebCore::MediaSessionManageriOS::activeVideoRouteDidChange):
1112
1113 2020-09-17  Antti Koivisto  <antti@apple.com>
1114
1115         Style::Change should be enum class
1116         https://bugs.webkit.org/show_bug.cgi?id=216644
1117
1118         Reviewed by Sam Weinig.
1119
1120         Also improve the names of the values.
1121
1122         * dom/Document.cpp:
1123         (WebCore::Document::resolveStyle):
1124         * html/HTMLPlugInImageElement.cpp:
1125         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
1126         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1127         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
1128         * rendering/updating/RenderTreeUpdater.cpp:
1129         (WebCore::RenderTreeUpdater::updateRenderTree):
1130         (WebCore::RenderTreeUpdater::updateAfterDescendants):
1131         (WebCore::RenderTreeUpdater::updateElementRenderer):
1132         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
1133         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
1134         * style/StyleChange.cpp:
1135         (WebCore::Style::determineChange):
1136         * style/StyleChange.h:
1137         (): Deleted.
1138         * style/StyleTreeResolver.cpp:
1139         (WebCore::Style::computeDescendantsToResolve):
1140         (WebCore::Style::TreeResolver::resolveElement):
1141         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1142         (WebCore::Style::TreeResolver::resolveComposedTree):
1143         * style/StyleTreeResolver.h:
1144         * style/StyleUpdate.h:
1145         * svg/SVGElement.cpp:
1146         (WebCore::SVGElement::willRecalcStyle):
1147
1148 2020-09-17  Antoine Quint  <graouts@webkit.org>
1149
1150         Remove the legacy animation code
1151         https://bugs.webkit.org/show_bug.cgi?id=216608
1152
1153         Reviewed by Dean Jackson.
1154
1155         We remove the legacy animation code found in Source/WebCore/page/animation/, save for CSSPropertyAnimation which
1156         is also used by the new Web Animations engine and now moved to Source/WebCore/animation/. Since we now have a single
1157         animation engine, the runtime flags to optionally enable the Web Animations engine are not needed anymore and removed
1158         as well.
1159
1160         We also remove some testing utilities and some RenderLayerBacking methods specific to accelerated transitions which
1161         the new animation engine does not use.
1162
1163         * CMakeLists.txt:
1164         * Headers.cmake:
1165         * Sources.txt:
1166         * WebCore.xcodeproj/project.pbxproj:
1167         * animation/Animatable.idl:
1168         * animation/AnimationEffect.idl:
1169         * animation/AnimationPlaybackEvent.idl:
1170         * animation/AnimationPlaybackEventInit.idl:
1171         * animation/AnimationTimeline.idl:
1172         * animation/CSSAnimation.idl:
1173         * animation/CSSPropertyAnimation.cpp: Renamed from Source/WebCore/page/animation/CSSPropertyAnimation.cpp.
1174         (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
1175         * animation/CSSPropertyAnimation.h: Renamed from Source/WebCore/page/animation/CSSPropertyAnimation.h.
1176         * animation/CSSTransition.idl:
1177         * animation/DocumentAnimations.idl:
1178         * animation/DocumentOrShadowRootAnimations.idl:
1179         * animation/DocumentTimeline.idl:
1180         * animation/KeyframeEffect.idl:
1181         * animation/WebAnimation.idl:
1182         * animation/WebAnimationTypes.h:
1183         * css/CSSComputedStyleDeclaration.cpp:
1184         (WebCore::computeRenderStyleForProperty):
1185         * dom/Document.cpp:
1186         (WebCore::Document::resolveStyle):
1187         (WebCore::Document::didBecomeCurrentDocumentInFrame):
1188         (WebCore::Document::willBeRemovedFromFrame):
1189         (WebCore::Document::implicitClose):
1190         (WebCore::Document::resume):
1191         * dom/Element.cpp:
1192         (WebCore::Element::removedFromAncestor):
1193         * dom/PseudoElement.cpp:
1194         (WebCore::PseudoElement::clearHostElement):
1195         * history/CachedFrame.cpp:
1196         (WebCore::CachedFrame::destroy):
1197         * page/Frame.cpp:
1198         (WebCore::Frame::Frame):
1199         (WebCore::Frame::clearTimers):
1200         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
1201         * page/Frame.h:
1202         * page/FrameView.cpp:
1203         (WebCore::FrameView::didDestroyRenderTree):
1204         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
1205         * page/FrameViewLayoutContext.cpp:
1206         (WebCore::FrameViewLayoutContext::layout):
1207         * page/Page.cpp:
1208         (WebCore::Page::handleLowModePowerChange):
1209         (WebCore::Page::setIsVisibleInternal):
1210         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
1211         * page/RuntimeEnabledFeatures.h:
1212         (WebCore::RuntimeEnabledFeatures::setWebAnimationsEnabled): Deleted.
1213         (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const): Deleted.
1214         (WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled): Deleted.
1215         (WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const): Deleted.
1216         * page/animation/AnimationBase.cpp: Removed.
1217         * page/animation/AnimationBase.h: Removed.
1218         * page/animation/CSSAnimationController.cpp: Removed.
1219         * page/animation/CSSAnimationController.h: Removed.
1220         * page/animation/CSSAnimationControllerPrivate.h: Removed.
1221         * page/animation/CompositeAnimation.cpp: Removed.
1222         * page/animation/CompositeAnimation.h: Removed.
1223         * page/animation/ImplicitAnimation.cpp: Removed.
1224         * page/animation/ImplicitAnimation.h: Removed.
1225         * page/animation/KeyframeAnimation.cpp: Removed.
1226         * page/animation/KeyframeAnimation.h: Removed.
1227         * platform/graphics/GraphicsLayer.h:
1228         * platform/graphics/ca/GraphicsLayerCA.cpp:
1229         (WebCore::isKeyframe):
1230         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1231         * rendering/RenderElement.cpp:
1232         (WebCore::RenderElement::animatedStyle):
1233         * rendering/RenderElement.h:
1234         (WebCore::RenderElement::startTransition): Deleted.
1235         (WebCore::RenderElement::transitionPaused): Deleted.
1236         (WebCore::RenderElement::transitionFinished): Deleted.
1237         * rendering/RenderLayer.cpp:
1238         (WebCore::RenderLayer::currentTransform const):
1239         (WebCore::RenderLayer::calculateClipRects const):
1240         * rendering/RenderLayerBacking.cpp:
1241         (WebCore::RenderLayerBacking::updateGeometry):
1242         (WebCore::RenderLayerBacking::notifyAnimationStarted):
1243         (WebCore::RenderLayerBacking::startTransition): Deleted.
1244         (WebCore::RenderLayerBacking::transitionPaused): Deleted.
1245         (WebCore::RenderLayerBacking::transitionFinished): Deleted.
1246         * rendering/RenderLayerBacking.h:
1247         * rendering/RenderLayerCompositor.cpp:
1248         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1249         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1250         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1251         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
1252         * rendering/RenderLayerModelObject.cpp:
1253         (WebCore::RenderLayerModelObject::startTransition): Deleted.
1254         (WebCore::RenderLayerModelObject::transitionPaused): Deleted.
1255         (WebCore::RenderLayerModelObject::transitionFinished): Deleted.
1256         * rendering/RenderLayerModelObject.h:
1257         * rendering/RenderObject.h:
1258         (WebCore::RenderObject::legacyAnimation const): Deleted.
1259         * rendering/updating/RenderTreeUpdater.cpp:
1260         (WebCore::RenderTreeUpdater::tearDownRenderers):
1261         * style/StyleAdjuster.cpp:
1262         * style/StyleTreeResolver.cpp:
1263         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1264         * testing/InternalSettings.cpp:
1265         (WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled): Deleted.
1266         * testing/InternalSettings.h:
1267         * testing/InternalSettings.idl:
1268         * testing/Internals.cpp:
1269         (WebCore::Internals::numberOfActiveAnimations const):
1270         (WebCore::Internals::animationsAreSuspended const):
1271         (WebCore::Internals::animationsInterval const):
1272         (WebCore::Internals::suspendAnimations const):
1273         (WebCore::Internals::resumeAnimations const):
1274         (WebCore::Internals::acceleratedAnimationsForElement):
1275         (WebCore::Internals::numberOfAnimationTimelineInvalidations const):
1276         (WebCore::Internals::pauseAnimationAtTimeOnElement): Deleted.
1277         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Deleted.
1278         (WebCore::Internals::pauseTransitionAtTimeOnElement): Deleted.
1279         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Deleted.
1280         * testing/Internals.h:
1281         * testing/Internals.idl:
1282
1283 2020-09-17  Jer Noble  <jer.noble@apple.com>
1284
1285         Unified build fix for "redefinition of 'kCMVideoCodecType_VP9"
1286         https://bugs.webkit.org/show_bug.cgi?id=216205
1287
1288         Reviewed by Youenn Fablet.
1289
1290         kCMVideoCodecType_VP9 is present in the macOS Big Sur SDK, so the redeclaration can
1291         be removed. To protect builds using prior OS SDKs, wrap the entire VP9 implementation
1292         in ENABLE(VP9) checks.
1293
1294         * platform/graphics/VP9Utilities.cpp:
1295         * platform/graphics/VP9Utilities.h:
1296         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
1297         (WebCore::videoCodecTypeFromRFC4281Type):
1298         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
1299         (): Deleted.
1300         * platform/graphics/cocoa/SourceBufferParserWebM.cpp:
1301         (WebCore::SourceBufferParserWebM::isContentTypeSupported):
1302         * platform/graphics/cocoa/VP9UtilitiesCocoa.h:
1303         * platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
1304         * testing/Internals.cpp:
1305         (WebCore::Internals::Internals):
1306         (WebCore::Internals::parseVPCodecParameters):
1307         (WebCore::Internals::setHardwareVP9DecoderDisabledForTesting):
1308         (WebCore::Internals::setVP9ScreenSizeAndScaleForTesting):
1309
1310 2020-09-15  Sergio Villar Senin  <svillar@igalia.com>
1311
1312         [css-flex] Remove flexbox's specific computePreferredLogicalWidths()
1313         https://bugs.webkit.org/show_bug.cgi?id=216577
1314
1315         Reviewed by Darin Adler.
1316
1317         Remove the flexbox override of computePreferredLogicalWidths() because it's essentially the same as RenderBlock's
1318         but worst because it was missing some cases that were properly handled in the superclass.
1319
1320         * rendering/RenderFlexibleBox.cpp:
1321         (WebCore::RenderFlexibleBox::computePreferredLogicalWidths): Deleted.
1322         * rendering/RenderFlexibleBox.h: Ditto.
1323
1324 2020-09-16  Zalan Bujtas  <zalan@apple.com>
1325
1326         [LFC][IFC] Move InlineRect from Display to Layout namespace
1327         https://bugs.webkit.org/show_bug.cgi?id=216633
1328
1329         Reviewed by Simon Fraser.
1330
1331         Let's move the Display type over to Layout namespace. Display tree needs a different set of data types.
1332
1333         * WebCore.xcodeproj/project.pbxproj:
1334         * layout/displaytree/DisplayLine.h:
1335         (WebCore::Display::Line::rect const):
1336         (WebCore::Display::Line::scrollableOverflow const):
1337         (WebCore::Display::Line::inkOverflow const):
1338         (WebCore::Display::Line::Line):
1339         * layout/displaytree/DisplayRun.h:
1340         (WebCore::Display::Run::rect const):
1341         (WebCore::Display::Run::inkOverflow const):
1342         (WebCore::Display::Run::Run):
1343         * layout/flexformatting/FlexFormattingContext.cpp:
1344         (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
1345         * layout/inlineformatting/InlineFormattingContext.cpp:
1346         (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const):
1347         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
1348         * layout/inlineformatting/InlineFormattingContext.h:
1349         * layout/inlineformatting/InlineLineBox.cpp:
1350         (WebCore::Layout::LineBox::InlineBox::InlineBox):
1351         (WebCore::Layout::LineBox::logicalRectForTextRun const):
1352         (WebCore::Layout::LineBox::constructInlineBoxes):
1353         * layout/inlineformatting/InlineLineBox.h:
1354         (WebCore::Layout::LineBox::InlineBox::logicalRect const):
1355         * layout/inlineformatting/InlineRect.h: Renamed from Source/WebCore/layout/displaytree/DisplayInlineRect.h.
1356         (WebCore::Layout::InlineRect::expandHorizontally):
1357         (WebCore::Layout::InlineRect::expandVertically):
1358         (WebCore::Layout::InlineRect::invalidateTop):
1359         (WebCore::Layout::InlineRect::invalidateLeft):
1360         (WebCore::Layout::InlineRect::invalidateWidth):
1361         (WebCore::Layout::InlineRect::invalidateHeight):
1362         (WebCore::Layout::InlineRect::hasValidPosition const):
1363         (WebCore::Layout::InlineRect::hasValidSize const):
1364         (WebCore::Layout::InlineRect::hasValidGeometry const):
1365         (WebCore::Layout::InlineRect::InlineRect):
1366         (WebCore::Layout::InlineRect::invalidatePosition):
1367         (WebCore::Layout::InlineRect::setHasValidPosition):
1368         (WebCore::Layout::InlineRect::setHasValidSize):
1369         (WebCore::Layout::InlineRect::top const):
1370         (WebCore::Layout::InlineRect::left const):
1371         (WebCore::Layout::InlineRect::bottom const):
1372         (WebCore::Layout::InlineRect::right const):
1373         (WebCore::Layout::InlineRect::topLeft const):
1374         (WebCore::Layout::InlineRect::size const):
1375         (WebCore::Layout::InlineRect::width const):
1376         (WebCore::Layout::InlineRect::height const):
1377         (WebCore::Layout::InlineRect::setTopLeft):
1378         (WebCore::Layout::InlineRect::setTop):
1379         (WebCore::Layout::InlineRect::setBottom):
1380         (WebCore::Layout::InlineRect::setLeft):
1381         (WebCore::Layout::InlineRect::setWidth):
1382         (WebCore::Layout::InlineRect::setHeight):
1383         (WebCore::Layout::InlineRect::moveHorizontally):
1384         (WebCore::Layout::InlineRect::moveVertically):
1385         (WebCore::Layout::InlineRect::moveBy):
1386         (WebCore::Layout::InlineRect::expand):
1387         (WebCore::Layout::InlineRect::expandToContain):
1388         (WebCore::Layout::InlineRect::expandVerticallyToContain):
1389         (WebCore::Layout::InlineRect::inflate):
1390         (WebCore::Layout::InlineRect::operator InlineLayoutRect const):
1391
1392 2020-09-16  Zalan Bujtas  <zalan@apple.com>
1393
1394         [LFC] Remove partial invalidation
1395         https://bugs.webkit.org/show_bug.cgi?id=216631
1396
1397         Reviewed by Simon Fraser.
1398
1399         Invalidation fails when the LayoutTree does not match the RenderTree structures (e.g. table wrapper box).
1400         Since incremental layouts are not supported yet, it has a very little value. Let's remove it for now.
1401
1402         * layout/display/DisplayView.h:
1403         * layout/integration/LayoutIntegrationLineLayout.h:
1404         * layout/layouttree/LayoutTreeBuilder.cpp:
1405         (WebCore::Layout::LayoutTree::LayoutTree):
1406         (WebCore::Layout::TreeBuilder::buildLayoutTree):
1407         (WebCore::Layout::TreeBuilder::TreeBuilder):
1408         (WebCore::Layout::TreeBuilder::createReplacedBox):
1409         (WebCore::Layout::TreeBuilder::createTextBox):
1410         (WebCore::Layout::TreeBuilder::createLineBreakBox):
1411         (WebCore::Layout::TreeBuilder::createContainer):
1412         (WebCore::Layout::TreeBuilder::createLayoutBox):
1413         (WebCore::Layout::printLayoutTreeForLiveDocuments):
1414         (WebCore::Layout::LayoutTreeContent::LayoutTreeContent): Deleted.
1415         (WebCore::Layout::LayoutTreeContent::addLayoutBoxForRenderer): Deleted.
1416         (WebCore::Layout::TreeBuilder::buildTree): Deleted.
1417         * layout/layouttree/LayoutTreeBuilder.h:
1418         (WebCore::Layout::LayoutTree::root const):
1419         (WebCore::Layout::LayoutTree::append):
1420         (WebCore::Layout::LayoutTreeContent::rootLayoutBox const): Deleted.
1421         (WebCore::Layout::LayoutTreeContent::rootLayoutBox): Deleted.
1422         (WebCore::Layout::LayoutTreeContent::rootRenderer const): Deleted.
1423         (WebCore::Layout::LayoutTreeContent::addBox): Deleted.
1424         (WebCore::Layout::LayoutTreeContent::addContainer): Deleted.
1425         (WebCore::Layout::LayoutTreeContent::layoutBoxForRenderer): Deleted.
1426         (WebCore::Layout::LayoutTreeContent::layoutBoxForRenderer const): Deleted.
1427         (WebCore::Layout::LayoutTreeContent::rendererForLayoutBox const): Deleted.
1428         * page/FrameViewLayoutContext.cpp:
1429         (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
1430         (WebCore::FrameViewLayoutContext::invalidateLayoutTreeContent): Deleted.
1431         (WebCore::FrameViewLayoutContext::invalidateLayoutState): Deleted.
1432         * page/FrameViewLayoutContext.h:
1433         (WebCore::FrameViewLayoutContext::layoutFormattingState const):
1434         (WebCore::FrameViewLayoutContext::layoutTreeContent const): Deleted.
1435         * rendering/RenderImage.cpp:
1436         (WebCore::RenderImage::imageChanged):
1437         * rendering/updating/RenderTreeBuilder.cpp:
1438         (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
1439         (WebCore::RenderTreeBuilder::detachFromRenderElement):
1440         * rendering/updating/RenderTreeUpdater.cpp:
1441         (WebCore::RenderTreeUpdater::updateRendererStyle):
1442
1443 2020-09-16  Ryosuke Niwa  <rniwa@webkit.org>
1444
1445         MutationObserverRegistration should be ref counted
1446         https://bugs.webkit.org/show_bug.cgi?id=216528
1447
1448         Reviewed by Darin Adler.
1449
1450         This patch makes MutationObserverRegistration ref counted so that the transient registry can store
1451         Ref<MutationObserverRegistration> instead of a raw pointer. It also merges NodeMutationObserverData
1452         into NodeRareData now that NodeRareData is actually rare after r266714 and r266769.
1453
1454         Before this patch, MutationObserverRegistration had to be kept alive by the originally observed node
1455         using m_nodeKeptAlive whenever a transient observation occurs (i.e. observation of a node which used
1456         to be a part of the subtree of the observed node). With this patch, this complexity is eliminated.
1457
1458         No new tests since there should be no behavioral difference.
1459
1460         * dom/MutationObserver.cpp:
1461         (WebCore::MutationObserver::disconnect): Skip any node for which the observed node had been deleted.
1462         This means that the registration is alive for transient nodes (i.e. a node which used to be a part of
1463         the subtree of the observed node).
1464         (WebCore::MutationObserver::observationStarted): Converted debug assert to a release assert.
1465         (WebCore::MutationObserver::observationEnded): Ditto.
1466         (WebCore::MutationObserver::deliver): Simplified logic a bit using WTF::map.
1467         * dom/MutationObserverRegistration.cpp:
1468         (WebCore::MutationObserverRegistration::create): Added.
1469         (WebCore::MutationObserverRegistration::MutationObserverRegistration): Create a WeakPtr for m_node.
1470         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach): Deleted the code for
1471         m_nodeKeptAlive since the observed node is no longer responsible for keeping this
1472         MutationObserverRegistration alive while transient observarion takes place.
1473         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Ditto.
1474         (WebCore::MutationObserverRegistration::shouldReceiveMutationFrom const):
1475         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const): Skip m_node if it has been
1476         deleted. This is possible during transient observations.
1477         * dom/MutationObserverRegistration.h:
1478         (WebCore::MutationObserverRegistration): This class is now ref counted. Also made m_node WeakPtr.
1479         (WebCore::MutationObserverRegistration::node):
1480         * dom/Node.cpp:
1481         (WebCore::Node::clearRareData):
1482         (WebCore::Node::moveNodeToNewDocument):
1483         (WebCore::Node::mutationObserverRegistry): Deleted.
1484         (WebCore::Node::transientMutationObserverRegistry): Deleted.
1485         (WebCore::collectMatchingObserversForMutation): Now takes a reference to registry.
1486         (WebCore::Node::registeredMutationObservers):
1487         (WebCore::Node::registerMutationObserver):
1488         (WebCore::Node::unregisterMutationObserver): Converted debug assertions to release assertions. With
1489         script execution forbidden during tree mutations, this should never happen now.
1490         (WebCore::Node::registerTransientMutationObserver):
1491         (WebCore::Node::unregisterTransientMutationObserver): Ditto.
1492         (WebCore::Node::notifyMutationObserversNodeWillDetach):
1493         * dom/Node.h:
1494         * dom/NodeRareData.cpp:
1495         * dom/NodeRareData.h:
1496         (WebCore::NodeMutationObserverData): Merged into NodeRareData.
1497         (WebCore::NodeRareData::mutationObserverData): Deleted.
1498         (WebCore::NodeRareData::ensureMutationObserverData): Deleted.
1499         (WebCore::NodeRareData::mutationObserverRegistry): Added.
1500         (WebCore::NodeRareData::mutationObserverRegistryIfExists): Added.
1501         (WebCore::NodeRareData::transientMutationObserverRegistry): Added.
1502         (WebCore::NodeRareData::useTypes const):
1503
1504 2020-09-16  Sam Weinig  <weinig@apple.com>
1505
1506         Remove runtime setting for enabling/disabling CSS shadow parts
1507         https://bugs.webkit.org/show_bug.cgi?id=216567
1508
1509         Reviewed by Tim Horton.
1510
1511         Remove runtime setting for enabling/disabling CSS shadow parts. It is
1512         on by default and there is no known reason one would need to disable it.
1513
1514         * css/CSSSelector.cpp:
1515         (WebCore::CSSSelector::parsePseudoElementType):
1516         * dom/Element.cpp:
1517         (WebCore::Element::partAttributeChanged):
1518         * dom/Element.idl:
1519         * dom/ShadowRoot.cpp:
1520         (WebCore::parsePartMappingsList):
1521         * page/RuntimeEnabledFeatures.h:
1522         (WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled): Deleted.
1523         (WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const): Deleted.
1524         * style/StyleInvalidator.cpp:
1525         (WebCore::Style::Invalidator::invalidateShadowParts):
1526
1527 2020-09-16  Chris Dumez  <cdumez@apple.com>
1528
1529         AudioBufferSourceNode.start() ignores 'when' parameter when pitch rate is 0
1530         https://bugs.webkit.org/show_bug.cgi?id=216623
1531
1532         Reviewed by Eric Carlson.
1533
1534         AudioBufferSourceNode::renderFromBuffer() has special logic when pitch rate is 0 since
1535         the output value is constant. However, that logic was wrongly always writing to the
1536         begining of the destination buffer, ignoring the computed writeIndex. As a result,
1537         instead of having silence at the beginning of the destination buffer, we would have
1538         it at the end.
1539
1540         No new tests, rebaselined existing test.
1541
1542         * Modules/webaudio/AudioBufferSourceNode.cpp:
1543         (WebCore::AudioBufferSourceNode::renderFromBuffer):
1544
1545 2020-09-16  Chris Dumez  <cdumez@apple.com>
1546
1547         AudioBufferSourceNode.start() behavior is incorrect when offset is past the end of the buffer
1548         https://bugs.webkit.org/show_bug.cgi?id=216622
1549
1550         Reviewed by Geoffrey Garen.
1551
1552         AudioBufferSourceNode.start() behavior is incorrect when offset is past the end of the buffer. We
1553         are supposed to output silence. However, in order implementation, we were just resetting the offset
1554         to 0, playing the buffer from the beginning.
1555
1556         To address the issue, I have dropped the logic that would reset the read offset if past the end of
1557         the buffer.
1558
1559         No new tests, rebaselined existing test.
1560
1561         * Modules/webaudio/AudioBufferSourceNode.cpp:
1562         (WebCore::AudioBufferSourceNode::renderFromBuffer):
1563
1564         (WebCore::AudioBufferSourceNode::startPlaying):
1565         Drop dead code since m_isGrain is always true in this function.
1566
1567 2020-09-16  Stephan Szabo  <stephan.szabo@sony.com>
1568
1569         Remove ENABLE_METER_ELEMENT
1570         https://bugs.webkit.org/show_bug.cgi?id=216582
1571
1572         Reviewed by Fujii Hironori.
1573
1574         With PlayStation finally planning to turn this on,
1575         no ports had this disabled, so remove the enable flag.
1576
1577         * DerivedSources.make:
1578         * accessibility/AXObjectCache.cpp:
1579         * accessibility/AccessibilityObject.cpp:
1580         * accessibility/AccessibilityProgressIndicator.cpp:
1581         * accessibility/AccessibilityProgressIndicator.h:
1582         * accessibility/AccessibilityRenderObject.cpp:
1583         * css/html.css:
1584         * html/HTMLMeterElement.cpp:
1585         * html/HTMLMeterElement.h:
1586         * html/HTMLMeterElement.idl:
1587         * html/HTMLTagNames.in:
1588         * platform/LocalizedStrings.h:
1589         * platform/cocoa/LocalizedStringsCocoa.mm:
1590         * rendering/RenderMeter.cpp:
1591         * rendering/RenderMeter.h:
1592         * rendering/RenderObject.h:
1593         * rendering/RenderTheme.cpp:
1594         * rendering/RenderTheme.h:
1595         * rendering/RenderThemeMac.h:
1596         * rendering/RenderThemeMac.mm:
1597         * rendering/RenderThemeWin.cpp:
1598         * rendering/RenderThemeWin.h:
1599
1600 2020-09-16  Sam Weinig  <weinig@apple.com>
1601
1602         Remove runtime setting for enabling/disabling the isSecureContext API?
1603         https://bugs.webkit.org/show_bug.cgi?id=216562
1604
1605         Reviewed by Darin Adler.
1606
1607         Remove runtime setting for enabling/disabling the the isSecureContext attribute. 
1608         on window and the worker global scope. There is no known reason one would need 
1609         to disable it.
1610
1611         * page/RuntimeEnabledFeatures.h:
1612         (WebCore::RuntimeEnabledFeatures::setIsSecureContextAttributeEnabled): Deleted.
1613         (WebCore::RuntimeEnabledFeatures::isSecureContextAttributeEnabled const): Deleted.
1614         * page/WindowOrWorkerGlobalScope.idl:
1615
1616 2020-09-16  Zalan Bujtas  <zalan@apple.com>
1617
1618         [LFC] Box geometry is all logical
1619         https://bugs.webkit.org/show_bug.cgi?id=216614
1620
1621         Reviewed by Simon Fraser.
1622
1623         Rename top/left/bottom/right/width/height to logical*. These coordinates are in the Layout namespace, therefore they are all logical.
1624
1625         * layout/FormattingContext.cpp:
1626         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1627         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1628         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1629         * layout/FormattingContextGeometry.cpp:
1630         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
1631         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
1632         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
1633         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1634         * layout/LayoutContext.cpp:
1635         (WebCore::Layout::LayoutContext::layout):
1636         * layout/Verification.cpp:
1637         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1638         * layout/blockformatting/BlockFormattingContext.cpp:
1639         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider):
1640         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
1641         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
1642         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
1643         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
1644         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
1645         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1646         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
1647         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1648         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1649         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
1650         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
1651         (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
1652         * layout/display/DisplayLayerController.cpp:
1653         (WebCore::Display::LayerController::prepareForDisplay):
1654         * layout/displaytree/DisplayPainter.cpp:
1655         (WebCore::Display::paintBoxDecoration):
1656         (WebCore::Display::Painter::absoluteBoxGeometry):
1657         (WebCore::Display::paintSubtree):
1658         (WebCore::Display::collectPaintRootsAndContentRect):
1659         * layout/flexformatting/FlexFormattingContext.cpp:
1660         (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
1661         * layout/floats/FloatingContext.cpp:
1662         (WebCore::Layout::FloatingContext::positionForFloat const):
1663         (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):
1664         (WebCore::Layout::FloatingContext::append):
1665         (WebCore::Layout::FloatingContext::mapTopLeftToFloatingStateRoot const):
1666         (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
1667         * layout/floats/FloatingState.h:
1668         (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
1669         (WebCore::Layout::FloatingState::FloatItem::bottom const):
1670         * layout/inlineformatting/InlineFormattingContext.cpp:
1671         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
1672         * layout/inlineformatting/InlineLineBuilder.cpp:
1673         (WebCore::Layout::LineBuilder::inlineItemWidth const):
1674         * layout/integration/LayoutIntegrationLineLayout.cpp:
1675         (WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
1676         * layout/layouttree/LayoutBoxGeometry.cpp:
1677         (WebCore::Layout::BoxGeometry::borderBox const):
1678         * layout/layouttree/LayoutBoxGeometry.h:
1679         (WebCore::Layout::BoxGeometry::logicalBottom const):
1680         (WebCore::Layout::BoxGeometry::logicalRight const):
1681         (WebCore::Layout::BoxGeometry::logicalBottomRight const):
1682         (WebCore::Layout::BoxGeometry::logicalSize const):
1683         (WebCore::Layout::BoxGeometry::logicalWidth const):
1684         (WebCore::Layout::BoxGeometry::logicalHeight const):
1685         (WebCore::Layout::BoxGeometry::isEmpty const):
1686         (WebCore::Layout::BoxGeometry::logicalRect const):
1687         (WebCore::Layout::BoxGeometry::logicalRectWithMargin const):
1688         (WebCore::Layout::BoxGeometry::logicalTop const):
1689         (WebCore::Layout::BoxGeometry::logicalLeft const):
1690         (WebCore::Layout::BoxGeometry::logicalTopLeft const):
1691         (WebCore::Layout::BoxGeometry::setLogicalTopLeft):
1692         (WebCore::Layout::BoxGeometry::setLogicalTop):
1693         (WebCore::Layout::BoxGeometry::setLogicalLeft):
1694         (WebCore::Layout::BoxGeometry::bottom const): Deleted.
1695         (WebCore::Layout::BoxGeometry::right const): Deleted.
1696         (WebCore::Layout::BoxGeometry::bottomRight const): Deleted.
1697         (WebCore::Layout::BoxGeometry::size const): Deleted.
1698         (WebCore::Layout::BoxGeometry::width const): Deleted.
1699         (WebCore::Layout::BoxGeometry::height const): Deleted.
1700         (WebCore::Layout::BoxGeometry::rect const): Deleted.
1701         (WebCore::Layout::BoxGeometry::rectWithMargin const): Deleted.
1702         (WebCore::Layout::BoxGeometry::top const): Deleted.
1703         (WebCore::Layout::BoxGeometry::left const): Deleted.
1704         (WebCore::Layout::BoxGeometry::topLeft const): Deleted.
1705         (WebCore::Layout::BoxGeometry::setTopLeft): Deleted.
1706         (WebCore::Layout::BoxGeometry::setTop): Deleted.
1707         (WebCore::Layout::BoxGeometry::setLeft): Deleted.
1708         * layout/layouttree/LayoutTreeBuilder.cpp:
1709         (WebCore::Layout::outputLayoutBox):
1710         * layout/tableformatting/TableFormattingContext.cpp:
1711         (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
1712         (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
1713         (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
1714         * layout/tableformatting/TableFormattingContextGeometry.cpp:
1715         (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const):
1716         * layout/tableformatting/TableLayout.cpp:
1717         (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace):
1718         * page/FrameViewLayoutContext.cpp:
1719         (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
1720
1721 2020-09-16  Zalan Bujtas  <zalan@apple.com>
1722
1723         [LFC][FFC] Add basic flex item sizing and positioning
1724         https://bugs.webkit.org/show_bug.cgi?id=216613
1725
1726         Reviewed by Antti Koivisto.
1727
1728         This patch adds support for single line (no-wrap), row based flex item layout with default spacing.
1729
1730         Test: fast/layoutformattingcontext/flex-box-simple.html
1731
1732         * Sources.txt:
1733         * WebCore.xcodeproj/project.pbxproj:
1734         * layout/FormattingContextGeometry.cpp:
1735         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
1736         * layout/Verification.cpp:
1737         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1738         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1739         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1740         * layout/flexformatting/FlexFormattingContext.cpp:
1741         (WebCore::Layout::FlexFormattingContext::layoutInFlowContent):
1742         (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
1743         (WebCore::Layout::FlexFormattingContext::computeIntrinsicWidthConstraintsForFlexItems):
1744         * layout/flexformatting/FlexFormattingContext.h:
1745         (WebCore::Layout::FlexFormattingContext::Geometry::Geometry):
1746         * layout/flexformatting/FlexFormattingContextGeometry.cpp: Added.
1747         (WebCore::Layout::FlexFormattingContext::Geometry::intrinsicWidthConstraints):
1748         * layout/flexformatting/FlexFormattingState.h:
1749         (WebCore::Layout::FlexFormattingState::lines const): Flex layout has the concept of lines where flex wrap may trigger multi-line layout.
1750         (WebCore::Layout::FlexFormattingState::addLine):
1751
1752 2020-09-16  Chris Lord  <clord@igalia.com>
1753
1754         Enable full CSS color parsing within a worker for OffscreenCanvas
1755         https://bugs.webkit.org/show_bug.cgi?id=204575
1756
1757         Reviewed by Darin Adler.
1758
1759         Enable full CSS color parsing in OffscreenCanvas by removing the
1760         unnecessary use of CSSValuePool::singleton in color-parsing code in
1761         CSSPropertyParserHelpers and adding a new helper function to return a
1762         Color instead of a CSSPrimitiveValue when parsing a color.
1763
1764         Rebaselined existing layout tests.
1765
1766         * css/CSSPrimitiveValue.cpp:
1767         (WebCore::CSSPrimitiveValue::computeDegrees const):
1768         * css/CSSPrimitiveValue.h:
1769         (WebCore::CSSPrimitiveValue::computeDegrees):
1770         * css/parser/CSSParser.cpp:
1771         (WebCore::CSSParser::parseColorWorkerSafe):
1772         * css/parser/CSSParser.h:
1773         * css/parser/CSSPropertyParserHelpers.cpp:
1774         (WebCore::CSSPropertyParserHelpers::CalcParser::consumePercentRaw):
1775         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeAngleRaw):
1776         (WebCore::CSSPropertyParserHelpers::consumePercentRaw):
1777         (WebCore::CSSPropertyParserHelpers::consumePercent):
1778         (WebCore::CSSPropertyParserHelpers::consumeAngleRaw):
1779         (WebCore::CSSPropertyParserHelpers::consumeAngle):
1780         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
1781         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
1782         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
1783         (WebCore::CSSPropertyParserHelpers::consumeColorWorkerSafe):
1784         * css/parser/CSSPropertyParserHelpers.h:
1785
1786 2020-09-16  Chris Dumez  <cdumez@apple.com>
1787
1788         Merge PeriodicWave improvements from Blink
1789         https://bugs.webkit.org/show_bug.cgi?id=216576
1790
1791         Reviewed by Darin Adler.
1792
1793         Merge PeriodicWave improvements from Blink:
1794         - https://codereview.chromium.org/1180613007
1795         - https://codereview.chromium.org/66393004
1796
1797         These fixes allow us to pass some of the tests imported from Blink.
1798
1799         No new tests, rebaselined existing tests.
1800
1801         * Modules/webaudio/PeriodicWave.cpp:
1802         (WebCore::PeriodicWave::PeriodicWave):
1803         (WebCore::PeriodicWave::maxNumberOfPartials const):
1804         (WebCore::PeriodicWave::createBandLimitedTables):
1805         (WebCore::PeriodicWave::generateBasicWaveform):
1806         (WebCore::PeriodicWave::periodicWaveSize const):
1807         * Modules/webaudio/PeriodicWave.h:
1808
1809 2020-09-16  Chris Dumez  <cdumez@apple.com>
1810
1811         OfflineAudioContext should support up to 32 channels
1812         https://bugs.webkit.org/show_bug.cgi?id=216587
1813
1814         Reviewed by Darin Adler.
1815
1816         OfflineAudioContext should support up to 32 channels. It previously had
1817         an artificial limit of 10.
1818
1819         No new tests, updated existing test.
1820
1821         * Modules/webaudio/OfflineAudioContext.cpp:
1822         (WebCore::OfflineAudioContext::create):
1823
1824 2020-09-16  Brent Fulgham  <bfulgham@apple.com>
1825
1826         [macOS] Limit reported macOS release to 10.15 series
1827         https://bugs.webkit.org/show_bug.cgi?id=216593
1828         <rdar://problem/68937905>
1829
1830         Reviewed by Maciej Stachowiak.
1831
1832         If the reported system OS is 11.0 (or beyond) report the last stable release
1833         of macOS.
1834
1835         * platform/mac/UserAgentMac.mm:
1836         (WebCore::standardUserAgentWithApplicationName):
1837
1838 2020-09-16  Chris Dumez  <cdumez@apple.com>
1839
1840         OfflineAudioContext constructor should not throw when given a bad buffer length
1841         https://bugs.webkit.org/show_bug.cgi?id=216584
1842
1843         Reviewed by Youenn Fablet.
1844
1845         OfflineAudioContext constructor should not throw when given a bad buffer length. We should
1846         instead throw later on when trying to start rendering.
1847
1848         No new tests, rebaselined existing test.
1849
1850         * Modules/webaudio/BaseAudioContext.cpp:
1851         (WebCore::BaseAudioContext::BaseAudioContext):
1852         * Modules/webaudio/BaseAudioContext.h:
1853         * Modules/webaudio/OfflineAudioContext.cpp:
1854         (WebCore::OfflineAudioContext::OfflineAudioContext):
1855         (WebCore::OfflineAudioContext::create):
1856         (WebCore::OfflineAudioContext::startOfflineRendering):
1857         * Modules/webaudio/OfflineAudioContext.h:
1858         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1859         (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode):
1860         (WebCore::OfflineAudioDestinationNode::maxChannelCount const):
1861
1862 2020-09-16  Sam Weinig  <weinig@apple.com>
1863
1864         [WebIDL] Move navigator.cookieEnabled to its own interface mixin, matching the spec
1865         https://bugs.webkit.org/show_bug.cgi?id=216590
1866
1867         Reviewed by Youenn Fablet.
1868
1869         Adds NavigatorCookies interface mixin and includes it in Navigator.
1870
1871         * CMakeLists.txt:
1872         * DerivedSources-input.xcfilelist:
1873         * DerivedSources-output.xcfilelist:
1874         * DerivedSources.make:
1875         * WebCore.xcodeproj/project.pbxproj:
1876         * page/Navigator.idl:
1877         * page/NavigatorCookies.idl: Added.
1878
1879 2020-09-16  Adrian Perez de Castro  <aperez@igalia.com>
1880
1881         Non-unified build fixes, early September 2020 edition
1882         https://bugs.webkit.org/show_bug.cgi?id=216599
1883
1884         Unreviewed build fix.
1885
1886         Largely based on a patch by Lauro Moura <lmoura@igalia.com>
1887
1888         * Modules/async-clipboard/ClipboardImageReader.cpp: Add missing Document.h include.
1889         * Modules/async-clipboard/ClipboardImageReader.h: Add missing forward declaration
1890         for Document.
1891         * Modules/fetch/FetchBodyConsumer.cpp: Add missing includes for DOMFormData.h,
1892         HTTPParsers.h, and JSDOMFormData.h.
1893         * css/parser/CSSSelectorParser.cpp: Move CSSSelectorParser declaration to header.
1894         * css/parser/CSSSelectorParser.h: Ditto.
1895         * css/parser/CSSSupportsParser.cpp: Add missing CSSSelectorParser.h include.
1896         * dom/DataTransferItemList.cpp: Add missing includes for ContextDestructionObserver.h
1897         and Document.h.
1898         * html/HTMLMetaElement.cpp: Add missing includes for Settings.h and
1899         wtf/IsoMallocInlines.h.
1900         * html/canvas/EXTBlendMinMax.cpp: Add missing wtf/IsoMallocInlines.h include.
1901         * html/canvas/EXTColorBufferFloat.cpp: Ditto.
1902         * html/canvas/OESElementIndexUint.cpp: Ditto.
1903         * html/canvas/WebGLCompressedTextureASTC.cpp: Ditto.
1904         * html/canvas/WebGLCompressedTextureATC.cpp: Ditto.
1905         * html/canvas/WebGLCompressedTextureETC.cpp: Ditto.
1906         * inspector/InspectorFrontendHost.cpp: Add missing Settings.h include.
1907         * layout/display/DisplayLayerController.cpp: Add missing LayoutState.h include.
1908         * layout/displaytree/DisplayPainter.h: Add missing LayoutBox.h include.
1909         * layout/inlineformatting/InlineLineBox.cpp: Add missing InlineFormattingContext.h
1910         include.
1911         * platform/audio/FFTFrame.cpp: Add missing VectorMath.h include.
1912         * platform/audio/SincResampler.h: Add missing wtf/Optional.h include.
1913         * rendering/SimpleLineLayout.h: Add missing RenderStyleConstants.h include.
1914
1915 2020-09-16  Zalan Bujtas  <zalan@apple.com>
1916
1917         [LFC][FFC] Create a Layout::ContainerBox for flex container
1918         https://bugs.webkit.org/show_bug.cgi?id=216598
1919
1920         Reviewed by Antti Koivisto.
1921
1922         A flex container establishes a flex formatting context.
1923
1924         * layout/LayoutContext.cpp:
1925         (WebCore::Layout::LayoutContext::createFormattingContext):
1926         * layout/layouttree/LayoutTreeBuilder.cpp:
1927         (WebCore::Layout::TreeBuilder::createLayoutBox):
1928
1929 2020-09-16  Aditya Keerthi  <akeerthi@apple.com>
1930
1931         [Cocoa] Use OTF font features instead of AAT font features when possible
1932         https://bugs.webkit.org/show_bug.cgi?id=182845
1933         <rdar://problem/33046942>
1934
1935         Reviewed by Myles C. Maxfield.
1936
1937         Using OTF font features instead of AAT font features allows WebKit to
1938         leverage CoreText's mapping between OTF and AAT features. This prevents us
1939         from having to maintain our own mapping, and adds support for previously
1940         missing features (for AAT fonts), such as stylistic alternatives.
1941
1942         Note that the hlig and hist features are not mapped by CoreText for AAT
1943         fonts, in which case we handle the mapping to an AAT font feature ourselves.
1944
1945         Test: css3/font-feature-settings-stylistic-set.html
1946
1947         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1948         (WebCore::appendTrueTypeFeature):
1949         (WebCore::preparePlatformFont):
1950
1951 2020-09-16  Philippe Normand  <pnormand@igalia.com>
1952
1953         [GStreamer][1.18] Regressions
1954         https://bugs.webkit.org/show_bug.cgi?id=216558
1955
1956         Reviewed by Xabier Rodriguez-Calvar.
1957
1958         The most significant change here is the added support for video rendering stats caching.
1959         This was caught by
1960         imported/w3c/web-platform-tests/media-source/mediasource-getvideoplaybackquality.html
1961
1962         * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
1963         (webKitGLVideoSinkGetProperty): Fix 1.18 version runtime check. 1.17 was the development version of 1.18.
1964         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
1965         (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const): Ditto.
1966         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1967         (WebCore::MediaPlayerPrivateGStreamer::createVideoSink): Ditto.
1968         (WebCore::MediaPlayerPrivateGStreamer::videoPlaybackQualityMetrics): Cache or reuse cached
1969         statistics. Caching is required so that metrics queries performed after EOS still return
1970         valid values.
1971         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1972
1973 2020-09-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
1974
1975         REGRESSION(r266677): ASSERTION FAILED in PaintFrequencyTracker::end()
1976         https://bugs.webkit.org/show_bug.cgi?id=216591
1977         <rdar://problem/68635418>
1978
1979         Reviewed by Simon Fraser.
1980
1981         Make RenderLayer track the painting which is scheduled through
1982         RenderingUpdateScheduler only. We can do this by (1) reseting Page::
1983         m_renderingUpdateTimestamp at the end of Page::updateRendering() and (2)
1984         making SinglePaintFrequencyTracking track the painting only if the 
1985         timestamp is not zero.
1986
1987         * page/ChromeClient.h:
1988         (WebCore::ChromeClient::timestampForPaintFrequencyTracking const): Deleted.
1989         * page/Page.cpp:
1990         (WebCore::Page::updateRendering):
1991         * page/Page.h:
1992         (WebCore::Page::renderingUpdateTimestamp const):
1993         (WebCore::Page::lastRenderingUpdateTimestamp const): Deleted.
1994         * rendering/PaintFrequencyTracker.h:
1995         (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
1996         * rendering/RenderLayer.cpp:
1997         (WebCore::RenderLayer::paintLayerContents):
1998         (WebCore::RenderLayer::calculateClipRects const):
1999
2000 2020-09-15  Rob Buis  <rbuis@igalia.com>
2001
2002         Fix lazy image load painting
2003         https://bugs.webkit.org/show_bug.cgi?id=216554
2004
2005         Reviewed by Darin Adler.
2006
2007         Fix lazy image load painting, when LoadImmediately was introduced, it correctly
2008         triggered the immediate load but after finishing the load there was no transition
2009         to the finished lazy load state, causing the logic in RenderImage::paint to not
2010         paint the finished load. This was not detected before since most lazy load WPT tests are
2011         not pixel tests but rather test correct load events etc. (image-loading-subpixel-clip.html
2012         is an exception since it is a reftest).
2013
2014         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-subpixel-clip.html
2015
2016         * loader/ImageLoader.cpp:
2017         (WebCore::ImageLoader::notifyFinished):
2018
2019 2020-09-15  Zalan Bujtas  <zalan@apple.com>
2020
2021         [LFC][FFC] 'display: flex' generates a flex container box that is block-level when placed in flow layout
2022         https://bugs.webkit.org/show_bug.cgi?id=216596
2023
2024         Reviewed by Simon Fraser.
2025
2026         See https://www.w3.org/TR/css-flexbox-1/#flex-containers.
2027
2028         * layout/layouttree/LayoutBox.cpp:
2029         (WebCore::Layout::Box::isBlockLevelBox const):
2030
2031 2020-09-15  Zalan Bujtas  <zalan@apple.com>
2032
2033         [LFC] Use isBlockBox() in Box::establishesBlockFormattingContext
2034         https://bugs.webkit.org/show_bug.cgi?id=216595
2035
2036         Reviewed by Simon Fraser.
2037
2038         Let's use the Box::isBlockBox() function (now that we have it) to check if a box establishes a new BFC (this matches spec language now).
2039
2040         * layout/layouttree/LayoutBox.cpp:
2041         (WebCore::Layout::Box::establishesBlockFormattingContext const):
2042
2043 2020-09-15  Aditya Keerthi  <akeerthi@apple.com>
2044
2045         [macOS] Date pickers should respect the document's color scheme
2046         https://bugs.webkit.org/show_bug.cgi?id=216514
2047         <rdar://problem/68889548>
2048
2049         Reviewed by Tim Horton.
2050
2051         Added the useDarkAppearance property to DateTimeChooserParameters, which
2052         is based on Document::useDarkAppearance and the associated element's
2053         computed style.
2054
2055         * html/HTMLInputElement.cpp:
2056         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2057         * platform/DateTimeChooserParameters.h:
2058         (WebCore::DateTimeChooserParameters::encode const):
2059         (WebCore::DateTimeChooserParameters::decode):
2060
2061 2020-09-15  Yusuke Suzuki  <ysuzuki@apple.com>
2062
2063         Delete LocaleToScriptMappingICU.cpp since it is no longer used
2064         https://bugs.webkit.org/show_bug.cgi?id=216592
2065
2066         Reviewed by Myles C. Maxfield.
2067
2068         All ports are using LocaleToScriptMappingDefault.cpp and nobody is using / building LocaleToScriptMappingICU.cpp.
2069         Let's remove it and rename LocaleToScriptMappingDefault.cpp to LocaleToScriptMapping.cpp
2070
2071         * Sources.txt:
2072         * WebCore.xcodeproj/project.pbxproj:
2073         * platform/text/LocaleToScriptMapping.cpp: Renamed from Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp.
2074         * platform/text/LocaleToScriptMappingICU.cpp: Removed.
2075
2076 2020-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
2077
2078         [macOS Big Sur] CGFontRenderingGetFontSmoothingDisabled() is no longer useful
2079         https://bugs.webkit.org/show_bug.cgi?id=216588
2080         <rdar://problem/68657748>
2081
2082         Reviewed by Simon Fraser.
2083
2084         No new tests because there is no behavior change.
2085
2086         * platform/graphics/coretext/FontCascadeCoreText.cpp:
2087         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
2088
2089 2020-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
2090
2091         [Apple Win] Migrate the first part of SimpleFontData{CG}Win.cpp to FontCoreText.cpp
2092         https://bugs.webkit.org/show_bug.cgi?id=216525
2093
2094         Reviewed by Dean Jackson.
2095
2096         This migrates:
2097         - Font::isProbablyOnlyUsedToRenderIcons()
2098         - Font::platformSupportsCodePoint()
2099         - Font::determinePitch()
2100         - Font::platformBoundsForGlyph()
2101         - Font::platformPathForGlyph()
2102         - Font::applyTransforms()
2103
2104         from the old Windows CG codepath to the Core Text codepath. This patch unifies these functions
2105         between the Apple Windows port and the macOS / iOS ports.
2106
2107         Covered by existing tests.
2108
2109         * platform/graphics/Font.cpp:
2110         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const):
2111         (WebCore::Font::platformSupportsCodePoint const): Deleted.
2112         * platform/graphics/coretext/FontCoreText.cpp:
2113         (WebCore::Font::platformWidthForGlyph const): Move this up into the #if !PLATFORM(WIN) section.
2114         We don't want to migrate this one just yet because it causes a significant number of test failures,
2115         which require more investigation.
2116         (WebCore::Font::determinePitch):
2117         (WebCore::Font::isProbablyOnlyUsedToRenderIcons const):
2118         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2119         (WebCore::Font::platformBoundsForGlyph const): Deleted.
2120         (WebCore::Font::platformPathForGlyph const): Deleted.
2121         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2122         (WebCore::Font::determinePitch): The WinCairo port is the only port still using the non-CG Windows
2123         implementation of this function, so we can just move it directly into the CairoWin-specific file.
2124         * platform/graphics/win/SimpleFontDataWin.cpp:
2125         (WebCore::Font::determinePitch): Deleted.
2126
2127 2020-09-15  Chris Dumez  <cdumez@apple.com>
2128
2129         ScriptProcessorNode should throw when trying to change its channel count or channel count mode
2130         https://bugs.webkit.org/show_bug.cgi?id=216583
2131
2132         Reviewed by Geoffrey Garen.
2133
2134         ScriptProcessorNode should throw when trying to change its channel count or channel count mode:
2135         - https://www.w3.org/TR/webaudio/#audionode-channelcount-constraints
2136         - https://www.w3.org/TR/webaudio/#audionode-channelcountmode-constraints
2137
2138         No new tests, rebaselined existing test.
2139
2140         * Modules/webaudio/ScriptProcessorNode.cpp:
2141         (WebCore::ScriptProcessorNode::setChannelCount):
2142         (WebCore::ScriptProcessorNode::setChannelCountMode):
2143         * Modules/webaudio/ScriptProcessorNode.h:
2144
2145 2020-09-15  Jer Noble  <jer.noble@apple.com>
2146
2147         CRASH: Exception thrown from -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
2148         https://bugs.webkit.org/show_bug.cgi?id=216580
2149         <rdar://problem/68866834>
2150
2151         Reviewed by Eric Carlson.
2152
2153         Protect against undocumented exceptions thrown from AVContentKeySession (and related) APIs by wrapping in @try/@catch blocks and firing
2154         the correct failure callbacks if an exception is encountered.
2155
2156         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2157         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
2158         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
2159         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
2160
2161 2020-09-15  Fujii Hironori  <Hironori.Fujii@sony.com>
2162
2163         preprocessor.pm: Use Cygwin::win_to_posix_path and Cygwin::posix_to_win_path instead of cygpath command
2164         https://bugs.webkit.org/show_bug.cgi?id=216527
2165
2166         Reviewed by Darin Adler.
2167
2168         * bindings/scripts/preprocessor.pm:
2169         (applyPreprocessor): Use shellwords() to split the $preprocessor.
2170         Use Cygwin Perl's builtin functions instead of spawning process.
2171
2172 2020-09-15  Sam Weinig  <weinig@apple.com>
2173
2174         Remove runtime setting for enabling/disabling the fetch API
2175         https://bugs.webkit.org/show_bug.cgi?id=216519
2176
2177         Reviewed by Alex Christensen.
2178
2179         Remove runtime setting for enabling/disabling the fetch API. There is no
2180         reason one needs to disable it now and it has been on by default for
2181         a long enough time.
2182
2183         * Modules/fetch/FetchBody.idl:
2184         * Modules/fetch/FetchHeaders.idl:
2185         * Modules/fetch/FetchRequest.idl:
2186         * Modules/fetch/FetchResponse.idl:
2187         * Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl:
2188         * page/RuntimeEnabledFeatures.h:
2189         (WebCore::RuntimeEnabledFeatures::setFetchAPIEnabled): Deleted.
2190         (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const): Deleted.
2191
2192 2020-09-15  Ryan Haddad  <ryanhaddad@apple.com>
2193
2194         Unreviewed, fix the build with recent SDKs.
2195         rdar://68939059
2196
2197         * platform/graphics/coretext/FontCascadeCoreText.cpp:
2198         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
2199
2200 2020-09-15  Sam Weinig  <weinig@apple.com>
2201
2202         Remove runtime setting for enabling/disabling custom elements
2203         https://bugs.webkit.org/show_bug.cgi?id=216518
2204
2205         Reviewed by Tim Horton.
2206
2207         Remove runtime setting for enabling/disabling custom elements. There is no
2208         reason one need to disable it now, and it has been on by default for
2209         a long enough time.
2210
2211         * dom/CustomElementRegistry.idl:
2212         * dom/Document.cpp:
2213         (WebCore::createUpgradeCandidateElement):
2214         * page/DOMWindow.idl:
2215         * page/Settings.yaml:
2216
2217 2020-09-15  Chris Dumez  <cdumez@apple.com>
2218
2219         Improve thread-safety in ScriptProcessorNode implementation
2220         https://bugs.webkit.org/show_bug.cgi?id=216555
2221
2222         Reviewed by Geoffrey Garen.
2223
2224         Improve thread-safety in ScriptProcessorNode implementation:
2225         - Use a Lock instead of a volatile bool to determine if the main thread
2226           is still busy firing the event.
2227         - Pass the doubleBufferIndex to the main thread by capturing it in the
2228           lambda instead of relying on a data member.
2229
2230         * Modules/webaudio/ScriptProcessorNode.cpp:
2231         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
2232         (WebCore::ScriptProcessorNode::process):
2233         (WebCore::ScriptProcessorNode::fireProcessEvent):
2234         * Modules/webaudio/ScriptProcessorNode.h:
2235
2236 2020-09-15  Alex Christensen  <achristensen@webkit.org>
2237
2238         Remove unused plumbing for setting whether the storage access API is enabled
2239         https://bugs.webkit.org/show_bug.cgi?id=216516
2240
2241         Reviewed by Youenn Fablet.
2242
2243         Sending a boolean from the process pool to the network process has been superceded by a preference in WebPreferences.yaml.
2244         The boolean sent to the network process was not even used any more.
2245
2246         * platform/network/NetworkStorageSession.h:
2247         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2248         (WebCore::NetworkStorageSession::setStorageAccessAPIEnabled): Deleted.
2249
2250 2020-09-15  Sam Weinig  <weinig@apple.com>
2251
2252         [WebIDL] Update Fetch IDLs to use WindowOrWorkerGlobalScope partial mixin
2253         https://bugs.webkit.org/show_bug.cgi?id=216524
2254
2255         Reviewed by Darin Adler.
2256
2257         Move global fetch() function definition from DOMWindowFetch.idl & WorkerGlobalScopeFetch.idl
2258         to single WindowOrWorkerGlobalScopeFetch.idl, matching the spec.
2259         
2260         Also cleanup some comments in other Fetch related IDLs.
2261
2262         * CMakeLists.txt:
2263         * DerivedSources-input.xcfilelist:
2264         * DerivedSources-output.xcfilelist:
2265         * DerivedSources.make:
2266         * Modules/fetch/DOMWindowFetch.cpp: Removed.
2267         * Modules/fetch/DOMWindowFetch.h: Removed.
2268         * Modules/fetch/DOMWindowFetch.idl: Removed.
2269         * Modules/fetch/FetchRequest.idl:
2270         * Modules/fetch/FetchRequestInit.idl:
2271         * Modules/fetch/FetchResponse.idl:
2272         * Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp: Added.
2273         (WebCore::WindowOrWorkerGlobalScopeFetch::fetch):
2274         * Modules/fetch/WindowOrWorkerGlobalScopeFetch.h: Added.
2275         * Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl: Added.
2276         * Modules/fetch/WorkerGlobalScopeFetch.cpp: Removed.
2277         * Modules/fetch/WorkerGlobalScopeFetch.h: Removed.
2278         * Modules/fetch/WorkerGlobalScopeFetch.idl: Removed.
2279         * Sources.txt:
2280         * WebCore.xcodeproj/project.pbxproj:
2281
2282 2020-09-15  Zalan Bujtas  <zalan@apple.com>
2283
2284         [LFC] Move Layout::Rect to a dedicated file
2285         https://bugs.webkit.org/show_bug.cgi?id=216553
2286
2287         Reviewed by Antti Koivisto.
2288
2289         * WebCore.xcodeproj/project.pbxproj:
2290         * layout/layouttree/LayoutBoxGeometry.h:
2291         (WebCore::Layout::Rect::expandHorizontally): Deleted.
2292         (WebCore::Layout::Rect::expandVertically): Deleted.
2293         (WebCore::Layout::Rect::intersects const): Deleted.
2294         (WebCore::Layout::Rect::invalidateTop): Deleted.
2295         (WebCore::Layout::Rect::invalidateLeft): Deleted.
2296         (WebCore::Layout::Rect::invalidateWidth): Deleted.
2297         (WebCore::Layout::Rect::invalidateHeight): Deleted.
2298         (WebCore::Layout::Rect::hasValidPosition const): Deleted.
2299         (WebCore::Layout::Rect::hasValidSize const): Deleted.
2300         (WebCore::Layout::Rect::hasValidGeometry const): Deleted.
2301         (WebCore::Layout::Rect::Rect): Deleted.
2302         (WebCore::Layout::Rect::invalidatePosition): Deleted.
2303         (WebCore::Layout::Rect::setHasValidPosition): Deleted.
2304         (WebCore::Layout::Rect::setHasValidSize): Deleted.
2305         (WebCore::Layout::Rect::top const): Deleted.
2306         (WebCore::Layout::Rect::left const): Deleted.
2307         (WebCore::Layout::Rect::bottom const): Deleted.
2308         (WebCore::Layout::Rect::right const): Deleted.
2309         (WebCore::Layout::Rect::topLeft const): Deleted.
2310         (WebCore::Layout::Rect::bottomRight const): Deleted.
2311         (WebCore::Layout::Rect::size const): Deleted.
2312         (WebCore::Layout::Rect::width const): Deleted.
2313         (WebCore::Layout::Rect::height const): Deleted.
2314         (WebCore::Layout::Rect::setTopLeft): Deleted.
2315         (WebCore::Layout::Rect::setTop): Deleted.
2316         (WebCore::Layout::Rect::setLeft): Deleted.
2317         (WebCore::Layout::Rect::setWidth): Deleted.
2318         (WebCore::Layout::Rect::setHeight): Deleted.
2319         (WebCore::Layout::Rect::setSize): Deleted.
2320         (WebCore::Layout::Rect::shiftLeftTo): Deleted.
2321         (WebCore::Layout::Rect::shiftRightTo): Deleted.
2322         (WebCore::Layout::Rect::shiftTopTo): Deleted.
2323         (WebCore::Layout::Rect::shiftBottomTo): Deleted.
2324         (WebCore::Layout::Rect::moveHorizontally): Deleted.
2325         (WebCore::Layout::Rect::moveVertically): Deleted.
2326         (WebCore::Layout::Rect::expand): Deleted.
2327         (WebCore::Layout::Rect::clone const): Deleted.
2328         (WebCore::Layout::Rect::operator LayoutRect const): Deleted.
2329         * layout/layouttree/LayoutGeometryRect.h: Added.
2330         (WebCore::Layout::Rect::expandHorizontally):
2331         (WebCore::Layout::Rect::expandVertically):
2332         (WebCore::Layout::Rect::intersects const):
2333         (WebCore::Layout::Rect::invalidateTop):
2334         (WebCore::Layout::Rect::invalidateLeft):
2335         (WebCore::Layout::Rect::invalidateWidth):
2336         (WebCore::Layout::Rect::invalidateHeight):
2337         (WebCore::Layout::Rect::hasValidPosition const):
2338         (WebCore::Layout::Rect::hasValidSize const):
2339         (WebCore::Layout::Rect::hasValidGeometry const):
2340         (WebCore::Layout::Rect::Rect):
2341         (WebCore::Layout::Rect::invalidatePosition):
2342         (WebCore::Layout::Rect::setHasValidPosition):
2343         (WebCore::Layout::Rect::setHasValidSize):
2344         (WebCore::Layout::Rect::top const):
2345         (WebCore::Layout::Rect::left const):
2346         (WebCore::Layout::Rect::bottom const):
2347         (WebCore::Layout::Rect::right const):
2348         (WebCore::Layout::Rect::topLeft const):
2349         (WebCore::Layout::Rect::bottomRight const):
2350         (WebCore::Layout::Rect::size const):
2351         (WebCore::Layout::Rect::width const):
2352         (WebCore::Layout::Rect::height const):
2353         (WebCore::Layout::Rect::setTopLeft):
2354         (WebCore::Layout::Rect::setTop):
2355         (WebCore::Layout::Rect::setLeft):
2356         (WebCore::Layout::Rect::setWidth):
2357         (WebCore::Layout::Rect::setHeight):
2358         (WebCore::Layout::Rect::setSize):
2359         (WebCore::Layout::Rect::shiftLeftTo):
2360         (WebCore::Layout::Rect::shiftRightTo):
2361         (WebCore::Layout::Rect::shiftTopTo):
2362         (WebCore::Layout::Rect::shiftBottomTo):
2363         (WebCore::Layout::Rect::moveHorizontally):
2364         (WebCore::Layout::Rect::moveVertically):
2365         (WebCore::Layout::Rect::expand):
2366         (WebCore::Layout::Rect::clone const):
2367         (WebCore::Layout::Rect::operator LayoutRect const):
2368
2369 2020-09-14  Sergio Villar Senin  <svillar@igalia.com>
2370
2371         [css-flexbox] Indefinite flex-basis percentage should cause height to be ignored
2372         https://bugs.webkit.org/show_bug.cgi?id=210077
2373
2374         Reviewed by Darin Adler.
2375
2376         If flex-basis is a percentage of an indefinite height we should ignore
2377         what height specifies and treat it and as height:auto.
2378
2379         * rendering/RenderFlexibleBox.cpp:
2380         (WebCore::RenderFlexibleBox::cacheChildMainSize): Cache the intrinsic height of the child when
2381         flex-basis is a percentage of an indefinite length.
2382
2383 2020-09-15  Rob Buis  <rbuis@igalia.com>
2384
2385         Convert runtime flag to setting for lazy image loading
2386         https://bugs.webkit.org/show_bug.cgi?id=215610
2387
2388         Reviewed by Youenn Fablet.
2389
2390         Convert runtime flag to setting for lazy image loading. Settings are
2391         preferred over RuntimeEnabledFeatures as they are not global singletons
2392         and are automatically accessible in layout tests via InternalSettingsGenerated.
2393
2394         * loader/ImageLoader.cpp:
2395
2396 2020-09-15  Youenn Fablet  <youenn@apple.com>
2397
2398         End of media capture should not be reported before 3 seconds of the start of capture
2399         https://bugs.webkit.org/show_bug.cgi?id=216415
2400
2401         Reviewed by Eric Carlson.
2402
2403         Add a timer that allows taking a function and a delay as parameter.
2404         Covered by added API test.
2405
2406         * platform/Timer.h:
2407         (WebCore::DeferrableTaskTimer::fired):
2408         (WebCore::DeferrableTaskTimer::doTask):
2409         (WebCore::DeferrableTaskTimer::cancel):
2410
2411 2020-09-14  Fujii Hironori  <Hironori.Fujii@sony.com>
2412
2413         [WinCairo] Unreviewed debug build fix after r267073
2414         https://bugs.webkit.org/show_bug.cgi?id=216448
2415
2416         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2417         (WebCore::FontPlatformData::description const): Added.
2418
2419 2020-09-14  Zalan Bujtas  <zalan@apple.com>
2420
2421         [LFC] Layout::BoxGeometry rename, part II.
2422         https://bugs.webkit.org/show_bug.cgi?id=216523
2423
2424         Reviewed by Simon Fraser.
2425
2426         Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and
2427         make sure we don't use displayBox as a variable name in Layout namespace.
2428
2429         * Sources.txt:
2430         * WebCore.xcodeproj/project.pbxproj:
2431         * layout/FormattingContext.cpp:
2432         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
2433         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
2434         (WebCore::Layout::FormattingContext::computeBorderAndPadding):
2435         (WebCore::Layout::FormattingContext::geometryForBox const):
2436         * layout/FormattingContext.h:
2437         * layout/FormattingContextGeometry.cpp:
2438         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
2439         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
2440         * layout/FormattingContextQuirks.cpp:
2441         * layout/FormattingState.cpp:
2442         (WebCore::Layout::FormattingState::boxGeometry):
2443         (WebCore::Layout::FormattingState::displayBox): Deleted.
2444         * layout/FormattingState.h:
2445         * layout/LayoutContext.cpp:
2446         (WebCore::Layout::LayoutContext::layout):
2447         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
2448         * layout/LayoutState.cpp:
2449         (WebCore::Layout::LayoutState::geometryForRootBox):
2450         (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow):
2451         (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted.
2452         (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted.
2453         * layout/LayoutState.h:
2454         (WebCore::Layout::LayoutState::hasBoxGeometry const):
2455         (WebCore::Layout::LayoutState::ensureGeometryForBox):
2456         (WebCore::Layout::LayoutState::geometryForBox const):
2457         (WebCore::Layout::Box::cachedGeometryForLayoutState const):
2458         (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted.
2459         (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted.
2460         (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted.
2461         (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted.
2462         * layout/Verification.cpp:
2463         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2464         * layout/blockformatting/BlockFormattingContext.cpp:
2465         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
2466         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
2467         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
2468         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
2469         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
2470         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
2471         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
2472         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
2473         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2474         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2475         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2476         * layout/blockformatting/BlockMarginCollapse.cpp:
2477         (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
2478         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
2479         (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
2480         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
2481         (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
2482         * layout/display/DisplayLayerController.cpp:
2483         (WebCore::Display::LayerController::prepareForDisplay):
2484         * layout/displaytree/DisplayPainter.cpp:
2485         (WebCore::Display::paintBoxDecoration):
2486         (WebCore::Display::Painter::absoluteBoxGeometry):
2487         (WebCore::Display::paintSubtree):
2488         (WebCore::Display::collectPaintRootsAndContentRect):
2489         (WebCore::Display::Painter::absoluteDisplayBox): Deleted.
2490         * layout/displaytree/DisplayPainter.h:
2491         * layout/floats/FloatAvoider.h:
2492         * layout/floats/FloatingContext.cpp:
2493         (WebCore::Layout::FloatingContext::positionForFloat const):
2494         (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):
2495         (WebCore::Layout::FloatingContext::append):
2496         (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const):
2497         (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted.
2498         * layout/floats/FloatingContext.h:
2499         * layout/floats/FloatingState.cpp:
2500         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
2501         * layout/floats/FloatingState.h:
2502         (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
2503         (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const):
2504         (WebCore::Layout::FloatingState::FloatItem::bottom const):
2505         * layout/inlineformatting/InlineFormattingContext.cpp:
2506         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2507         (WebCore::Layout::InlineFormattingContext::lineLayout):
2508         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2509         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
2510         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
2511         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
2512         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
2513         (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted.
2514         * layout/inlineformatting/InlineFormattingContext.h:
2515         * layout/inlineformatting/InlineLineBox.h:
2516         * layout/inlineformatting/InlineLineBuilder.cpp:
2517         * layout/integration/LayoutIntegrationLineLayout.cpp:
2518         (WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
2519         * layout/layouttree/LayoutBox.cpp:
2520         (WebCore::Layout::Box::setcachedGeometryForLayoutState const):
2521         (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted.
2522         * layout/layouttree/LayoutBox.h:
2523         * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp.
2524         (WebCore::Layout::BoxGeometry::BoxGeometry):
2525         (WebCore::Layout::BoxGeometry::~BoxGeometry):
2526         (WebCore::Layout::BoxGeometry::marginBox const):
2527         (WebCore::Layout::BoxGeometry::borderBox const):
2528         (WebCore::Layout::BoxGeometry::paddingBox const):
2529         (WebCore::Layout::BoxGeometry::contentBox const):
2530         * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h.
2531         (WebCore::Layout::Rect::expandHorizontally):
2532         (WebCore::Layout::Rect::expandVertically):
2533         (WebCore::Layout::Rect::intersects const):
2534         (WebCore::Layout::Rect::invalidateTop):
2535         (WebCore::Layout::Rect::invalidateLeft):
2536         (WebCore::Layout::Rect::invalidateWidth):
2537         (WebCore::Layout::Rect::invalidateHeight):
2538         (WebCore::Layout::Rect::hasValidPosition const):
2539         (WebCore::Layout::Rect::hasValidSize const):
2540         (WebCore::Layout::Rect::hasValidGeometry const):
2541         (WebCore::Layout::Rect::Rect):
2542         (WebCore::Layout::Rect::invalidatePosition):
2543         (WebCore::Layout::Rect::setHasValidPosition):
2544         (WebCore::Layout::Rect::setHasValidSize):
2545         (WebCore::Layout::Rect::top const):
2546         (WebCore::Layout::Rect::left const):
2547         (WebCore::Layout::Rect::bottom const):
2548         (WebCore::Layout::Rect::right const):
2549         (WebCore::Layout::Rect::topLeft const):
2550         (WebCore::Layout::Rect::bottomRight const):
2551         (WebCore::Layout::Rect::size const):
2552         (WebCore::Layout::Rect::width const):
2553         (WebCore::Layout::Rect::height const):
2554         (WebCore::Layout::Rect::setTopLeft):
2555         (WebCore::Layout::Rect::setTop):
2556         (WebCore::Layout::Rect::setLeft):
2557         (WebCore::Layout::Rect::setWidth):
2558         (WebCore::Layout::Rect::setHeight):
2559         (WebCore::Layout::Rect::setSize):
2560         (WebCore::Layout::Rect::shiftLeftTo):
2561         (WebCore::Layout::Rect::shiftRightTo):
2562         (WebCore::Layout::Rect::shiftTopTo):
2563         (WebCore::Layout::Rect::shiftBottomTo):
2564         (WebCore::Layout::Rect::moveHorizontally):
2565         (WebCore::Layout::Rect::moveVertically):
2566         (WebCore::Layout::Rect::expand):
2567         (WebCore::Layout::Rect::clone const):
2568         (WebCore::Layout::Rect::operator LayoutRect const):
2569         (WebCore::Layout::BoxGeometry::bottom const):
2570         (WebCore::Layout::BoxGeometry::right const):
2571         (WebCore::Layout::BoxGeometry::bottomRight const):
2572         (WebCore::Layout::BoxGeometry::size const):
2573         (WebCore::Layout::BoxGeometry::width const):
2574         (WebCore::Layout::BoxGeometry::height const):
2575         (WebCore::Layout::BoxGeometry::isEmpty const):
2576         (WebCore::Layout::BoxGeometry::rect const):
2577         (WebCore::Layout::BoxGeometry::rectWithMargin const):
2578         (WebCore::Layout::BoxGeometry::hasClearance const):
2579         (WebCore::Layout::BoxGeometry::verticalBorder const):
2580         (WebCore::Layout::BoxGeometry::horizontalBorder const):
2581         (WebCore::Layout::BoxGeometry::contentBoxTop const):
2582         (WebCore::Layout::BoxGeometry::contentBoxLeft const):
2583         (WebCore::Layout::BoxGeometry::contentBoxBottom const):
2584         (WebCore::Layout::BoxGeometry::contentBoxRight const):
2585         (WebCore::Layout::BoxGeometry::paddingBoxTop const):
2586         (WebCore::Layout::BoxGeometry::paddingBoxLeft const):
2587         (WebCore::Layout::BoxGeometry::paddingBoxBottom const):
2588         (WebCore::Layout::BoxGeometry::paddingBoxRight const):
2589         (WebCore::Layout::BoxGeometry::paddingBoxHeight const):
2590         (WebCore::Layout::BoxGeometry::paddingBoxWidth const):
2591         (WebCore::Layout::BoxGeometry::borderBoxHeight const):
2592         (WebCore::Layout::BoxGeometry::borderBoxWidth const):
2593         (WebCore::Layout::BoxGeometry::marginBoxHeight const):
2594         (WebCore::Layout::BoxGeometry::marginBoxWidth const):
2595         (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const):
2596         (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const):
2597         (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore):
2598         (WebCore::Layout::BoxGeometry::moveHorizontally):
2599         (WebCore::Layout::BoxGeometry::moveVertically):
2600         (WebCore::Layout::BoxGeometry::move):
2601         (WebCore::Layout::BoxGeometry::moveBy):
2602         (WebCore::Layout::BoxGeometry::setHasClearance):
2603         (WebCore::Layout::BoxGeometry::invalidateBorder):
2604         (WebCore::Layout::BoxGeometry::invalidatePadding):
2605         (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore):
2606         (WebCore::Layout::BoxGeometry::setHasValidTop):
2607         (WebCore::Layout::BoxGeometry::setHasValidLeft):
2608         (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin):
2609         (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin):
2610         (WebCore::Layout::BoxGeometry::setHasValidBorder):
2611         (WebCore::Layout::BoxGeometry::setHasValidPadding):
2612         (WebCore::Layout::BoxGeometry::setHasValidContentHeight):
2613         (WebCore::Layout::BoxGeometry::setHasValidContentWidth):
2614         (WebCore::Layout::BoxGeometry::invalidateMargin):
2615         (WebCore::Layout::BoxGeometry::top const):
2616         (WebCore::Layout::BoxGeometry::left const):
2617         (WebCore::Layout::BoxGeometry::topLeft const):
2618         (WebCore::Layout::BoxGeometry::setTopLeft):
2619         (WebCore::Layout::BoxGeometry::setTop):
2620         (WebCore::Layout::BoxGeometry::setLeft):
2621         (WebCore::Layout::BoxGeometry::setContentBoxHeight):
2622         (WebCore::Layout::BoxGeometry::setContentBoxWidth):
2623         (WebCore::Layout::BoxGeometry::contentBoxHeight const):
2624         (WebCore::Layout::BoxGeometry::contentBoxWidth const):
2625         (WebCore::Layout::BoxGeometry::setHorizontalMargin):
2626         (WebCore::Layout::BoxGeometry::setVerticalMargin):
2627         (WebCore::Layout::BoxGeometry::setBorder):
2628         (WebCore::Layout::BoxGeometry::setPadding):
2629         (WebCore::Layout::BoxGeometry::setVerticalPadding):
2630         (WebCore::Layout::BoxGeometry::verticalMargin const):
2631         (WebCore::Layout::BoxGeometry::horizontalMargin const):
2632         (WebCore::Layout::BoxGeometry::marginBefore const):
2633         (WebCore::Layout::BoxGeometry::marginStart const):
2634         (WebCore::Layout::BoxGeometry::marginAfter const):
2635         (WebCore::Layout::BoxGeometry::marginEnd const):
2636         (WebCore::Layout::BoxGeometry::paddingTop const):
2637         (WebCore::Layout::BoxGeometry::paddingLeft const):
2638         (WebCore::Layout::BoxGeometry::paddingBottom const):
2639         (WebCore::Layout::BoxGeometry::paddingRight const):
2640         (WebCore::Layout::BoxGeometry::verticalPadding const):
2641         (WebCore::Layout::BoxGeometry::horizontalPadding const):
2642         (WebCore::Layout::BoxGeometry::borderTop const):
2643         (WebCore::Layout::BoxGeometry::borderLeft const):
2644         (WebCore::Layout::BoxGeometry::borderBottom const):
2645         (WebCore::Layout::BoxGeometry::borderRight const):
2646         * layout/layouttree/LayoutTreeBuilder.cpp:
2647         (WebCore::Layout::outputLayoutBox):
2648         (WebCore::Layout::outputLayoutTree):
2649         (WebCore::Layout::showLayoutTree):
2650         * layout/tableformatting/TableFormattingContext.cpp:
2651         (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
2652         (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
2653         (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
2654         (WebCore::Layout::TableFormattingContext::layoutCell):
2655         * layout/tableformatting/TableFormattingContextGeometry.cpp:
2656         * layout/tableformatting/TableLayout.cpp:
2657         * page/FrameViewLayoutContext.cpp:
2658         (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
2659
2660 2020-09-14  Ryosuke Niwa  <rniwa@webkit.org>
2661
2662         Element should not set an attribute inside its constructor
2663         https://bugs.webkit.org/show_bug.cgi?id=216507
2664
2665         Reviewed by Wenson Hsieh.
2666
2667         Moved the code to add attributes from element constructors to respective ::create functions
2668         since setting attributes could run code in parseAttribute some of which may try to store
2669         "this" in Ref / RefPtr, which would not be safe before adoptRef is called.
2670
2671         No new tests since there should be no observable behavioral change.
2672
2673         * dom/Element.cpp:
2674         (WebCore::Element::setAttributeInternal): Added an assertion.
2675         * html/FileInputType.cpp:
2676         (WebCore::UploadButtonElement::create):
2677         (WebCore::UploadButtonElement::createForMultiple):
2678         (WebCore::UploadButtonElement::createInternal): Extracted.
2679         (WebCore::UploadButtonElement::UploadButtonElement):
2680         * html/HTMLKeygenElement.cpp:
2681         * html/shadow/DateTimeEditElement.cpp:
2682         (WebCore::DateTimeEditElement::DateTimeEditElement):
2683         (WebCore::DateTimeEditElement::create):
2684         * html/shadow/DateTimeFieldElements.cpp:
2685         (WebCore::DateTimeDayFieldElement::DateTimeDayFieldElement):
2686         (WebCore::DateTimeDayFieldElement::create):
2687         (WebCore::DateTimeHourFieldElement::DateTimeHourFieldElement):
2688         (WebCore::DateTimeHourFieldElement::create):
2689         (WebCore::DateTimeMeridiemFieldElement::DateTimeMeridiemFieldElement):
2690         (WebCore::DateTimeMeridiemFieldElement::create):
2691         (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement):
2692         (WebCore::DateTimeMillisecondFieldElement::create):
2693         (WebCore::DateTimeMinuteFieldElement::DateTimeMinuteFieldElement):
2694         (WebCore::DateTimeMinuteFieldElement::create):
2695         (WebCore::DateTimeMonthFieldElement::DateTimeMonthFieldElement):
2696         (WebCore::DateTimeMonthFieldElement::create):
2697         (WebCore::DateTimeSecondFieldElement::DateTimeSecondFieldElement):
2698         (WebCore::DateTimeSecondFieldElement::create):
2699         (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement):
2700         (WebCore::DateTimeSymbolicMonthFieldElement::create):
2701         (WebCore::DateTimeYearFieldElement::DateTimeYearFieldElement):
2702         (WebCore::DateTimeYearFieldElement::create):
2703         * html/shadow/DetailsMarkerControl.cpp:
2704         (WebCore::DetailsMarkerControl::create):
2705         (WebCore::DetailsMarkerControl::DetailsMarkerControl):
2706         * html/shadow/MediaControlTextTrackContainerElement.cpp:
2707         (WebCore::MediaControlTextTrackContainerElement::create):
2708         (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement):
2709         * html/shadow/SpinButtonElement.cpp:
2710         (WebCore::SpinButtonElement::SpinButtonElement):
2711         (WebCore::SpinButtonElement::create):
2712         * html/shadow/TextControlInnerElements.cpp:
2713         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
2714         (WebCore::TextControlPlaceholderElement::create):
2715         (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
2716         (WebCore::SearchFieldCancelButtonElement::create):
2717         * html/shadow/YouTubeEmbedShadowElement.cpp:
2718         (WebCore::YouTubeEmbedShadowElement::create):
2719         (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
2720         * html/track/TextTrackCue.cpp:
2721         (WebCore::TextTrackCueBox::create): Moved from .h.
2722         (WebCore::TextTrackCueBox::TextTrackCueBox):
2723         (WebCore::TextTrackCueBox::initilaize): Added.
2724         * html/track/TextTrackCue.h:
2725         (WebCore::TextTrackCueBox::create): Moved to cpp.
2726         * html/track/TextTrackCueGeneric.cpp:
2727         (WebCore::TextTrackCueGenericBoxElement::create): Now calls initialize().
2728         * html/track/VTTCue.cpp:
2729         (WebCore::VTTCueBox::create): Moved from .h. Now calls initialize().
2730         * html/track/VTTCue.h:
2731         (WebCore::VTTCueBox::create): Moved to cpp.
2732
2733 2020-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
2734
2735         [Apple Win] Migrate from FontPlatformDataWin.cpp to FontPlatformDataCoreText.cpp
2736         https://bugs.webkit.org/show_bug.cgi?id=216448
2737
2738         Reviewed by Darin Adler.
2739
2740         This is one of the steps toward migrating the Apple Win port off of CGFont and on to
2741         CTFont. This patch removes the #if !PLATFORM(WIN) guard in FontPlatformDataCoreText.cpp
2742         and deletes the old functions it used to be using. It fixes up the Core Text functions to
2743         use ctFont() instead of font(), because font() returns the HFONT on Windows.
2744
2745         It also adds a new helper, platformOpenTypeTable(), because it looks like
2746         CTFontCopyTable() sometimes fails, so we can use this function to fall back to using the
2747         HFONT and the win32 API instead.
2748
2749         Covered by existing tests.
2750
2751         * platform/graphics/FontPlatformData.cpp:
2752         * platform/graphics/FontPlatformData.h:
2753         (WebCore::FontPlatformData::ctFont const):
2754         (WebCore::FontPlatformData::font const):
2755         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2756         (WebCore::FontPlatformData::platformOpenTypeTable const):
2757         * platform/graphics/coretext/FontPlatformDataCoreText.cpp:
2758         (WebCore::FontPlatformData::FontPlatformData):
2759         (WebCore::FontPlatformData::registeredFont const):
2760         (WebCore::FontPlatformData::ctFont const):
2761         (WebCore::FontPlatformData::openTypeTable const):
2762         (WebCore::FontPlatformData::description const):
2763         (WebCore::FontPlatformData::familyName const):
2764         * platform/graphics/win/FontCustomPlatformData.cpp:
2765         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2766         (WebCore::FontCustomPlatformData::fontPlatformData):
2767         (WebCore::createFontCustomPlatformData):
2768         * platform/graphics/win/FontCustomPlatformData.h:
2769         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
2770         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2771         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2772         (WebCore::FontCustomPlatformData::fontPlatformData):
2773         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2774         (WebCore::FontPlatformData::FontPlatformData):
2775         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2776         (WebCore::FontPlatformData::openTypeTable const):
2777         * platform/graphics/win/FontPlatformDataWin.cpp:
2778         (WebCore::FontPlatformData::platformOpenTypeTable const):
2779         (WebCore::FontPlatformData::openTypeTable const): Deleted.
2780         (WebCore::FontPlatformData::description const): Deleted.
2781
2782 2020-09-14  Chris Dumez  <cdumez@apple.com>
2783
2784         Types of Panner.setPosition() / setOrientation() parameters should not be unrestricted float
2785         https://bugs.webkit.org/show_bug.cgi?id=216508
2786
2787         Reviewed by Darin Adler.
2788
2789         Types of Panner.setPosition() / setOrientation() parameters should not be unrestricted float:
2790         - https://www.w3.org/TR/webaudio/#pannernode
2791
2792         They should use float type so that we throw when passing values that are non-finite or not a number.
2793
2794         Test: webaudio/panner-node-exceptions.html
2795
2796         * Modules/webaudio/PannerNode.idl:
2797
2798 2020-09-14  Sam Weinig  <weinig@apple.com>
2799
2800         Remove runtime setting for enabling/disabling ShadowDOM
2801         https://bugs.webkit.org/show_bug.cgi?id=216511
2802
2803         Reviewed by Ryosuke Niwa.
2804
2805         Remove runtime setting for enabling/disabling ShadowDOM. There is no
2806         reason one need to disable it now, and it has been on by default for
2807         a long enough time.
2808
2809         * dom/Element.idl:
2810         * dom/Event.idl:
2811         * dom/Node.idl:
2812         * dom/ShadowRoot.idl:
2813         * dom/Slotable.idl:
2814         * html/HTMLSlotElement.idl:
2815         * page/RuntimeEnabledFeatures.h:
2816         (WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled): Deleted.
2817         (WebCore::RuntimeEnabledFeatures::shadowDOMEnabled const): Deleted.
2818
2819 2020-09-14  Simon Fraser  <simon.fraser@apple.com>
2820
2821         REGRESSION (Async overflow scroll): Code snippets on getkirby.com appear and disappear as content is scrolled
2822         https://bugs.webkit.org/show_bug.cgi?id=216490
2823         <rdar://problem/67018073>
2824
2825         Reviewed by Zalan Bujtas.
2826         
2827         The content in question had a z-order layer tree like this:
2828
2829             A (0,0) width=997 height=829 (layerID 20) {sc 2} RenderView 
2830               + B (0,0) width=997 height=8 RenderBlock  HTML  class='no-js'
2831                 + C (0,0) width=997 height=829 RenderFlexibleBox  MAIN 
2832                   n D (0,0) width=256 height=829 RenderFlexibleBox  NAV  class='left panel'
2833                     n E (0,0) width=256 height=829 (layerID 25) {sc 3} RenderBlock  DIV  class='scroller'
2834                   n F (256,0) width=741 height=829 RenderFlexibleBox  ARTICLE  class='main panel'
2835                     n G (0,0) width=741 height=829 (layerID 26) {sc 4} RenderBlock  DIV  class='scroller'
2836                       n H (0,-816) width=741 height=2810 RenderBlock  DIV  class='article-content'
2837                 + I (0,0) width=256 height=1000 (layerID 27) overlap RenderBlock (relative positioned)  DIV  class='content'
2838                 + J (10,300) width=721 height=202 (layerID 28) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
2839                 + K (10,802) width=721 height=202 (layerID 29) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
2840                 + L (10,1304) width=721 height=202 (layerID 30) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
2841                 + M (10,1806) width=721 height=202 (layerID 31) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
2842                 + M (10,2308) width=721 height=202 (layerID 32) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
2843
2844         When layer 'G' is scrolled, the code would find the paint-order parent, F, which is normal-flow because it has overflow:hidden,
2845         and would call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it. However, that doesn't go high enough, because
2846         we need to update J-M since their ancestor clipping stacks have geometry that relies on the scroll position of G. If we don't
2847         update that geometry, GraphicsLayers have an incorrect notion of what's visible, and we don't attach backing store.
2848
2849         The fix is to climb up to the stacking context B and call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it.
2850
2851         Test: compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment.html
2852
2853         * rendering/RenderLayer.cpp:
2854         (WebCore::RenderLayer::scrollTo):
2855
2856 2020-09-14  Chris Dumez  <cdumez@apple.com>
2857
2858         Type of AnalyserNode's attributes should not be unrestricted double
2859         https://bugs.webkit.org/show_bug.cgi?id=216505
2860
2861         Reviewed by Darin Adler.
2862
2863         Type of AnalyserNode's attributes should not be unrestricted double. They should use double type
2864         so that we throw when trying to set them to NaN or infinity values.
2865
2866         No new tests, updated existing test.
2867
2868         * Modules/webaudio/AnalyserNode.cpp:
2869         (WebCore::AnalyserNode::setSmoothingTimeConstant):
2870         * Modules/webaudio/AnalyserNode.idl:
2871
2872 2020-09-14  Chris Dumez  <cdumez@apple.com>
2873
2874         Drop non-standard AudioBuffer.gain
2875         https://bugs.webkit.org/show_bug.cgi?id=216510
2876
2877         Reviewed by Darin Adler.
2878
2879         Drop non-standard AudioBuffer.gain:
2880         - https://www.w3.org/TR/webaudio/#AudioBuffer
2881
2882         Blink does not expose this attribute either.
2883
2884         No new tests, updated existing test.
2885
2886         * Modules/webaudio/AudioBuffer.h:
2887         (WebCore::AudioBuffer::gain const): Deleted.
2888         (WebCore::AudioBuffer::setGain): Deleted.
2889         (): Deleted.
2890         * Modules/webaudio/AudioBuffer.idl:
2891         * Modules/webaudio/AudioBufferSourceNode.cpp:
2892         (WebCore::AudioBufferSourceNode::process):
2893
2894 2020-09-14  Chris Dumez  <cdumez@apple.com>
2895
2896         Drop smoothing logic from DelayDSPKernel::process()
2897         https://bugs.webkit.org/show_bug.cgi?id=216504
2898
2899         Reviewed by Eric Carlson.
2900
2901         Drop smoothing logic from DelayDSPKernel::process(). This is not as per specification and does not
2902         match the behavior of Chromium. This is causing us to fail a WPT test.
2903
2904         No new tests, rebaselined existing test.
2905
2906         * Modules/webaudio/DelayDSPKernel.cpp:
2907         (WebCore::DelayDSPKernel::DelayDSPKernel):
2908         (WebCore::DelayDSPKernel::process):
2909         (WebCore::DelayDSPKernel::reset):
2910         * Modules/webaudio/DelayDSPKernel.h:
2911
2912 2020-09-14  Zalan Bujtas  <zalan@apple.com>
2913
2914         [LFC][FFC] Block box flex items establish block formatting contexts
2915         https://bugs.webkit.org/show_bug.cgi?id=216502
2916
2917         Reviewed by Simon Fraser.
2918
2919         1. The display value of a flex item is blockified: if the specified display of an in-flow child of an element
2920            generating a flex container is an inline-level value, it computes to its block-level equivalent.
2921         2. A block box that establishes an independent formatting context establishes a new block formatting context for its contents.
2922
2923         * layout/layouttree/LayoutBox.cpp:
2924         (WebCore::Layout::Box::establishesBlockFormattingContext const):
2925         (WebCore::Layout::Box::isBlockBox const):
2926         * layout/layouttree/LayoutBox.h:
2927
2928 2020-09-14  Jer Noble  <jer.noble@apple.com>
2929
2930         [Cocoa,HDR] HLS streams with HDR variants will not select HDR.
2931         https://bugs.webkit.org/show_bug.cgi?id=216203
2932         <rdar://problem/67438626>
2933
2934         Reviewed by Darin Adler.
2935
2936         Test: http/tests/media/hls/hls-hdr-switch.html
2937
2938         In r264710, we adopted a new API to set the preferred HDR mode for every AVPlayer created by an HTMLMediaElement. The
2939         MediaPlayerPrivateAVFoundationObjC object will query its parent when it creates an AVPlayer, or the MediaPlayer will
2940         tell the MediaPlayerPrivate... that the HDR mode changes if the AVPlayer is already created. However, in r264710, we
2941         neglected to cache the new value of the preferred HDR mode, so subsequent queries will just return "Standard". This means
2942         HDR mode will correctly be applied if it changes after the AVPlayer has been created, but not initially.
2943
2944         * platform/graphics/MediaPlayer.cpp:
2945         (WebCore::MediaPlayer::setPreferredDynamicRangeMode):
2946
2947 2020-09-14  Simon Fraser  <simon.fraser@apple.com>
2948
2949         [LFC] The result of layout should be Layout::Geometry, not Display::Box
2950         https://bugs.webkit.org/show_bug.cgi?id=216497
2951
2952         Reviewed by Zalan Bujtas.
2953
2954         We should reserve things in the Display namespace for painting, so layout should emit
2955         Layout::Geometry rather than Display::Boxes. So clone Display::Box to Layout::Geometry
2956         and use Layout::Geometry everywhere that Display::Box was used.
2957
2958         Future patches will move painting ot use Display objects.
2959
2960         * Sources.txt:
2961         * WebCore.xcodeproj/project.pbxproj:
2962         * layout/FormattingContext.cpp:
2963         (WebCore::Layout::FormattingContext::geometryForBox const):
2964         * layout/FormattingContext.h:
2965         * layout/FormattingContextGeometry.cpp:
2966         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
2967         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
2968         * layout/FormattingContextQuirks.cpp:
2969         * layout/FormattingState.cpp:
2970         (WebCore::Layout::FormattingState::displayBox):
2971         * layout/FormattingState.h:
2972         * layout/LayoutContext.cpp:
2973         (WebCore::Layout::LayoutContext::layout):
2974         (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
2975         * layout/LayoutState.cpp:
2976         (WebCore::Layout::LayoutState::geometryForRootLayoutBox):
2977         (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow):
2978         (WebCore::Layout::LayoutState::displayBoxForRootLayoutBox): Deleted.
2979         * layout/LayoutState.h:
2980         (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox):
2981         (WebCore::Layout::LayoutState::geometryForLayoutBox const):
2982         (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const):
2983         (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBox): Deleted.
2984         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const): Deleted.
2985         * layout/Verification.cpp:
2986         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2987         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2988         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2989         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
2990         * layout/display/DisplayLayerController.cpp:
2991         (WebCore::Display::LayerController::prepareForDisplay):
2992         * layout/displaytree/DisplayPainter.cpp:
2993         (WebCore::Display::paintBoxDecoration):
2994         (WebCore::Display::Painter::absoluteDisplayBox):
2995         (WebCore::Display::collectPaintRootsAndContentRect):
2996         * layout/displaytree/DisplayPainter.h:
2997         * layout/floats/FloatAvoider.h:
2998         * layout/floats/FloatingContext.cpp:
2999         (WebCore::Layout::FloatingContext::append):
3000         * layout/floats/FloatingState.cpp:
3001         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
3002         * layout/floats/FloatingState.h:
3003         (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
3004         (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const):
3005         * layout/inlineformatting/InlineLineBox.h:
3006         * layout/inlineformatting/InlineLineBuilder.cpp:
3007         * layout/integration/LayoutIntegrationLineLayout.cpp:
3008         (WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
3009         * layout/layouttree/LayoutBox.cpp:
3010         (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const):
3011         * layout/layouttree/LayoutBox.h:
3012         * layout/layouttree/LayoutGeometry.cpp: Added.
3013         (WebCore::Layout::Geometry::Geometry):
3014         (WebCore::Layout::Geometry::~Geometry):
3015         (WebCore::Layout::Geometry::marginBox const):
3016         (WebCore::Layout::Geometry::borderBox const):
3017         (WebCore::Layout::Geometry::paddingBox const):
3018         (WebCore::Layout::Geometry::contentBox const):
3019         * layout/layouttree/LayoutGeometry.h: Added.
3020         (WebCore::Layout::Rect::expandHorizontally):
3021         (WebCore::Layout::Rect::expandVertically):
3022         (WebCore::Layout::Rect::intersects const):
3023         (WebCore::Layout::Rect::invalidateTop):
3024         (WebCore::Layout::Rect::invalidateLeft):
3025         (WebCore::Layout::Rect::invalidateWidth):
3026         (WebCore::Layout::Rect::invalidateHeight):
3027         (WebCore::Layout::Rect::hasValidPosition const):
3028         (WebCore::Layout::Rect::hasValidSize const):
3029         (WebCore::Layout::Rect::hasValidGeometry const):
3030         (WebCore::Layout::Rect::Rect):
3031         (WebCore::Layout::Rect::invalidatePosition):
3032         (WebCore::Layout::Rect::setHasValidPosition):
3033         (WebCore::Layout::Rect::setHasValidSize):
3034         (WebCore::Layout::Rect::top const):
3035         (WebCore::Layout::Rect::left const):
3036         (WebCore::Layout::Rect::bottom const):
3037         (WebCore::Layout::Rect::right const):
3038         (WebCore::Layout::Rect::topLeft const):
3039         (WebCore::Layout::Rect::bottomRight const):
3040         (WebCore::Layout::Rect::size const):
3041         (WebCore::Layout::Rect::width const):
3042         (WebCore::Layout::Rect::height const):
3043         (WebCore::Layout::Rect::setTopLeft):
3044         (WebCore::Layout::Rect::setTop):
3045         (WebCore::Layout::Rect::setLeft):
3046         (WebCore::Layout::Rect::setWidth):
3047         (WebCore::Layout::Rect::setHeight):
3048         (WebCore::Layout::Rect::setSize):
3049         (WebCore::Layout::Rect::shiftLeftTo):
3050         (WebCore::Layout::Rect::shiftRightTo):
3051         (WebCore::Layout::Rect::shiftTopTo):
3052         (WebCore::Layout::Rect::shiftBottomTo):
3053         (WebCore::Layout::Rect::moveHorizontally):
3054         (WebCore::Layout::Rect::moveVertically):
3055         (WebCore::Layout::Rect::expand):
3056         (WebCore::Layout::Rect::clone const):
3057         (WebCore::Layout::Rect::operator LayoutRect const):
3058         (WebCore::Layout::Geometry::bottom const):
3059         (WebCore::Layout::Geometry::right const):
3060         (WebCore::Layout::Geometry::bottomRight const):
3061         (WebCore::Layout::Geometry::size const):
3062         (WebCore::Layout::Geometry::width const):
3063         (WebCore::Layout::Geometry::height const):
3064         (WebCore::Layout::Geometry::isEmpty const):
3065         (WebCore::Layout::Geometry::rect const):
3066         (WebCore::Layout::Geometry::rectWithMargin const):
3067         (WebCore::Layout::Geometry::hasClearance const):
3068         (WebCore::Layout::Geometry::verticalBorder const):
3069         (WebCore::Layout::Geometry::horizontalBorder const):
3070         (WebCore::Layout::Geometry::contentBoxTop const):
3071         (WebCore::Layout::Geometry::contentBoxLeft const):
3072         (WebCore::Layout::Geometry::contentBoxBottom const):
3073         (WebCore::Layout::Geometry::contentBoxRight const):
3074         (WebCore::Layout::Geometry::paddingBoxTop const):
3075         (WebCore::Layout::Geometry::paddingBoxLeft const):
3076         (WebCore::Layout::Geometry::paddingBoxBottom const):
3077         (WebCore::Layout::Geometry::paddingBoxRight const):
3078         (WebCore::Layout::Geometry::paddingBoxHeight const):
3079         (WebCore::Layout::Geometry::paddingBoxWidth const):
3080         (WebCore::Layout::Geometry::borderBoxHeight const):
3081         (WebCore::Layout::Geometry::borderBoxWidth const):
3082         (WebCore::Layout::Geometry::marginBoxHeight const):
3083         (WebCore::Layout::Geometry::marginBoxWidth const):
3084         (WebCore::Layout::Geometry::verticalMarginBorderAndPadding const):
3085         (WebCore::Layout::Geometry::horizontalMarginBorderAndPadding const):
3086         (WebCore::Layout::Geometry::setHasPrecomputedMarginBefore):
3087         (WebCore::Layout::Geometry::moveHorizontally):
3088         (WebCore::Layout::Geometry::moveVertically):
3089         (WebCore::Layout::Geometry::move):
3090         (WebCore::Layout::Geometry::moveBy):
3091         (WebCore::Layout::Geometry::setHasClearance):
3092         (WebCore::Layout::Geometry::invalidateBorder):
3093         (WebCore::Layout::Geometry::invalidatePadding):
3094         (WebCore::Layout::Geometry::invalidatePrecomputedMarginBefore):
3095         (WebCore::Layout::Geometry::setHasValidTop):
3096         (WebCore::Layout::Geometry::setHasValidLeft):
3097         (WebCore::Layout::Geometry::setHasValidVerticalMargin):
3098         (WebCore::Layout::Geometry::setHasValidHorizontalMargin):
3099         (WebCore::Layout::Geometry::setHasValidBorder):
3100         (WebCore::Layout::Geometry::setHasValidPadding):
3101         (WebCore::Layout::Geometry::setHasValidContentHeight):
3102         (WebCore::Layout::Geometry::setHasValidContentWidth):
3103         (WebCore::Layout::Geometry::invalidateMargin):
3104         (WebCore::Layout::Geometry::top const):
3105         (WebCore::Layout::Geometry::left const):
3106         (WebCore::Layout::Geometry::topLeft const):
3107         (WebCore::Layout::Geometry::setTopLeft):
3108         (WebCore::Layout::Geometry::setTop):
3109         (WebCore::Layout::Geometry::setLeft):
3110         (WebCore::Layout::Geometry::setContentBoxHeight):
3111         (WebCore::Layout::Geometry::setContentBoxWidth):
3112         (WebCore::Layout::Geometry::contentBoxHeight const):
3113         (WebCore::Layout::Geometry::contentBoxWidth const):
3114         (WebCore::Layout::Geometry::setHorizontalMargin):
3115         (WebCore::Layout::Geometry::setVerticalMargin):
3116         (WebCore::Layout::Geometry::setBorder):
3117         (WebCore::Layout::Geometry::setPadding):
3118         (WebCore::Layout::Geometry::setVerticalPadding):
3119         (WebCore::Layout::Geometry::verticalMargin const):
3120         (WebCore::Layout::Geometry::horizontalMargin const):
3121         (WebCore::Layout::Geometry::marginBefore const):
3122         (WebCore::Layout::Geometry::marginStart const):
3123         (WebCore::Layout::Geometry::marginAfter const):
3124         (WebCore::Layout::Geometry::marginEnd const):
3125         (WebCore::Layout::Geometry::paddingTop const):
3126         (WebCore::Layout::Geometry::paddingLeft const):
3127         (WebCore::Layout::Geometry::paddingBottom const):
3128         (WebCore::Layout::Geometry::paddingRight const):
3129         (WebCore::Layout::Geometry::verticalPadding const):
3130         (WebCore::Layout::Geometry::horizontalPadding const):
3131         (WebCore::Layout::Geometry::borderTop const):
3132         (WebCore::Layout::Geometry::borderLeft const):
3133         (WebCore::Layout::Geometry::borderBottom const):
3134         (WebCore::Layout::Geometry::borderRight const):
3135         * layout/layouttree/LayoutTreeBuilder.cpp:
3136         (WebCore::Layout::outputLayoutBox):
3137         (WebCore::Layout::outputLayoutTree):
3138         (WebCore::Layout::showLayoutTree):
3139         * layout/tableformatting/TableFormattingContext.cpp:
3140         * layout/tableformatting/TableFormattingContextGeometry.cpp:
3141         * layout/tableformatting/TableLayout.cpp:
3142         * page/FrameViewLayoutContext.cpp:
3143         (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
3144
3145 2020-09-14  Peng Liu  <peng.liu6@apple.com>
3146
3147         Returning to element fullscreen from PiP is not stable under stress tests
3148         https://bugs.webkit.org/show_bug.cgi?id=216287
3149
3150         Reviewed by Jer Noble.
3151
3152         * platform/cocoa/VideoFullscreenChangeObserver.h:
3153         Delete prepareToExitFullscreen().
3154
3155         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3156         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3157         (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
3158         (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStop):
3159         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
3160         (VideoFullscreenInterfaceAVKit::stopPictureInPictureTimerFired):
3161         (VideoFullscreenInterfaceAVKit::setReadyToStopPictureInPicture):
3162         VideoFullscreenInterfaceAVKit expects an element enters fullscreen and figure out the
3163         location and size of the video element after that, which will be used by AVKit for the
3164         exiting picture-in-picture animation. However, the entering fullscreen may take a long
3165         time and AVKit will start exiting picture-in-picture before the entering fullscreen
3166         transition is done. We need to add protection for such a scenario. This patch adds
3167         a timer (m_stopPictureInPictureTimer) for this purpose. This patch also makes sure
3168         VideoFullscreenInterfaceAVKit will call didExitPictureInPicture() properly.
3169
3170         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3171         Delete prepareToExitFullscreen().
3172
3173         * platform/mac/VideoFullscreenInterfaceMac.mm:
3174         (WebCore::VideoFullscreenInterfaceMac::preparedToReturnToInline): This function
3175         is not used on Mac.
3176
3177 2020-09-14  Sam Weinig  <weinig@apple.com>
3178
3179         [WebIDL] Move synthetic operation creation from IDLParser to CodeGeneratorJS
3180         https://bugs.webkit.org/show_bug.cgi?id=216468
3181
3182         Reviewed by Chris Dumez.
3183
3184         Address FIXMEs in IDLParser by moving synthetic operation creation out of IDLParser
3185         and into CodeGeneratorJS. Replace use of isIterable/isMapLike/isSetLike predicates
3186         on IDLOperation and IDLAttribute with extended attributes, FromIterable, 
3187         ForwardToMapLike and ForwardToSetLike.
3188
3189         While this change completely removes all notion of operations/attributes from 
3190         IDLMapLike and IDLSetLike, IDLIterable retains an operations array, now only
3191         used by CodeGeneratorJS, to avoid a larger refactoring of the code generation.
3192         Eventually, it would be good to stop using AST level operations and attributes
3193         to model these synthetic operations, and instead have the code generation
3194         maintain a model that more closely resembles the ECMAScript output directly.
3195
3196         While here, also fix the issue that maplike and setlike were always overriding
3197         set/clear/delete and add/clear/delete (respectively) where as WebIDL says they
3198         should only add those if the interface doesn't already have members with those
3199         names. Adds new tests for this behavior.
3200
3201         * bindings/scripts/CodeGeneratorJS.pm:
3202         * bindings/scripts/IDLParser.pm:
3203         * bindings/scripts/test/BindingTestGlobalConstructors.idl:
3204         * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp: Added.
3205         * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.h: Added.
3206         * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp: Added.
3207         * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.h: Added.
3208         * bindings/scripts/test/SupplementalDependencies.dep:
3209         * bindings/scripts/test/TestMapLikeWithOverriddenOperations.idl: Added.
3210         * bindings/scripts/test/TestSetLikeWithOverriddenOperations.idl: Added.
3211
3212 2020-09-14  Zalan Bujtas  <zalan@apple.com>
3213
3214         [LFC][FFC] Each in-flow child of a flex container becomes a flex item.
3215         https://bugs.webkit.org/show_bug.cgi?id=216494
3216
3217         Reviewed by Simon Fraser.
3218
3219         ...and flex items form independent formatting contexts for their content.
3220
3221         * layout/layouttree/LayoutBox.cpp:
3222         (WebCore::Layout::Box::establishesIndependentFormattingContext const):
3223         (WebCore::Layout::Box::isFlexItem const):
3224         * layout/layouttree/LayoutBox.h:
3225
3226 2020-09-14  Chris Dumez  <cdumez@apple.com>
3227
3228         AudioDestinationCocoa should stop hardcoding the number of output channels to 2
3229         https://bugs.webkit.org/show_bug.cgi?id=216491
3230
3231         Reviewed by Darin Adler.
3232
3233         Stop hardcoding the number of output channels in AudioDestinationCocoa and instead use the AudioDestinationNode's
3234         number of output channels.
3235
3236         * platform/audio/cocoa/AudioDestinationCocoa.cpp:
3237         (WebCore::AudioDestination::create):
3238         (WebCore::AudioDestinationCocoa::AudioDestinationCocoa):
3239         (WebCore::AudioDestinationCocoa::numberOfOutputChannels const):
3240         (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription):
3241         (): Deleted.
3242         * platform/audio/cocoa/AudioDestinationCocoa.h:
3243         * platform/mock/MockAudioDestinationCocoa.cpp:
3244         (WebCore::MockAudioDestinationCocoa::MockAudioDestinationCocoa):
3245
3246 2020-09-14  Fujii Hironori  <Hironori.Fujii@sony.com>
3247
3248         [WinCairo][MediaFoundation] r264188 introduced linker warning: LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
3249         https://bugs.webkit.org/show_bug.cgi?id=214170
3250
3251         Reviewed by Alex Christensen.
3252
3253         r264188 added the linker flag /DELAYLOAD:mf.dll to WebCore. It
3254         introduced a lot of linker warnings for modules not using
3255         MediaFoundation, for example WebKitWebProcess.exe,
3256         MiniBrowserLib.dll, etc. The linker option should be applied only
3257         to direct WebCore consumers, namely WebKit.dll, WebKit2.dll and
3258         TestWebCore.exe.
3259
3260         Define a INTERFACE library, and link it explicitly with the direct
3261         WebCore consumers.
3262
3263         * PlatformWinCairo.cmake:
3264
3265 2020-09-14  Dean Jackson  <dino@apple.com>
3266
3267         Enable WebGL2 by default
3268         https://bugs.webkit.org/show_bug.cgi?id=216464
3269         <rdar://problem/68811378>
3270
3271         Reviewed by Sam Weinig.
3272
3273         Our WebGL2 implementation is in good enough shape that we should
3274         enable it by default for broader testing.
3275
3276         * page/RuntimeEnabledFeatures.h:
3277
3278 2020-09-14  Zalan Bujtas  <zalan@apple.com>
3279
3280         [LFC][FFC] Introduce flex formatting context
3281         https://bugs.webkit.org/show_bug.cgi?id=216483
3282
3283         Reviewed by Antti Koivisto.
3284
3285         Add the basic class structure for the flex formatting context.
3286         https://www.w3.org/TR/css-flexbox-1/
3287
3288         * Sources.txt:
3289         * WebCore.xcodeproj/project.pbxproj:
3290         * layout/FormattingContext.h:
3291         (WebCore::Layout::FormattingContext::isFlexFormattingContext const):
3292         * layout/FormattingState.h:
3293         (WebCore::Layout::FormattingState::isFlexFormattingState const):
3294         * layout/LayoutState.cpp:
3295         (WebCore::Layout::LayoutState::establishedFormattingState const):
3296         (WebCore::Layout::LayoutState::establishedFlexFormattingState const):
3297         (WebCore::Layout::LayoutState::ensureFormattingState):
3298         (WebCore::Layout::LayoutState::ensureFlexFormattingState):
3299         * layout/LayoutState.h:
3300         * layout/flexformatting/FlexFormattingContext.cpp: Added.
3301         (WebCore::Layout::FlexFormattingContext::FlexFormattingContext):
3302         (WebCore::Layout::FlexFormattingContext::layoutInFlowContent):
3303         (WebCore::Layout::FlexFormattingContext::computedIntrinsicWidthConstraints):
3304         * layout/flexformatting/FlexFormattingContext.h: Added.
3305         * layout/flexformatting/FlexFormattingState.cpp: Added.
3306         (WebCore::Layout::FlexFormattingState::FlexFormattingState):
3307         (WebCore::Layout::FlexFormattingState::~FlexFormattingState):
3308         * layout/flexformatting/FlexFormattingState.h: Added.
3309         * layout/layouttree/LayoutBox.cpp:
3310         (WebCore::Layout::Box::establishesFormattingContext const):
3311         (WebCore::Layout::Box::establishesFlexFormattingContext const):
3312         * layout/layouttree/LayoutBox.h:
3313         (WebCore::Layout::Box::isFlexBox const):
3314
3315 2020-09-14  Simon Fraser  <simon.fraser@apple.com>
3316
3317         First steps towards LFC painting in WebKit2
3318         https://bugs.webkit.org/show_bug.cgi?id=216466
3319
3320         Address post-landing comments: make two constructors explicit.
3321
3322         * layout/display/DisplayLayerController.h:
3323         * layout/display/DisplayView.h:
3324
3325 2020-09-14  Simon Fraser  <simon.fraser@apple.com>
3326
3327         First steps towards LFC painting in WebKit2
3328         https://bugs.webkit.org/show_bug.cgi?id=216466
3329
3330         Reviewed by Zalan Bujtas.
3331
3332         Get LFC painting in WebKit2.
3333
3334         Display::LayerController() is intended to be a controller object that makes layerization
3335         decisions; for now, it just creates some root layers and hooks them up via attachRootGraphicsLayer().
3336         It also creates a GraphicsLayerClient that paints by calling LayoutContext::paint().
3337
3338         Display::View is responsible for the display of an LFC-rendered document. FrameView
3339         has one, and the Display::View has a Display::LayerController(). The minimal hookup points are:
3340         1. Page::doAfterUpdateRendering() tells each Display::View to prepareForDisplay().
3341            This is where we'll do once-per-rendering layer updating.
3342         2. FrameView::flushCompositingStateForThisFrame() tells the Display::View() to flush
3343            layers, which just passes through to Display::LayerController().
3344
3345         For now we just rely on the fact that Display::LayerController() calls attachRootGraphicsLayer()
3346         after RenderLayerCompositor, replacing the root layer created by existing RenderLayerCompositor code.
3347
3348         * CMakeLists.txt:
3349         * Headers.cmake:
3350         * Sources.txt:
3351         * WebCore.xcodeproj/project.pbxproj:
3352         * layout/LayoutState.h:
3353         (WebCore::Layout::LayoutState::hasRoot const):
3354         * layout/display/DisplayLayerController.cpp: Added.
3355         (WebCore::Display::LayerController::RootLayerClient::RootLayerClient):
3356         (WebCore::Display::LayerController::RootLayerClient::notifyFlushRequired):
3357         (WebCore::Display::LayerController::RootLayerClient::paintContents):
3358         (WebCore::Display::LayerController::LayerController):
3359         (WebCore::Display::LayerController::prepareForDisplay):
3360         (WebCore::Display::LayerController::flushLayers):
3361         (WebCore::Display::LayerController::visibleRectForLayerFlushing const):
3362         (WebCore::Display::LayerController::scheduleRenderingUpdate):
3363         (WebCore::Display::LayerController::ensureRootLayer):
3364         (WebCore::Display::LayerController::setupRootLayerHierarchy):
3365         (WebCore::Display::LayerController::updateRootLayerGeometry):
3366         (WebCore::Display::LayerController::attachRootLayer):
3367         (WebCore::Display::LayerController::graphicsLayerFactory const):
3368         * layout/display/DisplayLayerController.h: Added.
3369         (WebCore::Display::LayerController::view const):
3370         (WebCore::Display::LayerController::rootGraphicsLayer const):
3371         (WebCore::Display::LayerController::contentLayer const):
3372         * layout/display/DisplayView.cpp: Copied from Source/WebCore/layout/displaytree/DisplayPainter.h.
3373         (WebCore::Display::View::View):
3374         (WebCore::Display::View::~View):
3375         (WebCore::Display::View::frame const):
3376         (WebCore::Display::View::page const):
3377         (WebCore::Display::View::layoutState const):
3378         (WebCore::Display::View::prepareForDisplay):
3379         (WebCore::Display::View::flushLayers):
3380         * layout/display/DisplayView.h: Copied from Source/WebCore/layout/displaytree/DisplayPainter.h.
3381         (WebCore::Display::View::frameView const):
3382         * layout/displaytree/DisplayPainter.cpp:
3383         (WebCore::Display::Painter::absoluteDisplayBox):
3384         (WebCore::Display::paintSubtree):
3385         (WebCore::Display::collectPaintRootsAndContentRect):
3386         (WebCore::Display::absoluteDisplayBox): Deleted.
3387         * layout/displaytree/DisplayPainter.h:
3388         * layout/inlineformatting/InlineLineBuilder.cpp:
3389         * page/FrameView.cpp:
3390         (WebCore::FrameView::flushCompositingStateForThisFrame):
3391         (WebCore::FrameView::existingDisplayView const):
3392         (WebCore::FrameView::displayView):
3393         * page/FrameView.h:
3394         * page/Page.cpp:
3395         (WebCore::Page::doAfterUpdateRendering):
3396         * platform/graphics/x11/PlatformDisplayX11.h: Denote Display as being in the global namespace.
3397         * platform/graphics/x11/XErrorTrapper.h:
3398         (WebCore::XErrorTrapper::XErrorTrapper):
3399         * platform/graphics/x11/XUniquePtr.h:
3400
3401 2020-09-14  Sam Weinig  <weinig@apple.com>
3402
3403         [WebIDL] Replace 'serializable' with '[Default] object toJSON()'
3404         https://bugs.webkit.org/show_bug.cgi?id=216148
3405
3406         Reviewed by Eric Carlson.
3407
3408         Replace the 'serializable' keyword, which has been removed from WebIDL,
3409         with its replacement, '[Default] object toJSON()'.
3410         
3411         The new version is pretty similar, but has much less room for customization
3412         in that you can no longer specify which attributes are included in the JSON
3413         result. Rather, all attributes that qualify as having a 'JSON type' are included
3414         for the interface itself and all ancestor interfaces. Interfaces that need more
3415         control can provide their own toJSON operation with the [Default] extended
3416         attribute.
3417
3418         This updates all the IDLs that used serializer to use the new [Default] except
3419         RTCIceCandidate.idl, which is specified to have a custom toJSON that returns
3420         a RTCIceCandidateInit, so that was implemented instead.
3421
3422         * css/DOMMatrixReadOnly.idl:
3423         * dom/DOMPointReadOnly.idl:
3424         * dom/DOMQuad.idl:
3425         * dom/DOMRectReadOnly.idl:
3426         * page/PerformanceEntry.idl:
3427         * page/PerformanceResourceTiming.h:
3428         * page/PerformanceResourceTiming.idl:
3429         * page/PerformanceServerTiming.idl:
3430         * page/PerformanceTiming.idl:
3431         * Modules/mediastream/MediaDeviceInfo.idl:
3432         * Modules/mediastream/RTCIceCandidate.cpp:
3433         * Modules/mediastream/RTCIceCandidate.h:
3434         * Modules/mediastream/RTCIceCandidate.idl:
3435         * Modules/mediastream/RTCSessionDescription.idl:
3436         * Modules/paymentrequest/PaymentAddress.idl:
3437         * Modules/paymentrequest/PaymentResponse.idl:
3438         Update IDLs replacing all use of serializer.
3439         
3440         * bindings/scripts/CodeGenerator.pm:
3441         (InterfaceHasRegularToJSONOperation):
3442         (IsJSONType):
3443         (InheritsSerializable): Deleted.
3444         (IsSerializableType): Deleted.
3445         (IsSerializableAttribute): Deleted.
3446         * bindings/scripts/CodeGeneratorJS.pm:
3447         (PrototypeOperationCount):
3448         (GenerateHeader):
3449         (GeneratePropertiesHashTable):
3450         (GenerateImplementation):
3451         (GenerateOperationDefinition):
3452         (GenerateDefaultOperationDefinition):
3453         (GenerateDefaultToJSONOperationDefinition):
3454         (GetRuntimeEnabledStaticProperties):
3455         (GenerateSerializerDefinition): Deleted.
3456         * bindings/scripts/IDLParser.pm:
3457         (cloneOperation):
3458         (parsePartialInterfaceMember):
3459         (applyMemberList):
3460         (parseSerializer): Deleted.
3461         (parseSerializerRest): Deleted.
3462         (parseSerializationPattern): Deleted.
3463         (parseSerializationAttributes): Deleted.
3464         * bindings/scripts/IDLAttributes.json:
3465         Add support for [Default] toJSON and remove support for serializer.
3466
3467         * bindings/scripts/test/BindingTestGlobalConstructors.idl:
3468         * bindings/scripts/test/JS/JSTestDefaultToJSON.cpp: Added.
3469         * bindings/scripts/test/JS/JSTestDefaultToJSON.h: Added.
3470         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3471         * bindings/scripts/test/JS/JSTestNode.cpp:
3472         * bindings/scripts/test/JS/JSTestNode.h:
3473         * bindings/scripts/test/JS/JSTestObj.cpp:
3474         * bindings/scripts/test/JS/JSTestObj.h:
3475         * bindings/scripts/test/JS/JSTestSerialization.cpp: Removed.
3476         * bindings/scripts/test/JS/JSTestSerialization.h: Removed.
3477         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: Removed.
3478         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: Removed.
3479         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: Removed.
3480         * bindings/scripts/test/JS/JSTestSerializationInherit.h: Removed.
3481         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: Removed.
3482         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: Removed.
3483         * bindings/scripts/test/SupplementalDependencies.dep:
3484         * bindings/scripts/test/TestDefaultToJSON.idl: Added.
3485         * bindings/scripts/test/TestDefaultToJSONIndirectInheritance.idl: Added.
3486         * bindings/scripts/test/TestDefaultToJSONInherit.idl: Added.
3487         * bindings/scripts/test/TestDefaultToJSONInheritFinal.idl: Added.
3488         * bindings/scripts/test/TestNode.idl:
3489         * bindings/scripts/test/TestObj.idl:
3490         * bindings/scripts/test/TestSerialization.idl: Removed.
3491         * bindings/scripts/test/TestSerializationIndirectInheritance.idl: Removed.
3492         * bindings/scripts/test/TestSerializationInherit.idl: Removed.
3493         * bindings/scripts/test/TestSerializationInheritFinal.idl: Removed.
3494         Update tests.
3495
3496 2020-09-14  Chris Dumez  <cdumez@apple.com>
3497
3498         Some WebAudio tests give different output on different machines
3499         https://bugs.webkit.org/show_bug.cgi?id=216371
3500         <rdar://problem/68653909>
3501
3502         Reviewed by Alex Christensen.
3503
3504         Hardcode default sample rate for AudioContext to 44100 for WPT tests instead
3505         of using the hardware sample rate. This allows some tests to output consistent
3506         results on different machines.
3507
3508         No new tests, unskipped existing test.
3509
3510         * Modules/webaudio/AudioContext.cpp:
3511         (WebCore::defaultSampleRateForTesting):
3512         (WebCore::AudioContext::setDefaultSampleRateForTesting):
3513         (WebCore::AudioContext::create):
3514         * Modules/webaudio/AudioContext.h:
3515         (WebCore::AudioContext::create):
3516         * testing/InternalSettings.cpp:
3517         (WebCore::InternalSettings::Backup::restoreTo):
3518         (WebCore::InternalSettings::setDefaultAudioContextSampleRate):
3519         * testing/InternalSettings.h:
3520         * testing/InternalSettings.idl:
3521
3522 2020-09-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3523
3524         [CG] Cache the last status of the image encoded data
3525         https://bugs.webkit.org/show_bug.cgi?id=216104
3526
3527         Reviewed by Youenn Fablet.
3528
3529         Cache the last status of the image encoded data such that early decisions
3530         can be made without calling system functions.
3531
3532         * platform/graphics/cg/ImageDecoderCG.cpp:
3533         (WebCore::ImageDecoderCG::encodedDataStatus const):
3534         * platform/graphics/cg/ImageDecoderCG.h:
3535
3536 2020-09-14  Chris Dumez  <cdumez@apple.com>
3537
3538         Add proper support for AudioContextOptions.sampleRate
3539         https://bugs.webkit.org/show_bug.cgi?id=216425
3540
3541         Reviewed by Eric Carlson.
3542
3543         Add proper support for AudioContextOptions.sampleRate. Previously, our AudioContext always ran
3544         at the hardware's sampleRate, no matter what value was set for AudioContextOptions.sampleRate.
3545
3546         This patch is based on the following Chromium changes:
3547         - https://chromium-review.googlesource.com/c/chromium/src/+/1482957
3548         - https://codereview.chromium.org/2549093009
3549         - https://codereview.chromium.org/14189035
3550
3551         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
3552         (WebCore::DefaultAudioDestinationNode::createDestination):
3553         When creating an AudioDestination, pass the requested AudioContext sample rate
3554         instead of the hardware sample rate.
3555
3556         * Sources.txt:
3557         * WebCore.xcodeproj/project.pbxproj:
3558
3559         * platform/audio/AudioFIFO.cpp: Removed.
3560         * platform/audio/AudioFIFO.h: Removed.
3561         * platform/audio/AudioPullFIFO.cpp: Removed.
3562         * platform/audio/AudioPullFIFO.h: Removed.
3563         * platform/audio/PushPullFIFO.cpp: Added.
3564         * platform/audio/PushPullFIFO.h: Added.
3565         Replace AudioFIFO and AudioPullFIFO with a new PushPullFIFO replacement, similarly
3566         to what was done in Chromium in:
3567         - https://codereview.chromium.org/2549093009
3568
3569         * platform/audio/MultiChannelResampler.cpp:
3570         (WebCore::MultiChannelResampler::MultiChannelResampler):
3571         * platform/audio/MultiChannelResampler.h:
3572         * platform/audio/SincResampler.cpp:
3573         (WebCore::SincResampler::SincResampler):
3574         (WebCore::SincResampler::updateRegions):
3575         (WebCore::SincResampler::initializeKernel):
3576         (WebCore::SincResampler::process):
3577         * platform/audio/SincResampler.h:
3578         Add parameter to MultiChannelResampler & SincResampler to allow the client to specify
3579         the size of the buffer in frames when the resampler calls AudioSourceProvider::provideInput()
3580         to get input data. This is necessary because our WebAudio implementation uses a static
3581         buffer size of 128 frames. This is similar to what was done in Chromium in:
3582         - https://codereview.chromium.org/14189035
3583
3584         * platform/audio/cocoa/AudioDestinationCocoa.cpp:
3585         (WebCore::AudioDestinationCocoa::AudioDestinationCocoa):
3586         (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription):
3587         (WebCore::AudioDestinationCocoa::render):
3588         (WebCore::AudioDestinationCocoa::provideInput):
3589         * platform/audio/cocoa/AudioDestinationCocoa.h:
3590         - Adopt PushPullFIFO to resolve the buffer size mismatch between the WebAudio engine and
3591           the callback function from the actual audio device, similarly to what was done in Chromium.
3592         - When the context's sample rate differs from the hardware sample rate, instantiate a
3593           MultiChannelResampler and use it in render() to do the resampling.
3594
3595         * platform/audio/ios/AudioDestinationIOS.cpp:
3596         (WebCore::AudioDestinationCocoa::configure):
3597         * platform/audio/mac/AudioDestinationMac.cpp:
3598         (WebCore::AudioDestinationCocoa::configure):
3599         Drop sampleRate parameter as it is no longer needed.
3600
3601         * platform/mock/MockAudioDestinationCocoa.cpp:
3602         (WebCore::MockAudioDestinationCocoa::tick):
3603
3604 2020-09-14  Sam Weinig  <weinig@apple.com>
3605
3606         [WebIDL] Split DOM Parsing related functions out of Element and ShadowRoot and into their own IDL files to match specs
3607         https://bugs.webkit.org/show_bug.cgi?id=216461
3608
3609         Reviewed by Darin Adler.
3610
3611         No behavior change, just cleaning up which IDL files DOM Parsing related operations
3612         live to match specs.
3613
3614         * CMakeLists.txt:
3615         * DerivedSources-input.xcfilelist:
3616         * DerivedSources-output.xcfilelist:
3617         * DerivedSources.make:
3618         * WebCore.xcodeproj/project.pbxproj:
3619         * dom/Element.idl:
3620         * dom/ElementDOMParsing.idl: Added.
3621         * dom/InnerHTML.idl: Added.
3622         * dom/ShadowRoot.idl:
3623
3624 2020-09-14  Chris Lord  <clord@igalia.com>
3625
3626         CSS parsing-related singletons should only be used on the main thread
3627         https://bugs.webkit.org/show_bug.cgi?id=216370
3628
3629         Reviewed by Darin Adler.
3630
3631         Mark some singletons that aren't safe to use off the main thread as
3632         MainThreadNeverDestroyed instead of just NeverDestroyed.
3633
3634         No new tests because there is no behavior change.
3635
3636         * css/CSSValuePool.cpp:
3637         (WebCore::CSSValuePool::singleton):
3638         * css/parser/CSSParserContext.cpp:
3639         (WebCore::strictCSSParserContext):
3640         * rendering/RenderThemeAdwaita.cpp:
3641         (WebCore::RenderTheme::singleton):
3642         * rendering/RenderThemeGtk.cpp:
3643         (WebCore::RenderTheme::singleton):
3644
3645 2020-09-14  Myles C. Maxfield  <mmaxfield@apple.com>
3646
3647         [Apple Win] Migrate from CGFontGetGlyphsForUnichars() to CTFontGetGlyphsForCharacters()
3648         https://bugs.webkit.org/show_bug.cgi?id=216446
3649
3650         Reviewed by Darin Adler.
3651
3652         This patch is one of the steps to moving the Apple Win port from CGFont to CTFont.
3653         This patch removes the #if !PLATFORM(WIN) guard from GlyphPageCoreText.cpp and deletes
3654         the old functions it used to be using.
3655
3656         Covered by existing tests.
3657
3658         * PlatformAppleWin.cmake:
3659         * platform/graphics/coretext/GlyphPageCoreText.cpp:
3660         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp: Removed. There's nothing left in the
3661           file.
3662
3663 2020-09-13  Sam Weinig  <weinig@apple.com>
3664
3665         [WebIDL] Remove need for [MayThrowException] on constructors and legacy factory functions
3666         https://bugs.webkit.org/show_bug.cgi?id=216442
3667
3668         Reviewed by Darin Adler.
3669
3670         Deduce implementation potentially throwing by using the existing overload of
3671         toJSNewlyCreated that conditionally checks for exceptions based on the return
3672         type. constexpr IsExceptionOr to maintain existing optimizations around conditional
3673         calls to RETURN_IF_EXCEPTION.
3674
3675         * bindings/scripts/CodeGeneratorJS.pm:
3676         (GenerateConstructorDefinition):
3677         Update code generation to output code that can handle constructors that return either
3678         ExceptionOr or not. Maintain existing static assertion that the underlying return type
3679         is a Ref<> using std::conditional_t predicated on IsExceptionOr and maintain the existing
3680         optimization to not check for an exception after toJSNewlyCreated if one could not have
3681         been made by again utilizing IsExceptionOr.
3682
3683         * bindings/scripts/IDLAttributes.json:
3684         Remove [LegacyFactoryFunctionMayThrowException] now that it is not needed.
3685
3686         * Modules/applepay/ApplePaySession.idl:
3687         * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
3688         * Modules/fetch/FetchHeaders.idl:
3689         * Modules/fetch/FetchRequest.idl:
3690         * Modules/fetch/FetchResponse.idl:
3691         * Modules/mediarecorder/MediaRecorder.idl:
3692         * Modules/mediastream/RTCIceCandidate.idl:
3693         * Modules/mediastream/RTCPeerConnection.idl:
3694         * Modules/paymentrequest/MerchantValidationEvent.idl:
3695         * Modules/paymentrequest/PaymentRequest.idl:
3696         * Modules/webaudio/AnalyserNode.idl:
3697         * Modules/webaudio/AudioBuffer.idl:
3698         * Modules/webaudio/AudioBufferSourceNode.idl:
3699         * Modules/webaudio/AudioContext.idl:
3700         * Modules/webaudio/BiquadFilterNode.idl:
3701         * Modules/webaudio/ChannelMergerNode.idl:
3702         * Modules/webaudio/ChannelSplitterNode.idl:
3703         * Modules/webaudio/ConstantSourceNode.idl:
3704         * Modules/webaudio/ConvolverNode.idl:
3705         * Modules/webaudio/DelayNode.idl:
3706         * Modules/webaudio/DynamicsCompressorNode.idl:
3707         * Modules/webaudio/GainNode.idl:
3708         * Modules/webaudio/IIRFilterNode.idl:
3709         * Modules/webaudio/MediaElementAudioSourceNode.idl:
3710         * Modules/webaudio/MediaStreamAudioDestinationNode.idl:
3711         * Modules/webaudio/MediaStreamAudioSourceNode.idl:
3712         * Modules/webaudio/OfflineAudioContext.idl:
3713         * Modules/webaudio/OscillatorNode.idl:
3714         * Modules/webaudio/PannerNode.idl:
3715         * Modules/webaudio/PeriodicWave.idl:
3716         * Modules/webaudio/StereoPannerNode.idl:
3717         * Modules/webaudio/WaveShaperNode.idl:
3718         * Modules/webaudio/WebKitAudioContext.idl:
3719         * Modules/webaudio/WebKitOfflineAudioContext.idl:
3720         * Modules/websockets/WebSocket.idl:
3721         * Modules/webxr/WebXRRigidTransform.idl:
3722         * Modules/webxr/WebXRWebGLLayer.idl:
3723         * animation/KeyframeEffect.idl:
3724         * css/DOMMatrix.idl:
3725         * css/DOMMatrixReadOnly.idl:
3726         * css/WebKitCSSMatrix.idl:
3727         * dom/StaticRange.idl:
3728         * dom/TextDecoder.idl:
3729         * dom/TextDecoderStreamDecoder.idl:
3730         * html/DOMURL.idl:
3731         * html/HTMLOptionElement.h:
3732         * html/HTMLOptionElement.idl:
3733         * html/ImageData.idl:
3734         * html/URLSearchParams.idl:
3735         * html/track/TextTrackCue.idl:
3736         * page/EventSource.idl:
3737         * page/IntersectionObserver.idl:
3738         * workers/Worker.idl:
3739         Remove all uses of [LegacyFactoryFunctionMayThrowException] and [MayThrowException]
3740         on constructors.
3741
3742         * html/HTMLAudioElement.cpp:
3743         (WebCore::HTMLAudioElement::createForLegacyFactoryFunction):
3744         (WebCore::HTMLAudioElement::createForJSConstructor): Deleted.
3745         * html/HTMLAudioElement.h:
3746         * html/HTMLImageElement.cpp:
3747         (WebCore::HTMLImageElement::createForLegacyFactoryFunction):
3748         (WebCore::HTMLImageElement::createForJSConstructor): Deleted.
3749         * html/HTMLImageElement.h:
3750         * html/HTMLOptionElement.cpp:
3751         (WebCore::HTMLOptionElement::createForLegacyFactoryFunction):
3752         (WebCore::HTMLOptionElement::createForJSConstructor): Deleted.
3753         Renamed createForJSConstructor to createForLegacyFactoryFunction to better
3754         match current WebIDL terminology.
3755
3756         * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp:
3757         (WebCore::JSExposedToWorkerAndWindowConstructor::construct):
3758         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3759         (WebCore::JSTestEventConstructorConstructor::construct):
3760         * bindings/scripts/test/JS/JSTestInterface.cpp:
3761         (WebCore::JSTestInterfaceConstructor::construct):
3762         * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp:
3763         (WebCore::JSTestLegacyFactoryFunctionLegacyFactoryFunction::construct):
3764         * bindings/scripts/test/JS/JSTestNode.cpp:
3765         (WebCore::JSTestNodeConstructor::construct):
3766         * bindings/scripts/test/JS/JSTestObj.cpp:
3767         (WebCore::JSTestObjConstructor::construct):
3768         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3769         (WebCore::constructJSTestOverloadedConstructors1):
3770         (WebCore::constructJSTestOverloadedConstructors2):
3771         (WebCore::constructJSTestOverloadedConstructors3):
3772         (WebCore::constructJSTestOverloadedConstructors4):
3773         (WebCore::constructJSTestOverloadedConstructors5):
3774         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3775         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
3776         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
3777         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3778         (WebCore::JSTestPromiseRejectionEventConstructor::construct):
3779         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3780         (WebCore::JSTestTypedefsConstructor::construct):
3781         * bindings/scripts/test/TestLegacyFactoryFunction.idl:
3782         Update tests/expectations.
3783
3784 2020-09-13  Sam Weinig  <weinig@apple.com>
3785
3786         FIXME in MediaDevices.idl is incorrect
3787         https://bugs.webkit.org/show_bug.cgi?id=216459
3788
3789         Reviewed by Anders Carlsson.
3790
3791         * Modules/mediastream/MediaDevices.idl:
3792         Remove FIXME about making MediaDevices an EventTarget subclass as it is a subclass
3793         EventTarget.
3794
3795 2020-09-13  Sam Weinig  <weinig@apple.com>
3796
3797         FIXME in MouseEventInit.idl is incorrect (we do support unsigned short buttons = 0)
3798         https://bugs.webkit.org/show_bug.cgi?id=216460
3799
3800         Reviewed by Darin Adler.
3801
3802         * dom/MouseEventInit.idl:
3803         Removes incorrect FIXME, adds spec link, and updates formatting to match spec.
3804
3805 2020-09-13  Aditya Keerthi  <akeerthi@apple.com>
3806
3807         Consolidate BaseDateAndTimeInputType and BaseChooserOnlyDateAndTimeInputType
3808         https://bugs.webkit.org/show_bug.cgi?id=216414
3809
3810         Reviewed by Devin Rousso.
3811
3812         BaseChooserOnlyDateAndTimeInputType is the only derived class of
3813         BaseDateAndTimeInputType. Furthermore, with the introduction of editable
3814         components, "ChooserOnly" no longer makes sense as a name for the
3815         derived class. Consequently, all logic in BaseChooserOnlyDateAndTimeInputType
3816         was moved into BaseDateAndTimeInputType, and the derived classes of the
3817         "ChooserOnly" type now inherit BaseDateAndTimeInputType.
3818
3819         Also changed some methods from override to final, and made some protected
3820         methods private, where possible.
3821
3822         No new tests, as there is no change in behavior.
3823
3824         * Sources.txt:
3825         * WebCore.xcodeproj/project.pbxproj:
3826         * html/BaseChooserOnlyDateAndTimeInputType.cpp: Removed.
3827         * html/BaseChooserOnlyDateAndTimeInputType.h: Removed.
3828         * html/BaseDateAndTimeInputType.cpp:
3829         (WebCore::BaseDateAndTimeInputType::DateTimeFormatValidator::visitField):
3830         (WebCore::BaseDateAndTimeInputType::DateTimeFormatValidator::validateFormat):
3831         (WebCore::BaseDateAndTimeInputType::~BaseDateAndTimeInputType):
3832         (WebCore::BaseDateAndTimeInputType::isMouseFocusable const):
3833         (WebCore::BaseDateAndTimeInputType::shouldHaveSecondField const):
3834         (WebCore::BaseDateAndTimeInputType::shouldHaveMillisecondField const):
3835         (WebCore::BaseDateAndTimeInputType::setValue):
3836         (WebCore::BaseDateAndTimeInputType::handleDOMActivateEvent):
3837         (WebCore::BaseDateAndTimeInputType::createShadowSubtree):
3838         (WebCore::BaseDateAndTimeInputType::destroyShadowSubtree):
3839         (WebCore::BaseDateAndTimeInputType::updateInnerTextValue):
3840         (WebCore::BaseDateAndTimeInputType::hasCustomFocusLogic const):
3841         (WebCore::BaseDateAndTimeInputType::attributeChanged):
3842         (WebCore::BaseDateAndTimeInputType::elementDidBlur):
3843         (WebCore::BaseDateAndTimeInputType::detach):
3844         (WebCore::BaseDateAndTimeInputType::isPresentingAttachedView const):
3845         (WebCore::BaseDateAndTimeInputType::handleKeydownEvent):
3846         (WebCore::BaseDateAndTimeInputType::handleKeypressEvent):
3847         (WebCore::BaseDateAndTimeInputType::handleKeyupEvent):
3848         (WebCore::BaseDateAndTimeInputType::handleFocusEvent):
3849         (WebCore::BaseDateAndTimeInputType::accessKeyAction):
3850         (WebCore::BaseDateAndTimeInputType::didBlurFromControl):
3851         (WebCore::BaseDateAndTimeInputType::didChangeValueFromControl):
3852         (WebCore::BaseDateAndTimeInputType::isEditControlOwnerDisabled const):
3853         (WebCore::BaseDateAndTimeInputType::isEditControlOwnerReadOnly const):
3854         (WebCore::BaseDateAndTimeInputType::localeIdentifier const):
3855         (WebCore::BaseDateAndTimeInputType::didChooseValue):
3856         (WebCore::BaseDateAndTimeInputType::didEndChooser):
3857         (WebCore::BaseDateAndTimeInputType::closeDateTimeChooser):
3858         * html/BaseDateAndTimeInputType.h:
3859         * html/DateInputType.cpp:
3860         (WebCore::DateInputType::DateInputType):
3861         * html/DateInputType.h:
3862         * html/DateTimeLocalInputType.cpp:
3863         * html/DateTimeLocalInputType.h:
3864         * html/MonthInputType.h:
3865         * html/TimeInputType.cpp:
3866         (WebCore::TimeInputType::TimeInputType):
3867         * html/TimeInputType.h:
3868         * html/WeekInputType.h:
3869
3870 2020-09-13  Simon Fraser  <simon.fraser@apple.com>
3871
3872         Overflow:scroll rubberbanding is interrupted by post-layout scrolling
3873         https://bugs.webkit.org/show_bug.cgi?id=216463
3874         <rdar://problem/67095741>
3875
3876         Reviewed by Darin Adler.
3877
3878         When rubberbanding overflow:scroll RenderLayer has an overscrolled scroll offset.
3879         If RenderLayer::updateScrollInfoAfterLayout() happens when in this state, it can 
3880         clamp the scroll offset, causing the rubberband to collapse which interferes with
3881         the user interaction. This happend on Gmail when composing a reply.
3882         
3883         Fix by tracking the rubberbanding state in the scrolling tree, and having RenderLayer
3884         query this state via the ScrollingCoordinator. RenderLayer::updateScrollInfoAfterLayout()
3885         already tested isRubberBandInProgress(). This is similar to how isUserScrollInProgress()
3886         and isScrollSnapInProgress() work.
3887         
3888         This patch also fixes the tracking of rubberbanding state. Previously setMainFrameIsRubberBanding()
3889         was just based on when the timer was started and stopped, which did not match the
3890         implementation of ScrollController::isRubberBandInProgress(). Now ScrollController
3891         correctly notifies its clients when the rubberbanding state changes by updating that
3892         state whenever any of the conditions consulted in isRubberBandInProgressInternal() change.
3893
3894         I tried to make tests for this, but the timing of wheel and scroll event delivery makes
3895         reliable detection of interrupted rubberbands impossible in WebKitTestRunner.
3896
3897         * page/FrameView.cpp:
3898         (WebCore::FrameView::isRubberBandInProgress const):
3899         * page/scrolling/AsyncScrollingCoordinator.cpp:
3900         (WebCore::AsyncScrollingCoordinator::isRubberBandInProgress const):
3901         * page/scrolling/AsyncScrollingCoordinator.h:
3902         * page/scrolling/ScrollingCoordinator.h:
3903         (WebCore::ScrollingCoordinator::isRubberBandInProgress const):
3904         * page/scrolling/ScrollingTree.cpp:
3905         (WebCore::ScrollingTree::isRubberBandInProgressForNode):
3906         (WebCore::ScrollingTree::setRubberBandingInProgressForNode):
3907         (WebCore::ScrollingTree::isRubberBandInProgress): Deleted.
3908         (WebCore::ScrollingTree::setMainFrameIsRubberBanding): Deleted.
3909         * page/scrolling/ScrollingTree.h:
3910         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3911         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
3912         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3913         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
3914         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinAndRubberbandState):
3915         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3916         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3917         (WebCore::ScrollingTreeOverflowScrollingNodeMac::currentScrollPositionChanged):
3918         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
3919         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3920         (WebCore::ScrollingTreeScrollingNodeDelegateMac::currentScrollPositionChanged):
3921         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isRubberBandInProgress const):
3922         (WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopRubberbandSnapAnimation):
3923         (WebCore::ScrollingTreeScrollingNodeDelegateMac::rubberBandingStateChanged):
3924         * platform/ScrollAnimator.cpp:
3925         (WebCore::ScrollAnimator::notifyPositionChanged):
3926         * platform/cocoa/ScrollController.h:
3927         (WebCore::ScrollControllerClient::rubberBandingStateChanged):
3928         * platform/cocoa/ScrollController.mm:
3929         (WebCore::ScrollController::handleWheelEvent):