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