[WPT] dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing exceptio...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-06-13  Sam Weinig  <weinig@apple.com>
2
3         [WPT] dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing exception in Document.createCDATASection()
4         https://bugs.webkit.org/show_bug.cgi?id=213167
5
6         Reviewed by Yusuke Suzuki.
7
8         Tested by existing (formerly failing) test: imported/w3c/web-platform-tests/dom/nodes/Document-createCDATASection-xhtml.xhtml
9
10         Throw an "InvalidCharacterError" DOMException if the data passed to createCDATASection
11         contains the string "]]>" as specified by https://dom.spec.whatwg.org/#dom-document-createcdatasection
12
13         * dom/Document.cpp:
14         (WebCore::Document::createCDATASection):
15
16 2020-06-13  Michael Catanzaro  <mcatanzaro@gnome.org>
17
18         Obsolete comment in FontCustomPlatformDataFreeType.cpp
19         https://bugs.webkit.org/show_bug.cgi?id=213169
20
21         Unreviewed, remove the stale comment.
22
23         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
24         (WebCore::defaultFontconfigOptions):
25
26 2020-06-13  Sam Weinig  <weinig@apple.com>
27
28         Extended Color: Experiment with strongly typed ColorComponents
29         https://bugs.webkit.org/show_bug.cgi?id=212396
30
31         Reviewed by Darin Adler.
32
33         Adds simple explicit types for sRGBA, LinearSRGBA, DisplayP3, 
34         LinearDisplayP3, XYZA and HSLA colors. Conversion to/from
35         ColorComponents<float> is easy but explicit to make conversions
36         easier to spot.
37
38         The goal is to add type clarity (you know when you are dealing
39         with an sRGB color vs. a DisplayP3 color) and make dealing with
40         the colors nicer (color.red rather than color[0]). It also allows
41         us to simplify the naming of functions that convert between color 
42         types as now only the output type needs to be in the function name.
43  
44         * Headers.cmake:
45         Add new header, ColorTypes.h
46
47         * WebCore.xcodeproj/project.pbxproj:
48         Add new header, ColorTypes.h
49
50         * css/parser/CSSPropertyParserHelpers.cpp:
51         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
52         Switch from hslToSRGB({ ... }) to toSRGBA(HSLAColor { ... })
53
54         * editing/cocoa/DataDetection.mm:
55         (WebCore::DataDetection::detectContentInRange):
56         Update to use toHSLA() and HSLA<float> making the code a bit more readable.
57
58         * platform/graphics/Color.cpp:
59         (WebCore::Color::lightened const):
60         (WebCore::Color::darkened const):
61         (WebCore::Color::isDark const):
62         (WebCore::Color::lightness const):
63         (WebCore::Color::luminance const):
64         (WebCore::Color::colorSpaceAndComponents const):
65         (WebCore::Color::toSRGBASimpleColorLossy const):
66         (WebCore::Color::toSRGBALossy const):
67         (WebCore::Color::toSRGBAComponentsLossy const): Deleted.
68         * platform/graphics/Color.h:
69         Renames toSRGBAComponentsLossy() to toSRGBALossy() which now returns
70         a SRGBA<float>.
71         
72         * platform/graphics/ColorMatrix.h:
73         (WebCore::ColorMatrix::transformColorComponents const): Deleted.
74         Remove transformColorComponents, keeping just transformedColorComponents
75         to simplify the interface. With late conversion to ColorComponents, the
76         latter is more straightforward to use in most cases anyway.
77         
78         * platform/graphics/ColorUtilities.cpp:
79         (WebCore::linearToRGBColorComponent):
80         (WebCore::rgbToLinearColorComponent):
81         (WebCore::toLinearSRGBA):
82         (WebCore::toSRGBA):
83         (WebCore::toLinearDisplayP3):
84         (WebCore::toDisplayP3):
85         (WebCore::toXYZ):
86         (WebCore::lightness):
87         (WebCore::luminance):
88         (WebCore::contrastRatio):
89         (WebCore::toHSLA):
90         (WebCore::premultiplied):
91         (WebCore::rgbToLinearComponents): Deleted.
92         (WebCore::linearToRGBComponents): Deleted.
93         (WebCore::xyzToLinearSRGB): Deleted.
94         (WebCore::linearSRGBToXYZ): Deleted.
95         (WebCore::XYZToLinearP3): Deleted.
96         (WebCore::linearP3ToXYZ): Deleted.
97         (WebCore::p3ToSRGB): Deleted.
98         (WebCore::sRGBToP3): Deleted.
99         (WebCore::sRGBToHSL): Deleted.
100         (WebCore::hslToSRGB): Deleted.
101         * platform/graphics/ColorUtilities.h:
102         Rename / rework conversion and utility functions to operate on explicit Color 
103         types. In doing so, simplify the names of the conversion functions so only name
104         the output type. For instance:
105
106             ColorComponents<float> p3ToSRGB(const ColorComponents<float>&);
107             
108         is now 
109         
110             SRGBA<float> toSRGBA(const DisplayP3<float>&);
111         
112         as the input type is implicit in the call. A little duplication was needed 
113         for linearToRGBColorComponent/rgbToLinearColorComponent (as it was used for
114         both sRGB and DisplayP3 linearization), but mostly things stay the same.
115         
116         * platform/graphics/ExtendedColor.cpp:
117         (WebCore::ExtendedColor::toSRGBALossy const):
118         (WebCore::ExtendedColor::toSRGBAComponentsLossy const): Deleted.
119         * platform/graphics/ExtendedColor.h:
120         Renamed toSRGBAComponentsLossy() to toSRGBALossy() and have it
121         return a SRGBA<float>.
122
123         * platform/graphics/SimpleColor.h:
124         (WebCore::SimpleColor::asSRGBA const):
125         (WebCore::makeSimpleColor):
126         (WebCore::SimpleColor::asSRGBFloatComponents const): Deleted.
127         Rename asSRGBFloatComponents() to asSRGBA<T>() and have it 
128         return a SRGBA<float>. Replace makeSimpleColor taking FloatComponents
129         with one taking a SRGBA<float>, making it much clearer that this
130         is only valid for sRGB.
131
132         * platform/graphics/filters/FELighting.cpp:
133         (WebCore::FELighting::drawLighting):
134         Rework to support seperate types for SRGB<float> and LinearSRGBA<float>.
135
136         * platform/graphics/filters/FELighting.cpp:
137         (WebCore::FELighting::drawLighting):
138         * platform/graphics/filters/FilterOperation.cpp:
139         (WebCore::BasicColorMatrixFilterOperation::transformColor const):
140         (WebCore::BasicComponentTransferFilterOperation::transformColor const):
141         (WebCore::InvertLightnessFilterOperation::transformColor const):
142         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
143         * platform/graphics/filters/FilterOperation.h:
144         (WebCore::FilterOperation::transformColor const):
145         (WebCore::FilterOperation::inverseTransformColor const):
146         * platform/graphics/filters/FilterOperations.cpp:
147         (WebCore::FilterOperations::transformColor const):
148         (WebCore::FilterOperations::inverseTransformColor const):
149         Use SRGBA<float> rather than ColorComponents<float> to make it clear
150         that the filters only work on sRGB colors right now.
151
152         * rendering/RenderTheme.cpp:
153         (WebCore::RenderTheme::disabledTextColor const):
154         * rendering/TextPaintStyle.cpp:
155         (WebCore::textColorIsLegibleAgainstBackgroundColor):
156         * platform/graphics/cairo/CairoUtilities.cpp:
157         (WebCore::setSourceRGBAFromColor):
158         * platform/graphics/cairo/GradientCairo.cpp:
159         (WebCore::addColorStopRGBA):
160         (WebCore::setCornerColorRGBA):
161         (WebCore::interpolateColorStop):
162         * platform/graphics/gtk/ColorGtk.cpp:
163         (WebCore::Color::operator GdkRGBA const):
164         * platform/graphics/texmap/TextureMapperGL.cpp:
165         (WebCore::TextureMapperGL::drawBorder):
166         (WebCore::TextureMapperGL::drawNumber):
167         (WebCore::prepareFilterProgram):
168         (WebCore::TextureMapperGL::drawSolidColor):
169         (WebCore::TextureMapperGL::clearColor):
170         * platform/graphics/win/ColorDirect2D.cpp:
171         (WebCore::Color::operator D2D1_COLOR_F const):
172         (WebCore::Color::operator D2D1_VECTOR_4F const):
173         * platform/graphics/win/GradientDirect2D.cpp:
174         (WebCore::Gradient::generateGradient):
175         * platform/graphics/win/GraphicsContextDirect2D.cpp:
176         (WebCore::GraphicsContext::colorWithGlobalAlpha const):
177         Update to call toSRGBALossy() rather than toSRGBAComponentsLossy().
178
179 2020-06-13  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
180
181         Remove FileError.h
182         https://bugs.webkit.org/show_bug.cgi?id=213119
183
184         Reviewed by Chris Dumez.
185
186         * Headers.cmake:
187         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
188         (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::didFail):
189         * Modules/async-clipboard/ClipboardItemBindingsDataSource.h:
190         * Modules/mediastream/RTCDataChannel.cpp:
191         (WebCore::RTCDataChannel::createMessageQueue):
192         * Modules/websockets/WebSocketChannel.cpp:
193         (WebCore::WebSocketChannel::didFail):
194         (WebCore::WebSocketChannel::abortOutgoingFrameQueue):
195         * Modules/websockets/WebSocketChannel.h:
196         * WebCore.xcodeproj/project.pbxproj:
197         * fileapi/BlobLoader.h:
198         (WebCore::BlobLoader::didFail):
199         * fileapi/FileError.h: Removed.
200         * fileapi/FileReader.cpp:
201         (WebCore::FileReader::didFail):
202         * fileapi/FileReader.h:
203         * fileapi/FileReaderLoader.cpp:
204         (WebCore::FileReaderLoader::start):
205         (WebCore::FileReaderLoader::cancel):
206         (WebCore::FileReaderLoader::cleanup):
207         (WebCore::FileReaderLoader::didReceiveResponse):
208         (WebCore::FileReaderLoader::didReceiveData):
209         (WebCore::FileReaderLoader::didFail):
210         (WebCore::FileReaderLoader::failed):
211         (WebCore::FileReaderLoader::toErrorCode):
212         (WebCore::FileReaderLoader::httpStatusCodeToErrorCode):
213         (WebCore::FileReaderLoader::arrayBufferResult const):
214         (WebCore::FileReaderLoader::stringResult):
215         * fileapi/FileReaderLoader.h:
216         (WebCore::FileReaderLoader::errorCode const):
217         * fileapi/FileReaderLoaderClient.h:
218         * fileapi/FileReaderSync.cpp:
219         (WebCore::FileReaderSync::startLoading):
220         * fileapi/FileReaderSync.h:
221         * fileapi/NetworkSendQueue.cpp:
222         (WebCore::NetworkSendQueue::processMessages):
223         * fileapi/NetworkSendQueue.h:
224         * html/ImageBitmap.cpp:
225
226 2020-06-12  Simon Fraser  <simon.fraser@apple.com>
227
228         REGRESSION(r261985): Unable to respond to large comments on Bugzilla with always-on scrollbars
229         https://bugs.webkit.org/show_bug.cgi?id=213135
230         <rdar://problem/64302086>
231
232         Reviewed by Tim Horton.
233         
234         The combination of programmatic scrolls (e.g. anchor click, reveal selection) and user scrolling
235         could result in a mismatch between the main thread and scrolling thread scroll positions, resulting
236         in missing tiles and offset cursor handling.
237         
238         This happened if a programmatic scroll occurred and 'scrolledSinceLastCommit' was true for
239         the equivalent scrolling node at the start of a rendering update. synchronizeStateFromScrollingTree()
240         would take the scrolling thread's notion of the scroll position, clobbering the position resulting
241         from the programmatic scroll.
242
243         To fix this, call commitTreeStateIfNeeded() before synchronizeStateFromScrollingTree() to ensure that
244         any programmatic scrolls have been pushed to the scrolling tree before we fetch its state.
245         
246         Some infrastructure is needed for testing; getting into the state where a programmatic
247         scroll and 'scrolledSinceLastCommit' happened in the same event loop cycle required adding
248         internals.scrollBySimulatingWheelEvent(), which just pokes the scrolling tree directly
249         without the complexities of wheel events dispatched via the UI process.
250
251         Test: scrollingcoordinator/mac/reveal-selection-tile-coverage.html
252
253         * page/scrolling/AsyncScrollingCoordinator.cpp:
254         (WebCore::AsyncScrollingCoordinator::scrollBySimulatingWheelEventForTesting):
255         * page/scrolling/AsyncScrollingCoordinator.h:
256         * page/scrolling/ScrollingCoordinator.h:
257         (WebCore::ScrollingCoordinator::scrollBySimulatingWheelEventForTesting):
258         * page/scrolling/ScrollingTree.cpp:
259         (WebCore::ScrollingTree::scrollBySimulatingWheelEventForTesting):
260         * page/scrolling/ScrollingTree.h:
261         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
262         (WebCore::ScrollingCoordinatorMac::willStartRenderingUpdate):
263         * testing/Internals.cpp:
264         (WebCore::Internals::scrollBySimulatingWheelEvent):
265         * testing/Internals.h:
266         * testing/Internals.idl:
267
268 2020-06-12  David Kilzer  <ddkilzer@apple.com>
269
270         [IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum()
271         <https://webkit.org/b/211988>
272         <rdar://problem/63137695>
273
274         Reviewed by Darin Adler.
275
276         Replace decodeEnum() with decode() and encodeEnum() with
277         operator<<().
278
279         * Modules/applicationmanifest/ApplicationManifest.h:
280         (WebCore::ApplicationManifest::decode):
281         * Modules/indexeddb/IDBKeyData.h:
282         (WebCore::IDBKeyData::encode const):
283         (WebCore::IDBKeyData::decode):
284         * Modules/indexeddb/shared/IDBCursorInfo.h:
285         (WebCore::IDBCursorInfo::encode const):
286         (WebCore::IDBCursorInfo::decode):
287         * Modules/indexeddb/shared/IDBError.h:
288         (WebCore::IDBError::encode const):
289         (WebCore::IDBError::decode):
290         * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
291         (WebCore::IDBGetAllRecordsData::encode const):
292         (WebCore::IDBGetAllRecordsData::decode):
293         * Modules/indexeddb/shared/IDBGetRecordData.h:
294         (WebCore::IDBGetRecordData::encode const):
295         (WebCore::IDBGetRecordData::decode):
296         * Modules/indexeddb/shared/IDBIterateCursorData.h:
297         (WebCore::IDBIterateCursorData::encode const):
298         (WebCore::IDBIterateCursorData::decode):
299         * Modules/indexeddb/shared/IDBRequestData.h:
300         (WebCore::IDBRequestData::encode const):
301         (WebCore::IDBRequestData::decode):
302         * Modules/indexeddb/shared/IDBResultData.h:
303         (WebCore::IDBResultData::encode const):
304         (WebCore::IDBResultData::decode):
305         * Modules/indexeddb/shared/IDBTransactionInfo.h:
306         (WebCore::IDBTransactionInfo::encode const):
307         (WebCore::IDBTransactionInfo::decode):
308         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
309         (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
310         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
311         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
312         (WebCore::PublicKeyCredentialDescriptor::decode):
313         * dom/ExceptionData.h:
314         (WebCore::ExceptionData::encode const):
315         (WebCore::ExceptionData::decode):
316         * html/DataListSuggestionInformation.h:
317         (WebCore::DataListSuggestionInformation::encode const):
318         (WebCore::DataListSuggestionInformation::decode):
319         * page/SecurityOrigin.h:
320         (WebCore::SecurityOrigin::encode const):
321         (WebCore::SecurityOrigin::decode):
322         * platform/ContextMenuItem.h:
323         (WTF::EnumTraits<WebCore::ContextMenuAction>):
324         - Add missing ContextMenuItemTagPasteAsPlainText that was added
325           in r261800.
326         * platform/LinkIcon.h:
327         (WebCore::LinkIcon::encode const):
328         (WebCore::LinkIcon::decode):
329         * platform/PasteboardItemInfo.h:
330         (WebCore::PasteboardItemInfo::encode const):
331         (WebCore::PasteboardItemInfo::decode):
332         * platform/ScreenProperties.h:
333         (WebCore::ScreenData::encode const):
334         (WebCore::ScreenData::decode):
335         * platform/graphics/InbandGenericCue.h:
336         (WebCore::GenericCueData::encode const):
337         * platform/graphics/Path.h:
338         (WebCore::Path::encode const):
339         (WebCore::Path::decode):
340         * platform/graphics/displaylists/DisplayListItems.h:
341         (WebCore::DisplayList::SetState::encode const):
342         (WebCore::DisplayList::SetState::decode):
343         (WebCore::DisplayList::DrawTiledScaledImage::encode const):
344         (WebCore::DisplayList::DrawTiledScaledImage::decode):
345         * platform/mediastream/CaptureDevice.h:
346         (WebCore::CaptureDevice::encode const):
347         * platform/mediastream/MediaConstraints.h:
348         (WebCore::MediaConstraint::encode const):
349         (WebCore::MediaConstraint::decode):
350         * platform/mediastream/MediaStreamRequest.h:
351         (WebCore::MediaStreamRequest::encode const):
352         (WebCore::MediaStreamRequest::decode):
353         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
354         (WebCore::CapabilityValueOrRange::encode const):
355         (WebCore::CapabilityValueOrRange::decode):
356         (WebCore::RealtimeMediaSourceCapabilities::encode const):
357         (WebCore::RealtimeMediaSourceCapabilities::decode):
358         * platform/mediastream/RealtimeMediaSourceSettings.h:
359         (WebCore::RealtimeMediaSourceSettings::encode const):
360         (WebCore::RealtimeMediaSourceSettings::decode):
361         * platform/mock/MockMediaDevice.h:
362         (WebCore::MockDisplayProperties::encode const):
363         * platform/network/HTTPHeaderMap.h:
364         (WebCore::HTTPHeaderMap::CommonHeader::encode const):
365         (WebCore::HTTPHeaderMap::CommonHeader::decode):
366         * testing/MockWebAuthenticationConfiguration.h:
367         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
368         (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode):
369         * workers/service/ServiceWorkerContextData.h:
370         (WebCore::ServiceWorkerContextData::decode):
371         * workers/service/ServiceWorkerJobData.h:
372         (WebCore::ServiceWorkerJobData::encode const):
373         (WebCore::ServiceWorkerJobData::decode):
374
375 2020-06-12  Chris Dumez  <cdumez@apple.com>
376
377         Stop allowing pages served over HTTPS with "Cache-Control: no-store" into the back/forward cache
378         https://bugs.webkit.org/show_bug.cgi?id=213147
379         <rdar://problem/64249683>
380
381         Reviewed by Geoffrey Garen.
382
383         Stop allowing pages served over HTTPS with "Cache-Control: no-store" into the back/forward cache.
384         This is a revert of r250437 due to push back from Web developers.
385
386         No new tests, updated existing tests.
387
388         * history/BackForwardCache.cpp:
389         (WebCore::canCacheFrame):
390
391 2020-06-12  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
392
393         Stop to use ActiveDOMObject::setPendingActivity() for Modules/fetch
394         https://bugs.webkit.org/show_bug.cgi?id=213037
395
396         Reviewed by Youenn Fablet.
397
398         By ActiveDOMObject's comments,
399         these methods should be replaced with using makePendingActivity().
400
401         `JSFetchRequest`/`JSFetchResponse` (as derived class of `JSDOMWrapper`) hold
402         `FetchRequest`/`FetchResponse`, and they have `FetchBodyOwner`
403         as a base class and keep alive it. We can replace
404         `setPendingActivity()` calling from `FetchBodyOwner`.
405
406         * Modules/fetch/FetchBodyOwner.cpp:
407         (WebCore::FetchBodyOwner::loadBlob):
408         (WebCore::FetchBodyOwner::finishBlobLoading):
409         (WebCore::FetchBodyOwner::virtualHasPendingActivity const):
410         * Modules/fetch/FetchBodyOwner.h:
411         * Modules/fetch/FetchBodySource.cpp:
412         (WebCore::FetchBodySource::setActive):
413         (WebCore::FetchBodySource::setInactive):
414         * Modules/fetch/FetchBodySource.h:
415
416
417 2020-06-12  Takashi Komori  <Takashi.Komori@sony.com>
418
419         [Curl] Implement functions to use ResourceLoadStatistics.
420         https://bugs.webkit.org/show_bug.cgi?id=207692
421
422         Reviewed by Don Olmstead.
423
424         Implement functions which are required to implement ResourceLoadStatistics for Curl port.
425
426         Tests: http/tests/resourceLoadStatistics/
427
428         * CMakeLists.txt:
429         * platform/network/curl/CookieJarDB.cpp:
430         (WebCore::CookieJarDB::openDatabase):
431         (WebCore::CookieJarDB::setCookie):
432         (WebCore::CookieJarDB::allDomains):
433         (WebCore::CookieJarDB::deleteCookiesForHostname):
434         * platform/network/curl/CookieJarDB.h:
435         * platform/network/curl/NetworkStorageSessionCurl.cpp:
436         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
437         (WebCore::NetworkStorageSession::setCookies):
438         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
439         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
440
441 2020-06-12  Andres Gonzalez  <andresg_22@apple.com>
442
443         In isolated tree mode 2, AXIsolatedObject::setChildrenIDs should be called only on secondary thread.
444         https://bugs.webkit.org/show_bug.cgi?id=213124
445
446         Reviewed by Chris Fleizach.
447
448         Covered by existing tests.
449
450         - AXIsolatedTree::createSubtree was calling AXIsolatedObject::setChildrenIDs
451         which should be called only on the secondary thread. Now it is queueing
452         the children update under lock.
453         - The unsigned int range for object IDs was being overrun for large
454         number of objects like in the case of the sample page in <rdar://problem/59331146>.
455         Increased the size of AXID to size_t.
456         - Better handle the case of invalid object IDs, although this needs
457         more work, since we should never encounter this case.
458
459         * accessibility/AccessibilityObjectInterface.h: AXID are now size_t instead of unsigned ints.
460         * accessibility/isolatedtree/AXIsolatedObject.cpp:
461         (WebCore::AXIsolatedObject::AXIsolatedObject):
462         (WebCore::AXIsolatedObject::setChildrenIDs): Inlined in header.
463         * accessibility/isolatedtree/AXIsolatedObject.h:
464         * accessibility/isolatedtree/AXIsolatedTree.cpp:
465         (WebCore::AXIsolatedTree::createSubtree):
466
467 2020-06-12  Andy Estes  <aestes@apple.com>
468
469         FileInputType should use WeakPtr for FileListCreator lambdas
470         https://bugs.webkit.org/show_bug.cgi?id=213130
471         <rdar://problem/64276591>
472
473         Reviewed by David Kilzer.
474
475         FileInputType::filesChosen was passing a completion handler to FileListCreator::create that
476         captured |this|. If the FileListCreator instance still existed when |this| was destroyed,
477         FileInputType::~FileInputType would clear the captured |this| by calling
478         FileListCreator::clear. This can be simplified by having the FileListCreator completion
479         handler capture a WeakPtr to |this|.
480
481         Also, when FileInputType::allowsDirectories is false, m_fileListCreator would not be
482         properly cleared after creating the file list. The FileListCreator completion handler would
483         set m_fileListCreator to nullptr, but would be executed *before* FileListCreator::create
484         returned and set m_fileListCreator to the newly-created FileListCreator object. Fixed this
485         by having FileListCreator::create execute the completion handler immediately and return
486         nullptr in cases where a FileListCreator does not need to be created for directory
487         resolution.
488
489         Covered by existing tests.
490
491         * html/FileInputType.cpp:
492         (WebCore::FileInputType::~FileInputType):
493         (WebCore::FileInputType::filesChosen):
494         * html/FileInputType.h:
495         * html/FileListCreator.cpp:
496         (WebCore::createFileList):
497         (WebCore::FileListCreator::create):
498         (WebCore::FileListCreator::FileListCreator):
499         (WebCore::FileListCreator::createFileList):
500         * html/FileListCreator.h:
501         (WebCore::FileListCreator::create): Deleted.
502
503 2020-06-12  Antti Koivisto  <antti@apple.com>
504
505         REGRESSION (r262618): Very slow typing in a github issue
506         https://bugs.webkit.org/show_bug.cgi?id=213137
507         <rdar://problem/64214117>
508
509         Reviewed by Darin Adler.
510
511         Test: fast/media/media-query-keyframes-resolution-count.html
512
513         If a stylesheet had multiple media queries and one of them forced static resolution
514         (by containing @keyframes rule for example) we would end up reseting the style multiple
515         times and forcing unneeded style resolutions.
516
517         * style/RuleSet.cpp:
518         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
519
520         We can't bail out from the loop. Even though the result is known we still need to loop to
521         save the evaluation result for all media queries.
522
523 2020-06-12  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
524
525         FileReader.error should be DOMException now
526         https://bugs.webkit.org/show_bug.cgi?id=213117
527
528         Reviewed by Chris Dumez.
529
530         By the [lastest spec](https://w3c.github.io/FileAPI/),
531         `FileReader.error` should return `DOMException`
532         and this remove obsoleted `FileError` from exposed interfaces.
533
534         Internally, our codebase still depends on `fileapi/FileError.h`
535         in everywhere. I'll plan to create a patch to refactor them.
536
537         * CMakeLists.txt:
538         * DerivedSources-input.xcfilelist:
539         * DerivedSources-output.xcfilelist:
540         * DerivedSources.make:
541         * Sources.txt:
542         * WebCore.order:
543         * WebCore.xcodeproj/project.pbxproj:
544         * fileapi/FileError.idl: Removed.
545         * fileapi/FileReader.cpp:
546         (WebCore::FileReader::abort):
547         (WebCore::FileReader::didFail):
548         * fileapi/FileReader.h:
549         * fileapi/FileReader.idl:
550         * fileapi/FileReaderSync.cpp:
551         (WebCore::FileReaderSync::errorCodeToException):
552         * fileapi/FileReaderSync.h:
553
554 2020-06-12  Zalan Bujtas  <zalan@apple.com>
555
556         [LFC][TFC] Add support for min/max-width
557         https://bugs.webkit.org/show_bug.cgi?id=213111
558
559         Reviewed by Antti Koivisto.
560
561         Apply min/max-width to constrain the available width for the table content. 
562
563         Test: fast/layoutformattingcontext/table-min-max-width-simple.html
564
565         * layout/blockformatting/BlockFormattingContext.cpp:
566         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
567         (WebCore::Layout::BlockFormattingContext::computedWidthAndMargin):
568         * layout/blockformatting/BlockFormattingContext.h:
569         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
570         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
571
572 2020-06-12  Antti Koivisto  <antti@apple.com>
573
574         Relative font size values (em) within CSS animations compound
575         https://bugs.webkit.org/show_bug.cgi?id=194749
576         <rdar://problem/48171898>
577
578         Reviewed by Antoine Quint.
579
580         The em unit should be relative to the font size of the parent style when resolving 'font-size' property.
581         We weren't passing the parent style when resolving keyframes.
582
583         Test case by Scott Kellum.
584
585         Test: animations/keyframe-em-unit.html
586
587         * style/StyleResolver.cpp:
588         (WebCore::Style::Resolver::styleForKeyframe):
589         * style/StyleResolver.h:
590         (WebCore::Style::Resolver::overrideDocumentElementStyle const):
591         (WebCore::Style::Resolver::setOverrideDocumentElementStyle):
592         (WebCore::Style::Resolver::setParentElementStyleForKeyframes):
593
594         Add a way to pass the parent element style directly to the style resolver.
595         This should really be passed via the animation system like other context but that requires
596         lots of refactoring.
597
598         * style/StyleTreeResolver.cpp:
599         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
600
601         Pass it.
602
603 2020-06-11  Sam Weinig  <weinig@apple.com>
604
605         Document.currentScript does not work for SVGScriptElements
606         https://bugs.webkit.org/show_bug.cgi?id=213104
607
608         Reviewed by Yusuke Suzuki.
609
610         Updates results for existing tests.
611
612         * WebCore.xcodeproj/project.pbxproj:
613         Add CurrentScriptIncrementer.h to the Xcode project as it was missing.
614
615         * dom/CurrentScriptIncrementer.h:
616         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
617         (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer):
618         Re-work using ScriptElement, removing the HTMLScriptElement checks. Also changes
619         scriptType check to explicitly check that against classic scripts, as they are
620         the only supported type, and if any types other than modules are added in the 
621         future, we would not want this to change behavior.
622
623         * dom/Document.cpp:
624         (WebCore::Document::pushCurrentScript):
625         * dom/Document.h:
626         (WebCore::Document::currentScript const):
627         Use an Element, rather than an HTMLScriptElement for currentScript/currentScriptStack
628         so that either an HTMLScriptElement or an SVGScriptElement can be stored. Using a 
629         ScriptElement would be possible, but would complicate the implementation unnecessarily
630         by requiring currentScript to have an additional checks before extracting the Element.
631         Variant<RefPtr<HTMLScriptElement>, RefPtr<SVGScriptElement>> could also have been used
632         but also would unnecessarily complicated the interface and caused more memory to be used. 
633
634         * dom/Document.idl:
635         Update interface to use Element rather HTMLScriptElement with a comment explaining why we
636         are not using HTMLOrSVGScriptElement but retaining the same observable behavior.
637
638         * dom/ScriptElement.cpp:
639         (WebCore::ScriptElement::executeClassicScript):
640         (WebCore::ScriptElement::executeModuleScript):
641         Pass *this directly to CurrentScriptIncrementer to simplify implementation.
642
643 2020-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
644
645         [GTK4] Make WebDriver work
646         https://bugs.webkit.org/show_bug.cgi?id=212316
647
648         Reviewed by Adrian Perez de Castro.
649
650         Add helper gtk definitions to avoid ifdefs and implement currentScreenMonitor() for GTK4.
651
652         * platform/gtk/GtkVersioning.h:
653         (gtk_window_move):
654         (gtk_window_minimize):
655         (gtk_window_unminimize):
656         * platform/gtk/PlatformScreenGtk.cpp:
657         (WebCore::currentScreenMonitor):
658         (WebCore::screenRect):
659         (WebCore::screenAvailableRect):
660         (WebCore::getCurrentScreenMonitor): Deleted.
661
662 2020-06-11  David Kilzer  <ddkilzer@apple.com>
663
664         [IPC] Add WTF::EnumTraits<> for every enum type used in IPC
665         <https://webkit.org/b/213093>
666
667         Reviewed by Darin Adler.
668
669         Summary:
670         - Change underlying type of enum class to `bool` when there are
671           only two values.  In some cases, reorder the two values so the
672           mapping to 0 and 1 makes more sense.  Converting every enum to
673           an enum class is not a goal of this patch, so some two-value
674           enums stil have WTF::EnumTraits<> defined as noted below.
675         - Add WTF::EnumTraits<> for the remaining enum types that are
676           used by IPC::Encoder::encodeEnum() and
677           IPC::Decoder::decodeEnum() so that WTF::isValidEnum<>() checks
678           may be added next.
679         - Add #include <WebCore/LibWebRTCEnumTraits.h> as needed.
680
681         * Headers.cmake:
682         * WebCore.xcodeproj/project.pbxproj:
683         - Add LibWebRTCEnumTraits.h to project. Keep these definitions
684           separate from the libwebrtc project cut down on changes to
685           re-merge after updating.
686
687         * platform/mediastream/libwebrtc/LibWebRTCEnumTraits.h: Add.
688
689         * Modules/applepay/ApplePaySessionPaymentRequest.h:
690         * Modules/indexeddb/IDBTransactionMode.h:
691         * Modules/indexeddb/IndexedDB.h:
692         (WTF::EnumTraits<WebCore::IndexedDB::IndexRecordType>):
693         - Remove after changing enum class to bool.
694         * Modules/indexeddb/shared/IDBGetRecordData.h:
695         * Modules/indexeddb/shared/IDBResultData.h:
696         * WebCore.xcodeproj/project.pbxproj:
697         * dom/ExceptionCode.h:
698         * editing/CompositionUnderline.h:
699         * html/Autofill.h:
700         * html/DataListSuggestionInformation.h:
701         * html/EnterKeyHint.h:
702         * html/LinkIconType.h:
703         * loader/FrameLoaderTypes.h:
704         - Alphabetize WTF::EnumTraits<> definitions.
705         * loader/ResourceLoaderOptions.h:
706         * page/SecurityOrigin.h:
707         * page/UserStyleSheetTypes.h:
708         (WTF::EnumTraits<WebCore::UserStyleLevel>):
709         - Define this since UserStyleLevel is not an enum class.
710         * page/scrolling/ScrollingCoordinatorTypes.h:
711         * platform/ContextMenuItem.h:
712         * platform/Cursor.h:
713         * platform/DragData.h:
714         * platform/FileChooser.h:
715         * platform/PopupMenuStyle.h:
716         * platform/ScreenProperties.h:
717         * platform/ScrollTypes.h:
718         * platform/SerializedPlatformDataCueValue.h:
719         (WebCore::SerializedPlatformDataCueValue::PlatformType):
720         - Convert from enum to enum class.
721         * platform/UserInterfaceLayoutDirection.h:
722         * platform/animation/TimingFunction.h:
723         * platform/graphics/GraphicsContext.h:
724         * platform/graphics/GraphicsLayer.h:
725         * platform/graphics/GraphicsTypes.h:
726         - Alphabetize WTF::EnumTraits<> definitions.
727         * platform/graphics/Image.h:
728         * platform/graphics/Path.h:
729         * platform/graphics/ca/PlatformCAAnimation.h:
730         * platform/graphics/ca/PlatformCALayer.h:
731         * platform/graphics/filters/FilterOperation.h:
732         * platform/mediastream/MediaConstraints.h:
733         * platform/mediastream/MediaStreamRequest.h:
734         (WTF::EnumTraits<WebCore::MediaStreamRequest::Type>):
735         - Fix EnumTraits definition (missing "::Type").
736         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
737         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
738         * platform/network/CredentialBase.h:
739         * platform/network/ProtectionSpaceBase.h:
740         * platform/network/ResourceErrorBase.h:
741         * platform/network/soup/SoupNetworkProxySettings.h:
742         * platform/text/TextChecking.h:
743         (WTF::EnumTraits<WebCore::TextCheckingProcessType):
744         - Define this since TextCheckingProcessType is not an enum class.
745         * platform/text/WritingMode.h:
746         * rendering/Pagination.h:
747         * workers/service/ServiceWorkerJobType.h:
748
749 2020-06-11  Beth Dakin  <bdakin@apple.com>
750
751         Fix comment after blocklist transition
752         https://bugs.webkit.org/show_bug.cgi?id=213100
753
754         Reviewed by Wenson Hsieh.
755
756         * platform/mac/PasteboardMac.mm:
757         (WebCore::cocoaTypeFromHTMLClipboardType):
758
759 2020-06-11  Rob Buis  <rbuis@igalia.com>
760
761         REGRESSION (r262776): Flaky crash under -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
762         https://bugs.webkit.org/show_bug.cgi?id=213059
763
764         Reviewed by Alex Christensen.
765
766         My r262776 patch did not null check m_handle and it can cause crashes
767         in some cases, so add the check.
768
769         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
770         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
771
772 2020-06-11  Beth Dakin  <bdakin@apple.com>
773
774         Replace instances of whitelist in WebCore with allowlist
775         https://bugs.webkit.org/show_bug.cgi?id=213068
776
777         Reviewed by Tim Horton.
778
779         * Modules/webdatabase/DatabaseAuthorizer.cpp:
780         (WebCore::DatabaseAuthorizer::DatabaseAuthorizer):
781         (WebCore::DatabaseAuthorizer::addAllowedFunctions):
782         (WebCore::DatabaseAuthorizer::allowFunction):
783         (WebCore::DatabaseAuthorizer::addWhitelistedFunctions): Deleted.
784         * Modules/webdatabase/DatabaseAuthorizer.h:
785         * dom/ExtensionStyleSheets.cpp:
786         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
787         * loader/CrossOriginAccessControl.cpp:
788         (WebCore::isOnAccessControlSimpleRequestMethodAllowlist):
789         (WebCore::isSimpleCrossOriginAccessRequest):
790         (WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Deleted.
791         * loader/CrossOriginAccessControl.h:
792         * loader/CrossOriginPreflightResultCache.cpp:
793         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
794         * loader/appcache/ApplicationCache.cpp:
795         (WebCore::ApplicationCache::setOnlineAllowlist):
796         (WebCore::ApplicationCache::isURLInOnlineAllowlist):
797         (WebCore::ApplicationCache::setOnlineWhitelist): Deleted.
798         (WebCore::ApplicationCache::isURLInOnlineWhitelist): Deleted.
799         * loader/appcache/ApplicationCache.h:
800         (WebCore::ApplicationCache::onlineAllowlist const):
801         (WebCore::ApplicationCache::onlineWhitelist const): Deleted.
802         * loader/appcache/ApplicationCacheGroup.cpp:
803         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
804         * loader/appcache/ApplicationCacheHost.cpp:
805         (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
806         (WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
807         * loader/appcache/ApplicationCacheStorage.cpp:
808         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
809         (WebCore::ApplicationCacheStorage::openDatabase):
810         (WebCore::ApplicationCacheStorage::store):
811         (WebCore::ApplicationCacheStorage::loadCache):
812         * loader/appcache/ManifestParser.cpp:
813         (WebCore::parseManifest):
814         * loader/appcache/ManifestParser.h:
815         * page/Frame.cpp:
816         (WebCore::Frame::injectUserScriptImmediately):
817         * page/SecurityOrigin.cpp:
818         (WebCore::SecurityOrigin::canRequest const):
819         (WebCore::SecurityOrigin::canDisplay const):
820         * page/SecurityPolicy.cpp:
821         (WebCore::SecurityPolicy::isAccessAllowed):
822         (WebCore::SecurityPolicy::addOriginAccessAllowlistEntry):
823         (WebCore::SecurityPolicy::removeOriginAccessAllowlistEntry):
824         (WebCore::SecurityPolicy::resetOriginAccessAllowlists):
825         (WebCore::SecurityPolicy::isAccessWhiteListed): Deleted.
826         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): Deleted.
827         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): Deleted.
828         (WebCore::SecurityPolicy::resetOriginAccessWhitelists): Deleted.
829         * page/SecurityPolicy.h:
830         * page/UserContentURLPattern.cpp:
831         (WebCore::UserContentURLPattern::matchesPatterns):
832         * page/UserContentURLPattern.h:
833         * page/UserScript.h:
834         (WebCore::UserScript::UserScript):
835         (WebCore::UserScript::allowlist const):
836         (WebCore::UserScript::encode const):
837         (WebCore::UserScript::decode):
838         (WebCore::UserScript::whitelist const): Deleted.
839         * page/UserStyleSheet.h:
840         (WebCore::UserStyleSheet::UserStyleSheet):
841         (WebCore::UserStyleSheet::allowlist const):
842         (WebCore::UserStyleSheet::whitelist const): Deleted.
843         * platform/graphics/FontCache.h:
844         * platform/graphics/cocoa/FontCacheCoreText.cpp:
845         (WebCore::fontAllowlist):
846         (WebCore::FontCache::setFontAllowlist):
847         (WebCore::platformFontLookupWithFamily):
848         (WebCore::fontWhitelist): Deleted.
849         (WebCore::FontCache::setFontWhitelist): Deleted.
850         * platform/network/HTTPParsers.cpp:
851         (WebCore::isValidAcceptHeaderValue):
852         * rendering/FloatingObjects.h:
853         * style/ElementRuleCollector.cpp:
854         (WebCore::Style::ElementRuleCollector::transferMatchedRules):
855         * style/ElementRuleCollector.h:
856         * style/PropertyCascade.cpp:
857         (WebCore::Style::PropertyCascade::addMatch):
858         * style/RuleData.cpp:
859         (WebCore::Style::determinePropertyAllowlistType):
860         (WebCore::Style::RuleData::RuleData):
861         (WebCore::Style::determinePropertyWhitelistType): Deleted.
862         * style/RuleData.h:
863         (WebCore::Style::RuleData::propertyAllowlistType const):
864         (WebCore::Style::RuleData::propertyWhitelistType const): Deleted.
865
866 2020-06-11  Andy Estes  <aestes@apple.com>
867
868         [iOS] nullptr deref in FileInputType::iconLoaded when the input's type attribute is modified by a change event listener
869         https://bugs.webkit.org/show_bug.cgi?id=208244
870         <rdar://problem/41855350>
871
872         Reviewed by Wenson Hsieh.
873
874         When an <input> element's type attribute changes, its existing InputType is detached from
875         the HTMLInputElement by nulling InputType::m_element. When FileInputType::filesChosen is
876         called, it dispatches the input and change events, which can run arbitrary JavaScript that
877         might modify the element's type attribute. If this happens, FileInputType::m_element will be
878         null after returning from FileInputType::setFiles and if there is an icon will be
879         dereferenced by FileInputType::iconLoaded.
880
881         Fixed this by checking for a non-null m_element before calling iconLoaded. While here, also
882         fixed a bug where we sometimes checked the length of m_fileList before FileListCreator had
883         finished setting m_fileList. This bug resulted in missing file icons whenever an
884         <input type=file> had the webkitdirectory attribute.
885
886         Tests: fast/forms/file/file-input-type-detached-on-change.html
887                fast/forms/file/file-input-webkitdirectory-icon.html
888
889         * html/FileInputType.cpp:
890         (WebCore::FileInputType::filesChosen):
891
892 2020-06-11  Beth Dakin  <bdakin@apple.com>
893
894         Remove references to "slave" in WebCore
895         https://bugs.webkit.org/show_bug.cgi?id=213085
896
897         Reviewed by Wenson Hsieh.
898
899         This feature is referred to as a mediagroup in html, so let's use that terminology here as 
900         well.
901         * html/MediaController.cpp:
902         (WebCore::MediaController::buffered const):
903         (WebCore::MediaController::seekable const):
904         (WebCore::MediaController::played):
905         (WebCore::MediaController::duration const):
906         (WebCore::MediaController::setCurrentTime):
907         (WebCore::MediaController::play):
908         (WebCore::MediaController::updateReadyState):
909         (WebCore::MediaController::updatePlaybackState):
910         (WebCore::MediaController::isBlocked const):
911         (WebCore::MediaController::hasEnded const):
912
913 2020-06-11  David Kilzer  <ddkilzer@apple.com>
914
915         [IPC] Adopt enum class for DragSourceAction
916         <https://webkit.org/b/212885>
917         <rdar://problem/64094134>
918
919         Reviewed by Darin Adler.
920
921         Summary:
922         - Convert DragSourceAction to enum class.
923         - Remove DragSourceActionNone by using Optional<> and
924           OptionSet<> (as dictated by how the code used the value).
925         - Remove DragSourceActionAny and replace (as needed) with
926           anyDragSourceAction(). (Some--but not all--uses were removed.)
927         - Add both WTF::EnumTraits<> and WTF::OptionSetTraits<> for
928           DragSourceAction since both Optional<> and OptionSet<> are
929           used with IPC.
930
931         * loader/EmptyClients.cpp:
932         * page/DragActions.h:
933         (WebCore::DragSourceAction):
934         - Convert to enum class.
935         (WebCore::anyDragSourceAction): Add.
936         - Replaces WebCore::DragSourceActionAny.
937         (WTF::EnumTraits<WebCore::DragSourceAction>): Add.
938         (WTF::OptionSetTraits<WebCore::DragSourceAction>): Add.
939         * page/DragClient.h:
940         * page/DragController.cpp:
941         (WebCore::DragController::delegateDragSourceAction):
942         (WebCore::DragController::draggableElement const):
943         (WebCore::DragController::prepareForDragStart const):
944         (WebCore::DragController::startDrag):
945         (WebCore::DragController::doSystemDrag):
946         - Use OptionSet<>::toSingleValue() and add ASSERT() that it does
947           not return WTF::nullopt.
948         * page/DragController.h:
949         (WebCore::DragController::dragSourceAction const):
950         * page/DragState.h:
951         * page/EventHandler.cpp:
952         (WebCore::EventHandler::updateDragSourceActionsAllowed const):
953         (WebCore::EventHandler::dragHysteresisExceeded const):
954         - Use OptionSet<>::toSingleValue() and add ASSERT() that it does
955           not return WTF::nullopt.
956         - Remove case statements for DragSourceActionNone and
957           DragSourceActionAny, along with ASSERT_NOT_REACHED(). The
958           ASSERT() for toSingleValue() replaces the DragSourceActionNone
959           case.
960         (WebCore::EventHandler::didStartDrag):
961         (WebCore::ExactlyOneBitSet): Delete.
962         - Move to WTF::OptionSet<>::hasExactlyOneBitSet().
963         (WebCore::EventHandler::handleDrag):
964         - Add code to #ifndef NDEBUG/#endif instead of modifying
965           dragState().type in-place since it seemed weird to modify it
966           just to check an ASSERT(), even though it was overwritten
967           immediately after that.
968         * page/EventHandler.h:
969         * platform/DragItem.h:
970         (WebCore::DragItem::encode const):
971         (WebCore::DragItem::decode):
972         - Stop using decodeEnum()/encodeEnum() with
973           Optional<DragSourceAction>.
974
975 2020-06-11  Youenn Fablet  <youenn@apple.com>
976
977         End a remote MediaStreamTrack if its source is ended
978         https://bugs.webkit.org/show_bug.cgi?id=213074
979
980         Reviewed by Eric Carlson.
981
982         Make remote audio/video source observers of their webrtc source.
983         In case the webrtc source ends, end the source, thus its related tracks as well.
984         This is covered by the above test.
985
986         Test: webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive.html
987
988         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
989         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
990         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
991         (WebCore::RealtimeIncomingAudioSource::startProducingData):
992         (WebCore::RealtimeIncomingAudioSource::stopProducingData):
993         (WebCore::RealtimeIncomingAudioSource::OnChanged):
994         * platform/mediastream/RealtimeIncomingAudioSource.h:
995         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
996         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
997         (WebCore::RealtimeIncomingVideoSource::~RealtimeIncomingVideoSource):
998         (WebCore::RealtimeIncomingVideoSource::startProducingData):
999         (WebCore::RealtimeIncomingVideoSource::stopProducingData):
1000         (WebCore::RealtimeIncomingVideoSource::OnChanged):
1001         * platform/mediastream/RealtimeIncomingVideoSource.h:
1002         * platform/mediastream/RealtimeMediaSource.cpp:
1003         (WebCore::RealtimeMediaSource::requestToEnd):
1004         (WebCore::RealtimeMediaSource::end):
1005         * platform/mediastream/RealtimeMediaSource.h:
1006
1007 2020-06-11  Rob Buis  <rbuis@igalia.com>
1008
1009         Improve url-setters.html WPT test
1010         https://bugs.webkit.org/show_bug.cgi?id=213046
1011
1012         Reviewed by Darin Adler.
1013
1014         Improve url-setters.html WPT test by testing for failure that can occur
1015         when setting host or hostname [1].
1016
1017         [1] https://url.spec.whatwg.org/#host-state
1018
1019         * html/URLDecomposition.cpp:
1020         (WebCore::URLDecomposition::setHost):
1021         (WebCore::URLDecomposition::setHostname):
1022
1023 2020-06-11  ChangSeok Oh  <changseok@webkit.org>
1024
1025         [GTK] Implement button-press-event, button-release-event, and absolute-axis-event of GAMEPAD API.
1026         https://bugs.webkit.org/show_bug.cgi?id=133850
1027
1028         Reviewed by Carlos Garcia Campos.
1029
1030         This is a follow-up change after r261965, implementing the rest of missing GAMEPAD API
1031         for the gtk port. Buttons and analog sticks of standard gamepads work with this change.
1032
1033         No new tests since existing tests can cover this change.
1034
1035         * html/OffscreenCanvas.h:
1036         * platform/gamepad/manette/ManetteGamepad.cpp:
1037         (WebCore::toStandardGamepadAxis):
1038         (WebCore::onAbsoluteAxisEvent):
1039         (WebCore::toStandardGamepadButton):
1040         (WebCore::onButtonPressEvent):
1041         (WebCore::onButtonReleaseEvent):
1042         (WebCore::ManetteGamepad::ManetteGamepad):
1043         (WebCore::ManetteGamepad::~ManetteGamepad):
1044         (WebCore::ManetteGamepad::buttonPressedOrReleased):
1045         (WebCore::ManetteGamepad::absoluteAxisChanged):
1046         * platform/gamepad/manette/ManetteGamepad.h:
1047         * platform/gamepad/manette/ManetteGamepadProvider.cpp:
1048         (WebCore::ManetteGamepadProvider::ManetteGamepadProvider):
1049         (WebCore::ManetteGamepadProvider::~ManetteGamepadProvider):
1050         (WebCore::ManetteGamepadProvider::gamepadHadInput):
1051         (WebCore::ManetteGamepadProvider::inputNotificationTimerFired):
1052         * platform/gamepad/manette/ManetteGamepadProvider.h:
1053
1054 2020-06-10  Sergio Villar Senin  <svillar@igalia.com>
1055
1056         [WebXR] Pass an unsigned long to cancelAnimationCallback() as handle
1057         https://bugs.webkit.org/show_bug.cgi?id=212529
1058
1059         Reviewed by Youenn Fablet.
1060
1061         The type of the handle returned by XRSession::requestAnimationFrame() was recently changed
1062         to unsigned long from long as there was no point in using signed integers for that. However
1063         we forgot to update the cancelAnimationFrame() in the specs as well as it receives the handle
1064         returned by requestAnimationFrame().
1065
1066         We landed https://github.com/immersive-web/webxr/pull/1069 in the WebXR specs so we can now
1067         safely also replace signed by unsigned integers in our implementation.
1068
1069         No new tests as there is no change in functionality.
1070
1071         Reland r262718.
1072
1073         * Modules/webxr/WebXRSession.cpp:
1074         (WebCore::WebXRSession::cancelAnimationFrame): Use unsigned ids.
1075         * Modules/webxr/WebXRSession.h: Ditto.
1076         * Modules/webxr/WebXRSession.idl: Ditto.
1077
1078 2020-06-11  Antoine Quint  <graouts@webkit.org>
1079
1080         [Web Animations] Setting the style at the last style change event to null should not create an ElementAnimationRareData object
1081         https://bugs.webkit.org/show_bug.cgi?id=213070
1082         <rdar://problem/63841893>
1083
1084         Reviewed by Tim Horton.
1085
1086         In r262154 we added code that records the pre-animation style for a given element in
1087         Style::TreeResolver::createAnimatedElementUpdate(), which is in Web Animations spec
1088         parlance the style at the last style change event. This style is set on the backing
1089         ElementAnimationRareData object for the given Element. For any element that did not
1090         actually have any animations, we would set this style to null, but the function on
1091         Element acting as a go-between would always create the backing ElementAnimationRareData
1092         even though it would set a null value. We now only creaste the ElementAnimationRareData
1093         object if there is a value to be stored, which fixes a performance regression in the
1094         Speedometer2 test.
1095
1096         * dom/Element.cpp:
1097         (WebCore::Element::setLastStyleChangeEventStyle):
1098
1099 2020-06-10  Beth Dakin  <bdakin@apple.com>
1100
1101         Replace instances of blacklist in WebCore with blocklist
1102         https://bugs.webkit.org/show_bug.cgi?id=213064
1103
1104         Reviewed by Tim Horton.
1105
1106         * dom/ExtensionStyleSheets.cpp:
1107         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
1108         * page/Frame.cpp:
1109         (WebCore::Frame::injectUserScriptImmediately):
1110         * page/UserContentURLPattern.cpp:
1111         (WebCore::UserContentURLPattern::matchesPatterns):
1112         * page/UserContentURLPattern.h:
1113         * page/UserScript.h:
1114         (WebCore::UserScript::UserScript):
1115         (WebCore::UserScript::blocklist const):
1116         (WebCore::UserScript::encode const):
1117         (WebCore::UserScript::decode):
1118         (WebCore::UserScript::blacklist const): Deleted.
1119         * page/UserStyleSheet.h:
1120         (WebCore::UserStyleSheet::UserStyleSheet):
1121         (WebCore::UserStyleSheet::blocklist const):
1122         (WebCore::UserStyleSheet::blacklist const): Deleted.
1123         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
1124         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
1125         (WebCore::GraphicsContextGLOpenGL::checkGPUStatus):
1126         * platform/mac/PasteboardMac.mm:
1127         (WebCore::cocoaTypeFromHTMLClipboardType):
1128         * platform/text/TextEncodingRegistry.cpp:
1129         (WebCore::pruneBlocklistedCodecs):
1130         (WebCore::extendTextCodecMaps):
1131         (WebCore::pruneBlacklistedCodecs): Deleted.
1132
1133 2020-06-10  Frank Yang  <guowei_yang@apple.com>
1134
1135         Multiple SVG Filters Unexpectedly lightens image using linearRGB
1136         https://bugs.webkit.org/show_bug.cgi?id=212649
1137
1138         Reviewed by Myles C. Maxfield, Simon Fraser, Darin Adler
1139
1140         Added color space conversion of input FilterEffect ImageBuffer and ImageData
1141         for filters that directly manipulates pixel values. The conversion
1142         is missing only on CG platforms because on CG platforms,
1143         FilterEffect::transformResultColorSpace doesn't perform any operations
1144         Its author assumed all filters are using CG ImageBuffers, and that
1145         CG will handle the conversion which is not the case. The following filters
1146         operates on the raw pixels inside an ImageBuffer, and this requires an explicit
1147         color space conversion of the pixel values when the ImageData are retrieved
1148         by calling FilterEffect::copy{Pre/Un}multipliedData(). 
1149
1150         The filters affected are feComponentTransfer, feComposite, feConvolveMatrix
1151         feGaussianBlur, FELighting, feMorphology. The conversion is done 
1152         by CG, by drawing the input ImageBuffer to a new ImageBuffer that 
1153         has the correct color space tag. The ImageData is then pulled from 
1154         this new ImageBuffer and used in platformApplySoftware() 
1155
1156         Tests: svg/filters/feComponentTransfer-clipped-expected.svg
1157                svg/filters/feComponentTransfer-clipped.svg
1158                svg/filters/feComposite-clipped-expected.svg
1159                svg/filters/feComposite-clipped.svg
1160                svg/filters/feConvolveMatrix-clipped-expected.svg
1161                svg/filters/feConvolveMatrix-clipped.svg
1162                svg/filters/feGaussianBlur-clipped-expected.svg
1163                svg/filters/feGaussianBlur-clipped.svg
1164                svg/filters/feLighting-clipped-expected.svg
1165                svg/filters/feLighting-clipped.svg
1166                svg/filters/feMorphology-clipped-expected.svg
1167                svg/filters/feMorphology-clipped.svg
1168
1169         * platform/graphics/filters/FEComponentTransfer.cpp:
1170         (WebCore::FEComponentTransfer::platformApplySoftware): Modified function call to
1171              FilterEffect::premultipliedResult, color space conversion is required on CG 
1172              platforms, so operatingColorSpace is passed in and input will be converted to 
1173              that color space
1174         * platform/graphics/filters/FEComposite.cpp:
1175         (WebCore::FEComposite::platformApplySoftware): Similarly, color space conversion 
1176              Required on CG color space conversion is required on CG 
1177              platforms, so operatingColorSpace is passed in and input will be converted to 
1178              that color space
1179         * platform/graphics/filters/FEConvolveMatrix.cpp:
1180         (WebCore::FEConvolveMatrix::platformApplySoftware): converting to operating space
1181         * platform/graphics/filters/FEGaussianBlur.cpp:
1182         (WebCore::FEGaussianBlur::platformApplySoftware): converting to operating space
1183         * platform/graphics/filters/FELighting.cpp:
1184         (WebCore::FELighting::platformApplySoftware): converting to operating space
1185         * platform/graphics/filters/FEMorphology.cpp:
1186         (WebCore::FEMorphology::platformApplyDegenerate): converting to operating space
1187         (WebCore::FEMorphology::platformApplySoftware): converting to operating space
1188         * platform/graphics/filters/FilterEffect.cpp:
1189         (WebCore::FilterEffect::unmultipliedResult): modified function signature so that 
1190              The Optional ColorSpace enum could be passed in to copyUnmultipliedResult()
1191         (WebCore::FilterEffect::premultipliedResult): modified function signature so that 
1192              The Optional ColorSpace enum could be passed in to copyUnmultipliedResult()
1193         (WebCore::FilterEffect::convertImageDataToColorSpace): helper function that takes an ImageData ptr 
1194              as input, put it into an ImageBuffer, and calls convertImageBufferToColorSpace to
1195              perform color conversion, and returns the converted ImageData
1196         (WebCore::FilterEffect::convertImageBufferToColorSpace): helper function that takes an ImageBuffer ptr 
1197              as input, create a new ImageBuffer with target color space, write input ImageBuffer to this new buffer
1198              (CG backend handles the conversion) and returns the ImageData in the buffer.
1199         (WebCore::FilterEffect::copyConvertedImageBufferToDestination): helper function that copies data from ImageBuffer
1200              whose data is converted to the correct color space, to the destination array
1201         (WebCore::FilterEffect::copyConvertedImageDataToDestination): helper function that copies data from ImageData
1202              whose data is converted to the correct color space, to the destination array
1203         (WebCore::FilterEffect::copyUnmultipliedResult): added an optional argument, colorSpace, which will be passed 
1204              into requiresAdditionalColorSpaceConversion, in order to determine if color space conversion is required
1205              when obtaining the unmultiplied result. Then, added code to convert color space before writing to the 
1206              destination array
1207         (WebCore::FilterEffect::copyPremultipliedResult): added an optional argument, colorSpace, which will be passed
1208              into requiresAdditionalColorSpaceConversion, in order to determine if color space conversion is required
1209              when obtaining the premultiplied result. Then, added code to convert color space before writing to the
1210              destination array.
1211         (WebCore::FilterEffect::requiresImageDataColorSpaceConversion): unction that only returns true 
1212               when 1) destination color space is non-null and is different than current color space AND 
1213                    2) the code is running on CG platforms
1214               This function will only be called inside copy{Un, Pre}multipliedResult, to address the issue
1215               where color space is needed for filters that modifies raw pixels.
1216         * platform/graphics/filters/FilterEffect.h: Added function declarations
1217
1218 2020-06-10  Zalan Bujtas  <zalan@apple.com>
1219
1220         [Line clamp] Do not apply the special anchor handling when the anchor content is visible after clamping
1221         https://bugs.webkit.org/show_bug.cgi?id=213052
1222         <rdar://problem/59739131>
1223
1224         Reviewed by Simon Fraser.
1225
1226         Line clamping tries to preserve the anchor text if it is at the bottom of the paragraph to support cases like "... Read more", where the "read more" is an actual link.
1227         This patch makes sure that we only apply the special case handling if the anchor text get clamped.
1228
1229         Test: fast/flexbox/line-clamp-with-anchor-content-only.html
1230
1231         * rendering/RenderDeprecatedFlexibleBox.cpp:
1232         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1233
1234 2020-06-10  Jer Noble  <jer.noble@apple.com>
1235
1236         [Cocoa] CRASH: imported/w3c/web-platform-tests/remote-playback/watch-availability-initial-callback.html is flaky crashing
1237         https://bugs.webkit.org/show_bug.cgi?id=213044
1238         <rdar://problem/62317723>
1239
1240         Reviewed by Eric Carlson.
1241
1242         Add null-checks around previously non-null-checked derefs of WeakPtr<HTMLMediaElement>.
1243
1244         * Modules/remoteplayback/RemotePlayback.cpp:
1245         (WebCore::RemotePlayback::watchAvailability):
1246         (WebCore::RemotePlayback::shouldPlayToRemoteTargetChanged):
1247         (WebCore::RemotePlayback::playbackTargetPickerWasDismissed):
1248
1249 2020-06-10  Sihui Liu  <sihui_liu@apple.com>
1250
1251         Text manipulation does not observe inserted elements that are invisible
1252         https://bugs.webkit.org/show_bug.cgi?id=213057
1253         <rdar://problem/63768253>
1254
1255         Reviewed by Wenson Hsieh.
1256
1257         TextManipulationController gets notification when renderer of an element is created and starts observing the 
1258         element. It currently sets the observing range to be the visible start position and visible end position of the 
1259         element. When the invisible content becomes visible later, TextManipulationController does not get notification 
1260         and will miss the content. Therefore, TextManipulationController should use the actual start and end positions 
1261         of the element for range.
1262
1263         Test: TextManipulation.StartTextManipulationFindsInsertedClippedText
1264
1265         * editing/TextManipulationController.cpp:
1266         (WebCore::makeHashablePositionRange):
1267         (WebCore::TextManipulationController::scheduleObservationUpdate):
1268
1269 2020-06-10  Geoffrey Garen  <ggaren@apple.com>
1270
1271         Some style improvements to main thread code
1272         https://bugs.webkit.org/show_bug.cgi?id=213051
1273
1274         Reviewed by Darin Adler.
1275
1276         Updated for rename.
1277
1278         * WebCore.order:
1279         * platform/ios/wak/WebCoreThread.mm:
1280         (StartWebThread):
1281
1282 2020-06-10  Pinki Gyanchandani  <pgyanchandani@apple.com>
1283
1284         Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
1285         https://bugs.webkit.org/show_bug.cgi?id=212714
1286
1287         Reviewed by Geoffrey Garen.
1288
1289         Replaced call to WTFMove(widgetNewParentMap()) with std::exchange(widgetNewParentMap(), { }) in the 
1290         WidgetHierarchyUpdatesSuspensionScope::moveWidgets(), thereby making it explicit to set the source map empty.
1291
1292         Test would be added later.
1293
1294         * rendering/RenderWidget.cpp:
1295         (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
1296
1297 2020-06-10  Brent Fulgham  <bfulgham@apple.com>
1298
1299         Improve CSP compliance under PSON
1300         https://bugs.webkit.org/show_bug.cgi?id=212995
1301         <rdar://problem/62996186>
1302
1303         Reviewed by Chris Dumez.
1304
1305         Tests: http/tests/security/contentSecurityPolicy/1.1/form-action-src-self-blocked.html
1306
1307         The form submission logic was only considering CSP if the form
1308         action was a JavaScript URL. This is incorrect, as CSP might
1309         apply to any URL.
1310
1311         This is also covered by the existing form-action CSP tests.
1312
1313         * loader/FrameLoader.cpp:
1314         (WebCore::FrameLoader::submitForm): All URLs should be evaluted for
1315         compliance with CSP.
1316
1317 2020-06-10  Brian Burg  <bburg@apple.com>
1318
1319         WebDriver on non-iOS ports cannot perform ActionChain which has scrolling down to the element and click it
1320         https://bugs.webkit.org/show_bug.cgi?id=208232
1321         <rdar://problem/59859491>
1322
1323         Reviewed by Devin Rousso.
1324
1325         * platform/ScrollView.h:
1326         * platform/ScrollView.cpp:
1327         (WebCore::ScrollView::rootViewToContents const):
1328         Create a version of this function that works with FloatPoint.
1329
1330 2020-06-10  Commit Queue  <commit-queue@webkit.org>
1331
1332         Unreviewed, reverting r262718.
1333         https://bugs.webkit.org/show_bug.cgi?id=213047
1334
1335         Broke WPE Debug too
1336
1337         Reverted changeset:
1338
1339         "[WebXR] Pass an unsigned long to cancelAnimationCallback() as
1340         handle"
1341         https://bugs.webkit.org/show_bug.cgi?id=212529
1342         https://trac.webkit.org/changeset/262718
1343
1344 2020-06-10  Antoine Quint  <graouts@webkit.org>
1345
1346         Subframes should not autosize independently
1347         https://bugs.webkit.org/show_bug.cgi?id=212984
1348         <rdar://problem/64175493>
1349
1350         Reviewed by Simon Fraser.
1351
1352         * page/FrameView.cpp:
1353         (WebCore::FrameView::enableAutoSizeMode):
1354
1355 2020-06-10  Philippe Normand  <pnormand@igalia.com>
1356
1357         Unreviewed, WPE Debug build fix attempt after r262838.
1358
1359         Second attempt. :) Still broken because of r262718 though...
1360
1361         * platform/xr/openxr/PlatformXROpenXR.cpp:
1362
1363 2020-06-10  Philippe Normand  <pnormand@igalia.com>
1364
1365         Unreviewed, WPE Debug build fix attempt after r262838.
1366
1367         Still broken because of r262718 though...
1368         
1369         * platform/xr/openxr/PlatformXROpenXR.cpp:
1370
1371 2020-06-10  Youenn Fablet  <youenn@apple.com>
1372
1373         BaseAudioSharedUnit does not need to restart its audio unit at resume time.
1374         https://bugs.webkit.org/show_bug.cgi?id=213021
1375
1376         Reviewed by Eric Carlson.
1377
1378         Removing a case that should not happen, and was guarded by ASSERT.
1379         Keeping ASSERT to make sure we do not break this assumption.
1380
1381         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
1382         (WebCore::BaseAudioSharedUnit::resume):
1383         (WebCore::BaseAudioSharedUnit::suspend):
1384
1385 2020-06-10  Youenn Fablet  <youenn@apple.com>
1386
1387         REGRESSION(r262798): fast/mediastream/media-stream-track-interrupted.html is failing
1388         https://bugs.webkit.org/show_bug.cgi?id=213011
1389
1390         Reviewed by Eric Carlson.
1391
1392         Before the patch, a source that is muted and for which its observers get ended will not be ended.
1393         This is a potential issue as the source can get unmuted, in which case, the audio shared unit might be asked to restart.
1394         This is crashing in debug as we would not have the AudioSession correct category for audio capture.
1395
1396         Test: fast/mediastream/track-ended-while-muted.html
1397         Also covered by fast/mediastream/media-stream-track-interrupted.html no longer flakily crashing in debug.
1398
1399         * platform/mediastream/RealtimeMediaSource.cpp:
1400         (WebCore::RealtimeMediaSource::requestToEnd):
1401         End the source even if muted.
1402         * platform/mediastream/RealtimeMediaSource.h:
1403         * testing/Internals.cpp:
1404         (WebCore::Internals::isMediaStreamSourceEnded const):
1405         * testing/Internals.h:
1406         * testing/Internals.idl:
1407         Add necessary test infrastructure.
1408
1409 2020-06-05  Sergio Villar Senin  <svillar@igalia.com>
1410
1411         [WebXR] Refactor OpenXR platform code
1412         https://bugs.webkit.org/show_bug.cgi?id=212470
1413
1414         Reviewed by Youenn Fablet.
1415
1416         Refactored a bit the platform code because we want to extend the PlatformXR::Device for the OpenXR
1417         library. Also we're removing all the device id code because there is no need to expose it.
1418
1419         The idea from now on is to only define interfaces in PlatformXR.h and then add all the OpenXR specifics
1420         in the newly renamed PlatformXROpenXR.[ch] files. We're also renaming PlatformXR.cpp to
1421         PlatformXROpenXR.cpp to clearly state that it's the OpenXR implementation and to differentiate it from
1422         the implementation agnostic PlatformXR.h file.
1423
1424         No new tests as there is no change in functionality.
1425
1426         * Sources.txt: Added renamed files. Removed PlatformXR.cpp.
1427         * WebCore.xcodeproj/project.pbxproj: Ditto.
1428         * platform/xr/PlatformXR.cpp: Removed.
1429         * platform/xr/PlatformXR.h:
1430         (PlatformXR::Device::id const): Deleted.
1431         (PlatformXR::Device::operator== const): Deleted.
1432         * platform/xr/openxr/PlatformXROpenXR.cpp: Renamed from Source/WebCore/platform/xr/openxr/PlatformXR.cpp.
1433         (PlatformXR::Instance::Impl::~Impl): Call xrDestroyInstance() on m_instance.
1434         (PlatformXR::Instance::Impl::collectSupportedSessionModes): Do not pass XrSystemId as argument
1435         as it's stored in the OpenXRDevice object.
1436         (PlatformXR::Instance::enumerateImmersiveXRDevices): Create an OpenXRDevice instead of a Device.
1437         * platform/xr/openxr/PlatformXROpenXR.h: Added.
1438
1439 2020-06-09  Pinki Gyanchandani  <pgyanchandani@apple.com>
1440
1441         Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
1442         https://bugs.webkit.org/show_bug.cgi?id=212714
1443
1444         Reviewed by Geoffrey Garen.
1445
1446         Made change in the WidgetHierarchyUpdatesSuspensionScope::moveWidgets() to handle all widgets scheduled to move,
1447         including new widgets scheduled during moveWidgets().
1448
1449         Test would be added later.
1450
1451         * rendering/RenderWidget.cpp:
1452         (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
1453
1454 2020-06-09  Fujii Hironori  <Hironori.Fujii@sony.com>
1455
1456         Unreviewed, reverting r262791.
1457
1458         WinCairo WebKit1 is crashing.
1459
1460         Reverted changeset:
1461
1462         "[Curl] Implement functions to use ResourceLoadStatistics."
1463         https://bugs.webkit.org/show_bug.cgi?id=207692
1464         https://trac.webkit.org/changeset/262791
1465
1466 2020-06-09  Simon Fraser  <simon.fraser@apple.com>
1467
1468         Minor overflow layers cleanup
1469         https://bugs.webkit.org/show_bug.cgi?id=213002
1470
1471         Reviewed by Zalan Bujtas.
1472
1473         Now that we parent scrollbar and scroll corner layers into the overflowControlsContainer
1474         layer, we no need to parent these layers in RenderLayerCompositor::updateBackingAndHierarchy().
1475
1476         Also rename overflowControlsHostLayerBox to overflowControlsHostLayerRect to avoid
1477         ambiguity with RenderBox.
1478
1479         * rendering/RenderLayerBacking.cpp:
1480         (WebCore::RenderLayerBacking::updateDebugIndicators):
1481         (WebCore::overflowControlsHostLayerRect):
1482         (WebCore::RenderLayerBacking::updateGeometry):
1483         (WebCore::overflowControlsHostLayerBox): Deleted.
1484         * rendering/RenderLayerBacking.h:
1485         * rendering/RenderLayerCompositor.cpp:
1486         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1487
1488 2020-06-09  Mark Lam  <mark.lam@apple.com>
1489
1490         Disambiguate the OverridesGetPropertyNames structure flag
1491         https://bugs.webkit.org/show_bug.cgi?id=212909
1492         <rdar://problem/63823557>
1493
1494         Reviewed by Saam Barati.
1495
1496         1. JSDOMWindowProperties was not defining its Base.  As a result, its
1497            StructureFlags was inheriting from JSDOMObject's Base instead of from JSDOMObject
1498            as one would expect.  This turns out to be harmless because JSDOMObject did not
1499            define any StructureFlags.  Regardless, this is not fixed so that if JSDOMObject
1500            adds any StructureFlags, it will be inherited properly by JSDOMWindowProperties.
1501
1502         2. Updated CodeGeneratorJS.pm and rebased the binding test results.
1503
1504         * bindings/js/JSDOMWindowProperties.h:
1505         * bindings/scripts/CodeGeneratorJS.pm:
1506         (GenerateHeader):
1507         * bindings/scripts/test/JS/JSTestEventTarget.h:
1508         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
1509         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
1510         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
1511         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
1512         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
1513         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
1514         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
1515         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
1516         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
1517         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
1518         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
1519         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
1520         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
1521         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
1522         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
1523         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
1524         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
1525         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
1526         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
1527         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
1528         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
1529         * bindings/scripts/test/JS/JSTestObj.h:
1530         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1531         * bridge/runtime_array.h:
1532         * bridge/runtime_object.h:
1533
1534 2020-06-09  Dean Jackson  <dino@apple.com>
1535
1536         Stop using discriminatory names for WebGL and Plugin blocking
1537         https://bugs.webkit.org/show_bug.cgi?id=213000
1538
1539         Reviewed by Simon Fraser.
1540
1541         * SourcesCocoa.txt:
1542         * WebCore.xcodeproj/project.pbxproj:
1543         * platform/mac/BlocklistUpdater.h: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.h.
1544         (WebCore::BlocklistUpdater::pluginBlocklist):
1545         (WebCore::BlocklistUpdater::webGLBlocklist):
1546         * platform/mac/BlocklistUpdater.mm: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.mm.
1547         (WebCore::BlocklistUpdater::readBlocklistData):
1548         (WebCore::BlocklistUpdater::reloadIfNecessary):
1549         (WebCore::BlocklistUpdater::initializeQueue):
1550         * platform/mac/PluginBlocklist.h: Renamed from Source/WebCore/platform/mac/PluginBlacklist.h.
1551         * platform/mac/PluginBlocklist.mm: Renamed from Source/WebCore/platform/mac/PluginBlacklist.mm.
1552         (WebCore::PluginBlocklist::loadPolicyForPluginVersion):
1553         (WebCore::PluginBlocklist::isPluginUpdateAvailable):
1554         (WebCore::PluginBlocklist::create):
1555         (WebCore::PluginBlocklist::~PluginBlocklist):
1556         (WebCore::PluginBlocklist::splitOSVersion):
1557         (WebCore::PluginBlocklist::loadPolicyForPlugin const):
1558         (WebCore::PluginBlocklist::isUpdateAvailable const):
1559         (WebCore::PluginBlocklist::PluginBlocklist):
1560         * platform/mac/WebGLBlocklist.h: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.h.
1561         * platform/mac/WebGLBlocklist.mm: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.mm.
1562         (WebCore::buildInfoFromOSBuildString):
1563         (WebCore::WebGLBlocklist::shouldBlockWebGL):
1564         (WebCore::WebGLBlocklist::shouldSuggestBlockingWebGL):
1565         (WebCore::matchesBuildInfo):
1566         (WebCore::WebGLBlocklist::create):
1567         (WebCore::WebGLBlocklist::shouldBlock const):
1568         (WebCore::WebGLBlocklist::shouldSuggestBlocking const):
1569         (WebCore::WebGLBlocklist::WebGLBlocklist):
1570         (WebCore::WebGLBlocklist::~WebGLBlocklist):
1571
1572 2020-06-09  Simon Fraser  <simon.fraser@apple.com>
1573
1574         Logging and tree dumping crash fix
1575         https://bugs.webkit.org/show_bug.cgi?id=212988
1576
1577         Reviewed by Zalan Bujtas.
1578
1579         Add scrolling logging to RenderLayer::requestScrollPositionUpdate().
1580
1581         Null-check the scrollerImp in ScrollbarThemeMac::isLayoutDirectionRTL, because this is
1582         called from renderTreeAsText() which can be invoked from the debugger, and should not crash.
1583
1584         * platform/mac/ScrollbarThemeMac.mm:
1585         (WebCore::ScrollbarThemeMac::isLayoutDirectionRTL):
1586         * rendering/RenderLayer.cpp:
1587         (WebCore::RenderLayer::requestScrollPositionUpdate):
1588
1589 2020-06-09  Andy Estes  <aestes@apple.com>
1590
1591         Unreviewed change for post-commit feedback after r262682.
1592
1593         * DerivedSources.make: Replaced tabs with spaces.
1594
1595 2020-06-09  Frank Yang  <guowei_yang@apple.com>
1596
1597         WebKit Crashes when SVG Filter Logging is Turned On
1598         https://bugs.webkit.org/show_bug.cgi?id=212415
1599
1600         Reviewed by Darin Adler.
1601
1602         No new tests are required because this is just 
1603         fixing a simple pointer access inside logging code
1604
1605         * html/ImageData.cpp:
1606         (WebCore::operator<<): Overloaded << operator to print the 
1607                address of pixel data it stores
1608         * html/ImageData.h: Declare overloaded << operator
1609         * platform/graphics/filters/FilterEffect.cpp:
1610         (WebCore::FilterEffect::imageBufferResult): Modified logging code
1611                so that it does a null check by calling ValueOrNull on 
1612                m_premultipliedImageResult and m_unmultipliedImageResult
1613         (WebCore::FilterEffect::copyUnmultipliedResult):  Modified logging code
1614                so that it does a null check by calling ValueOrNull on
1615                m_premultipliedImageResult and m_unmultipliedImageResult
1616         (WebCore::FilterEffect::copyPremultipliedResult):  Modified logging code
1617                so that it does a null check by calling ValueOrNull on
1618                m_premultipliedImageResult and m_unmultipliedImageResult
1619
1620 2020-06-09  Dean Jackson  <dino@apple.com>
1621
1622         REGRESSION: [Safari Mojave for High Sierra] Accessing some of the featured pages on apple.com causes the webpage to crash
1623         https://bugs.webkit.org/show_bug.cgi?id=212940
1624         rdar://63839405
1625
1626         Reviewed by Tim Horton.
1627
1628         The code to use the singleton for a SwitchingGPUClient was assuming it
1629         has always been set, which was not the case when
1630         ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true.
1631
1632         * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: Check the state of the
1633         singleton before calling it.
1634         (WebCore::GraphicsContextGLOpenGLManager::updateHighPerformanceState):
1635         (WebCore::GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired):
1636         * platform/graphics/mac/SwitchingGPUClient.h: Return a pointer to the singleton which
1637         will allow the code to check for its existence.
1638         (WebCore::SwitchingGPUClient::singletonIfExists):
1639
1640 2020-06-09  Sam Weinig  <weinig@apple.com>
1641
1642         Extended Color: Streamline SimpleColor premulitply/unpremultiply code
1643         https://bugs.webkit.org/show_bug.cgi?id=212945
1644
1645         Reviewed by Darin Adler.
1646
1647         Simplify / streamline the premulitply/unpremultiply code by:
1648         - Removing the overloads that didn't take individual components, keeping 
1649           only the ones taking a SimpleColor.
1650         - Replacing the "ceiling" bool in makePremultipliedSimpleColor and converting
1651           it into two functions.
1652         - Simplifying the names from makePremultipliedSimpleColor/makeUnpremultipliedSimpleColor
1653           to premultiplyFlooring/premultiplyCeiling/unpremultiply.
1654         - Where component order is important, use valueAsARGB() explicitly to
1655           show what the resulting value's format will be.
1656
1657         * platform/graphics/Color.cpp:
1658         (WebCore::blend):
1659         Update to call premultiplyCeiling/unpremultiply.
1660
1661         * platform/graphics/ImageBackingStore.h:
1662         (WebCore::ImageBackingStore::blendPixel):
1663         (WebCore::ImageBackingStore::pixelValue const):
1664         Update to call premultiplyFlooring/unpremultiply and valueAsARGB().
1665
1666         * platform/graphics/SimpleColor.h:
1667         * platform/graphics/SimpleColor.cpp:
1668         (WebCore::premultiplyFlooring):
1669         (WebCore::premultiplyCeiling):
1670         (WebCore::unpremultiplyChannel):
1671         (WebCore::unpremultiply):
1672         (WebCore::premultipliedChannel): Deleted.
1673         (WebCore::unpremultipliedChannel): Deleted.
1674         (WebCore::makePremultipliedSimpleColor): Deleted.
1675         (WebCore::makeUnpremultipliedSimpleColor): Deleted.
1676         Simplify premulitply/unpremultiply interfaces. Use structured bindings to make
1677         the code a bit easier to follow as well.
1678         
1679         * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp:
1680         (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace):
1681         Update to call premultiplyFlooring/unpremultiply and valueAsARGB().
1682
1683         * platform/graphics/cairo/NativeImageCairo.cpp:
1684         (WebCore::nativeImageSinglePixelSolidColor):
1685         Update to call premultiplyFlooring/unpremultiply and valueAsARGB(). Also removes
1686         reinterpret cast to SimpleColor, instead following the model in ImageBufferCairoImageSurfaceBackend
1687         and casting to unsigned, and building the SimpleColor from that. This will allow 
1688         SimpleColor to change its underlying representation in the future without breaking things.
1689
1690 2020-06-09  Commit Queue  <commit-queue@webkit.org>
1691
1692         Unreviewed, reverting r261841.
1693         https://bugs.webkit.org/show_bug.cgi?id=212991
1694
1695         Caused spotify pages to scroll to the top
1696         (<http://webkit.org/b/212983|webkit.org/b/212983>)
1697
1698         Reverted changeset:
1699
1700         "[css-grid] Clear the override width for computing percent
1701         margins"
1702         https://bugs.webkit.org/show_bug.cgi?id=209461
1703         https://trac.webkit.org/changeset/261841
1704
1705 2020-06-09  Fujii Hironori  <Hironori.Fujii@sony.com>
1706
1707         [Win] ComplexTextControllerUniscribe: Retry ScriptShape with SCRIPT_UNDEFINED if it failed as USP_E_SCRIPT_NOT_IN_FONT
1708         https://bugs.webkit.org/show_bug.cgi?id=212947
1709
1710         Reviewed by Don Olmstead.
1711
1712         If the given font doesn't support the givin text, ScriptShape API
1713         fails as USP_E_SCRIPT_NOT_IN_FONT. In the case, the complex run
1714         was simply ignored and nothing was drawn for the text.
1715
1716         According to Uniscribe document, We should retry ScriptShape with
1717         SCRIPT_UNDEFINED to get missing glyphs.
1718         <https://docs.microsoft.com/en-us/windows/win32/intl/displaying-text-with-uniscribe>
1719
1720         * platform/graphics/win/ComplexTextControllerUniscribe.cpp:
1721         (WebCore::shapeByUniscribe):
1722
1723 2020-06-09  Fujii Hironori  <Hironori.Fujii@sony.com>
1724
1725         ComplexTextController: Use std::sort to calculate m_runIndices
1726         https://bugs.webkit.org/show_bug.cgi?id=212944
1727
1728         Reviewed by Myles C. Maxfield.
1729
1730         ComplexTextController was using O(n²) sort to lazily calculate
1731         m_runIndices. And, exact matching stringBegin and stringEnd can
1732         cause infinite loop (Bug 212670 and Bug 108877).
1733
1734         Use std::sort instead.
1735
1736         * platform/graphics/ComplexTextController.cpp:
1737         (WebCore::ComplexTextController::finishConstruction):
1738         (WebCore::ComplexTextController::indexOfCurrentRun):
1739
1740 2020-06-09  Youenn Fablet  <youenn@apple.com>
1741
1742         BaseAudioSharedUnit should unmute its clients in case of suspension even if not having any audio unit
1743         https://bugs.webkit.org/show_bug.cgi?id=212970
1744
1745         Reviewed by Eric Carlson.
1746
1747         CoreAudioCaptureSource(s), when muted, are now calling stopProducingData.
1748         This will, in turn, make the BaseAudioSharedUnit stop and no longer have any audio unit.
1749         In that case, when resume is called on the BaseAudioSharedUnit, it will exit early as the audio unit is null.
1750         This will prevent to unmute the CoreAudioCaptureSource(s).
1751
1752         Fix this by removing the audio unit check in BaseAudioSharedUnit::resume.
1753         Add infrastructure testing to be able to write a test.
1754
1755         Covered by added test.
1756
1757         * platform/mediastream/RealtimeMediaSource.h:
1758         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
1759         (WebCore::BaseAudioSharedUnit::resume):
1760         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1761         (WebCore::CoreAudioCaptureSource::setInterruptedForTesting):
1762         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1763         * testing/Internals.cpp:
1764         (WebCore::Internals::isMediaStreamSourceInterrupted const):
1765         * testing/Internals.h:
1766         * testing/Internals.idl:
1767
1768 2020-06-09  Myles C. Maxfield  <mmaxfield@apple.com>
1769
1770         lang=zh needs to defer to system preferences to know whether it should be simplified or traditional
1771         https://bugs.webkit.org/show_bug.cgi?id=212626
1772         <rdar://problem/60227623>
1773
1774         Reviewed by Darin Adler.
1775
1776         If the content says lang="zh" font-family: sans-serif, we have no signal for whether
1777         the content should be traditional or simplified. In this case, we should pick based
1778         on system preferences to make it more likely that we get the right answer.
1779
1780         This is actually what some Cocoa platform text functions were doing, but not all of them.
1781         We need to do it at our level in WebKit to make sure that all our calls to the platform
1782         have consistent behavior. Also, we can cache the result at our level, which is more
1783         performant than if the platform cached it at each platform entry point.
1784
1785         We already started consulting with system preferences to make this decision in r189038.
1786         This patch extends that and fixes it to throughout WebKit.
1787
1788         This doesn't expose any new fingerprinting data, because this information was already
1789         exposed (e.g. by drawing fallback fonts to the canvas and then reading back the pixels).
1790
1791         Tests: fast/text/locale-getComputedStyle.html
1792                fast/text/international/generic-font-family-language-traditional.html
1793
1794         * css/CSSComputedStyleDeclaration.cpp:
1795         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
1796         * css/CSSFontSelector.cpp:
1797         (WebCore::resolveGenericFamily):
1798         * css/CSSProperties.json:
1799         * layout/inlineformatting/InlineLineBreaker.cpp:
1800         (WebCore::Layout::LineBreaker::wordBreakBehavior const):
1801         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
1802         * platform/graphics/Font.cpp:
1803         (WebCore::Font::systemFallbackFontForCharacter const):
1804         * platform/graphics/FontCache.h:
1805         (WebCore::FontDescriptionKey::FontDescriptionKey):
1806         * platform/graphics/FontCascade.cpp:
1807         (WebCore::FontCascade::widthForSimpleText const):
1808         * platform/graphics/FontCascadeDescription.cpp:
1809         * platform/graphics/FontCascadeDescription.h:
1810         (WebCore::FontCascadeDescription::initialSpecifiedLocale):
1811         (WebCore::FontCascadeDescription::initialLocale): Deleted.
1812         * platform/graphics/FontDescription.cpp:
1813         (WebCore::computeSpecializedChineseLocale):
1814         (WebCore::cachedSpecializedChineseLocale):
1815         (WebCore::fontDescriptionLanguageChanged):
1816         (WebCore::specializedChineseLocale):
1817         (WebCore::FontDescription::setSpecifiedLocale):
1818         (WebCore::FontDescription::setLocale): Deleted.
1819         * platform/graphics/FontDescription.h:
1820         (WebCore::FontDescription::computedLocale const):
1821         (WebCore::FontDescription::specifiedLocale const):
1822         (WebCore::FontDescription::operator== const):
1823         (WebCore::FontDescription::encode const):
1824         (WebCore::FontDescription::decode):
1825         (WebCore::FontDescription::locale const): Deleted.
1826         * platform/graphics/WidthIterator.cpp:
1827         (WebCore::WidthIterator::applyFontTransforms):
1828         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1829         (WebCore::FontCache::systemFallbackForCharacters):
1830         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1831         (WebCore::FontDescription::platformResolveGenericFamily):
1832         (WebCore::computeSpecializedChineseLocale): Deleted.
1833         (WebCore::cachedSpecializedChineseLocale): Deleted.
1834         (WebCore::languageChanged): Deleted.
1835         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1836         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
1837         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1838         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1839         * rendering/RenderQuote.cpp:
1840         (WebCore::RenderQuote::computeText const):
1841         * rendering/RenderText.cpp:
1842         (WebCore::maxWordFragmentWidth):
1843         (WebCore::RenderText::computePreferredLogicalWidths):
1844         (WebCore::applyTextTransform):
1845         * rendering/RenderThemeCocoa.mm:
1846         (WebCore::RenderThemeCocoa::paintApplePayButton):
1847         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1848         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
1849         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
1850         * rendering/line/BreakingContext.h:
1851         (WebCore::BreakingContext::handleText):
1852         * rendering/style/RenderStyle.h:
1853         (WebCore::RenderStyle::computedLocale const):
1854         (WebCore::RenderStyle::specifiedLocale const):
1855         (WebCore::RenderStyle::locale const): Deleted.
1856         * style/StyleBuilderCustom.h:
1857         (WebCore::Style::BuilderCustom::applyValueWebkitLocale):
1858         * style/StyleResolveForDocument.cpp:
1859         (WebCore::Style::resolveForDocument):
1860
1861 2020-06-09  Zalan Bujtas  <zalan@apple.com>
1862
1863         [LFC][TFC] Add support for empty table
1864         https://bugs.webkit.org/show_bug.cgi?id=212971
1865
1866         Reviewed by Antti Koivisto.
1867
1868         No need to run formatting context layout when the table box has no descendant.
1869
1870         Test: fast/layoutformattingcontext/empty-table-box.html
1871
1872         * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
1873         (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox):
1874         (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
1875         (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
1876         * layout/tableformatting/TableFormattingContext.cpp:
1877         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
1878         * layout/tableformatting/TableGrid.h:
1879         (WebCore::Layout::TableGrid::isEmpty const):
1880
1881 2020-06-09  Youenn Fablet  <youenn@apple.com>
1882
1883         Forward declare MediaKeys/MediaKeySession in Internals.h
1884         https://bugs.webkit.org/show_bug.cgi?id=212965
1885
1886         Reviewed by Xabier Rodriguez-Calvar.
1887
1888         No change of behavior.
1889
1890         * testing/Internals.cpp:
1891         * testing/Internals.h:
1892
1893 2020-06-09  Youenn Fablet  <youenn@apple.com>
1894
1895         Fix two MediaStream tests
1896         https://bugs.webkit.org/show_bug.cgi?id=208926
1897         <rdar://problem/60329008>
1898
1899         Reviewed by Eric Carlson.
1900
1901         Previously, the mock capture sample rate was the one of the mock audio shared unit, which is the sample rate of the audio session by default.
1902         This sample rate may change according the bots.
1903         For that reason, explicitly set the mock shared unit sample rate to the default sample rate of the device, just before creating the source.
1904         MediaConstraints may still apply after this step.
1905
1906         Fix an issue where we would use the real core audio unit in CoreAudioCaptureSource constructor.
1907         We now pass the unit override if any in constructor.
1908
1909         Covered by unflaked tests.
1910
1911         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
1912         (WebCore::BaseAudioSharedUnit::BaseAudioSharedUnit):
1913         * platform/mediastream/mac/BaseAudioSharedUnit.h:
1914         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1915         (WebCore::initializeCoreAudioCaptureSource):
1916         (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
1917         (WebCore::CoreAudioCaptureSource::create):
1918         (WebCore::CoreAudioCaptureSource::createForTesting):
1919         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1920         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1921         * platform/mediastream/mac/MockAudioSharedUnit.mm:
1922         (WebCore::MockRealtimeAudioSource::create):
1923         (WebCore::MockAudioSharedUnit::MockAudioSharedUnit):
1924         Do not disable echo cancellation to mimick what the real unit is doing.
1925
1926 2020-06-09  Zalan Bujtas  <zalan@apple.com>
1927
1928         [LFC][Table][Floats] Multi-pass table layout needs clean floating state
1929         https://bugs.webkit.org/show_bug.cgi?id=212889
1930
1931         Reviewed by Antti Koivisto.
1932
1933         When laying out the cell content multiple times to accommodate flex table layout,
1934         the float state needs be cleared to avoid having redundant float content.
1935
1936         Test: fast/layoutformattingcontext/float-inside-table-cell-simple.html
1937
1938         * layout/floats/FloatingState.cpp:
1939         (WebCore::Layout::FloatingState::append):
1940         * layout/floats/FloatingState.h:
1941         (WebCore::Layout::FloatingState::FloatItem::floatBox const):
1942         * layout/layouttree/LayoutTreeBuilder.cpp:
1943         (WebCore::Layout::TreeBuilder::createLayoutBox):
1944         * layout/tableformatting/TableFormattingContext.cpp:
1945         (WebCore::Layout::TableFormattingContext::layoutCell):
1946
1947 2020-06-09  Takashi Komori  <Takashi.Komori@sony.com>
1948
1949         [Curl] Implement functions to use ResourceLoadStatistics.
1950         https://bugs.webkit.org/show_bug.cgi?id=207692
1951
1952         Reviewed by Don Olmstead.
1953
1954         Implement functions which are required to implement ResourceLoadStatistics for Curl port.
1955
1956         Tests: http/tests/resourceLoadStatistics/
1957
1958         * CMakeLists.txt:
1959         * platform/network/curl/CookieJarDB.cpp:
1960         (WebCore::CookieJarDB::openDatabase):
1961         (WebCore::CookieJarDB::setCookie):
1962         (WebCore::CookieJarDB::allDomains):
1963         (WebCore::CookieJarDB::deleteCookiesForHostname):
1964         * platform/network/curl/CookieJarDB.h:
1965         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1966         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1967         (WebCore::NetworkStorageSession::setCookies):
1968         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1969         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1970
1971 2020-06-09  Sam Weinig  <weinig@apple.com>
1972
1973         Extended Color: Switch ColorMac.mm's nsColor() function over to using TinyLRUCache
1974         https://bugs.webkit.org/show_bug.cgi?id=212918
1975
1976         Reviewed by Darin Adler.
1977
1978         * platform/graphics/Color.h:
1979         (WebCore::Color::isExtended const):
1980         Make asSimple() public, so nsColor() can use it. This also allows us to unfriend cachedCGColor().
1981
1982         * platform/graphics/mac/ColorMac.mm:
1983         (WTF::RetainPtr<NSColor>>::createValueForKey):
1984         (WebCore::nsColor):
1985         Mimic the structure of cachedCGColor() by switching over simpleColor values for common
1986         colors and using a 32 value TinyLRUCache for the rest.
1987
1988 2020-06-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1989
1990         [EME] CDMProxyInstance should not keep CDMInstanceSessions hard referenced
1991         https://bugs.webkit.org/show_bug.cgi?id=212689
1992
1993         Reviewed by Youenn Fablet.
1994
1995         Sessions are now tracked as WeakPtr inside the CDMInstanceProxy
1996         instead of RefPtr because this creates referencing issues as the
1997         internal objects should be released when the backing JS object is
1998         garbage collected.
1999
2000         Test: media/encrypted-media/clearKey/clearKey-session-life-cycle.html
2001
2002         * Modules/encryptedmedia/MediaKeySession.h:
2003         * Modules/encryptedmedia/MediaKeySession.idl:
2004         * Modules/encryptedmedia/MediaKeys.h:
2005         * Modules/encryptedmedia/MediaKeys.idl:
2006         * platform/encryptedmedia/CDMProxy.cpp:
2007         (WebCore::CDMInstanceProxy::trackSession):
2008         * platform/encryptedmedia/CDMProxy.h:
2009         (WebCore::CDMInstanceProxy::trackSession):
2010         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2011         (WebCore::CDMInstanceClearKey::createSession):
2012         * platform/encryptedmedia/clearkey/CDMClearKey.h:
2013         * testing/Internals.cpp:
2014         (WebCore::Internals::mediaKeysInternalInstanceObjectRefCount const):
2015         (WebCore::Internals::mediaKeySessionInternalInstanceSessionObjectRefCount const):
2016         * testing/Internals.h:
2017         * testing/Internals.idl:
2018
2019 2020-06-09  Sihui Liu  <sihui_liu@apple.com>
2020
2021         TextManipulationController range of paragraph may be wrong after r262601
2022         https://bugs.webkit.org/show_bug.cgi?id=212874
2023
2024         Reviewed by Wenson Hsieh.
2025
2026         Start and end position of item are not properly set in r262601.
2027
2028         Test: TextManipulation.CompleteTextManipulationSuccedsWhenContentOutOfParagraphIsAdded
2029
2030         * editing/TextManipulationController.cpp:
2031         (WebCore::TextManipulationController::addItemIfPossible):
2032
2033 2020-06-08  Sihui Liu  <sihui_liu@apple.com>
2034
2035         TextManipulation should only convert text from Node's text content to tokens
2036         https://bugs.webkit.org/show_bug.cgi?id=212928
2037
2038         Reviewed by Wenson Hsieh.
2039
2040         TextIterator may emit text like line breaks between nodes. This kind of text is generated based on the range of 
2041         TextIterator and style of node. We need this text for splitting tokens or splitting paragraphs, but we should 
2042         not convert it to normal tokens. This is because tokens should be created from content of node and text 
2043         manipulation fails if content does not match. The change of this kind of text does not indicate change in 
2044         content and we may still be able to finish text manipulation.
2045
2046         Test: TextManipulation.CompleteTextManipulationReplaceTwoSimpleParagraphs
2047
2048         * editing/TextManipulationController.cpp:
2049         (WebCore::isInPrivateUseArea):
2050         (WebCore::isTokenDelimiter):
2051         (WebCore::ParagraphContentIterator::currentContent):
2052         (WebCore::ParagraphContentIterator::appendToText):
2053         (WebCore::ParagraphContentIterator::advanceIteratorNodeAndUpdateText):
2054         (WebCore::TextManipulationController::createUnit):
2055         (WebCore::TextManipulationController::parse):
2056         (WebCore::TextManipulationController::observeParagraphs):
2057         (WebCore::TextManipulationController::replace):
2058         * editing/TextManipulationController.h:
2059
2060 2020-06-08  Rob Buis  <rbuis@igalia.com>
2061
2062         XMLHTTPRequest.send should not send Content-Type headers when Blob has no type
2063         https://bugs.webkit.org/show_bug.cgi?id=211999
2064
2065         Reviewed by Alex Christensen.
2066
2067         XMLHTTPRequest.send should not send Content-Type headers when Blob has no type [1, 2].
2068         This behavior overrides the behavior of the File API spec [3].
2069
2070         Behavior matches Firefox and Chrome.
2071
2072         Test: imported/w3c/web-platform-tests/xhr/send-blob-with-no-mime-type.html
2073
2074         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
2075         [2] https://fetch.spec.whatwg.org/#concept-bodyinit-extract
2076         [3] http://dev.w3.org/2006/webapi/FileAPI/#dfn-type
2077
2078         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2079         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
2080         * xml/XMLHttpRequest.cpp:
2081         (WebCore::XMLHttpRequest::send):
2082
2083 2020-06-08  Simon Fraser  <simon.fraser@apple.com>
2084
2085         Horizontally scrolling elements are broken when revealed by toggling visibility
2086         https://bugs.webkit.org/show_bug.cgi?id=212439
2087         <rdar://problem/63739559>
2088
2089         Reviewed by Zalan Bujtas.
2090
2091         When revealing an overflow:scroll by toggling the visibility property, make sure that
2092         we use composited scrolling.
2093
2094         computeScrollDimensions() is only updated on layout, so we need to recompute m_hasCompositedScrollableOverflow
2095         on style change as well.
2096
2097         Test: compositing/scrolling/async-overflow-scrolling/toggle-visibility-on-scroller.html
2098
2099         * rendering/RenderLayer.cpp:
2100         (WebCore::RenderLayer::computeScrollDimensions):
2101         (WebCore::RenderLayer::computeHasCompositedScrollableOverflow):
2102         (WebCore::RenderLayer::calculateClipRects const):
2103         * rendering/RenderLayer.h:
2104
2105 2020-06-08  Sam Weinig  <weinig@apple.com>
2106
2107         Extended Color: Rename Color::lighten() and Color::darken() to Color::lightened() and Color::darkened()
2108         https://bugs.webkit.org/show_bug.cgi?id=212917
2109
2110         Reviewed by Darin Adler.
2111
2112         Addresses feedback from Darin.
2113
2114         * platform/graphics/Color.cpp:
2115         (WebCore::Color::lightened const):
2116         (WebCore::Color::darkened const):
2117         (WebCore::Color::lighten const): Deleted.
2118         (WebCore::Color::darken const): Deleted.
2119         * platform/graphics/Color.h:
2120         * rendering/RenderObject.cpp:
2121         (WebCore::RenderObject::calculateBorderStyleColor):
2122         * rendering/RenderTheme.cpp:
2123         (WebCore::RenderTheme::disabledTextColor const):
2124         * rendering/TextPaintStyle.cpp:
2125         (WebCore::adjustColorForVisibilityOnBackground):
2126
2127 2020-06-08  Devin Rousso  <drousso@apple.com>
2128
2129         Remove unnecessary variable in `WindowProxy::createJSWindowProxy`
2130         https://bugs.webkit.org/show_bug.cgi?id=212929
2131
2132         Reviewed by Darin Adler.
2133
2134         * bindings/js/WindowProxy.cpp:
2135         (WebCore::WindowProxy::createJSWindowProxy):
2136
2137 2020-06-08  Pinki Gyanchandani  <pgyanchandani@apple.com>
2138
2139         Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
2140         https://bugs.webkit.org/show_bug.cgi?id=212714
2141
2142         Reviewed by Geoffrey Garen.
2143
2144         Widget removal in the middle of building a Render Tree causes side effects, leading to Release Assert. Moved the scope for suspension of widgets
2145         update to RenderTreeBuilder instead of having it in RenderTreeUpdater.
2146
2147         Test would be added later.
2148
2149         * rendering/updating/RenderTreeBuilder.h:
2150         * rendering/updating/RenderTreeUpdater.cpp:
2151         (WebCore::RenderTreeUpdater::tearDownRenderers):
2152
2153 2020-06-08  Yusuke Suzuki  <ysuzuki@apple.com>
2154
2155         Use usual promise in readableStreamTee
2156         https://bugs.webkit.org/show_bug.cgi?id=212715
2157
2158         Reviewed by Mark Lam.
2159
2160         The spec[1] is organized to be OK to use usual promises here. This patch uses usual promises instead of internal ones.
2161
2162         [1]: https://streams.spec.whatwg.org/#readable-stream-tee
2163
2164         * Modules/streams/ReadableStreamInternals.js:
2165         (readableStreamTee):
2166
2167 2020-06-08  David Kilzer  <ddkilzer@apple.com>
2168
2169         [IPC] Adopt enum class for DragOperation
2170         <https://webkit.org/b/212870>
2171         <rdar://problem/64069940>
2172
2173         Reviewed by Darin Adler.
2174
2175         * dom/DataTransfer.cpp:
2176         (WebCore::dragOpFromIEOp):
2177         (WebCore::IEOpFromDragOp):
2178         (WebCore::DataTransfer::sourceOperationMask const):
2179         (WebCore::DataTransfer::destinationOperationMask const):
2180         (WebCore::DataTransfer::setSourceOperationMask):
2181         (WebCore::DataTransfer::setDestinationOperationMask):
2182         (WebCore::DataTransfer::setEffectAllowed):
2183         * page/DragActions.h:
2184         (WebCore::DragOperation):
2185         - Convert to enum class.
2186         (WebCore::anyDragOperation):
2187         * page/DragController.cpp:
2188         (WebCore::DragController::platformGenericDragOperation):
2189         (WebCore::DragController::dragEnteredOrUpdated):
2190         (WebCore::DragController::tryDocumentDrag):
2191         (WebCore::defaultOperationForDrag):
2192         (WebCore::DragController::startDrag):
2193         * page/EventHandler.cpp:
2194         (WebCore::convertDropZoneOperationToDragOperation):
2195         (WebCore::convertDragOperationToDropZoneOperation):
2196         * page/gtk/DragControllerGtk.cpp:
2197         (WebCore::DragController::dragOperation):
2198         * page/mac/DragControllerMac.mm:
2199         (WebCore::DragController::dragOperation):
2200         (WebCore::DragController::platformGenericDragOperation):
2201         * page/win/DragControllerWin.cpp:
2202         (WebCore::DragController::dragOperation):
2203         * platform/gtk/GtkUtilities.cpp:
2204         (WebCore::gdkDragActionToDragOperation):
2205         (WebCore::dragOperationToGdkDragActions):
2206         (WebCore::dragOperationToSingleGdkDragAction):
2207
2208 2020-06-08  Sam Weinig  <weinig@apple.com>
2209
2210         Extended Color: Unify rounding / clamping conversions between 0-1 float components and 0-255 byte components
2211         https://bugs.webkit.org/show_bug.cgi?id=212871
2212
2213         Reviewed by Simon Fraser.
2214         
2215         Unify all conversions of 0.0f - 1.0f float based color components to 0-255 int based color components
2216         to use the new convertToComponentByte() function which scales, rounds (using lroundf) and clamps the
2217         value. For consistency, a convertToComponentFloat() function, which just scales down an int based value
2218         to a float based value, is also added.
2219         
2220         - Removes *UsingAlternativeRounding variants (actually, we now only have this variant) for color functions
2221           which allowed callers to pick from truncation vs. rounding when overriding alpha.
2222         - Replaces all uses of scaleRoundAndClampColorChannel() with convertToComponentByte() (really just a rename).
2223         - Replaces uses of nextafter(256, 0) based conversions with convertToComponentByte().
2224         
2225         Also:
2226         - Moves roundAndClampColorChannel() functions to SVGAnimationAdditiveValueFunctionImpl.h, which was
2227           the only places they were used.
2228         - Removes areEssentiallyEqual() overload taking ColorComponents<float>. It was ununsed.
2229         - Removes makeSimpleColorFromHSLA(...) and just inlines makeSimpleColor(hslToSRGB(...)) which now
2230           does the same thing.
2231
2232         * css/parser/CSSPropertyParserHelpers.cpp:
2233         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
2234         Use convertPrescaledToComponentByte() to round and clamp the components.
2235
2236         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
2237         Use uint8_t more consistently now that helpers ensure that is the return type
2238         of conversion functions.
2239
2240         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
2241         Switch to using makeSimpleColor(hslToSRGB(...)) directly.
2242
2243         * editing/cocoa/DataDetection.mm:
2244         (WebCore::DataDetection::detectContentInRange):
2245         Switch to using makeSimpleColor(hslToSRGB(...)) directly.
2246
2247         * html/HTMLElement.cpp:
2248         (WebCore::parseLegacyColorValue):
2249         Use uint8_t since that is what toASCIIHexValue() returns.
2250
2251         * html/canvas/CanvasRenderingContext2DBase.cpp:
2252         (WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
2253         (WebCore::CanvasRenderingContext2DBase::setFillStyle):
2254         (WebCore::CanvasRenderingContext2DBase::setShadow):
2255         * html/canvas/CanvasStyle.cpp:
2256         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
2257         Replaces uses of colorWithAlphaUsingAlternativeRounding() with colorWithAlpha().
2258
2259         * inspector/agents/InspectorDOMAgent.cpp:
2260         (WebCore::parseColor):
2261         Use convertToComponentByte() rather than a simple truncating cast.
2262
2263         * platform/graphics/Color.cpp:
2264         (WebCore::Color::light const):
2265         (WebCore::Color::dark const):
2266         Use makeSimpleColorFromFloats() rather than nextafterf(256.0f, 0.0f) conversion.
2267
2268         (WebCore::Color::colorWithAlpha const):
2269         (WebCore::Color::invertedColorWithAlpha const):
2270         Use convertToComponentByte() for alpha conversion.
2271         
2272         (WebCore::Color::toSRGBASimpleColorLossy const):
2273         Call asExtended().toSRGBAComponentsLossy() directly to avoid unnecessary branch.
2274         
2275         (WebCore::Color::colorWithAlphaMultipliedBy const): Deleted.
2276         (WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const): Deleted.
2277         (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): Deleted.
2278         Remove UsingAlternativeRounding variants.
2279
2280         * platform/graphics/Color.h:
2281         (WebCore::Color::alpha const):
2282         Use convertToComponentByte() for alpha conversion.
2283
2284         (WebCore::Color::invertedColorWithAlpha const):
2285         Add an overload taking an Optional<float> for consistency.
2286
2287         (WebCore::Color::colorWithAlphaMultipliedBy const):
2288         (WebCore::Color::colorWithAlpha const):
2289         Simplify by inlining all variants except the main colorWithAlpha().
2290
2291         * platform/graphics/ColorUtilities.cpp:
2292         (WebCore::areEssentiallyEqual): Deleted.
2293         Remove unused function.
2294
2295         * platform/graphics/ColorUtilities.h:
2296         (WebCore::convertPrescaledToComponentByte):
2297         Added. Useful for callers who already have prescaled values but need rounding/clamping.
2298
2299         (WebCore::convertToComponentByte):
2300         Added. Bottleneck for float to byte based color component conversions.
2301         (WebCore::convertToComponentFloat):
2302         Added. Bottleneck for byte to float based color component conversions.
2303
2304         * platform/graphics/SimpleColor.cpp:
2305         (WebCore::makeSimpleColorFromCMYKA):
2306         Use makeSimpleColorFromFloats() rather than nextafterf(256.0f, 0.0f) conversion. Eventually,
2307         when we probably want this to go away and store CMYKA colors as ExtendedColors with their own
2308         color space. 
2309
2310         (WebCore::makeSimpleColorFromFloats): 
2311         Moved to header.
2312
2313         * platform/graphics/SimpleColor.h:
2314         (WebCore::SimpleColor::alphaComponentAsFloat const):
2315         Use convertToComponentFloat().
2316
2317         (WebCore::SimpleColor::asSRGBFloatComponents const):
2318         Use convertToComponentFloat().
2319
2320         (WebCore::makeSimpleColor):
2321         Avoid unncessary clamping of the alpha component by calling constructor directly.
2322
2323         (WebCore::makeSimpleColorFromFloats):
2324         Inlined. Calls convertToComponentByte now rather than the older (identical) scaleRoundAndClampColorChannel().
2325
2326         * platform/graphics/cairo/CairoOperations.cpp:
2327         (WebCore::Cairo::prepareCairoContextSource):
2328         Replaces use of colorWithAlphaMultipliedByUsingAlternativeRounding with colorWithAlphaMultipliedBy().
2329
2330         * platform/graphics/cg/ColorCG.cpp:
2331         (WebCore::makeSimpleColorFromCGColor):
2332         Use makeSimpleColorFromFloats() rather than nextafter(256.0, 0.0) conversion.
2333
2334         * platform/graphics/filters/FEFlood.cpp:
2335         (WebCore::FEFlood::platformApplySoftware):
2336         Replaces use of colorWithAlphaMultipliedByUsingAlternativeRounding with colorWithAlphaMultipliedBy().
2337
2338         * platform/graphics/mac/ColorMac.mm:
2339         (WebCore::makeSimpleColorFromNSColor):
2340         Use makeSimpleColorFromFloats() rather than nextafter(256.0, 0.0) conversion.
2341
2342         * platform/ios/ColorIOS.mm:
2343         (WebCore::colorFromUIColor):
2344         Use makeSimpleColorFromFloats() rather than nextafter(256.0, 0.0) conversion.
2345
2346         * svg/SVGStopElement.cpp:
2347         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
2348         Replaces use of colorWithAlphaMultipliedByUsingAlternativeRounding with colorWithAlphaMultipliedBy().
2349
2350         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2351         (WebCore::SVGAnimationColorFunction::roundAndClampColorChannel):
2352         Moved from ColorUtilities.h as this was the only use.
2353
2354 2020-06-08  Sam Weinig  <weinig@apple.com>
2355
2356         Extended Color: Replace uses of differenceSquared() with luminance based computations
2357         https://bugs.webkit.org/show_bug.cgi?id=212872
2358
2359         Reviewed by Darin Adler.
2360
2361         Replace all uses of differenceSquared() with luminance based comparisons. This is
2362         possible because all of the uses of differenceSquared() were about identifying a
2363         distance from black or white to determine relative brightness. It is more accurate
2364         to do this in terms of luminance, and has the added benefit of being something that
2365         is expressible in all colorspaces (since luminance is defined as the Y-component 
2366         of the XYZ colorspace which all colorspaces are convertable to). 
2367
2368         * platform/graphics/Color.cpp:
2369         (WebCore::Color::lighten const):
2370         Renamed Color::light() to Color::lighten(), which makes more sense. The algorithm
2371         used should be updated at some point to also use luminance, but is unchanged for
2372         now.
2373
2374         (WebCore::Color::darken const):
2375         Renamed Color::dark() to Color::darken(), which makes more sense. The algorithm
2376         used should be updated at some point to also use luminance, but is unchanged for
2377         now.
2378
2379         (WebCore::Color::luminance const):
2380         Added. Converts to sRGB for now, but can be updated to work with other color spaces
2381         when needed.
2382
2383         * platform/graphics/Color.h:
2384         Removed differenceSquared.
2385
2386         * platform/graphics/ColorUtilities.cpp:
2387         (WebCore::luminance):
2388         Updated to use the standard conversion to linear-sRGB. While there are certainly
2389         some places that specify a 0.03928 cutoff, the much more accepted value (and value
2390         specified by the IEC) is 0.04045, which we use for all other gamma correction.
2391         (See https://entropymine.com/imageworsener/srgbformula/ or https://en.wikipedia.org/wiki/SRGB#The_forward_transformation_(CIE_XYZ_to_sRGB)
2392         for more information on this).
2393
2394         Also added a FIXME about how in the future we can avoid hardcoding the specific values
2395         multiple times by extracting them from the linear-sRGB to XYZ matrix.
2396
2397         * rendering/RenderObject.cpp:
2398         (WebCore::RenderObject::calculateBorderStyleColor):
2399         Use luminance, rather than distance as a better comparison for whether the color
2400         is too dark or too light for modification.
2401
2402         * rendering/RenderTheme.cpp:
2403         (WebCore::RenderTheme::disabledTextColor const):
2404         Use luminance, rather than distance as a better comparison for whether the color
2405         is too dark or too light for modification. Also us the contrastRatio utility
2406         function to determine illegibility issues due to contrast, picking a new minimum
2407         that roughly matches the old one based fast/forms/input-disabled-color.html
2408
2409         * rendering/TextPaintStyle.cpp:
2410         (WebCore::adjustColorForVisibilityOnBackground):
2411         Use luminance, rather than distance as a better comparison for whether the color
2412         is too dark or too light for modification.
2413
2414 2020-06-08  Youenn Fablet  <youenn@apple.com>
2415
2416         Missing WebRTC Metrics in iOS Safari
2417         https://bugs.webkit.org/show_bug.cgi?id=212668
2418         <rdar://problem/63902458>
2419
2420         Reviewed by Eric Carlson.
2421
2422         Expose more transports related stats.
2423         Covered by updated test.
2424
2425         * Modules/mediastream/RTCStatsReport.h:
2426         * Modules/mediastream/RTCStatsReport.idl:
2427         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
2428         (WebCore::fillRTCTransportStats):
2429
2430 2020-06-08  Youenn Fablet  <youenn@apple.com>
2431
2432         Add missed WebRTC media-source and remote-inbound-rtp stats
2433         https://bugs.webkit.org/show_bug.cgi?id=206645
2434         <rdar://problem/58833958>
2435
2436         Reviewed by Eric Carlson.
2437
2438         Update stats according latest spec and webrtc backend.
2439         We still expose obsolete trackId for consistency with existing WPT tests.
2440         Covered by existing and updated tests.
2441
2442         * Modules/mediastream/RTCStatsReport.h:
2443         (WebCore::RTCStatsReport::InboundRtpStreamStats::InboundRtpStreamStats):
2444         (WebCore::RTCStatsReport::RemoteInboundRtpStreamStats::RemoteInboundRtpStreamStats):
2445         (WebCore::RTCStatsReport::OutboundRtpStreamStats::OutboundRtpStreamStats):
2446         (WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats): Deleted.
2447         (WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats): Deleted.
2448         * Modules/mediastream/RTCStatsReport.idl:
2449         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
2450         (WebCore::fillRtpStreamStats):
2451         (WebCore::fillReceivedRtpStreamStats):
2452         (WebCore::fillInboundRtpStreamStats):
2453         (WebCore::fillRemoteInboundRtpStreamStats):
2454         (WebCore::fillSentRtpStreamStats):
2455         (WebCore::fillOutboundRtpStreamStats):
2456         (WebCore::initializeRTCStatsReportBackingMap):
2457         (WebCore::fillRTCRTPStreamStats): Deleted.
2458         (WebCore::fillInboundRTPStreamStats): Deleted.
2459         (WebCore::fillOutboundRTPStreamStats): Deleted.
2460
2461 2020-06-08  Jonathan Bedard  <jbedard@apple.com>
2462
2463         WebCore: Add tvOS and watchOS SPI headers
2464         https://bugs.webkit.org/show_bug.cgi?id=212853
2465         <rdar://problem/64048485>
2466
2467         Reviewed by Andy Estes.
2468
2469         No new tests, no behavior changed.
2470
2471         * platform/ios/WebCoreMotionManager.h: Forward-declare CMMotionManager.
2472         * platform/ios/WebCoreMotionManager.mm: Include CoreMotionSPI.h.
2473
2474 2020-06-08  Zalan Bujtas  <zalan@apple.com>
2475
2476         [LFC][IFC] Add support for min/max-width/height
2477         https://bugs.webkit.org/show_bug.cgi?id=212904
2478
2479         Reviewed by Antti Koivisto.
2480
2481         Test: fast/layoutformattingcontext/inline-max-width-height-simple.html
2482
2483         * layout/FormattingContextGeometry.cpp:
2484         (WebCore::Layout::FormattingContext::Geometry::computedWidthValue): Adjust assert to check inline, non-replaced boxes only (inline-block is an
2485         inline level element but not an inline element) 
2486         * layout/inlineformatting/InlineFormattingContext.cpp:
2487         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
2488         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
2489
2490 2020-06-05  Sergio Villar Senin  <svillar@igalia.com>
2491
2492         [WebXR] Add missing interfaces from the AR module
2493         https://bugs.webkit.org/show_bug.cgi?id=212826
2494
2495         Reviewed by Youenn Fablet.
2496
2497         Added the XRInteractionMode partial interface from the WebXR AR module spec. This spec
2498         https://immersive-web.github.io/webxr-ar-module/ expands the WebXR Device API with
2499         functionality available in AR hardware.
2500
2501         Some WebXR wpt tests are now passing.
2502
2503         * CMakeLists.txt: Added new files.
2504         * DerivedSources.make: Ditto.
2505         * Modules/webxr/WebXRSession.cpp:
2506         (WebCore::WebXRSession::interactionMode const): Added.
2507         * Modules/webxr/WebXRSession.h: Added interactionMode attribute and getter;
2508         * Modules/webxr/WebXRSession.idl: Added interactionMode attribute;
2509         * Modules/webxr/XRInteractionMode.h: Added.
2510         * Modules/webxr/XRInteractionMode.idl: Added.
2511         * Sources.txt: Added new files.
2512         * WebCore.xcodeproj/project.pbxproj: Ditto.
2513
2514 2020-05-29  Sergio Villar Senin  <svillar@igalia.com>
2515
2516         [WebXR] Pass an unsigned long to cancelAnimationCallback() as handle
2517         https://bugs.webkit.org/show_bug.cgi?id=212529
2518
2519         Reviewed by Youenn Fablet.
2520
2521         The type of the handle returned by XRSession::requestAnimationFrame() was recently changed
2522         to unsigned long from long as there was no point in using signed integers for that. However
2523         we forgot to update the cancelAnimationFrame() in the specs as well as it receives the handle
2524         returned by requestAnimationFrame().
2525
2526         We landed https://github.com/immersive-web/webxr/pull/1069 in the WebXR specs so we can now
2527         safely also replace signed by unsigned integers in our implementation.
2528
2529         No new tests as there is no change in functionality.
2530
2531         * Modules/webxr/WebXRSession.cpp:
2532         (WebCore::WebXRSession::cancelAnimationFrame): Use unsigned ids.
2533         * Modules/webxr/WebXRSession.h: Ditto.
2534         * Modules/webxr/WebXRSession.idl: Ditto.
2535
2536 2020-06-01  Sergio Villar Senin  <svillar@igalia.com>
2537
2538         [css-flexbox] align-content should apply even when there's just a single line
2539         https://bugs.webkit.org/show_bug.cgi?id=209871
2540
2541         Reviewed by Manuel Rego Casasnovas.
2542
2543         The 'align-content' property should have no effect on single line flex containers according to
2544         the specs https://drafts.csswg.org/css-flexbox/#propdef-align-content. The current code was not
2545         differentiating between single-line containers and multi-line containers with just 1 line.
2546
2547         Also in order not to introduce regressions and properly support replaced elements as flex items
2548         we replaced the computation of child's width for 'flex-direction:column' by a direct call to
2549         computeLogicalWidthForFragment() which already properly handles all the cases. It used to be
2550         just the shrink-to-fit computation but that was not enough for replaced elements for example or
2551         elements with min/max-size restrictions.
2552
2553         Several align-content-wrap-* subtests are working now. Updated expectations.
2554
2555         * rendering/RenderFlexibleBox.cpp:
2556         (WebCore::initialAlignContentOffset): Removed check for #lines <= 1, as it is incorrect because it
2557         is true for multi-line containers with just 1 line.
2558         (WebCore::RenderFlexibleBox::alignFlexLines): Use isMultiline() instead of "#lines == 1".
2559         (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): Replace shrink-to-fit computation
2560         by a call computeLogicalWidthForFragment().
2561         (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Use the whole crossAxisExtent
2562         for single line containers. Moved from alignFlexLines() as it fits much better here.
2563
2564
2565 2020-06-08  Andy Estes  <aestes@apple.com>
2566
2567         [Apple Pay] Remove ENABLE_APPLE_PAY_SETUP, ENABLE_APPLE_PAY_SESSION_V7, and HAVE_PASSKIT_PAYMENT_SETUP
2568         https://bugs.webkit.org/show_bug.cgi?id=212883
2569         <rdar://problem/64090763>
2570
2571         Reviewed by Youenn Fablet.
2572
2573         These macros evaluate to true whenever ENABLE(APPLE_PAY) is true on platforms supported by
2574         trunk WebKit, so we can either remove them or replace them with ENABLE(APPLE_PAY).
2575
2576         * Modules/applepay/ApplePaySetup.cpp:
2577         * Modules/applepay/ApplePaySetup.idl:
2578         * Modules/applepay/ApplePaySetupConfiguration.h:
2579         * Modules/applepay/ApplePaySetupConfiguration.idl:
2580         * Modules/applepay/ApplePaySetupFeature.idl:
2581         * Modules/applepay/ApplePaySetupFeature.mm:
2582         * Modules/applepay/ApplePaySetupFeatureState.h:
2583         * Modules/applepay/ApplePaySetupFeatureState.idl:
2584         * Modules/applepay/ApplePaySetupFeatureType.idl:
2585         * Modules/applepay/ApplePaySetupFeatureTypeWebCore.h:
2586         * Modules/applepay/ApplePaySetupFeatureWebCore.h:
2587         * Modules/applepay/ApplePaySetupWebCore.h:
2588         * Modules/applepay/PaymentCoordinator.cpp:
2589         * Modules/applepay/PaymentCoordinator.h:
2590         * Modules/applepay/PaymentCoordinatorClient.cpp:
2591         (WebCore::PaymentCoordinatorClient::supportsVersion):
2592         * Modules/applepay/PaymentCoordinatorClient.h:
2593         (WebCore::PaymentCoordinatorClient::endApplePaySetup):
2594         * testing/MockApplePaySetupFeature.cpp:
2595         * testing/MockApplePaySetupFeature.h:
2596         * testing/MockPaymentCoordinator.cpp:
2597         * testing/MockPaymentCoordinator.h:
2598         * testing/MockPaymentCoordinator.idl:
2599
2600 2020-06-08  Antti Koivisto  <antti@apple.com>
2601
2602         Pseudo-elements (::after) in shadow roots don't animate
2603         https://bugs.webkit.org/show_bug.cgi?id=173027
2604         <rdar://problem/42842994>
2605
2606         Reviewed by Antoine Quint.
2607
2608         Test: animations/keyframe-pseudo-shadow.html
2609
2610         * animation/AnimationTimeline.cpp:
2611         (WebCore::shouldConsiderAnimation):
2612
2613         We should use the actual element instead of the PseudoElement when calling Style::Scope::forOrdinal.
2614         The keyframe code that computes the style already does this correctly.
2615
2616 2020-06-08  Youenn Fablet  <youenn@apple.com>
2617
2618         Use one audio unit for all tracks of a given process
2619         https://bugs.webkit.org/show_bug.cgi?id=212406
2620
2621         Reviewed by Eric Carlson.
2622
2623         Before the patch, we were creating one audio unit per track to render.
2624         This is potentially inefficient as this requires to IPC on iOS each audio data.
2625         Instead, we could have one single remote unit that will receive the mixed content of all tracks.
2626         For that purpose, introduce AudioMediaStreamTrackRendererUnit as a singleton.
2627
2628         AudioMediaStreamTrackRendererCocoa will just register/unregister sources to AudioMediaStreamTrackRendererUnit.
2629         AudioMediaStreamTrackRendererUnit will then start/stop as needed and do the mixing.
2630
2631         This requires a change in AudioSampleDataSource to support mixing in case track volumes are different.
2632         If we have to mix and with different volumes, we first pull the samples in a scratch buffer, apply volume and then mix it with the other tracks.
2633
2634         In the future, we might also do the audio rendering with the CoreAudioSharedUnit directly so as to improve as much as possible echo cancellation.
2635
2636         Interruption is handled by the fact that all tracks should stop playing, thus stop their renderer, thus unregister themselves from the renderer unit.
2637         it might be more future proof to add the unit as an interruption observer as a follow-up.
2638
2639         Manually tested plus LayoutTests/webrtc/multi-audio.html
2640
2641         * SourcesCocoa.txt:
2642         * WebCore.xcodeproj/project.pbxproj:
2643         * platform/audio/mac/AudioSampleBufferList.cpp:
2644         (WebCore::mixBuffers):
2645         (WebCore::AudioSampleBufferList::mixFrom):
2646         * platform/audio/mac/AudioSampleBufferList.h:
2647         * platform/audio/mac/AudioSampleDataSource.mm:
2648         (WebCore::AudioSampleDataSource::pullSamplesInternal):
2649         * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:
2650         (WebCore::AudioMediaStreamTrackRendererCocoa::start):
2651         (WebCore::AudioMediaStreamTrackRendererCocoa::stop):
2652         (WebCore::AudioMediaStreamTrackRendererCocoa::clear):
2653         (WebCore::AudioMediaStreamTrackRendererCocoa::setVolume):
2654         (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples):
2655         (WebCore::AudioMediaStreamTrackRendererCocoa::createAudioUnit): Deleted.
2656         (WebCore::AudioMediaStreamTrackRendererCocoa::render): Deleted.
2657         (WebCore::AudioMediaStreamTrackRendererCocoa::inputProc): Deleted.
2658         * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h:
2659         (): Deleted.
2660         * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.cpp: Added.
2661         (WebCore::AudioMediaStreamTrackRendererUnit::singleton):
2662         (WebCore::AudioMediaStreamTrackRendererUnit::~AudioMediaStreamTrackRendererUnit):
2663         (WebCore::AudioMediaStreamTrackRendererUnit::addSource):
2664         (WebCore::AudioMediaStreamTrackRendererUnit::removeSource):
2665         (WebCore::AudioMediaStreamTrackRendererUnit::createAudioUnitIfNeeded):
2666         (WebCore::AudioMediaStreamTrackRendererUnit::start):
2667         (WebCore::AudioMediaStreamTrackRendererUnit::stop):
2668         (WebCore::AudioMediaStreamTrackRendererUnit::formatDescription):
2669         (WebCore::AudioMediaStreamTrackRendererUnit::createAudioUnit):
2670         (WebCore::AudioMediaStreamTrackRendererUnit::render):
2671         (WebCore::AudioMediaStreamTrackRendererUnit::inputProc):
2672         * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h: Copied from Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h.
2673
2674 2020-06-08  youenn fablet  <youenn@apple.com>
2675
2676         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
2677         https://bugs.webkit.org/show_bug.cgi?id=206582
2678         <rdar://problem/58985368>
2679
2680         Reviewed by Eric Carlson.
2681
2682         AVAssetWriterDelegate allows to grab recorded data whenever wanted.
2683         This delegate requires passing compressed samples to AVAssetWriter.
2684         Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
2685         These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor.
2686         They support AAC and H264 so far and should be further improved to support more encoding options.
2687
2688         Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere.
2689         The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors.
2690         It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter.
2691         The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data.
2692
2693         Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed.
2694         Therefore data should not be requested too fast to get adequate video compression.
2695
2696         Covered by existing tests.
2697
2698         * Modules/mediarecorder/MediaRecorderProvider.cpp:
2699         (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
2700         * WebCore.xcodeproj/project.pbxproj:
2701         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
2702         (WebCore::MediaRecorderPrivateAVFImpl::create):
2703         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
2704         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added.
2705         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added.
2706         (WebCore::AudioSampleBufferCompressor::create):
2707         (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
2708         (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
2709         (WebCore::AudioSampleBufferCompressor::initialize):
2710         (WebCore::AudioSampleBufferCompressor::finish):
2711         (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
2712         (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
2713         (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
2714         (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
2715         (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
2716         (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
2717         (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
2718         (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
2719         (WebCore::AudioSampleBufferCompressor::processSampleBuffer):
2720         (WebCore::AudioSampleBufferCompressor::addSampleBuffer):
2721         (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
2722         (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
2723         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2724         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2725         (-[WebAVAssetWriterDelegate initWithWriter:]):
2726         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]):
2727         (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]):
2728         (-[WebAVAssetWriterDelegate close]):
2729         (WebCore::MediaRecorderPrivateWriter::create):
2730         (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback):
2731         (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback):
2732         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
2733         (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter):
2734         (WebCore::MediaRecorderPrivateWriter::initialize):
2735         (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
2736         (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
2737         (WebCore::MediaRecorderPrivateWriter::startAssetWriter):
2738         (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
2739         (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
2740         (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers):
2741         (WebCore::appendEndsPreviousSampleDurationMarker):
2742         (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded):
2743         (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers):
2744         (WebCore::MediaRecorderPrivateWriter::clear):
2745         (WebCore::copySampleBufferWithCurrentTimeStamp):
2746         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2747         (WebCore::createAudioFormatDescription):
2748         (WebCore::createAudioSampleBuffer):
2749         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
2750         (WebCore::MediaRecorderPrivateWriter::stopRecording):
2751         (WebCore::MediaRecorderPrivateWriter::appendData):
2752         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h.
2753         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added.
2754         (WebCore::VideoSampleBufferCompressor::create):
2755         (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
2756         (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
2757         (WebCore::VideoSampleBufferCompressor::initialize):
2758         (WebCore::VideoSampleBufferCompressor::finish):
2759         (WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
2760         (WebCore::VideoSampleBufferCompressor::initCompressionSession):
2761         (WebCore::VideoSampleBufferCompressor::processSampleBuffer):
2762         (WebCore::VideoSampleBufferCompressor::addSampleBuffer):
2763         (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
2764         (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):
2765
2766 2020-06-08  Youenn Fablet  <youenn@apple.com>
2767
2768         File URLs with hostnames are misleading
2769         https://bugs.webkit.org/show_bug.cgi?id=212739
2770         <rdar://problem/63754917>
2771
2772         Reviewed by Alex Christensen.
2773
2774         Showing a file URL like file://example.org/test is misleading to users.
2775         To prevent this, we just do a redirection to the same file URL with an empty host.
2776         Remove the port at the same time.
2777         Covered by added API test.
2778
2779         * loader/DocumentLoader.cpp:
2780         (WebCore::DocumentLoader::willSendRequest):
2781
2782 2020-06-08  Rob Buis  <rbuis@igalia.com>
2783
2784         Simplify fallback content handling in FrameLoader
2785         https://bugs.webkit.org/show_bug.cgi?id=212880
2786
2787         Reviewed by Youenn Fablet.
2788
2789         Simplify fallback content handling in FrameLoader, this can be inlined
2790         and some HTMLObjectElement checks can be combined.
2791
2792         * loader/DocumentLoader.cpp:
2793         (WebCore::DocumentLoader::continueAfterContentPolicy):
2794         * loader/FrameLoader.cpp:
2795         (WebCore::FrameLoader::receivedMainResourceError):
2796         (WebCore::FrameLoader::handleFallbackContent): Deleted.
2797         (WebCore::FrameLoader::isHostedByObjectElement const): Deleted.
2798         * loader/FrameLoader.h:
2799         * loader/HistoryController.cpp:
2800         (WebCore::FrameLoader::HistoryController::createItemTree):
2801
2802 2020-06-07  Zalan Bujtas  <zalan@apple.com>
2803
2804         [LFC][Height percentage] Skip anonymous wrappers when searching for fixed height
2805         https://bugs.webkit.org/show_bug.cgi?id=212881
2806
2807         Reviewed by Antti Koivisto.
2808
2809         When the block level box is a direct child of an inline level box (<span><div></div></span>) and we wrap it into a continuation,
2810         the containing block (anonymous wrapper) is not the box we need to check for fixed height.
2811
2812         Test: fast/layoutformattingcontext/height-precentage-with-anonymous-wrapper.html
2813
2814         * layout/FormattingContextGeometry.cpp:
2815         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
2816
2817 2020-06-07  Zalan Bujtas  <zalan@apple.com>
2818
2819         [LFC][BFC] Intrinsic width computation should take min/max-width into account.
2820         https://bugs.webkit.org/show_bug.cgi?id=212876
2821
2822         Reviewed by Antti Koivisto.
2823
2824         Test: fast/layoutformattingcontext/min-max-content-width-simple2.html
2825
2826         * layout/FormattingContextGeometry.cpp:
2827         (WebCore::Layout::FormattingContext::Geometry::computedWidthValue): Address Sam's post-landing comment.
2828         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2829         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2830
2831 2020-06-07  Zalan Bujtas  <zalan@apple.com>
2832
2833         [LFC] Pass in the element attributes to Layout::ReplacedBox
2834         https://bugs.webkit.org/show_bug.cgi?id=212879
2835
2836         Reviewed by Antti Koivisto.
2837
2838         The information whether the replace box is an image box is required to see if the box has intrinsic ratio (used for sizing inflow replaced content).
2839
2840         * layout/layouttree/LayoutReplacedBox.cpp:
2841         (WebCore::Layout::ReplacedBox::ReplacedBox):
2842         (): Deleted.
2843         * layout/layouttree/LayoutReplacedBox.h:
2844         * layout/layouttree/LayoutTreeBuilder.cpp:
2845         (WebCore::Layout::TreeBuilder::createReplacedBox):
2846         (WebCore::Layout::TreeBuilder::createLayoutBox):
2847         * layout/layouttree/LayoutTreeBuilder.h:
2848
2849 2020-06-07  Philippe Normand  <pnormand@igalia.com>
2850
2851         Remove ENABLE_VIDEO_TRACK ifdef guards
2852         https://bugs.webkit.org/show_bug.cgi?id=212568
2853
2854         Reviewed by Youenn Fablet.
2855
2856         * CMakeLists.txt:
2857         * Configurations/FeatureDefines.xcconfig:
2858         * Modules/mediacontrols/MediaControlsHost.cpp:
2859         * Modules/mediasource/AudioTrackMediaSource.h:
2860         * Modules/mediasource/AudioTrackMediaSource.idl:
2861         * Modules/mediasource/SourceBuffer.h:
2862         * Modules/mediasource/SourceBuffer.idl:
2863         * Modules/mediasource/TextTrackMediaSource.h:
2864         * Modules/mediasource/TextTrackMediaSource.idl:
2865         * Modules/mediasource/VideoTrackMediaSource.h:
2866         * Modules/mediasource/VideoTrackMediaSource.idl:
2867         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:
2868         (WebCore::HTMLVideoElementPictureInPicture::requestPictureInPicture):
2869         * Sources.txt:
2870         * WebCore.xcodeproj/project.pbxproj:
2871         * bindings/js/JSAudioTrackCustom.cpp:
2872         * bindings/js/JSAudioTrackListCustom.cpp:
2873         * bindings/js/JSTextTrackCueCustom.cpp:
2874         * bindings/js/JSTextTrackCustom.cpp:
2875         * bindings/js/JSTextTrackListCustom.cpp:
2876         * bindings/js/JSTrackCustom.cpp:
2877         * bindings/js/JSTrackCustom.h:
2878         * bindings/js/JSVideoTrackCustom.cpp:
2879         * bindings/js/JSVideoTrackListCustom.cpp:
2880         * css/CSSSelector.cpp:
2881         (WebCore::CSSSelector::pseudoId):
2882         (WebCore::CSSSelector::selectorText const):
2883         * css/CSSSelector.h:
2884         * css/SelectorChecker.cpp:
2885         (WebCore::SelectorChecker::checkOne const):
2886         * css/SelectorCheckerTestFunctions.h:
2887         (WebCore::matchesLangPseudoClass):
2888         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2889         * css/SelectorPseudoElementTypeMap.in:
2890         * css/parser/CSSParserSelector.h:
2891         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
2892         (WebCore::CSSParserSelector::isPseudoElementCueFunction const):
2893         * css/parser/CSSSelectorParser.cpp:
2894         (WebCore::CSSSelectorParser::consumePseudo):
2895         * cssjit/SelectorCompiler.cpp:
2896         (WebCore::SelectorCompiler::addPseudoClassType):
2897         * dom/Document.cpp:
2898         * dom/Document.h:
2899         * dom/EventNames.in:
2900         * dom/EventTargetFactory.in:
2901         * dom/Node.h:
2902         * history/BackForwardCache.cpp:
2903         * history/BackForwardCache.h:
2904         * history/CachedPage.cpp:
2905         (WebCore::CachedPage::restore):
2906         (WebCore::CachedPage::clear):
2907         * history/CachedPage.h:
2908         * html/HTMLLinkElement.cpp:
2909         (WebCore::HTMLLinkElement::as const):
2910         * html/HTMLMediaElement.cpp:
2911         (WebCore::HTMLMediaElement::HTMLMediaElement):
2912         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2913         (WebCore::HTMLMediaElement::registerWithDocument):
2914         (WebCore::HTMLMediaElement::unregisterWithDocument):
2915         (WebCore::HTMLMediaElement::finishParsingChildren):
2916         (WebCore::HTMLMediaElement::prepareForLoad):
2917         (WebCore::HTMLMediaElement::selectMediaResource):
2918         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
2919         (WebCore::HTMLMediaElement::setReadyState):
2920         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
2921         (WebCore::HTMLMediaElement::playInternal):
2922         (WebCore::HTMLMediaElement::setVolume):
2923         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
2924         (WebCore::HTMLMediaElement::configureTextTracks):
2925         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2926         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2927         (WebCore::HTMLMediaElement::userCancelledLoad):
2928         (WebCore::HTMLMediaElement::clearMediaPlayer):
2929         (WebCore::HTMLMediaElement::syncTextTrackBounds):
2930         (WebCore::HTMLMediaElement::setVideoFullscreenStandby):
2931         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2932         (WebCore::HTMLMediaElement::hasClosedCaptions const):
2933         (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
2934         (WebCore::HTMLMediaElement::createMediaPlayer):
2935         (WebCore::HTMLMediaElement::bufferingPolicy const):
2936         * html/HTMLMediaElement.h:
2937         * html/HTMLMediaElement.idl:
2938         * html/HTMLTagNames.in:
2939         * html/HTMLTrackElement.cpp:
2940         * html/HTMLTrackElement.h:
2941         * html/HTMLTrackElement.idl:
2942         * html/canvas/WebGLRenderingContextBase.cpp:
2943         (WebCore::WebGLRenderingContextBase::texImageSourceHelper):
2944         (WebCore::WebGLRenderingContextBase::validateTexFuncParameters):
2945         * html/shadow/MediaControlTextTrackContainerElement.cpp:
2946         * html/shadow/MediaControlTextTrackContainerElement.h:
2947         * html/track/AudioTrack.cpp:
2948         * html/track/AudioTrack.h:
2949         * html/track/AudioTrack.idl:
2950         * html/track/AudioTrackList.cpp:
2951         * html/track/AudioTrackList.h:
2952         * html/track/AudioTrackList.idl:
2953         * html/track/DataCue.cpp:
2954         * html/track/DataCue.h:
2955         * html/track/DataCue.idl:
2956         * html/track/InbandDataTextTrack.cpp:
2957         * html/track/InbandDataTextTrack.h:
2958         * html/track/InbandGenericTextTrack.cpp:
2959         * html/track/InbandGenericTextTrack.h:
2960         * html/track/InbandTextTrack.cpp:
2961         * html/track/InbandTextTrack.h:
2962         * html/track/InbandWebVTTTextTrack.cpp:
2963         * html/track/InbandWebVTTTextTrack.h:
2964         * html/track/LoadableTextTrack.cpp:
2965         * html/track/LoadableTextTrack.h:
2966         * html/track/TextTrack.cpp:
2967         * html/track/TextTrack.h:
2968         * html/track/TextTrack.idl:
2969         * html/track/TextTrackCue.cpp:
2970         * html/track/TextTrackCue.h:
2971         * html/track/TextTrackCue.idl:
2972         * html/track/TextTrackCueGeneric.cpp:
2973         * html/track/TextTrackCueGeneric.h:
2974         * html/track/TextTrackCueGeneric.idl:
2975         * html/track/TextTrackCueList.cpp:
2976         * html/track/TextTrackCueList.h:
2977         * html/track/TextTrackCueList.idl:
2978         * html/track/TextTrackList.cpp:
2979         * html/track/TextTrackList.h:
2980         * html/track/TextTrackList.idl:
2981         * html/track/TrackBase.cpp:
2982         * html/track/TrackBase.h:
2983         * html/track/TrackEvent.cpp:
2984         * html/track/TrackEvent.h:
2985         * html/track/TrackEvent.idl:
2986         * html/track/TrackListBase.cpp:
2987         * html/track/TrackListBase.h:
2988         * html/track/VTTCue.cpp:
2989         * html/track/VTTCue.h:
2990         * html/track/VTTCue.idl:
2991         * html/track/VTTRegion.cpp:
2992         * html/track/VTTRegion.h:
2993         * html/track/VTTRegion.idl:
2994         * html/track/VTTRegionList.cpp:
2995         * html/track/VTTRegionList.h:
2996         * html/track/VTTRegionList.idl:
2997         * html/track/VideoTrack.cpp:
2998         * html/track/VideoTrack.h:
2999         * html/track/VideoTrack.idl:
3000         * html/track/VideoTrackList.cpp:
3001         * html/track/VideoTrackList.h:
3002         * html/track/VideoTrackList.idl:
3003         * html/track/WebVTTElement.cpp:
3004         * html/track/WebVTTElement.h:
3005         * html/track/WebVTTParser.cpp:
3006         * html/track/WebVTTParser.h:
3007         * html/track/WebVTTToken.h:
3008         * html/track/WebVTTTokenizer.cpp:
3009         * html/track/WebVTTTokenizer.h:
3010         * loader/LinkLoader.cpp:
3011         (WebCore::LinkLoader::resourceTypeFromAsAttribute):
3012         (WebCore::createLinkPreloadResourceClient):
3013         (WebCore::LinkLoader::isSupportedType):
3014         * loader/ResourceLoadInfo.cpp:
3015         (WebCore::ContentExtensions::toResourceType):
3016         * loader/SubresourceLoader.cpp:
3017         (WebCore::logResourceLoaded):
3018         * loader/TextTrackLoader.cpp:
3019         * loader/TextTrackLoader.h:
3020         * loader/cache/CachedResource.cpp:
3021         (WebCore::CachedResource::defaultPriorityForResourceType):
3022         * loader/cache/CachedResource.h:
3023         * loader/cache/CachedResourceLoader.cpp:
3024         (WebCore::createResource):
3025         (WebCore::contentTypeFromResourceType):
3026         (WebCore::CachedResourceLoader::checkInsecureContent const):
3027         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
3028         (WebCore::destinationForType):
3029         * loader/cache/CachedResourceLoader.h:
3030         * loader/cache/CachedTextTrack.cpp:
3031         * loader/cache/CachedTextTrack.h:
3032         * page/CaptionUserPreferences.cpp:
3033         * page/CaptionUserPreferences.h:
3034         * page/CaptionUserPreferencesMediaAF.cpp:
3035         * page/CaptionUserPreferencesMediaAF.h:
3036         * page/Page.cpp:
3037         (WebCore::Page::setPageScaleFactor):
3038         (WebCore::Page::setUserInterfaceLayoutDirection):
3039         (WebCore::Page::doAfterUpdateRendering):
3040         (WebCore::Page::forEachMediaElement):
3041         * page/Page.h:
3042         * page/PageGroup.cpp:
3043         * page/PageGroup.h:
3044         * page/Settings.yaml:
3045         * platform/LocalizedStrings.cpp:
3046         * platform/LocalizedStrings.h:
3047         * platform/MIMETypeRegistry.cpp:
3048         (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
3049         * platform/SerializedPlatformDataCue.cpp:
3050         * platform/graphics/AudioTrackPrivate.h:
3051         * platform/graphics/ImageDecoder.cpp:
3052         (WebCore::ImageDecoder::create):
3053         (WebCore::ImageDecoder::supportsMediaType):
3054         * platform/graphics/InbandGenericCue.cpp:
3055         * platform/graphics/InbandGenericCue.h:
3056         * platform/graphics/InbandTextTrackPrivate.h:
3057         * platform/graphics/InbandTextTrackPrivateClient.h:
3058         * platform/graphics/MediaPlayer.cpp:
3059         (WebCore::buildMediaEnginesVector):
3060         * platform/graphics/MediaPlayer.h:
3061         (WebCore::MediaPlayerClient::textTrackRepresentationBoundsChanged):
3062         * platform/graphics/MediaPlayerPrivate.h:
3063         (WebCore::MediaPlayerPrivateInterface::tracksChanged):
3064         * platform/graphics/TextTrackRepresentation.cpp:
3065         * platform/graphics/TextTrackRepresentation.h:
3066         * platform/graphics/TrackPrivateBase.cpp:
3067         * platform/graphics/TrackPrivateBase.h:
3068         * platform/graphics/VideoTrackPrivate.h:
3069         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h:
3070         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3071         * platform/graphics/avfoundation/AudioTrackPrivateAVF.h:
3072         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
3073         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3074         * platform/graphics/avfoundation/VideoTrackPrivateAVF.h:
3075         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h:
3076         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
3077         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp:
3078         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
3079         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3080         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3081         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:
3082         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h:
3083         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
3084         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
3085         * platform/graphics/cocoa/TextTrackRepresentationCocoa.h:
3086         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
3087         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
3088         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
3089         * platform/graphics/gstreamer/GStreamerCommon.cpp:
3090         (WebCore::initializeGStreamer):
3091         * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
3092         * platform/graphics/gstreamer/ImageDecoderGStreamer.h:
3093         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
3094         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
3095         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3096         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3097         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3098         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
3099         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
3100         (WebCore::MediaPlayerPrivateGStreamer::newTextSample):
3101         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
3102         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3103         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks):
3104         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3105         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3106         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
3107         * platform/graphics/gstreamer/TextCombinerGStreamer.h:
3108         * platform/graphics/gstreamer/TextSinkGStreamer.cpp:
3109         * platform/graphics/gstreamer/TextSinkGStreamer.h:
3110         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3111         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3112         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
3113         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
3114         * platform/mac/SerializedPlatformDataCueMac.h:
3115         * platform/mac/SerializedPlatformDataCueMac.mm:
3116         * platform/mediastream/AudioMediaStreamTrackRenderer.cpp:
3117         * platform/mediastream/AudioMediaStreamTrackRenderer.h:
3118         * platform/mediastream/AudioTrackPrivateMediaStream.cpp:
3119         * platform/mediastream/AudioTrackPrivateMediaStream.h:
3120         * platform/mediastream/VideoTrackPrivateMediaStream.h:
3121         * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:
3122         * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h:
3123         * rendering/RenderVTTCue.cpp:
3124         * rendering/RenderVTTCue.h:
3125         * style/ElementRuleCollector.cpp:
3126         (WebCore::Style::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
3127         * style/PropertyCascade.cpp:
3128         (WebCore::Style::PropertyCascade::addMatch):
3129         * style/RuleData.cpp:
3130         (WebCore::Style::determinePropertyWhitelistType):
3131         * style/RuleData.h:
3132         * style/RuleSet.cpp:
3133         (WebCore::Style::RuleSet::addRule):
3134         (WebCore::Style::RuleSet::traverseRuleDatas):
3135         (WebCore::Style::RuleSet::hasShadowPseudoElementRules const):
3136         (WebCore::Style::RuleSet::shrinkToFit):
3137         * style/RuleSet.h:
3138         * style/StyleAdjuster.cpp:
3139         (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const):
3140         * testing/InternalSettings.cpp:
3141         (WebCore::InternalSettings::Backup::Backup):
3142         (WebCore::InternalSettings::Backup::restoreTo):
3143         (WebCore::InternalSettings::setShouldDisplayTrackKind):
3144         (WebCore::InternalSettings::shouldDisplayTrackKind):
3145         * testing/InternalSettings.h:
3146         * testing/InternalSettings.idl:
3147         * testing/Internals.cpp:
3148         (WebCore::Internals::resetToConsistentState):
3149         (WebCore::Internals::Internals):
3150         (WebCore::Internals::userPreferredAudioCharacteristics const):
3151         (WebCore::Internals::setUserPreferredAudioCharacteristic):
3152         (WebCore::Internals::captionsStyleSheetOverride):
3153         (WebCore::Internals::setCaptionsStyleSheetOverride):
3154         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride):
3155         (WebCore::Internals::setCaptionDisplayMode):
3156         (WebCore::Internals::textTrackBCP47Language):
3157         (WebCore::Internals::getCurrentMediaControlsStatusForElement):
3158         * testing/Internals.h:
3159         * testing/Internals.idl:
3160
3161 2020-06-06  Yusuke Suzuki  <ysuzuki@apple.com>
3162
3163         Crash when running web-apis data collection
3164         https://bugs.webkit.org/show_bug.cgi?id=212458
3165
3166         Reviewed by Mark Lam.
3167
3168         Test: js/dom/dom-attribute-getter-setter.html
3169
3170         For properties using DOMAttribute property attribute in the table, code generator must use DOMAttributeGetterSetter instead of CustomGetterSetter.
3171
3172         * bindings/scripts/CodeGeneratorJS.pm:
3173         (GenerateImplementation):
3174         * bindings/scripts/test/JS/JSTestObj.cpp:
3175         (WebCore::JSTestObjPrototype::finishCreation):
3176
3177 2020-06-06  Zalan Bujtas  <zalan@apple.com>
3178
3179         [LFC] Add support for width: min/max-content
3180         https://bugs.webkit.org/show_bug.cgi?id=212869
3181
3182         Reviewed by Antti Koivisto.
3183
3184         Use the existing intrinsic width logic to compute min/max-content width. 
3185
3186         Test: fast/layoutformattingcontext/min-max-content-width-simple.html
3187
3188         * layout/FormattingContext.h:
3189         * layout/FormattingContextGeometry.cpp:
3190         (WebCore::Layout::FormattingContext::Geometry::computedWidthValue):
3191         (WebCore::Layout::FormattingContext::Geometry::computedWidth):
3192         (WebCore::Layout::FormattingContext::Geometry::fixedValue const):
3193         (WebCore::Layout::FormattingContext::Geometry::computedMinWidth):
3194         (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth):
3195         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3196         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3197         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3198         (WebCore::Layout::FormattingContext::Geometry::computedWidth const): Deleted.
3199         (WebCore::Layout::FormattingContext::Geometry::computedMinWidth const): Deleted.
3200         (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth const): Deleted.
3201         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const): Deleted.
3202         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const): Deleted.
3203         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const): Deleted.
3204         * layout/blockformatting/BlockFormattingContext.h:
3205         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3206         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3207         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3208         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const): Deleted.
3209         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin const): Deleted.
3210         * layout/tableformatting/TableFormattingContext.h:
3211         * layout/tableformatting/TableFormattingContextGeometry.cpp:
3212         (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth):
3213         (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const): Deleted.
3214
3215 2020-06-06  Devin Rousso  <drousso@apple.com>
3216
3217         [ macOS wk2 ] inspector/page/setBootstrapScript-sub-frame.html is flaky failing
3218         https://bugs.webkit.org/show_bug.cgi?id=207053
3219         <rdar://problem/59064908>
3220
3221         Reviewed by Timothy Hatcher.
3222
3223         Test: inspector/page/setBootstrapScript-sub-frame.html
3224
3225         * inspector/InspectorInstrumentation.cpp:
3226         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
3227         Ensure the `InspectorPageAgent` sends the new `Page.Frame` payload to the frontend before
3228         the `PageRuntimeAgent` so that a `WI.Frame` exists before adding any `WI.ExecutionContext`.
3229
3230 2020-06-06  Jer Noble  <jer.noble@apple.com>
3231
3232         REGRESSION (r262364): Disney Plus crashes playing videos
3233         https://bugs.webkit.org/show_bug.cgi?id=212862
3234         <rdar://problem/64044841>
3235
3236         Reviewed by Eric Carlson.
3237
3238         In r262364, we specified an incorrect number size for CFNumberGetValue, which nevertheless
3239         worked fine in debug builds, but overwrote stack data in release builds, leading to a crash when
3240         the returned pointer was ref()d. The correct size for a FourCharCode is a
3241         kCFNumberSInt32Type, not a kCFNumberLongType.
3242
3243         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3244
3245 2020-06-06  David Kilzer  <ddkilzer@apple.com>
3246
3247         [IPC] Adopt enum class for GradientSpreadMethod
3248         <https://webkit.org/b/212868>
3249         <rdar://problem/64069035>
3250
3251         Reviewed by Anders Carlsson.
3252
3253         Summary:
3254         - Convert GradientSpreadMethod to an enum class.
3255         - Add WTF::EnumTraits<AutocapitalizeType> for IPC.
3256         - Remove use of decodeEnum() and encodeEnum().
3257
3258         * platform/graphics/Gradient.h:
3259         (WebCore::Gradient::encode const):
3260         (WebCore::Gradient::decode):
3261         * platform/graphics/GraphicsTypes.h:
3262         * platform/graphics/cairo/GradientCairo.cpp:
3263         (WebCore::Gradient::createPlatformGradient):
3264         * platform/graphics/cg/GradientCG.cpp:
3265         (WebCore::Gradient::paint):
3266         * rendering/svg/RenderSVGResourceGradient.cpp:
3267         (WebCore::RenderSVGResourceGradient::applyResource):
3268
3269 2020-06-06  Rob Buis  <rbuis@igalia.com>
3270
3271         Reduce includes for CustomHeaderFields
3272         https://bugs.webkit.org/show_bug.cgi?id=212691
3273
3274         Reviewed by Joseph Pecoraro.
3275
3276         Reduce includes for CustomHeaderFields, I guess these were needed
3277         at some point but not anymore.
3278
3279         * Modules/applepay/ApplePaySession.cpp:
3280         * Modules/applepay/PaymentSession.cpp:
3281         * bindings/js/ScriptController.cpp:
3282         * contentextensions/ContentExtensionsBackend.cpp:
3283         * dom/Document.cpp:
3284         * editing/cocoa/EditorCocoa.mm:
3285         * editing/cocoa/HTMLConverter.mm:
3286         * editing/cocoa/WebContentReaderCocoa.mm:
3287         * editing/markup.cpp:
3288         * history/CachedFrame.cpp:
3289         * html/HTMLDocument.cpp:
3290         * html/HTMLHtmlElement.cpp:
3291         * html/HTMLMediaElement.cpp:
3292         * html/ImageDocument.cpp:
3293         * html/MediaDocument.cpp:
3294         * html/PluginDocument.cpp:
3295         * html/parser/HTMLDocumentParser.cpp:
3296         * html/parser/XSSAuditor.cpp:
3297         * inspector/InspectorInstrumentation.cpp:
3298         * inspector/agents/InspectorApplicationCacheAgent.cpp:
3299         * inspector/agents/InspectorNetworkAgent.cpp:
3300         * inspector/agents/InspectorPageAgent.cpp:
3301         * inspector/agents/page/PageNetworkAgent.cpp:
3302         * loader/ApplicationManifestLoader.cpp:
3303         * loader/FrameLoader.cpp:
3304         * loader/LoadTiming.cpp:
3305         * loader/NetscapePlugInStreamLoader.cpp:
3306         * loader/ResourceLoader.cpp:
3307         * loader/SubresourceLoader.cpp:
3308         * loader/appcache/ApplicationCacheHost.cpp:
3309         * loader/archive/cf/LegacyWebArchive.cpp:
3310         * loader/icon/IconLoader.cpp:
3311         * page/ContextMenuController.cpp:
3312         * page/FrameView.cpp:
3313         * page/Page.cpp:
3314         * page/Performance.cpp:
3315         * page/PerformanceNavigation.cpp:
3316         * page/Quirks.cpp:
3317         * page/UserContentProvider.cpp:
3318         * page/csp/ContentSecurityPolicy.cpp:
3319         * page/mac/PageMac.mm:
3320         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3321         * svg/graphics/SVGImage.cpp:
3322         * testing/Internals.cpp:
3323
3324 2020-06-06  Andy Estes  <aestes@apple.com>
3325
3326         [Apple Pay] Add testing and logging for ApplePaySetup
3327         https://bugs.webkit.org/show_bug.cgi?id=211972
3328         <rdar://problem/63291965>
3329
3330         Reviewed by Alex Christensen.
3331
3332         Test: http/tests/ssl/applepay/ApplePaySetup.https.html
3333
3334         * DerivedSources-input.xcfilelist:
3335         * DerivedSources-output.xcfilelist:
3336         * DerivedSources.make:
3337         * Modules/applepay/ApplePaySetup.cpp:
3338         (WebCore::ApplePaySetup::getSetupFeatures):
3339         (WebCore::ApplePaySetup::begin):
3340         (WebCore::ApplePaySetup::ApplePaySetup):
3341         (WebCore::ApplePaySetup::stop):
3342         * Modules/applepay/ApplePaySetup.idl:
3343         * Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
3344         * Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
3345         * Modules/applepay/ApplePaySetupFeature.idl:
3346         * Modules/applepay/ApplePaySetupFeature.mm:
3347         (WebCore::ApplePaySetupFeature::state const):
3348         * Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
3349         * Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
3350         * Modules/applepay/ApplePaySetupFeatureType.idl:
3351         * Modules/applepay/ApplePaySetupFeatureWebCore.h:
3352         * Modules/applepay/ApplePaySetupWebCore.h:
3353         (WebCore::ApplePaySetup::create):
3354         * Modules/applepay/PaymentCoordinator.cpp:
3355         (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const):
3356         (WebCore::PaymentCoordinator::getSetupFeatures):
3357         (WebCore::PaymentCoordinator::beginApplePaySetup):
3358         (WebCore::PaymentCoordinator::endApplePaySetup):
3359         * Modules/applepay/PaymentCoordinator.h:
3360         * Modules/applepay/PaymentCoordinatorClient.h:
3361         (WebCore::PaymentCoordinatorClient::getSetupFeatures):
3362         (WebCore::PaymentCoordinatorClient::beginApplePaySetup):
3363         * SourcesCocoa.txt:
3364         * WebCore.xcodeproj/project.pbxproj:
3365         * testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
3366         (WebCore::MockApplePaySetupFeature::create):
3367         (WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature):
3368         * testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
3369         * testing/MockPaymentCoordinator.cpp:
3370         (WebCore::MockPaymentCoordinator::addSetupFeature):
3371         (WebCore::MockPaymentCoordinator::getSetupFeatures):
3372         (WebCore::MockPaymentCoordinator::beginApplePaySetup):
3373         * testing/MockPaymentCoordinator.h:
3374         * testing/MockPaymentCoordinator.idl:
3375
3376 2020-06-06  David Kilzer  <ddkilzer@apple.com>
3377
3378         Follow-up: Use OptionSet<DragOperation> for mask values
3379         <https://webkit.org/b/212605>
3380         <rdar://problem/64069091>
3381
3382         * dom/DataTransfer.cpp:
3383         (WebCore::DataTransfer::destinationOperationMask const):
3384         - Don't compare to anyDragOperation(). Darin suggested this
3385           change during patch review, but this use was missed.
3386
3387 2020-06-06  David Kilzer  <ddkilzer@apple.com>
3388
3389         Use OptionSet<DragOperation> for mask values
3390         <https://webkit.org/b/212605>
3391
3392         Reviewed by Darin Adler.
3393
3394         In broad strokes:
3395         - Replace use of DragOperation with OptionSet<DragOperation> or
3396           Optional<DragOperation>.
3397         - Rename function parameters and local variables to denote use
3398           of mask values.
3399         - Remove DragOperationNone enum value.
3400         - Replace DragOperationEvery enum value with anyDragOperation().
3401
3402         * dom/DataTransfer.cpp:
3403         (WebCore::DataTransfer::createForDrop):