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