Fix for crashes in WebAccessibilityObjectWrapper after notification updates in Isolat...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-02-11  Andres Gonzalez  <andresg_22@apple.com>
2
3         Fix for crashes in WebAccessibilityObjectWrapper after notification updates in IsolatedTree mode.
4         https://bugs.webkit.org/show_bug.cgi?id=207558
5
6         Reviewed by Chris Fleizach.
7
8         - Accessibility methods invoked in the secondary thread that Return id
9         values retrieved from the main thread, need to retain/autorelease the
10         returned ids.
11         - When serving a request on the AX thread that requires retrieving a
12         value from the main thread, the backing obbject on the main thread may
13         have gone away, so need to check for nullity of the backing object also
14         on the main thread.
15
16         * accessibility/AccessibilityObjectInterface.h:
17         (WebCore::Accessibility::retrieveAutoreleasedValueFromMainThread):
18         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
19         (-[WebAccessibilityObjectWrapper attachmentView]):
20         (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]):
21         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
22         (-[WebAccessibilityObjectWrapper associatedPluginParent]):
23         (-[WebAccessibilityObjectWrapper scrollViewParent]):
24         (-[WebAccessibilityObjectWrapper windowElement:]):
25         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
26
27 2020-02-11  Zalan Bujtas  <zalan@apple.com>
28
29         [LFC] Introduce Layout::LineBreakBox
30         https://bugs.webkit.org/show_bug.cgi?id=207550
31         <rdar://problem/59348274>
32
33         Reviewed by Antti Koivisto.
34
35         This is in preparation for making Layout::Box an abstract box (so that it stops being a leaf type of box).
36
37         * Sources.txt:
38         * WebCore.xcodeproj/project.pbxproj:
39         * layout/inlineformatting/InlineFormattingContext.cpp:
40         (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
41         * layout/integration/LayoutIntegrationBoxTree.cpp:
42         (WebCore::LayoutIntegration::BoxTree::buildTree):
43         * layout/layouttree/LayoutBox.h:
44         (WebCore::Layout::Box::isImage const):
45         (WebCore::Layout::Box::isLineBreakBox const):
46         * layout/layouttree/LayoutTreeBuilder.cpp:
47         (WebCore::Layout::TreeBuilder::createLineBreakBox):
48         (WebCore::Layout::TreeBuilder::createLayoutBox):
49         * layout/layouttree/LayoutTreeBuilder.h:
50
51 2020-02-11  Zalan Bujtas  <zalan@apple.com>
52
53         [LFC] Introduce Layout::InlineTextBox
54         https://bugs.webkit.org/show_bug.cgi?id=207530
55         <rdar://problem/59336020>
56
57         Reviewed by Antti Koivisto.
58
59         Any text that is directly contained inside a block container element (not inside an inline element) must be treated as an anonymous inline element.
60
61         * Sources.txt:
62         * layout/Verification.cpp:
63         (WebCore::Layout::checkForMatchingTextRuns):
64         * layout/inlineformatting/InlineFormattingContext.cpp:
65         (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
66         * layout/inlineformatting/InlineLineBreaker.cpp:
67         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
68         * layout/inlineformatting/InlineLineBuilder.cpp:
69         (WebCore::Layout::m_textContext):
70         * layout/inlineformatting/InlineSoftLineBreakItem.h:
71         (WebCore::Layout::InlineSoftLineBreakItem::createSoftLineBreakItem):
72         (WebCore::Layout::InlineSoftLineBreakItem::InlineSoftLineBreakItem):
73         * layout/inlineformatting/InlineTextItem.cpp:
74         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
75         (WebCore::Layout::InlineTextItem::isEmptyContent const):
76         * layout/inlineformatting/InlineTextItem.h:
77         (WebCore::Layout::InlineTextItem::inlineTextBox const):
78         (WebCore::Layout::InlineTextItem::createWhitespaceItem):
79         (WebCore::Layout::InlineTextItem::createNonWhitespaceItem):
80         (WebCore::Layout::InlineTextItem::createEmptyItem):
81         (WebCore::Layout::InlineTextItem::InlineTextItem):
82         (WebCore::Layout::InlineTextItem::left const):
83         (WebCore::Layout::InlineTextItem::right const):
84         * layout/inlineformatting/LineLayoutContext.cpp:
85         (WebCore::Layout::endsWithSoftWrapOpportunity):
86         * layout/inlineformatting/text/TextUtil.cpp:
87         (WebCore::Layout::TextUtil::width):
88         (WebCore::Layout::TextUtil::split):
89         * layout/inlineformatting/text/TextUtil.h:
90         * layout/integration/LayoutIntegrationBoxTree.cpp:
91         (WebCore::LayoutIntegration::BoxTree::buildTree):
92         * layout/layouttree/LayoutBox.cpp:
93         (WebCore::Layout::Box::Box):
94         (): Deleted.
95         * layout/layouttree/LayoutBox.h:
96         (WebCore::Layout::Box::isInlineTextBox const):
97         (WebCore::Layout::Box::hasTextContent const): Deleted.
98         (WebCore::Layout::Box::textContext const): Deleted.
99         * layout/layouttree/LayoutContainer.cpp:
100         (WebCore::Layout::Container::Container):
101         (): Deleted.
102         * layout/layouttree/LayoutInlineTextBox.cpp: Copied from Source/WebCore/layout/layouttree/TextContext.h.
103         (WebCore::Layout::InlineTextBox::InlineTextBox):
104         (WebCore::Layout::m_canUseSimplifiedContentMeasuring):
105         * layout/layouttree/LayoutInlineTextBox.h: Renamed from Source/WebCore/layout/layouttree/TextContext.h.
106         (WebCore::Layout::InlineTextBox::content const):
107         (WebCore::Layout::InlineTextBox::canUseSimplifiedContentMeasuring const):
108         * layout/layouttree/LayoutTreeBuilder.cpp:
109         (WebCore::Layout::TreeBuilder::createTextBox):
110         (WebCore::Layout::TreeBuilder::createLayoutBox):
111         (WebCore::Layout::outputLayoutBox):
112         * layout/layouttree/LayoutTreeBuilder.h:
113
114 2020-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
115
116         Unreviewed. Fix WPE build after r256298
117
118         It started to fail in r256298 because of unified builds, but the issue was introduced in r256013.
119
120         * platform/network/soup/ResourceRequestSoup.cpp: Add missing header include.
121
122 2020-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
123
124         [WPE] Add initial support for rendering scrollbars
125         https://bugs.webkit.org/show_bug.cgi?id=206999
126
127         Reviewed by Michael Catanzaro.
128
129         Show overlay scrollbars with a style similar to Adwaita.
130
131         * SourcesWPE.txt: Add ScrollAnimatorGeneric.cpp to the build.
132         * platform/ScrollAnimator.cpp: Switch to use ScrollAnimatorGeneric, required to show/hide the overlay scrollbars.
133         * platform/wpe/ScrollbarThemeWPE.cpp:
134         (WebCore::ScrollbarThemeWPE::scrollbarThickness):
135         (WebCore::ScrollbarThemeWPE::minimumThumbLength):
136         (WebCore::ScrollbarThemeWPE::hasButtons):
137         (WebCore::ScrollbarThemeWPE::hasThumb):
138         (WebCore::ScrollbarThemeWPE::backButtonRect):
139         (WebCore::ScrollbarThemeWPE::forwardButtonRect):
140         (WebCore::ScrollbarThemeWPE::trackRect):
141         (WebCore::ScrollbarThemeWPE::paint):
142         * platform/wpe/ScrollbarThemeWPE.h:
143
144 2020-02-10  Keith Rollin  <krollin@apple.com>
145
146         Adjust the minor version number for the desktop user agent string.
147         https://bugs.webkit.org/show_bug.cgi?id=207498
148         <rdar://problem/59274765>
149
150         Reviewed by Wenson Hsieh.
151
152         This helps with Netflix compatibility on the iPad.
153
154         No new tests -- no new or changed functionality.
155
156         * platform/ios/UserAgentIOS.mm:
157         (WebCore::standardUserAgentWithApplicationName):
158
159 2020-02-10  Wenson Hsieh  <wenson_hsieh@apple.com>
160
161         [iOS] REGRESSION (r255592): The simulated mouse event dispatch quirk should not be on by default
162         https://bugs.webkit.org/show_bug.cgi?id=207513
163         <rdar://problem/59326119>
164
165         Reviewed by Tim Horton.
166
167         Turn `shouldDispatchSimulatedMouseEvents` back off by default (r255592 enabled it by default on all web pages).
168
169         * page/Quirks.cpp:
170         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
171
172 2020-02-10  Basuke Suzuki  <basuke.suzuki@sony.com>
173
174         [WebCore] Shrink Vectors passed to SharedBuffer
175         https://bugs.webkit.org/show_bug.cgi?id=207503
176
177         Reviewed by Yusuke Suzuki.
178
179         Once SharedBuffer::DataSegment is created, the content won't change in its life cycle. Shrink the passed vector
180         before assigning to member variable to save space.
181
182         With the quick research, when displaying Apple's website, 1~3% RSS usage reduction on PlayStation port.
183
184         No new tests because there's no behavior change.
185
186         * platform/SharedBuffer.h:
187
188 2020-02-10  Timothy Hatcher  <timothy@apple.com>
189
190         REGRESSION (r246055): Data detected URLs are no longer blue
191         https://bugs.webkit.org/show_bug.cgi?id=207490
192         rdar://problem/58760796
193
194         Reviewed by Tim Horton.
195
196         This matches how the old code ended up working, since the old approach inlined the blue link color when
197         "shouldUseLightLinks" was false. This change allows the link style color to naturally apply as expected.
198         DD only uses light links when the category is "link" or "phone number" and not in the email signature.
199
200         * editing/cocoa/DataDetection.mm:
201         (WebCore::DataDetection::detectContentInRange): Only set color: currentColor when setting underline color.
202
203 2020-02-10  James Howard  <jameshoward@mac.com>
204
205         Standard gamepad mapping for GameControllerGamepads
206         https://bugs.webkit.org/show_bug.cgi?id=206033
207
208         Reviewed by Dean Jackson.
209
210         Extend PlatformGamepad to add a field for the gamepad mapping.
211         The mapping defines the order and interpretation of the axes and
212         buttons vectors, and is passed along to users of the Gamepad
213         API[1].
214
215         Letting PlatformGamepad subclassers define their mapping is the
216         natural place for this functionality. The PlatformGamepad
217         already defines the order of the axes and buttons and
218         PlatformGamepad subclassers may know something about the
219         physical layout of the gamepad they represent.
220
221         This change modifies the GameControllerGamepad subclass of
222         PlatformGamepad to set the mapping to "standard" when a
223         GCExtendedGamepad is detected, and to bind the axes and buttons
224         appropriately. Previously, the buttons and axes were bound
225         arbitrarily, and in some cases incompletely. While that wasn't a
226         bug per se, because with the mapping set to the empty string an
227         implementation is free to provide any interpretation of the
228         gamepad elements it likes, it was certainly less useful than the
229         "standard" mapping.
230
231         [1] https://www.w3.org/TR/gamepad/#remapping
232
233         * Modules/gamepad/Gamepad.cpp:
234         (WebCore::Gamepad::Gamepad):
235         * platform/gamepad/PlatformGamepad.h:
236         (WebCore::PlatformGamepad::mapping const):
237         * platform/gamepad/cocoa/GameControllerGamepad.mm:
238         (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
239         * testing/MockGamepad.cpp:
240         (WebCore::MockGamepad::MockGamepad):
241         (WebCore::MockGamepad::updateDetails):
242         * testing/MockGamepad.h:
243         * testing/MockGamepadProvider.cpp:
244         (WebCore::MockGamepadProvider::setMockGamepadDetails):
245         * testing/MockGamepadProvider.h:
246         * testing/js/WebCoreTestSupport.cpp:
247         (WebCoreTestSupport::setMockGamepadDetails):
248         * testing/js/WebCoreTestSupport.h:
249
250 2020-02-07  Ryosuke Niwa  <rniwa@webkit.org>
251
252         Don't update selection when calling setSelectionRange on a disconnected input element
253         https://bugs.webkit.org/show_bug.cgi?id=207357
254
255         Reviewed by Antti Koivisto.
256
257         Don't update FrameSelection when the text form control element is disconnected from document.
258
259         * html/HTMLTextFormControlElement.cpp:
260         (WebCore::HTMLTextFormControlElement::setSelectionRange):
261
262 2020-02-10  Jiewen Tan  <jiewen_tan@apple.com>
263
264         [WebAuthn] Merge some of the CTAP response decoder's code
265         https://bugs.webkit.org/show_bug.cgi?id=205375
266
267         Reviewed by Darin Adler.
268
269         This patch makes those code more compact and maintainable.
270
271         No change of behaviors.
272
273         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
274         (fido::decodeResponseMap):
275         (fido::readCTAPMakeCredentialResponse):
276         (fido::readCTAPGetAssertionResponse):
277         (fido::readCTAPGetInfoResponse):
278         * Modules/webauthn/fido/DeviceResponseConverter.h:
279         * Modules/webauthn/fido/Pin.cpp:
280         (fido::pin::encodePinCommand):
281         (fido::pin::RetriesResponse::parse):
282         (fido::pin::KeyAgreementResponse::parse):
283         (fido::pin::TokenResponse::parse):
284
285 2020-02-10  Megan Gardner  <megan_gardner@apple.com>
286
287         Rename SelectionData classes and structures HighlightData, etc to be more inclusive for their new use cases
288         https://bugs.webkit.org/show_bug.cgi?id=206340
289
290         Reviewed by Ryosuke Niwa.
291
292         Rename only, no behaviour change.
293
294         With the new Highlight API, we will be using these data structures to support Highlights as well as Selection, 
295         rename to Highlight, as a Selection is a type of Highlight.
296
297         * Sources.txt:
298         * WebCore.xcodeproj/project.pbxproj:
299         * platform/DragImage.cpp:
300         (WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
301         (WebCore::createDragImageForRange):
302         * rendering/ComplexLineLayout.cpp:
303         (WebCore::ComplexLineLayout::constructLine):
304         * rendering/EllipsisBox.cpp:
305         (WebCore::EllipsisBox::paint):
306         * rendering/EllipsisBox.h:
307         * rendering/HighlightData.cpp: Renamed from Source/WebCore/rendering/SelectionRangeData.cpp.
308         (WebCore::isValidRendererForSelection):
309         (WebCore::collect):
310         (WebCore::HighlightData::HighlightData):
311         (WebCore::HighlightData::setRenderRange):
312         (WebCore::HighlightData::selectionStateForRenderer):
313         (WebCore::HighlightData::set):
314         (WebCore::HighlightData::clear):
315         (WebCore::HighlightData::repaint const):
316         (WebCore::HighlightData::collectBounds const):
317         (WebCore::HighlightData::apply):
318         * rendering/HighlightData.h: Renamed from Source/WebCore/rendering/SelectionRangeData.h.
319         (WebCore::HighlightData::RenderRange::RenderRange):
320         (WebCore::HighlightData::RenderRange::operator== const):
321         (WebCore::HighlightData::get const):
322         (WebCore::HighlightData::start const):
323         (WebCore::HighlightData::end const):
324         (WebCore::HighlightData::startOffset const):
325         (WebCore::HighlightData::endOffset const):
326         * rendering/InlineBox.cpp:
327         (WebCore::InlineBox::selectionState):
328         * rendering/InlineBox.h:
329         * rendering/InlineFlowBox.cpp:
330         (WebCore::InlineFlowBox::selectionState):
331         * rendering/InlineFlowBox.h:
332         * rendering/InlineTextBox.cpp:
333         (WebCore::InlineTextBox::selectionState):
334         (WebCore::InlineTextBox::verifySelectionState const):
335         (WebCore::InlineTextBox::paint):
336         (WebCore::InlineTextBox::clampedStartEndForState const):
337         (WebCore::InlineTextBox::highlightStartEnd const):
338         (WebCore::InlineTextBox::collectMarkedTextsForHighlights const):
339         * rendering/InlineTextBox.h:
340         * rendering/RenderBlock.cpp:
341         (WebCore::RenderBlock::shouldPaintSelectionGaps const):
342         (WebCore::RenderBlock::selectionGaps):
343         (WebCore::RenderBlock::blockSelectionGaps):
344         (WebCore::RenderBlock::getSelectionGapInfo):
345         * rendering/RenderBlock.h:
346         * rendering/RenderBlockFlow.cpp:
347         (WebCore::RenderBlockFlow::setSelectionState):
348         (WebCore::RenderBlockFlow::inlineSelectionGaps):
349         * rendering/RenderBlockFlow.h:
350         * rendering/RenderBoxModelObject.cpp:
351         (WebCore::RenderBoxModelObject::setSelectionState):
352         * rendering/RenderBoxModelObject.h:
353         * rendering/RenderLineBreak.cpp:
354         (WebCore::RenderLineBreak::setSelectionState):
355         * rendering/RenderLineBreak.h:
356         * rendering/RenderListMarker.cpp:
357         (WebCore::RenderListMarker::paint):
358         (WebCore::RenderListMarker::setSelectionState):
359         (WebCore::RenderListMarker::selectionRectForRepaint):
360         * rendering/RenderListMarker.h:
361         * rendering/RenderObject.cpp:
362         (WebCore::RenderObject::isSelectionBorder const):
363         * rendering/RenderObject.h:
364         (WebCore::RenderObject::selectionState const):
365         (WebCore::RenderObject::setSelectionState):
366         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
367         (WebCore::RenderObject::RenderObjectBitfields::selectionState const):
368         (WebCore::RenderObject::RenderObjectBitfields::setSelectionState):
369         (WebCore::RenderObject::setSelectionStateIfNeeded):
370         * rendering/RenderReplaced.cpp:
371         (WebCore::RenderReplaced::shouldDrawSelectionTint const):
372         (WebCore::RenderReplaced::paint):
373         (WebCore::RenderReplaced::setSelectionState):
374         (WebCore::RenderReplaced::isSelected const):
375         * rendering/RenderReplaced.h:
376         * rendering/RenderSelectionInfo.h:
377         (WebCore::RenderSelectionInfoBase::state const):
378         * rendering/RenderText.cpp:
379         (WebCore::RenderText::setSelectionState):
380         (WebCore::RenderText::collectSelectionRectsForLineBoxes):
381         * rendering/RenderText.h:
382         * rendering/RenderTextLineBoxes.cpp:
383         (WebCore::RenderTextLineBoxes::setSelectionState):
384         * rendering/RenderTextLineBoxes.h:
385         * rendering/RenderThemeMac.mm:
386         (WebCore::RenderThemeMac::paintAttachment):
387         * rendering/RenderView.h:
388         * rendering/RenderWidget.cpp:
389         (WebCore::RenderWidget::setSelectionState):
390         * rendering/RenderWidget.h:
391         * rendering/RootInlineBox.cpp:
392         (WebCore::RootInlineBox::lineSelectionGap):
393         (WebCore::RootInlineBox::selectionState):
394         (WebCore::RootInlineBox::firstSelectedBox):
395         (WebCore::RootInlineBox::lastSelectedBox):
396         (WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock const):
397         * rendering/RootInlineBox.h:
398         * rendering/SimpleLineLayout.cpp:
399         (WebCore::SimpleLineLayout::canUseForWithReason):
400         * rendering/svg/SVGInlineTextBox.cpp:
401         (WebCore::SVGInlineTextBox::paintSelectionBackground):
402         (WebCore::SVGInlineTextBox::paint):
403         * rendering/svg/SVGRootInlineBox.cpp:
404         (WebCore::SVGRootInlineBox::paint):
405
406 2020-02-10  Simon Fraser  <simon.fraser@apple.com>
407
408         WebContent jetsams on Sony lens webpage due to spike of IOSurfaces
409         https://bugs.webkit.org/show_bug.cgi?id=207493
410         rdar://problem/59020443
411
412         Reviewed by Zalan Bujtas.
413
414         There were three issues that contributed to massive backing store allocation on
415         <https://www.sony.com/electronics/lenses/t/camera-lenses>.
416
417         The first, fixed in r256095, was that the Web Animations code unioned the untransitioning
418         bounds with the transitioning bounds, causing the computation of large extent rects.
419
420         The second, fixed in r256181, was that GraphicsLayerCA would keep hold of a transform
421         animation for an extra frame, causing a rendering update where
422         RenderLayerBacking::updateGeometry() would have cleared the extent, but GraphicsLayerCA
423         still thought transform was animating, causing GraphicsLayerCA::updateCoverage() to keep
424         backing store attached.
425
426         This patch is the final fix; when animations start and end, we need to ensure that
427         RenderLayerBacking::updateGeometry() is called so that we compute the animation extent in
428         the same frame that adds the animation.
429
430         Test: compositing/backing/transition-extent.html
431
432         * rendering/RenderLayerBacking.cpp:
433         (WebCore::RenderLayerBacking::startAnimation):
434         (WebCore::RenderLayerBacking::animationFinished):
435
436 2020-02-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
437
438         Unreachable code hit in WebCore::Shape::createShape
439         https://bugs.webkit.org/show_bug.cgi?id=207399
440
441         Reviewed by Darin Adler.
442
443         CSS parser should not consume the 'shape-outside' property with type 'path' 
444         since it has not been implemented yet. This will prevent an assertion in
445         the debug build and null dref in the release build.
446
447         Test: css3/shapes/shape-outside-path-no-crash.html
448
449         * css/parser/CSSPropertyParser.cpp:
450         (WebCore::consumeBasicShape):
451         (WebCore::consumeShapeOutside):
452
453 2020-02-10  Daniel Bates  <dabates@apple.com>
454
455         Disallow setting base URL to a data or JavaScript URL
456         https://bugs.webkit.org/show_bug.cgi?id=207136
457
458         Reviewed by Brent Fulgham.
459
460         Inspired by <https://bugs.chromium.org/p/chromium/issues/detail?id=679318>.
461
462         Block setting the base URL to a data URL or JavaScript URL as such usage is questionable.
463         This makes WebKit match the behavior of Chrome and Firefox and is in the spirit of the
464         discussion in <https://github.com/whatwg/html/issues/2249>.
465
466         On Mac and iOS, this restriction is applied only to apps linked against a future SDK to
467         avoid breaking shipped apps.
468
469         For all other ports, this restriction is enabled by default.
470
471         Tests: fast/url/relative2.html
472                fast/url/segments-from-data-url2.html
473                http/tests/security/allowed-base-url-data-url-via-setting.html
474                http/tests/security/denied-base-url-data-url.html
475                http/tests/security/denied-base-url-javascript-url.html
476
477         * dom/Document.cpp:
478         (WebCore::Document::processBaseElement): Condition updating the parsed
479         base URL on whether is has an allowed scheme, if restrictions are enabled. Otherwise,
480         do what we do now. If the scheme is disallowed then log a message to the console to
481         explain this to web developers.
482         * html/parser/HTMLPreloadScanner.cpp:
483         (WebCore::TokenPreloadScanner::scan): Pass whether to apply restrictons to the base URL
484         to updatePredictedBaseURL(). This depends on whether the setting is enabled or not.
485         (WebCore::TokenPreloadScanner::updatePredictedBaseURL): Modifed to take a boolean as to
486         whether to apply restrictions. If restrictions are not to be applied do what we do now.
487         Otherwise, only do what we do now if the scheme for the predicated base URL is allowed.
488         * html/parser/HTMLPreloadScanner.h:
489         * page/SecurityPolicy.cpp:
490         (WebCore::SecurityPolicy::isBaseURLSchemeAllowed): Added.
491         * page/SecurityPolicy.h:
492         * page/Settings.yaml: Add a setting to toggle restrictions on the base URL scheme.
493
494 2020-02-10  Truitt Savell  <tsavell@apple.com>
495
496         Unreviewed, rolling out r256091.
497
498         Broke internal builds
499
500         Reverted changeset:
501
502         "Move trivial definitions from FeatureDefines.xcconfig to
503         PlatformEnableCocoa.h"
504         https://bugs.webkit.org/show_bug.cgi?id=207155
505         https://trac.webkit.org/changeset/256091
506
507 2020-02-10  Truitt Savell  <tsavell@apple.com>
508
509         Unreviewed, rolling out r256103.
510
511         This patch is blocking the rollout of r256091
512
513         Reverted changeset:
514
515         "Move JavaScriptCore related feature defines from
516         FeatureDefines.xcconfig to PlatformEnableCocoa.h"
517         https://bugs.webkit.org/show_bug.cgi?id=207436
518         https://trac.webkit.org/changeset/256103
519
520 2020-02-10  Antoine Quint  <graouts@webkit.org>
521
522         There's an event loop cycle between an animation finishing, and it being removed from GraphicsLayerCA
523         https://bugs.webkit.org/show_bug.cgi?id=207361
524         <rdar://problem/59280370>
525
526         Reviewed by Simon Fraser.
527
528         Animations should be removed from GraphicsLayersCAs in the same rendering update that changes the playState of the 
529         animation to "finished", to avoid layer flush where a GraphicsLayersCAs has no extent set, but thinks there is
530         an active transform animation.
531
532         To do this, instead of enqueuing accelerated actions when resolving animations during style resolution, in
533         KeyframeAnimation::apply(), we enqueue them as soon as an animation's current time may have changed: in
534         WebAnimation::tick() and WebAnimation::play() with supporting functions newly exposed on AnimationEffect.
535
536         Now, accelerated animations are enqueued and applied during the "update animations and send events" procedure.
537
538         * animation/AnimationEffect.h:
539         * animation/KeyframeEffect.cpp:
540         (WebCore::KeyframeEffect::apply):
541         (WebCore::KeyframeEffect::updateAcceleratedActions):
542         (WebCore::KeyframeEffect::animationDidTick):
543         (WebCore::KeyframeEffect::animationDidPlay):
544         * animation/KeyframeEffect.h:
545         * animation/WebAnimation.cpp:
546         (WebCore::WebAnimation::play):
547         (WebCore::WebAnimation::tick):
548
549 2020-02-10  Chris Dumez  <cdumez@apple.com>
550
551         Make FormDataElement::lengthInBytes() safe to call on a non-main thread
552         https://bugs.webkit.org/show_bug.cgi?id=207419
553         <rdar://problem/54386521>
554
555         Reviewed by Youenn Fablet.
556
557         Make FormDataElement::lengthInBytes() safe to call on a non-main thread by using the
558         ThreadableBlobRegistry. DOMCache code in workers may call this on worker threads for
559         example.
560
561         * platform/network/FormData.cpp:
562         (WebCore::FormDataElement::lengthInBytes const):
563
564 2020-02-10  Rob Buis  <rbuis@igalia.com>
565
566         Remove setHTTPAccept call for main resources
567         https://bugs.webkit.org/show_bug.cgi?id=207441
568
569         Reviewed by Darin Adler.
570
571         Remove setHTTPAccept call for main resources since all main resource loading goes
572         through CachedResourceLoader, which sets the Accept header as specified in:
573         https://fetch.spec.whatwg.org/#fetching (Step 1.3).
574
575         This patch also removed unused Accept header related functionality
576         in ResourceRequest.
577
578         No test since no change in behavior, tested by http/tests/misc/xhtml.php.
579
580         * loader/FrameLoader.cpp:
581         (WebCore::FrameLoader::addExtraFieldsToRequest):
582         * platform/network/ResourceRequestBase.cpp:
583         (WebCore::ResourceRequestBase::httpAccept const): Deleted.
584         (WebCore::ResourceRequestBase::setHTTPAccept): Deleted.
585         (WebCore::ResourceRequestBase::clearHTTPAccept): Deleted.
586         * platform/network/ResourceRequestBase.h:
587
588 2020-02-09  Basuke Suzuki  <basuke.suzuki@sony.com>
589
590         Replace redundant functions with variadic template function.
591         https://bugs.webkit.org/show_bug.cgi?id=207413
592
593         Reviewed by Darin Adler.
594
595         No new tests. Covered by existing tests.
596
597         * loader/TextResourceDecoder.cpp:
598         (WebCore::bytesEqual):
599
600 2020-02-09  Keith Rollin  <krollin@apple.com>
601
602         Re-enable LTO for ARM builds
603         https://bugs.webkit.org/show_bug.cgi?id=207402
604         <rdar://problem/49190767>
605
606         Reviewed by Sam Weinig.
607
608         Bug 190758 re-enabled LTO for Production builds for x86-family CPUs.
609         Enabling it for ARM was left out due to a compiler issue. That issue
610         has been fixed, and so now we can re-enable LTO for ARM.
611
612         No new tests -- no new or changed functionality.
613
614         * Configurations/Base.xcconfig:
615
616 2020-02-09  Antti Koivisto  <antti@apple.com>
617
618         [LFC][Integration] Support intruding floats
619         https://bugs.webkit.org/show_bug.cgi?id=207099
620
621         Reviewed by Zalan Bujtas.
622
623         Add support for for floats placed by the legacy render tree layout intruding to IFC flow.
624
625         This was the last frequently used feature supported by the simple line layout but not
626         the integrated LFC (pagination is the final missing piece).
627
628         * layout/floats/FloatingContext.cpp:
629         (WebCore::Layout::FloatingContext::remove): Deleted.
630         * layout/floats/FloatingContext.h:
631         * layout/floats/FloatingState.cpp:
632         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
633         (WebCore::Layout::FloatingState::FloatingState):
634         (WebCore::Layout::FloatingState::remove): Deleted.
635
636         Delete some unused functions.
637
638         * layout/floats/FloatingState.h:
639         (WebCore::Layout::FloatingState::FloatItem::isLeftPositioned const):
640         (WebCore::Layout::FloatingState::clear):
641         (WebCore::Layout::FloatingState::FloatItem::operator== const): Deleted.
642         * layout/integration/LayoutIntegrationLineLayout.cpp:
643         (WebCore::LayoutIntegration::LineLayout::canUseFor):
644
645         Allow floats.
646
647         (WebCore::LayoutIntegration::LineLayout::layout):
648         (WebCore::LayoutIntegration::LineLayout::prepareLayoutState):
649         (WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
650
651         Translate floats from render tree to IFC float structures.
652
653         * layout/integration/LayoutIntegrationLineLayout.h:
654
655 2020-02-09  Zalan Bujtas  <zalan@apple.com>
656
657         [LFC][BFC] Move updatePositiveNegativeMarginValues out of MarginCollapse class
658         https://bugs.webkit.org/show_bug.cgi?id=207445
659         <rdar://problem/59297879>
660
661         Reviewed by Antti Koivisto.
662
663         MarginCollapse::updatePositiveNegativeMarginValues is just a static helper.
664         Let's split this function so that it can be just a regular member function (move the state updating to the BlockFormattingContext caller).
665
666         * layout/blockformatting/BlockFormattingContext.cpp:
667         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
668         * layout/blockformatting/BlockFormattingContext.h:
669         * layout/blockformatting/BlockMarginCollapse.cpp:
670         (WebCore::Layout::BlockFormattingContext::MarginCollapse::resolvedPositiveNegativeMarginValues):
671         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues): Deleted.
672
673 2020-02-08  Sam Weinig  <weinig@apple.com>
674
675         Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
676         https://bugs.webkit.org/show_bug.cgi?id=207436
677
678         Reviewed by Tim Horton.
679
680         * Configurations/FeatureDefines.xcconfig:
681         Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.
682
683 2020-02-08  Simon Fraser  <simon.fraser@apple.com>
684
685         Optimize Style::determineChange()
686         https://bugs.webkit.org/show_bug.cgi?id=207438
687
688         Reviewed by Antti Koivisto.
689
690         Style::determineChange() called RenderStyle::operator!=() before the testing some other
691         sets of properties for inequality.
692         
693         It's faster to call inheritedEqual() etc before the full style compare. Also optimize
694         comparing alignItems() and justifyItems() by adding a helper function that first tests
695         for equality of the m_rareNonInheritedData pointer. These (added in r213480) return Inherit
696         because align-items and justify-items affect child layout.
697         
698         This is a ~4% progression on some MotionMark subtests. Time under TreeResolver::createAnimatedElementUpdate()
699         drops from 2.4% to 0.9%.
700
701         * rendering/style/RenderStyle.cpp:
702         (WebCore::RenderStyle::descendantAffectingNonInheritedPropertiesEqual const):
703         * rendering/style/RenderStyle.h:
704         * style/StyleChange.cpp:
705         (WebCore::Style::determineChange):
706
707 2020-02-09  Zalan Bujtas  <zalan@apple.com>
708
709         [LFC] FloatingContext::constraints should take a vertical range instead of just vertical position.
710         https://bugs.webkit.org/show_bug.cgi?id=207440
711         <rdar://problem/59295022>
712
713         Reviewed by Antti Koivisto.
714
715         In an IFC, this covers the entire line when searching for intrusive float to shrink the available horizontal space.
716         (This fix is limited to content with fixed line height)
717
718         * layout/blockformatting/BlockFormattingContext.cpp:
719         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
720         * layout/floats/FloatingContext.cpp:
721         (WebCore::Layout::FloatingContext::constraints const):
722         * layout/floats/FloatingContext.h:
723         * layout/inlineformatting/InlineFormattingContext.cpp:
724         (WebCore::Layout::InlineFormattingContext::lineLayout):
725         (WebCore::Layout::InlineFormattingContext::constraintsForLine):
726
727 2020-02-08  Zalan Bujtas  <zalan@apple.com>
728
729         [LFC][BFC] Replace "estimated" term with "precomputed"
730         https://bugs.webkit.org/show_bug.cgi?id=207433
731         <rdar://problem/59288794>
732
733         Reviewed by Antti Koivisto.
734
735         The term "pre-computed" describes better what this value is.
736
737         * layout/MarginTypes.h:
738         (WebCore::Layout::EstimatedMarginBefore::usedValue const): Deleted.
739         * layout/blockformatting/BlockFormattingContext.cpp:
740         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
741         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPosition):
742         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForAncestors):
743         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRoot):
744         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
745         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
746         (WebCore::Layout::BlockFormattingContext::setPrecomputedMarginBefore):
747         (WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const):
748         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): Deleted.
749         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors): Deleted.
750         (WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore): Deleted.
751         (WebCore::Layout::BlockFormattingContext::hasEstimatedMarginBefore const): Deleted.
752         * layout/blockformatting/BlockFormattingContext.h:
753         * layout/blockformatting/BlockMarginCollapse.cpp:
754         (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
755         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
756         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
757         (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore):
758         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore): Deleted.
759         * layout/displaytree/DisplayBox.cpp:
760         (WebCore::Display::Box::Box):
761         * layout/displaytree/DisplayBox.h:
762         (WebCore::Display::Box::setHasPrecomputedMarginBefore):
763         (WebCore::Display::Box::invalidatePrecomputedMarginBefore):
764         (WebCore::Display::Box::top const):
765         (WebCore::Display::Box::topLeft const):
766         (WebCore::Display::Box::setVerticalMargin):
767         (WebCore::Display::Box::setHasEstimatedMarginBefore): Deleted.
768         (WebCore::Display::Box::invalidateEstimatedMarginBefore): Deleted.
769
770 2020-02-08  Zalan Bujtas  <zalan@apple.com>
771
772         [LFC][BFC] Pre-compute vertical position only when we really need it.
773         https://bugs.webkit.org/show_bug.cgi?id=207432
774         <rdar://problem/59288539>
775
776         Reviewed by Antti Koivisto.
777
778         Instead of pre-computing the vertical position at computeStaticVerticalPosition, let's compute it when
779         1. we are about to layout a new non-float-avoider/float clear FC (e.g. so that intrusive floats can shrink the lines inside IFCs)
780         2. we are about to compute the non-static vertical position of a float avoider block level box.
781
782         * layout/blockformatting/BlockFormattingContext.cpp:
783         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
784         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
785         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors):
786         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRoot):
787         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
788         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
789         (WebCore::Layout::BlockFormattingContext::computeStaticPosition): Deleted.
790         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot): Deleted.
791         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear): Deleted.
792         (WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const): Deleted.
793         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition): Deleted.
794         * layout/blockformatting/BlockFormattingContext.h:
795
796 2020-02-08  Zalan Bujtas  <zalan@apple.com>
797
798         [LFC][BFC] Remove establishesBlockFormattingContextOnly and establishesInlineFormattingContextOnly
799         https://bugs.webkit.org/show_bug.cgi?id=207431
800         <rdar://problem/59288366>
801
802         Reviewed by Antti Koivisto.
803
804         The current caller of establishesInlineFormattingContextOnly is actually interested in whether the box is float avoider
805         (and the debug-only caller of establishesBlockFormattingContextOnly should instead check if the box also establishes an IFC).
806
807         * layout/LayoutContext.cpp:
808         (WebCore::Layout::LayoutContext::createFormattingContext):
809         * layout/blockformatting/BlockFormattingContext.cpp:
810         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot):
811         * layout/layouttree/LayoutBox.cpp:
812         (WebCore::Layout::Box::establishesInlineFormattingContextOnly const): Deleted.
813         (WebCore::Layout::Box::establishesBlockFormattingContextOnly const): Deleted.
814         * layout/layouttree/LayoutBox.h:
815
816 2020-02-08  Zalan Bujtas  <zalan@apple.com>
817
818         [LFC][BFC] Adjust Box::isFloatAvoider() for Inline and Independent FCs.
819         https://bugs.webkit.org/show_bug.cgi?id=207430
820         <rdar://problem/59288236>
821
822         Reviewed by Antti Koivisto.
823
824         A block container box that establishes both BFC and IFC is not a float avoider (add support for independent formatting context too).
825
826         * layout/layouttree/LayoutBox.cpp:
827         (WebCore::Layout::Box::isFloatAvoider const):
828
829 2020-02-08  Simon Fraser  <simon.fraser@apple.com>
830
831         Extent of a composited animation should not include the untransformed position
832         https://bugs.webkit.org/show_bug.cgi?id=207434
833
834         Reviewed by Sam Weinig.
835
836         To determine whether to create ("attach") backing store for layers with transform animations,
837         we compute the union of all the states of the animation as an "extent", and ask whether it intersects
838         the coverage rect in GraphicsLayerCA.
839
840         The non-Web Animations transition code did this correctly, just unioning the bounds transformed by
841         the start and end state.
842
843         The non-Web Animations keyframe code, and the Web Animations KeyframeEffect code (used for both CSS transitions
844         and animations) also unioned with the unanimated bounds, which could create overly large extents in some
845         cases, contributing to jetsams on iOS (rdar://problem/59020443).
846
847         Fix KeyframeAnimation and KeyframeEffect to not union with the untransformed bounds.
848
849         Tests: compositing/backing/backing-store-attachment-animating-outside-viewport.html
850                legacy-animation-engine/compositing/backing/backing-store-attachment-animating-outside-viewport.html
851
852         * animation/KeyframeEffect.cpp:
853         (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
854         * page/animation/KeyframeAnimation.cpp:
855         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
856
857 2020-02-08  Zalan Bujtas  <zalan@apple.com>
858
859         [LFC][BFC] Box::isFloatAvoider should not check for isFloatingPositioned()
860         https://bugs.webkit.org/show_bug.cgi?id=207429
861         <rdar://problem/59288204>
862
863         Reviewed by Antti Koivisto.
864
865         Box::isFloatAvoider() already checks for establishesBlockFormattingContext() (and floats do establish BFCs). 
866
867         * layout/layouttree/LayoutBox.cpp:
868         (WebCore::Layout::Box::isFloatAvoider const):
869
870 2020-02-08  Sam Weinig  <weinig@apple.com>
871
872         Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
873         https://bugs.webkit.org/show_bug.cgi?id=207155
874
875         Reviewed by Tim Horton.
876
877         Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
878         from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
879         also has a default value in PlatformEnable.h
880
881         To support the move, DerivedSources.make and generate-unified-sources.sh have been 
882         updated to generate the list of ENABLE_* features by directly from preprocessing 
883         Platform.h, rather than just getting the partial list from the xcconfig file.
884
885         * Configurations/FeatureDefines.xcconfig:
886         * Configurations/WebCore.xcconfig:
887         * DerivedSources.make:
888         * Scripts/generate-unified-sources.sh:
889
890 2020-02-08  Doug Kelly  <dougk@apple.com>
891
892         Crash in RenderTreeBuilder::Table::findOrCreateParentForChild with multicol spanner
893         https://bugs.webkit.org/show_bug.cgi?id=206917
894
895         Reviewed by Zalan Bujtas.
896
897         During render tree construction, multi-column spanners are moved from their original tree position to
898         next to the enclosing anonymous fragmented flow and we mark their previous location with a spanner placeholder.
899         If we try to add a new renderer right before the spanner (beforeChild is the spanner renderer), we need to use
900         the spanner's original position as the insertion point.
901         This patch addresses the mismatching position issue by adjusting the spanner beforeChild right before
902         we start searching for the final insertion point.
903
904         Test: fast/multicol/spanner-crash-when-finding-table-parent.html
905
906         * rendering/updating/RenderTreeBuilder.cpp:
907         (WebCore::RenderTreeBuilder::attach):
908         * rendering/updating/RenderTreeBuilderTable.cpp:
909         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
910
911 2020-02-07  Jon Lee  <jonlee@apple.com>
912
913         Web Inspector: Revert slim toolbar
914         https://bugs.webkit.org/show_bug.cgi?id=207422
915
916         Reviewed by Timothy Hatcher.
917
918         The slim toolbar needs a little more work before landing.
919
920         This patch reverts r255547, r255557, r255890, r255892, r255893, r255901, r255980.
921
922         * en.lproj/Localizable.strings:
923         * inspector/InspectorFrontendClient.h:
924         * inspector/InspectorFrontendClientLocal.cpp:
925         * inspector/InspectorFrontendClientLocal.h:
926         * inspector/InspectorFrontendHost.cpp:
927         * inspector/InspectorFrontendHost.h:
928         * inspector/InspectorFrontendHost.idl:
929
930 2020-02-07  Jack Lee  <shihchieh_lee@apple.com>
931
932         Nullptr crash in WebCore::FontFamilySpecificationCoreText::fontRanges
933         https://bugs.webkit.org/show_bug.cgi?id=207236
934         <rdar://problem/57214193>
935
936         Reviewed by Ryosuke Niwa.
937
938         Add a state variable in FontDescriptionKey for tracking hash entry deletion.
939
940         * platform/graphics/FontCache.h:
941         (WebCore::FontDescriptionKey::FontDescriptionKey):
942         (WebCore::FontDescriptionKey::operator== const):
943         (WebCore::FontDescriptionKey::isHashTableDeletedValue const):
944
945 2020-02-07  Chris Dumez  <cdumez@apple.com>
946
947         [Hardening] Validate Geolocation access permission on UIProcess side
948         https://bugs.webkit.org/show_bug.cgi?id=207393
949         <rdar://problem/56816051>
950
951         Reviewed by Brent Fulgham.
952
953         Validate Geolocation access permission on UIProcess side, instead of only relying solely on the WebProcess for this.
954
955         The workflow is as follows:
956         - The Geolocation objects request for permission to access location data
957         - The UIProcess shows a prompt
958         - If the user accepts, the UIProcess sends an authorization token (a UUID
959           string) to the Geolocation object.
960         - When the Geolocation object later asks for location updates from the UIProcess, the UIProcess validates
961           that this is a valid authorization token (one that it previously issued for this page)
962         - When the Geolocation objects gets destroyed (or resets its permission), the authorization token gets
963           revoked so that it is no longer valid.
964
965         No new tests, no Web-facing behavior change, merely hardening.
966
967         * Modules/geolocation/Geolocation.cpp:
968         (WebCore::Geolocation::~Geolocation):
969         (WebCore::Geolocation::resumeTimerFired):
970         (WebCore::Geolocation::resetAllGeolocationPermission):
971         (WebCore::Geolocation::stop):
972         (WebCore::Geolocation::setIsAllowed):
973         (WebCore::Geolocation::revokeAuthorizationTokenIfNecessary):
974         (WebCore::Geolocation::resetIsAllowed):
975         * Modules/geolocation/Geolocation.h:
976         * Modules/geolocation/GeolocationClient.h:
977         (WebCore::GeolocationClient::revokeAuthorizationToken):
978         * Modules/geolocation/GeolocationController.cpp:
979         (WebCore::GeolocationController::addObserver):
980         (WebCore::GeolocationController::revokeAuthorizationToken):
981         (WebCore::GeolocationController::activityStateDidChange):
982         * Modules/geolocation/GeolocationController.h:
983         * platform/mock/GeolocationClientMock.cpp:
984         (WebCore::GeolocationClientMock::permissionTimerFired):
985         (WebCore::GeolocationClientMock::startUpdating):
986         * platform/mock/GeolocationClientMock.h:
987
988 2020-02-07  Alex Christensen  <achristensen@apple.com>
989
990         Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content
991         https://bugs.webkit.org/show_bug.cgi?id=207409
992         rdar://problem/59275641
993
994         Reviewed by Chris Dumez.
995
996         Covered by an API test.
997
998         * history/CachedFrame.cpp:
999         (WebCore::CachedFrame::setHasInsecureContent):
1000         * history/CachedFrame.h:
1001         (WebCore::CachedFrame::usedLegacyTLS const):
1002         * loader/EmptyFrameLoaderClient.h:
1003         * loader/FrameLoader.cpp:
1004         (WebCore::FrameLoader::receivedFirstData):
1005         (WebCore::FrameLoader::commitProvisionalLoad):
1006         (WebCore::FrameLoader::dispatchDidCommitLoad):
1007         * loader/FrameLoader.h:
1008         * loader/FrameLoaderClient.h:
1009
1010 2020-02-07  Ryan Haddad  <ryanhaddad@apple.com>
1011
1012         Unreviewed, rolling out r256051.
1013
1014         Broke internal builds.
1015
1016         Reverted changeset:
1017
1018         "Move trivial definitions from FeatureDefines.xcconfig to
1019         PlatformEnableCocoa.h"
1020         https://bugs.webkit.org/show_bug.cgi?id=207155
1021         https://trac.webkit.org/changeset/256051
1022
1023 2020-02-07  Eric Carlson  <eric.carlson@apple.com>
1024
1025         Captions sometimes render at the wrong size when in fullscreen and PiP
1026         https://bugs.webkit.org/show_bug.cgi?id=207389
1027         <rdar://problem/58677864>
1028
1029         Reviewed by Jer Noble.
1030
1031         The TextTrackRepresentation, used to render captions when in fullscreen and PiP on
1032         iOS and and in PiP on macOS, frequently rendered captions before layout completed
1033         immediately after it was created. Fix this by having it not render until a layout
1034         happens. Additionally, make the code more efficient by hiding the TextTrackRepresentation's
1035         backing layer when cues are not visible instead of destroying the whole object.
1036         Drive by: RELEASE_LOG_DISABLED is always defined for PLATFORM(COCOA), so remove it
1037         from the macOS/iOS media players to make it easier to add logging to VideoFullscreenLayerManagerObjC.
1038         
1039
1040         * html/HTMLMediaElement.cpp:
1041         (WebCore::convertEnumerationToString):
1042         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
1043         * html/HTMLMediaElementEnums.h:
1044         (WTF::LogArgument<WebCore::HTMLMediaElementEnums::TextTrackVisibilityCheckType>::toString):
1045         * html/shadow/MediaControlElements.cpp:
1046         (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement):
1047         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1048         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
1049         (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
1050         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationStyle):
1051         (WebCore::MediaControlTextTrackContainerElement::layoutIfNecessary):
1052         (WebCore::MediaControlTextTrackContainerElement::updateVideoDisplaySize):
1053         (WebCore::MediaControlTextTrackContainerElement::updateSizes):
1054         (WebCore::MediaControlTextTrackContainerElement::updateCueStyles):
1055         (WebCore::MediaControlTextTrackContainerElement::logger const):
1056         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
1057         (WebCore::MediaControlTextTrackContainerElement::updateTimerFired): Deleted.
1058         (WebCore::MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation): Deleted.
1059         * platform/graphics/TextTrackRepresentation.h:
1060         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1061         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1062         (WebCore::MediaPlayerPrivateAVFoundation::logChannel const):
1063         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1064         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1065         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1066         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
1067         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
1068         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1069         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1070         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
1071         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1072         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1073         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
1074         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1075         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1076         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
1077         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1078         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1079         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
1080         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::logChannel const):
1081         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
1082         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
1083         (WebCore::VideoFullscreenLayerManagerObjC::VideoFullscreenLayerManagerObjC):
1084         (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
1085         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
1086         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame):
1087         (WebCore::VideoFullscreenLayerManagerObjC::didDestroyVideoLayer):
1088         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds):
1089         (WebCore::VideoFullscreenLayerManagerObjC::setTextTrackRepresentation):
1090         (WebCore::VideoFullscreenLayerManagerObjC::logChannel const):
1091         * platform/graphics/cocoa/TextTrackRepresentationCocoa.h:
1092         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
1093         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
1094         (TextTrackRepresentationCocoa::setHidden const):
1095         (TextTrackRepresentationCocoa::boundsChanged):
1096         * rendering/RenderMediaControlElements.cpp:
1097         (WebCore::RenderTextTrackContainerElement::layout):
1098
1099 2020-02-07  Sam Weinig  <weinig@apple.com>
1100
1101         Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
1102         https://bugs.webkit.org/show_bug.cgi?id=207155
1103
1104         Reviewed by Tim Horton.
1105
1106         Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
1107         from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
1108         also has a default value in PlatformEnable.h
1109
1110         To support the move, DerivedSources.make and generate-unified-sources.sh have been 
1111         updated to generate the list of ENABLE_* features by directly from preprocessing 
1112         Platform.h, rather than just getting the partial list from the xcconfig file.
1113
1114         * Configurations/FeatureDefines.xcconfig:
1115         * Configurations/WebCore.xcconfig:
1116         * DerivedSources.make:
1117         * Scripts/generate-unified-sources.sh:
1118
1119 2020-02-07  Nikos Mouchtaris  <nmouchtaris@apple.com>
1120
1121         [Apple Pay] Provide a redacted billing contact during payment method selection
1122         https://bugs.webkit.org/show_bug.cgi?id=207169
1123         <rdar://problem/42737441>
1124
1125         Reviewed by Andy Estes.
1126
1127         Added requestBillingAddress option to PaymentOptions, to allow merchants
1128         to request the user's billing address prior to user authentication to allow
1129         the calculation of taxes. Added billingAddress member to ApplePayPaymentMethod 
1130         to return the billing address in the PaymentMethodChanged callback function.
1131
1132         Test: http/tests/ssl/applepay/ApplePayBillingAddress.html
1133
1134         * Modules/applepay/ApplePayPaymentMethod.h:
1135         * Modules/applepay/ApplePayPaymentMethod.idl:
1136         * Modules/applepay/PaymentCoordinatorClient.cpp:
1137         (WebCore::PaymentCoordinatorClient::supportsVersion):
1138         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
1139         (WebCore::convert):
1140         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1141         (WebCore::mergePaymentOptions):
1142         * Modules/paymentrequest/PaymentOptions.h:
1143         * Modules/paymentrequest/PaymentOptions.idl:
1144
1145 2020-02-07  Myles C. Maxfield  <mmaxfield@apple.com>
1146
1147         [Cocoa] Slightly improve performance of Font::getCFStringAttributes()
1148         https://bugs.webkit.org/show_bug.cgi?id=207374
1149
1150         Reviewed by Darin Adler.
1151
1152         Switch from CFDictionaryCreateMutable() to CFDictionaryCreate(). Also, don't construct a CTParagraphStyle each time the function is called.
1153
1154         No new tests because there is no behavior change.
1155
1156         * platform/graphics/FontCascade.cpp:
1157         (WebCore::FontCascade::widthForSimpleText const):
1158         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1159         (WebCore::Font::getCFStringAttributes const):
1160
1161 2020-02-07  youenn fablet  <youenn@apple.com>
1162
1163         Align getDisplayMedia() with spec
1164         https://bugs.webkit.org/show_bug.cgi?id=207191
1165         <rdar://problem/59151017>
1166
1167         Reviewed by Eric Carlson.
1168
1169         Update WebIDL as per spec to have the correct default values for getDisplayMedia.
1170         Covered by updated test.
1171
1172         * Modules/mediastream/MediaDevices.cpp:
1173         (WebCore::MediaDevices::getDisplayMedia):
1174         * Modules/mediastream/MediaDevices.h:
1175         * Modules/mediastream/MediaDevices.idl:
1176
1177 2020-02-07  youenn fablet  <youenn@apple.com>
1178
1179         Add release logging for the case of libwebrtc being not available
1180         https://bugs.webkit.org/show_bug.cgi?id=207383
1181
1182         Reviewed by Eric Carlson.
1183
1184         Add logging in case of no libwebrtc dylib, in case we try to create a peer connection or a libwebrtc factory.
1185         No change of behavior.
1186
1187         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1188         (WebCore::createLibWebRTCPeerConnectionBackend):
1189         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1190         (WebCore::LibWebRTCProvider::factory):
1191
1192 2020-02-07  youenn fablet  <youenn@apple.com>
1193
1194         Filter out TURN/STUN .local URLs from a RTCPeerConnection iceServers list
1195         https://bugs.webkit.org/show_bug.cgi?id=207332
1196
1197         Reviewed by Eric Carlson.
1198
1199         Test: webrtc/stun-server-filtering.html
1200
1201         * Modules/mediastream/RTCPeerConnection.cpp:
1202         (WebCore::iceServersFromConfiguration):
1203         Ignore .local URLs for STUN/TURN servers as they are not used right now
1204         and could be used to discover local network services.
1205
1206 2020-02-07  Antoine Quint  <graouts@webkit.org>
1207
1208         REGRESSION (r255953): [ iOS Mac ] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events.html is crashing
1209         https://bugs.webkit.org/show_bug.cgi?id=207342
1210         <rdar://problem/59227960>
1211
1212         Reviewed by Youenn Fablet.
1213
1214         DocumentTimeline::detachFromDocument() may remove the last reference to WebAnimation objects that may, in return, remove the last reference of this
1215         DocumentTimeline. As such, this method should make a strong reference to itself for the span of this method. However, we should not be calling it
1216         from the destructor where the only thing matters is removing the weak reference from the Document to the DocumentTimeline.
1217
1218         * animation/DocumentTimeline.cpp:
1219         (WebCore::DocumentTimeline::~DocumentTimeline):
1220         (WebCore::DocumentTimeline::detachFromDocument):
1221
1222 2020-02-07  youenn fablet  <youenn@apple.com>
1223
1224         Mandate UUID version 4 for mDNS ICE candidates
1225         https://bugs.webkit.org/show_bug.cgi?id=207329
1226
1227         Reviewed by Alex Christensen.
1228
1229         Ignore ICE candidates if they are mDNS but not UUID version 4.
1230         Covered by existing tests relying on mDNS to do the connection.
1231
1232         * Modules/mediastream/PeerConnectionBackend.cpp:
1233         (WebCore::shouldIgnoreCandidate):
1234         (WebCore::PeerConnectionBackend::addIceCandidate):
1235
1236 2020-02-07  Tomoki Imai  <Tomoki.Imai@sony.com>
1237
1238         [OpenSSL] Implement WebCrypto APIs for AES-CBC, AES-CFB and AES-GCM
1239         https://bugs.webkit.org/show_bug.cgi?id=207176
1240
1241         Reviewed by Fujii Hironori.
1242
1243         Add WebCrypto implementations for the following algorithms with OpenSSL.
1244         - AES_CBC
1245         - AES_CFB
1246         - AES_GCM
1247
1248         Currently we don't have AES-KW implementation, because EVP API doesn't have AES-KW implementation.
1249
1250         Enabled WebCrypto LayoutTests for AES-CBC, AES-CFB and AES-GCM.
1251
1252         * crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp:
1253         (WebCore::aesAlgorithm): Added. Helper function to select which AES-CBC algorithm to be used by checking key size.
1254         (WebCore::cryptEncrypt): Added. Helper function for platformEncrypt.
1255         (WebCore::cryptDecrypt): Added. Helper function for platformDecrypt.
1256         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): Implemented
1257         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): Implemented
1258         * crypto/openssl/CryptoAlgorithmAES_CFBOpenSSL.cpp:
1259         (WebCore::aesAlgorithm): Added. Helper function to select which AES-CFB algorithm to be used by checking key size.
1260         (WebCore::cryptEncrypt): Added. Helper function for platformEncrypt.
1261         (WebCore::cryptDecrypt): Added. Helper function for platformDecrypt.
1262         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt): Implemented
1263         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt): Implemented
1264         * crypto/openssl/CryptoAlgorithmAES_GCMOpenSSL.cpp:
1265         (WebCore::aesAlgorithm): Added. Helper function to select which AES-GCM algorithm to be used by checking key size.
1266         (WebCore::cryptEncrypt): Added. Helper function for platformEncrypt.
1267         (WebCore::cryptDecrypt): Added. Helper function for platformDecrypt.
1268         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt): Implemented
1269         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt): Implemented
1270         * crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp:
1271         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Registered CryptoAlgorithmAES_CBC, CryptoAlgorithmAES_CFB,
1272         and CryptoAlgorithmAES_GCM.
1273         * crypto/openssl/OpenSSLCryptoUniquePtr.h: Added to make sure that EVP_CIPHER_CTX is freed.
1274         (WebCore::OpenSSLCryptoPtrDeleter<EVP_CIPHER_CTX>::operator() const):
1275
1276 2020-02-07  Patrick Griffis  <pgriffis@igalia.com>
1277
1278         [GTK][WPE] Add same-site cookie support
1279         https://bugs.webkit.org/show_bug.cgi?id=204137
1280
1281         Reviewed by Carlos Garcia Campos.
1282
1283         Implements same-site cookie support in the soup backend.
1284
1285         * platform/network/HTTPParsers.cpp:
1286         (WebCore::isSafeMethod):
1287         * platform/network/HTTPParsers.h:
1288         * platform/network/SameSiteInfo.cpp:
1289         (WebCore::SameSiteInfo::create):
1290         * platform/network/SameSiteInfo.h:
1291         (WebCore::SameSiteInfo::encode const):
1292         (WebCore::SameSiteInfo::decode):
1293         * platform/network/soup/CookieSoup.cpp:
1294         (WebCore::coreSameSitePolicy):
1295         (WebCore::soupSameSitePolicy):
1296         (WebCore::Cookie::Cookie):
1297         (WebCore::Cookie::toSoupCookie const):
1298         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1299         (WebCore::NetworkStorageSession::getRawCookies const):
1300         (WebCore::cookiesForSession):
1301         (WebCore::NetworkStorageSession::cookiesForDOM const):
1302         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1303         * platform/network/soup/ResourceRequestSoup.cpp:
1304         (WebCore::ResourceRequest::updateSoupMessageMembers const):
1305         (WebCore::ResourceRequest::updateFromSoupMessage):
1306
1307 2020-02-07  Rob Buis  <rbuis@igalia.com>
1308
1309         Fix fetch/api/policies/referrer-origin-worker.html
1310         https://bugs.webkit.org/show_bug.cgi?id=206520
1311
1312         Reviewed by Youenn Fablet.
1313
1314         Expose referrer policy as part of the worker global scope [1] through
1315         the new ScriptExecutionContext::referrerPolicy method.
1316         Call it as environment settings object when starting a fetch in case
1317         the FetchRequestInit has no referrerPolicy set [2].
1318
1319         Test: imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-worker.html
1320
1321         [1] https://html.spec.whatwg.org/multipage/workers.html#set-up-a-worker-environment-settings-object
1322         [2] https://fetch.spec.whatwg.org/#ref-for-concept-main-fetch①  (Step 2.5)
1323
1324         * Modules/fetch/FetchLoader.cpp:
1325         (WebCore::FetchLoader::start):
1326         * dom/Document.h:
1327         (WebCore::Document::referrerPolicy const): Deleted.
1328         * dom/ScriptExecutionContext.h:
1329         * workers/DedicatedWorkerGlobalScope.cpp:
1330         (WebCore::DedicatedWorkerGlobalScope::create):
1331         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1332         * workers/DedicatedWorkerGlobalScope.h:
1333         * workers/DedicatedWorkerThread.cpp:
1334         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1335         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1336         * workers/DedicatedWorkerThread.h:
1337         * workers/Worker.cpp:
1338         (WebCore::Worker::notifyFinished):
1339         * workers/WorkerGlobalScope.cpp:
1340         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1341         (WebCore::WorkerGlobalScope::referrerPolicy const):
1342         * workers/WorkerGlobalScope.h:
1343         * workers/WorkerGlobalScopeProxy.h:
1344         * workers/WorkerMessagingProxy.cpp:
1345         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1346         * workers/WorkerMessagingProxy.h:
1347         * workers/WorkerThread.cpp:
1348         (WebCore::WorkerParameters::isolatedCopy const):
1349         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1350         (WebCore::WorkerThread::WorkerThread):
1351         (WebCore::WorkerThread::workerThread):
1352         * workers/WorkerThread.h:
1353         * workers/service/ServiceWorkerGlobalScope.cpp:
1354         (WebCore::ServiceWorkerGlobalScope::create):
1355         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
1356         * workers/service/ServiceWorkerGlobalScope.h:
1357         * workers/service/context/ServiceWorkerThread.cpp:
1358         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1359         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
1360         * workers/service/context/ServiceWorkerThread.h:
1361         * worklets/WorkletGlobalScope.cpp:
1362         (WebCore::WorkletGlobalScope::referrerPolicy const):
1363         * worklets/WorkletGlobalScope.h:
1364
1365 2020-02-07  youenn fablet  <youenn@apple.com>
1366
1367         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
1368         https://bugs.webkit.org/show_bug.cgi?id=206582
1369         <rdar://problem/58985368>
1370
1371         Reviewed by Eric Carlson.
1372
1373         AVAssetWriterDelegate allows to grab recorded data whenever wanted.
1374         This delegate requires passing compressed samples to AVAssetWriter.
1375         Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
1376         These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor.
1377         They support AAC and H264 so far and should be further improved to support more encoding options.
1378
1379         Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere.
1380         The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors.
1381         It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter.
1382         The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data.
1383
1384         Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed.
1385         Therefore data should not be requested too fast to get adequate video compression.
1386
1387         Covered by existing tests.
1388
1389         * Modules/mediarecorder/MediaRecorderProvider.cpp:
1390         (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
1391         * WebCore.xcodeproj/project.pbxproj:
1392         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
1393         (WebCore::MediaRecorderPrivateAVFImpl::create):
1394         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
1395         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added.
1396         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added.
1397         (WebCore::AudioSampleBufferCompressor::create):
1398         (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
1399         (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
1400         (WebCore::AudioSampleBufferCompressor::initialize):
1401         (WebCore::AudioSampleBufferCompressor::finish):
1402         (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
1403         (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
1404         (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
1405         (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
1406         (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
1407         (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
1408         (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
1409         (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
1410         (WebCore::AudioSampleBufferCompressor::processSampleBuffer):
1411         (WebCore::AudioSampleBufferCompressor::addSampleBuffer):
1412         (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
1413         (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
1414         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
1415         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1416         (-[WebAVAssetWriterDelegate initWithWriter:]):
1417         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]):
1418         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]):
1419         (-[WebAVAssetWriterDelegate close]):
1420         (WebCore::MediaRecorderPrivateWriter::create):
1421         (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback):
1422         (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback):
1423         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
1424         (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
1425         (WebCore::MediaRecorderPrivateWriter::initialize):
1426         (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
1427         (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
1428         (WebCore::MediaRecorderPrivateWriter::startAssetWriter):
1429         (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
1430         (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
1431         (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers):
1432         (WebCore::appendEndsPreviousSampleDurationMarker):
1433         (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded):
1434         (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers):
1435         (WebCore::MediaRecorderPrivateWriter::clear):
1436         (WebCore::copySampleBufferWithCurrentTimeStamp):
1437         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1438         (WebCore::createAudioFormatDescription):
1439         (WebCore::createAudioSampleBuffer):
1440         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1441         (WebCore::MediaRecorderPrivateWriter::stopRecording):
1442         (WebCore::MediaRecorderPrivateWriter::appendData):
1443         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h.
1444         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added.
1445         (WebCore::VideoSampleBufferCompressor::create):
1446         (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
1447         (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
1448         (WebCore::VideoSampleBufferCompressor::initialize):
1449         (WebCore::VideoSampleBufferCompressor::finish):
1450         (WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
1451         (WebCore::VideoSampleBufferCompressor::initCompressionSession):
1452         (WebCore::VideoSampleBufferCompressor::processSampleBuffer):
1453         (WebCore::VideoSampleBufferCompressor::addSampleBuffer):
1454         (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
1455         (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):
1456
1457 2020-02-07  youenn fablet  <youenn@apple.com>
1458
1459         Do not process newly gathered ICE candidates if document is suspended
1460         https://bugs.webkit.org/show_bug.cgi?id=207326
1461         <rdar://problem/57336453>
1462
1463         Reviewed by Alex Christensen.
1464
1465         We should not register MDNS candidates for suspended documents.
1466         For that reason, enqueue a task when receiving a new candidate.
1467         If document is not suspended, it will be executed immediately.
1468         Otherwise, we will wait until document gets unsuspended.
1469
1470         Add a mock endpoint that delays gathering of candidates until document is suspended.
1471
1472         Test: webrtc/peerconnection-new-candidate-page-cache.html
1473
1474         * Modules/mediastream/PeerConnectionBackend.cpp:
1475         (WebCore::PeerConnectionBackend::newICECandidate):
1476         * testing/MockLibWebRTCPeerConnection.cpp:
1477         (WebCore::MockLibWebRTCPeerConnection::GetTransceivers const):
1478         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::MockLibWebRTCPeerConnectionForIceCandidates):
1479         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
1480         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::sendCandidates):
1481         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
1482
1483 2020-02-06  Myles C. Maxfield  <mmaxfield@apple.com>
1484
1485         REGRESSION(r254534): 1-3% regression on PLT
1486         https://bugs.webkit.org/show_bug.cgi?id=207244
1487
1488         Can't put null strings into hash maps.
1489
1490         Reviewed by Wenson Hsieh.
1491
1492         * platform/text/cocoa/LocaleCocoa.mm:
1493         (WebCore::LocaleCocoa::canonicalLanguageIdentifierFromString):
1494
1495 2020-02-06  Myles C. Maxfield  <mmaxfield@apple.com>
1496
1497         [Cocoa] Rename LocaleMac to LocaleCocoa
1498         https://bugs.webkit.org/show_bug.cgi?id=207371
1499
1500         Reviewed by Simon Fraser.
1501
1502         It's used by all the Cocoa platforms.
1503
1504         No new tests because there is no behavior change.
1505
1506         * PlatformMac.cmake:
1507         * SourcesCocoa.txt:
1508         * WebCore.order:
1509         * WebCore.xcodeproj/project.pbxproj:
1510         * page/cocoa/MemoryReleaseCocoa.mm:
1511         (WebCore::platformReleaseMemory):
1512         * platform/graphics/cocoa/FontCocoa.mm:
1513         (WebCore::Font::applyTransforms const):
1514         * platform/text/cocoa/LocaleCocoa.h: Renamed from Source/WebCore/platform/text/mac/LocaleMac.h.
1515         * platform/text/mac/LocaleMac.mm: Removed.
1516
1517 2020-02-06  Tim Horton  <timothy_horton@apple.com>
1518
1519         macCatalyst: Unnecessary I-beam over images in editable areas
1520         https://bugs.webkit.org/show_bug.cgi?id=207370
1521         <rdar://problem/59235429>
1522
1523         Reviewed by Wenson Hsieh.
1524
1525         * dom/Position.h:
1526
1527 2020-02-06  Doug Kelly  <dougk@apple.com>
1528
1529         Incorrect TextTrack sorting with invalid BCP47 language
1530         https://bugs.webkit.org/show_bug.cgi?id=207315
1531
1532         Reviewed by Jer Noble.
1533
1534         When comparing TextTracks, this ensures all tracks are compared based on consistent parameters, including tracks with an invalid BCP47
1535         language attribute.
1536
1537         * page/CaptionUserPreferencesMediaAF.cpp:
1538         (WebCore::textTrackCompare):
1539
1540 2020-02-06  James Darpinian  <jdarpinian@chromium.org>
1541
1542         webgl/1.0.3/conformance/glsl/misc/shader-with-reserved-words.html is timing out on some hardware configurations
1543         https://bugs.webkit.org/show_bug.cgi?id=205739
1544
1545         Reviewed by Dean Jackson.
1546
1547         Optimize disabling ANGLE_texture_rectangle.
1548
1549         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
1550         (WebCore::GraphicsContextGLOpenGL::compileShader):
1551
1552 2020-02-06  Myles C. Maxfield  <mmaxfield@apple.com>
1553
1554         REGRESSION(r254534): 1-3% regression on PLT
1555         https://bugs.webkit.org/show_bug.cgi?id=207244
1556         <rdar://problem/58821709>
1557
1558         Reviewed by Simon Fraser.
1559
1560         Turns out CTFontTransformGlyphsWithLanguage() is 33.7% slower than CTFontTransformGlyphs() on some OSes.
1561         This patch changes the preprocessor guards to not use the function on those OSes.
1562         Also, the contract of the function on the more performant OSes requires that the locale name be canonicalized,
1563         so this patch implements a canonical locale cache inside LocaleMac.mm. It gets cleared when the low memory
1564         warning is fired.
1565
1566         Marked existing tests as failing.
1567
1568         * page/cocoa/MemoryReleaseCocoa.mm:
1569         (WebCore::platformReleaseMemory):
1570         * platform/graphics/cocoa/FontCocoa.mm:
1571         (WebCore::Font::applyTransforms const):
1572         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1573         (WebCore::Font::getCFStringAttributes const):
1574         * platform/text/mac/LocaleMac.h:
1575         * platform/text/mac/LocaleMac.mm:
1576         (WebCore::determineLocale):
1577         (WebCore::canonicalLocaleMap):
1578         (WebCore::LocaleMac::canonicalLanguageIdentifierFromString):
1579         (WebCore::LocaleMac::releaseMemory):
1580
1581 2020-02-06  Devin Rousso  <drousso@apple.com>
1582
1583         Web Inspector: show JavaScript Worker terminated state as an internal property
1584         https://bugs.webkit.org/show_bug.cgi?id=207347
1585
1586         Reviewed by Brian Burg.
1587
1588         Test: inspector/worker/worker-create-and-terminate.html
1589
1590         * inspector/WebInjectedScriptHost.cpp:
1591         (WebCore::WebInjectedScriptHost::getInternalProperties):
1592
1593         * workers/Worker.h:
1594         (WebCore::Worker::wasTerminated): Added.
1595
1596 2020-02-06  Christopher Reid  <chris.reid@sony.com>
1597
1598         [curl] PublicSuffixCurl should skip leading dots
1599         https://bugs.webkit.org/show_bug.cgi?id=206954
1600
1601         Reviewed by Fujii Hironori.
1602
1603         Covered by existing tests.
1604
1605         Matching PublicSuffixSoup.cpp behavior to skip leading dots.
1606
1607         * platform/network/curl/PublicSuffixCurl.cpp:
1608
1609 2020-02-06  Jack Lee  <shihchieh_lee@apple.com>
1610
1611         Nullptr crash in WebCore::findPlaceForCounter with pseudo element that has display:contents host.
1612         https://bugs.webkit.org/show_bug.cgi?id=207241
1613
1614         When the pseudo element's host element does not initiate a renderer
1615         (e.g. display: contents) we need to look further in the DOM tree 
1616         for a previous-sibling-or-parent-element candidate.
1617
1618         Reviewed by Zalan Bujtas.
1619
1620         Test: fast/css/counters/findPlaceForCounter-pseudo-element-display-content-host-crash.html
1621
1622         * rendering/RenderCounter.cpp:
1623         (WebCore::previousSiblingOrParentElement):
1624
1625 2020-02-06  Commit Queue  <commit-queue@webkit.org>
1626
1627         Unreviewed, rolling out r255910, r255970, and r255972.
1628         https://bugs.webkit.org/show_bug.cgi?id=207345
1629
1630         Broke internal builds (Requested by ryanhaddad on #webkit).
1631
1632         Reverted changesets:
1633
1634         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1635         https://bugs.webkit.org/show_bug.cgi?id=206582
1636         https://trac.webkit.org/changeset/255910
1637
1638         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1639         https://bugs.webkit.org/show_bug.cgi?id=206582
1640         https://trac.webkit.org/changeset/255970
1641
1642         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1643         https://bugs.webkit.org/show_bug.cgi?id=206582
1644         https://trac.webkit.org/changeset/255972
1645
1646 2020-02-06  Ali Juma  <ajuma@chromium.org>
1647
1648         Crash in RenderTableCol::willBeRemovedFromTree()
1649         https://bugs.webkit.org/show_bug.cgi?id=207031
1650
1651         Reviewed by Antti Koivisto.
1652
1653         A RenderTableCol's table() can be null during willBeRemovedFromTree. This can
1654         happen when the RenderTableCol's table is an ancestor rather than a direct
1655         parent. If RenderTreeBuilder::destroy is then called on an ancestor of the
1656         the RenderTableCol's table, RenderTreeBuilder::destroy proceeds down the ancestor
1657         chain, detaching each node along the way. By the time the RenderTableCol is
1658         reached, the table (a non-parent ancestor) has already been detached, so
1659         table() is null and we crash while trying to use it.
1660
1661         The underlying bug is that RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers
1662         is getting called on the RenderTableCol's ancestor before its descendants (including
1663         the RenderTableCol) are destroyed.
1664
1665         Fix this by changing the order of operations in RenderTreeUpdater::tearDownRenderers
1666         so that tearDownLeftoverShadowHostChildren happens before destroyAndCleanUpAnonymousWrappers.
1667         This ensures that the RenderTableCol is destroyed before destroyAndCleanUpAnonymousWrappers is
1668         called on its ancestor.
1669
1670         Test: tables/table-col-indent-crash.html
1671
1672         * rendering/updating/RenderTreeUpdater.cpp:
1673         (WebCore::RenderTreeUpdater::tearDownRenderers):
1674
1675 2020-02-06  Brent Fulgham  <bfulgham@apple.com>
1676
1677         Prevent navigating top level frames to Data URLs
1678         https://bugs.webkit.org/show_bug.cgi?id=206962
1679         <rdar://problem/56770676>
1680
1681         Reviewed by Youenn Fablet.
1682
1683         Revise our loading behavior to match Chrome and Firefox by blocking
1684         top level frame navigations to Data URLs.
1685
1686         Test: fast/loader/data-url-frame-allowed.html, fast/loader/data-url-load-denied.html
1687
1688         * loader/DocumentLoader.cpp:
1689         (WebCore::DocumentLoader::disallowDataRequest const): Added,
1690         (WebCore::DocumentLoader::continueAfterContentPolicy): Validate whether the load should
1691         continue if it is a Data URL.
1692         * loader/DocumentLoader.h:
1693         (WebCore::DocumentLoader::setAllowsDataURLForMainFrame): Added.
1694         (WebCore::DocumentLoader::allowsDataURLForMainFrame const): Added.
1695         * loader/FrameLoader.cpp:
1696         (WebCore::FrameLoader::load): If the main frame loader as triggered by user action, or
1697         direct call to the client API, allow top-frame navigation to Data URLs.
1698         (WebCore::FrameLoader::reload): If the original load allowed top-frame navigation to Data
1699         URLs, continue to do so in the reload.
1700         * loader/FrameLoader.h:
1701
1702 2020-02-06  Cathie Chen  <cathiechen@igalia.com>
1703
1704         Add support for scroll behavior relies on ScrollAnimation of the Web process
1705         https://bugs.webkit.org/show_bug.cgi?id=204882
1706
1707         Reviewed by Frédéric Wang
1708
1709         Based on the patch by Frédéric Wang.
1710
1711         This patch introduces a programmatic smooth scrolling in WebKit from the CSSOM View
1712         specification [1]. To use this effect, web developers can pass a behavior parameter (auto,
1713         smooth, or instant) to Element.scroll, Element.scrollTo, Element.scrollBy,
1714         Element.scrollIntoView, Window.scroll, Window.scrollTo or Window.scrollBy [2]. When behavior
1715         is auto, the instant/smooth characteristic is actually taken from the value of a new CSS
1716         scroll-behavior property [3]. Both the new CSS and DOM behavior are protected by a runtime
1717         flag.
1718
1719         [1] https://drafts.csswg.org/cssom-view
1720         [2] https://drafts.csswg.org/cssom-view/#dictdef-scrolloptions
1721         [3] https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
1722
1723         Tests: imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html
1724                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html
1725                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html
1726                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html
1727                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html
1728                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html
1729                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html
1730                imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html
1731         * Sources.txt: Build ScrollAnimationSmooth.cpp on all platforms.
1732         * SourcesGTK.txt: Remove ScrollAnimationSmooth.cpp since it is built on all platforms now.
1733         * dom/Element.cpp:
1734         (WebCore::Element::scrollIntoView): Pass scroll behavior, if any.
1735         (WebCore::Element::scrollBy):
1736         (WebCore::Element::scrollTo): Handle the case when scroll behavior is smooth.
1737         (WebCore::Element::setScrollLeft): Handle the case when scroll behavior is smooth.
1738         (WebCore::Element::setScrollTop): Handle the case when scroll behavior is smooth.
1739         * page/DOMWindow.cpp:
1740         (WebCore::DOMWindow::scrollBy const):
1741         (WebCore::DOMWindow::scrollTo const): Handle the case when scroll behavior is smooth.
1742         The optimization of cancel (0, 0) scrolling is skipped if an animated scroll is in progress.
1743         Otherwise, the previous scroll won't be stopped by a follow-up scroll.
1744         * page/FrameView.cpp:
1745         (WebCore::FrameView::setScrollPosition):
1746         (WebCore::FrameView::scrollToOffsetWithAnimation): Start an animated scroll.
1747         * page/FrameView.h:
1748         * platform/ScrollAnimation.h:
1749         (WebCore::ScrollAnimation::scroll): Function to animate scrolling to a specified position.
1750         * platform/ScrollAnimationSmooth.cpp: Build this file on all platforms. Add a
1751         smoothFactorForProgrammaticScroll parameter to slow down the smooth scrolling.
1752         (WebCore::ScrollAnimationSmooth::scroll):
1753         (WebCore::ScrollAnimationSmooth::updatePerAxisData): Scale the time parameters of the
1754         animation so that it looks smoother.
1755         * platform/ScrollAnimationSmooth.h: Declare the class on all platforms.
1756         * platform/ScrollAnimator.cpp:
1757         (WebCore::ScrollAnimator::ScrollAnimator): Initialize animation member for programmatic scrolling.
1758         (WebCore::ScrollAnimator::scrollToOffset): Animate scrolling to the specified position.
1759         (WebCore::ScrollAnimator::cancelAnimations): Copy logic from ScrollAnimationSmooth.cpp.
1760         (WebCore::ScrollAnimator::serviceScrollAnimations): Ditto.
1761         (WebCore::ScrollAnimator::willEndLiveResize): Ditto.
1762         (WebCore::ScrollAnimator::didAddVerticalScrollbar): Ditto.
1763         (WebCore::ScrollAnimator::didAddHorizontalScrollbar): Ditto.
1764         * platform/ScrollAnimator.h: New animation member for smooth programmatic scrolling.
1765         (WebCore::ScrollAnimator::ScrollAnimator::cancelAnimations): Deleted.
1766         (WebCore::ScrollAnimator::ScrollAnimator::serviceScrollAnimations): Deleted.
1767         (WebCore::ScrollAnimator::ScrollAnimator::willEndLiveResize): Deleted.
1768         (WebCore::ScrollAnimator::ScrollAnimator::didAddVerticalScrollbar): Deleted.
1769         (WebCore::ScrollAnimator::ScrollAnimator::didAddHorizontalScrollbar): Deleted.
1770         * platform/ScrollTypes.h: Add ScrollBehaviorStatus to indicate the status of scrolling.
1771         * platform/ScrollView.cpp:
1772         (WebCore::ScrollView::setScrollPosition): Follow the CSSOM View spec: If a scroll is in
1773         progress, we interrupt it and continue the scroll call (even when we are at the final position).
1774         * platform/ScrollView.h:
1775         * platform/ScrollableArea.cpp:
1776         (WebCore::ScrollableArea::ScrollableArea):
1777         (WebCore::ScrollableArea::scrollToOffsetWithAnimation):
1778         * platform/ScrollableArea.h:
1779         (WebCore::ScrollableArea::currentScrollBehaviorStatus const): Maintain currentScrollBehaviorStatus.
1780         (WebCore::ScrollableArea::setScrollBehaviorStatus):
1781         * platform/mac/ScrollAnimatorMac.mm:
1782         (WebCore::ScrollAnimatorMac::cancelAnimations): Call parent member to handle programmatic scrolling.
1783         * rendering/RenderBox.cpp:
1784         (WebCore::RenderBox::setScrollLeft): Add flag to indicate animated or not.
1785         (WebCore::RenderBox::setScrollTop): Ditto.
1786         (WebCore::RenderBox::setScrollPosition):
1787         * rendering/RenderBox.h:
1788         * rendering/RenderLayer.cpp:
1789         (WebCore::RenderLayer::scrollToXPosition): Ditto.
1790         (WebCore::RenderLayer::scrollToYPosition): Ditto.
1791         (WebCore::RenderLayer::scrollToPosition):
1792         (WebCore::RenderLayer::scrollToOffset): Follow the CSSOM View spec: If a scroll is in
1793         progress, we interrupt it and continue the scroll call (even when we are at the final
1794         position). It's ScrollBehaviorType::Instant scroll.
1795         (WebCore::RenderLayer::scrollToOffsetWithAnimation): Ditto. This is similar to scrollToOffset
1796         but animates the scroll. It's ScrollBehaviorType::Smooth scroll.
1797         (WebCore::RenderLayer::scrollTo):
1798         (WebCore::RenderLayer::scrollRectToVisible): Again don't do an early return if scroll is in
1799         progress. We call scrollToOffsetWithAnimation instead of scrollToOffset when appropriate.
1800         Note that this function may not work well for several nested scroll boxes with at least one
1801         element with smooth behavior. It will handled in bug Follow.
1802         * rendering/RenderLayer.h: Add scroll behavior to ScrollTectToVisibleOptions.
1803         * rendering/RenderListBox.cpp:
1804         (WebCore::RenderListBox::setScrollLeft): Add animated flag.
1805         (WebCore::RenderListBox::setScrollTop): Ditto.
1806         * rendering/RenderListBox.h:
1807         * rendering/RenderTextControlSingleLine.cpp:
1808         (WebCore::RenderTextControlSingleLine::setScrollLeft):
1809         (WebCore::RenderTextControlSingleLine::setScrollTop):
1810         * rendering/RenderTextControlSingleLine.h:
1811         * testing/Internals.cpp:
1812         (WebCore::Internals::unconstrainedScrollTo):
1813
1814 2020-02-06  Antoine Quint  <graouts@apple.com>
1815
1816         [Web Animations] Ensure all timelines are detached from their document
1817         https://bugs.webkit.org/show_bug.cgi?id=207331
1818         <rdar://problem/59210306>
1819
1820         Reviewed by Dean Jackson.
1821
1822         We recently added a WeakHashSet<DocumentTimeline> m_timelines member to Document and added code to ~DocumentTimeline
1823         to remove themselves from their Document's m_timelines. However, Document::prepareForDestruction() would call
1824         DocumentTimeline::detachFromDocument() only for the main timeline and neglect to do the same for any additional
1825         timelines that may have been created with the DocumentTimeline constructor.
1826
1827         We now cleanly call DocumentTimeline::detachFromDocument() for all items in a Document's m_timelines, which has the
1828         effect of clearing the Document <> DocumentTimeline relationship since DocumentTimeline::detachFromDocument() now
1829         calls Document::removeTimeline().
1830
1831         Finally, we now call DocumentTimeline::detachFromDocument() from the DocumentTimeline destructor to ensure that timelines
1832         that were created purely in JS but got garbage-collected are no longer referenced from the Document still.
1833
1834         * animation/DocumentTimeline.cpp:
1835         (WebCore::DocumentTimeline::~DocumentTimeline):
1836         (WebCore::DocumentTimeline::detachFromDocument):
1837         (WebCore::DocumentTimeline::cacheCurrentTime):
1838         * dom/Document.cpp:
1839         (WebCore::Document::prepareForDestruction):
1840
1841 2020-02-06  Adrian Perez de Castro  <aperez@igalia.com>
1842
1843         [Cairo] Do not use old-style GNU field initializers
1844         https://bugs.webkit.org/show_bug.cgi?id=207309
1845
1846         Reviewed by Carlos Garcia Campos.
1847
1848         No new tests needed.
1849
1850         * platform/graphics/cairo/GradientCairo.cpp:
1851         (WebCore::addConicSector): Use the standard named field initializer syntax instead.
1852
1853 2020-02-06  youenn fablet  <youenn@apple.com>
1854
1855         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
1856         https://bugs.webkit.org/show_bug.cgi?id=206582
1857         <rdar://problem/58985368>
1858
1859         Reviewed by Eric Carlson.
1860
1861         AVAssetWriterDelegate allows to grab recorded data whenever wanted.
1862         This delegate requires passing compressed samples to AVAssetWriter.
1863         Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
1864         These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor.
1865         They support AAC and H264 so far and should be further improved to support more encoding options.
1866
1867         Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere.
1868         The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors.
1869         It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter.
1870         The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data.
1871
1872         Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed.
1873         Therefore data should not be requested too fast to get adequate video compression.
1874
1875         Covered by existing tests.
1876
1877         * Modules/mediarecorder/MediaRecorderProvider.cpp:
1878         (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
1879         * WebCore.xcodeproj/project.pbxproj:
1880         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
1881         (WebCore::MediaRecorderPrivateAVFImpl::create):
1882         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
1883         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added.
1884         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added.
1885         (WebCore::AudioSampleBufferCompressor::create):
1886         (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
1887         (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
1888         (WebCore::AudioSampleBufferCompressor::initialize):
1889         (WebCore::AudioSampleBufferCompressor::finish):
1890         (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
1891         (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
1892         (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
1893         (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
1894         (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
1895         (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
1896         (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
1897         (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
1898         (WebCore::AudioSampleBufferCompressor::processSampleBuffer):
1899         (WebCore::AudioSampleBufferCompressor::addSampleBuffer):
1900         (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
1901         (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
1902         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
1903         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1904         (-[WebAVAssetWriterDelegate initWithWriter:]):
1905         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]):
1906         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]):
1907         (-[WebAVAssetWriterDelegate close]):
1908         (WebCore::MediaRecorderPrivateWriter::create):
1909         (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback):
1910         (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback):
1911         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
1912         (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
1913         (WebCore::MediaRecorderPrivateWriter::initialize):
1914         (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
1915         (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
1916         (WebCore::MediaRecorderPrivateWriter::startAssetWriter):
1917         (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
1918         (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
1919         (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers):
1920         (WebCore::appendEndsPreviousSampleDurationMarker):
1921         (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded):
1922         (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers):
1923         (WebCore::MediaRecorderPrivateWriter::clear):
1924         (WebCore::copySampleBufferWithCurrentTimeStamp):
1925         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1926         (WebCore::createAudioFormatDescription):
1927         (WebCore::createAudioSampleBuffer):
1928         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1929         (WebCore::MediaRecorderPrivateWriter::stopRecording):
1930         (WebCore::MediaRecorderPrivateWriter::appendData):
1931         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h.
1932         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added.
1933         (WebCore::VideoSampleBufferCompressor::create):
1934         (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
1935         (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
1936         (WebCore::VideoSampleBufferCompressor::initialize):
1937         (WebCore::VideoSampleBufferCompressor::finish):
1938         (WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
1939         (WebCore::VideoSampleBufferCompressor::initCompressionSession):
1940         (WebCore::VideoSampleBufferCompressor::processSampleBuffer):
1941         (WebCore::VideoSampleBufferCompressor::addSampleBuffer):
1942         (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
1943         (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):
1944
1945 2020-02-06  youenn fablet  <youenn@apple.com>
1946
1947         ServiceWorkerProvider::registerServiceWorkerClients is no longer needed
1948         https://bugs.webkit.org/show_bug.cgi?id=207193
1949
1950         Reviewed by Chris Dumez.
1951
1952         registerServiceWorkerClients is no longer needed since we moved service worker handling to network process.
1953         We no longer have to optimize creating a sw server connection since we piggy back on the webprocess to network process connection.
1954
1955         As can be seen from DocumentLoader, we register service worker clients in DocumentLoader::commitData.
1956         The only documents we do not register are documents for which we exit early due to creatingInitialEmptyDocument check.
1957
1958         registerServiceWorkerClients was used initially when starting the first service worker process.
1959         This is obsolete since now we split service workers according sessionID and registrable domains.
1960
1961         No observable change of behavior if network process does not crash.
1962         Covered by existing service worker tests crashing network process in the middle of processing.
1963
1964         * workers/service/SWClientConnection.cpp:
1965         (WebCore::SWClientConnection::registerServiceWorkerClients):
1966         * workers/service/SWClientConnection.h:
1967         * workers/service/ServiceWorkerProvider.cpp:
1968         * workers/service/ServiceWorkerProvider.h:
1969
1970 2020-02-05  David Kilzer  <ddkilzer@apple.com>
1971
1972         Crash when printing at WebCore: WebCore::FrameView::paintContents
1973         <https://webkit.org/b/207313>
1974         <rdar://problem/56675778>
1975
1976         Reviewed by Brent Fulgham.
1977
1978         * page/PrintContext.cpp:
1979         (WebCore::PrintContext::spoolPage):
1980         (WebCore::PrintContext::spoolRect):
1981         - Add nullptr check for frame.view().  This matches similar
1982           checks in other methods.
1983
1984 2020-02-05  Don Olmstead  <don.olmstead@sony.com>
1985
1986         [PlayStation] Miscellaneous build fixes February 2020 edition
1987         https://bugs.webkit.org/show_bug.cgi?id=207312
1988
1989         Unreviewed build fix.
1990
1991         * accessibility/AccessibilityObject.h: Add missing definition for !ENABLE(ACCESSIBILITY)
1992         (WebCore::AccessibilityObject::detachPlatformWrapper):
1993         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1994         * platform/graphics/cairo/ImageBufferCairo.cpp: Add missing include
1995
1996 2020-02-05  Fujii Hironori  <Hironori.Fujii@sony.com>
1997
1998         Unreviewed build fix for Windows ports since r255875
1999         https://bugs.webkit.org/show_bug.cgi?id=207073
2000         <rdar://problem/59168065>
2001
2002         WEBCORE_TESTSUPPORT_EXPORT should be used only for WebCoreTestSupport, not for WebCore
2003         See also Bug 203876.
2004
2005         * storage/StorageNamespaceProvider.h: Replaced WEBCORE_TESTSUPPORT_EXPORT with WEBCORE_EXPORT.
2006
2007 2020-02-05  Devin Rousso  <drousso@apple.com>
2008
2009         Web Inspector: ensure that `didClearWindowObjectInWorld` is dispatched for the main world first
2010         https://bugs.webkit.org/show_bug.cgi?id=207232
2011
2012         Reviewed by Timothy Hatcher.
2013
2014         It is necessary to order the `DOMWrapperWorld`s because certain callers expect the main
2015         world to be the first item in the list, as they use the main world as an indicator of when
2016         the page is ready to start evaluating JavaScript. For example, Web Inspector waits for the
2017         main world change to clear any injected scripts and debugger/breakpoint state.
2018
2019         * bindings/js/WebCoreJSClientData.cpp:
2020         (WebCore::JSVMClientData::getAllWorlds):
2021
2022 2020-02-05  Andres Gonzalez  <andresg_22@apple.com>
2023
2024         Check for null return from AXIsolatedTree::nodeForID.
2025         https://bugs.webkit.org/show_bug.cgi?id=207300
2026
2027         Reviewed by Chris Fleizach.
2028
2029         - As the IsolatedTree is updated, AXIsolatedTree::nodeForID may return
2030         nullptr for objects that have been removed from the tree. Thus,
2031         IsolatedObjects must check the returned value when updating children
2032         and any other operations involving cached IDs.
2033         - Tidying up use of auto on for and if statements.
2034
2035         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2036         (WebCore::AXIsolatedObject::detachRemoteParts):
2037         (WebCore::AXIsolatedObject::children):
2038         (WebCore::AXIsolatedObject::accessibilityText const):
2039         (WebCore::AXIsolatedObject::insertMathPairs):
2040         (WebCore::AXIsolatedObject::objectAttributeValue const):
2041         (WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
2042         (WebCore::AXIsolatedObject::tree const): Deleted, moved inline to the header.
2043         * accessibility/isolatedtree/AXIsolatedObject.h:
2044
2045 2020-02-05  Jer Noble  <jer.noble@apple.com>
2046
2047         Adopt MTOverrideShouldPlayHDRVideo()
2048         https://bugs.webkit.org/show_bug.cgi?id=207275
2049         <rdar://problem/58837093>
2050
2051         Reviewed by Eric Carlson.
2052
2053         * platform/PlatformScreen.h:
2054         * platform/mac/PlatformScreenMac.mm:
2055         (WebCore::setShouldOverrideScreenSupportsHighDynamicRange):
2056
2057 2020-02-05  Chris Dumez  <cdumez@apple.com>
2058
2059         [IPC hardening] Fail IPC decoding of invalid ClientOrigin objects
2060         https://bugs.webkit.org/show_bug.cgi?id=207305
2061         <rdar://problem/58797651>
2062
2063         Reviewed by Brent Fulgham.
2064
2065         Fail IPC decoding of invalid ClientOrigin objects (empty ClientOrigin or deleted value in a HashMap).
2066
2067         * page/ClientOrigin.h:
2068         (WebCore::ClientOrigin::decode):
2069         * page/SecurityOriginData.h:
2070         (WebCore::SecurityOriginData::decode):
2071
2072 2020-02-05  Chris Dumez  <cdumez@apple.com>
2073
2074         Regression(r248734) StorageAreaMap objects are getting leaked
2075         https://bugs.webkit.org/show_bug.cgi?id=207073
2076         <rdar://problem/59168065>
2077
2078         Reviewed by Darin Adler.
2079
2080         Add test infrastructure for testing this change.
2081
2082         Test: http/tests/storage/storage-map-leaking.html
2083
2084         * storage/StorageNamespace.h:
2085         (WebCore::StorageNamespace::storageAreaMapCountForTesting const):
2086         * storage/StorageNamespaceProvider.h:
2087         * testing/Internals.cpp:
2088         (WebCore::Internals::storageAreaMapCount const):
2089         * testing/Internals.h:
2090         * testing/Internals.idl:
2091
2092 2020-02-05  Alex Christensen  <achristensen@webkit.org>
2093
2094         Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache
2095         https://bugs.webkit.org/show_bug.cgi?id=207207
2096
2097         Reviewed by Chris Dumez.
2098
2099         * platform/network/ResourceResponseBase.cpp:
2100         (WebCore::ResourceResponseBase::includeCertificateInfo const):
2101         * platform/network/ResourceResponseBase.h:
2102         (WebCore::ResourceResponseBase::usedLegacyTLS const):
2103         (WebCore::ResourceResponseBase::encode const):
2104         (WebCore::ResourceResponseBase::decode):
2105
2106 2020-02-05  Chris Fleizach  <cfleizach@apple.com>
2107
2108         AX: replaceTextInRange should handle when called on the WebArea element
2109         https://bugs.webkit.org/show_bug.cgi?id=207242
2110         <rdar://problem/59173196>
2111
2112         Reviewed by Zalan Bujtas.
2113
2114         Test: accessibility/mac/replace-text-with-range-on-webarea-element.html
2115
2116         * accessibility/AccessibilityObject.cpp:
2117         (WebCore::AccessibilityObject::replaceTextInRange):
2118
2119 2020-02-05  Michael Catanzaro  <mcatanzaro@gnome.org>
2120
2121         [GTK] Cannot perform most local loads with sandbox enabled
2122         https://bugs.webkit.org/show_bug.cgi?id=202071
2123
2124         Reviewed by Carlos Garcia Campos.
2125
2126         SecurityOrigin::canDisplay is improperly checking whether the target file URL points to a
2127         file on the same "volume" (mount point) as the source file. That can't happen here because
2128         this code is running in the web process, but only the network process has access to the
2129         unsandboxed filesystem. This code can only check whether the target file exists within the
2130         sandbox's mount namespace, but that's not what we want to do because we're not going to load
2131         that file, we're going to ask the network process to load the file with the same path
2132         outside the mount namespace.
2133
2134         We can probably live without this check. But if bringing it back is desired, it has to be
2135         done someplace totally different, in network process code rather than web process code.
2136
2137         * page/SecurityOrigin.cpp:
2138         (WebCore::SecurityOrigin::canDisplay const):
2139
2140 2020-02-05  Commit Queue  <commit-queue@webkit.org>
2141
2142         Unreviewed, rolling out r255818.
2143         https://bugs.webkit.org/show_bug.cgi?id=207270
2144
2145         It is breaking some Mac builds (Requested by youenn on
2146         #webkit).
2147
2148         Reverted changeset:
2149
2150         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
2151         https://bugs.webkit.org/show_bug.cgi?id=206582
2152         https://trac.webkit.org/changeset/255818
2153
2154 2020-02-05  youenn fablet  <youenn@apple.com>
2155
2156         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
2157         https://bugs.webkit.org/show_bug.cgi?id=206582
2158         <rdar://problem/58985368>
2159
2160         Reviewed by Eric Carlson.
2161
2162         AVAssetWriterDelegate allows to grab recorded data whenever wanted.
2163         This delegate requires passing compressed samples to AVAssetWriter.
2164         Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
2165         These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor.
2166         They support AAC and H264 so far and should be further improved to support more encoding options.
2167
2168         Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere.
2169         The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors.
2170         It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter.
2171         The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data.
2172
2173         Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed.
2174         Therefore data should not be requested too fast to get adequate video compression.
2175
2176         Covered by existing tests.
2177
2178         * Modules/mediarecorder/MediaRecorderProvider.cpp:
2179         (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
2180         * WebCore.xcodeproj/project.pbxproj:
2181         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
2182         (WebCore::MediaRecorderPrivateAVFImpl::create):
2183         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
2184         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added.
2185         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added.
2186         (WebCore::AudioSampleBufferCompressor::create):
2187         (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
2188         (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
2189         (WebCore::AudioSampleBufferCompressor::initialize):
2190         (WebCore::AudioSampleBufferCompressor::finish):
2191         (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
2192         (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
2193         (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
2194         (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
2195         (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
2196         (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
2197         (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
2198         (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
2199         (WebCore::AudioSampleBufferCompressor::processSampleBuffer):
2200         (WebCore::AudioSampleBufferCompressor::addSampleBuffer):
2201         (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
2202         (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
2203         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2204         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2205         (-[WebAVAssetWriterDelegate initWithWriter:]):
2206         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]):
2207         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]):
2208         (-[WebAVAssetWriterDelegate close]):
2209         (WebCore::MediaRecorderPrivateWriter::create):
2210         (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback):
2211         (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback):
2212         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
2213         (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
2214         (WebCore::MediaRecorderPrivateWriter::initialize):
2215         (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
2216         (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
2217         (WebCore::MediaRecorderPrivateWriter::startAssetWriter):
2218         (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
2219         (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
2220         (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers):
2221         (WebCore::appendEndsPreviousSampleDurationMarker):
2222         (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded):
2223         (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers):
2224         (WebCore::MediaRecorderPrivateWriter::clear):
2225         (WebCore::copySampleBufferWithCurrentTimeStamp):
2226         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2227         (WebCore::createAudioFormatDescription):
2228         (WebCore::createAudioSampleBuffer):
2229         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
2230         (WebCore::MediaRecorderPrivateWriter::stopRecording):
2231         (WebCore::MediaRecorderPrivateWriter::appendData):
2232         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h.
2233         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added.
2234         (WebCore::VideoSampleBufferCompressor::create):
2235         (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
2236         (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
2237         (WebCore::VideoSampleBufferCompressor::initialize):
2238         (WebCore::VideoSampleBufferCompressor::finish):
2239         (WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
2240         (WebCore::VideoSampleBufferCompressor::initCompressionSession):
2241         (WebCore::VideoSampleBufferCompressor::processSampleBuffer):
2242         (WebCore::VideoSampleBufferCompressor::addSampleBuffer):
2243         (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
2244         (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):
2245
2246 2020-02-05  Chris Dumez  <cdumez@apple.com>
2247
2248         Unreviewed iOS build fix.
2249
2250         * rendering/RenderThemeIOS.h:
2251
2252 2020-02-05  Antoine Quint  <graouts@apple.com>
2253
2254         [Web Animations] Canceling an accelerated animation before it was committed does not prevent it from playing
2255         https://bugs.webkit.org/show_bug.cgi?id=207253
2256         <rdar://problem/59143624>
2257
2258         Reviewed by Antti Koivisto.
2259
2260         Test: webanimations/accelerated-animation-canceled-before-commit.html
2261
2262         Merely checking whether an accelerated animation is running prior to enqueuing an action to cancel it is not sufficient
2263         since there could be an uncommitted change to start it upon the next animation frame. The same logic would need to apply
2264         in other situations where the playback state changes for a potentially in-flight animation. 
2265
2266         * animation/KeyframeEffect.cpp:
2267         (WebCore::KeyframeEffect::animationDidSeek):
2268         (WebCore::KeyframeEffect::animationWasCanceled):
2269         (WebCore::KeyframeEffect::willChangeRenderer):
2270         (WebCore::KeyframeEffect::animationSuspensionStateDidChange):
2271
2272 2020-02-05  Philippe Normand  <philn@igalia.com>
2273
2274         [GStreamer] Client-side video rendering doesn't fallback to internal compositing
2275         https://bugs.webkit.org/show_bug.cgi?id=207208
2276
2277         Reviewed by Xabier Rodriguez-Calvar and Žan Doberšek.
2278
2279         Refactor the default video composition code into a self-contained
2280         closure and invoke it if the video frame holder failed to export
2281         the EGLImage to a valid DMABuf.
2282
2283         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2284         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
2285         (WebCore::GstVideoFrameHolder::hasDMABuf const):
2286         (WebCore::MediaPlayerPrivateGStreamer::pushTextureToCompositor):
2287
2288 2020-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2289
2290         [WPE] Add support for rendering menu list buttons
2291         https://bugs.webkit.org/show_bug.cgi?id=207196
2292
2293         Reviewed by Žan Doberšek.
2294
2295         * platform/wpe/RenderThemeWPE.cpp:
2296         (WebCore::RenderThemeWPE::supportsFocusRing const):
2297         (WebCore::RenderThemeWPE::adjustTextFieldStyle const):
2298         (WebCore::RenderThemeWPE::paintTextField):
2299         (WebCore::RenderThemeWPE::paintTextArea):
2300         (WebCore::RenderThemeWPE::adjustSearchFieldStyle const):
2301         (WebCore::RenderThemeWPE::paintSearchField):
2302         (WebCore::paintFocus):
2303         (WebCore::paintArrow):
2304         (WebCore::RenderThemeWPE::popupInternalPaddingBox const):
2305         * platform/wpe/RenderThemeWPE.h:
2306
2307 2020-02-01  Darin Adler  <darin@apple.com>
2308
2309         Replace RGBA32 typedef with a class to improve type safety
2310         https://bugs.webkit.org/show_bug.cgi?id=206862
2311
2312         Reviewed by Sam Weinig.
2313
2314         * Headers.cmake: Remove RGBColor.h.
2315         * Sources.txt: Remove RBGColor.cpp.
2316         * WebCore.xcodeproj/project.pbxproj: Remove RGBColor.h and RGBColor.cpp.
2317
2318         * css/CSSPrimitiveValue.cpp: Removed include of RGBColor.h.
2319         (WebCore::CSSPrimitiveValue::getCounterValue const): Deleted.
2320         (WebCore::CSSPrimitiveValue::getRectValue const): Deleted.
2321         (WebCore::CSSPrimitiveValue::getRGBColorValue const): Deleted.
2322         * css/CSSPrimitiveValue.h: Updated for the above.
2323
2324         * css/DeprecatedCSSOMPrimitiveValue.cpp:
2325         (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue const): Use
2326         CSSPrimitiveValue::counterValue.
2327         (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue const): Use
2328         CSSPrimitiveValue::rectValue.
2329         (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue const): USe
2330         CSSPrimitiveValue::isRGBColor and CSSPrimitiveValue::color.
2331
2332         * css/DeprecatedCSSOMRGBColor.h: Store a Color instead of an RGBA32.
2333         Take a Color argument instead of a RGBColor argument. Refactored to
2334         use a createWrapper template function member to tighten the code.
2335
2336         * css/RGBColor.cpp: Removed.
2337         * css/RGBColor.h: Removed.
2338
2339         * css/StyleColor.cpp:
2340         (WebCore::StyleColor::colorFromKeyword): Explicitly convert to SimpleColor
2341         rather than relying on initializing a Color from an integer ARGB value.
2342
2343         * editing/cocoa/HTMLConverter.mm: Removed include of RGBColor.h.
2344
2345         * inspector/InspectorOverlay.cpp:
2346         (WebCore::drawOutlinedQuadWithClip): Use the Color constructor instead of
2347         Color::createUnchecked.
2348
2349         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2350         (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo): Use
2351         explicit SimpleColor rather than relying on initializing a Color from an
2352         integer ARGB value.
2353
2354         * platform/graphics/Color.cpp: Use constexpr for constant colors.
2355         (WebCore::makeRGB): Implement by calling makeRGBA.
2356         (WebCore::makeRGBA): Use an explicit argument list to call the
2357         SimpleColor constructor.
2358         (WebCore::makeRGBA32FromFloats): Implement by calling makeRGBA.
2359         (WebCore::colorWithOverrideAlpha): Use an explicit argument list to call
2360         the SimpleColor constructor.
2361         (WebCore::parseHexColorInternal): Ditto.
2362         (WebCore::Color::Color): Removed unneeded code to set the color
2363         to invalid, since that's already the default for a new Color object.
2364         Also tweak the logic a bit and add explicit argument list for the
2365         SimpleColor constructor.
2366         (WebCore::SimpleColor::serializationForHTML const): Added. Factored out of
2367         the Color::serialized function.
2368         (WebCore::Color::serialized const): Changed to call serializationForHTML.
2369         (WebCore::fractionDigitsForFractionalAlphaValue): Renamed slightly shorter.
2370         (WebCore::SimpleColor::serializationForCSS const): Added. Factored out of
2371         the Color::cssText function.
2372         (WebCore::Color::cssText const): Changed to call serializationForCSS.
2373         (WebCore::RGBA32::serializationForRenderTreeAsText const): Added.
2374         Factored out of nameForRenderTreeAsText.
2375         (WebCore::Color::nameForRenderTreeAsText const): Changed to call
2376         serializationForRenderTreeAsText.
2377         (WebCore::colorFromPremultipliedARGB): Updated to use the SimpleColor
2378         member functions instead of the red/green/blue/alphaChannel functions.
2379         (WebCore::blend): Use Color::transparent for blending where the old
2380         code used 0 and relied on how that is converted to a Color.
2381
2382         * platform/graphics/Color.h: Replaced the RGBA32 typedef and the
2383         RGBA class with a new class named SimpleColor. Deleted the four
2384         red/green/blue/alphaChannel functions, the Color constructor that
2385         takes and RGBA, and the Color::createUnchecked function. Changed
2386         the color constants to all be constexpr. Moved the inline function
2387         definitions until after everything is delcared.
2388
2389         * platform/graphics/ImageBackingStore.h:
2390         (WebCore::ImageBackingStore::setSize): Use uint32_t instead of RGBA32.
2391         (WebCore::ImageBackingStore::clear): Ditto.
2392         (WebCore::ImageBackingStore::clearRect): Ditto.
2393         (WebCore::ImageBackingStore::fillRect): Ditto.
2394         (WebCore::ImageBackingStore::repeatFirstRow): Ditto.
2395         (WebCore::ImageBackingStore::pixelAt const): Ditto.
2396         (WebCore::ImageBackingStore::setPixel): Ditto.
2397         (WebCore::ImageBackingStore::blendPixel): Ditto. Convert to and from
2398         SimpleColor so we can use various functions that operate on that type.
2399         Use the isVisible and red/green/blue/alphaComponent member functions.
2400         (WebCore::ImageBackingStore::ImageBackingStore): Ditto.
2401         (WebCore::ImageBackingStore::pixelValue const): Use Color::transparent
2402         instead of returning a 0 and relying on how that is converted to a Color.
2403
2404         * platform/graphics/ImageFrame.h: Removed include of ImageBackingStore.h.
2405         * platform/graphics/ImageSource.h: Added forward delaration of SharedBuffer.
2406
2407         * platform/graphics/cairo/ImageBufferCairo.cpp:
2408         (WebCore::ImageBuffer::platformTransformColorSpace): Call value() to
2409         convert RGBA32, which is now a class, to an 32-bit ARGB integer.
2410
2411         * platform/graphics/cg/ColorCG.cpp:
2412         (WebCore::cachedCGColor): Use constexpr SimpleColor::value function to
2413         switch on a SimpleColor.
2414
2415         * platform/graphics/mac/ColorMac.mm:
2416         (WebCore::oldAquaFocusRingColor): Use an explicit SimpleColor to turn a
2417         hex integer into a Color without relying on implicit conversion.
2418
2419         * platform/graphics/win/ColorDirect2D.cpp:
2420         (WebCore::Color::operator D2D1_COLOR_F const): Use value() to get the color
2421         integer, just to keep this working. Probably needs a better implementation
2422         at some point.
2423
2424         * platform/image-decoders/png/PNGImageDecoder.cpp:
2425         (WebCore::PNGImageDecoder::rowAvailable): Don't use makeRGB any more,
2426         write the expression out here instead. More efficient anyway since these
2427         are already single bytes.
2428
2429         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2430         (WebCore::defaultDevices):  Use an explicit SimpleColor to turn a
2431         hex integer into a Color without relying on implicit conversion.
2432         * platform/mock/MockRealtimeVideoSource.cpp:
2433         (WebCore::MockRealtimeVideoSource::drawBoxes): Ditto. Also use a modern
2434         for loop instead of indexing.
2435         * platform/mock/ScrollbarThemeMock.cpp:
2436         (WebCore::ScrollbarThemeMock::paintTrackBackground): Ditto.
2437         * rendering/RenderObject.cpp:
2438         (WebCore::RenderObject::calculateBorderStyleColor): Ditto.
2439         * rendering/RenderTheme.cpp:
2440         (WebCore::RenderTheme::systemColor const): Ditto. Also used named colors.
2441         * rendering/RenderThemeMac.mm:
2442         (WebCore::RenderThemeMac::systemColor const): Ditto.
2443
2444         * rendering/RenderTreeAsText.cpp:
2445         (WebCore::RenderTreeAsText::writeRenderObject): Added checks against
2446         Color::transparent instead of converting to an integer and checking
2447         against 0. Removed unneeded isValid checks, since invalid color's ARGB
2448         value is Color::transparent.
2449
2450 2020-02-04  Darin Adler  <darin@apple.com>
2451
2452         Remove NSKeyedArchiverSPI.h now that WebKit only uses API
2453         https://bugs.webkit.org/show_bug.cgi?id=207203
2454
2455         Reviewed by Anders Carlsson.
2456
2457         * editing/cocoa/EditorCocoa.mm:
2458         (WebCore::archivedDataForAttributedString): Removed NSKeyedArchiverSPI.h header and use
2459         NSKeyedArchiver methods directly instead of through WebKit functions.
2460         * loader/archive/cf/LegacyWebArchiveMac.mm:
2461         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
2462         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
2463         * platform/ios/PlatformPasteboardIOS.mm:
2464         (WebCore::PlatformPasteboard::write): Ditto.
2465         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto. Also added
2466         a missing type check when unarchiving a dictionary.
2467         (WebCore::createItemProviderRegistrationList): Ditto. Also added a missing null check.
2468         * testing/cocoa/WebArchiveDumpSupport.mm:
2469         (WebCoreTestSupport::createCFURLResponseFromResponseData): Ditto.
2470
2471 2020-02-04  Alex Christensen  <achristensen@webkit.org>
2472
2473         Fix internal build after r255709
2474         https://bugs.webkit.org/show_bug.cgi?id=207231
2475
2476         * platform/ios/WebItemProviderPasteboard.h:
2477         Revert part of the original change.
2478
2479 2020-02-04  Adrian Perez de Castro  <aperez@igalia.com>
2480
2481         Non-unified build fixes early February 2020 edition
2482         https://bugs.webkit.org/show_bug.cgi?id=207227
2483
2484         Reviewed by Don Olmstead.
2485
2486         No new tests needed.
2487
2488         * accessibility/atk/AccessibilityObjectAtk.cpp: Add missing inclusion of WebKitAccessible.h
2489         * inspector/agents/InspectorAnimationAgent.cpp: Add issing inclusions of JSExecState.h and
2490         JavaScriptCore/InjectedScriptManager.h
2491         * style/MatchedDeclarationsCache.cpp: Add missing inclusion of FontCascade.h
2492
2493 2020-02-04  Alex Christensen  <achristensen@webkit.org>
2494
2495         Fix Mac CMake build
2496         https://bugs.webkit.org/show_bug.cgi?id=207231
2497
2498         * PlatformMac.cmake:
2499         * platform/ios/WebItemProviderPasteboard.h:
2500
2501 2020-02-04  Rob Buis  <rbuis@igalia.com>
2502
2503         Tighten up stylesheet loading
2504         https://bugs.webkit.org/show_bug.cgi?id=189913
2505
2506         Reviewed by Antti Koivisto.
2507
2508         Content-Type metadata for link stylesheet is determined using MIME
2509         sniffing[1]. This can result in no Content-Type metadata.
2510         If there is no Content-Type metadata, but the external resource link
2511         type has a default type defined, then the user agent must assume that
2512         the resource is of that type [2]. For link stylesheet the default is
2513         text/css. This means invalid MIME type will default to text/css and
2514         load and valid MIME types other than text/css will result in load error.
2515
2516         [1] https://mimesniff.spec.whatwg.org/
2517         [2] https://html.spec.whatwg.org/multipage/semantics.html#fetch-and-process-the-linked-resource
2518
2519         Tests: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-load-error-events.html
2520                imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-load-error-events.https.html
2521                imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01.html
2522                imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-limited-quirks.html
2523                imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-quirks.html
2524
2525         * css/StyleSheetContents.cpp:
2526         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2527         * css/StyleSheetContents.h:
2528         * html/HTMLLinkElement.cpp:
2529         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2530         * loader/cache/CachedCSSStyleSheet.cpp:
2531         (WebCore::CachedCSSStyleSheet::canUseSheet const):
2532
2533 2020-02-04  youenn fablet  <youenn@apple.com>
2534
2535         NetworkProcess should be notified by UIProcess when its service worker process connection should be on
2536         https://bugs.webkit.org/show_bug.cgi?id=207122
2537         <rdar://problem/59089780>
2538
2539         Reviewed by Chris Dumez.
2540
2541         Add a completion handler to the create context connection callback.
2542         This is called when the context connection should have been created.
2543         In case there is a context connection, completion handler does nothing.
2544         Otherwise, SWServer will retry creating a context connection if needed.
2545
2546         The pending connection map entry is now removed in the completion handler instead of addContextConnection.
2547         This ensures that only one connection request is sent by network process at a time.
2548
2549         Add extra logging to monitor creation of a context connection.
2550
2551         * workers/service/context/SWContextManager.h:
2552         * workers/service/server/SWServer.cpp:
2553         (WebCore::SWServer::addContextConnection):
2554         (WebCore::SWServer::removeContextConnection):
2555         (WebCore::SWServer::createContextConnectionFinished):
2556         * workers/service/server/SWServer.h:
2557
2558 2020-02-04  youenn fablet  <youenn@apple.com>
2559
2560         Check for callback being null in Notification.requestPermission
2561         https://bugs.webkit.org/show_bug.cgi?id=207192
2562         <rdar://problem/59130804>
2563
2564         Reviewed by Chris Dumez.
2565
2566         Covered by updated test.
2567
2568         * Modules/notifications/Notification.cpp:
2569         (WebCore::Notification::requestPermission):
2570         Callback can be null if no function is given to requestPermission.
2571         Check this before calling the callback.
2572
2573 2020-02-04  Pablo Saavedra  <psaavedra@igalia.com>
2574
2575         Build error with -DENABLE_VIDEO=OFF after r253923
2576         https://bugs.webkit.org/show_bug.cgi?id=207101
2577
2578         Reviewed by Youenn Fablet.
2579
2580         No new tests, only build error fix up
2581
2582         * page/Page.cpp:
2583         (WebCore::Page::forEachMediaElement):
2584
2585 2020-02-04  Antti Koivisto  <antti@apple.com>
2586
2587         CSS Rules with the same selector from several large stylesheets are applied in the wrong order
2588         https://bugs.webkit.org/show_bug.cgi?id=204687
2589         <rdar://problem/57522566>
2590
2591         Reviewed by Zalan Bujtas.
2592
2593         Original test by Anton Khlynovskiy.
2594
2595         Test: fast/css/many-rules.html
2596
2597         * style/RuleData.h:
2598
2599         We overflow the 18 bit m_position field with > 256k CSS rules, confusing the rule order.
2600         Since we have unused bits it costs nothing to increase the field size to 22 bits.
2601
2602         4M rules should be enough for anybody.
2603
2604 2020-02-04  Ross Kirsling  <ross.kirsling@sony.com>
2605
2606         [CMake] Add Cairo::Cairo target
2607         https://bugs.webkit.org/show_bug.cgi?id=207159
2608
2609         Reviewed by Konstantin Tokarev.
2610
2611         * PlatformWinCairo.cmake:
2612         * platform/Cairo.cmake:
2613
2614 2020-02-04  youenn fablet  <youenn@apple.com>
2615
2616         MediaDevices should handle changes of iframe allow attribute value
2617         https://bugs.webkit.org/show_bug.cgi?id=207112
2618
2619         Reviewed by Eric Carlson.
2620
2621         MediaDevices was computing whether it could access camera or microphone at creation time.
2622         Since the iframe allow attribute can be modified, we cannot do that.
2623         Instead, we get the feature policy everytime this is needed.
2624
2625         Refactor code to use the newly added routine to check for feature policy.
2626         Update logging to give origin and allow attribute value of the frame that fail the feature policy check.
2627
2628         Test: http/tests/webrtc/enumerateDevicesInFrames.html
2629
2630         * Modules/mediastream/MediaDevices.cpp:
2631         (WebCore::MediaDevices::MediaDevices):
2632         (WebCore::MediaDevices::refreshDevices):
2633         (WebCore::MediaDevices::enumerateDevices):
2634         (WebCore::MediaDevices::listenForDeviceChanges):
2635         * Modules/mediastream/MediaDevices.h:
2636         * Modules/mediastream/UserMediaController.cpp:
2637         (WebCore::UserMediaController::logGetUserMediaDenial):
2638         (WebCore::UserMediaController::logGetDisplayMediaDenial):
2639         (WebCore::UserMediaController::logEnumerateDevicesDenial):
2640         * Modules/mediastream/UserMediaController.h:
2641         * Modules/mediastream/UserMediaRequest.cpp:
2642         (WebCore::UserMediaRequest::start):
2643         * html/FeaturePolicy.cpp:
2644         (WebCore::policyTypeName):
2645         (WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners):
2646         * html/FeaturePolicy.h:
2647         * page/DOMWindow.cpp:
2648         (WebCore::DOMWindow::printErrorMessage const):
2649         * page/DOMWindow.h:
2650
2651 2020-02-03  Fujii Hironori  <Hironori.Fujii@sony.com>
2652
2653         [WinCairo][curl][Clang] error: member access into incomplete type 'WebCore::SynchronousLoaderMessageQueue' in ~CurlRequest
2654         https://bugs.webkit.org/show_bug.cgi?id=207187
2655
2656         Unreviewed build fix for clang-cl builds of WinCairo port.
2657
2658         SynchronousLoaderMessageQueue couldn't be destructed in inlined
2659         ~CurlRequest because it's a incomplete type. Moved the dtor from
2660         CurlRequest.h to CurlRequest.cpp.
2661
2662         * platform/network/curl/CurlRequest.cpp:
2663         * platform/network/curl/CurlRequest.h:
2664
2665 2020-02-03  Antti Koivisto  <antti@apple.com>
2666
2667         Accelerated animations freeze on render tree rebuild
2668         https://bugs.webkit.org/show_bug.cgi?id=201048
2669         <rdar://problem/54612621>
2670
2671         Reviewed by Antoine Quint.
2672
2673         If there is an accelerated animation in progress for a renderer and the render tree is rebuild the animation
2674         does not continue with the new renderer.
2675
2676         To fix, make sure that the animation leaves the accelerated state when the renderer is removed. The new renderer
2677         will then become accelerated automatically.
2678
2679         Original test case by Tim Guan-tin Chien.
2680
2681         Test: webanimations/accelerated-animation-renderer-change.html
2682
2683         * animation/AnimationTimeline.cpp:
2684         (WebCore::AnimationTimeline::willChangeRendererForElement):
2685         * animation/AnimationTimeline.h:
2686         * animation/KeyframeEffect.cpp:
2687         (WebCore::KeyframeEffect::willChangeRenderer):
2688         * animation/KeyframeEffect.h:
2689         * animation/WebAnimation.cpp:
2690         (WebCore::WebAnimation::willChangeRenderer):
2691         * animation/WebAnimation.h:
2692         * rendering/updating/RenderTreeUpdater.cpp:
2693         (WebCore::RenderTreeUpdater::tearDownRenderers):
2694
2695 2020-02-03  Andres Gonzalez  <andresg_22@apple.com>
2696
2697         [WebAccessibilityObjectWrapper detach] should detach either the wrapped AXObject or the IsolatedObject but not both.
2698         https://bugs.webkit.org/show_bug.cgi?id=207178
2699
2700         Reviewed by Chris Fleizach.
2701
2702         Detach either the AXObject or the IsolatedObject depending on the thread that the method is invoed on.
2703
2704         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2705         (-[WebAccessibilityObjectWrapperBase detachAXObject]):
2706         (-[WebAccessibilityObjectWrapperBase detachIsolatedObject]):
2707         (-[WebAccessibilityObjectWrapperBase detach]): Detach one or the other depending on the thread.
2708
2709 2020-02-03  Sihui Liu  <sihui_liu@apple.com>
2710
2711         Crash in WebCore::IDBServer::IDBServer::createIndex
2712         https://bugs.webkit.org/show_bug.cgi?id=207137
2713         <rdar://problem/59096231>
2714
2715         Reviewed by Darin Adler.
2716
2717         Export IDBIndexInfo::isolatedCopy so it can be used in WebKitLegacy framework code.
2718
2719         * Modules/indexeddb/shared/IDBIndexInfo.h:
2720
2721 2020-02-03  Jer Noble  <jer.noble@apple.com>
2722
2723         Unreviewed iOS build fix; lambdas need an arrow operator between the paramaters and return type.
2724
2725         * page/Quirks.cpp:
2726         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2727
2728 2020-02-03  Antoine Quint  <graouts@apple.com>
2729
2730         [Web Animations] Accelerated animations don't run until their natural completion
2731         https://bugs.webkit.org/show_bug.cgi?id=207130
2732         <rdar://problem/59106047>
2733
2734         Reviewed by Dean Jackson.
2735
2736         Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html
2737                webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html
2738
2739         Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
2740         The accelerated animations will be queued for removal in the next animation frame.
2741
2742         * animation/KeyframeEffect.cpp:
2743         (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):
2744         * animation/KeyframeEffect.h:
2745         * animation/KeyframeEffectStack.cpp:
2746         (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):
2747
2748 2020-02-03  Jer Noble  <jer.noble@apple.com>
2749
2750         [iPad] Videos on nhl.com can't be scrubbed when loaded with desktop UA.
2751         https://bugs.webkit.org/show_bug.cgi?id=207058
2752
2753         Reviewed by Darin Adler.
2754
2755         The video controls on nhl.com listen for mousedown/mousemove/mouseup events, not
2756         touchstart/touchmove/touchend events. Until nhl.com can update their site to support touch
2757         events, add them to the quirks list for simplated mouse events.
2758
2759         Drive-by fix: There's no need to re-parse the entire URL and walk through all the cases
2760         every time shouldDispatchSimulatedMouseEvents() is called. Save the results of the initial
2761         pass so that subsequent checks are just a simple bool check.
2762
2763         * page/Quirks.cpp:
2764         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2765
2766 2020-02-03  Jer Noble  <jer.noble@apple.com>
2767
2768         Replace the custom allocator in AudioArray::allocate() with fastAlignedMalloc().
2769         https://bugs.webkit.org/show_bug.cgi?id=206504
2770
2771         Reviewed by Filip Pizlo.
2772
2773         AudioArray wants to have its data aligned at 16-byte boundaries, as that's a requirement for
2774         some of the accelerated math frameworks used by Web Audio. Now that we have fastAlignedMalloc(),
2775         there's no need to use a custom aligned allocator.
2776
2777         Drive-by fixes: clean up the constructors a bit to use the modern initialization syntax.
2778
2779         * platform/audio/AudioArray.h:
2780         (WebCore::AudioArray::AudioArray):
2781         (WebCore::AudioArray::~AudioArray):
2782         (WebCore::AudioArray::allocate):
2783         (WebCore::AudioArray::data):
2784         (WebCore::AudioArray::data const):
2785         (WebCore::AudioArray::alignedAddress): Deleted.
2786
2787 2020-02-03  youenn fablet  <youenn@apple.com>
2788
2789         [ macOS wk2 ] http/tests/media/media-stream/get-display-media-prompt.html is flaky failure
2790         https://bugs.webkit.org/show_bug.cgi?id=206958
2791         <rdar://problem/59003765>
2792
2793         Reviewed by Eric Carlson.
2794
2795         We added a rule to only allow one getDisplayMedia call per gesture.
2796         For that reason, we were storing a pointer to the gesture event and
2797         resetting in case the current gesture event was equal to the stored pointer.
2798         Instead, store a WeakPtr which ensures that if the previous event is destroyed,
2799         the weak pointer will be null and so will not have the same value as the new gesture event.
2800         Covered by existing tests no longer being flaky.
2801
2802         * Modules/mediastream/MediaDevices.cpp:
2803         (WebCore::MediaDevices::computeUserGesturePriviledge):
2804         * Modules/mediastream/MediaDevices.h:
2805         * dom/UserGestureIndicator.h:
2806
2807 2020-02-03  Eric Carlson  <eric.carlson@apple.com>
2808
2809         [macOS] AirPlay sometimes stops after 60 minutes of playback
2810         https://bugs.webkit.org/show_bug.cgi?id=207056
2811         <rdar://problem/53649508>
2812
2813         Reviewed by Jer Noble.
2814
2815         No new tests, this only reproduces when playing to an AirPlay device.
2816
2817         AVPlayerItem.tracks is empty during AirPlay. If AirPlay is activated immediately
2818         after the item is created, as is typically the case when switching from an MSE to
2819         a url based player, MediaPlayerPrivateAVFoundationObjC doesn't know if the AVPlayerItem
2820         has audio or video so the state reported to the WebMediaSessionManager is incorrect.
2821         AirPlay can't actually be active if an item doesn't have audio or video, so always claim
2822         to have both during AirPlay.
2823
2824         Converted WebMediaSessionManager logging from debug-only to runtime to make it easier
2825         to diagnose problems in the future.
2826
2827         * Modules/mediasession/WebMediaSessionManager.cpp:
2828         (WebCore::mediaProducerStateString):
2829         (WebCore::WebMediaSessionLogger::create):
2830         (WebCore::WebMediaSessionLogger::WebMediaSessionLogger):
2831         (WebCore::WebMediaSessionLogger::log const):
2832         (WebCore::WebMediaSessionManager::logger):
2833         (WebCore::WebMediaSessionManager::alwaysOnLoggingAllowed const):
2834         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled):
2835         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState):
2836         (WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup):
2837         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
2838         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
2839         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
2840         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
2841         (WebCore::WebMediaSessionManager::clientStateDidChange):
2842         (WebCore::WebMediaSessionManager::setPlaybackTarget):
2843         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
2844         (WebCore::WebMediaSessionManager::playbackTargetPickerWasDismissed):
2845         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients):
2846         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
2847         (WebCore::WebMediaSessionManager::configureWatchdogTimer):
2848         (WebCore::WebMediaSessionManager::watchdogTimerFired):
2849         (WebCore::ClientState::logAlways const): Deleted.
2850         * Modules/mediasession/WebMediaSessionManager.h:
2851         * Modules/mediasession/WebMediaSessionManagerClient.h:
2852         (WebCore::WebMediaSessionManagerClient::alwaysOnLoggingAllowed):
2853         * html/HTMLMediaElement.cpp:
2854         (WebCore::HTMLMediaElement::mediaState const):
2855         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2856         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2857         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasVideo const):
2858         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAudio const):
2859
2860 2020-02-03  youenn fablet  <youenn@apple.com>
2861
2862         Do not copy feature policy in isFeaturePolicyAllowedByDocumentAndAllOwners
2863         https://bugs.webkit.org/show_bug.cgi?id=207110
2864
2865         Reviewed by Eric Carlson.
2866
2867         Use auto& instead of auto to not copy the feature policy object.
2868         Add some auto* to improve code readability.
2869         No change of behavior.
2870
2871         * html/FeaturePolicy.cpp:
2872         (WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners):
2873
2874 2020-02-03  Zan Dobersek  <zdobersek@igalia.com>
2875
2876         Use std::hypot() where possible
2877         https://bugs.webkit.org/show_bug.cgi?id=198483
2878
2879         Reviewed by Carlos Garcia Campos.
2880
2881         Use std::hypot() where possible, allowing for a possibly more precise
2882         calculation of square roots of sums of two or three square values.
2883
2884         * css/CSSGradientValue.cpp:
2885         (WebCore::horizontalEllipseRadius):
2886         * platform/audio/FFTFrame.cpp:
2887         (WebCore::FFTFrame::print):
2888         * platform/graphics/FloatPoint.cpp:
2889         (WebCore::FloatPoint::length const): Deleted.
2890         * platform/graphics/FloatPoint.h:
2891         (WebCore::FloatPoint::length const):
2892         * platform/graphics/FloatPoint3D.h:
2893         (WebCore::FloatPoint3D::length const):
2894         * platform/graphics/FloatSize.cpp:
2895         (WebCore::FloatSize::diagonalLength const): Deleted.
2896         * platform/graphics/FloatSize.h:
2897         (WebCore::FloatSize::diagonalLength const):
2898         * platform/graphics/GeometryUtilities.cpp:
2899         (WebCore::euclidianDistance):
2900         * platform/graphics/GraphicsContext.cpp:
2901         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
2902         * platform/graphics/PathTraversalState.cpp:
2903         (WebCore::distanceLine):
2904         * platform/graphics/cairo/CairoOperations.cpp:
2905         (WebCore::Cairo::computeLineBoundsAndAntialiasingModeForText):
2906         * platform/graphics/cairo/PathCairo.cpp:
2907         (WebCore::Path::addArcTo):
2908         * platform/graphics/cg/GraphicsContextCG.cpp:
2909         (WebCore::GraphicsContext::roundToDevicePixels):
2910         * platform/graphics/filters/FETurbulence.cpp:
2911         (WebCore::FETurbulence::initPaint):
2912         * platform/graphics/transforms/AffineTransform.cpp:
2913         (WebCore::AffineTransform::xScale const):
2914         (WebCore::AffineTransform::yScale const):
2915         * platform/graphics/transforms/RotateTransformOperation.cpp:
2916         (WebCore::RotateTransformOperation::blend):
2917         * platform/graphics/transforms/TransformationMatrix.cpp:
2918         (WebCore::v3Length):
2919         (WebCore::decompose2):
2920         (WebCore::TransformationMatrix::rotate3d):
2921         * rendering/RenderThemeIOS.mm:
2922         (WebCore::shortened):
2923         * rendering/style/BasicShapes.cpp:
2924         (WebCore::BasicShapeCircle::floatValueForRadiusInBox const):
2925         * rendering/svg/SVGRenderingContext.cpp:
2926         (WebCore::SVGRenderingContext::calculateScreenFontSizeScalingFactor):
2927         * svg/SVGAnimateMotionElement.cpp:
2928         (WebCore::SVGAnimateMotionElement::calculateDistance):
2929         * svg/SVGLengthContext.cpp:
2930         (WebCore::SVGLengthContext::valueForLength):
2931         (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage const):
2932         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits const):
2933         * svg/SVGTransformDistance.cpp:
2934         (WebCore::SVGTransformDistance::distance const):
2935         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2936
2937 2020-02-03  Jonathan Kingston  <jonathan@jooped.co.uk>
2938
2939         Crash in WebKitAccessible
2940         https://bugs.webkit.org/show_bug.cgi?id=207093
2941         <rdar://problem/59088456>
2942
2943         Reviewed by Carlos Garcia Campos.
2944
2945         Fixed a debug crash in WebKitAccessible caused by detatching an accessibility wrapper multiple times.
2946
2947         * accessibility/atk/AccessibilityObjectAtk.cpp:
2948         (WebCore::AccessibilityObject::detachPlatformWrapper):
2949
2950 2020-02-03  Pablo Saavedra  <psaavedra@igalia.com>
2951
2952         Build error with -DENABLE_VIDEO_TRACK=OFF after r255151
2953         https://bugs.webkit.org/show_bug.cgi?id=207097
2954
2955         Reviewed by Antti Koivisto.
2956
2957         No new tests, only build error fix up
2958
2959         * css/CSSSelector.cpp:
2960         (WebCore::CSSSelector::selectorText const):
2961
2962 2020-02-02  Antoine Quint  <graouts@apple.com>
2963
2964         ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) on animations/keyframe-autoclose-brace.html
2965         https://bugs.webkit.org/show_bug.cgi?id=207071
2966         <rdar://problem/59076249>
2967
2968         Reviewed by Dean Jackson.
2969
2970         We cannot add CSSPropertyInvalid to a HashSet<CSSPropertyID>, because it triggers an ASSERT, and also we shouldn't
2971         because we wouldn't know how to animate that CSS property.
2972
2973         * animation/AnimationTimeline.cpp:
2974         (WebCore::compileTransitionPropertiesInStyle):
2975
2976 2020-02-01  Michael Catanzaro  <mcatanzaro@gnome.org>
2977
2978         Silence compiler warnings
2979         https://bugs.webkit.org/show_bug.cgi?id=207015
2980
2981         Reviewed by Darin Adler.
2982
2983         * accessibility/AXObjectCache.cpp:
2984         (WebCore::characterForCharacterOffset): Use IGNORE_CLANG_WARNINGS macros to avoid
2985         warnings when using GCC. GCC freaks out when it doesn't recognize a warning passed to
2986         IGNORE_WARNINGS_BEGIN().
2987         * inspector/InspectorCanvas.cpp:
2988         (WebCore::InspectorCanvas::buildObjectForCanvas): Fix -Wredundant-move
2989         * platform/PasteboardItemInfo.h: Fix -Wredundant-move
2990         (WebCore::PresentationSize::decode):
2991         (WebCore::PasteboardItemInfo::decode):
2992
2993 2020-02-01  Devin Rousso  <drousso@apple.com>
2994
2995         Web Inspector: move the items in the toolbar into the tab bar to save vertical space
2996         https://bugs.webkit.org/show_bug.cgi?id=204627
2997
2998         Reviewed by Timothy Hatcher.
2999
3000         Now that there is no toolbar area, there is nothing obstructing the ability for the window
3001         to be moved around when dragging via the title bar area. As such, we can remove the unused
3002         `InspectorFrontendHost` APIs.
3003
3004         * inspector/InspectorFrontendHost.idl:
3005         * inspector/InspectorFrontendHost.h:
3006         * inspector/InspectorFrontendHost.cpp:
3007         (WebCore::InspectorFrontendHost::startWindowDrag): Deleted.
3008         (WebCore::InspectorFrontendHost::moveWindowBy const): Deleted.
3009
3010         * inspector/InspectorFrontendClient.h:
3011         * inspector/InspectorFrontendClientLocal.h:
3012         * inspector/InspectorFrontendClientLocal.cpp:
3013         (WebCore::InspectorFrontendClientLocal::moveWindowBy): Deleted.
3014
3015 2020-01-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3016
3017         Add support for specifying background colors when setting marked text
3018         https://bugs.webkit.org/show_bug.cgi?id=207065
3019         <rdar://problem/57876140>
3020
3021         Reviewed by Tim Horton.
3022
3023         Add support for rendering custom highlights (background colors) behind marked text in WebCore. To do this, we
3024         plumb a Vector of CompositionHighlights alongside the Vector of CompositionUnderlines to Editor. At paint time,
3025         we then consult this highlight data to determine which ranges of text in the composition should paint using
3026         custom background colors.
3027
3028         Note that in the future, we should consider refactoring both composition underlines and highlights to use the
3029         MarkedText mechanism for decorating ranges of text instead.
3030
3031         Test: editing/input/composition-highlights.html
3032
3033         * Headers.cmake:
3034         * WebCore.xcodeproj/project.pbxproj:
3035         * editing/CompositionHighlight.h: Added.
3036         (WebCore::CompositionHighlight::CompositionHighlight):
3037         (WebCore::CompositionHighlight::encode const):
3038         (WebCore::CompositionHighlight::decode):
3039
3040         Add CompositionHighlight, which represents a range in the composition that should be highlighted with a given
3041         background color.
3042
3043         * editing/Editor.cpp:
3044         (WebCore::Editor::clear):
3045         (WebCore::Editor::setComposition):
3046
3047         Add logic for clearing and updating m_customCompositionHighlights.
3048
3049         * editing/Editor.h:
3050         (WebCore::Editor::compositionUsesCustomHighlights const):
3051         (WebCore::Editor::customCompositionHighlights const):
3052         * rendering/InlineTextBox.cpp:
3053         (WebCore::InlineTextBox::paintCompositionBackground):
3054
3055         If custom composition highlights are given, use those when painting the composition background; otherwise,
3056         default to painting the entire composition range using `Color::compositionFill`.
3057
3058 2020-01-31  Justin Fan  <justin_fan@apple.com>
3059
3060         [WebGL] Revert logging added to investigate 205757
3061         https://bugs.webkit.org/show_bug.cgi?id=207076
3062
3063         Unreviewed.
3064         
3065         Revert https://trac.webkit.org/changeset/255468.
3066
3067         * html/canvas/WebGLRenderingContextBase.cpp:
3068         (WebCore::WebGLRenderingContextBase::bindTexture):
3069         (WebCore::WebGLRenderingContextBase::createTexture):
3070         (WebCore::WebGLRenderingContextBase::getError):
3071         (WebCore::WebGLRenderingContextBase::texSubImage2D):
3072         (WebCore::WebGLRenderingContextBase::texImage2D):
3073         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
3074         (WebCore::GraphicsContextGLOpenGL::texImage2D):
3075         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
3076         (WebCore::GraphicsContextGLOpenGL::bindTexture):
3077         (WebCore::GraphicsContextGLOpenGL::getError):
3078         (WebCore::GraphicsContextGLOpenGL::texSubImage2D):
3079         (WebCore::GraphicsContextGLOpenGL::createTexture):
3080
3081 2020-01-31  Antoine Quint  <graouts@apple.com>
3082
3083         [Web Animations] [WK1] REGRESSION: opacity doesn't animate
3084         https://bugs.webkit.org/show_bug.cgi?id=207044
3085         <rdar://problem/59061225>
3086
3087         Reviewed by Simon Fraser.
3088
3089         Test: webanimations/opacity-animation.html
3090
3091         We failed to animate opacity in WK1 because we made the assumption that just because an animation targets only accelerated properties it would be accelerated
3092         and wouldn't need to be updated as it runs in WebAnimation::timeToNextTick(). This is incorrect, an animation may fail to start or may fail to get a composited
3093         layer, the latter being the case on WK1 because usesCompositing() is false in RenderLayerCompositor::requiresCompositingForAnimation().
3094
3095         We now check that an animation is both only animating accelerated properties and running accelerated to determine that an animation won't need to be updated
3096         until it completes.
3097
3098         * animation/WebAnimation.cpp:
3099         (WebCore::WebAnimation::timeToNextTick const):
3100
3101 2020-01-31  Cathie Chen  <cathiechen@igalia.com>
3102
3103         Asynchronous scrolling of overflow element can enter a recursive loop
3104         https://bugs.webkit.org/show_bug.cgi?id=206884
3105
3106         Reviewed by Frédéric Wang.
3107
3108         After implementing RenderLayer::requestScrollPositionUpdate, there's a recursive loop
3109         while performing asynchronous programmatic scrolling for overflow elements. In order to break
3110         the loop call notifyScrollPositionChanged in updateScrollPositionAfterAsyncScroll instead.
3111
3112         Test: fast/scrolling/ios/programmatic-scroll-element-crash.html
3113
3114         * page/scrolling/AsyncScrollingCoordinator.cpp:
3115         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3116         * rendering/RenderLayer.cpp:
3117         (WebCore::RenderLayer::requestScrollPositionUpdate):
3118         (WebCore::RenderLayer::scrollToOffset):
3119         * rendering/RenderLayer.h:
3120
3121 2020-01-31  Antti Koivisto  <antti@apple.com>
3122
3123         REGRESSION (r240250): Pages using smoothscroll.js can't be scrolled with trackpad
3124         https://bugs.webkit.org/show_bug.cgi?id=207040
3125         <rdar://problem/52712513>
3126
3127         Reviewed by Simon Fraser.
3128
3129         Add a quirk that makes the wheel event listener used by smoothscroll.js passive so it can't prevent scrolling.
3130
3131         This uses the same logic as the Chromium intervention in
3132         https://chromium.googlesource.com/chromium/src/+/b6b13c9cfe64d52a4168d9d8d1ad9bb8f0b46a2a%5E%21/
3133
3134         * bindings/js/JSEventListener.cpp:
3135         (WebCore::JSEventListener::functionName const):
3136         * bindings/js/JSEventListener.h:
3137         * dom/EventTarget.cpp:
3138         (WebCore::EventTarget::addEventListener):
3139         * page/Quirks.cpp:
3140         (WebCore::Quirks::shouldMakeEventListenerPassive const):
3141
3142         Also factor the existing code for making some touch event listeners passive here.
3143
3144         * page/Quirks.h:
3145
3146 2020-01-31  Peng Liu  <peng.liu6@apple.com>
3147
3148         Media controls of the video player on nfl.com are not visible in fullscreen mode (iPad only)
3149         https://bugs.webkit.org/show_bug.cgi?id=207020
3150
3151         Reviewed by Eric Carlson.
3152
3153         Add a quirk to disable the element fullscreen API support for nfl.com on iPads.
3154
3155         * dom/DocumentFullscreen.idl:
3156         * dom/Element.idl:
3157         * page/Quirks.cpp:
3158         (WebCore::Quirks::shouldDisableElementFullscreenQuirk const):
3159         * page/Quirks.h:
3160
3161 2020-01-31  Antti Koivisto  <antti@apple.com>
3162
3163         Regression(r255359): imported/mozilla/svg/svg-integration/clipPath-html-06.xhtml is failing consistently on windows
3164         https://bugs.webkit.org/show_bug.cgi?id=206991
3165         <rdar://problem/59030252>
3166
3167         Reviewed by Antoine Quint.
3168
3169         The previous approach may have still allowed RenderStyles computed with non-current FontCascade in
3170         matched properties caches (because some non-font properties were resolved based on obsolete font information).
3171
3172         This patch takes a more robust approach by simply preventing caching of styles with non-current font.
3173
3174         * dom/Document.h:
3175         (WebCore::Document::fontSelector const):
3176         * platform/graphics/FontCascade.cpp:
3177         (WebCore::FontCascade::isCurrent const):
3178         * platform/graphics/FontCascade.h:
3179         * style/MatchedDeclarationsCache.cpp:
3180         (WebCore::Style::MatchedDeclarationsCache::isCacheable):
3181         * style/StyleBuilderState.cpp:
3182         (WebCore::Style::BuilderState::updateFont):
3183
3184 2020-01-30  Antoine Quint  <graouts@apple.com>
3185
3186         [Web Animations] DocumentTimeline shouldn't suspend itself if hiddenPageCSSAnimationSuspensionEnabled is disabled
3187         https://bugs.webkit.org/show_bug.cgi?id=207014
3188         <rdar://problem/58815952>
3189
3190         Reviewed by Antti Koivisto.
3191
3192         We suspend a timeline upon consutrction if we know that the page is not visible because, unlike CSSAnimationController, the DocumentTimeline is not guaranteed
3193         to be created by the time the Page sets the initial visibility state. This is because DocumentTimeline is created as needed when there are CSS Animations or CSS
3194         Transitions created for the page, or if the content uses any of the Web Animations APIs.
3195
3196         However, the Page::setIsVisibleInternal() function that would call DocumentTimeline::resumeAnimations() at a later time checks whether the hiddenPageCSSAnimationSuspensionEnabled
3197         setting is enabled. So we must respect that setting also when suspending animations in the first place or we risk ending up in a state where we suspend animations
3198         because the page is not visible upon timeline creation, but never resuming animations later due to the hiddenPageCSSAnimationSuspensionEnabled setting being false.
3199
3200         * animation/DocumentTimeline.cpp:
3201         (WebCore::DocumentTimeline::DocumentTimeline):
3202
3203 2020-01-31  Jiewen Tan  <jiewen_tan@apple.com>
3204
3205         REGRESSION: [iOS release] http/tests/security/window-named-proto.html is a flaky timing out
3206         https://bugs.webkit.org/show_bug.cgi?id=206672
3207         <rdar://problem/58838583>
3208
3209         Reviewed by Chris Dumez.
3210
3211         This is a speculative fix to increase the priority of the DataURLDecoder's WorkQueue such that
3212         it is less likely to be preempted.
3213
3214         Covered by existing tests.
3215
3216         * platform/network/DataURLDecoder.cpp:
3217         (WebCore::DataURLDecoder::decodeQueue):
3218
3219 2020-01-30  Said Abou-Hallawa  <said@apple.com>
3220
3221         [iOS] Page throttling reasons are not initialized with the device low power mode
3222         https://bugs.webkit.org/show_bug.cgi?id=206860
3223
3224         Reviewed by Simon Fraser.
3225
3226         Initialize m_throttlingReasons with the device current low power mode in
3227         the constructor of Page.
3228
3229         Add m_throttlingReasonsOverridenForTesting to Page and use it to control
3230         overriding the ThrottlingReasons of m_throttlingReasons.
3231
3232         * page/Page.cpp:
3233         (WebCore::m_deviceOrientationUpdateProvider):
3234         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
3235         (WebCore::Page::handleLowModePowerChange):
3236         (WebCore::Page::isLowPowerModeEnabled const): Deleted.
3237         * page/Page.h:
3238         (WebCore::Page::isLowPowerModeEnabled const):
3239         (WebCore::Page::canUpdateThrottlingReason const):
3240
3241 2020-01-30  Doug Kelly  <dougk@apple.com>
3242
3243         Ensure non-initial values for CSS Font properties
3244         https://bugs.webkit.org/show_bug.cgi?id=206312
3245
3246         Reviewed by Antti Koivisto.
3247
3248         If CSS font properties are currently initial values, set them to a normal value.
3249
3250         * css/CSSFontFaceSet.cpp:
3251         (WebCore::computeFontSelectionRequest):
3252
3253 2020-01-30  Doug Kelly  <dougk@apple.com>
3254
3255         Crash in GraphicsLayerCA::fetchCloneLayers() when setting contents to solid color
3256         https://bugs.webkit.org/show_bug.cgi?id=205530
3257
3258         Reviewed by Ryosuke Niwa.
3259
3260         Change the assertion in fetchCloneLayers() to check for null explicitly to ensure contentsLayer is valid.
3261
3262         * platform/graphics/ca/GraphicsLayerCA.cpp:
3263         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
3264
3265 2020-01-30  Fujii Hironori  <Hironori.Fujii@sony.com>
3266
3267         [Cairo] Use CAIRO_FILTER_BILINEAR for image tile painting with InterpolationQuality::Default
3268         https://bugs.webkit.org/show_bug.cgi?id=201326
3269
3270         Reviewed by Carlos Garcia Campos.
3271
3272         Mac port is using a better image interpolation method for painting
3273         a single image than painting tiled images.
3274
3275         In Cairo port, CAIRO_FILTER_GOOD was used for both cases as
3276         default. CAIRO_FILTER_GOOD is using separable convolution filter
3277         for down-scaling (≤ 0.75 and ≠ 0.5), and bi-linear filter
3278         otherwise. The separable convolution filter is better quality but
3279         quite slower than bi-linear filter.
3280
3281         drawSurface of CairoOperations.cpp has the code to choose a filter
3282         based on InterpolationQuality.
3283         <https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp?rev=254506#L966>
3284
3285         This change copied the code to drawPatternToCairoContext, and
3286         changed it to use CAIRO_FILTER_BILINEAR for
3287         InterpolationQuality::Default.
3288
3289         * platform/graphics/cairo/CairoOperations.cpp:
3290         (WebCore::Cairo::drawPattern):
3291         * platform/graphics/cairo/CairoUtilities.cpp:
3292         (WebCore::drawPatternToCairoContext): Set a filter by calling
3293         cairo_pattern_set_filter based on InterpolationQuality.
3294         * platform/graphics/cairo/CairoUtilities.h: Added a InterpolationQuality argument.
3295
3296 2020-01-30  Ross Kirsling  <ross.kirsling@sony.com>
3297
3298         [CMake] Add SQLite::SQLite3 target
3299         https://bugs.webkit.org/show_bug.cgi?id=207005
3300
3301         Reviewed by Don Olmstead.
3302
3303         * CMakeLists.txt: Use SQLite3 target.
3304         * PlatformPlayStation.cmake: Remove redundant entries.
3305
3306 2020-01-30  Tim Horton  <timothy_horton@apple.com>
3307
3308         Add a quirk to opt Twitter out of the non-overlaid minimized input view
3309         https://bugs.webkit.org/show_bug.cgi?id=207021
3310         <rdar://problem/59016252>
3311
3312         Reviewed by Wenson Hsieh.
3313
3314         * page/Quirks.cpp:
3315         (WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):
3316         Twitter has a content breakpoint that sits immediately between the size
3317         of the Safari content area on a 11" iPad in landscape with the App Banner
3318         visible and the same minus the height of the minimized input view that
3319         we display when using a hardware keyboard. This breakpoint removes the
3320         login field, causing the keyboard to dismiss, the input view to disappear,
3321         and the page to resize to the larger size. This results in a loop,
3322         so we must opt Twitter out of the content-avoiding input view mechanism.
3323
3324 2020-01-30  Justin Fan  <justin_fan@apple.com>
3325
3326         [WebGL] Add logging statements to attempt to catch texture-upload-size.html timeout
3327         https://bugs.webkit.org/show_bug.cgi?id=207006
3328
3329         Unreviewed temporary logging additions for flaky timeout investigation.
3330
3331         * html/canvas/WebGLRenderingContextBase.cpp:
3332         (WebCore::WebGLRenderingContextBase::bindTexture):
3333         (WebCore::WebGLRenderingContextBase::createTexture):
3334         (WebCore::WebGLRenderingContextBase::getError):
3335         (WebCore::WebGLRenderingContextBase::texSubImage2D):
3336         (WebCore::WebGLRenderingContextBase::texImage2D):
3337         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
3338         (WebCore::GraphicsContextGLOpenGL::texImage2D):
3339         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
3340         (WebCore::GraphicsContextGLOpenGL::bindTexture):
3341         (WebCore::GraphicsContextGLOpenGL::getError):
3342         (WebCore::GraphicsContextGLOpenGL::texSubImage2D):
3343         (WebCore::GraphicsContextGLOpenGL::createTexture):
3344
3345 2020-01-30  Per Arne Vollan  <pvollan@apple.com>
3346
3347         [iOS] Issue mach sandbox extension to the frontboard and icon service when the attachment element is enabled
3348         https://bugs.webkit.org/show_bug.cgi?id=205443
3349
3350         Reviewed by Brent Fulgham.
3351
3352         Get focus ring color in the UI process since getting this color will communicate with the frontboard daemon.
3353
3354         Test: fast/sandbox/ios/focus-ring-color.html
3355
3356         * rendering/RenderTheme.h:
3357         * rendering/RenderThemeIOS.h:
3358         * rendering/RenderThemeIOS.mm:
3359         (WebCore::cachedFocusRingColor):
3360         (WebCore::RenderThemeIOS::platformFocusRingColor const):
3361         (WebCore::RenderThemeIOS::setFocusRingColor):
3362         * testing/Internals.cpp:
3363         (WebCore::Internals::focusRingColor):
3364         * testing/Internals.h:
3365         * testing/Internals.idl:
3366
3367 2020-01-30  Jonathan Bedard  <jbedard@apple.com>
3368
3369         PAL: Remove old iOS version macros
3370         https://bugs.webkit.org/show_bug.cgi?id=206905
3371
3372         Reviewed by Darin Adler.
3373
3374         No functional changes, covered by existing tests.
3375
3376         * loader/archive/cf/LegacyWebArchiveMac.mm: Remove USE(SECURE_ARCHIVER_API).
3377         * testing/cocoa/WebArchiveDumpSupport.mm: Ditto.
3378
3379 2020-01-30  Doug Kelly  <dougk@apple.com>
3380
3381         Crash in RenderElement::selectionPseudoStyle with detail element set to display: contents
3382         https://bugs.webkit.org/show_bug.cgi?id=206705
3383
3384         Reviewed by Zalan Bujtas.
3385
3386         Check the element for a valid renderer before calling getUncachedPseudoStyle(), and if the
3387         element is set to "display: contents", walk up to the parent element until we're at the root
3388         or the element is not set to "display: contents".
3389
3390         Test: fast/css/display-contents-detail-selection.html
3391
3392         * rendering/RenderElement.cpp:
3393         (WebCore::RenderElement::selectionPseudoStyle const):
3394
3395 2020-01-30  Ryan Haddad  <ryanhaddad@apple.com>
3396
3397         Unreviewed, rolling out r255424.
3398
3399         Breaks internal builds.
3400
3401         Reverted changeset:
3402
3403         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
3404         https://bugs.webkit.org/show_bug.cgi?id=206582
3405         https://trac.webkit.org/changeset/255424
3406
3407 2020-01-30  Doug Kelly  <dougk@apple.com>
3408
3409         Crash in RenderBlockFlow::adjustLinePositionForPagination() with complex line without root box
3410         https://bugs.webkit.org/show_bug.cgi?id=206610
3411
3412         Reviewed by Zalan Bujtas.