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