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