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