Source/ThirdParty/libwebrtc:
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-06-05  Youenn Fablet  <youenn@apple.com>
2
3         Ad support for media-source stats
4         https://bugs.webkit.org/show_bug.cgi?id=212702
5
6         Reviewed by Eric Carlson.
7
8         Expose 'media-source' stats which come in audio and video flavours.
9         Covered by updated test.
10
11         * Modules/mediastream/RTCStatsReport.h:
12         (WebCore::RTCStatsReport::AudioSourceStats::AudioSourceStats):
13         (WebCore::RTCStatsReport::VideoSourceStats::VideoSourceStats):
14         * Modules/mediastream/RTCStatsReport.idl:
15         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
16         (WebCore::fillRTCRTPStreamStats):
17         (WebCore::fillRTCMediaSourceStats):
18         (WebCore::fillRTCAudioSourceStats):
19         (WebCore::fillRTCVideoSourceStats):
20         (WebCore::initializeRTCStatsReportBackingMap):
21
22 2020-06-04  Sihui Liu  <sihui_liu@apple.com>
23
24         Text manipulation: first and last unit in a paragraph should not contain only excluded tokens
25         https://bugs.webkit.org/show_bug.cgi?id=212759
26
27         Reviewed by Wenson Hsieh.
28
29         In r262398, we literally made text of one Node as the minimum unit for text manipulation. This patches introduce
30         a struct ManipulationUnit for that. Now a paragraph can be represented as multiple ManipulationUnits. When all 
31         tokens in a ManipulationUnit are excluded, it means the ManipulationUnit is excluded and should not be 
32         manipulated. To record ManipulationUnits in a paragraph based on our current implementation, we need to keep the
33         excluded ManipulationUnits surrounded by non-excluded ManipulationUnits, but we can safely remove the leading 
34         and trailing excluded ManipulationUnits. In this case, we can limit the range of paragraph further and thus less
35         text replacement work.
36
37         Covered by existing test.
38
39         * editing/TextManipulationController.cpp:
40         (WebCore::TextManipulationController::parse):
41         (WebCore::TextManipulationController::addItemIfPossible):
42         (WebCore::TextManipulationController::observeParagraphs):
43         * editing/TextManipulationController.h:
44
45 2020-06-04  Peng Liu  <peng.liu6@apple.com>
46
47         A YouTube video gets stuck after rapidly tapping on touchbar’s PIP button
48         https://bugs.webkit.org/show_bug.cgi?id=212729
49
50         Reviewed by Darin Adler.
51
52         Call HTMLVideoElement::setFullscreenMode() instead of HTMLMediaElement::enterFullscreen()
53         and HTMLMediaElement::exitFullscreen() to toggle picture-in-picture mode.
54         HTMLVideoElement::setFullscreenMode() is robust under stress test after r262456.
55
56         Manually tested.
57
58         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
59         (WebCore::PlaybackSessionModelMediaElement::togglePictureInPicture):
60
61 2020-06-04  Commit Queue  <commit-queue@webkit.org>
62
63         Unreviewed, reverting r262583.
64         https://bugs.webkit.org/show_bug.cgi?id=212799
65
66         Internal source code has the same bug, needs to be landed
67         after fixing internal source
68
69         Reverted changeset:
70
71         "DOM constructor should only accept Ref<> / ExceptionOr<Ref<>>
72         for creation to ensure toJSNewlyCreated is always returning
73         object"
74         https://bugs.webkit.org/show_bug.cgi?id=212767
75         https://trac.webkit.org/changeset/262583
76
77 2020-06-04  Zalan Bujtas  <zalan@apple.com>
78
79         HTMLAppletElement::updateWidget should check for renderer after the overlapping test.
80         https://bugs.webkit.org/show_bug.cgi?id=212789
81         <rdar://problem/61854614>
82
83         Reviewed by Simon Fraser.
84
85         createJavaAppletWidget needs to check if the plugin(replacement) is obscured.
86         Since the overlapping test requires up-to-date geometry, it initiates a top level style recalc/layout.
87         We need to check if the apple element still has a renderer after the style recalc.
88
89         * html/HTMLAppletElement.cpp:
90         (WebCore::HTMLAppletElement::updateWidget):
91
92 2020-06-04  Jack Lee  <shihchieh_lee@apple.com>
93
94         Nullptr crash in DeleteSelectionCommand::doApply() when ending position is disconnected.
95         https://bugs.webkit.org/show_bug.cgi?id=212723
96         <rdar://problem/63866653>
97
98         Reviewed by Geoffrey Garen.
99
100         In this test case, while merging paragraphs after deleting a text element, we need call removeNodeAndPruneAncestors()
101         to remove a BR node. However, the ancestor of BR is also removed. Later we try to insert a node at the parent of the
102         removed ancestor in function DeleteSelectionCommand::doApply().
103
104         For now we just check the parentless inserting position and bail out. The proper fix should be re-designing 
105         removeNodeAndPruneAncestors() or select a different inserting position after removeNodeAndPruneAncestors() is called.
106
107         Test: editing/deleting/delete-txt-in-dl-crash.html
108
109         * editing/DeleteSelectionCommand.cpp:
110         (WebCore::DeleteSelectionCommand::doApply):
111
112 2020-06-04  Ross Kirsling  <ross.kirsling@sony.com>
113
114         [PlayStation] Unreviewed revert of build fix. Missing include was not the cause.
115
116         * platform/graphics/ColorUtilities.cpp:
117
118 2020-06-04  Sihui Liu  <sihui_liu@apple.com>
119
120         REGRESSION:(r262398) Text manipulation crashes when content is added
121         https://bugs.webkit.org/show_bug.cgi?id=212785
122
123         Reviewed by Ryosuke Niwa.
124
125         r262398 accidentally removed the bound check on array index and was not caught by existing tests.
126
127         Test: TextManipulation.CompleteTextManipulationFailWhenContentIsAdded
128
129         * editing/TextManipulationController.cpp:
130         (WebCore::TextManipulationController::replace):
131
132 2020-06-04  Ross Kirsling  <ross.kirsling@sony.com>
133
134         [PlayStation] Unreviewed build fix following r262352.
135
136         * platform/graphics/ColorUtilities.cpp:
137
138 2020-06-04  Yusuke Suzuki  <ysuzuki@apple.com>
139
140         DOM constructor should only accept Ref<> / ExceptionOr<Ref<>> for creation to ensure toJSNewlyCreated is always returning object
141         https://bugs.webkit.org/show_bug.cgi?id=212767
142
143         Reviewed by Darin Adler.
144
145         When using toJSNewlyCreated in DOM constructor, we should ensure that this only returns JSObject* (if exception is not happening) to
146         avoid `isObject()` check after that. However AudioContext and ImageData is not following this and can return nullptr from `create` factory
147         function. We should not allow this.
148
149         In this patch,
150
151         1. AudioContext should throw an error instead of returning null. AudioContext had a limit derived from OS, but this limit is reasonable only
152            in Windows. We should insert `OS(WINDOWS)` around this check, and throw an error instead of returning null.
153
154         2. ImageData::create can return nullptr potentially, and it can be converted to null. This is not acceptable for DOM constructor. We should throw
155            an error if we failed to create ImageData.
156
157         3. We inserted static_asserts in CodeGeneratorJS.pm to ensure that XXX::create only returns Ref<> or ExceptionOr<Ref<>>. This ensures that toJSNewlyCreated
158            will return JSObject*.
159
160         * Modules/webaudio/AudioContext.cpp:
161         (WebCore::AudioContext::create):
162         * Modules/webaudio/AudioContext.h:
163         * Modules/webaudio/AudioContext.idl:
164         * bindings/scripts/CodeGeneratorJS.pm:
165         (GenerateConstructorDefinition):
166         * dom/ExceptionOr.h:
167         * html/ImageData.cpp:
168         (WebCore::ImageData::create):
169         * html/ImageData.h:
170         * testing/Internals.cpp:
171         (WebCore::Internals::videoSampleAvailable):
172
173 2020-06-04  Kate Cheney  <katherine_cheney@apple.com>
174
175         REGRESSION (r262212): [ iOS Debug wk2 ] ASSERTION FAILED: !isSynchronous() || !m_synchronousLoadData->delayedReply in WebKit::NetworkResourceLoader
176         https://bugs.webkit.org/show_bug.cgi?id=212678
177         <rdar://problem/63797758>
178
179         Reviewed by Chris Dumez.
180
181         No new tests, this will fix http/tests/xmlhttprequest/access-control-preflight-credential-sync.html.
182
183         Refactor the bundle identifier setters and getters in
184         RuntimeApplicationChecksCocoa.mm so that a separate function sets
185         an override bundle identifier, and clearing the override identifier
186         does not clear the UI process bundle identifier as well. 
187
188         * platform/RuntimeApplicationChecks.h:
189         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
190         (WebCore::bundleIdentifierOverride):
191         (WebCore::bundleIdentifier):
192         (WebCore::applicationBundleIdentifier):
193         (WebCore::setApplicationBundleIdentifier):
194         (WebCore::setApplicationBundleIdentifierOverride):
195         (WebCore::clearApplicationBundleIdentifierTestingOverride):
196         (WebCore::applicationBundleIdentifierOverride): Deleted.
197
198 2020-06-04  Yusuke Suzuki  <ysuzuki@apple.com>
199
200         MessageEvent should tell its memory cost to GC
201         https://bugs.webkit.org/show_bug.cgi?id=203990
202
203         Reviewed by Mark Lam.
204
205         This patch fixes two issues to make MessageEvent's memoryCost working.
206
207         1. MessageEvent does not have memoryCost function. So even if ArrayBuffer etc. is held as a SerializedScriptValue,
208            it does not communicate memory pressure to GC. This patch adds ReportExtraMemoryCost to MessageEvent.idl and memoryCost
209            function to MessageEvent. And we implement SerializedScriptValue::memoryCost function to obtain rough memory cost
210            for SerializedScriptValue.
211
212         2. IDL code generator puts `reportExtraMemoryAllocated` function call in `toJSNewlyCreated`. However, `toJSNewlyCreated`
213            is not always used when creating JS wrapper. For example, JSMessageEvent can be created from toJSNewlyCreated for MessageEvent.
214            But it can be also be created from toJSNewlyCreated for Event through EventFactory. If the latter path is taken, we won't properly
215            report memory cost even if IDL has ReportExtraMemoryCost. In JSC, we put `reportExtraMemoryAllocated` at the end of JSXXX::finishCreation.
216            IDL code should follow this convention.
217
218         * bindings/js/SerializedScriptValue.cpp:
219         (WebCore::SerializedScriptValue::SerializedScriptValue):
220         (WebCore::SerializedScriptValue::computeMemoryCost const):
221         * bindings/js/SerializedScriptValue.h:
222         (WebCore::SerializedScriptValue::memoryCost const):
223         * bindings/scripts/CodeGeneratorJS.pm:
224         (GenerateImplementation):
225         * bindings/scripts/test/JS/JSInterfaceName.cpp:
226         (WebCore::JSInterfaceName::finishCreation):
227         (WebCore::toJSNewlyCreated):
228         * dom/MessageEvent.cpp:
229         (WebCore::MessageEvent::memoryCost const):
230         * dom/MessageEvent.h:
231         * dom/MessageEvent.idl:
232         * html/OffscreenCanvas.h:
233         (WebCore::DetachedOffscreenCanvas::memoryCost const):
234
235 2020-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>
236
237         [macOS] Add a way to override the contact AutoFill button image
238         https://bugs.webkit.org/show_bug.cgi?id=212775
239         <rdar://problem/60381452>
240
241         Reviewed by Tim Horton.
242
243         Rename `SYSTEM_ATTACHMENT_PLACEHOLDER_ICON` to `ALTERNATE_ICONS`, and use it to additionally guard an alternate
244         appearance for the contact AutoFill button icon.
245
246         * css/html.css:
247         (input::-webkit-contacts-auto-fill-button):
248         * rendering/RenderThemeMac.h:
249         * rendering/RenderThemeMac.mm:
250         (WebCore::RenderThemeMac::extraDefaultStyleSheet):
251
252 2020-06-04  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
253
254         Rename BlobLineEndings to EndingType to match the latest spec
255         https://bugs.webkit.org/show_bug.cgi?id=212644
256
257         Reviewed by Sam Weinig.
258
259         By the latest File API spec, the role of `BlobLineEndings` is named as `EndingType`.
260         https://w3c.github.io/FileAPI/#enumdef-endingtype
261
262         * CMakeLists.txt:
263         * DerivedSources-input.xcfilelist:
264         * DerivedSources-output.xcfilelist:
265         * DerivedSources.make:
266         * Headers.cmake:
267         * Sources.txt:
268         * WebCore.xcodeproj/project.pbxproj:
269         * fileapi/BlobBuilder.cpp:
270         (WebCore::BlobBuilder::BlobBuilder):
271         (WebCore::BlobBuilder::append):
272         * fileapi/BlobBuilder.h:
273         * fileapi/BlobPropertyBag.h:
274         * fileapi/BlobPropertyBag.idl:
275         * fileapi/EndingType.h: Renamed from Source/WebCore/fileapi/BlobLineEndings.h.
276         * fileapi/EndingType.idl: Renamed from Source/WebCore/fileapi/BlobLineEndings.idl.
277
278 2020-06-04  Chris Dumez  <cdumez@apple.com>
279
280         [iOS] Validate index parameter in PlatformPasteboard
281         https://bugs.webkit.org/show_bug.cgi?id=212713
282         <rdar://problem/60068765>
283
284         Reviewed by Alex Christensen.
285
286         Follow-up to r262529 to also make sure that the index is not negative after
287         casting to NSInteger.
288
289         * platform/ios/PlatformPasteboardIOS.mm:
290         (WebCore::PlatformPasteboard::readBuffer const):
291         (WebCore::PlatformPasteboard::readString const):
292         (WebCore::PlatformPasteboard::readURL const):
293
294 2020-06-04  Xabier Rodriguez Calvar  <calvaris@igalia.com>
295
296         [EME][GStreamer] cdmProxyAttached does not need to force a bump ref in the signature
297         https://bugs.webkit.org/show_bug.cgi?id=212754
298
299         Reviewed by Philippe Normand.
300
301         cdmProxyAttached is currently receiving a RefPtr<CDMProxy> in the
302         signature, what causes a ref bump when the function is called. A
303         const RefPtr<CDMProxy>& is more suitable cause the reference is
304         already bumped when the CDMProxy assigned in the decryptor
305         attribute.
306
307         No new tests, just a rework.
308
309         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
310         (cdmProxyAttached):
311         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
312
313 2020-06-04  Tim Horton  <timothy_horton@apple.com>
314
315         Work around broken system version macro
316         https://bugs.webkit.org/show_bug.cgi?id=212726
317
318         Reviewed by Dan Bernstein.
319
320         * Configurations/DebugRelease.xcconfig:
321
322 2020-06-04  Andy Estes  <aestes@apple.com>
323
324         [watchOS] Re-enable content filtering in the simulator build
325         https://bugs.webkit.org/show_bug.cgi?id=212711
326         <rdar://problem/63938350>
327
328         Reviewed by Wenson Hsieh.
329
330         * Configurations/FeatureDefines.xcconfig:
331
332 2020-06-04  Zalan Bujtas  <zalan@apple.com>
333
334         Reset fragment line info when the relatively positioned inline box becomes static with block child.
335         https://bugs.webkit.org/show_bug.cgi?id=212724
336         <rdar://problem/62847534>
337
338         Reviewed by Simon Fraser.
339
340         adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded was missing the case when the
341         block container was inside an inline box. It happens when the inline box is relatively positioned while the
342         child block box is absolutely positioned.
343         RenderFragmentedFlow keeps track of the associated root lineboxes in m_lineToFragmentMap.
344         In adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded, when the block is no longer part of the fragment
345         we remove these cached lineboxes from the m_lineToFragmentMap.
346         This patch fixes the case when the cached lineboxes are generated by a child block box.
347
348         * rendering/RenderElement.cpp:
349         (WebCore::RenderElement::adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded):
350
351 2020-06-04  Youenn Fablet  <youenn@apple.com>
352
353         Read MediaPlayerPrivateMediaStreamAVFObjC::m_canEnqueueDisplayLayer after the lock
354         https://bugs.webkit.org/show_bug.cgi?id=212693
355
356         Reviewed by Eric Carlson.
357
358         In case destroyLayers is called and shortly after ensureLayers is also called, the m_canEnqueueDisplayLayer check in enqueueVideoSample
359         might be bypassed. Make sure to lock before checking m_canEnqueueDisplayLayer in enqueueVideoSample.
360         For good measure, set m_canEnqueueDisplayLayer to false after locking in destroyLayers.
361
362         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
363         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
364         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
365
366 2020-06-03  Chris Dumez  <cdumez@apple.com>
367
368         [iOS] Validate index parameter in PlatformPasteboard
369         https://bugs.webkit.org/show_bug.cgi?id=212713
370         <rdar://problem/60068765>
371
372         Reviewed by Wenson Hsieh.
373
374         Validate index parameter in PlatformPasteboard, before calling [NSIndexSet indexSetWithIndex:].
375         Per documentation, index needs to be in the range [0 .. NSNotFound-1].
376
377         * platform/ios/PlatformPasteboardIOS.mm:
378         (WebCore::PlatformPasteboard::readBuffer const):
379         (WebCore::PlatformPasteboard::readString const):
380         (WebCore::PlatformPasteboard::readURL const):
381
382 2020-06-03  Andy Estes  <aestes@apple.com>
383
384         [Apple Pay] Add new values for -apple-pay-button-type
385         https://bugs.webkit.org/show_bug.cgi?id=212684
386         <rdar://problem/63908535>
387
388         Reviewed by Anders Carlsson.
389
390         Where available, added new values for -apple-pay-button-type and introduced ApplePaySession v10.
391
392         New test: http/tests/ssl/applepay/ApplePayButton.html
393
394         * Modules/applepay/PaymentCoordinatorClient.cpp:
395         (WebCore::PaymentCoordinatorClient::supportsVersion):
396         * accessibility/AccessibilityRenderObject.cpp:
397         (WebCore::AccessibilityRenderObject::applePayButtonDescription const):
398         * css/CSSPrimitiveValueMappings.h:
399         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
400         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
401         * css/CSSValueKeywords.in:
402         * css/parser/CSSParserFastPaths.cpp:
403         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
404         * en.lproj/Localizable.strings:
405         * platform/LocalizedStrings.cpp:
406         (WebCore::AXApplePayReloadLabel):
407         (WebCore::AXApplePayAddMoneyLabel):
408         (WebCore::AXApplePayTopUpLabel):
409         (WebCore::AXApplePayOrderLabel):
410         (WebCore::AXApplePayRentLabel):
411         (WebCore::AXApplePaySupportLabel):
412         (WebCore::AXApplePayContributeLabel):
413         (WebCore::AXApplePayTipLabel):
414         * platform/LocalizedStrings.h:
415         * rendering/RenderThemeCocoa.mm:
416         (WebCore::toPKPaymentButtonType):
417         * rendering/style/RenderStyleConstants.cpp:
418         (WebCore::operator<<):
419         * rendering/style/RenderStyleConstants.h:
420         * rendering/style/StyleRareNonInheritedData.h:
421
422 2020-06-03  Daniel Bates  <dabates@apple.com>
423
424         Inserted text placeholder should vertically align to top and behave like block-level element when it has 0 width
425         https://bugs.webkit.org/show_bug.cgi?id=212716
426         <rdar://problem/62672479>
427
428         Reviewed by Darin Adler.
429
430         Refine the appearance of a text placeholder based on feedback:
431             1. If the width of the placeholder is 0 then put it on its own line. This is accomplished by making it
432                CSS "display: block".
433             2. Vertically align the placeholder with the top of the line.
434
435         Both of these refinements are to make the rendering more like TextKit's rendering.
436
437         Tests: editing/text-placeholder/insert-into-content-editable-non-zero-width-and-height.html
438                editing/text-placeholder/insert-into-content-editable-zero-width.html
439
440         * html/shadow/TextPlaceholderElement.cpp:
441
442 2020-06-03  Pinki Gyanchandani  <pgyanchandani@apple.com>
443
444         Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
445         https://bugs.webkit.org/show_bug.cgi?id=212714
446
447         Reviewed by Geoffrey Garen.
448
449         Widget removal in the middle of building a Render Tree causes side effects, leading to Release Assert. Moved the scope for suspension of widgets
450         update to RenderTreeBuilder instead of having it in RenderTreeUpdater.
451
452         Also made sure that the WidgetHierarchyUpdatesSuspensionScope::moveWidgets() should handle all widgets scheduled to move, including new widgets
453         scheduled during moveWidgets().
454
455         Test: fast/rendering/widget-removal-in-render-tree-builder-crash.html
456
457         * rendering/RenderWidget.cpp:
458         (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
459         * rendering/updating/RenderTreeBuilder.h:
460         * rendering/updating/RenderTreeUpdater.cpp:
461         (WebCore::RenderTreeUpdater::tearDownRenderers):
462
463 2020-06-03  Wenson Hsieh  <wenson_hsieh@apple.com>
464
465         [Text manipulation] Extract the value attribute in inputs of type "text" and "search"
466         https://bugs.webkit.org/show_bug.cgi?id=212706
467         <rdar://problem/63876969>
468
469         Reviewed by Tim Horton.
470
471         Allow text manipulation to extract text for the value of text fields that were not last modified by user input.
472         Aside from button types, it generally doesn't make sense to perform text manipulation over arbitrary input
473         element values, especially for text field types such as passwords, URLs, emails, and numbers. However, some
474         webpages set the `value` of inputs to implement `placeholder`-like behavior in text fields, and we need to be
475         compatible with this.
476
477         Tests:  TextManipulation.StartTextManipulationExtractsValuesFromTextInputs
478                 TextManipulation.CompleteTextManipulationInButtonsAndTextFields
479
480         * editing/TextManipulationController.cpp:
481         (WebCore::shouldExtractValueForTextManipulation):
482
483         Unfortunately, we need to check the type attribute here against "text", since inputs of type "date" and "time"
484         fall back to text fields on macOS, and we still want to avoid extracting values for these.
485
486         (WebCore::isAttributeForTextManipulation):
487
488         Pull the `value` attribute of this out into a separate method, above.
489
490         (WebCore::TextManipulationController::observeParagraphs):
491         (WebCore::TextManipulationController::replace):
492
493         Treat the text field value separately from other attributes by calling `HTMLInputElement::value()` upon
494         extraction, and `HTMLInputElement::setValue()` upon replacement.
495
496 2020-06-03  Rob Buis  <rbuis@igalia.com>
497
498         Disallow responses when a response contains invalid header values
499         https://bugs.webkit.org/show_bug.cgi?id=184493
500
501         Reviewed by Darin Adler.
502
503         From the Fetch specification [1]:
504         "A value is a byte sequence that matches the following conditions:
505         "- Contains no 0x00 (NUL) or HTTP newline bytes."
506
507         [1] https://fetch.spec.whatwg.org/#concept-header-value
508
509         Tests: imported/w3c/web-platform-tests/fetch/h1-parsing/resources-with-0x00-in-header.window.html
510                imported/web-platform-tests/fetch/api/basic/header-value-combining.any.html
511                imported/web-platform-tests/fetch/api/basic/header-value-combining.any.worker.html
512                imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.html
513                imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.worker.html
514                imported/web-platform-tests/xhr/headers-normalize-response.htm
515
516         * Modules/fetch/FetchHeaders.cpp:
517         (WebCore::canWriteHeader):
518         (WebCore::appendToHeaderMap):
519         (WebCore::FetchHeaders::filterAndFill):
520         * loader/DocumentThreadableLoader.cpp:
521         (WebCore::DocumentThreadableLoader::loadRequest):
522         * loader/SubresourceLoader.cpp:
523         (WebCore::SubresourceLoader::didReceiveResponse):
524         * platform/network/HTTPParsers.cpp:
525         (WebCore::isValidHTTPHeaderValue):
526         * platform/network/ResourceResponseBase.cpp:
527         (WebCore::ResourceResponseBase::containsInvalidHTTPHeaders const):
528         * platform/network/ResourceResponseBase.h:
529
530 2020-06-03  Wenson Hsieh  <wenson_hsieh@apple.com>
531
532         dataTransfer.types is empty when handling the "dragstart" event
533         https://bugs.webkit.org/show_bug.cgi?id=212685
534         <rdar://problem/61368402>
535
536         Reviewed by Andy Estes.
537
538         Implements several currently stubbed methods on StaticPasteboard, so that the DataTransfer provided to the page
539         on the "dragstart" event contains the DOM-exposed data types that will be written to the system pasteboard. This
540         includes "text/html", "text/plain", and "text/uri-list".
541
542         Tests:  DragAndDropTests.DataTransferTypesOnDragStartForTextSelection
543                 DragAndDropTests.DataTransferTypesOnDragStartForImage
544                 DragAndDropTests.DataTransferTypesOnDragStartForLink
545
546         ...as well as several existing tests in DragAndDropTestsIOS.mm that attempt to set pasteboard data during the
547         dragstart event:
548
549                 DragAndDropTests.DataTransferSanitizeHTML
550                 DragAndDropTests.DataTransferSetDataCannotWritePlatformTypes
551                 DragAndDropTests.DataTransferSetDataInvalidURL
552                 DragAndDropTests.DataTransferSetDataUnescapedURL
553                 DragAndDropTests.DataTransferSetDataValidURL
554
555         * dom/DataTransfer.cpp:
556         (WebCore::DataTransfer::commitToPasteboard):
557
558         Only commit data to the native pasteboard if the page actually tried to write or modify the data. This allows us
559         to preserve existing behavior by allowing DragController to write dragged data to the pasteboard normally in the
560         case where the page didn't specify any custom data. In the case where the page does specify custom data, we will
561         write this custom data *in addition* to any default data that was written to the static pasteboard. While this
562         is a departure from our current behavior (which is to treat the pasteboard as a blank slate that contains only
563         whatever custom data was provided by the page), it matches behavior in both Chrome and Firefox, and is likely
564         more compatible with webpages that don't have UA-specific logic targeting WebKit.
565
566         * editing/cocoa/EditorCocoa.mm:
567         (WebCore::Editor::writeSelectionToPasteboard):
568
569         Avoid calling into the injected bundle (as well as writing a few particular non-web-exposed types, such as web
570         archive data) in the case where we're writing to a static pasteboard (there's no point in doing this for the
571         static pasteboard, and in the worst case, it could confuse some internal clients).
572
573         * editing/ios/EditorIOS.mm:
574         (WebCore::Editor::writeImageToPasteboard): Ditto.
575         * editing/mac/EditorMac.mm:
576         (WebCore::Editor::writeImageToPasteboard):
577
578         Ditto. But additionally, introduce a markup string to PasteboardImage, so that we will expose the "text/html"
579         type when starting a drag on an image element.
580
581         * page/DragController.cpp:
582         (WebCore::DragController::startDrag):
583
584         Only attempt to call into `Pasteboard::writeTrustworthyWebURLsPboardType` in the case where the pasteboard
585         supports this type (i.e. on macOS). This fixes an existing assertion that was hit by my new API test, which
586         attempts to override the contents of the pasteboard with custom data while starting a drag on a link.
587
588         * page/EventHandler.cpp:
589         (WebCore::EventHandler::handleDrag):
590
591         Since the StaticPasteboard contains data before the page has written anything, don't use `Pasteboard::hasData()`
592         to determine whether there's custom data; instead, use the new `hasNonDefaultData()` method on
593         `StaticPasteboard` (see below).
594
595         * platform/Pasteboard.cpp:
596         (WebCore::Pasteboard::canWriteTrustworthyWebURLsPboardType):
597
598         On non-macOS ports, return false.
599
600         * platform/Pasteboard.h:
601         * platform/StaticPasteboard.cpp:
602         (WebCore::StaticPasteboard::hasNonDefaultData const):
603
604         Keep track of whether the page attempted to stage any custom data during "dragstart" by maintaining the set of
605         types written by the page, via calls to `writeString()` and similar. I'm using a set of types here instead of a
606         simple `bool` flag to ensure correctness in the case where the page adds a type, and then later removes that
607         same custom type, such that there is no longer non-default data.
608
609         (WebCore::StaticPasteboard::writeString):
610         (WebCore::StaticPasteboard::writeData):
611         (WebCore::StaticPasteboard::writeStringInCustomData):
612         (WebCore::StaticPasteboard::clear):
613
614         See above.
615
616         (WebCore::StaticPasteboard::writeMarkup):
617         (WebCore::StaticPasteboard::writePlainText):
618         (WebCore::StaticPasteboard::write):
619
620         Implement these methods by writing to the `PasteboardCustomData`. These methods are invoked by our own code
621         rather than the bindings, and should only be used to stage default data types when starting a drag.
622
623         * platform/StaticPasteboard.h:
624         * platform/mac/PasteboardMac.mm:
625         (WebCore::Pasteboard::write):
626         (WebCore::Pasteboard::canWriteTrustworthyWebURLsPboardType):
627
628 2020-06-03  Jer Noble  <jer.noble@apple.com>
629
630         Crash with uncaught exception: *** -[AVSampleBufferAudioRenderer enqueueSampleBuffer:] Sample buffer has media type 'vide' instead of 'soun'
631         https://bugs.webkit.org/show_bug.cgi?id=212646
632         <rdar://problem/63040834>
633
634         Reviewed by Eric Carlson.
635
636         Protect against the possibility of AVStreamDataParser generating non-video or -audio samples in an otherwise
637         video- or audio-track. Check the format description attached to the sample before appending, and ASSERT in
638         debug builds and ERROR_LOG in release builds, as this is an exceptional condition.
639
640         * platform/graphics/FourCC.h:
641         (WTF::LogArgument<WebCore::FourCC>::toString):
642         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
643         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
644
645 2020-06-03  Kate Cheney  <katherine_cheney@apple.com>
646
647         Any active sqlite transactions for the ITP database should be aborted when the network process suspends.
648         https://bugs.webkit.org/show_bug.cgi?id=212608
649         <rdar://problem/60540768>
650
651         Reviewed by Chris Dumez.
652
653         Add WEBCORE_EXPORT macro to use interrupt() function in
654         ResourceLoadStatisticsDatabaseStore.
655
656         * platform/sql/SQLiteDatabase.h:
657
658 2020-06-03  Andres Gonzalez  <andresg_22@apple.com>
659
660         AX: SVG text node with content is described as "empty group" even if it's not empty
661         https://bugs.webkit.org/show_bug.cgi?id=210315
662
663         Reviewed by Darin Adler.
664
665         Test: accessibility/svg-text.html
666
667         SVGText elements are conveyed as AXGroups and cannot have a description
668         or help property, but instead the content of the element is exposed as
669         static text.
670
671         * accessibility/AccessibilitySVGElement.cpp:
672         (WebCore::AccessibilitySVGElement::accessibilityDescription const):
673         (WebCore::AccessibilitySVGElement::helpText const):
674         * accessibility/AccessibilitySVGElement.h:
675
676 2020-06-03  Sihui Liu  <sihui_liu@apple.com>
677
678         Text manipulation sometimes fails to replace text in attributes
679         https://bugs.webkit.org/show_bug.cgi?id=212701
680
681         Reviewed by Wenson Hsieh.
682
683         Concatenate replacement tokens of same identifier for attribute like we do for title and option element in 
684         r260393.
685
686         Covered by test: TextManipulation.CompleteTextManipulationShouldReplaceTextContentWithMultipleTokens
687
688         * editing/TextManipulationController.cpp:
689         (WebCore::TextManipulationController::replace):
690
691 2020-06-02  Dean Jackson  <dino@apple.com>
692
693         [ macOS ] REGRESSION(r262366): webgl/1.0.3/conformance/canvas/buffer-offscreen-test.html & webgl/2.0.0/conformance/canvas/buffer-offscreen-test.html are constant failures
694         https://bugs.webkit.org/show_bug.cgi?id=212594
695         <rdar://problem/63828783>
696
697         Reviewed by Eric Carlson.
698
699         The change in r262366 split the OpenGL work to prepare a canvas for rendering from the actual painting
700         (or compositing in this case). Canvas elements were being "prepared" at the end of the HTML run loop
701         if they'd done anything that would change pixels. The problem is that canvas elements that are not in
702         the document body are never composited, and thus should never be prepared, otherwise they will clear
703         their drawing buffer. In other words, a canvas in this state must keep the same buffer through
704         each rendering frame.
705
706         The solution is to check if the canvas is in the tree scope at the time we consider preparing
707         it for display.
708
709         * dom/Document.cpp:
710         (WebCore::Document::prepareCanvasesForDisplayIfNeeded):
711
712 2020-06-03  John Wilander  <wilander@apple.com>
713
714         Storage Access API: Add setting for per-page storage access scope
715         https://bugs.webkit.org/show_bug.cgi?id=212682
716         <rdar://problem/63904824>
717
718         Reviewed by Brent Fulgham.
719
720         This is a follow-up patch to https://bugs.webkit.org/show_bug.cgi?id=212114,
721         adding an off-by-default setting and a test case for per-page storage access.
722
723         Test: http/tests/storageAccess/request-and-grant-access-with-per-page-scope-access-from-another-frame.html
724
725         * dom/DocumentStorageAccess.cpp:
726         (WebCore::DocumentStorageAccess::requestStorageAccess):
727         * page/Settings.yaml:
728         * testing/InternalSettings.cpp:
729         (WebCore::InternalSettings::setStorageAccessAPIPerPageScopeEnabled):
730         * testing/InternalSettings.h:
731         * testing/InternalSettings.idl:
732
733 2020-06-03  Rob Buis  <rbuis@igalia.com>
734
735         Make generated C++ code use modern C++
736         https://bugs.webkit.org/show_bug.cgi?id=190714
737
738         Reviewed by Jonathan Bedard.
739
740         Replace typedef usage by alias-declaration.
741
742         No new tests. No change in behavior.
743
744         * css/makeprop.pl:
745         * dom/make_names.pl:
746         (printHeaderHead):
747         (printInit):
748         (printTypeHelpersHeaderFile):
749         (printFactoryCppFile):
750         (printFactoryHeaderFile):
751         (printWrapperFactoryCppFile):
752         (printWrapperFactoryHeaderFile):
753
754 2020-06-03  Javier Fernandez  <jfernandez@igalia.com>
755
756         [css-grid] Dynamically setting "position: absolute" in a grid item doesn't trigger a relayout of that element
757         https://bugs.webkit.org/show_bug.cgi?id=191465
758
759         Reviewed by Manuel Rego Casasnovas.
760
761         From Blink r484620 by Sergio Villar <svillar@igalia.com>
762
763         Containing block overrides not cleared for position:absolute
764
765         Whenever a position:absolute block gets a new containing block the
766         previously set containing block overrides are not cleared. This causes the
767         block not to be properly layout for its new containing block (for example
768         when using relative sizes).
769
770         In particular this affects grid items which always get a containing block
771         override size (which represent the grid areas) in case their
772         containing block switches from the grid container to a grid ancestor.
773
774         No new tests, as this change is covered by current web platform tests.
775
776         * rendering/RenderBlock.cpp:
777         (WebCore::RenderBlock::insertPositionedObject): Clear the containing block's override width and height.
778
779 2020-06-03  Youenn Fablet  <youenn@apple.com>
780
781         Add more logging related to service worker fetch event handling
782         https://bugs.webkit.org/show_bug.cgi?id=212632
783
784         Reviewed by Chris Dumez.
785
786         Add logging related to creating/canceling/deleting fetch event handler related client.
787         No change of behavior.
788
789         * workers/service/context/ServiceWorkerThreadProxy.cpp:
790         (WebCore::ServiceWorkerThreadProxy::startFetch):
791         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
792         (WebCore::ServiceWorkerThreadProxy::removeFetch):
793
794 2020-06-02  Yusuke Suzuki  <ysuzuki@apple.com>
795
796         ASSERTION FAILED: isCell() under WebCore::JSDOMConstructor seen with webaudio/the-audio-api/the-audiocontext-interface/audiocontextoptions.html
797         https://bugs.webkit.org/show_bug.cgi?id=212650
798
799         Reviewed by Mark Lam.
800
801         Some DOM constructor can return jsNull. For example, AudioContext constructor can return jsNull when it exceeds # of hardware audio contexts.
802         However CodeGeneratorJS assumes that DOM constructor always returns an object, or throws an exception.
803         This patch adds object check after DOM constructor call to handle the jsNull case while it does not change the existing semantics.
804
805         * bindings/scripts/CodeGeneratorJS.pm:
806         (GenerateConstructorDefinition):
807
808 2020-06-02  Simon Fraser  <simon.fraser@apple.com>
809
810         EventRegion::translate() needs to offset the wheel event regions
811         https://bugs.webkit.org/show_bug.cgi?id=212683
812
813         Reviewed by Zalan Bujtas.
814
815         EventRegion::translate() failed to offset the wheel event regions, which resulted 
816         in wrong reasons for GraphicsLayers with a non-zero offsetFromRenderer.
817
818         Test: fast/scrolling/mac/wheel-event-listener-region-layer-offset.html
819
820         * rendering/EventRegion.cpp:
821         (WebCore::EventRegion::translate):
822
823 2020-06-02  Wenson Hsieh  <wenson_hsieh@apple.com>
824
825         Add a helper method to populate a DataTransfer before dispatching a "dragstart" event
826         https://bugs.webkit.org/show_bug.cgi?id=212614
827         Work towards <rdar://problem/61368402>
828
829         Reviewed by Tim Horton.
830
831         Add a helper method in DragController to pre-populate the StaticPasteboard-backed DataTransfer before
832         dispatching the "dragstart" event. There should be no change in behavior yet, since StaticPasteboard doesn't
833         implement methods for writing data to the pasteboard, which this new method uses.
834
835         * page/DragController.cpp:
836         (WebCore::DragController::prepareForDragStart const):
837         (WebCore::DragController::hitTestResultForDragStart const):
838         (WebCore::DragController::startDrag):
839         * page/DragController.h:
840         * page/EventHandler.cpp:
841         (WebCore::EventHandler::dispatchDragStartEventOnSourceElement):
842
843 2020-06-02  Andres Gonzalez  <andresg_22@apple.com>
844
845         AXIsolatedTree::updateNode should not call nodeForID.
846         https://bugs.webkit.org/show_bug.cgi?id=212662
847
848         Reviewed by Chris Fleizach.
849
850         In isolated tree mode AXIsolatedTree::nodeForID should be called only
851         on the secondary AX thread. So removing the need to call nodeForID in
852         updateNode by using AXCoreObject::childrenIDs() instead of retrieving
853         the isolated node to access its children IDs.
854
855         * accessibility/isolatedtree/AXIsolatedTree.cpp:
856         (WebCore::AXIsolatedTree::updateNode):
857
858 2020-06-02  Keith Rollin  <krollin@apple.com>
859
860         Revert FEATURES_DEFINES related changes
861         https://bugs.webkit.org/show_bug.cgi?id=212664
862         <rdar://problem/63893033>
863
864         Reviewed by Andy Estes.
865
866         Bug 262310, Bug 262311, Bug 262318, and Bug 262331 involve changes to
867         FEATURE_DEFINES and how the values there relate to those found in the
868         Platform*.h files. Those changes break XCBuild (by removing the
869         .xcfilelist related to UnifiedSources and the process for generating
870         them), and so are being reverted.
871
872         No new tests -- build changes.
873
874         * Configurations/FeatureDefines.xcconfig:
875         * Configurations/GenerateUnifiedSources.xcconfig: Added.
876         * DerivedSources-input.xcfilelist:
877         * DerivedSources-output.xcfilelist:
878         * DerivedSources.make:
879         * Modules/applepay/ApplePayError.idl:
880         * Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
881         * Modules/applepay/ApplePayPaymentContact.idl:
882         * Modules/applepay/ApplePayPaymentMethodUpdate.idl:
883         * Modules/applepay/ApplePayRequestBase.idl:
884         * Modules/applepay/ApplePaySession.idl:
885         * Modules/applepay/ApplePayShippingContactUpdate.idl:
886         * Modules/applepay/ApplePayShippingMethodUpdate.idl:
887         * Modules/applepay/PaymentCoordinatorClient.cpp:
888         (WebCore::PaymentCoordinatorClient::supportsVersion):
889         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
890         (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const):
891         * Scripts/generate-unified-sources.sh:
892         * UnifiedSources-output.xcfilelist: Added.
893         * WebCore.xcodeproj/project.pbxproj:
894         * accessibility/AccessibilityRenderObject.cpp:
895         (WebCore::AccessibilityRenderObject::applePayButtonDescription const):
896         * css/CSSPrimitiveValueMappings.h:
897         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
898         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
899         * css/CSSValueKeywords.in:
900         * css/parser/CSSParserFastPaths.cpp:
901         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
902         * rendering/RenderThemeCocoa.mm:
903         (WebCore::toPKPaymentButtonType):
904         * rendering/style/RenderStyleConstants.cpp:
905         (WebCore::operator<<):
906         * rendering/style/RenderStyleConstants.h:
907
908 2020-06-02  Ryan Haddad  <ryanhaddad@apple.com>
909
910         Unreviewed, reverting r262424.
911
912         Caused webkitpy test failure
913
914         Reverted changeset:
915
916         "Make generated C++ code use modern C++"
917         https://bugs.webkit.org/show_bug.cgi?id=190714
918         https://trac.webkit.org/changeset/262424
919
920 2020-06-02  Peng Liu  <peng.liu6@apple.com>
921
922         Stressing webkitSetPresentationMode leads to wrong inline video dimensions
923         https://bugs.webkit.org/show_bug.cgi?id=202425
924
925         Reviewed by Eric Carlson.
926
927         Make the HTMLVideoElement::setFullscreenMode() robust under stress tests
928         by ignoring a request when the video element is not ready yet.
929
930         Manually tested.
931
932         * dom/Element.h:
933         (WebCore::Element::didStopBeingFullscreenElement):
934         Add a callback to indicate that the element has exited fullscreen.
935         * dom/FullscreenManager.cpp:
936         (WebCore::FullscreenManager::didExitFullscreen):
937         Call Element::didStopBeingFullscreenElement() when the element has exited fullscreen.
938
939         * html/HTMLMediaElement.cpp:
940         (WebCore::HTMLMediaElement::enterFullscreen):
941         * html/HTMLMediaElement.h:
942
943         * html/HTMLVideoElement.cpp:
944         (WebCore::HTMLVideoElement::webkitDisplayingFullscreen):
945         This function will return true when a video element is in the process to exit
946         fullscreen/picture-in-picture until it has completed the process. Therefore, a page
947         can safely request the video element to enter fullscreen/picture-in-picture when
948         this function returns false.
949
950         (WebCore::HTMLVideoElement::setFullscreenMode):
951         (WebCore::HTMLVideoElement::didBecomeFullscreenElement):
952         (WebCore::HTMLVideoElement::didStopBeingFullscreenElement):
953         (WebCore::HTMLVideoElement::didEnterFullscreen): Deleted.
954         (WebCore::HTMLVideoElement::didExitFullscreen): Deleted.
955         * html/HTMLVideoElement.h:
956         Add a flag m_isChangingPresentationMode. webkitSetPresentationMode() will only
957         change the presentation mode when the flag is false.
958
959 2020-06-01  Simon Fraser  <simon.fraser@apple.com>
960
961         Add ENABLE(WHEEL_EVENT_REGIONS), enabled on macOS which is the only platform that needs wheel event regions for scrolling thread hit-testing
962         https://bugs.webkit.org/show_bug.cgi?id=212620
963
964         Reviewed by Tim Horton.
965
966         Surround code related to wheel event regions with ENABLE(WHEEL_EVENT_REGIONS).
967
968         Eventually we'll use this same code for touch event regions, and when we do, we
969         can rejigger the #ifdefs.
970
971         * rendering/EventRegion.cpp:
972         (WebCore::EventRegion::operator== const):
973         (WebCore::EventRegion::unite):
974         (WebCore::EventRegion::containsEditableElementsInRect const):
975         (WebCore::EventRegion::dump const):
976         * rendering/EventRegion.h:
977         * rendering/RenderLayerBacking.cpp:
978         (WebCore::RenderLayerBacking::paintDebugOverlays):
979
980 2020-06-02  Andres Gonzalez  <andresg_22@apple.com>
981
982         Avoid calling axBackingObject multiple times in [WebAccessibilityObjectWrapper roleDescription].
983         https://bugs.webkit.org/show_bug.cgi?id=212643
984
985         Reviewed by Chris Fleizach.
986
987         No new functionality.
988
989         Avoid unnecessary overhead of calling axBackingObject multiple times in
990         roleDescription. axBackingObject is not just a getter but involves
991         checking whether isolated tree mode is enabled.
992
993         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
994         (-[WebAccessibilityObjectWrapper subrole]):
995         (-[WebAccessibilityObjectWrapper roleDescription]):
996
997 2020-06-02  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
998
999         Pass nullptr for the 2nd argument of FileReaderLoader 
1000         https://bugs.webkit.org/show_bug.cgi?id=212642
1001
1002         Reviewed by Darin Adler.
1003
1004         Instead of passing `0`, `nullptr` is better
1005         because `FileReaderLoader` takes a pointer.
1006
1007         * fileapi/FileReaderSync.cpp:
1008         (WebCore::FileReaderSync::readAsArrayBuffer):
1009         (WebCore::FileReaderSync::readAsBinaryString):
1010         (WebCore::FileReaderSync::readAsText):
1011         (WebCore::FileReaderSync::readAsDataURL):
1012
1013 2020-06-02  Tim Horton  <timothy_horton@apple.com>
1014
1015         UIColor and NSColor WebCore::Color factories should return invalid colors for nil input colors
1016         https://bugs.webkit.org/show_bug.cgi?id=212631
1017
1018         Reviewed by Anders Carlsson.
1019
1020         * platform/graphics/mac/ColorMac.mm:
1021         (WebCore::colorFromNSColor):
1022         (WebCore::semanticColorFromNSColor):
1023         * platform/ios/ColorIOS.mm:
1024         (WebCore::colorFromUIColor):
1025         This doesn't affect any code currently in WebKit, but it is very, very surprising
1026         that these functions happily accept a null color, assert in debug, but in release
1027         do crazy things like try to paint the null color into a small bitmap to figure out
1028         what it really is.
1029
1030         Also, this matches the behavior of the Color constructors that take CGColorRef.
1031
1032 2020-06-02  Rob Buis  <rbuis@igalia.com>
1033
1034         Make generated C++ code use modern C++
1035         https://bugs.webkit.org/show_bug.cgi?id=190714
1036
1037         Reviewed by Sam Weinig.
1038
1039         Replace typedef usage by alias-declaration.
1040
1041         No new tests. No change in behavior.
1042
1043         * css/makeprop.pl:
1044         * dom/make_names.pl:
1045         (printHeaderHead):
1046         (printInit):
1047         (printTypeHelpersHeaderFile):
1048         (printFactoryCppFile):
1049         (printFactoryHeaderFile):
1050         (printWrapperFactoryCppFile):
1051         (printWrapperFactoryHeaderFile):
1052
1053 2020-06-02  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
1054
1055         Remove unused BlobURL::getIdentifier
1056         https://bugs.webkit.org/show_bug.cgi?id=212635
1057
1058         Reviewed by Youenn Fablet.
1059
1060         * fileapi/BlobURL.cpp:
1061         * fileapi/BlobURL.h:
1062
1063 2020-06-02  Mark Lam  <mark.lam@apple.com>
1064
1065         Fix broken Windows build.
1066         https://bugs.webkit.org/show_bug.cgi?id=212633
1067
1068         Reviewed by Yusuke Suzuki.
1069
1070         * html/HTMLCanvasElement.cpp:
1071         (WebCore::HTMLCanvasElement::needsPreparationForDisplay):
1072         (WebCore::HTMLCanvasElement::prepareForDisplay):
1073
1074 2020-06-02  Youenn Fablet  <youenn@apple.com>
1075
1076         Add some logging to ServiceWorkerThread to track install/activate event handling
1077         https://bugs.webkit.org/show_bug.cgi?id=212523
1078
1079         Reviewed by Chris Dumez.
1080
1081         Add some logging for firing install/activate events and when these events are handled.
1082         No change of behavior.
1083
1084         * workers/service/context/ServiceWorkerThread.cpp:
1085         (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent):
1086         (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent):
1087
1088 2020-06-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1089
1090         [GTK4] Make popup menus work
1091         https://bugs.webkit.org/show_bug.cgi?id=211178
1092
1093         Reviewed by Adrian Perez de Castro.
1094
1095         * platform/gtk/GtkVersioning.h:
1096         (gtk_tree_view_column_cell_get_size):
1097
1098 2020-06-01  Sergio Villar Senin  <svillar@igalia.com>
1099
1100         [css-flexbox] ChildIntrinsicLogicalWidth should use fit-content, not max-content
1101         https://bugs.webkit.org/show_bug.cgi?id=210465
1102
1103         Reviewed by Javier Fernandez.
1104
1105         When computing the hypothetical cross size of each item in the flexbox algorithm
1106         the current code was using the max-size. However the specs state clearly that we
1107         should use fit-content instead, i.e., the shrink-to-fit size.
1108         See https://drafts.csswg.org/css-flexbox/#algo-cross-item.
1109
1110         Based on Blink's crrev.com/1327746 by <cbiesinger@chromium.org>
1111
1112         * rendering/RenderFlexibleBox.cpp:
1113         (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): Use the shrink-to-fit
1114         size instead just the max-size.
1115
1116 2020-06-02  Youenn Fablet  <youenn@apple.com>
1117
1118         MediaPlayerPrivateMediaStreamAVFObjC should enqueue samples in a background thread
1119         https://bugs.webkit.org/show_bug.cgi?id=212073
1120
1121         Reviewed by Eric Carlson.
1122
1123         Do not hop to the main thread when rendering video samples anymore.
1124         Instead, we enqueue to the display layer in the background thread but still hop to the main thread for two things:
1125         - Update of various states of the player
1126         - keep a ref to the video sample if canvas rendering is needed.
1127
1128         Most display layer operations stay in the main thread (creation, flushing...).
1129         Deletion of the display layer and access from a background are covered by a lock.
1130         The m_canEnqueueDisplayLayer boolean ensures we do not enqueue too early when the display layer is not yet properly initialized.
1131
1132         LocalSampleBufferDisplayLayer needs to handle the fact that enqueueing might be done in a background thread.
1133         Instead of introducing a lock, we introduce a work queue and we hop to this queue whenever we need to enqueue/mutate the pending samples.
1134
1135         Covered by existing tests and manual testing.
1136
1137         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h:
1138         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
1139         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
1140         (WebCore::LocalSampleBufferDisplayLayer::enqueueSample):
1141         (WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer):
1142         (WebCore::LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData):
1143         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1144         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1145         (WebCore::videoTransformationMatrix):
1146         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::processNewVideoSampleAvailable):
1147         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
1148         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive):
1149         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers):
1150         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
1151         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
1152         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateRenderingMode):
1153         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
1154         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
1155         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
1156         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rootLayerBoundsDidChange):
1157         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Deleted.
1158         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Deleted.
1159         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer): Deleted.
1160
1161 2020-06-02  Youenn Fablet  <youenn@apple.com>
1162
1163         [ Mac wk2 ] http/wpt/service-workers/service-worker-spinning-fetch.https.html is flaky failing.
1164         https://bugs.webkit.org/show_bug.cgi?id=207515
1165         <rdar://problem/59329307>
1166
1167         Reviewed by Chris Dumez.
1168
1169         When a service worker is terminated, we remove it from the map in SWContextManager.
1170         Shortly after a new service worker may be added to the map.
1171         In that case, previously, we were potentially trying to decrement the message count of the old service worker thread, which is confusing the new service worker thread.
1172         Instead, use WeakPtr to decrement if the service worker thread is still valid.
1173         Covered by existing tests.
1174
1175         * workers/service/context/ServiceWorkerThread.cpp:
1176         (WebCore::ServiceWorkerThread::queueTaskToPostMessage):
1177         (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent):
1178         (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent):
1179         (WebCore::ServiceWorkerThread::start):
1180         * workers/service/context/ServiceWorkerThread.h:
1181
1182 2020-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
1183
1184         [WebGPU] Update texture creation validation according to the discussion at https://github.com/gpuweb/gpuweb/pull/799/files
1185         https://bugs.webkit.org/show_bug.cgi?id=212390
1186
1187         Reviewed by Dean Jackson.
1188
1189         Two new rules: Multisampled textures can't have the STORAGE flag, and sampleCount must be either 1 or 4.
1190
1191         Test: webgpu/texture-creation.html
1192
1193         * platform/graphics/gpu/GPUDevice.cpp:
1194         (WebCore::GPUDevice::tryCreateTexture const):
1195
1196 2020-06-01  Noam Rosenthal  <noam@webkit.org>
1197
1198         Make unicode-bidi:isolate the default for an element with a dir attribute (instead of unicode-bidi:embed)
1199         https://bugs.webkit.org/show_bug.cgi?id=134630
1200
1201         Reviewed by Simon Fraser.
1202
1203         Unskipped 11 dir-isolation w3c tests.
1204
1205         * html/HTMLElement.cpp:
1206         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
1207                 Use isolate instead of embed for unicode-bidi when dir attribute is present.
1208
1209 2020-06-01  Devin Rousso  <drousso@apple.com>
1210
1211         Web Inspector: Graphics: should use the `id` (name) of the animation if it exists
1212         https://bugs.webkit.org/show_bug.cgi?id=212618
1213
1214         Reviewed by Timothy Hatcher.
1215
1216         Test: inspector/animation/lifecycle-css-animation.html:
1217               inspector/animation/lifecycle-css-transition.html:
1218               inspector/animation/lifecycle-web-animation.html:
1219               inspector/animation/nameChanged.html
1220
1221         * animation/WebAnimation.h:
1222         (WebCore::WebAnimation::setId): Deleted.
1223         * animation/WebAnimation.cpp:
1224         (WebCore::WebAnimation::setId): Added.
1225
1226         * inspector/InspectorInstrumentation.h:
1227         (WebCore::InspectorInstrumentation::didChangeWebAnimationName): Added.
1228         * inspector/InspectorInstrumentation.cpp:
1229         (WebCore::InspectorInstrumentation::didChangeWebAnimationNameImpl): Added.
1230
1231         * inspector/agents/InspectorAnimationAgent.h:
1232         * inspector/agents/InspectorAnimationAgent.cpp:
1233         (WebCore::InspectorAnimationAgent::didChangeWebAnimationName): Added.
1234         (WebCore::InspectorAnimationAgent::bindAnimation):
1235
1236 2020-06-01  Andres Gonzalez  <andresg_22@apple.com>
1237
1238         [WebAccessibilityObjectWrapper subrole] should check for the nullity of the underlying AXCoreObject before dereferencing.
1239         https://bugs.webkit.org/show_bug.cgi?id=212607
1240
1241         Reviewed by Chris Fleizach.
1242
1243         Covered by existing tests.
1244
1245         - Check for nullity of the backingObject before dereferencing.
1246         - self.axBackingObject is now called only once, instead of many times unnecessarily.
1247
1248         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1249         (-[WebAccessibilityObjectWrapper subrole]):
1250
1251 2020-06-01  Sihui Liu  <sihui_liu@apple.com>
1252
1253         TextManipulationController should put one Node in only one paragraph
1254         https://bugs.webkit.org/show_bug.cgi?id=212548
1255
1256         Reviewed by Wenson Hsieh.
1257
1258         TextManipulationController mainly uses line break as delimiter to split paragraphs. In our current 
1259         implementation, if text of a Node has line break, the part before the line break is in one paragraph and the
1260         part after the line break is in another paragraph, which means the Node is in the ranges of two paragraphs.
1261         In this case, when TextManipulationController manipulates the first paragraph, it replaces all the Nodes in the 
1262         range of first paragraph with new Nodes. Then when it manipulates the second paragraph, if will find Node in the
1263         range of second paragraph does not exist and fail (because the Node is removed when handling the first 
1264         paragraph.). Also, TextManipulationController currently does not preserve line breaks in text, which can be an
1265         issue if these line breaks are visible. 
1266
1267         This patch makes the ParagraphContentIterator iterate over Nodes instead of text, so a Node can only be in the 
1268         range of one paragraph. To do this, it makes line break and spaces around it as a special excluded token.
1269         Here are the rules for splitting paragraphs by line break now:
1270         1. If the special token is the first token in a Node, text in Nodes before the Node will make a paragraph. 
1271         2. If the special token is the last token in a Node, text in Nodes before the Node and in the Node will make a 
1272         paragraph.
1273         3. If the special token in the middle of tokens in a Node, then we don't make a new paragraph until next special
1274         token meets condition 1 or 2.
1275
1276         This patch also fixes the issue that Nodes out of the paragraph range can be removed due to the preorder Node
1277         traversal, by finding and adding those Nodes back.
1278
1279         * editing/TextManipulationController.cpp:
1280         (WebCore::ParagraphContentIterator::m_pastEndNode):
1281         (WebCore::ParagraphContentIterator::advance):
1282         (WebCore::ParagraphContentIterator::currentContent):
1283         (WebCore::ParagraphContentIterator::atEnd const):
1284         (WebCore::ParagraphContentIterator::advanceNode):
1285         (WebCore::ParagraphContentIterator::advanceIteratorNodeAndUpdateText):
1286         (WebCore::isEnclosingItemBoundaryElement):
1287         (WebCore::TextManipulationController::parse):
1288         (WebCore::TextManipulationController::observeParagraphs):
1289         (WebCore::TextManipulationController::addItem):
1290         (WebCore::TextManipulationController::getPath):
1291         (WebCore::TextManipulationController::updateInsertions):
1292         (WebCore::TextManipulationController::replace):
1293         (WebCore::ParagraphContentIterator::startPosition): Deleted.
1294         (WebCore::ParagraphContentIterator::endPosition): Deleted.
1295         (WebCore::ParagraphContentIterator::moveCurrentNodeForward): Deleted.
1296         (WebCore::containsOnlyHTMLSpaces): Deleted.
1297         * editing/TextManipulationController.h:
1298
1299 2020-06-01  David Kilzer  <ddkilzer@apple.com>
1300
1301         Don't use casts to convert between WebCore::DragDestinationAction and {Web,WK}DragDestinationAction types
1302         <https://webkit.org/b/212507>
1303
1304         Reviewed by Darin Adler.
1305
1306         * page/DragActions.h:
1307         (WebCore::anyDragDestinationAction): Add.
1308         (WebCore::DragDestinationActionAny): Delete.
1309         - Rename DragDestinationActionAny() to
1310           anyDragDestinationAction() to match WebKit style.
1311         * platform/DragData.h:
1312         - Update to use anyDragDestinationAction().
1313
1314 2020-06-01  Simon Fraser  <simon.fraser@apple.com>
1315
1316         Add ENABLE(TOUCH_ACTION_REGIONS) to wrap code that's only relevant for platforms that consult touch-action for event handling
1317         https://bugs.webkit.org/show_bug.cgi?id=212572
1318
1319         Reviewed by Andy Estes.
1320
1321         This will allow for optimizations in event region painting without ambiguity.
1322
1323         * dom/Document.h:
1324         * page/Frame.cpp:
1325         (WebCore::Frame::invalidateContentEventRegionsIfNeeded):
1326         * page/scrolling/ScrollingTreeNode.h:
1327         * rendering/EventRegion.cpp:
1328         (WebCore::EventRegion::operator== const):
1329         (WebCore::EventRegion::unite):
1330         (WebCore::EventRegion::translate):
1331         (WebCore::EventRegion::dump const):
1332         * rendering/EventRegion.h:
1333         (WebCore::EventRegion::encode const):
1334         (WebCore::EventRegion::decode):
1335         * rendering/RenderBlock.cpp:
1336         (WebCore::RenderBlock::paintObject):
1337         * rendering/RenderElement.cpp:
1338         (WebCore::RenderElement::styleWillChange):
1339         * rendering/RenderLayerBacking.cpp:
1340         (WebCore::RenderLayerBacking::maintainsEventRegion const):
1341         (WebCore::RenderLayerBacking::paintDebugOverlays):
1342         * style/StyleTreeResolver.cpp:
1343         (WebCore::Style::TreeResolver::resolveElement):
1344
1345 2020-06-01  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
1346
1347         Implement ParentNode.prototype.replaceChildren
1348         https://bugs.webkit.org/show_bug.cgi?id=198578
1349
1350         Reviewed by Darin Adler.
1351
1352         Ideally, we can use `ContainerNode::replaceAllChildren` to implement
1353         this simply but the current of it does not have a path to support
1354         `DocumentFragment`.
1355
1356         Hence, we call related methods from `ParentNode.prototype.replaceChildren` directly.
1357
1358         * dom/ContainerNode.cpp:
1359         (WebCore::ContainerNode::replaceChildren):
1360         * dom/ContainerNode.h:
1361         * dom/ParentNode.idl:
1362
1363 2020-05-25  Sergio Villar Senin  <svillar@igalia.com>
1364
1365         [css-flexbox] Tables as flex items should obey the flex container sizing
1366         https://bugs.webkit.org/show_bug.cgi?id=212355
1367
1368         Reviewed by Manuel Rego Casasnovas.
1369
1370         For most of the boxes, "width:auto" means use all the available space from your container in the inline
1371         direction. This means that a flex container does not need to do anything in particular to stretch them
1372         in the inline axis. However that is not true for tables because their width mostly depend on the sum of
1373         the sizes of their columns (whichever algorithm is used). That's why the layout code of tables should
1374         check whether or not it has an override for the content logical width which is the way flexbox uses to
1375         stretch flex items (and use that override width).
1376
1377         * rendering/RenderTable.cpp:
1378         (WebCore::RenderTable::updateLogicalWidth): Stretch till overrideContentLogicalWidth() if needed.
1379
1380 2020-06-01  Sam Weinig  <weinig@apple.com>
1381
1382         Extended Color: Replace Color constructors taking numeric values with type specific factory functions
1383         https://bugs.webkit.org/show_bug.cgi?id=212576
1384
1385         Reviewed by Tim Horton.
1386
1387         Replaces all remaining implicit and explicit uses of the Color constructors taking numeric
1388         values with explicit calls to makeSimpleColor/makeSimpleColorFromFloats/makeExtendedColor,
1389         giving us a consistent way to create colors. Also addes use constexpr SimpleColors where possible.
1390
1391         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1392         (WebCore::AXIsolatedObject::initializeAttributeData):
1393         * css/CSSValuePool.cpp:
1394         (WebCore::StaticCSSValuePool::StaticCSSValuePool):
1395         * css/parser/CSSPropertyParserHelpers.cpp:
1396         (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
1397         * html/HTMLInputElement.cpp:
1398         (WebCore::HTMLInputElement::createInnerTextStyle):
1399         * html/canvas/CanvasRenderingContext2DBase.cpp:
1400         (WebCore::CanvasRenderingContext2DBase::shadowColor const):
1401         (WebCore::CanvasRenderingContext2DBase::setShadow):
1402         * html/canvas/CanvasStyle.cpp:
1403         (WebCore::CanvasStyle::CanvasStyle):
1404         (WebCore::CanvasStyle::isEquivalentRGBA const):
1405         * inspector/InspectorOverlay.cpp:
1406         (WebCore::drawOutlinedQuadWithClip):
1407         (WebCore::drawShapeHighlight):
1408         (WebCore::InspectorOverlay::paint):
1409         (WebCore::InspectorOverlay::drawPaintRects):
1410         (WebCore::InspectorOverlay::drawBounds):
1411         (WebCore::InspectorOverlay::drawRulers):
1412         (WebCore::InspectorOverlay::drawElementTitle):
1413         * inspector/agents/InspectorDOMAgent.cpp:
1414         (WebCore::parseColor):
1415         * layout/integration/LayoutIntegrationLineLayout.cpp:
1416         (WebCore::LayoutIntegration::LineLayout::debugTextShadow):
1417         * page/CaptionUserPreferencesMediaAF.cpp:
1418         (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const):
1419         * page/DebugPageOverlays.cpp:
1420         (WebCore::touchEventRegionColors):
1421         (WebCore::NonFastScrollableRegionOverlay::drawRect):
1422         * page/FrameView.cpp:
1423         (WebCore::FrameView::paintContents):
1424         * page/PrintContext.cpp:
1425         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
1426         * page/linux/ResourceUsageOverlayLinux.cpp:
1427         (WebCore::ResourceUsageOverlay::platformInitialize):
1428         * platform/graphics/BitmapImage.cpp:
1429         (WebCore::BitmapImage::draw):
1430         * platform/graphics/Color.cpp:
1431         (WebCore::Color::light const):
1432         (WebCore::Color::dark const):
1433         (WebCore::Color::blendWithWhite const):
1434         (WebCore::Color::colorWithAlphaMultipliedBy const):
1435         (WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const):
1436         (WebCore::Color::colorWithAlpha const):
1437         (WebCore::Color::colorWithAlphaUsingAlternativeRounding const):
1438         (WebCore::blendWithoutPremultiply):
1439         (WebCore::extendedColorsEqual): Deleted.
1440         (WebCore::Color::tagAsValid): Deleted.
1441         * platform/graphics/Color.h:
1442         (WebCore::Color::Color):
1443         (WebCore::Color::tagAsSemantic):
1444         (WebCore::Color::tagAsValid):
1445         (WebCore::extendedColorsEqual):
1446         (WebCore::Color::decode):
1447         (WebCore::Color::setIsSemantic): Deleted.
1448         * platform/graphics/ExtendedColor.cpp:
1449         (WebCore::makeExtendedColor):
1450         * platform/graphics/ExtendedColor.h:
1451         (WebCore::ExtendedColor::ExtendedColor):
1452         (): Deleted.
1453         * platform/graphics/GraphicsLayer.cpp:
1454         (WebCore::GraphicsLayer::getDebugBorderInfo const):
1455         * platform/graphics/ca/GraphicsLayerCA.cpp:
1456         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1457         (WebCore::contentsLayerDebugBorderColor):
1458         (WebCore::cloneLayerDebugBorderColor):
1459         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1460         * platform/graphics/ca/PlatformCALayer.cpp:
1461         (WebCore::PlatformCALayer::drawRepaintIndicator):
1462         * platform/graphics/ca/TileCoverageMap.cpp:
1463         (WebCore::TileCoverageMap::TileCoverageMap):
1464         (WebCore::TileCoverageMap::update):
1465         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1466         (PlatformCALayerWinInternal::drawRepaintCounters):
1467         * platform/graphics/cairo/GradientCairo.cpp:
1468         (WebCore::interpolateColorStop):
1469         * platform/graphics/cg/ColorCG.cpp:
1470         (WebCore::Color::Color):
1471         * platform/graphics/cg/NativeImageCG.cpp:
1472         (WebCore::nativeImageSinglePixelSolidColor):
1473         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1474         (WebCore::colorForMarkerLineStyle):
1475         * platform/graphics/filters/FilterOperation.cpp:
1476         (WebCore::DropShadowFilterOperation::blend):
1477         * platform/graphics/mac/ColorMac.mm:
1478         (WebCore::colorFromNSColor):
1479         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1480         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
1481         * platform/ios/DragImageIOS.mm:
1482         (WebCore::createDragImageForLink):
1483         * platform/ios/LegacyTileCache.mm:
1484         (WebCore::LegacyTileCache::colorForGridTileBorder const):
1485         * platform/win/DragImageWin.cpp:
1486         (WebCore::createDragImageForLink):
1487         * rendering/PaintInfo.h:
1488         (WebCore::PaintInfo::forcedTextColor const):
1489         * rendering/RenderEmbeddedObject.cpp:
1490         (WebCore::RenderEmbeddedObject::paintReplaced):
1491         (WebCore::replacementTextRoundedRectPressedColor): Deleted.
1492         (WebCore::replacementTextRoundedRectColor): Deleted.
1493         (WebCore::replacementTextColor): Deleted.
1494         (WebCore::unavailablePluginBorderColor): Deleted.
1495         * rendering/RenderFrameSet.cpp:
1496         (WebCore::RenderFrameSet::paintColumnBorder):
1497         (WebCore::RenderFrameSet::paintRowBorder):
1498         (WebCore::borderStartEdgeColor): Deleted.
1499         (WebCore::borderEndEdgeColor): Deleted.
1500         (WebCore::borderFillColor): Deleted.
1501         * rendering/RenderLayer.cpp:
1502         (WebCore::RenderLayer::beginTransparencyLayers):
1503         * rendering/RenderLayerBacking.cpp:
1504         (WebCore::RenderLayerBacking::paintDebugOverlays):
1505         * rendering/RenderTheme.cpp:
1506         (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const):
1507         (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const):
1508         (WebCore::RenderTheme::platformTextSearchHighlightColor const):
1509         (WebCore::RenderTheme::paintSystemPreviewBadge):
1510         (WebCore::RenderTheme::platformTapHighlightColor const):
1511         * rendering/RenderTheme.h:
1512         (WebCore::RenderTheme::platformFocusRingColor const):
1513         * rendering/RenderThemeIOS.h:
1514         * rendering/RenderThemeIOS.mm:
1515         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
1516         (WebCore::RenderThemeIOS::paintRadioDecorations):
1517         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
1518         (WebCore::RenderThemeIOS::paintSliderTrack):
1519         (WebCore::RenderThemeIOS::paintProgressBar):
1520         (WebCore::paintAttachmentProgress):
1521         (WebCore::paintAttachmentBorder):
1522         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
1523         (WebCore::RenderThemeIOS::shadowColor const): Deleted.
1524         (WebCore::attachmentBorderColor): Deleted.
1525         (WebCore::attachmentProgressColor): Deleted.
1526         * rendering/RenderThemeMac.mm:
1527         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
1528         (WebCore::titleTextColorForAttachment):
1529         (WebCore::AttachmentLayout::layOutSubtitle):
1530         (WebCore::paintAttachmentIconBackground):
1531         (WebCore::paintAttachmentTitleBackground):
1532         (WebCore::paintAttachmentProgress):
1533         (WebCore::paintAttachmentPlaceholderBorder):
1534         (WebCore::attachmentIconBackgroundColor): Deleted.
1535         (WebCore::attachmentIconBorderColor): Deleted.
1536         (WebCore::attachmentTitleInactiveBackgroundColor): Deleted.
1537         (WebCore::attachmentTitleInactiveTextColor): Deleted.
1538         (WebCore::attachmentSubtitleTextColor): Deleted.
1539         (WebCore::attachmentProgressBarBackgroundColor): Deleted.
1540         (WebCore::attachmentProgressBarFillColor): Deleted.
1541         (WebCore::attachmentProgressBarBorderColor): Deleted.
1542         (WebCore::attachmentPlaceholderBorderColor): Deleted.
1543         * rendering/RenderThemeWin.cpp:
1544         (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const):
1545         (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const):
1546         (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const):
1547         (WebCore::RenderThemeWin::systemColor const):
1548         * rendering/SimpleLineLayoutFunctions.cpp:
1549         (WebCore::SimpleLineLayout::paintFlow):
1550         * rendering/mathml/RenderMathMLBlock.cpp:
1551         (WebCore::RenderMathMLBlock::paint):
1552         * rendering/style/RenderStyle.cpp:
1553         (WebCore::RenderStyle::colorResolvingCurrentColor const):
1554         * rendering/style/RenderStyle.h:
1555         (WebCore::RenderStyle::initialStrokeColor):
1556         * rendering/style/SVGRenderStyle.h:
1557         (WebCore::SVGRenderStyle::initialStopColor):
1558         (WebCore::SVGRenderStyle::initialFloodColor):
1559         (WebCore::SVGRenderStyle::initialLightingColor):
1560         * svg/SVGStopElement.cpp:
1561         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
1562         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
1563         (WebCore::SVGAnimationColorFunction::animate):
1564         * testing/MockPageOverlayClient.cpp:
1565         (WebCore::MockPageOverlayClient::drawRect):
1566         * testing/cocoa/WebViewVisualIdentificationOverlay.mm:
1567         (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]):
1568
1569 2020-06-01  Per Arne Vollan  <pvollan@apple.com>
1570
1571         [Win] When GraphicsLayerCA::m_uncommittedChanges is initialized with a non-zero value, nothing is painted.
1572         https://bugs.webkit.org/show_bug.cgi?id=168666
1573
1574         Reviewed by Maciej Stachowiak.
1575
1576         When m_uncommittedChanges is initialized with a non-zero value, client().notifyFlushRequired() will not be
1577         called in the first call to noteLayerPropertyChanged(), see https://bugs.webkit.org/show_bug.cgi?id=64808.
1578
1579         Covered by existing tests.
1580
1581         * platform/graphics/ca/GraphicsLayerCA.cpp:
1582         (WebCore::GraphicsLayerCA::initialize):
1583         * platform/graphics/ca/GraphicsLayerCA.h:
1584
1585 2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1586
1587         [GTK4] Add printing support
1588         https://bugs.webkit.org/show_bug.cgi?id=212320
1589
1590         Reviewed by Adrian Perez de Castro.
1591
1592         Add gtk_dialog_run() to GTK4.
1593
1594         * platform/gtk/GtkVersioning.h:
1595         (gtk_dialog_run):
1596
1597 2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1598
1599         [GTK4] Make inspector work
1600         https://bugs.webkit.org/show_bug.cgi?id=212321
1601
1602         Reviewed by Adrian Perez de Castro.
1603
1604         Add gtk_native_dialog_run() for GTK4.
1605
1606         * platform/gtk/GtkVersioning.h:
1607         (gtk_native_dialog_run):
1608
1609 2020-06-01  Rob Buis  <rbuis@igalia.com>
1610
1611         Rename ResourceResponseBase::isHTTP to isInHTTPFamily
1612         https://bugs.webkit.org/show_bug.cgi?id=208782
1613
1614         Reviewed by Sam Weinig.
1615
1616         As the comment says, the method name is misleading and the method
1617         is inconsistent with the API of ResourceRequestBase, so rename it
1618         to make it clear the method can be used for both http and https
1619         protocols.
1620
1621         No tests since no change in behavior.
1622
1623         * loader/DocumentLoader.cpp:
1624         (WebCore::DocumentLoader::continueAfterContentPolicy):
1625         * loader/NetscapePlugInStreamLoader.cpp:
1626         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
1627         * platform/network/ResourceResponseBase.cpp:
1628         (WebCore::ResourceResponseBase::isInHTTPFamily const):
1629         (WebCore::ResourceResponseBase::isHTTP const): Deleted.
1630         * platform/network/ResourceResponseBase.h:
1631         * xml/XMLHttpRequest.cpp:
1632         (WebCore::XMLHttpRequest::responseMIMEType const):
1633         * xml/parser/XMLDocumentParserLibxml2.cpp:
1634         (WebCore::externalEntityMimeTypeAllowed):
1635
1636 2020-05-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1637
1638         Tidy up Source/WebCore/page/DragController.h
1639         https://bugs.webkit.org/show_bug.cgi?id=212584
1640
1641         Reviewed by Anders Carlsson.
1642
1643         Unindent the `DragController` class by 1 indentation level, to adhere with
1644         <https://webkit.org/code-style-guidelines/#indentation-namespace>. Also, remove
1645         some stray trailing whitespace.
1646
1647         No change in behavior.
1648
1649         * page/DragController.h:
1650         (WebCore::DragController::mouseIsOverFileInput const):
1651         (WebCore::DragController::numberOfItemsToBeAccepted const):
1652         (WebCore::DragController::setDidInitiateDrag):
1653         (WebCore::DragController::didInitiateDrag const):
1654         (WebCore::DragController::sourceDragOperation const):
1655         (WebCore::DragController::draggingImageURL const):
1656         (WebCore::DragController::setDragOffset):
1657         (WebCore::DragController::dragOffset const):
1658         (WebCore::DragController::dragSourceAction const):
1659         (WebCore::DragController::dragHandlingMethod const):
1660         (WebCore::DragController::documentUnderMouse const):
1661         (WebCore::DragController::dragDestinationActionMask const):
1662         (WebCore::DragController::droppedImagePlaceholders const):
1663         (WebCore::DragController::droppedImagePlaceholderRange const):
1664         (WebCore::DragController::canLoadDataFromDraggingPasteboard const):
1665         (WebCore::DragController::client const):
1666
1667 2020-05-31  Dean Jackson  <dino@apple.com>
1668
1669         AutoTrader crashed while browsing search results
1670         https://bugs.webkit.org/show_bug.cgi?id=212461
1671         rdar://60733185
1672
1673         Reviewed by Sam Weinig.
1674
1675         On iOS, when using WebKit1 (UIWebView), CoreAnimation would
1676         call WebGLLayer's display method from a thread that is not
1677         the Web Thread. That method was performing some GL work using
1678         ANGLE, causing a crash.
1679
1680         Since all the WebGLLayer's display method really needs to do
1681         is swap buffers for compositing, the fix is to separate all
1682         the GL operations into a method that can be called after
1683         painting but before compositing. This should also have the added
1684         benefit that by the time CoreAnimation comes to call display
1685         on all the dirty layers, we will have already executed our
1686         expensive GPU work. The total amount of work done on the GPU
1687         is the same, but hopefully it is now all done in WebKit's
1688         paint cycle, rather than when the Window Server is trying
1689         to get CA to composite things.
1690
1691         Covered by a new API test: WebGLPrepareDisplayOnWebThread
1692
1693         * html/HTMLCanvasElement.h:
1694         * html/HTMLCanvasElement.cpp:
1695         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
1696         (WebCore::HTMLCanvasElement::~HTMLCanvasElement):
1697         (WebCore::HTMLCanvasElement::didMoveToNewDocument):
1698         (WebCore::HTMLCanvasElement::removedFromAncestor):
1699             Add or remove the document as a CanvasObserver.
1700         (WebCore::HTMLCanvasElement::needsPreparationForDisplay):
1701             Signals whether this element is the type that needs preparation.
1702         (WebCore::HTMLCanvasElement::prepareForDisplay):
1703             Tell the WebGLRenderingContext it must prepare.
1704
1705         * html/canvas/WebGLRenderingContextBase.h:
1706         * html/canvas/WebGLRenderingContextBase.cpp:
1707         (WebCore::WebGLRenderingContextBase::prepareForDisplay):
1708             The WebGLRenderingContext must forward the call
1709             to prepare down to the GraphicsContextGLOpenGL.
1710
1711         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
1712         * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
1713         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
1714         (WebCore::GraphicsContextGLOpenGL::prepareForDisplay):
1715             And the GraphicsContextGLOpenGL forwards the call
1716             into the WebGLLayer.
1717
1718         * platform/graphics/cocoa/WebGLLayer.h:
1719         * platform/graphics/cocoa/WebGLLayer.mm:
1720         (-[WebGLLayer prepareForDisplay]):
1721         (-[WebGLLayer display]):
1722             Split the parts of the `display` method that deal
1723             with flushing the GL commands, preparing the framebuffer texture,
1724             and swapping the IOSurfaces into a new `prepareForDisplay`. This
1725             method is invoked at the end of the rendering/layout tasks, leaving
1726             the `display` method to only tell CoreAnimation about a new buffer
1727             to composite.
1728
1729         * dom/Document.cpp:
1730         * dom/Document.h:
1731         (WebCore::Document::prepareCanvasesForDisplayIfNeeded):
1732         (WebCore::Document::canvasChanged):
1733         (WebCore::Document::canvasDestroyed):
1734             Keep a set of HTMLCanvasElements that need to
1735             be prepared so we can tell them when they need to prepare.
1736             Do this by becoming a CanvasObserver, thus getting
1737             notified when a canvas has done something that
1738             would cause painting.
1739
1740         * page/Page.cpp:
1741         (WebCore::Page::doAfterUpdateRendering):
1742             Add a new task that asks the Document to notify
1743             all relevant canvas objects that they should prepare
1744             for display.
1745
1746 2020-05-31  Jer Noble  <jer.noble@apple.com>
1747
1748         [Cocoa] EME should return more helpful error code during key exchange
1749         https://bugs.webkit.org/show_bug.cgi?id=212535
1750         <rdar://problem/60439979>
1751
1752         Reviewed by Eric Carlson.
1753
1754         Clients have requested that the EME API provide more helpful information when the FairPlay CDM is unable
1755         to provide the requested level of key security. Currently, we reject the update() promise with a generic
1756         "failed" error code. Instead, resolve the promise, but mark the key as "output-restricted" in the key
1757         status map, indicating that the key cannot be used with required level of security.
1758
1759         Drive-by fix: We currently ASSERT() that the callback from removeSessionData() isn't called if the session
1760         is not a PUR session. When calling removeSessionData() on a non-PUR session, call the callback with a generic
1761         "failed" error.
1762
1763         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1764         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
1765         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
1766         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
1767
1768 2020-05-31  Jer Noble  <jer.noble@apple.com>
1769
1770         [Cocoa] Transition between encrypted and clear codecs throws error from SourceBuffer.appendBuffer()
1771         https://bugs.webkit.org/show_bug.cgi?id=212550
1772         <rdar://problem/62207260>
1773
1774         Reviewed by Eric Carlson.
1775
1776         CoreMedia returns a different codec 4CC code for "encrypted AVC" than it does for "clear AVC", though
1777         the underlying codec used for both is the same. While CoreMedia does use different codec implementations
1778         for each, it is capable of freely switching between the two, and the codec string used by web developers
1779         for encrypted vs. clear content is identical. So we will treat these two codecs as "the same" as it pertains
1780         to the MSE requirement that codecs contained in new initialization segments are "the same" as previous
1781         ones. Adopt kCMFormatDescriptionExtension_ProtectedContentOriginalFormat, which can query the "original"
1782         codec used for encrypted codec playback.
1783
1784         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1785
1786 2020-05-31  Zalan Bujtas  <zalan@apple.com>
1787
1788         [iBooks] Empty pages appear in book
1789         https://bugs.webkit.org/show_bug.cgi?id=212573
1790         <rdar://problem/62912623>
1791
1792         Reviewed by Antti Koivisto.
1793
1794         Do not add a page break for orphan content unless the line does not fit anymore.
1795
1796         Test: fast/multicol/orphans-ignored.html
1797
1798         * rendering/SimpleLineLayoutPagination.cpp:
1799         (WebCore::SimpleLineLayout::setPageBreakForLine):
1800         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
1801
1802 2020-05-31  Rob Buis  <rbuis@igalia.com>
1803
1804         Implement named item condition for images
1805         https://bugs.webkit.org/show_bug.cgi?id=212473
1806
1807         Reviewed by Maciej Stachowiak.
1808
1809         Implement named item condition for images, not only should we
1810         check there are both an id and a name attribute, but also that
1811         the name attribute is non-empty [1].
1812
1813         Behavior matches Chrome and Firefox.
1814
1815         [1] https://html.spec.whatwg.org/multipage/dom.html#dom-document-nameditem-filter
1816
1817         Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-06.html
1818
1819         * html/HTMLNameCollection.cpp:
1820         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
1821
1822 2020-05-31  Rob Buis  <rbuis@igalia.com>
1823
1824         <area> needs to be connected in order to navigate
1825         https://bugs.webkit.org/show_bug.cgi?id=177357
1826
1827         Reviewed by Maciej Stachowiak.
1828
1829         Implement second step of cannot navigate algorithm:
1830         https://html.spec.whatwg.org/#cannot-navigate
1831
1832         Test: web-platform-tests/html/semantics/links/following-hyperlinks/activation-behavior.window.html
1833
1834         * html/HTMLAnchorElement.cpp:
1835         (WebCore::HTMLAnchorElement::handleClick):
1836
1837 2020-05-30  Sam Weinig  <weinig@apple.com>
1838
1839         Extended Color: Additional color cleanups
1840         https://bugs.webkit.org/show_bug.cgi?id=212567
1841
1842         Reviewed by Simon Fraser.
1843
1844         A few unrelated quality-of-life cleanups to Color and related classes:
1845         - Rename Color::asSimpleColor() to Color::asSimple() for parity with Color::asExtended().
1846         - Move SimpleColor implementations of invertedColorWithAlpha() and asSRGBFloatComponents()
1847           to SimpleColor for parity with ExtenedColor.
1848         - Rename ExtendedColor::channels() to ExtendedColor::components() to consistency.
1849         - Adds operator[] to ColorComponents to allow direct access to components rather than
1850           requiring and additional .components[]
1851         - Using std::minmax() where possible.
1852         - Renaming colorFloatToSimpleColorByte to scaleRoundAndClampColorChannel to have a consistent 
1853           naming and location of conversion to 8-bit color channels.
1854
1855         * platform/graphics/Color.cpp:
1856         (WebCore::Color::serialized const):
1857         (WebCore::Color::cssText const):
1858         (WebCore::Color::nameForRenderTreeAsText const):
1859         (WebCore::Color::light const):
1860         (WebCore::Color::dark const):
1861         (WebCore::Color::colorWithAlpha const):
1862         (WebCore::Color::colorWithAlphaUsingAlternativeRounding const):
1863         (WebCore::Color::invertedColorWithAlpha const):
1864         (WebCore::Color::colorSpaceAndComponents const):
1865         (WebCore::Color::toSRGBASimpleColorLossy const):
1866         (WebCore::Color::toSRGBAComponentsLossy const):
1867         * platform/graphics/Color.h:
1868         (WebCore::Color::isOpaque const):
1869         (WebCore::Color::isVisible const):
1870         (WebCore::Color::alpha const):
1871         (WebCore::Color::alphaAsFloat const):
1872         (WebCore::Color::asSimple const):
1873         (WebCore::Color::isBlackColor):
1874         (WebCore::Color::isWhiteColor):
1875         (WebCore::Color::encode const):
1876         (WebCore::Color::asSimpleColor const): Deleted.
1877         * platform/graphics/ColorComponents.h:
1878         (WebCore::ColorComponents::operator[]):
1879         (WebCore::ColorComponents::operator[] const):
1880         (WebCore::=):
1881         (WebCore::perComponentMax):
1882         (WebCore::perComponentMin):
1883         * platform/graphics/ColorMatrix.h:
1884         (WebCore::Rows>::transformedColorComponents const):
1885         * platform/graphics/ColorUtilities.cpp:
1886         (WebCore::areEssentiallyEqual):
1887         (WebCore::rgbToLinearComponents):
1888         (WebCore::linearToRGBComponents):
1889         (WebCore::lightness):
1890         (WebCore::luminance):
1891         (WebCore::sRGBToHSL):
1892         (WebCore::hslToSRGB):
1893         * platform/graphics/ColorUtilities.h:
1894         (WebCore::scaleRoundAndClampColorChannel):
1895         (WebCore::scaleRoundAndClampColorChannelUsingAlternativeRounding):
1896         (WebCore::colorFloatToSimpleColorByte): Deleted.
1897         * platform/graphics/ExtendedColor.cpp:
1898         (WebCore::ExtendedColor::hash const):
1899         (WebCore::ExtendedColor::cssText const):
1900         (WebCore::ExtendedColor::colorWithAlpha const):
1901         (WebCore::ExtendedColor::invertedColorWithAlpha const):
1902         (WebCore::ExtendedColor::toSRGBAComponentsLossy const):
1903         (WebCore::ExtendedColor::isWhite const):
1904         (WebCore::ExtendedColor::isBlack const):
1905         * platform/graphics/ExtendedColor.h:
1906         (WebCore::ExtendedColor::alpha const):
1907         (WebCore::ExtendedColor::components const):
1908         (WebCore::ExtendedColor::ExtendedColor):
1909         (WebCore::operator==):
1910         (WebCore::ExtendedColor::channels const): Deleted.
1911         * platform/graphics/SimpleColor.cpp:
1912         (WebCore::makeSimpleColorFromFloats):
1913         (WebCore::makeSimpleColorFromHSLA):
1914         * platform/graphics/SimpleColor.h:
1915         (WebCore::SimpleColor::SimpleColor):
1916         (WebCore::SimpleColor::valueAsARGB const):
1917         (WebCore::SimpleColor::colorWithAlpha const):
1918         (WebCore::SimpleColor::invertedColorWithAlpha const):
1919         (WebCore::SimpleColor::asSRGBFloatComponents const):
1920         (WebCore::makeSimpleColor):
1921         * platform/graphics/cg/ColorCG.cpp:
1922         (WebCore::cachedCGColor):
1923         * platform/graphics/filters/FELighting.cpp:
1924         (WebCore::FELighting::drawLighting):
1925         * platform/graphics/filters/FETurbulence.cpp:
1926         (WebCore::toIntBasedColorComponents):
1927         * platform/graphics/filters/FilterOperation.cpp:
1928         (WebCore::BasicComponentTransferFilterOperation::transformColor const):
1929         (WebCore::InvertLightnessFilterOperation::transformColor const):
1930         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
1931         * platform/graphics/filters/FilterOperations.cpp:
1932         (WebCore::FilterOperations::transformColor const):
1933         (WebCore::FilterOperations::inverseTransformColor const):
1934
1935 2020-05-30  Commit Queue  <commit-queue@webkit.org>
1936
1937         Unreviewed, reverting r262335.
1938         https://bugs.webkit.org/show_bug.cgi?id=212571
1939
1940         Triggered assertions in WebKit1
1941
1942         Reverted changeset:
1943
1944         "Disallow responses when a response contains invalid header
1945         values"
1946         https://bugs.webkit.org/show_bug.cgi?id=184493
1947         https://trac.webkit.org/changeset/262335
1948
1949 2020-05-30  Simon Fraser  <simon.fraser@apple.com>
1950
1951         For scroll container and scrolled contents layers, use the renderer style to set up the event regions
1952         https://bugs.webkit.org/show_bug.cgi?id=212570
1953
1954         Reviewed by Antti Koivisto.
1955
1956         RenderLayerBacking::updateEventRegion() sets up event regions on the scroll container and scrolled contents
1957         layer using the default style, in order to fill up the m_region part of EventRegion, but we might as well
1958         pass the renderer style so that it fills up the touch-action and wheel event regions as well.
1959
1960         Also re-use the existing event region trace points for region building.
1961
1962         * rendering/RenderLayerBacking.cpp:
1963         (WebCore::RenderLayerBacking::updateEventRegion):
1964
1965 2020-05-30  Andy Estes  <aestes@apple.com>
1966
1967         [Apple Pay] Support percentage border-radius values in -apple-pay-button
1968         https://bugs.webkit.org/show_bug.cgi?id=212559
1969         <rdar://problem/63781881>
1970
1971         Reviewed by Antti Koivisto.
1972
1973         Added test cases to fast/css/appearance-apple-pay-button-border-radius.html.
1974
1975         * rendering/RenderThemeCocoa.mm:
1976         (WebCore::RenderThemeCocoa::paintApplePayButton): Used floatValueForLength() to ensure
1977         percentage lengths are resolved before passing a corner radius to PassKit.
1978
1979 2020-05-29  Yusuke Suzuki  <ysuzuki@apple.com>
1980
1981         [JSC] JSBigInt allocation should be graceful for OOM
1982         https://bugs.webkit.org/show_bug.cgi?id=212512
1983
1984         Reviewed by Mark Lam.
1985
1986         * bindings/js/SerializedScriptValue.cpp:
1987         (WebCore::CloneDeserializer::readBigInt):
1988
1989 2020-05-29  Simon Fraser  <simon.fraser@apple.com>
1990
1991         Event region painting should use the same paint flags as normal painting
1992         https://bugs.webkit.org/show_bug.cgi?id=212547
1993
1994         Reviewed by Sam Weinig.
1995
1996         There are cases (see r260118) where we need to send down the correct paint flags when
1997         painting the scrolled contents layer to avoid unwanted clipping. We need to send down
1998         the one paint flag relevant for event region paints, CompositedOverflowScrollContent,
1999         for the same reasons.
2000
2001         I could not make a testcase that shows a behavior change, but I did copy the testcase
2002         from r260118 and adapt it for event-region generation to detect future behavior changes.
2003
2004         Test: fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll-clipped-out.html
2005
2006         * rendering/RenderLayer.cpp:
2007         (WebCore::RenderLayer::paintLayerContents):
2008         (WebCore::RenderLayer::collectEventRegionForFragments):
2009         * rendering/RenderLayer.h:
2010
2011 2020-05-29  Simon Fraser  <simon.fraser@apple.com>
2012
2013         Elements with wheel event handlers inside overflow:scroll are missing from the event region
2014         https://bugs.webkit.org/show_bug.cgi?id=212545
2015
2016         Reviewed by Zalan Bujtas.
2017
2018         RenderBlock::paintObject() needs to traverse into descendants if there are are
2019         wheel event handlers on the document, just as it does for elements with touch-action.
2020
2021         Test: fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll.html
2022
2023         * dom/Document.h:
2024         (WebCore::Document::hasTouchEventHandlers const):
2025         (WebCore::Document::hasWheelEventHandlers const):
2026         * rendering/RenderBlock.cpp:
2027         (WebCore::RenderBlock::paintObject):
2028
2029 2020-05-29  Rob Buis  <rbuis@igalia.com>
2030
2031         Disallow responses when a response contains invalid header values
2032         https://bugs.webkit.org/show_bug.cgi?id=184493
2033
2034         Reviewed by Youenn Fablet.
2035
2036         From the Fetch specification [1]:
2037         "A value is a byte sequence that matches the following conditions:
2038         "- Contains no 0x00 (NUL) or HTTP newline bytes."
2039
2040         [1] https://fetch.spec.whatwg.org/#concept-header-value
2041
2042         Tests: imported/w3c/web-platform-tests/fetch/h1-parsing/resources-with-0x00-in-header.window.html
2043                imported/web-platform-tests/fetch/api/basic/header-value-combining.any.html
2044                imported/web-platform-tests/fetch/api/basic/header-value-combining.any.worker.html
2045                imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.html
2046                imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.worker.html
2047                imported/web-platform-tests/xhr/headers-normalize-response.htm
2048
2049         * Modules/fetch/FetchHeaders.cpp:
2050         (WebCore::canWriteHeader):
2051         (WebCore::appendToHeaderMap):
2052         (WebCore::FetchHeaders::filterAndFill):
2053         * loader/DocumentThreadableLoader.cpp:
2054         (WebCore::DocumentThreadableLoader::loadRequest):
2055         * loader/SubresourceLoader.cpp:
2056         (WebCore::SubresourceLoader::didReceiveResponse):
2057         * platform/network/ResourceResponseBase.cpp:
2058         (WebCore::ResourceResponseBase::containsInvalidHTTPHeaders const):
2059         * platform/network/ResourceResponseBase.h:
2060
2061 2020-05-29  Andy Estes  <aestes@apple.com>
2062
2063         [Apple Pay] Remove conditionals for ENABLE_APPLE_PAY_SESSION_V(3|4)
2064         https://bugs.webkit.org/show_bug.cgi?id=212541
2065
2066         Reviewed by Darin Adler.
2067
2068         APPLE_PAY_SESSION_V(3|4) is now enabled whenever APPLE_PAY itself is enabled.
2069
2070         * Configurations/FeatureDefines.xcconfig:
2071         * Modules/applepay/ApplePayError.idl:
2072         * Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
2073         * Modules/applepay/ApplePayPaymentContact.idl:
2074         * Modules/applepay/ApplePayPaymentMethodUpdate.idl:
2075         * Modules/applepay/ApplePayRequestBase.idl:
2076         * Modules/applepay/ApplePaySession.idl:
2077         * Modules/applepay/ApplePayShippingContactUpdate.idl:
2078         * Modules/applepay/ApplePayShippingMethodUpdate.idl:
2079         * Modules/applepay/PaymentCoordinatorClient.cpp:
2080         (WebCore::PaymentCoordinatorClient::supportsVersion):
2081         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2082         (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const):
2083         * accessibility/AccessibilityRenderObject.cpp:
2084         (WebCore::AccessibilityRenderObject::applePayButtonDescription const):
2085         * css/CSSPrimitiveValueMappings.h:
2086         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2087         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
2088         * css/CSSValueKeywords.in:
2089         * css/parser/CSSParserFastPaths.cpp:
2090         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2091         * rendering/RenderThemeCocoa.mm:
2092         (WebCore::toPKPaymentButtonType):
2093         * rendering/style/RenderStyleConstants.cpp:
2094         (WebCore::operator<<):
2095         * rendering/style/RenderStyleConstants.h:
2096
2097 2020-05-29  Jer Noble  <jer.noble@apple.com>
2098
2099         [EME] navigator.requestMediaKeySystemAccess() should reject PUR sessionTypes in private browsing mode.
2100         https://bugs.webkit.org/show_bug.cgi?id=212540
2101         <rdar://problem/61125757>
2102
2103         Reviewed by Eric Carlson.
2104
2105         A MediaKeySystemAccess with a PUR session type will never be able to create media keys when created in
2106         private browsing mode. Allow clients to fail over to non-PUR session by rejecting the promise returned by
2107         requestMediaKeySystemAccess() when in private browsing mode.
2108
2109         Test: platform/mac/media/encrypted-media/fps-ephemeral-requestMediaKeySystemAccess.html
2110
2111         * Modules/encryptedmedia/CDM.cpp:
2112         (WebCore::CDM::getSupportedConfiguration):
2113
2114 2020-05-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2115
2116         [iOS] Unable to paste images when composing mail at yahoo.com
2117         https://bugs.webkit.org/show_bug.cgi?id=212544
2118         <rdar://problem/63511613>
2119
2120         Reviewed by Megan Gardner and Andy Estes.
2121
2122         When pasting images in the mobile version of the mail compose editor on mail.yahoo.com, mail.yahoo.com's script
2123         handles the paste by allowing images to be inserted into the DOM (i.e. by not preventing the "paste" event), and
2124         then stripping away the `src` attribute of the pasted image afterwards. This leaves behind a blank space in the
2125         email.
2126
2127         Work around this by avoiding images when converting the contents of the pasteboard into web content on iOS.
2128         Instead, we fall back to inserting (sanitized) text, or nothing at all if there is no other representation
2129         suitable for converting into web content.
2130
2131         Unfortunately, the mobile version of the website is loaded on iPad as well, even when the desktop website has
2132         been requested (through sending the macOS user agent and "MacIntel" navigator platform).
2133
2134         * editing/cocoa/WebContentReaderCocoa.mm:
2135         (WebCore::WebContentReader::readImage):
2136         * page/Quirks.cpp:
2137         (WebCore::Quirks::shouldAvoidPastingImagesAsWebContent const):
2138         * page/Quirks.h:
2139
2140 2020-05-29  Darin Adler  <darin@apple.com>
2141
2142         Remove things from FeatureDefines.xcconfig that are covered by PlatformEnableCocoa.h
2143         https://bugs.webkit.org/show_bug.cgi?id=212418
2144
2145         Rubber-stamped by Simon Fraser.
2146
2147         * Configurations/FeatureDefines.xcconfig: Add back ENABLE_CSS_CONIC_GRADIENTS, removed
2148         by accident.
2149
2150 2020-05-29  Jacob Uphoff  <jacob_uphoff@apple.com>
2151
2152         Unreviewed, reverting r262289.
2153
2154         This commit caused a test to crash internally
2155
2156         Reverted changeset:
2157
2158         "MediaPlayerPrivateMediaStreamAVFObjC should enqueue samples
2159         in a background thread"
2160         https://bugs.webkit.org/show_bug.cgi?id=212073
2161         https://trac.webkit.org/changeset/262289
2162
2163 2020-05-27  Darin Adler  <darin@apple.com>
2164
2165         Remove things from FeatureDefines.xcconfig that are covered by PlatformEnableCocoa.h
2166         https://bugs.webkit.org/show_bug.cgi?id=212418
2167
2168         Reviewed by Andy Estes.
2169
2170         * Configurations/FeatureDefines.xcconfig: Removed 83 of the 119 things defined in
2171         this file. There are 36 more that are slightly more complex that we can remove
2172         carefully later.
2173
2174 2020-05-29  Darin Adler  <darin@apple.com>
2175
2176         Make generate-unified-sources.sh not depend on features being listed in FEATURE_DEFINES environment variable
2177         https://bugs.webkit.org/show_bug.cgi?id=212420
2178
2179         Currently any #if in the Sources.txt and SourcesCocoa.txt files can check only features
2180         defined in the FeatureDefines.xcconfig file, which sets up the FEATURE_DEFINES environment
2181         variable. Instead, we'd like to pass in all the things defined in the Platform.h headers
2182         as well. We accomplish that using the FEATURE_AND_PLATFORM_DEFINES variable from the
2183         DerivedSources.make file. This was the last place using FEATURE_DEFINES directly, so it
2184         frees us up to reduce FeatureDefines.xcconfig and move feature definitions to
2185         PlatformEnableCocoa.h instead, which will be less repetitive.
2186
2187         Reviewed by Andy Estes.
2188
2189         * Configurations/GenerateUnifiedSources.xcconfig: Deleted.
2190         * DerivedSources-input.xcfilelist: Updated.
2191         * DerivedSources-output.xcfilelist: Updated.
2192         * DerivedSources.make: Added a rule to invoke generate-unified-sources.sh, passing
2193         FEATURE_AND_PLATFORM_DEFINES.
2194         * Scripts/generate-unified-sources.sh: Removed hard-coded use of FEATURE_DEFINES.
2195         * UnifiedSources-output.xcfilelist: Deleted.
2196         * WebCore.xcodeproj/project.pbxproj: Removed Generate Unified Sources build step,
2197         since it's now part of Generate Derived Sources.
2198
2199 2020-05-29  Darin Adler  <darin@apple.com>
2200
2201         [Cocoa] Pass all defines from Platform.h to various scripts, not just the ones from .xcconfig
2202         https://bugs.webkit.org/show_bug.cgi?id=212451
2203
2204         Reviewed by Sam Weinig.
2205
2206         * DerivedSources.make: Run the preprocessor on Platform.h and parse the output into
2207         FEATURE_AND_PLATFORM_DEFINES. Use that and FEATURE_AND_PLATFORM_DEFINE_DEPENDENCIES
2208         whenever we need a list of defines. Also took out some Windows-specific stuff since
2209         this is now only used on Mac platforms. Use ":=" when calling $(shell) to make sure
2210         the same shell command is not invoked over and over again.
2211
2212 2020-05-29  Keith Rollin  <krollin@apple.com>
2213
2214         Revert switch to XCBuild
2215         https://bugs.webkit.org/show_bug.cgi?id=212530
2216         <rdar://problem/63764632>
2217
2218         Unreviewed build fix.
2219
2220         Bug 209890 enabled the use of XCBuild by default. Since then, some
2221         build issues have shown up. While addressing them, temporarily turn
2222         off the use of XCBuild by default.
2223
2224         No new tests -- build fix.
2225
2226         * WebCore.xcodeproj/project.pbxproj:
2227
2228 2020-05-29  Myles C. Maxfield  <mmaxfield@apple.com>
2229
2230         REGRESSION(r261940): PLT5 is 2% regressed
2231         https://bugs.webkit.org/show_bug.cgi?id=212504
2232         <rdar://problem/63685637>
2233
2234         Reviewed by Wenson Hsieh.
2235
2236         We were causing spurious style recalcs on every main frame load.
2237
2238         No new tests because there is no behavior change.
2239
2240         * page/Settings.yaml:
2241
2242 2020-05-29  Sam Weinig  <weinig@apple.com>
2243
2244         Extended Color: ColorMatrix should support smaller matrices and be constexpr
2245         https://bugs.webkit.org/show_bug.cgi?id=212477
2246
2247         Reviewed by Simon Fraser.
2248
2249         - Adds the ability to specify a ColorMatrix with any number of rows or columns,
2250           useful as most of the uses ColorMatrix did not need the full 5x4. Transformation
2251           act as-if the the ColorMatrix is the identify matrix for any rows or columns
2252           not present. For example, when transforming a ColorComponents, which is 4x1, a 
2253           3x3 ColorMatrix of the form:
2254
2255               [ a, b, c ]
2256               [ d, e, f ]
2257               [ g, h, i ]
2258               
2259           will behave as-if it looks like:
2260           
2261               [ a, b, c, 0 ]
2262               [ d, e, f, 0 ]
2263               [ g, h, i, 0 ]
2264               [ 0, 0, 0, 1 ]
2265         
2266           In practice, this means that the last component of the input vector is left
2267           unmodified.
2268
2269         - Adds ability to use ColorMatrix in constexpr statements, which will be useful
2270           for compile time concatenation of colorspace conversion matrices in a future
2271           change but is also useful for improved space efficiency of constant matrices
2272           already used.
2273
2274         * Sources.txt:
2275         * WebCore.xcodeproj/project.pbxproj:
2276         Remove ColorMatrix.cpp
2277
2278         * platform/graphics/ColorComponents.h:
2279         (WebCore::ColorComponents::ColorComponents):
2280         (WebCore::ColorComponents::operator+=):
2281         (WebCore::ColorComponents::operator+ const):
2282         (WebCore::ColorComponents::operator/ const):
2283         (WebCore::ColorComponents::operator* const):
2284         (WebCore::ColorComponents::abs const):
2285         (WebCore::ColorComponents::get const):
2286         (WebCore::perComponentMax):
2287         (WebCore::perComponentMin):
2288         (WebCore::operator==):
2289         (WebCore::operator!=):
2290         Make everything constexpr and move implementations out of the declarations for clarity.
2291
2292         * platform/graphics/ColorMatrix.cpp: Removed.
2293         * platform/graphics/ColorMatrix.h:
2294         (WebCore::ColorMatrix::ColorMatrix):
2295         (WebCore::ColorMatrix::at const):
2296         (WebCore::grayscaleColorMatrix):
2297         (WebCore::sepiaColorMatrix):
2298         (WebCore::saturationColorMatrix):
2299         (WebCore::hueRotateColorMatrix):
2300         (WebCore::ColorMatrix::transformColorComponents):
2301         (WebCore::ColorMatrix::transformedColorComponents):
2302         Re-write as a class templatized on the number of rows and columns. Moves factory functions
2303         out of the class to avoid awkwardness of having to specify a dummy size when calling them 
2304         (e.g. we wouldn't want you to have to write ColorMatrix<3, 3>::grayscaleMatrix(), instead
2305         just grayscaleColorMatrix() is much nicer).
2306
2307         * platform/graphics/ColorUtilities.cpp:
2308         (WebCore::xyzToLinearSRGB):
2309         (WebCore::linearSRGBToXYZ):
2310         (WebCore::XYZToLinearP3):
2311         (WebCore::linearP3ToXYZ):
2312         * platform/graphics/filters/FilterOperation.cpp:
2313         (WebCore::BasicColorMatrixFilterOperation::transformColor const):
2314         (WebCore::InvertLightnessFilterOperation::transformColor const):
2315         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
2316         Adopt new ColorMatrix interface.
2317
2318         * platform/graphics/filters/FilterOperation.h:
2319         Remove unnecessary T in forward declaration.
2320
2321         * platform/graphics/ColorUtilities.h:
2322         (WebCore::fastMultiplyBy255):
2323         (WebCore::fastDivideBy255):
2324         Add some missing constexprs.
2325
2326 2020-05-29  Commit Queue  <commit-queue@webkit.org>
2327
2328         Unreviewed, reverting r262245.
2329         https://bugs.webkit.org/show_bug.cgi?id=212531
2330
2331         "Caused WebCore's 'Check .xcfilelists' build phase to be ~100x
2332         slower"
2333
2334         Reverted changeset:
2335
2336         "[Cocoa] Pass all defines from Platform.h to various scripts,
2337         not just the ones from .xcconfig"
2338         https://bugs.webkit.org/show_bug.cgi?id=212451
2339         https://trac.webkit.org/changeset/262245
2340
2341 2020-05-29  Sergio Villar Senin  <svillar@igalia.com>
2342
2343         Unreviewed build fix after r262299
2344
2345         We replaced ScriptExecutionContext* by Document& in WebXRSpace hierarchy, so the
2346         failing ASSERT() was:
2347         1. Invalid, there is no "context" parameter but "document"
2348         2. Not needed anymore, as we're passing a reference
2349
2350         * Modules/webxr/WebXRSpace.cpp:
2351         (WebCore::WebXRSpace::WebXRSpace): Removed invalid ASSERT().
2352
2353 2020-05-27  Sergio Villar Senin  <svillar@igalia.com>
2354
2355         [WebXR] Implement XRSession::requestReferenceSpace()
2356         https://bugs.webkit.org/show_bug.cgi?id=212407
2357
2358         Reviewed by Youenn Fablet.
2359
2360         This patch implements the requestReferenceSpace() method of the XRSession which is used to
2361         create reference spaces. A reference space establishes a space where pose data will be defined
2362         and thus is mandatory to retrieve that pose information.
2363
2364         There are still some bits that have to implementated in follow up patches using platform code.
2365
2366         * Modules/webxr/WebXRBoundedReferenceSpace.cpp:
2367         (WebCore::WebXRBoundedReferenceSpace::create): Added.
2368         (WebCore::WebXRBoundedReferenceSpace::WebXRBoundedReferenceSpace): Ditto.
2369         * Modules/webxr/WebXRBoundedReferenceSpace.h:
2370         * Modules/webxr/WebXRReferenceSpace.cpp:
2371         (WebCore::WebXRReferenceSpace::create): Added.
2372         (WebCore::WebXRReferenceSpace::WebXRReferenceSpace): Ditto.
2373         (WebCore::WebXRReferenceSpace::getOffsetReferenceSpace): Use the create() method.
2374         * Modules/webxr/WebXRReferenceSpace.h:
2375         * Modules/webxr/WebXRSession.cpp:
2376         (WebCore::WebXRSession::referenceSpaceIsSupported const): New method to check whether a reference.
2377         space is supported by session and device.
2378         (WebCore::WebXRSession::requestReferenceSpace): New method that creates reference spaces for pose data.
2379         * Modules/webxr/WebXRSession.h:
2380         * Modules/webxr/WebXRSpace.cpp:
2381         (WebCore::WebXRSpace::WebXRSpace): Store a reference to the session creating the space.
2382         * Modules/webxr/WebXRSpace.h:
2383
2384 2020-05-29  Simon Fraser  <simon.fraser@apple.com>
2385
2386         Update debug overlays at rendering update time
2387         https://bugs.webkit.org/show_bug.cgi?id=212510
2388
2389         Reviewed by Antoine Quint.
2390
2391         Don't eagerly update the regions in debug overlays when things change; this triggers
2392         assertions for touch event overlays.
2393
2394         Instead, just mark them dirty and update the regions at "update the rendering" time.
2395
2396         * page/DebugPageOverlays.cpp:
2397         (WebCore::RegionOverlay::setRegionChanged):
2398         (WebCore::RegionOverlay::didMoveToPage):
2399         (WebCore::RegionOverlay::recomputeRegion):
2400         (WebCore::DebugPageOverlays::regionChanged):
2401         (WebCore::DebugPageOverlays::updateRegionIfNecessary):
2402         * page/DebugPageOverlays.h:
2403         (WebCore::DebugPageOverlays::doAfterUpdateRendering):
2404         * page/Page.cpp:
2405         (WebCore::Page::doAfterUpdateRendering):
2406
2407 2020-05-29  Simon Fraser  <simon.fraser@apple.com>
2408
2409         Prepare for async scrolling in passive wheel event handler regions
2410         https://bugs.webkit.org/show_bug.cgi?id=212455
2411
2412         Reviewed by Tim Horton.
2413
2414         Clarify the processing for wheel events by adding OptionSet<WheelEventProcessingSteps>,
2415         which will, in future, allow us to describe the processing for an event in the passive
2416         event handler region which does scrolling on the scrolling thread, and is then sent
2417         to the main thread for DOM event dispatch.
2418         
2419         Removed ScrollingEventResult, which conflated "handled" with "send to another thread".
2420         The thread sending behavior is now encoded in the WheelEventProcessingSteps, and we can just
2421         use a bool for handled.
2422         
2423         Scrolling tree and node handleWheelEvent() functions return a WheelEventHandlingResult, which
2424         is a tuple of OptionSet<WheelEventProcessingSteps> and 'handled', allowing for a node with
2425         background-attachment:fixed to add the "send to main thread" processing step.
2426
2427         * page/FrameView.cpp:
2428         (WebCore::FrameView::wheelEvent):
2429         * page/scrolling/ScrollingCoordinator.h:
2430         (WebCore::ScrollingCoordinator::handleWheelEvent):
2431         * page/scrolling/ScrollingCoordinatorTypes.h:
2432         * page/scrolling/ScrollingTree.cpp:
2433         (WebCore::ScrollingTree::determineWheelEventProcessing):
2434         (WebCore::ScrollingTree::handleWheelEvent):
2435         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Deleted.
2436         * page/scrolling/ScrollingTree.h:
2437         (WebCore::WheelEventHandlingResult::needsMainThreadProcessing const):
2438         (WebCore::WheelEventHandlingResult::handled):
2439         (WebCore::WheelEventHandlingResult::unhandled):
2440         (WebCore::WheelEventHandlingResult::result):
2441         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2442         (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
2443         * page/scrolling/ScrollingTreeScrollingNode.h:
2444         * page/scrolling/ThreadedScrollingTree.cpp:
2445         (WebCore::ThreadedScrollingTree::handleWheelEvent):
2446         (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
2447         * page/scrolling/ThreadedScrollingTree.h:
2448         * page/scrolling/mac/ScrollingCoordinatorMac.h:
2449         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2450         (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
2451         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2452         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2453         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2454         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2455         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2456         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
2457         * platform/PlatformWheelEvent.cpp:
2458         (WebCore::operator<<):
2459         * platform/PlatformWheelEvent.h:
2460
2461 2020-05-29  Sergio Villar Senin  <svillar@igalia.com>
2462
2463         [WebXR] ActiveDOMObjects must call suspendIfNeeded() upon creation
2464         https://bugs.webkit.org/show_bug.cgi?id=212517
2465
2466         Reviewed by Žan Doberšek.
2467
2468         We weren't calling suspendIfNeeded() upon ActiveDOMObjects creation (XRSession and XRSystem)
2469         and that was triggering ASSERTION FAILED: m_suspendIfNeededWasCalled.
2470
2471         No new tests required as this was already detected by existing tests.
2472
2473         * Modules/webxr/WebXRSession.cpp:
2474         (WebCore::WebXRSession::WebXRSession): Call suspendIfNeeded().
2475         * Modules/webxr/WebXRSystem.cpp:
2476         (WebCore::WebXRSystem::WebXRSystem): Call suspendIfNeeded().
2477
2478 2020-05-29  Sergio Villar Senin  <svillar@igalia.com>
2479
2480         [WebXR] WebXRSystem::unregisterSimulatedXRDeviceForTesting() ASSERTs in m_immersiveDevices.contains(device)
2481         https://bugs.webkit.org/show_bug.cgi?id=212516
2482
2483         Reviewed by Žan Doberšek.
2484
2485         The ASSERT that was failing was wrong. It was assuming that every simulated device should be part of the list
2486         of immersive devices. That's wrong, as devices only supporting inline sessions are not in that list.
2487
2488         Apart from that, fake devices were not removed from the list of available devices in WebXRTest after
2489         disconnecting them all. That could potentially cause flakiness in the tests.
2490
2491         No new test required as the current tests were properly detecting the issue.
2492
2493         * Modules/webxr/WebXRSystem.cpp:
2494         (WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Use XRSessionMode directly.
2495         (WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Fixed the ASSERT. A simulated device
2496         might not be in the list of immersive devices if only supports inline sessions.
2497         * testing/WebXRTest.cpp:
2498         (WebCore::WebXRTest::disconnectAllDevices): Clear the list of devices after disconnecting.
2499
2500 2020-05-29  Youenn Fablet  <youenn@apple.com>
2501
2502         MediaPlayerPrivateMediaStreamAVFObjC should enqueue samples in a background thread
2503         https://bugs.webkit.org/show_bug.cgi?id=212073
2504
2505         Reviewed by Eric Carlson.
2506
2507         Do not hop to the main thread when rendering video samples anymore.
2508         Instead, we enqueue to the display layer in the background thread but still hop to the main thread for two things:
2509         - Update of various states of the player
2510         - keep a ref to the video sample if canvas rendering is needed.
2511
2512         Most display layer operations stay in the main thread (creation, flushing...).
2513         Deletion of the display layer and access from a background are covered by a lock.
2514         The m_canEnqueueDisplayLayer boolean ensures we do not enqueue too early when the display layer is not yet properly initialized.
2515
2516         LocalSampleBufferDisplayLayer needs to handle the fact that enqueueing might be done in a background thread.
2517         Instead of introducing a lock, we introduce a work queue and we hop to this queue whenever we need to enqueue/mutate the pending samples.
2518
2519         Covered by existing tests and manual testing.
2520
2521         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h:
2522         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
2523         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
2524         (WebCore::LocalSampleBufferDisplayLayer::enqueueSample):
2525         (WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer):
2526         (WebCore::LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData):
2527         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2528         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2529         (WebCore::videoTransformationMatrix):
2530         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::processNewVideoSampleAvailable):
2531         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
2532         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive):
2533         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers):
2534         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2535         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
2536         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateRenderingMode):
2537         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
2538         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2539         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
2540         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rootLayerBoundsDidChange):
2541         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Deleted.
2542         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Deleted.
2543         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer): Deleted.
2544
2545 2020-05-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2546
2547         [GTK4] Implement script dialogs
2548         https://bugs.webkit.org/show_bug.cgi?id=212318
2549
2550         Reviewed by Adrian Perez de Castro.
2551
2552         Add more definitions to avoid ifdefs.
2553
2554         * platform/gtk/GtkVersioning.h:
2555         (gtk_entry_set_text):
2556         (gtk_entry_get_text):
2557         (gtk_label_set_line_wrap):
2558         (gtk_window_set_default):
2559         (gtk_widget_add_css_class):
2560
2561 2020-05-28  Andy Estes  <aestes@apple.com>
2562
2563         [Apple Pay] Buttons render with a corner radius of PKApplePayButtonDefaultCornerRadius even when explicitly specifying "border-radius: 0px"
2564         https://bugs.webkit.org/show_bug.cgi?id=212476
2565         <rdar://problem/63401433>
2566
2567         Reviewed by Antti Koivisto.
2568
2569         r256648 added support for customizing the corner radius of Apple Pay buttons using the
2570         border-radius CSS property. PassKit buttons have a default corner radius of 4, but
2571         border-radius has an initial value of 0, so to maintain web compatibility with existing
2572         buttons we only want to customize the corner radius when a border-radius value has been
2573         explicitly specified (otherwise, previously rounded buttons would all become squared off due
2574         to border-radius's initial value).
2575
2576         r256648 checked for a non-initial border-radius by calling RenderStyle::hasBorderRadius, but
2577         this check does not distinguish between an initial value and an explicit declaration of
2578         "border-radius: 0px". As a result, authors are unable to create Apple Pay buttons with
2579         square corners.
2580
2581         This patch adds a flag to RenderStyle::NonInheritedFlags that tracks whether any
2582         border-radius longhand has been explicitly set (or has explicitly inherited an explicitly set
2583         value), and uses that flag to adjust the computed border radius for Apple Pay buttons.
2584
2585         The addition of RenderStyle::NonInheritedFlags::hasExplicitlySetBorderRadius did not change
2586         the size of RenderStyle.
2587
2588         Tests: fast/css/appearance-apple-pay-button-border-radius.html
2589                fast/css/getComputedStyle/computed-style-apple-pay-button.html
2590
2591         * css/CSSProperties.json:
2592         * rendering/RenderThemeCocoa.mm:
2593         (WebCore::RenderThemeCocoa::adjustApplePayButtonStyle const):
2594         (WebCore::RenderThemeCocoa::paintApplePayButton):
2595         (WebCore::largestCornerRadius): Deleted.
2596         * rendering/style/RenderStyle.cpp:
2597         (WebCore::RenderStyle::RenderStyle):
2598         * rendering/style/RenderStyle.h:
2599         (WebCore::RenderStyle::hasExplicitlySetBorderRadius const):
2600         (WebCore::RenderStyle::setHasExplicitlySetBorderRadius):
2601         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
2602         (WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom):
2603         * style/StyleBuilderCustom.h:
2604         (WebCore::Style::BuilderCustom::applyInheritBorderBottomLeftRadius):
2605         (WebCore::Style::BuilderCustom::applyValueBorderBottomLeftRadius):
2606         (WebCore::Style::BuilderCustom::applyInheritBorderBottomRightRadius):
2607         (WebCore::Style::BuilderCustom::applyValueBorderBottomRightRadius):
2608         (WebCore::Style::BuilderCustom::applyInheritBorderTopLeftRadius):
2609         (WebCore::Style::BuilderCustom::applyValueBorderTopLeftRadius):
2610         (WebCore::Style::BuilderCustom::applyInheritBorderTopRightRadius):
2611         (WebCore::Style::BuilderCustom::applyValueBorderTopRightRadius):
2612
2613 2020-05-28  Andy Estes  <aestes@apple.com>
2614
2615         Shrink StyleRareNonInheritedData by 8 bytes (on 64-bit platforms)
2616         https://bugs.webkit.org/show_bug.cgi?id=212484
2617
2618         Reviewed by Tim Horton.
2619
2620         There were 4 bytes of padding after shapeImageThreshold, enough to fit order and shrink the
2621         overall size of StyleRareNonInheritedData by 8 bytes on 64-bit platforms.
2622
2623         Before:
2624         Total byte size: 480
2625         Total pad bytes: 50
2626         Padding percentage: 10.42 %
2627
2628         After:
2629         Total byte size: 472
2630         Total pad bytes: 42
2631         Padding percentage: 8.90 %
2632
2633         * rendering/style/StyleRareNonInheritedData.cpp:
2634         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2635         (WebCore::StyleRareNonInheritedData::operator== const):
2636         * rendering/style/StyleRareNonInheritedData.h:
2637
2638 2020-05-28  Megan Gardner  <megan_gardner@apple.com>
2639
2640         Responding to post commit review comments for https://bugs.webkit.org/show_bug.cgi?id=212060
2641
2642         * editing/InsertIntoTextNodeCommand.cpp:
2643         (WebCore::InsertIntoTextNodeCommand::doApply):
2644
2645 2020-05-28  Simon Fraser  <simon.fraser@apple.com>
2646
2647         Simplify EventDispatcher wheel event dispatch
2648         https://bugs.webkit.org/show_bug.cgi?id=212490
2649
2650         Reviewed by Tim Horton.
2651
2652         The various cross-thread bounces and completion lambdas in EventDispatcher::wheelEvent()
2653         and ScrollingTree code made the logic very hard to follow.
2654
2655         Moving the ScrollingThread::dispatch() into EventHandler code simplifies things a little,
2656         and allows for removal of the hokey "try to handle" ScrollingTree function, as well
2657         as the clunky completion function.
2658
2659         Now, EventHandler call shouldHandleWheelEventSynchronously(), then does the
2660         ScrollingThread::dispatch() which allows the lambda to easily call back into
2661         EventHandler for the main thread dispatch.
2662
2663         * page/scrolling/ScrollingTree.h:
2664         * page/scrolling/ThreadedScrollingTree.cpp:
2665         (WebCore::ThreadedScrollingTree::tryToHandleWheelEvent): Deleted.
2666         * page/scrolling/ThreadedScrollingTree.h:
2667
2668 2020-05-28  Oriol Brufau  <obrufau@igalia.com>
2669
2670         [css-grid] Fix referencing grid line names with auto repeat()
2671         https://bugs.webkit.org/show_bug.cgi?id=209572
2672
2673         Reviewed by Darin Adler.
2674
2675         This patch fixes multiple problems when referencing named grid lines with the presence of
2676         the auto repeat() syntax:
2677
2678           - If the 1st track was defined with auto repeat(), then the code used to assume that the
2679             referenced line appeared after the repeated tracks. But it may actually precede them.
2680
2681           - If the referenced line appeared both inside and outside the auto repeat(), then it
2682             could resolve to the outside raw index, without expanding the auto repeat().
2683
2684           - The logic for placing a placement property set to both an integer and an identifier
2685             was wrong with auto repeat().
2686             This patch fixes it by using the same proper logic that was already implemented in
2687             OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex
2688
2689           - The indices of both implicit grid lines defined with grid-template-areas and explicit
2690             ones defined with grid-template-rows/columns used to be stored together in
2691             NamedGridColumnLines and NamedGridRowLines. This was problematic because the former
2692             indices already refer to the final explicit grid so they don't have to be increased when
2693             expanding an auto repeat(), but the latter ones should.
2694             Therefore, this patch stores the indices in separate fields and uses the correct logic
2695             for each one. This also fixes 'grid-template-areas: inherit'.
2696
2697         This patch is a port of these Chromium patches:
2698           - https://crrev.com/744426
2699           - https://crrev.com/745925
2700           - https://crrev.com/747631
2701           - https://crrev.com/747669
2702           - https://crrev.com/771984
2703
2704         Tests: imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-002.html
2705                imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-004.html
2706                imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-005.html
2707                imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-008.html
2708                imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-009.html
2709
2710         * rendering/style/GridPositionsResolver.cpp:
2711         (WebCore::NamedLineCollection::NamedLineCollection):
2712         (WebCore::NamedLineCollection::hasExplicitNamedLines const):
2713         (WebCore::NamedLineCollection::hasNamedLines const):
2714         (WebCore::NamedLineCollection::contains const):
2715         (WebCore::NamedLineCollection::firstExplicitPosition const):
2716         (WebCore::NamedLineCollection::firstPosition const):
2717         * rendering/style/GridPositionsResolver.h:
2718         * rendering/style/RenderStyle.h:
2719         (WebCore::RenderStyle::implicitNamedGridColumnLines const):
2720         (WebCore::RenderStyle::implicitNamedGridRowLines const):
2721         (WebCore::RenderStyle::setImplicitNamedGridColumnLines):
2722         (WebCore::RenderStyle::setImplicitNamedGridRowLines):
2723         * rendering/style/StyleGridData.cpp:
2724         (WebCore::StyleGridData::StyleGridData):
2725         * rendering/style/StyleGridData.h:
2726         (WebCore::StyleGridData::operator== const):
2727         * style/StyleBuilderCustom.h:
2728         (WebCore::Style::BuilderCustom::applyInitialGridTemplateAreas):
2729         (WebCore::Style::BuilderCustom::applyInheritGridTemplateAreas):
2730         (WebCore::Style::BuilderCustom::applyValueGridTemplateAreas):
2731
2732 2020-05-28  Andres Gonzalez  <andresg_22@apple.com>
2733
2734         [ macOS Debug ] accessibility/roles-exposed.html is a flaky timeout
2735         https://bugs.webkit.org/show_bug.cgi?id=212478
2736         <rdar://problem/63411656>
2737
2738         Reviewed by Chris Fleizach.
2739
2740         Logging the backingObject in every call to accessibilityAttributeValue
2741         seems to be causing this long test to take too long and timeout in slow
2742         systems.
2743
2744         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2745         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2746
2747 2020-05-27  Keith Miller  <keith_miller@apple.com>
2748
2749         for-of should check the iterable is a JSArray for FastArray in DFG iterator_open
2750         https://bugs.webkit.org/show_bug.cgi?id=212383
2751
2752         Reviewed by Saam Barati.
2753
2754         Update various InheritsTraits specializations to contain a typeRange member.
2755         Also, change the inherits function to use inheritsJSTypeImpl like the JSC
2756         variants.
2757
2758         * bindings/js/JSDocumentCustom.h:
2759         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
2760         * bindings/js/JSElementCustom.h:
2761         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
2762         * bindings/js/JSEventCustom.h:
2763         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
2764         * bindings/js/JSNodeCustom.h:
2765         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
2766         * bindings/scripts/CodeGeneratorJS.pm:
2767         (GenerateHeader):
2768
2769 2020-05-27  Darin Adler  <darin@apple.com>
2770
2771         [Cocoa] Pass all defines from Platform.h to various scripts, not just the ones from .xcconfig
2772         https://bugs.webkit.org/show_bug.cgi?id=212451
2773
2774         Reviewed by Sam Weinig.
2775
2776         * DerivedSources.make: Run the preprocessor on Platform.h and parse the output into
2777         FEATURE_AND_PLATFORM_DEFINES. Use that and FEATURE_AND_PLATFORM_DEFINE_DEPENDENCIES
2778         whenever we need a list of defines. Also took out some Windows-specific stuff since
2779         this is now only used on Mac platforms.
2780
2781 2020-05-27  Simon Fraser  <simon.fraser@apple.com>
2782
2783         ScrollingTreeMac::eventListenerRegionTypesForPoint() needs to convert the point to local coordinates
2784         https://bugs.webkit.org/show_bug.cgi?id=212440
2785
2786         Reviewed by Tim Horton.
2787
2788         ScrollingTreeMac::eventListenerRegionTypesForPoint() needs to convert the point to local coordinates
2789         before consulting the event region.
2790
2791         Also made EventListenerRegionType loggabale.
2792
2793         Will be tested by wheel event tests once we switch to using these kinds of regions.
2794
2795         * page/scrolling/mac/ScrollingTreeMac.mm:
2796         (collectDescendantLayersAtPoint):
2797         (ScrollingTreeMac::scrollingNodeForPoint):
2798         (ScrollingTreeMac::eventListenerRegionTypesForPoint const):
2799         * rendering/style/RenderStyleConstants.cpp:
2800         (WebCore::operator<<):
2801         * rendering/style/RenderStyleConstants.h:
2802
2803 2020-05-28  Youenn Fablet  <youenn@apple.com>
2804
2805         RealtimeIncomingVideoSourceCocoa::OnFrame should use video frame timestamp
2806         https://bugs.webkit.org/show_bug.cgi?id=212402
2807
2808         Reviewed by Eric Carlson.
2809
2810         Use timestamp provided from the libwebrtc backend instread of marking the frames as display immediately.
2811         Update LocalSampleBufferDisplayLayer to mark the frame as display immediately if their presentation time is in the past since we guarantee the frames are in order.
2812
2813         Remove the offset correction in MediaPlayerPrivateMediaStreamAVFObjC.
2814         This does not work well when the display layer is in GPU process and it is simpler to use the system clock which is what AVSampleBufferDisplayLayser is using if controlTimebase is not set.
2815
2816         Manually tested.
2817
2818         * platform/graphics/avfoundation/SampleBufferDisplayLayer.h:
2819         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
2820         (WebCore::LocalSampleBufferDisplayLayer::enqueueSample):
2821         (WebCore::LocalSampleBufferDisplayLayer::removeOldSamplesFromPendingQueue):
2822         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2823         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2824         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2825         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
2826         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferDisplayLayerStatusDidChange):
2827         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive):
2828         * platform/mediastream/VideoTrackPrivateMediaStream.h:
2829         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2830         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2831
2832 2020-05-28  Antti Koivisto  <antti@apple.com>
2833
2834         Incorrect clipping of absolute and fixed elements inside stacking-context composited overflow:hidden
2835         https://bugs.webkit.org/show_bug.cgi?id=212419
2836         <rdar://problem/55856170>
2837
2838         Reviewed by Simon Fraser.
2839
2840         We incorrectly clip descendants that are not in containing block chain.
2841         There is already code to do the correct clipping, it just needs be enabled in this case.
2842
2843         Tests: compositing/overflow/non-contained-descendant-clipping-absolute.html
2844                compositing/overflow/non-contained-descendant-clipping-fixed.html
2845
2846         * rendering/RenderLayer.cpp:
2847         (WebCore::RenderLayer::RenderLayer):
2848         * rendering/RenderLayer.h:
2849
2850         Add hasCompositedNonContainedDescendants bit.
2851
2852         * rendering/RenderLayerCompositor.cpp:
2853         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
2854         (WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer):
2855
2856         Check if the parent layer is for a containing block of this layer.
2857
2858         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2859
2860         Update the bit.
2861
2862         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2863         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
2864
2865         Pick the clipping path where descendants are not clipped.
2866
2867 2020-05-27  Noam Rosenthal  <noam@webkit.org>
2868
2869         Implement AccessKeyLabel attribute.
2870         https://bugs.webkit.org/show_bug.cgi?id=72715
2871
2872         Spec: https://html.spec.whatwg.org/multipage/interaction.html#dom-accesskeylabel
2873
2874         As per spec, return the modifiers+accessKey when requesting the element accessKeyLabel.
2875
2876         Equivalent to the existing Firefox implementation and (pending) Chrome implementation.
2877
2878         Alt is the hardcoded modifier for any non-cocoa platform, so hardcode it also for the label.
2879         Use modifier text for Mac/iOS as it can change (e.g. for voice-over).
2880
2881         Reviewed by Darin Adler.
2882
2883         Test: fast/forms/access-key-label.html
2884
2885         * html/HTMLElement.cpp:
2886         (WebCore::HTMLElement::accessKeyLabel const):
2887         * html/HTMLElement.h:
2888         * html/HTMLElement.idl:
2889
2890 2020-05-27  Sam Weinig  <weinig@apple.com>
2891
2892         Extended Color: Refactor FloatComponents and ColorComponents into a single templatized ColorComponents class
2893         https://bugs.webkit.org/show_bug.cgi?id=212446
2894
2895         Reviewed by Simon Fraser.
2896
2897         Merge FloatComponents and ColorComponents into ColorComponents<T> and move them to their own
2898         header. This avoids duplicate code and paves the way for further generalization down the line.
2899         
2900         Also moves some utility functions to ColorUtilities.h from SimpleColor.h as they make more sense
2901         in the former.
2902
2903         * Headers.cmake:
2904         * WebCore.xcodeproj/project.pbxproj:
2905         Add ColorComponents.h
2906
2907         * platform/graphics/ColorComponents.h: Copied from Source/WebCore/platform/graphics/ColorUtilities.h.
2908         Moved ColorComponents to its own header and templatized it to allow it to serve the
2909         needs of both the old ColorComponents and old FloatComponents classes.
2910         
2911         * platform/graphics/ColorUtilities.cpp:
2912         * platform/graphics/ColorUtilities.h:
2913         Removed ColorComponents/FloatComponents and update existing usages to their new names.
2914         Also moved roundAndClampColorChannel, fastMultiplyBy255, fastDivideBy255 
2915         and colorFloatToSimpleColorByte here from SimpleColor to make it clear where
2916         general helper functions can go.
2917         
2918         * platform/graphics/Color.h:
2919         * platform/graphics/Color.cpp:
2920         (WebCore::Color::colorSpaceAndComponents const):
2921         (WebCore::Color::toSRGBAComponentsLossy const):
2922         * platform/graphics/ExtendedColor.h:
2923         (WebCore::ExtendedColor::channels const):
2924         Update for rename of FloatComponents to ColorComponents<float>.
2925
2926         * platform/graphics/SimpleColor.cpp:
2927         (WebCore::makeSimpleColorFromHSLA):
2928         Use structured bindings and simplify code. 
2929
2930         * platform/graphics/SimpleColor.h:
2931         (WebCore::roundAndClampColorChannel): Deleted.
2932         (WebCore::fastMultiplyBy255): Deleted.
2933         (WebCore::fastDivideBy255): Deleted.
2934         (WebCore::colorFloatToSimpleColorByte): Deleted.
2935         As noted above, moved roundAndClampColorChannel, fastMultiplyBy255, fastDivideBy255 
2936         and colorFloatToSimpleColorByte to ColorUtilities.h
2937
2938         * platform/graphics/filters/FEColorMatrix.cpp:
2939         Update for rename of FloatComponents to ColorComponents<float>.
2940
2941         * platform/graphics/filters/FEDisplacementMap.cpp:
2942         (WebCore::byteOffsetOfPixel):
2943         Moved byteOffsetOfPixel here from ColorUtilities. This file is the only user
2944         and it wasn't general in a way that was clear for other users.
2945
2946         * platform/graphics/filters/FELighting.cpp:
2947         (WebCore::FELighting::drawLighting):
2948         Update for rename of FloatComponents to ColorComponents<float>.
2949
2950         * platform/graphics/filters/FEMorphology.cpp:
2951         (WebCore::makeColorComponentsfromPixelValue):
2952         Added. Used to be ColorComponents::fromRGBA(), but was only used here
2953         and didn't seem generally useful.
2954
2955         (WebCore::makePixelValueFromColorComponents):
2956         Added. Used to be ColorComponents::toRGBA(), but was only used here
2957         and didn't seem generally useful.
2958         
2959         (WebCore::minOrMax):
2960         (WebCore::columnExtremum):
2961         (WebCore::kernelExtremum):
2962         (WebCore::FEMorphology::platformApplyGeneric):
2963         Update for rename of FloatComponents to ColorComponents<float> and ColorComponents
2964         to ColorComponents<uint8_t>.
2965
2966         * platform/graphics/filters/FETurbulence.cpp:
2967         (WebCore::FETurbulence::noise2D const):
2968         (WebCore::toIntBasedColorComponents):
2969         (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
2970         (WebCore::FETurbulence::fillRegion const):
2971         * platform/graphics/filters/FETurbulence.h:
2972         Update for rename of FloatComponents to ColorComponents<float> and ColorComponents
2973         to ColorComponents<uint8_t>. Also renames toColorComponents to toIntBasedColorComponents
2974         as the former was no longer specific enough. Updated to use std::clamp.
2975
2976         * platform/graphics/filters/FilterOperation.cpp:
2977         (WebCore::BasicColorMatrixFilterOperation::transformColor const):
2978         (WebCore::BasicComponentTransferFilterOperation::transformColor const):
2979         (WebCore::InvertLightnessFilterOperation::transformColor const):
2980         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
2981         * platform/graphics/filters/FilterOperation.h:
2982         (WebCore::FilterOperation::transformColor const):
2983         (WebCore::FilterOperation::inverseTransformColor const):
2984         * platform/graphics/filters/FilterOperations.cpp:
2985         (WebCore::FilterOperations::transformColor const):
2986         (WebCore::FilterOperations::inverseTransformColor const):
2987         Update for rename of FloatComponents to ColorComponents<float>.
2988
2989 2020-05-27  David Kilzer  <ddkilzer@apple.com>
2990
2991         REGRESSION (r260023): ITP sparse plist decoding.
2992         <https://bugs.webkit.org/show_bug.cgi?id=212424>
2993         <rdar://problem/63683055>
2994
2995         Reviewed by John Wilander.
2996
2997         Reverted changeset:
2998
2999         "KeyedDecoder functions in ResourceLoadStatistics.{cpp,h} should return bool and use WARN_UNUSED_RETURN"
3000         https://bugs.webkit.org/show_bug.cgi?id=210414
3001         https://trac.webkit.org/changeset/260023
3002
3003         The revert did not compile due to changes in the KeyedDecoder
3004         class that require checking the return value of its methods, so
3005         additional changes were made below.
3006
3007         * loader/ResourceLoadStatistics.cpp:
3008         (WebCore::decodeHashCountedSet):
3009         (WebCore::decodeHashSet):
3010         - Use IGNORE_WARNINGS_BEGIN("unused-result")/IGNORE_WARNINGS_END
3011           to suppress warning about ignoring the return value from
3012           KeyeDecoder::decodeObjects() since decoding these objects is
3013           optional.
3014         (WebCore::decodeOptionSet):
3015         - Check return value of KeyedDecoder::decodeUInt64() before
3016           setting `optionSet` parameter.
3017
3018 2020-05-27  Andres Gonzalez  <andresg_22@apple.com>
3019
3020         Empty alt attribute does not ignore the image for accessibility clients in Safari.
3021         https://bugs.webkit.org/show_bug.cgi?id=212432
3022
3023         Reviewed by Chris Fleizach.
3024
3025         Test: accessibility/img-alt-attribute-unassigned-empty.html
3026
3027         - AccessibilityRenderObject::computeAccessibilityIsIgnored was handling
3028         the case of images too late, after checking for ariaRoleAttribute(). So
3029         if an image had a role attribute, it was exposed regardless whether its
3030         alt attribute was an empty string. This change moves the handling of
3031         images above the check for ariaroleAttribute and hence honors the empty
3032         alt attribute rule.
3033         - Also images that have an aria-label attribute are now exposed.
3034         - Added logging of AccessibilityObjectInclusion.
3035         - Changed signature of log(RefPtr<AXCoreObject>) as pointed out by Darin Adler in a separate review.
3036
3037         * accessibility/AXLogger.cpp:
3038         (WebCore::AXLogger::log):
3039         (WebCore::operator<<):
3040         * accessibility/AXLogger.h:
3041         * accessibility/AccessibilityNodeObject.cpp:
3042         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3043         (WebCore::AccessibilityNodeObject::isImage const): Moved to base class.
3044         * accessibility/AccessibilityNodeObject.h:
3045         * accessibility/AccessibilityObject.h:
3046         * accessibility/AccessibilityObjectInterface.h:
3047         (WebCore::AXCoreObject::isImage const):
3048         * accessibility/AccessibilityRenderObject.cpp:
3049         (WebCore::objectInclusionFromAltText):
3050         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
3051         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3052         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
3053         * accessibility/isolatedtree/AXIsolatedObject.cpp:
3054         (WebCore::AXIsolatedObject::initializeAttributeData):
3055         * accessibility/isolatedtree/AXIsolatedObject.h:
3056
3057 2020-05-27  Chris Dumez  <cdumez@apple.com>
3058
3059         pageshow only fires the first time the back button is pressed
3060         https://bugs.webkit.org/show_bug.cgi?id=156356
3061         <rdar://problem/29256489>
3062
3063         Reviewed by Alexey Proskuryakov.
3064
3065         When FrameLoader::commitProvisionalLoad() would restore a page from the back/forward
3066         cache, it would only call FrameLoader::checkCompleted() in the main frame and fail
3067         to do so in subframes. Calling checkCompleted() is important, not only because it
3068         sets m_isComplete to true but also because it calls checkCallImplicitClose(), which
3069         resets m_didCallImplicitClose to true and m_wasUnloadEventEmitted to false.
3070
3071         Because checkCompleted() was not called, FrameLoader::dispatchUnloadEvents() would then
3072         fail to fire the pagehide event because the `m_didCallImplicitClose && !m_wasUnloadEventEmitted`
3073         was not met. Also, even though checkCompleted() was called for the main frame, if there
3074         are subframes, it would just return early because allChildrenAreComplete() returned false.
3075         Later on, when trying to fire the pageshow event, it would fail to because we have logic
3076         in DOMWindow::dispatchEvent() to avoid firing a pageshow event if we did not previously
3077         send a pagehide event.
3078
3079         To address the issue, I now call checkCompleted() in FrameLoader::open() for subframes, as
3080         this gets called for every frame during restoration from the back/forward cache. For the main
3081         frame, we keep calling checkCompleted(), after we've called sendRemainingDelegateMessages().
3082
3083         Test: fast/history/multiple-back-forward-navigations.html
3084
3085         * loader/FrameLoader.cpp:
3086         (WebCore::FrameLoader::open):
3087
3088 2020-05-27  Sam Weinig  <weinig@apple.com>
3089
3090         Extended Color: Move ColorMatrix to its own files
3091         https://bugs.webkit.org/show_bug.cgi?id=212431
3092
3093         Reviewed by Dean Jackson.
3094
3095         Move ColorMatrix to its own files from ColorUtilities.h/cpp
3096
3097         * Headers.cmake:
3098         * Sources.txt:
3099         * WebCore.xcodeproj/project.pbxproj:
3100         * platform/graphics/ColorMatrix.cpp: Copied from Source/WebCore/platform/graphics/ColorUtilities.cpp.
3101         * platform/graphics/ColorMatrix.h: Copied from Source/WebCore/platform/graphics/ColorUtilities.h.
3102         * platform/graphics/ColorUtilities.cpp:
3103         * platform/graphics/ColorUtilities.h:
3104         * platform/graphics/filters/FilterOperation.cpp:
3105
3106 2020-05-27  David Kilzer  <ddkilzer@apple.com>
3107
3108         Add OptionSetTraits<> and use with WebCore::DragDestinationAction
3109         <https://webkit.org/b/212397>
3110
3111         Reviewed by Alex Christensen.
3112
3113         * page/DragActions.h:
3114         (WTF::OptionSetTraits<WebCore::DragDestinationAction>):
3115         - Add for use with OptionSet<>.
3116
3117 2020-05-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3118
3119         [Clipboard API] Support reading "image/png" on ClipboardItem
3120         https://bugs.webkit.org/show_bug.cgi?id=212339
3121         <rdar://problem/63588957>
3122
3123         Reviewed by Tim Horton.
3124
3125         Adds support for reading "image/png" data via ClipboardItem.getType(). See below for more details.
3126
3127         Tests:  ClipboardTests.ConvertTIFFToPNGWhenPasting
3128                 editing/async-clipboard/clipboard-read-write-images.html
3129
3130         * Modules/async-clipboard/Clipboard.cpp:
3131         (WebCore::Clipboard::getType):
3132         (WebCore::Clipboard::updateSessionValidity):
3133
3134         Factor out logic for invalidating the `Clipboard`'s active `Pasteboard` object into a helper method. This is
3135         invoked after reading data from the clipboard, and verifies that the changeCount of the pasteboard is still the
3136         same as it was upon initially reading the contents of the clipboard. If the clipboard contents changed, we
3137         invalidate the session, and `Clipboard` is subsequently denied pasteboard access (until the next time the user
3138         explicitly grants programmatic pasteboard access).
3139
3140         Note that this step is here for correctness rather than security. While it is true that a compromised web
3141         process could fake the changeCount at any given moment, other fairly recent changes around WebPasteboardProxy in
3142         the UI process makes it impossible to take advantage of this fact to arbitrarily read content from the system
3143         pasteboard. Instead of simply reading the empty string, this invalidation ensures that we actually reject the
3144         promise returned by the async clipboard API.
3145
3146         * Modules/async-clipboard/Clipboard.h:
3147         * Modules/async-clipboard/ClipboardImageReader.cpp: Added.
3148
3149         Add a PasteboardFileReader subclass that is responsible for sanitizing image data from the pasteboard into
3150         data that may be exposed to the page via clipboard API. On both macOS and iOS, this ensures that potentially
3151         sensitive EXIF data is stripped via conversion to the platform image type and back. On macOS, this additionally
3152         allows us to handle transcoding TIFF data on the pasteboard to PNG (this is covered by the new API test).
3153
3154         (WebCore::ClipboardImageReader::readBuffer):
3155
3156         Add a stub implementation for non-Cocoa platforms for now, which don't implement this part of the API.
3157
3158         (WebCore::ClipboardImageReader::shouldReadBuffer const):
3159
3160         Add a new hook to skip over certain types when reading pasteboard data into Files. In particular,
3161         `ClipboardImageReader` skips over any MIME type that does not match the MIME type specified (for now, this is
3162         limited to "image/png", but may be extended to include more image types in the future after we implement more
3163         transcoding logic).
3164
3165         * Modules/async-clipboard/ClipboardImageReader.h: Added.
3166         (WebCore::ClipboardImageReader::ClipboardImageReader):
3167         (WebCore::ClipboardImageReader::takeResult):
3168         * Modules/async-clipboard/ios/ClipboardImageReaderIOS.mm: Added.
3169         (WebCore::ClipboardImageReader::readBuffer):
3170
3171         Add iOS-specific `(PNG) => PNG` transcoding logic.
3172
3173         * Modules/async-clipboard/mac/ClipboardImageReaderMac.mm: Added.
3174         (WebCore::ClipboardImageReader::readBuffer):
3175
3176         Add macOS-specific `(PNG, TIFF) => PNG` transcoding logic.
3177
3178         * Sources.txt:
3179         * SourcesCocoa.txt:
3180         * WebCore.xcodeproj/project.pbxproj:
3181         * platform/Pasteboard.h:
3182         (WebCore::PasteboardFileReader::shouldReadBuffer const):
3183         * platform/cocoa/PasteboardCocoa.mm:
3184         (WebCore::Pasteboard::read):
3185
3186         Add support for targeting a given pasteboard item index when reading files on Cocoa platforms.
3187
3188         * platform/gtk/PasteboardGtk.cpp:
3189         (WebCore::Pasteboard::read):
3190         * platform/ios/PlatformPasteboardIOS.mm:
3191         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
3192         (WebCore::webSafeTypes):
3193         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3194
3195         Expose "image/png" as one of the readable pasteboard types on iOS when using the async clipboard API. For some
3196         reason, this adjustment was made on macOS, but wasn't done on iOS, which led to a missing "image/png" type when
3197         asking for `ClipboardItem.types`.
3198
3199         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3200
3201         Add support for writing "image/png "data to the system pasteboard (note that this data has been sanitized
3202         already, as it has been processed through `ClipboardItemTypeLoader::sanitizeDataIfNeeded()`). We simply needed
3203         to use `forEachPlatformStringOrBuffer` instead of just `forEachPlatformString` when writing the custom
3204         pasteboard data.
3205
3206         (WebCore::createItemProviderRegistrationList):
3207         * platform/libwpe/PasteboardLibWPE.cpp:
3208         (WebCore::Pasteboard::read):
3209         * platform/win/PasteboardWin.cpp:
3210         (WebCore::Pasteboard::read):
3211
3212 2020-05-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
3213
3214         REGRESSION (r254541): Valid mime types can only be added to the HashSet of the supported types for encoding
3215         https://bugs.webkit.org/show_bug.cgi?id=212427
3216
3217         Reviewed by Darin Adler.
3218
3219         Add back a check for the mime type validity which was removed in r254541.
3220
3221         * platform/MIMETypeRegistry.cpp:
3222         (WebCore::MIMETypeRegistry::createMIMETypeRegistryThreadGlobalData):
3223
3224 2020-05-27  Devin Rousso  <drousso@apple.com>
3225
3226         Web Inspector: replace `featureGuard` and `availability` with a combined `condition` that accepts any macro
3227         https://bugs.webkit.org/show_bug.cgi?id=210014
3228
3229         Reviewed by Brian Burg.
3230
3231         Previously, the generated InspectorBackendCommands.js would include code for things that the
3232         backend doesn't actually support. By using actual macros and preprocessing that file, we can
3233         ensure that the frontend doesn't incorrectly think that something is supported by the page
3234         being inspected:
3235          - the `Canvas` commands and events related to shader programs/pipelines should only exist
3236            when the corresponding context type exists, namely `ENABLE(WEBGL)` and `ENABLE(WEBGPU)`.
3237          - iOS doesn't support showing rulers, so create a variant of `DOM.setInspectModeEnabled`
3238            that only exists for `PLATFORM(IOS_FAMILY)` that doesn't have the `showRulers` optional
3239            parameter, as well as removing `Page.setShowRulers` entirely.
3240          - setting the forced appearance should only be possible if dark mode is supported.
3241          - web archives only exist if CF is used.
3242
3243         * inspector/InspectorInstrumentation.h:
3244         * inspector/InspectorInstrumentation.cpp:
3245         * inspector/agents/InspectorCanvasAgent.h:
3246         * inspector/agents/InspectorCanvasAgent.cpp:
3247         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3248         (WebCore::InspectorCanvasAgent::enable):
3249         (WebCore::InspectorCanvasAgent::startRecording):
3250         (WebCore::InspectorCanvasAgent::reset):
3251         (WebCore::InspectorCanvasAgent::unbindCanvas):
3252         * inspector/InspectorShaderProgram.h:
3253         * inspector/InspectorShaderProgram.cpp:
3254         (WebCore::InspectorShaderProgram::requestShaderSource):
3255         (WebCore::InspectorShaderProgram::updateShader):
3256         * inspector/agents/InspectorDOMAgent.h:
3257         * inspector/agents/InspectorDOMAgent.cpp:
3258         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
3259         * inspector/agents/InspectorPageAgent.h:
3260         * inspector/agents/InspectorPageAgent.cpp:
3261         (WebCore::InspectorPageAgent::enable):
3262         (WebCore::InspectorPageAgent::disable):
3263         (WebCore::InspectorPageAgent::setForcedAppearance):
3264         (WebCore::InspectorPageAgent::archive):
3265
3266         * Configurations/FeatureDefines.xcconfig:
3267         Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h.
3268
3269         * inspector/InspectorFrontendHost.idl:
3270         Drive-by: replace the `#if` with the IDL `[Conditional=]`.
3271
3272 2020-05-27  Miguel Gomez  <magomez@igalia.com>
3273
3274         [WPE] REGRESSION(r253675) Crash when using threaded rendering
3275         https://bugs.webkit.org/show_bug.cgi?id=212404
3276
3277         Reviewed by Carlos Garcia Campos.
3278
3279         Check whether the GraphicsContext has a PlatformGraphicsContext before trying to paint with
3280         it. If there's no PlatformGraphicsContext, paint using the GraphicsContext methods instead.
3281
3282         * platform/graphics/cairo/ImageBufferCairoBackend.cpp:
3283         (WebCore::ImageBufferCairoBackend::draw):
3284         (WebCore::ImageBufferCairoBackend::drawPattern):
3285
3286 2020-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3287
3288         Unreviewed. Fix build warning with GTK4
3289
3290         * platform/gtk/GtkUtilities.cpp:
3291         (WebCore::widgetRootCoords):
3292
3293 2020-05-27  David Kilzer  <ddkilzer@apple.com>
3294
3295         Use OptionSet<DragDestinationAction> for mask values
3296         <https://webkit.org/b/212115>
3297         <rdar://problem/63423380>
3298
3299         Reviewed by Alex Christensen.
3300
3301         DragDestinationAction is used as both individual values and as a
3302         bit mask. This changes bit mask uses to OptionSet<> and renames
3303         variables to denote masks.
3304
3305         * page/DragActions.h:
3306         (WebCore::DragDestinationAction):
3307         - Convert to enum class and remove *None and *Any values.
3308         (WebCore::DragDestinationActionAny):
3309         - Add helper function to return OptionSet<DragDestinationAction>
3310           with all values set.
3311         * page/DragController.cpp:
3312         (WebCore::DragController::performDragOperation):
3313         (WebCore::DragController::dragEnteredOrUpdated):
3314         (WebCore::DragController::tryDocumentDrag):
3315         (WebCore::DragController::concludeEditDrag):
3316         * page/DragController.h:
3317         (WebCore::DragController::dragDestinationAction const): Rename.
3318         (WebCore::DragController::dragDestinationActionMask const):
3319         - Rename dragDestinationAction() to dragDestinationActionMask().
3320         * platform/DragData.cpp:
3321         (WebCore::DragData::DragData):
3322         * platform/DragData.h:
3323         (WebCore::DragData::DragData):
3324         - Use DragDestinationActionAny() in place of removed
3325           DragDestinationActionAny.
3326         (WebCore::DragData::dragDestinationAction const): Rename.
3327         (WebCore::DragData::dragDestinationActionMask const):
3328         - Rename dragDestinationAction() to dragDestinationActionMask().
3329         (WebCore::DragData::operator =):
3330         * platform/cocoa/DragDataCocoa.mm:
3331         (WebCore::DragData::DragData):
3332
3333 2020-05-27  Youenn Fablet  <youenn@apple.com>
3334
3335         Video freezes when attaching a local MediaStream to multiple elements
3336         https://bugs.webkit.org/show_bug.cgi?id=194802
3337         <rdar://problem/63613107>
3338
3339         Reviewed by Eric Carlson.
3340
3341         AVSampleBufferDisplayLayer sometimes does not update the rendering when the same local source is rendered several times.
3342         To workaround this, we set kCMSampleAttachmentKey_DisplayImmediately to true, which fixes the issue as per my testing.
3343         We clone the sample buffer before setting this property as it might not be thread safe to modify the attachments of a sample
3344         that might also be encoded.
3345         We implement this at LocalSampleBufferDisplayLayer level and enable this for local capture sources only.
3346
3347         Manually tested.
3348
3349         * platform/graphics/avfoundation/SampleBufferDisplayLayer.h:
3350         (WebCore::SampleBufferDisplayLayer::setRenderPolicy):
3351         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h:
3352         (WebCore::LocalSampleBufferDisplayLayer::setRenderPolicy):
3353         * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
3354         (WebCore::LocalSampleBufferDisplayLayer::enqueueSample):
3355         (WebCore::LocalSampleBufferDisplayLayer::removeOldSamplesFromPendingQueue):
3356         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3357         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
3358         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
3359         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3360         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
3361         (WebCore::setSampleBufferAsDisplayImmediately):
3362         (WebCore::MediaSampleAVFObjC::setAsDisplayImmediately):
3363         (WebCore::MediaSampleAVFObjC::cloneSampleBuffer):
3364
3365 2020-05-19  Sergio Villar Senin  <svillar@igalia.com>
3366
3367         [WebXR] Implement XRSession::requestAnimationFrame()
3368         https://bugs.webkit.org/show_bug.cgi?id=212099
3369
3370         Reviewed by Youenn Fablet.
3371
3372         The WebXR spec defines a requestAnimationFrame() mechanism to provide information about XR tracking devices
3373         using callbacks. It's pretty similar to the requestAnimationFrame() exposed by Window but only used
3374         to update WebXR content. We're adding a basic implementation of this mechanism as long as cancellation
3375         support. It requires some platform code that will be added in follow up patches. That platform code will
3376         provide information like devices' refresh rates, pose (position & orientation), display resolution, etc...
3377
3378         This patch also replaces the type of the callback id from int to unsigned int as per the following change
3379         in specs https://github.com/immersive-web/webxr/pull/1062.
3380
3381         Apart from that we're adding a missing adoptRef() in the testing code that was causing assertions in some
3382         of the tests that are being unskipped as part of this change.
3383
3384         * Modules/webxr/WebXRSession.cpp:
3385         (WebCore::WebXRSession::WebXRSession):
3386         (WebCore::WebXRSession::animationTimerFired): Added.
3387         (WebCore::WebXRSession::scheduleAnimation): Ditto.
3388         (WebCore::WebXRSession::requestAnimationFrame): Ditto.
3389         (WebCore::WebXRSession::cancelAnimationFrame):
3390         * Modules/webxr/WebXRSession.h:
3391         * Modules/webxr/XRFrameRequestCallback.h:
3392         (WebCore::XRFrameRequestCallback::callbackId):
3393         (WebCore::XRFrameRequestCallback::setCallbackId):
3394         (WebCore::XRFrameRequestCallback::cancel):
3395         (WebCore::XRFrameRequestCallback::isCancelled const):
3396         * testing/WebFakeXRDevice.cpp:
3397         (WebCore::WebFakeXRDevice::simulateInputSourceConnection):
3398         * testing/WebFakeXRDevice.h:
3399         * testing/WebFakeXRInputController.h:
3400
3401 2020-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3402
3403         [GTK4] Make PointerLock work