AX: PSON: Going back from apple.com to search results, cannot interact with HTML...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-18  Chris Fleizach  <cfleizach@apple.com>
2
3         AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
4         https://bugs.webkit.org/show_bug.cgi?id=194742
5
6         Reviewed by Chris Dumez.
7
8         With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
9         had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
10
11         This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
12         receive notifications.
13
14         It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
15         page load.
16
17         * accessibility/mac/AXObjectCacheMac.mm:
18         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
19
20 2019-02-18  Megan Gardner  <megan_gardner@apple.com>
21
22         Turn On Smart Delete
23         https://bugs.webkit.org/show_bug.cgi?id=194320
24
25         Reviewed by Ryosuke Niwa.
26
27         Updated the following tests to work with iOS:
28         * editing/deleting/smart-delete-001.html:
29         * editing/deleting/smart-delete-002.html:
30         * editing/deleting/smart-delete-003.html:
31         * editing/deleting/smart-delete-004.html:
32         * editing/deleting/smart-delete-across-editable-boundaries-2.html:
33         * editing/selection/delete-word-granularity-text-control.html:
34
35         Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other 
36         platforms to turn on smart delete when desired.
37
38         * editing/Editor.cpp:
39         (WebCore::Editor::shouldSmartDelete):
40         Allow platfroms to determine if smart delete should be on.
41         On mac, this is via word granularity, on iOS this is just on all the time.
42         (WebCore::Editor::canSmartCopyOrDelete):
43         (WebCore::Editor::performCutOrCopy):
44         * editing/Editor.h:
45         * editing/EditorCommand.cpp:
46         (WebCore::executeDelete):
47         * editing/ios/EditorIOS.mm:
48         (WebCore::Editor::shouldSmartDelete):
49         * editing/mac/EditorMac.mm:
50         (WebCore::Editor::shouldSmartDelete):
51
52 2019-02-17  David Kilzer  <ddkilzer@apple.com>
53
54         Unreviewed, rolling out r241620.
55
56         "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
57         (Requested by ddkilzer on #webkit.)
58
59         Reverted changeset:
60
61         "[WTF] Add environment variable helpers"
62         https://bugs.webkit.org/show_bug.cgi?id=192405
63         https://trac.webkit.org/changeset/241620
64
65 2019-02-16  Zalan Bujtas  <zalan@apple.com>
66
67         [LFC] RenderImage's default intrinsic size is 0.
68         https://bugs.webkit.org/show_bug.cgi?id=194745
69
70         Reviewed by Antti Koivisto.
71
72         While the images are being loaded, their intrinsic size is set to 0 (RenderImage c'tor). Note that this code is temporary.
73         * layout/layouttree/LayoutTreeBuilder.cpp:
74         (WebCore::Layout::TreeBuilder::createSubTree):
75
76 2019-02-16  Zalan Bujtas  <zalan@apple.com>
77
78         [LFC][BFC] Add support for block replaced intrinsic width.
79         https://bugs.webkit.org/show_bug.cgi?id=194705
80
81         Reviewed by Simon Fraser.
82
83         Replaced boxes should report their intrinsic width as preferred widths.
84
85         Test: fast/block/block-only/replaced-intrinsic-width-simple.html
86
87         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
88         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
89
90 2019-02-16  Zalan Bujtas  <zalan@apple.com>
91
92         [LFC] Apply min/max width constraints to preferred width computation
93         https://bugs.webkit.org/show_bug.cgi?id=194739
94
95         Reviewed by Simon Fraser.
96
97         Ensure that both min-height and max-height are taken into account while computing the preferred width.
98
99         Test: fast/block/block-only/min-max-and-preferred-width-simple.html
100
101         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
102         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
103
104 2019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
105
106         [JSC] Make builtin objects more lazily initialized under non-JIT mode
107         https://bugs.webkit.org/show_bug.cgi?id=194727
108
109         Reviewed by Saam Barati.
110
111         * Modules/streams/ReadableByteStreamInternals.js:
112         (privateInitializeReadableByteStreamController):
113         (readableByteStreamControllerRespond):
114
115 2019-02-15  Dean Jackson  <dino@apple.com>
116
117         Allow emulation of user gestures from Web Inspector console
118         https://bugs.webkit.org/show_bug.cgi?id=194725
119         <rdar://problem/48126604>
120
121         Reviewed by Joseph Pecoraro and Devin Rousso.
122
123         Test: inspector/runtime/evaluate-userGestureEmulation.html
124
125         * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
126         a UserGestureIndicator based on the emulateUserGesture option.
127         (WebCore::PageRuntimeAgent::evaluate):
128         * inspector/agents/page/PageRuntimeAgent.h:
129
130 2019-02-15  Chris Dumez  <cdumez@apple.com>
131
132         Sample domainsVisited diagnostic logging
133         https://bugs.webkit.org/show_bug.cgi?id=194657
134
135         Reviewed by Ryosuke Niwa.
136
137         Sample domainsVisited diagnostic logging, we are getting a lot of data from
138         this key and this is hurting our other keys.
139
140         * page/Page.cpp:
141         (WebCore::Page::logNavigation):
142
143 2019-02-15  Ryosuke Niwa  <rniwa@webkit.org>
144
145         Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
146         https://bugs.webkit.org/show_bug.cgi?id=194691
147
148         Reviewed by Simon Fraser.
149
150         The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document
151         without updating the layout of ancestor documents (i.e. documents in which frame owner
152         elements appear) even though it hit-tests against the top-level document's RenderView.
153
154         Fixed the bug by updating the layout of the top-level document as needed.
155
156         Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html
157
158         * html/HTMLPlugInElement.cpp:
159         (WebCore::HTMLPlugInElement::isReplacementObscured):
160
161 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
162
163         [WTF] Add environment variable helpers
164         https://bugs.webkit.org/show_bug.cgi?id=192405
165
166         Reviewed by Michael Catanzaro.
167
168         * platform/NotImplemented.h:
169         * platform/cocoa/SystemVersion.mm:
170         (WebCore::createSystemMarketingVersion):
171         * platform/graphics/gstreamer/GStreamerCommon.cpp:
172         (WebCore::initializeGStreamer):
173         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
174         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
175         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
176         (Nicosia::PaintingEngine::create):
177         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
178         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
179         * platform/graphics/x11/PlatformDisplayX11.cpp:
180         (WebCore::PlatformDisplayX11::create):
181         * platform/gtk/RenderThemeWidget.cpp:
182         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
183         * platform/gtk/ScrollbarThemeGtk.cpp:
184         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
185         * platform/network/curl/CurlContext.cpp:
186         (WebCore::CurlContext::CurlContext):
187         (WebCore::EnvironmentVariableReader::read): Deleted.
188         (WebCore::EnvironmentVariableReader::defined): Deleted.
189         (WebCore::EnvironmentVariableReader::readAs): Deleted.
190         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
191         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
192         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
193         * platform/network/curl/NetworkStorageSessionCurl.cpp:
194         (WebCore::defaultCookieJarPath):
195         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
196         (WebCore::getCACertPathEnv):
197         * platform/network/win/CurlSSLHandleWin.cpp:
198         (WebCore::getCACertPathEnv):
199         * platform/text/hyphen/HyphenationLibHyphen.cpp:
200         (WebCore::topLevelPath):
201         (WebCore::webkitBuildDirectory):
202         * platform/unix/LoggingUnix.cpp:
203         (WebCore::logLevelString):
204         * platform/win/LoggingWin.cpp:
205         (WebCore::logLevelString):
206         Utilize WTF::Environment where possible.
207
208 2019-02-15  Antoine Quint  <graouts@apple.com>
209
210         Add a method to dispatch a PointerEvent based on a PlatformTouchEvent
211         https://bugs.webkit.org/show_bug.cgi?id=194702
212         <rdar://problem/48109355>
213
214         Reviewed by Dean Jackson.
215
216         * page/EventHandler.cpp:
217         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex):
218         * page/EventHandler.h:
219
220 2019-02-15  Per Arne Vollan  <pvollan@apple.com>
221
222         [WebVTT] Inline WebVTT styles should start with '::cue'
223         https://bugs.webkit.org/show_bug.cgi?id=194227
224
225         Reviewed by Eric Carlson.
226
227         The original fix in r241203 is not sufficient, since it only checks if the CSS string starts
228         with '::cue'. Before accepting a CSS string from a WebVTT file, it should be checked that
229         all selectors starts with '::cue'.
230
231         Test: media/track/track-cue-css.html
232
233         * html/track/WebVTTParser.cpp:
234         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
235
236 2019-02-15  Youenn Fablet  <youenn@apple.com>
237
238         Add binding tests for ContextAllowsMediaDevices and ContextHasServiceWorkerScheme
239         https://bugs.webkit.org/show_bug.cgi?id=194713
240
241         Reviewed by Eric Carlson.
242
243         Binding tests covering mediaDevices and serviceWorker attributes.
244
245         * bindings/scripts/test/JS/JSTestObj.cpp:
246         (WebCore::JSTestObjPrototype::finishCreation):
247         (WebCore::jsTestObjMediaDevices1Getter):
248         (WebCore::jsTestObjMediaDevices1):
249         (WebCore::jsTestObjMediaDevices2Getter):
250         (WebCore::jsTestObjMediaDevices2):
251         (WebCore::jsTestObjServiceWorkers1Getter):
252         (WebCore::jsTestObjServiceWorkers1):
253         (WebCore::jsTestObjServiceWorkers2Getter):
254         (WebCore::jsTestObjServiceWorkers2):
255         * bindings/scripts/test/TestObj.idl:
256
257 2019-02-15  Beth Dakin  <bdakin@apple.com>
258
259         Build fix.
260
261         * rendering/RenderThemeIOS.mm:
262         (WebCore::iconForAttachment):
263
264 2019-02-15  Youenn Fablet  <youenn@apple.com>
265
266         Make ServiceWorkerClientFetch closer to WebResourceLoader
267         https://bugs.webkit.org/show_bug.cgi?id=194651
268
269         Reviewed by Alex Christensen.
270
271         Check for redirection response and if so call a specific client API.
272         Ensure ServiceWorkerFetch::Client gets called in the service worker thread proxy
273         so that its m_connection is only accessed on that thread.
274
275         Covered by existing tests.
276
277         * platform/network/FormData.h:
278         * platform/network/ResourceErrorBase.h:
279         * workers/service/context/ServiceWorkerFetch.cpp:
280         (WebCore::ServiceWorkerFetch::processResponse):
281         * workers/service/context/ServiceWorkerFetch.h:
282         * workers/service/context/ServiceWorkerThreadProxy.cpp:
283         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
284         (WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse):
285         * workers/service/context/ServiceWorkerThreadProxy.h:
286
287 2019-02-15  Youenn Fablet  <youenn@apple.com>
288
289         Make navigator.mediaDevices SecureContext
290         https://bugs.webkit.org/show_bug.cgi?id=194666
291
292         Reviewed by Eric Carlson.
293
294         Make navigator.mediaDevices SecureContext.
295         This can still be enabled for unsecure context using the existing page settings.
296         To cover that case, introduce ContextHasMediaDevices custom IDL keyword.
297
298         Covered by API test.
299
300         * Modules/mediastream/NavigatorMediaDevices.idl:
301         * bindings/scripts/CodeGeneratorJS.pm:
302         (GenerateRuntimeEnableConditionalString):
303         * bindings/scripts/IDLAttributes.json:
304         * dom/ScriptExecutionContext.cpp:
305         (WebCore::ScriptExecutionContext::hasMediaDevices const):
306         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
307         * dom/ScriptExecutionContext.h:
308
309 2019-02-15  Youenn Fablet  <youenn@apple.com>
310
311         WebSocket should not fire events after being stopped
312         https://bugs.webkit.org/show_bug.cgi?id=194690
313
314         Reviewed by Geoffrey Garen.
315
316         dispatchOrQueueErrorEvent is scheduled using RunLoop::main().dispatch or dispatch_async.
317         This makes it possible to dispatch an event while WebSocket is already stopped.
318         Instead, use Document::postTask so that the task is only executed if WebSocket is not stopped.
319
320         As a refactoring, make use of PendingActivity to keep track of setPendingActivity/unsetPendingActivity more easily.
321
322         * Modules/websockets/WebSocket.cpp:
323         (WebCore::WebSocket::stop):
324         (WebCore::WebSocket::connect):
325         * Modules/websockets/WebSocket.h:
326
327 2019-02-15  Youenn Fablet  <youenn@apple.com>
328
329         Performance should not fire events when its context is stopped
330         https://bugs.webkit.org/show_bug.cgi?id=194689
331
332         Reviewed by Alex Christensen.
333
334         Stop the timer when its context is destroyed.
335         Add an assertion to ensure the timer does not fire after context is destroyed.
336
337         * page/Performance.cpp:
338         (WebCore::Performance::stop):
339
340 2019-02-15  Alex Christensen  <achristensen@webkit.org>
341
342         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
343         https://bugs.webkit.org/show_bug.cgi?id=194523
344
345         Reviewed by Geoffrey Garen.
346
347         The scope of the FormCreationContext was limited to the scope of createHTTPBodyCFReadStream,
348         so when it was used in formCreate it was lucky to get the same context if the stack hadn't been overwritten
349         and if the FormData hadn't been freed.  Instead, keep it alive with new/delete like we do the FormStreamFields.
350         A younger me should've noticed this when reviewing r218517.
351
352         * platform/network/cf/FormDataStreamCFNet.cpp:
353         (WebCore::formCreate):
354         (WebCore::createHTTPBodyCFReadStream):
355
356 2019-02-15  Commit Queue  <commit-queue@webkit.org>
357
358         Unreviewed, rolling out r241559 and r241566.
359         https://bugs.webkit.org/show_bug.cgi?id=194710
360
361         Causes layout test crashes under GuardMalloc (Requested by
362         ryanhaddad on #webkit).
363
364         Reverted changesets:
365
366         "[WTF] Add environment variable helpers"
367         https://bugs.webkit.org/show_bug.cgi?id=192405
368         https://trac.webkit.org/changeset/241559
369
370         "Unreviewed build fix for WinCairo Debug after r241559."
371         https://trac.webkit.org/changeset/241566
372
373 2019-02-15  Youenn Fablet  <youenn@apple.com>
374
375         Stop the endpoint synchronously in RTCPeerConnection::close
376         https://bugs.webkit.org/show_bug.cgi?id=194688
377
378         Reviewed by Eric Carlson.
379
380         In the case where the peer connection is being closed, it was asynchronously stopping the endpoint.
381         But the endpoint, before being stopped, could try to fire an event.
382         If the context is gone in between, we end up with a null pointer dereference.
383
384         * Modules/mediastream/RTCPeerConnection.cpp:
385         (WebCore::RTCPeerConnection::close):
386
387 2019-02-15  Zalan Bujtas  <zalan@apple.com>
388
389         [LFC] Out-of-flow box is never a float box
390         https://bugs.webkit.org/show_bug.cgi?id=194704
391
392         Reviewed by Antti Koivisto.
393
394         We can't have it both ways. Absolute positioning wins.
395
396         Test: fast/block/block-only/out-of-flow-is-never-float-box.html
397
398         * layout/layouttree/LayoutBox.cpp:
399         (WebCore::Layout::Box::isFloatingPositioned const):
400         (WebCore::Layout::Box::isLeftFloatingPositioned const):
401         (WebCore::Layout::Box::isRightFloatingPositioned const):
402
403 2019-02-15  Philippe Normand  <pnormand@igalia.com>
404
405         [GStreamer] Simplify GObject class name check
406         https://bugs.webkit.org/show_bug.cgi?id=194537
407
408         Reviewed by Michael Catanzaro.
409
410         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
411         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
412         Use G_OBJECT_TYPE_NAME() to filter out uridecodebin child
413         elements.
414
415 2019-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
416
417         Refactor EditingStyle::textDirection to return an Optional<WritingDirection> instead of a bool
418         https://bugs.webkit.org/show_bug.cgi?id=194686
419
420         Reviewed by Ryosuke Niwa.
421
422         Changes EditingStyle::textDirection to return an Optional<WritingDirection>, instead of taking a reference to
423         the resulting WritingDirection. No change in behavior.
424
425         * editing/ApplyStyleCommand.cpp:
426         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
427         (WebCore::ApplyStyleCommand::applyInlineStyle):
428         * editing/EditingStyle.cpp:
429         (WebCore::EditingStyle::textDirection const):
430         (WebCore::EditingStyle::textDirectionForSelection):
431         * editing/EditingStyle.h:
432
433 2019-02-10  Darin Adler  <darin@apple.com>
434
435         Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
436         https://bugs.webkit.org/show_bug.cgi?id=194487
437
438         Reviewed by Daniel Bates.
439
440         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
441         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue): Use makeString
442         instead of String::format.
443
444         * page/linux/ResourceUsageOverlayLinux.cpp:
445         (WebCore::formatByteNumber): Use String::number instead of String::format.
446
447         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
448         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
449         Use makeString instead of String::format.
450         * platform/glib/UserAgentGLib.cpp:
451         (WebCore::platformVersionForUAString): Ditto.
452         * platform/graphics/gstreamer/GStreamerCommon.cpp:
453         (WebCore::simpleBusMessageCallback): Ditto.
454         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
455         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ditto.
456         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
457         (WebCore::AppendPipeline::AppendPipeline): Ditto.
458         (WebCore::AppendPipeline::handleStateChangeMessage): Ditto.
459         (WebCore::AppendPipeline::resetParserState): Ditto.
460         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
461         (WebCore::MediaPlayerPrivateGStreamerMSE::load): Ditto.
462         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Ditto.
463
464         * platform/graphics/gtk/ImageBufferGtk.cpp:
465         (WebCore::encodeImage): Use String::number instead of String::format.
466
467         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
468         (WebCore::GStreamerAudioCaptureSource::create): Use makeString instead of
469         String::format.
470         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
471         (WebCore::GStreamerCaptureDeviceManager::addDevice): Ditto.
472         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
473         (WebCore::webkitMediaStreamSrcAddPad): Ditto.
474         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
475         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
476         * platform/network/curl/CookieJarDB.cpp:
477         (WebCore::CookieJarDB::verifySchemaVersion): Ditto.
478         * platform/win/SearchPopupMenuDB.cpp:
479         (WebCore::SearchPopupMenuDB::verifySchemaVersion): Ditto.
480
481 2019-02-15  Philippe Normand  <pnormand@igalia.com>
482
483         [GStreamer] Decoding media-capabilities configuration initial support
484         https://bugs.webkit.org/show_bug.cgi?id=191191
485
486         Reviewed by Xabier Rodriguez-Calvar.
487
488         This patch enables basic platform probing for GStreamer decoders,
489         optionally using Hardware decoding capabilities. The previous code
490         for decoders/demuxers probing partially duplicated between the MSE
491         player and its parent class was moved to a new module called
492         GStreamerRegistryScanner. There is one instance of it for the MSE player
493         and one for the parent class.
494
495         The scanner can check for the presence of the GstElement Hardware
496         metadata classifier in decoders and thus advise the
497         MediaEngineConfigurationFactoryGStreamer that hardware decoding is
498         supported or not. This is only a first step though. The scanner
499         should also probably attempt a NULL->READY transition on decoders
500         to validate specific input caps are supported. As this might
501         require changes in GStreamer, this part of the patch wasn't
502         included.
503
504         This patch is covered by the existing media tests.
505
506         * platform/GStreamer.cmake: New files.
507         * platform/graphics/MediaPlayer.cpp: Add support for converting
508         SupportsType enum to string.
509         (WebCore::convertEnumerationToString):
510         * platform/graphics/MediaPlayer.h: Ditto.
511         * platform/graphics/MediaPlayerEnums.h: Ditto.
512         * platform/graphics/gstreamer/GStreamerCommon.cpp: Move
513         gstRegistryHasElementForMediaType to GStreamerRegistryScanner.
514         * platform/graphics/gstreamer/GStreamerCommon.h: Ditto.
515         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Added.
516         (WebCore::GStreamerRegistryScanner::singleton):
517         (WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): Initialize
518         supported mime-types and codecs from the GStreamer registry.
519         (WebCore::GStreamerRegistryScanner::~GStreamerRegistryScanner): Free the element factories.
520         (WebCore::GStreamerRegistryScanner::gstRegistryHasElementForMediaType):
521         Check the input caps are supported, optionally using hardware
522         device.
523         (WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping):
524         Moved from MediaPlayerPrivateGStreamer{,MSE}.
525         (WebCore::GStreamerRegistryScanner::initialize): Ditto.
526         (WebCore::GStreamerRegistryScanner::supportsCodec const): Ditto.
527         (WebCore::GStreamerRegistryScanner::supportsAllCodecs const): Ditto.
528         (WebCore::GStreamerRegistryScanner::isDecodingSupported const): Check
529         the given configuration is supported. For now hardware support is
530         checked for video configurations only as it is quite uncommon
531         anyway to have hardware-enabled audio decoders.
532         * platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added.
533         (WebCore::GStreamerRegistryScanner::mimeTypeSet):
534         (WebCore::GStreamerRegistryScanner::supportsContainerType const):
535         (WebCore::GStreamerRegistryScanner::RegistryLookupResult::operator bool const):
536         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp: Added.
537         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
538         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h: Added.
539         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
540         Rely on new GStreamerRegistryScanner and add some debugging macros.
541         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
542         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
543         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Ditto. Also
544         plug qtdemux for AAC containers, this is an explicit consequence
545         of finer-grained codecs probing.
546         (WebCore::AppendPipeline::AppendPipeline):
547         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
548         * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.cpp: Added.
549         (WebCore::GStreamerRegistryScannerMSE::singleton):
550         (WebCore::GStreamerRegistryScannerMSE::GStreamerRegistryScannerMSE):
551         * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.h: Added.
552         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
553         Rely on new GStreamerRegistryScanner and add some debugging macros.
554         (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
555         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
556         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
557         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
558         (WebCore::factories): GStreamer support.
559
560 2019-02-14  Joseph Pecoraro  <pecoraro@apple.com>
561
562         Web Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector
563         https://bugs.webkit.org/show_bug.cgi?id=194671
564         <rdar://problem/47628191>
565
566         Reviewed by Devin Rousso.
567
568         * css/CSSStyleSheet.cpp:
569         (WebCore::CSSStyleSheet::item):
570         A crash may happen if the m_childRuleCSSOMWrappers Vector gets out of
571         sync with the m_contents list of rules. In particular if the wrappers
572         vector is shorter than the rule list. We tried exercising code paths
573         that modify these lists but were not able to reproduce the crash.
574         To avoid a crash we can make this access safer and avoid the original
575         overflow. At the same time we will keep and promote the assertion that
576         would catch the lists getting out of sync in debug builds.
577
578 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
579
580         Unreviewed build fix for WinCairo Debug after r241559.
581
582         * platform/network/curl/CurlContext.cpp:
583         (WebCore::CurlContext::CurlContext):
584
585 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
586
587         [WTF] Add environment variable helpers
588         https://bugs.webkit.org/show_bug.cgi?id=192405
589
590         Reviewed by Michael Catanzaro.
591
592         * platform/NotImplemented.h:
593         * platform/cocoa/SystemVersion.mm:
594         (WebCore::createSystemMarketingVersion):
595         * platform/graphics/gstreamer/GStreamerCommon.cpp:
596         (WebCore::initializeGStreamer):
597         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
598         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
599         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
600         (Nicosia::PaintingEngine::create):
601         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
602         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
603         * platform/graphics/x11/PlatformDisplayX11.cpp:
604         (WebCore::PlatformDisplayX11::create):
605         * platform/gtk/RenderThemeWidget.cpp:
606         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
607         * platform/gtk/ScrollbarThemeGtk.cpp:
608         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
609         * platform/network/curl/CurlContext.cpp:
610         (WebCore::CurlContext::CurlContext):
611         (WebCore::EnvironmentVariableReader::read): Deleted.
612         (WebCore::EnvironmentVariableReader::defined): Deleted.
613         (WebCore::EnvironmentVariableReader::readAs): Deleted.
614         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
615         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
616         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
617         * platform/network/curl/NetworkStorageSessionCurl.cpp:
618         (WebCore::defaultCookieJarPath):
619         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
620         (WebCore::getCACertPathEnv):
621         * platform/network/win/CurlSSLHandleWin.cpp:
622         (WebCore::getCACertPathEnv):
623         * platform/text/hyphen/HyphenationLibHyphen.cpp:
624         (WebCore::topLevelPath):
625         (WebCore::webkitBuildDirectory):
626         * platform/unix/LoggingUnix.cpp:
627         (WebCore::logLevelString):
628         * platform/win/LoggingWin.cpp:
629         (WebCore::logLevelString):
630         Utilize WTF::Environment where possible.
631
632 2019-02-14  Chris Dumez  <cdumez@apple.com>
633
634         [PSON] Introduce a WebContent Process cache
635         https://bugs.webkit.org/show_bug.cgi?id=194594
636         <rdar://problem/46793397>
637
638         Reviewed by Geoff Garen.
639
640         Update localizable strings.
641
642         * en.lproj/Localizable.strings:
643
644 2019-02-14  Commit Queue  <commit-queue@webkit.org>
645
646         Unreviewed, rolling out r241486.
647         https://bugs.webkit.org/show_bug.cgi?id=194655
648
649         causing API failures in builds (Requested by ShawnRoberts on
650         #webkit).
651
652         Reverted changeset:
653
654         "[Cocoa] Media elements will restart network buffering just
655         before suspending"
656         https://bugs.webkit.org/show_bug.cgi?id=193691
657         https://trac.webkit.org/changeset/241486
658
659 2019-02-13  Brian Burg  <bburg@apple.com>
660
661         Web Inspector: don't include accessibility role in DOM.Node object payloads
662         https://bugs.webkit.org/show_bug.cgi?id=194623
663         <rdar://problem/36384037>
664
665         Reviewed by Devin Rousso.
666
667         Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
668         Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
669         first place due to a DOM node tree update (i.e., NodeInserted).
670
671         It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
672         the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
673         necessary to collect this information in a problematic way when initially pushing the node, as
674         it will be updated anyway.
675
676         No new tests, no change in behavior.
677
678         * inspector/agents/InspectorDOMAgent.cpp:
679         (WebCore::InspectorDOMAgent::buildObjectForNode):
680
681 2019-02-14  Zalan Bujtas  <zalan@apple.com>
682
683         [LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
684         https://bugs.webkit.org/show_bug.cgi?id=194622
685
686         Reviewed by Antti Koivisto.
687
688         Ensure that block replaced boxes don't collapse through their vertical margins. 
689
690         Test: fast/block/block-only/block-replaced-with-vertical-margins.html
691
692         * layout/blockformatting/BlockMarginCollapse.cpp:
693         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
694         * page/FrameViewLayoutContext.cpp:
695         (WebCore::layoutUsingFormattingContext):
696
697 2019-02-14  Zalan Bujtas  <zalan@apple.com>
698
699         [LFC] Shrink-to-fit-width should be constrained by min/max width
700         https://bugs.webkit.org/show_bug.cgi?id=194653
701
702         Reviewed by Antti Koivisto.
703
704         Use the fixed value of min-width/max-width to constrain the computed preferred width.
705
706         * layout/FormattingContext.h:
707         * layout/FormattingContextGeometry.cpp:
708         (WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth):
709         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
710         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
711         * layout/inlineformatting/InlineFormattingContext.cpp:
712         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
713
714 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
715
716         Crash in DOMTimer::fired
717         https://bugs.webkit.org/show_bug.cgi?id=194638
718
719         Reviewed by Brent Fulgham.
720
721         This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934.
722
723         The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer
724         is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired).
725
726         Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit
727         from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map
728         we would not leak these DOM timers.
729
730         We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the
731         size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier.
732         Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code,
733         and is no longer the preferred approach when dealing with these classes of bugs in WebKit.
734
735         Test: fast/dom/timer-destruction-during-firing.html
736
737         * page/DOMTimer.cpp:
738         (WebCore::NestedTimersMap::add):
739         (WebCore::DOMTimer::install):
740         (WebCore::DOMTimer::fired):
741
742 2019-02-13  Joseph Pecoraro  <pecoraro@apple.com>
743
744         Web Inspector: Crash when inspecting an element that constantly changes visibility
745         https://bugs.webkit.org/show_bug.cgi?id=194632
746         <rdar://problem/48060258>
747
748         Reviewed by Matt Baker and Devin Rousso.
749
750         * inspector/agents/InspectorDOMAgent.h:
751         * inspector/agents/InspectorDOMAgent.cpp:
752         (WebCore::InspectorDOMAgent::processAccessibilityChildren):
753         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
754         Don't use rvalue-references as that was taking ownership and deleting
755         the object we want to keep around. Instead simplify this to just use
756         references so no ref counting changes happen.
757
758 2019-02-13  Chris Fleizach  <cfleizach@apple.com>
759
760         AX: Crash in handleMenuOpen
761         https://bugs.webkit.org/show_bug.cgi?id=194627
762
763         Reviewed by Zalan Bujtas.
764
765         Tests run under libGuardMalloc will cause crashes.
766
767         This list of objects is a Node list, not an Element list, so we were
768         not removing some nodes when they were being deallocated.
769
770         * accessibility/AXObjectCache.cpp:
771         (WebCore::AXObjectCache::remove):
772
773 2019-02-13  Jer Noble  <jer.noble@apple.com>
774
775         [Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized.
776         https://bugs.webkit.org/show_bug.cgi?id=194621
777         <rdar://problem/48002560>
778
779         Reviewed by Eric Carlson.
780
781         When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation
782         change events in the media-controller.js on rAF().
783
784         * Modules/modern-media-controls/media/media-controller.js:
785         (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
786
787 2019-02-13  John Wilander  <wilander@apple.com>
788
789         Ignore Ad Click Attribution where source and destination are same-site
790         https://bugs.webkit.org/show_bug.cgi?id=194620
791         <rdar://problem/47890018>
792
793         Reviewed by Jiewen Tan.
794
795         Updated the existing test.
796
797         We should not accept Ad Click Attribution requests where the site of the
798         anchor tag and its addestination attribute are same-site. Such attributions
799         don’t make sense (the site can track intra-site clicks through better means)
800         and would just lead to increased memory use where are the pending
801         attributions are stored.
802
803         For ports that don't have access to the Public Suffix List, this patch
804         only checks that the hosts don't match, i.e. not just eTLD+1.
805
806         * html/HTMLAnchorElement.cpp:
807         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
808             Now returns WTF::nullopt if the current document and the
809             addestination are same site. Also fixed a console message
810             typo.
811
812 2019-02-13  Eric Carlson  <eric.carlson@apple.com> and Youenn Fablet  <youenn@apple.com>
813
814         getUserMedia with an ideal deviceId constraint doesn't always select the correct device
815         https://bugs.webkit.org/show_bug.cgi?id=193614
816
817         Reviewed by Eric Carlson.
818
819         Compute a fitness score based on constraints.
820         For each constraint, a fitness score is computed from the distance.
821         The smaller the distance, the higher the score.
822         Fitness scores are then summed to give a device fitness score.
823         Matching devices are then sorted according the fitness score.
824
825         For important constraints, deviceId and facingMode, add a more important weight.
826         This ensures that should any of these ideal constraints are set, they will be respected.
827
828         Restrict our automatic setting of default constraints to not add a default ideal facingMode in case of existing deviceId constraint.
829         Do not set a default ideal frameRate if width and height are already set.
830
831         Covered by updated test.
832
833         * platform/mediastream/MediaConstraints.cpp:
834         (WebCore::FlattenedConstraint::set):
835         (WebCore::MediaConstraints::setDefaultVideoConstraints):
836         * platform/mediastream/RealtimeMediaSource.cpp:
837         (WebCore::RealtimeMediaSource::fitnessDistance):
838         (WebCore::RealtimeMediaSource::selectSettings):
839         (WebCore::RealtimeMediaSource::supportsConstraints):
840         (WebCore::RealtimeMediaSource::applyConstraints):
841         * platform/mediastream/RealtimeMediaSource.h:
842         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
843         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
844
845 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
846
847         [iOS] Add a hack to work around buggy video control library
848         https://bugs.webkit.org/show_bug.cgi?id=194615
849         <rdar://problem/46146946>
850
851         Reviewed by Jer Noble.
852
853         Test: media/ios/video-volume-ios-quirk.html
854
855         * html/HTMLMediaElement.cpp:
856         (WebCore::HTMLMediaElement::setVolume): Change m_volume for one turn of the runloop.
857         (WebCore::HTMLMediaElement::cancelPendingTasks): Clear the task queue used to restore m_volume.
858         (WebCore::HTMLMediaElement::closeTaskQueues): Close it.
859         * html/HTMLMediaElement.h:
860
861 2019-02-13  Jer Noble  <jer.noble@apple.com>
862
863         [Cocoa] Media elements will restart network buffering just before suspending
864         https://bugs.webkit.org/show_bug.cgi?id=193691
865
866         Reviewed by Eric Carlson.
867
868         API Test: WebKit.ProcessSuspendMediaBuffering
869
870         Allow the Page to suspend all media buffering in its child Documents.
871
872         * dom/Document.cpp:
873         (WebCore::Document::suspendAllMediaBuffering):
874         (WebCore::Document::resumeAllMediaBuffering):
875         * dom/Document.h:
876         * html/MediaElementSession.cpp:
877         (WebCore::MediaElementSession::dataBufferingPermitted const):
878         (WebCore::MediaElementSession::suspendBuffering):
879         (WebCore::MediaElementSession::resumeBuffering):
880         (WebCore::MediaElementSession::bufferingSuspended const):
881         * html/MediaElementSession.h:
882         * page/Page.cpp:
883         (WebCore::Page::suspendAllMediaBuffering):
884         (WebCore::Page::resumeAllMediaBuffering):
885         * page/Page.h:
886         (WebCore::Page::mediaPlaybackIsSuspended const):
887         (WebCore::Page::mediaBufferingIsSuspended const):
888         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
889         * platform/audio/PlatformMediaSession.h:
890         (WebCore::PlatformMediaSession::suspendBuffering):
891         (WebCore::PlatformMediaSession::resumeBuffering):
892         * platform/audio/PlatformMediaSessionManager.cpp:
893         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
894         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
895         * platform/audio/PlatformMediaSessionManager.h:
896
897 2019-02-13  Jer Noble  <jer.noble@apple.com>
898
899         Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root
900         https://bugs.webkit.org/show_bug.cgi?id=194516
901         <rdar://problem/44678353>
902
903         Reviewed by Antoine Quint.
904
905         Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html
906
907         When walking up the element ancestor chain, use parentElementInComposedTree() to
908         walk past the shadow root boundary.
909
910         * dom/Element.cpp:
911         (WebCore::parentCrossingFrameBoundaries):
912
913 2019-02-13  Chris Dumez  <cdumez@apple.com>
914
915         Unreviewed, update localizable strings.
916
917         * en.lproj/Localizable.strings:
918
919 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
920
921         Further restricting webarchive loads
922         https://bugs.webkit.org/show_bug.cgi?id=194567
923         <rdar://problem/47610130>
924
925         Reviewed by Youenn Fablet.
926
927         This patch futher restricts main frame webarchive loads to the followings:
928         1) loaded by clients;
929         2) loaded by drag;
930         3) reloaded from any of the previous two.
931
932         It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document
933         to FrameLoader such that the option is remembered during redirections.
934
935         Covered by API tests.
936
937         * dom/Document.h:
938         (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted.
939         (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted.
940         * loader/DocumentLoader.cpp:
941         (WebCore::DocumentLoader::disallowWebArchive const):
942         * loader/DocumentLoader.h:
943         (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame):
944         (WebCore::DocumentLoader::allowsWebArchiveForMainFrame):
945         * loader/FrameLoadRequest.h:
946         (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput):
947         (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput):
948         * loader/FrameLoader.cpp:
949         (WebCore::FrameLoader::load):
950         (WebCore::FrameLoader::reload):
951         * loader/FrameLoader.h:
952         (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive):
953         (WebCore::FrameLoader::alwaysAllowLocalWebarchive const):
954         * page/DragController.cpp:
955         (WebCore::DragController::performDragOperation):
956         * testing/Internals.cpp:
957         (WebCore::Internals::setAlwaysAllowLocalWebarchive const):
958         * testing/Internals.h:
959         * testing/Internals.idl:
960
961 2019-02-13  Jer Noble  <jer.noble@apple.com>
962
963         Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged()
964         https://bugs.webkit.org/show_bug.cgi?id=194613
965         <rdar://problem/48023912>
966
967         Reviewed by Eric Carlson.
968
969         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
970         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
971
972 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
973
974         Unreviewed, fix unused variable warnings after r241148/r241251
975         https://bugs.webkit.org/show_bug.cgi?id=194348
976         <rdar://problem/47566449>
977
978         * Modules/mediasource/SourceBuffer.cpp:
979         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
980         (WebCore::SourceBuffer::evictCodedFrames):
981         (WebCore::SourceBuffer::provideMediaData):
982
983 2019-02-13  Sihui Liu  <sihui_liu@apple.com>
984
985         REGRESSION: [ Mac Debug WK2 ] Layout Test storage/indexeddb/key-type-infinity-private.html is a flaky crash
986         https://bugs.webkit.org/show_bug.cgi?id=194413
987         <rdar://problem/47897254>
988
989         Reviewed by Brady Eidson.
990
991         IDB clients expected transaction operations to be executed in order, but in 
992         UniqueIDBDatabase::immediateCloseForUserDelete, callbacks in callback map were errored out randomly.
993         This patch added a callback queue to UniqueIDBDatabase to make sure callbacks will be called in the same order
994         as IDB Server receives the request.
995
996         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
997         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
998         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
999         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
1000         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
1001         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
1002         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
1003         (WebCore::IDBServer::UniqueIDBDatabase::performCountCallback):
1004         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
1005         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1006
1007 2019-02-13  John Wilander  <wilander@apple.com>
1008
1009         Store Ad Click Attribution requests in the network process
1010         https://bugs.webkit.org/show_bug.cgi?id=194510
1011         <rdar://problem/47650118>
1012
1013         Reviewed by Alex Christensen and Daniel Bates.
1014
1015         Test: http/tests/adClickAttribution/store-ad-click-attribution.html
1016
1017         This patch adds support functions for validation and storage of
1018         WebCore::AdClickAttribution objects. It also adds WTF::HashTraits so that
1019         WebCore::AdClickAttribution::Source and WebCore::AdClickAttribution::Destination
1020         can be used in a HashMap.
1021
1022         * loader/AdClickAttribution.cpp:
1023         (WebCore::AdClickAttribution::toString const):
1024         * loader/AdClickAttribution.h:
1025         (WebCore::AdClickAttribution::Source::operator== const):
1026         (WebCore::AdClickAttribution::Source::deletedValue):
1027         (WebCore::AdClickAttribution::Source::constructDeletedValue):
1028         (WebCore::AdClickAttribution::Source::deleteValue):
1029         (WebCore::AdClickAttribution::Source::isDeletedValue const):
1030         (WebCore::AdClickAttribution::SourceHash::hash):
1031         (WebCore::AdClickAttribution::SourceHash::equal):
1032         (WebCore::AdClickAttribution::Destination::operator== const):
1033         (WebCore::AdClickAttribution::Destination::matches const):
1034             This convenience function allows matching of a WTF::URL object.
1035         (WebCore::AdClickAttribution::Destination::deletedValue):
1036         (WebCore::AdClickAttribution::Destination::constructDeletedValue):
1037         (WebCore::AdClickAttribution::Destination::deleteValue):
1038         (WebCore::AdClickAttribution::Destination::isDeletedValue const):
1039         (WebCore::AdClickAttribution::DestinationHash::hash):
1040         (WebCore::AdClickAttribution::DestinationHash::equal):
1041         (WebCore::AdClickAttribution::source const):
1042         (WebCore::AdClickAttribution::destination const):
1043             Getters added to support mapped storage based on source and destination.
1044         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::emptyValue):
1045         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::constructDeletedValue):
1046         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::isDeletedValue):
1047         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::emptyValue):
1048         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::constructDeletedValue):
1049         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::isDeletedValue):
1050         * loader/NavigationAction.h:
1051         (WebCore::NavigationAction::adClickAttribution const):
1052         (WebCore::NavigationAction::adClickAttribution): Deleted.
1053             Corrected the constness of this function.
1054
1055 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
1056
1057         Revert r240434
1058         https://bugs.webkit.org/show_bug.cgi?id=194600
1059         <rdar://problem/48044566>
1060
1061         Reviewed by Brent Fulgham.
1062
1063         * html/HTMLMediaElement.cpp:
1064         (WebCore::HTMLMediaElement::setVolume):
1065         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
1066         (WebCore::HTMLMediaElement::updateVolume):
1067         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1068         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
1069
1070 2019-02-13  Alex Christensen  <achristensen@webkit.org>
1071
1072         Stop using setDefersLoading from WebCore
1073         https://bugs.webkit.org/show_bug.cgi?id=194315
1074
1075         Reviewed by Jer Noble.
1076
1077         That is what CompletionHandlers are for.
1078
1079         * loader/MediaResourceLoader.cpp:
1080         (WebCore::MediaResource::responseReceived):
1081         (WebCore::MediaResource::setDefersLoading): Deleted.
1082         * loader/MediaResourceLoader.h:
1083         * platform/graphics/PlatformMediaResourceLoader.h:
1084         (WebCore::PlatformMediaResourceClient::responseReceived):
1085         (WebCore::PlatformMediaResource::stop):
1086         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
1087         * platform/network/cocoa/WebCoreNSURLSession.mm:
1088         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1089         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
1090         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
1091         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
1092
1093 2019-02-13  Jer Noble  <jer.noble@apple.com>
1094
1095         [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
1096         https://bugs.webkit.org/show_bug.cgi?id=194580
1097         <rdar://problem/42727739>
1098
1099         Reviewed by Eric Carlson.
1100
1101         * platform/cocoa/CoreVideoSoftLink.cpp:
1102         * platform/cocoa/CoreVideoSoftLink.h:
1103         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1104         (WebCore::CVPixelBufferGetBytePointerCallback):
1105         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
1106
1107 2019-02-13  Antoine Quint  <graouts@apple.com>
1108
1109         Support simulated mouse events on iOS based on a PlatformTouchEvent
1110         https://bugs.webkit.org/show_bug.cgi?id=194501
1111         <rdar://problem/46910790>
1112
1113         Reviewed by Dean Jackson.
1114
1115         Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and
1116         whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate
1117         that, we allow for a MouseEvent to be created, much like a PointerEvent, based on a PlatformTouchEvent. Then, we set a flag on Event within
1118         EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched.
1119         Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on.
1120
1121         Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html
1122
1123         * SourcesCocoa.txt:
1124         * WebCore.xcodeproj/project.pbxproj:
1125         * dom/Event.cpp:
1126         * dom/Event.h:
1127         (WebCore::Event::hasEncounteredListener const):
1128         (WebCore::Event::setHasEncounteredListener):
1129         * dom/EventNames.h:
1130         (WebCore::EventNames::isTouchRelatedEventType const):
1131         (WebCore::EventNames::touchRelatedEventNames const):
1132         (WebCore::EventNames::extendedTouchRelatedEventNames const):
1133         (WebCore::EventNames::isTouchEventType const): Deleted.
1134         (WebCore::EventNames::touchAndPointerEventNames const): Deleted.
1135         * dom/EventTarget.cpp:
1136         (WebCore::EventTarget::innerInvokeEventListeners):
1137         * dom/MouseEvent.h:
1138         * dom/Node.cpp:
1139         (WebCore::Node::moveNodeToNewDocument):
1140         (WebCore::tryAddEventListener):
1141         (WebCore::tryRemoveEventListener):
1142         (WebCore::Node::defaultEventHandler):
1143         * dom/ios/MouseEventIOS.cpp: Added.
1144         (WebCore::mouseEventType):
1145         (WebCore::MouseEvent::create):
1146         * dom/ios/PointerEventIOS.cpp:
1147         (WebCore::pointerEventType):
1148         (WebCore::PointerEvent::create):
1149         (WebCore::eventType): Deleted.
1150         * page/DOMWindow.cpp:
1151         (WebCore::DOMWindow::addEventListener):
1152         (WebCore::DOMWindow::removeEventListener):
1153         * page/EventHandler.h:
1154         * page/RuntimeEnabledFeatures.h:
1155         (WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const):
1156         (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
1157         (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const):
1158         (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled):
1159
1160 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1161
1162         [FreeType] Unable to render some Hebrew characters
1163         https://bugs.webkit.org/show_bug.cgi?id=194498
1164
1165         Reviewed by Michael Catanzaro.
1166
1167         We are failing to find a font for some of the combining character sequences because normalization is failing due
1168         to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so
1169         we should handle that case to resize the output buffer and try again.
1170
1171         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1172         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
1173
1174 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
1175
1176         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
1177         https://bugs.webkit.org/show_bug.cgi?id=194582
1178
1179         Reviewed by Antti Koivisto.
1180
1181         Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
1182         from the non-generated identifier being sent to us as it was the case in this failure.
1183
1184         * loader/PolicyChecker.cpp:
1185         (WebCore::PolicyCheckIdentifier::isValidFor):
1186
1187 2019-02-13  Commit Queue  <commit-queue@webkit.org>
1188
1189         Unreviewed, rolling out r241273.
1190         https://bugs.webkit.org/show_bug.cgi?id=194579
1191
1192         This change is causing a flaky assertion failure crash in High
1193         Sierra Debug (Requested by ShawnRoberts on #webkit).
1194
1195         Reverted changeset:
1196
1197         "Stop using setDefersLoading from WebCore"
1198         https://bugs.webkit.org/show_bug.cgi?id=194315
1199         https://trac.webkit.org/changeset/241273
1200
1201 2019-02-12  Mark Lam  <mark.lam@apple.com>
1202
1203         Remove unnecessary null check in bindings.
1204         https://bugs.webkit.org/show_bug.cgi?id=194581
1205
1206         Reviewed by Yusuke Suzuki.
1207
1208         It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
1209         It will just return false.  Since we don't expect the root pointer to be null in
1210         the common case, having a null check here is also not optimal.  We'll remove this
1211         unneeded null check.
1212
1213         * bindings/scripts/CodeGeneratorJS.pm:
1214         (GenerateImplementation):
1215         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1216         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
1217
1218 2019-02-12  Rob Buis  <rbuis@igalia.com>
1219
1220         Align with Fetch on data: URLs
1221         https://bugs.webkit.org/show_bug.cgi?id=182325
1222
1223         Reviewed by Alex Christensen.
1224
1225         The MIME type part of the data url should be serialized as
1226         specified in step 3 under "data" [1].
1227
1228         Test: web-platform-tests/fetch/data-urls/processing.any.js
1229
1230         [1] https://fetch.spec.whatwg.org/#concept-scheme-fetch 
1231
1232         * platform/network/DataURLDecoder.cpp:
1233         (WebCore::DataURLDecoder::parseMediaType):
1234
1235 2019-02-12  Alex Christensen  <achristensen@webkit.org>
1236
1237         Build fix after r241320
1238         https://bugs.webkit.org/show_bug.cgi?id=194271
1239
1240         * page/Frame.cpp:
1241         (WebCore::Frame::requestDOMPasteAccess):
1242
1243 2019-02-12  Justin Fan  <justin_fan@apple.com>
1244
1245         [WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
1246         https://bugs.webkit.org/show_bug.cgi?id=194552
1247
1248         Reviewed by Dean Jackson.
1249
1250         WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
1251         Consolidate the two versions of these classes in our implementation.
1252
1253         Affected layout tests updated with new names. No change in behavior.
1254
1255         * CMakeLists.txt:
1256         * DerivedSources-input.xcfilelist:
1257         * DerivedSources-output.xcfilelist:
1258         * DerivedSources.make:
1259         * Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
1260         * Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
1261         * Modules/webgpu/WebGPUBufferUsage.h: Removed.
1262         * Modules/webgpu/WebGPUDevice.cpp:
1263         (WebCore::WebGPUDevice::createBuffer const):
1264         * Modules/webgpu/WebGPUDevice.h:
1265         * Modules/webgpu/WebGPUDevice.idl:
1266         * Sources.txt:
1267         * WebCore.xcodeproj/project.pbxproj:
1268         * bindings/js/WebCoreBuiltinNames.h:
1269         * platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
1270         * platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.
1271
1272 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1273
1274         Unreviewed, try to fix the internal iOS build after r241321
1275
1276         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1277
1278 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1279
1280         Allow pages to trigger programmatic paste from script on iOS
1281         https://bugs.webkit.org/show_bug.cgi?id=194271
1282         <rdar://problem/47808810>
1283
1284         Reviewed by Tim Horton.
1285
1286         Tests: editing/pasteboard/ios/dom-paste-confirmation.html
1287                editing/pasteboard/ios/dom-paste-consecutive-confirmations.html
1288                editing/pasteboard/ios/dom-paste-rejection.html
1289                editing/pasteboard/ios/dom-paste-requires-user-gesture.html
1290
1291         * dom/UserGestureIndicator.cpp:
1292         (WebCore::UserGestureIndicator::~UserGestureIndicator):
1293
1294         Reset a gesture token's DOM paste access when exiting the scope of a user gesture. This prevents DOM paste
1295         access permissions from leaking into `setTimeout()` callbacks when we forward user gesture tokens.
1296
1297         * dom/UserGestureIndicator.h:
1298         (WebCore::UserGestureToken::resetDOMPasteAccess):
1299
1300 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
1301
1302         AX: IsolatedTree: Implement more attributes
1303         https://bugs.webkit.org/show_bug.cgi?id=193911
1304         <rdar://problem/47599217>
1305
1306         Reviewed by Daniel Bates.
1307
1308         Make use of new HIServices SPI to use a secondary AX thread.
1309         Store root node/focused node status in IsolatedTree rather than on the element.
1310         Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description.
1311         Implement hit-testing using relative-frames.
1312         Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to.
1313
1314         * SourcesCocoa.txt:
1315         * WebCore.xcodeproj/project.pbxproj:
1316         * accessibility/AXObjectCache.cpp:
1317         (WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
1318         * accessibility/AXObjectCache.h:
1319         (WebCore::AXObjectCache::focusedUIElementForPage):
1320         * accessibility/AccessibilityAttachment.cpp:
1321         (WebCore::AccessibilityAttachment::accessibilityText const):
1322         (WebCore::AccessibilityAttachment::accessibilityText): Deleted.
1323         * accessibility/AccessibilityAttachment.h:
1324         * accessibility/AccessibilityImageMapLink.cpp:
1325         (WebCore::AccessibilityImageMapLink::accessibilityText const):
1326         (WebCore::AccessibilityImageMapLink::accessibilityText): Deleted.
1327         * accessibility/AccessibilityImageMapLink.h:
1328         * accessibility/AccessibilityMediaControls.cpp:
1329         (WebCore::AccessibilityMediaControl::accessibilityText const):
1330         (WebCore::AccessibilityMediaControl::accessibilityText): Deleted.
1331         * accessibility/AccessibilityMediaControls.h:
1332         * accessibility/AccessibilityNodeObject.cpp:
1333         (WebCore::AccessibilityNodeObject::accessibilityText const):
1334         (WebCore::AccessibilityNodeObject::accessibilityText): Deleted.
1335         * accessibility/AccessibilityNodeObject.h:
1336         * accessibility/AccessibilityObject.cpp:
1337         (WebCore::AccessibilityObject::convertFrameToSpace const):
1338         (WebCore::AccessibilityObject::relativeFrame const):
1339         (WebCore::AccessibilityObject::elementAccessibilityHitTest const):
1340         (WebCore::AccessibilityObject::focusedUIElement const):
1341         * accessibility/AccessibilityObject.h:
1342         (WebCore::AccessibilityObject::accessibilityText const):
1343         (WebCore::AccessibilityObject::isLink const): Deleted.
1344         (WebCore::AccessibilityObject::isImage const): Deleted.
1345         (WebCore::AccessibilityObject::isAttachment const): Deleted.
1346         (WebCore::AccessibilityObject::isFileUploadButton const): Deleted.
1347         (WebCore::AccessibilityObject::isImageMapLink const): Deleted.
1348         (WebCore::AccessibilityObject::isMediaControlLabel const): Deleted.
1349         (WebCore::AccessibilityObject::isTree const): Deleted.
1350         (WebCore::AccessibilityObject::isTreeItem const): Deleted.
1351         (WebCore::AccessibilityObject::isScrollbar const): Deleted.
1352         (WebCore::AccessibilityObject::accessibilityHitTest const): Deleted.
1353         (WebCore::AccessibilityObject::accessibilityText): Deleted.
1354         (WebCore::AccessibilityObject::roleValue const): Deleted.
1355         (WebCore::AccessibilityObject::wrapper const): Deleted.
1356         * accessibility/AccessibilityObjectInterface.h: Replaced.
1357         * accessibility/AccessibilityRenderObject.cpp:
1358         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
1359         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const):
1360         (WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const):
1361         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
1362         (WebCore::AccessibilityRenderObject::selectedChildren):
1363         * accessibility/AccessibilityRenderObject.h:
1364         * accessibility/AccessibilitySVGElement.cpp:
1365         (WebCore::AccessibilitySVGElement::accessibilityText const):
1366         (WebCore::AccessibilitySVGElement::accessibilityText): Deleted.
1367         * accessibility/AccessibilitySVGElement.h:
1368         * accessibility/AccessibilityScrollView.cpp:
1369         (WebCore::AccessibilityScrollView::accessibilityHitTest const):
1370         * accessibility/AccessibilityScrollView.h:
1371         * accessibility/ios/AccessibilityObjectIOS.mm:
1372         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
1373         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1374         (-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted.
1375         * accessibility/isolatedtree: Replaced.
1376         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
1377         (WebCore::AXIsolatedTree::treePageCache):
1378         (WebCore::AXIsolatedTree::AXIsolatedTree):
1379         (WebCore::AXIsolatedTree::nodeInTreeForID):
1380         (WebCore::AXIsolatedTree::nodeForID const):
1381         (WebCore::AXIsolatedTree::focusedUIElement):
1382         (WebCore::AXIsolatedTree::setRootNodeID):
1383         (WebCore::AXIsolatedTree::setFocusedNodeID):
1384         (WebCore::AXIsolatedTree::setInitialRequestInProgress):
1385         (WebCore::AXIsolatedTree::applyPendingChanges):
1386         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
1387         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
1388         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
1389         (WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode):
1390         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
1391         (WebCore::AXIsolatedTreeNode::setProperty):
1392         (WebCore::AXIsolatedTreeNode::setParent):
1393         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
1394         (WebCore::AXIsolatedTreeNode::focusedUIElement const):
1395         (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const):
1396         (WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
1397         (WebCore::AXIsolatedTreeNode::tree const):
1398         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
1399         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
1400         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
1401         * accessibility/mac/AXObjectCacheMac.mm:
1402         (WebCore::AXObjectCache::associateIsolatedTreeNode):
1403         * accessibility/mac/AccessibilityObjectBase.mm: Added.
1404         (WebCore::AccessibilityObject::speechHintAttributeValue const):
1405         (WebCore::AccessibilityObject::descriptionAttributeValue const):
1406         (WebCore::AccessibilityObject::titleAttributeValue const):
1407         (WebCore::AccessibilityObject::helpTextAttributeValue const):
1408         * accessibility/mac/AccessibilityObjectMac.mm:
1409         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
1410         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1411         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1412         (addChildToArray):
1413         (convertToNSArray):
1414         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
1415         (-[WebAccessibilityObjectWrapperBase detach]):
1416         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1417         (-[WebAccessibilityObjectWrapperBase accessibilityObject]):
1418         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
1419         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
1420         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
1421         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
1422         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
1423         (convertPathToScreenSpaceFunction):
1424         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
1425         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
1426         (-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted.
1427         (-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted.
1428         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1429         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
1430         (-[WebAccessibilityObjectWrapper childrenVectorSize]):
1431         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
1432         (-[WebAccessibilityObjectWrapper position]):
1433         (-[WebAccessibilityObjectWrapper subrole]):
1434         (-[WebAccessibilityObjectWrapper roleDescription]):
1435         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1436         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
1437         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
1438         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
1439         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
1440         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
1441
1442 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1443
1444         Allow pages to trigger programmatic paste from script on iOS
1445         https://bugs.webkit.org/show_bug.cgi?id=194271
1446         <rdar://problem/47808810>
1447
1448         Reviewed by Ryosuke Niwa.
1449
1450         Add support for allowing script to trigger programmatic paste commands. Currently on macOS and iOS, the ability
1451         to trigger programmatic paste (i.e. `document.execCommand('Paste');`) is disabled by default, such that
1452         execCommand is simply a no-op that returns false. This policy is a privacy measure (common among other major
1453         browsers) that prevents untrusted web content from sniffing content from the system pasteboard (even on user
1454         interaction, since unintended user interaction occasionally happens as well!).
1455
1456         In order to make it possible for web pages to programmatically paste without opening the door to privacy and
1457         security issues, we make paste commands triggered from bindings present platform UI on iOS, in the form of a
1458         callout bar with the single option to paste. This UI is dismissed upon any user interaction; furthermore, any
1459         user interaction short of explicitly triggering the "Paste" action subsequently prevents the page from executing
1460         the paste (and causes execCommand to return false). However, if the paste action is chosen by the user, we
1461         instead follow through with the programmatic paste command.
1462
1463         New tests to come in a followup patch.
1464
1465         * WebCore.xcodeproj/project.pbxproj:
1466         * dom/DOMPasteAccessPolicy.h: Added.
1467         * dom/UserGestureIndicator.h:
1468         (WebCore::UserGestureToken::domPasteAccessPolicy const):
1469         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
1470
1471         Add helpers on UserGestureToken to update and query the current DOM paste access policy. The access policies are
1472         "NotRequestedYet" (i.e. pending a response from the user), "Granted" (the user has granted DOM paste access to
1473         the page), or "Denied" (the user has prevented the page from reading the contents of the clipboard). When DOM
1474         paste access is granted or rejected, make this decision sticky until the end of the current user gesture.
1475
1476         * editing/EditorCommand.cpp:
1477         (WebCore::executePaste):
1478         (WebCore::executePasteAndMatchStyle):
1479         (WebCore::executePasteAsPlainText):
1480         (WebCore::executePasteAsQuotation):
1481
1482         When executing a paste command where the source is DOM bindings, request DOM paste if needed before proceeding
1483         with the paste.
1484
1485         (WebCore::supportedPaste):
1486         * loader/EmptyClients.cpp:
1487         * page/EditorClient.h:
1488         * page/Frame.cpp:
1489         (WebCore::Frame::requestDOMPasteAccess):
1490
1491         Add a helper method that requests access to the clipboard on behalf of script when pasting.
1492
1493         * page/Frame.h:
1494         * page/Settings.yaml:
1495
1496         Introduce a new WebCore setting, used to gate DOM paste access requests.
1497
1498 2019-02-12  Alex Christensen  <achristensen@webkit.org>
1499
1500         Remove setDefersLoading infrastructure from WebKit2
1501         https://bugs.webkit.org/show_bug.cgi?id=194506
1502
1503         Reviewed by Brady Eidson.
1504
1505         setDefersLoading is inherently racy from WebCore to the NetworkProcess,
1506         it adds unwanted complexity to the initialization and use of network objects,
1507         and it has led to many unrecoverable hang bugs over the years.
1508         We needed to force it into WebKit2 to transition some existing clients who relied on it,
1509         but we have recently finished transitioning those clients to other solutions, mostly
1510         completion handlers.
1511
1512         * inspector/PageScriptDebugServer.cpp:
1513         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
1514
1515 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1516
1517         Unreviewed, fix build warnings after content extensions enablement
1518         https://bugs.webkit.org/show_bug.cgi?id=193622
1519         <rdar://problem/47982850>
1520
1521         * contentextensions/DFABytecode.h:
1522         (WebCore::ContentExtensions::instructionSizeWithArguments):
1523         * contentextensions/DFABytecodeCompiler.h:
1524         * contentextensions/URLFilterParser.cpp:
1525         (WebCore::ContentExtensions::URLFilterParser::statusString):
1526
1527 2019-02-12  Justin Fan  <justin_fan@apple.com>
1528
1529         [Web GPU] DepthStencilAttachment implementation
1530         https://bugs.webkit.org/show_bug.cgi?id=194458
1531         <rdar://problem/47932446>
1532
1533         Reviewed by Dean Jackson.
1534
1535         Implement ability to provide a depth attachment to the render pass encoder. Also implement
1536         GPULoad/StoreOp and update color attachments' implementation for full functionality.
1537
1538         Test: webgpu/depth-enabled-triangle-strip.html
1539
1540         Update project files for new symbols:
1541         * CMakeLists.txt:
1542         * DerivedSources-input.xcfilelist:
1543         * DerivedSources-output.xcfilelist:
1544         * DerivedSources.make:
1545         * Sources.txt:
1546         * WebCore.xcodeproj/project.pbxproj:
1547
1548         * Modules/webgpu/GPUColor.idl: Renamed from WebGPUColor.idl
1549         * Modules/webgpu/GPULoadOp.idl: Added. Interface for attachment operation enum.
1550         * Modules/webgpu/GPUStoreOp.idl: Ditto.
1551         * Modules/webpug/WebGPUColor.h: Removed.
1552         * Modules/webgpu/WebGPUCommandBuffer.cpp: Refactored descriptor validation logic out of this file.
1553         (WebCore::WebGPUCommandBuffer::beginRenderPass):
1554         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Added. Now owns code for validating descriptors.
1555         (WebCore::WebGPURenderPassDescriptor::validateAndConvertToGPUVersion const):
1556         * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h/idl: Removed. Code moved into WebGPURenderPassDescriptor.
1557         * Modules/webgpu/WebGPURenderPassDescriptor.h: Move sub-descriptor definitions into this file.
1558         * Modules/webgpu/WebGPURenderPassDescriptor.idl: Ditto.
1559         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Make depthStencilState optional to match API update.
1560         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
1561         * Modules/webgpu/WebGPUTextureView.h:
1562         * platform/graphics/gpu/GPULoadOp.h: Added.
1563         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Removed (moved into GPURenderPassDescriptor).
1564         * platform/graphics/gpu/GPURenderPassDescriptor.h: Mirror WebGPU* changes.
1565         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Make depthStencilState optional.
1566         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
1567         * platform/graphics/gpu/GPUStoreOp.h: Added.
1568         * platform/graphics/gpu/GPUTexture.h:
1569         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1570         (WebCore::loadActionForGPULoadOp): Added.
1571         (WebCore::storeActionForGPUStoreOp): Added.
1572         (WebCore::populateMtlColorAttachmentsArray): Added. Create all expected color attachments, rather than just the first.
1573         (WebCore::populateMtlDepthStencilAttachment): Added.
1574         (WebCore::GPURenderPassEncoder::create):
1575         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Make depthStencilState optional.
1576         (WebCore::GPURenderPipeline::create):
1577
1578 2019-02-12  David Kilzer  <ddkilzer@apple.com>
1579
1580         REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
1581         <https://webkit.org/b/194529>
1582         <rdar://problem/47924449>
1583
1584         Reviewed by Eric Carlson.
1585
1586         * SourcesCocoa.txt:
1587         - Do not include DataDetectorsCoreSoftLink.mm in unified
1588           sources.
1589         * WebCore.xcodeproj/project.pbxproj:
1590         - Add DataDetectorsCoreSoftLink.mm to the WebCore target now
1591           that it isn't part of the unifed sources.
1592         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
1593         - Switch from using SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL() to
1594           SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE() when linking
1595           DataDetectorsCore.framework. None of the other macros assume
1596           this framework is optional, and it was likely made optional
1597           originally because the framework was new to iOS and thus
1598           didn't exist on older versions.
1599         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1600         - Change use of SOFT_LINK_CLASS_FOR_SOURCE() macros to
1601           SOFT_LINK_CLASS() since the latter can only be used with
1602           SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation).  This broke after
1603           the fix for <wtf/SoftLinking.h> was applied.
1604
1605 2019-02-12  Youenn Fablet  <youenn@apple.com>
1606
1607         Make use of is<SubresourceLoader>
1608         https://bugs.webkit.org/show_bug.cgi?id=194541
1609
1610         Reviewed by Alex Christensen.
1611
1612         No change of behavior.
1613
1614         * inspector/agents/InspectorNetworkAgent.cpp:
1615         (WebCore::InspectorNetworkAgent::didReceiveResponse):
1616         * loader/SubresourceLoader.h:
1617         (isType):
1618
1619 2019-02-12  Mark Lam  <mark.lam@apple.com>
1620
1621         Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
1622         https://bugs.webkit.org/show_bug.cgi?id=194530
1623         <rdar://problem/47973274>
1624
1625         Reviewed by Chris Dumez.
1626
1627         This is needed to fix a null pointer dereference that arises from the following scenario:
1628         1. a Document detaches from its StyleSheetList.
1629         2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
1630            to be scanned and collected by the GC.
1631         3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
1632            discovers a null owner pointer.
1633
1634         This patch fixes this issue by applying the following null checks:
1635
1636         1. Add a null check in JSNodeCustom.h's root().
1637
1638            root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
1639            isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
1640            to root().  However, depending on which class the ownerNode() method belongs to,
1641            it can either return a pointer or a reference.  The null check only makes sense
1642            in the pointer case.
1643
1644            To accommodate the 2 forms, root() itself is has an overload that takes a
1645            reference instead of a pointer.
1646
1647            Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
1648            returns, it can't discern when the result is a pointer and apply the null check.
1649            Instead, we just add the null check to the version of root() that takes a
1650            pointer.  If the node pointer is null, we'll return a null opaque root.
1651
1652         2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.
1653
1654         * bindings/js/JSNodeCustom.h:
1655         (WebCore::root):
1656         * bindings/scripts/CodeGeneratorJS.pm:
1657         (GenerateImplementation):
1658         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1659         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
1660
1661 2019-02-12  Andy Estes  <aestes@apple.com>
1662
1663         [iOSMac] Enable Parental Controls Content Filtering
1664         https://bugs.webkit.org/show_bug.cgi?id=194521
1665         <rdar://39732376>
1666
1667         Reviewed by Tim Horton.
1668
1669         * Configurations/FeatureDefines.xcconfig:
1670         * platform/ContentFilterUnblockHandler.h:
1671         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1672         * platform/cocoa/ParentalControlsContentFilter.mm:
1673
1674 2019-02-11  Jer Noble  <jer.noble@apple.com>
1675
1676         Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.
1677
1678         * platform/audio/ios/MediaSessionManagerIOS.h:
1679         * platform/audio/ios/MediaSessionManagerIOS.mm:
1680         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
1681
1682 2019-02-12  Antti Koivisto  <antti@apple.com>
1683
1684         Crash in WebCore::ScrollingTree::updateTreeFromStateNode
1685         https://bugs.webkit.org/show_bug.cgi?id=194538
1686         <rdar://problem/47841926>
1687
1688         Reviewed by Zalan Bujtas.
1689
1690         * page/scrolling/ScrollingTree.cpp:
1691         (WebCore::ScrollingTree::updateTreeFromStateNode):
1692
1693         Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.
1694
1695 2019-02-12  Zalan Bujtas  <zalan@apple.com>
1696
1697         [LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
1698         https://bugs.webkit.org/show_bug.cgi?id=194540
1699
1700         Reviewed by Antti Koivisto.
1701
1702         Use FormattingContext::computeBorderAndPadding instead.
1703
1704         * layout/FormattingContext.cpp:
1705         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1706         * layout/FormattingContext.h:
1707         * layout/inlineformatting/InlineFormattingContext.cpp:
1708         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
1709         * layout/inlineformatting/InlineFormattingContext.h:
1710
1711 2019-02-12  Zalan Bujtas  <zalan@apple.com>
1712
1713         [LFC][IFC] Add intrinsic width support for float boxes.
1714         https://bugs.webkit.org/show_bug.cgi?id=194528
1715
1716         Reviewed by Antti Koivisto.
1717
1718         This patch implements a very simple float box support for intrinsic width.
1719
1720         * layout/inlineformatting/InlineFormattingContext.cpp:
1721         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1722         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
1723         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
1724         (WebCore::Layout::InlineFormattingContext::computeMargin const):
1725         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const): Deleted.
1726         * layout/inlineformatting/InlineFormattingContext.h:
1727
1728 2019-02-12  Rob Buis  <rbuis@igalia.com>
1729
1730         Implement serializing in MIME type parser
1731         https://bugs.webkit.org/show_bug.cgi?id=193909
1732
1733         Reviewed by Darin Adler.
1734
1735         Implement serializing in MIME type parser [1], to preserve the parameter
1736         order the Vector m_parameterNames is introduced, since HashMaps do not
1737         guarantee any order.
1738
1739         Test: ParsedContentType.Serialize
1740
1741         [1] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
1742
1743         * platform/network/ParsedContentType.cpp:
1744         (WebCore::skipSpaces):
1745         (WebCore::parseQuotedString):
1746         (WebCore::ParsedContentType::parseContentType):
1747         (WebCore::ParsedContentType::parameterValueForName const):
1748         (WebCore::ParsedContentType::parameterCount const):
1749         (WebCore::ParsedContentType::setContentType):
1750         (WebCore::ParsedContentType::setContentTypeParameter):
1751         (WebCore::ParsedContentType::serialize const):
1752         * platform/network/ParsedContentType.h:
1753
1754 2019-02-08  Chris Fleizach  <cfleizach@apple.com>
1755
1756         AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc
1757         https://bugs.webkit.org/show_bug.cgi?id=182280
1758         <rdar://problem/37018386>
1759
1760         Reviewed by Alan Bujtas.
1761
1762         Remove the possibility that changing children calls back into updating layout by
1763         handling children changes in a deferred manner.
1764
1765         This follows the same architecture as many other deferred changes, but also requires us to check deferred changes
1766         in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children.
1767
1768         A few tests had to be modified to no longer change the tree and then check the children immediately. 
1769
1770         * accessibility/AXObjectCache.cpp:
1771         (WebCore::AXObjectCache::remove):
1772         (WebCore::AXObjectCache::childrenChanged):
1773         (WebCore::AXObjectCache::prepareForDocumentDestruction):
1774         (WebCore::AXObjectCache::performDeferredCacheUpdate):
1775         * accessibility/AXObjectCache.h:
1776         * accessibility/AccessibilityObject.cpp:
1777         (WebCore::AccessibilityObject::updateBackingStore):
1778         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1779         (convertToNSArray):
1780         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1781
1782 2019-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
1783
1784         [Cocoa] Ask platform for generic font family mappings
1785         https://bugs.webkit.org/show_bug.cgi?id=187723
1786         <rdar://problem/41892438>
1787
1788         Reviewed by Brent Fulgham.
1789
1790         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
1791         When trying to style a character with a generic font family, we first look to see if
1792         we have a mapping for the particular script the character is rendered with, and if we
1793         don't find a match, we then check USCRIPT_COMMON.
1794
1795         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
1796         the only scripts which won't use the API families) is in
1797         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
1798         for the CJK scripts.
1799
1800         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
1801         user-installed fonts. Instead, we should be consulting with the platform for some of
1802         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
1803         API still has to work to set the mappings for untagged content. Therefore, we use the
1804         system mappings for language-tagged content, and the API mappings for non-language-tagged
1805         content. This is a good balance that makes sure we always have a good mapping for every
1806         language, but API clients can still set the mappings, too.
1807
1808         Test: fast/text/ja-sans-serif.html
1809
1810         * css/CSSComputedStyleDeclaration.cpp:
1811         * css/CSSFontSelector.cpp:
1812         (WebCore::resolveGenericFamily):
1813         * css/parser/CSSPropertyParser.cpp:
1814         (WebCore::consumeFontFamily):
1815         * page/cocoa/SettingsBaseCocoa.mm:
1816         (WebCore::SettingsBase::initializeDefaultFontFamilies):
1817         (WebCore::osakaMonoIsInstalled): Deleted.
1818         * platform/graphics/FontDescription.cpp:
1819         (WebCore::FontDescription::platformResolveGenericFamily):
1820         * platform/graphics/FontDescription.h:
1821         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1822         (WebCore::computeSpecializedChineseLocale):
1823         (WebCore::cachedSpecializedChineseLocale):
1824         (WebCore::languageChanged):
1825         (WebCore::FontDescription::platformResolveGenericFamily):
1826         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1827         (WebCore::SystemFontDatabaseCoreText::clear):
1828         (WebCore::genericFamily):
1829         (WebCore::SystemFontDatabaseCoreText::serifFamily):
1830         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
1831         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
1832         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
1833         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
1834         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1835
1836 2019-02-11  Adrian Perez de Castro  <aperez@igalia.com>
1837
1838         [GTK][WPE] Add content extensions support in WKTR and unskip layout tests
1839         https://bugs.webkit.org/show_bug.cgi?id=193622
1840
1841         Reviewed by Michael Catanzaro.
1842
1843         No new tests needed.
1844
1845         * SourcesCocoa.txt: Remove loader/ResourceLoadInfo.cpp, it's not Cocoa-specific anymore.
1846         * Sources.txt: Add loader/ResourceLoadInfo.cpp, all ports use it now.
1847
1848 2019-02-11  Daniel Bates  <dabates@apple.com>
1849
1850         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1851         https://bugs.webkit.org/show_bug.cgi?id=191446
1852         <rdar://problem/45929460>
1853
1854         Reviewed by Tim Horton.
1855
1856         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
1857         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
1858         to be passed to WebKit.
1859
1860         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
1861                fast/events/touch/ios/pointer-events-with-modifiers.html
1862                fast/events/touch/ios/touch-events-with-modifiers.html
1863
1864         * platform/ios/PlatformEventFactoryIOS.mm:
1865         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1866         * platform/ios/WebEvent.h:
1867         * platform/ios/WebEvent.mm:
1868         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
1869         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
1870
1871 2019-02-11  Jer Noble  <jer.noble@apple.com>
1872
1873         [Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
1874         https://bugs.webkit.org/show_bug.cgi?id=194504
1875
1876         Reviewed by Eric Carlson.
1877
1878         This allows the MediaRemote framework to associate the WebContent process with its host application.
1879
1880         * Modules/mediastream/UserMediaRequest.cpp:
1881         (WebCore::UserMediaRequest::start):
1882         * platform/audio/PlatformMediaSessionManager.h:
1883         (WebCore::PlatformMediaSessionManager::prepareToSendUserMediaPermissionRequest):
1884         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1885         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1886         (MediaSessionManagerCocoa::prepareToSendUserMediaPermissionRequest):
1887         (MediaSessionManagerCocoa::providePresentingApplicationPIDIfNecessary):
1888         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1889
1890 2019-02-11  Commit Queue  <commit-queue@webkit.org>
1891
1892         Unreviewed, rolling out r241272 and r241276.
1893         https://bugs.webkit.org/show_bug.cgi?id=194514
1894
1895         Broke the Apple Internal build and the fix requires human
1896         intervention :( (Requested by dydz on #webkit).
1897
1898         Reverted changesets:
1899
1900         "[iOS] Mouse/Touch/Pointer events are missing modifier keys"
1901         https://bugs.webkit.org/show_bug.cgi?id=191446
1902         https://trac.webkit.org/changeset/241272
1903
1904         "Fix internal iOS build after r241272"
1905         https://bugs.webkit.org/show_bug.cgi?id=191446
1906         https://trac.webkit.org/changeset/241276
1907
1908 2019-02-11  Alex Christensen  <achristensen@webkit.org>
1909
1910         Stop using setDefersLoading from WebCore
1911         https://bugs.webkit.org/show_bug.cgi?id=194315
1912
1913         Reviewed by Jer Noble.
1914
1915         That is what CompletionHandlers are for.
1916
1917         * loader/MediaResourceLoader.cpp:
1918         (WebCore::MediaResource::responseReceived):
1919         (WebCore::MediaResource::setDefersLoading): Deleted.
1920         * loader/MediaResourceLoader.h:
1921         * platform/graphics/PlatformMediaResourceLoader.h:
1922         (WebCore::PlatformMediaResourceClient::responseReceived):
1923         (WebCore::PlatformMediaResource::stop):
1924         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
1925         * platform/network/cocoa/WebCoreNSURLSession.mm:
1926         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1927         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
1928         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
1929         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
1930
1931 2019-02-11  Daniel Bates  <dabates@apple.com>
1932
1933         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1934         https://bugs.webkit.org/show_bug.cgi?id=191446
1935         <rdar://problem/45929460>
1936
1937         Reviewed by Tim Horton.
1938
1939         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
1940         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
1941         to be passed to WebKit.
1942
1943         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
1944                fast/events/touch/ios/pointer-events-with-modifiers.html
1945                fast/events/touch/ios/touch-events-with-modifiers.html
1946
1947         * platform/ios/PlatformEventFactoryIOS.mm:
1948         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1949         * platform/ios/WebEvent.h:
1950         * platform/ios/WebEvent.mm:
1951         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
1952         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
1953
1954 2019-02-11  Daniel Bates  <dabates@apple.com>
1955
1956         Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
1957         https://bugs.webkit.org/show_bug.cgi?id=193591
1958
1959         Reviewed by Simon Fraser.
1960
1961         Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using
1962         the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when
1963         outline-style: auto.
1964
1965         No functionality changed. So, no new tests.
1966
1967         * platform/graphics/GraphicsContext.h:
1968         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1969         (WebCore::drawFocusRing):
1970         (WebCore::drawFocusRingToContextAtTime):
1971         Change some macro guards.
1972
1973         * rendering/RenderElement.cpp:
1974         (WebCore::usePlatformFocusRingColorForOutlineStyleAuto): Added.
1975         (WebCore::useShrinkWrappedFocusRingForOutlineStyleAuto): Added.
1976         (WebCore::drawFocusRing): Added.
1977         (WebCore::RenderElement::paintFocusRing): Write in terms of drawFocusRing().
1978
1979 2019-02-11  Truitt Savell  <tsavell@apple.com>
1980
1981         Unreviewed, rolling out r241229.
1982
1983         Revision broke internal builds for watchOS.
1984
1985         Reverted changeset:
1986
1987         "[Cocoa] Ask platform for generic font family mappings"
1988         https://bugs.webkit.org/show_bug.cgi?id=187723
1989         https://trac.webkit.org/changeset/241229
1990
1991 2019-02-11  Youenn Fablet  <youenn@apple.com>
1992
1993         Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
1994         https://bugs.webkit.org/show_bug.cgi?id=194404
1995         <rdar://problem/47891915>
1996
1997         Reviewed by Geoffrey Garen.
1998
1999         Align with the spec, except for known problematic web sites.
2000         Covered by updated test.
2001
2002         * Modules/fetch/FetchRequest.cpp:
2003         (WebCore::needsSignalQuirk):
2004         (WebCore::processInvalidSignal):
2005         (WebCore::FetchRequest::initializeWith):
2006
2007 2019-02-11  Zalan Bujtas  <zalan@apple.com>
2008
2009         [LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
2010         https://bugs.webkit.org/show_bug.cgi?id=194490
2011
2012         Reviewed by Antti Koivisto.
2013
2014         This is in preparation for adding floating preferred width computation support. It requires height computaiton
2015         which uses containing block width to resolve vertical margins.
2016
2017         * layout/FormattingContext.cpp:
2018         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2019         * layout/FormattingContext.h:
2020         * layout/FormattingContextGeometry.cpp:
2021         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2022         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2023         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2024         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2025         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2026         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
2027         * layout/FormattingContextQuirks.cpp:
2028         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
2029         * layout/LayoutUnits.h:
2030         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
2031         * layout/blockformatting/BlockFormattingContext.cpp:
2032         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2033         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2034         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2035         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2036         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2037         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2038         * layout/blockformatting/BlockMarginCollapse.cpp:
2039         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
2040         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
2041         * layout/inlineformatting/InlineFormattingContext.cpp:
2042         (WebCore::Layout::InlineFormattingContext::layout const):
2043         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2044         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2045         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2046
2047 2019-02-11  Zalan Bujtas  <zalan@apple.com>
2048
2049         [LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently.
2050         https://bugs.webkit.org/show_bug.cgi?id=194483
2051
2052         Reviewed by Antti Koivisto.
2053
2054         Rename intrinsicWidthConstraints to computeIntrinsicWidthConstraints (it does not return the width values anymore).
2055
2056         * layout/FormattingContext.h:
2057         * layout/FormattingContextGeometry.cpp:
2058         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2059         * layout/blockformatting/BlockFormattingContext.cpp:
2060         (WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const):
2061         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const): Deleted.
2062         * layout/blockformatting/BlockFormattingContext.h:
2063         * layout/inlineformatting/InlineFormattingContext.cpp:
2064         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2065         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
2066         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const): Deleted.
2067         * layout/inlineformatting/InlineFormattingContext.h:
2068
2069 2019-02-10  Zalan Bujtas  <zalan@apple.com>
2070
2071         [LFC] Fix spelling error.
2072         https://bugs.webkit.org/show_bug.cgi?id=194489
2073
2074         Reviewed by Simon Fraser.
2075
2076         instrinsic -> intrinsic
2077
2078         * layout/FormattingContext.h:
2079         * layout/FormattingContextGeometry.cpp:
2080         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2081         * layout/FormattingState.h:
2082         (WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
2083         (WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
2084         (WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
2085         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
2086         (WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
2087         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
2088         * layout/blockformatting/BlockFormattingContext.cpp:
2089         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
2090         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
2091         * layout/blockformatting/BlockFormattingContext.h:
2092         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2093         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
2094         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2095         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
2096         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
2097         * layout/inlineformatting/InlineFormattingContext.cpp:
2098         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
2099         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
2100         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
2101         * layout/inlineformatting/InlineFormattingContext.h:
2102
2103 2019-02-10  Darin Adler  <darin@apple.com>
2104
2105         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
2106         https://bugs.webkit.org/show_bug.cgi?id=194485
2107
2108         Reviewed by Daniel Bates.
2109
2110         * Modules/websockets/WebSocket.cpp:
2111         (WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.
2112
2113         * css/parser/CSSParserToken.cpp:
2114         (WebCore::CSSParserToken::serialize const): Fixed style of many return statements
2115         that called a function returning void; doesn't match WebKit's prevailing style.
2116         Also use break instead of return. Used appendLiteral instead of append in many
2117         cases, and append character instead of single-character literal in others.
2118         Use appendUnsignedAsHex instead of String::format.
2119
2120         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2121         (WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
2122         Should come back here and use makeString once we make HexNumber.h work with that.
2123
2124         * platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.
2125
2126         * rendering/RenderTreeAsText.cpp:
2127         (WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
2128         to character append. Touched because it was next to a call to appendUnsignedAsHex.
2129
2130 2019-02-10  Pablo Saavedra  <psaavedra@igalia.com>
2131
2132         libWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
2133         https://bugs.webkit.org/show_bug.cgi?id=194484
2134
2135         Reviewed by Darin Adler.
2136
2137         * bindings/js/JSUndoItemCustom.cpp:
2138
2139 2019-02-10  Philippe Normand  <pnormand@igalia.com>
2140
2141         Unreviewed, GTK Debug build fix after r241148.
2142
2143         * Modules/mediasource/SourceBuffer.cpp:
2144         (WebCore::removeSamplesFromTrackBuffer):
2145         SourceBuffer::logClassName and friends are declared for
2146         !RELEASE_LOG_DISABLED builds so adapt calling sites accordingly.
2147
2148 2019-02-10  Zalan Bujtas  <zalan@apple.com>
2149
2150         [LFC][IFC] Add intrinsic width support for inline-block boxes
2151         https://bugs.webkit.org/show_bug.cgi?id=194479
2152
2153         Reviewed by Antti Koivisto.
2154
2155         Compute the intrinsic width for the inline-block (formatting context root) and set it as the content box width while
2156         laying out the content for the min/max width.
2157
2158         <div style="position: absolute">before<span id=inline-block style="display: inline-block">inline_block content<span>after</div>
2159
2160         The "inline-block" formatting root returns "inline_block" width for the minimum and "inline_block width" for
2161         the maximum width. These min/max values are used to figure out the intrinsic width for the parent <div>.
2162
2163         * layout/inlineformatting/InlineFormattingContext.cpp:
2164         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2165         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
2166         (WebCore::Layout::InlineFormattingContext::computeMargin const):
2167         * layout/inlineformatting/InlineFormattingContext.h:
2168         * page/FrameViewLayoutContext.cpp:
2169         (WebCore::layoutUsingFormattingContext):
2170
2171 2019-02-10  Zalan Bujtas  <zalan@apple.com>
2172
2173         [LFC][IFC] Add intrinsic width support for replaced boxes
2174         https://bugs.webkit.org/show_bug.cgi?id=194478
2175
2176         Reviewed by Antti Koivisto.
2177
2178         * layout/inlineformatting/InlineFormattingContext.cpp:
2179         (WebCore::Layout::InlineFormattingContext::layout const):
2180         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2181         (WebCore::Layout::InlineFormattingContext::computeMargin const):
2182         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
2183         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2184         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
2185         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const): Deleted.
2186         * layout/inlineformatting/InlineFormattingContext.h:
2187
2188 2019-02-10  Alicia Boya García  <aboya@igalia.com>
2189
2190         [MSE][GStreamer] Add missing return type to lambda
2191         https://bugs.webkit.org/show_bug.cgi?id=194414
2192
2193         Reviewed by Darin Adler.
2194
2195         Since g_signal_connect() is untyped, a compiler error was not
2196         generated when a lambda with a missing GstFlowReturn return type was
2197         provided for a signal that expects it.
2198
2199         This used to work before r240784 because a recent function call had
2200         set GST_FLOW_OK in the return value register and it happened to
2201         survive until the lambda function call ended. Starting on that commit
2202         such return value was removed and it stopped working on debug.
2203
2204         Of course, the actual problem is in the signature of the lambda
2205         function, and this patch fixes that.
2206
2207         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2208         (WebCore::AppendPipeline::AppendPipeline):
2209
2210 2019-02-09  Darin Adler  <darin@apple.com>
2211
2212         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
2213         https://bugs.webkit.org/show_bug.cgi?id=194021
2214
2215         Reviewed by Geoffrey Garen.
2216
2217         For floating point numbers, String::number gives a fixed precision result,
2218         stripping trailing zeroes. When possible, I changed the code to instead use the
2219         equivalent of String::numberToStringECMAScript, which is what makeString does by
2220         default for floating point, gives the same results for many cases, and gives
2221         better results in many others. However, for floats, we do not yet have a good
2222         implementation, so instead I used FormattedNumber::fixedPrecision to match
2223         the old behavior.
2224
2225         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
2226         (WebCore::IDBTransactionInfo::loggingString const): Remove String::number and let
2227         makeString do the conversion without allocating/destroying a String.
2228         * Modules/websockets/ThreadableWebSocketChannel.cpp:
2229         (WebCore::ThreadableWebSocketChannel::create): Ditto.
2230         * Modules/websockets/WebSocket.cpp:
2231         (WebCore::WebSocket::connect): Ditto. Added a cast to "unsigned" to sidestep the
2232         ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
2233         and sometimes used for UTF-16 code units (UChar) and can be the same type.
2234
2235         * Modules/websockets/WebSocketChannel.cpp:
2236         (WebCore::WebSocketChannel::didFailSocketStream): Use ASCIILiteral when intializing
2237         a string instead of just a normal C literal. Switched to makeString so we could
2238         remove String::number and do the conversion without allocating/destroying a String.
2239         (WebCore::WebSocketChannel::didFail): Ditto.
2240         (WebCore::WebSocketChannel::processFrame): Ditto.
2241         * Modules/websockets/WebSocketFrame.cpp:
2242         (WebCore::WebSocketFrame::parseFrame): Ditto.
2243         * Modules/websockets/WebSocketHandshake.cpp:
2244         (WebCore::WebSocketHandshake::readServerHandshake): Ditto.
2245         * accessibility/AccessibilityRenderObject.cpp:
2246         (WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Ditto.
2247         * bindings/js/JSDOMConvertNumbers.cpp:
2248         (WebCore::rangeErrorString): Ditto.
2249         * css/CSSAspectRatioValue.cpp:
2250         (WebCore::CSSAspectRatioValue::customCSSText const): Ditto. Used
2251         FormattedNumber::fixedPrecision since these are floats.
2252
2253         * css/DOMMatrixReadOnly.cpp:
2254         (WebCore::DOMMatrixReadOnly::toString const): Use
2255         StringBuilder::builder.appendECMAScriptNumber instead of
2256         String::numberToStringECMAScript so we can do it without allocating/destroying
2257         a String.
2258         * css/WebKitCSSMatrix.cpp:
2259         (WebCore::WebKitCSSMatrix::toString const): Ditto.
2260
2261         * dom/MessagePortIdentifier.h:
2262         (WebCore::MessagePortIdentifier::logString const): Remove String::number and let
2263         makeString do the conversion without allocating/destroying a String.
2264
2265         * editing/cocoa/DataDetection.mm:
2266         (WebCore::dataDetectorStringForPath): Remove unnecessary type casts on values
2267         passed to String::number and to StringBuilder::appendNumber. These could do
2268         harm if the values were out of range, and should not be necessary.
2269
2270         * history/BackForwardItemIdentifier.h:
2271         (WebCore::BackForwardItemIdentifier::logString const): Remove String::number
2272         and let makeString do the conversion without allocating/destroying a String.
2273         * html/FTPDirectoryDocument.cpp:
2274         (WebCore::processFileDateString): Ditto.
2275         * html/canvas/WebGLRenderingContextBase.cpp:
2276         (WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
2277         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Ditto.
2278         * inspector/agents/WebConsoleAgent.cpp:
2279         (WebCore::WebConsoleAgent::didReceiveResponse): Ditto.
2280         * loader/WorkerThreadableLoader.cpp:
2281         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
2282         * loader/appcache/ApplicationCacheGroup.cpp:
2283         (WebCore::ApplicationCacheGroup::didFailLoadingManifest): Ditto.
2284         * page/PageSerializer.cpp:
2285         (WebCore::PageSerializer::urlForBlankFrame): Ditto.
2286         * page/PrintContext.cpp:
2287         (WebCore::PrintContext::pageProperty): Ditto.
2288         (WebCore::PrintContext::pageSizeAndMarginsInPixels): Ditto.
2289
2290         * page/WheelEventTestTrigger.cpp:
2291         (WebCore::dumpState): Use StringBuilder::appendNumber instead of
2292         String::number so we can do it without allocating/destroying a String.
2293         Also use StringBuilder::appendLiteral on a literal.
2294
2295         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2296         (WebCore::ResourceUsageOverlay::platformDraw): Pass explicit
2297         KeepTrailingZeros to FormattedNumber::fixedPrecision to preserve behavior,
2298         since default is now to truncate trailing zeros.
2299
2300         * platform/graphics/Color.cpp:
2301         (WebCore::Color::cssText): Use StringBuilder::appendNumber instead of
2302         calling numberToFixedPrecisionString to do the same thing.
2303         * platform/graphics/ExtendedColor.cpp:
2304         (WebCore::ExtendedColor::cssText): Ditto.
2305
2306         * platform/graphics/ca/GraphicsLayerCA.cpp:
2307         (WebCore::animationIdentifier): Remove String::number and let makeString
2308         do the conversion without allocating/destroying a String. Had to add
2309         a typecast to convert the enumeration into an integer.
2310         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2311         (WebCore::PlatformCAFilters::setFiltersOnLayer): Ditto.
2312         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2313         (WebCore::FontPlatformData::description const): Ditto.
2314
2315         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2316         (WebCore::MockMediaSample::MockMediaSample): Use AtomicString::number
2317         instead of String::number to avoid unneccessarily allocating an additional
2318         temporary String when an AtomicString already exists.
2319
2320         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2321         (WebCore::SocketStreamHandleImpl::reportErrorToClient): Remove String::number
2322         and let makeString do the conversion without allocating/destroying a String.
2323         * platform/sql/SQLiteDatabase.cpp:
2324         (WebCore::SQLiteDatabase::setMaximumSize): Ditto.
2325         (WebCore::SQLiteDatabase::setSynchronous): Ditto. Had to add a typecast to
2326         convert the enumeration into an integer.
2327         * svg/SVGAngleValue.cpp:
2328         (WebCore::SVGAngleValue::valueAsString const): Ditto.
2329         * svg/SVGLengthValue.cpp:
2330         (WebCore::SVGLengthValue::valueAsString const): Ditto.
2331         * testing/Internals.cpp:
2332         (WebCore::Internals::configurationForViewport): Ditto. Used
2333         FormattedNumber::fixedPrecision since these are floats.
2334         (WebCore::Internals::getCurrentCursorInfo): Use StringBuilder::appendNumber
2335         instead of calling numberToFixedPrecisionString to do the same thing.
2336         (WebCore::Internals::queueMicroTask): Remove String::number and let makeString
2337         do the conversion without allocating/destroying a String.
2338         (WebCore::appendOffsets): Use StringBuilder::appendNumber instead of
2339         String::number so we can do it without allocating/destroying a String.
2340
2341         * workers/service/ServiceWorkerClientIdentifier.h:
2342         (WebCore::ServiceWorkerClientIdentifier::toString const): Remove String::number
2343         and let makeString do the conversion without allocating/destroying a String.
2344         * workers/service/server/RegistrationDatabase.cpp:
2345         (WebCore::databaseFilenameFromVersion): Ditto.
2346
2347 2019-02-09  Zalan Bujtas  <zalan@apple.com>
2348
2349         [LFC][IFC] Add intrinsic width support for basic inline containers
2350         https://bugs.webkit.org/show_bug.cgi?id=194473
2351
2352         Reviewed by Antti Koivisto.
2353
2354         Preferred width computation logic is very similar to normal layout.
2355         One of the main difference is that the preferred width codepath does not provide valid containing block width.
2356         This patch implement basic inline container support by passing nullopt containing block width in UsedHorizontalValues. 
2357
2358         * layout/inlineformatting/InlineFormattingContext.cpp:
2359         (WebCore::Layout::InlineFormattingContext::layout const):
2360         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2361         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
2362         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
2363         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2364         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2365         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
2366         * layout/inlineformatting/InlineFormattingContext.h:
2367
2368 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
2369
2370         [Cocoa] CTLineGetGlyphRuns() might return nullptr
2371         https://bugs.webkit.org/show_bug.cgi?id=194467
2372         <rdar://problem/42423999>
2373
2374         Reviewed by Simon Fraser.
2375
2376         Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.
2377
2378         Covered by find/text/find-backwards.html
2379
2380         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2381         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2382
2383 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
2384
2385         [Cocoa] Ask platform for generic font family mappings
2386         https://bugs.webkit.org/show_bug.cgi?id=187723
2387         <rdar://problem/41892438>
2388
2389         Reviewed by Brent Fulgham.
2390
2391         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
2392         When trying to style a character with a generic font family, we first look to see if
2393         we have a mapping for the particular script the character is rendered with, and if we
2394         don't find a match, we then check USCRIPT_COMMON.
2395
2396         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
2397         the only scripts which won't use the API families) is in
2398         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
2399         for the CJK scripts.
2400
2401         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
2402         user-installed fonts. Instead, we should be consulting with the platform for some of
2403         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
2404         API still has to work to set the mappings for untagged content. Therefore, we use the
2405         system mappings for language-tagged content, and the API mappings for non-language-tagged
2406         content. This is a good balance that makes sure we always have a good mapping for every
2407         language, but API clients can still set the mappings, too.
2408
2409         Test: fast/text/ja-sans-serif.html
2410
2411         * css/CSSComputedStyleDeclaration.cpp:
2412         * css/CSSFontSelector.cpp:
2413         (WebCore::resolveGenericFamily):
2414         * css/parser/CSSPropertyParser.cpp:
2415         (WebCore::consumeFontFamily):
2416         * page/cocoa/SettingsBaseCocoa.mm:
2417         (WebCore::SettingsBase::initializeDefaultFontFamilies):
2418         (WebCore::osakaMonoIsInstalled): Deleted.
2419         * platform/graphics/FontDescription.cpp:
2420         (WebCore::FontDescription::platformResolveGenericFamily):
2421         * platform/graphics/FontDescription.h:
2422         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2423         (WebCore::computeSpecializedChineseLocale):
2424         (WebCore::cachedSpecializedChineseLocale):
2425         (WebCore::languageChanged):
2426         (WebCore::FontDescription::platformResolveGenericFamily):
2427         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
2428         (WebCore::SystemFontDatabaseCoreText::clear):
2429         (WebCore::SystemFontDatabaseCoreText::serifFamily):
2430         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
2431         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
2432         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
2433         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
2434         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
2435
2436 2019-02-08  Yusuke Suzuki  <ysuzuki@apple.com>
2437
2438         [JSC] Shrink sizeof(CodeBlock) more
2439         https://bugs.webkit.org/show_bug.cgi?id=194419
2440
2441         Reviewed by Mark Lam.
2442
2443         * testing/Internals.cpp:
2444         (WebCore::Internals::parserMetaData):
2445
2446 2019-02-08  Chris Dumez  <cdumez@apple.com>
2447
2448         [Cocoa] Optimize ResourceResponse::platformLazyInit()
2449         https://bugs.webkit.org/show_bug.cgi?id=194438
2450
2451         Reviewed by Alex Christensen.
2452
2453         Optimize ResourceResponse::platformLazyInit(). Most of the CPU time currently goes into getting the
2454         HTTP headers from CFNetwork:
2455         """
2456         Sample Count, Samples %, CPU %, Symbol
2457         46, 0.0%, 0.0%, WebCore::initializeHTTPHeaders(WebCore::OnlyCommonHeaders, NSHTTPURLResponse*, WebCore::HTTPHeaderMap&) (in WebCore)
2458         34, 0.0%, 0.0%,     HTTPHeaderDict::copyAsOrdinaryDict(__CFAllocator const*) const (in CFNetwork)
2459         11, 0.0%, 0.0%,     CFDictionaryApplyFunction (in CoreFoundation)
2460         """
2461
2462         We currently have 2 levels of initialization: CommonFieldsOnly & AllFields. With WebKit2, most ResourceResponses get sent over IPC
2463         and thus end up getting initialized twice, once with CommonFieldsOnly and then with AllFields.
2464         This would cause us to call the expensive HTTPHeaderDict::copyAsOrdinaryDict() twice instead of once, simply to initialize the common
2465         HTTP headers first and then the uncommon ones later.
2466
2467         This patch updates ResourceResponse::platformLazyInit() to initialize all HTTP headers at once, as soon as CommonFieldsOnly
2468         initialization is requested, so that we no longer copy all HTTP headers twice.
2469
2470         * platform/network/cocoa/ResourceResponseCocoa.mm:
2471         (WebCore::initializeHTTPHeaders):
2472         (WebCore::ResourceResponse::platformLazyInit):
2473
2474 2019-02-08  Justin Fan  <justin_fan@apple.com>
2475
2476         [Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
2477         https://bugs.webkit.org/show_bug.cgi?id=194443
2478
2479         Unreviewed build fix.
2480
2481         For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
2482         if not using MTLStorageModePrivate, must use MTLStorageModeShared.
2483
2484         Behavior unchanged.
2485
2486         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2487         (WebCore::storageModeForPixelFormatAndSampleCount):
2488
2489 2019-02-08  Per Arne Vollan  <pvollan@apple.com>
2490
2491         [WebVTT] Inline WebVTT styles should start with '::cue'
2492         https://bugs.webkit.org/show_bug.cgi?id=194227
2493         <rdar://problem/47791087>
2494
2495         Reviewed by Eric Carlson.
2496
2497         Check that the CSS string starts with '::cue' and is successfully parsed before adding it
2498         to the CSS stylesheet list. Also, the caption preferences CSS string should start with
2499         '::cue', since it is added inside the video shadow root element.
2500
2501         Test: media/track/track-cue-css.html
2502
2503         * html/track/WebVTTParser.cpp:
2504         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
2505         * page/CaptionUserPreferencesMediaAF.cpp:
2506         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
2507
2508 2019-02-08  Youenn Fablet  <youenn@apple.com>
2509
2510         Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
2511         https://bugs.webkit.org/show_bug.cgi?id=194380
2512         <rdar://problem/47916514>
2513
2514         Reviewed by Eric Carlson.
2515
2516         Set whether VP8 is supported at creation of the page.
2517         This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.
2518
2519         Add internal API to enable resetting the factory to enable proper testing.
2520
2521         Covered by updated test.
2522
2523         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2524         (WebCore::createLibWebRTCPeerConnectionBackend):
2525         * page/Page.cpp:
2526         (WebCore::m_applicationManifest):
2527         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2528         * testing/Internals.cpp:
2529         (WebCore::Internals::clearPeerConnectionFactory):
2530         * testing/Internals.h:
2531         * testing/Internals.idl:
2532
2533 2019-02-08  Andy Estes  <aestes@apple.com>
2534
2535         [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
2536         https://bugs.webkit.org/show_bug.cgi?id=190997
2537         <rdar://problem/35983035>
2538
2539         Reviewed by Brent Fulgham.
2540
2541         Support serializing sequences and FrozenArrays of types that aren't interfaces. This is
2542         needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings.
2543
2544         We should support serializing sequences of interfaces too, but that's slightly more
2545         complicated since it involves iterating the sequence and serializing each of its items. I
2546         left that as a follow-up task, since I don't see any IDLs that currently need this.
2547
2548         We also don't support serializing sequences with the CachedAttribute or CustomGetter
2549         extended attributes, because WebIDL specifies that a new array should be created when
2550         converting an IDL sequence into an ECMAScript value.
2551
2552         Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to
2553         http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html.
2554
2555         * bindings/scripts/CodeGenerator.pm:
2556         (GetInterfaceForType): Renamed from GetInterfaceForAttribute.
2557         (IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types.
2558         (hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an
2559         attribute has the CachedAttribute or CustomGetter extended attributes.
2560         (IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter
2561         extended attributes before calling IsSerializableType.
2562         (GetInterfaceForAttribute): Renamed to GetInterfaceForType.
2563         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2564         * bindings/scripts/test/TestSerialization.idl:
2565
2566 2019-02-08  Sihui Liu  <sihui_liu@apple.com>
2567
2568         IndexedDB tests leak documents
2569         https://bugs.webkit.org/show_bug.cgi?id=189435
2570         <rdar://problem/44240043>
2571
2572         Reviewed by Geoffrey Garen.
2573
2574         Remove use of JSC::Strong in IndexedDatabase.
2575
2576         * Modules/indexeddb/IDBCursor.cpp:
2577         (WebCore::IDBCursor::update):
2578         (WebCore::IDBCursor::continuePrimaryKey):
2579         (WebCore::IDBCursor::continueFunction):
2580         (WebCore::IDBCursor::deleteFunction):
2581         (WebCore::IDBCursor::setGetResult):
2582         * Modules/indexeddb/IDBCursor.h:
2583         (WebCore::IDBCursor::key):
2584         (WebCore::IDBCursor::primaryKey):
2585         (WebCore::IDBCursor::value):
2586         (WebCore::IDBCursor::keyWrapper):
2587         (WebCore::IDBCursor::primaryKeyWrapper):
2588         (WebCore::IDBCursor::valueWrapper):
2589         (WebCore::IDBCursor::key const): Deleted.
2590         (WebCore::IDBCursor::primaryKey const): Deleted.
2591         (WebCore::IDBCursor::value const): Deleted.
2592         * Modules/indexeddb/IDBCursor.idl:
2593         * Modules/indexeddb/IDBCursorWithValue.idl:
2594         * Modules/indexeddb/IDBObjectStore.cpp:
2595         (WebCore::IDBObjectStore::putForCursorUpdate):
2596         * Modules/indexeddb/IDBObjectStore.h:
2597         * Modules/indexeddb/IDBRequest.cpp:
2598         (WebCore::IDBRequest::IDBRequest):
2599         (WebCore::IDBRequest::~IDBRequest):
2600         (WebCore::IDBRequest::result const):
2601         (WebCore::IDBRequest::setResult):
2602         (WebCore::IDBRequest::setResultToStructuredClone):
2603         (WebCore::IDBRequest::setResultToUndefined):
2604         (WebCore::IDBRequest::resultCursor):
2605         (WebCore::IDBRequest::willIterateCursor):
2606         (WebCore::IDBRequest::didOpenOrIterateCursor):
2607         * Modules/indexeddb/IDBRequest.h:
2608         (WebCore::IDBRequest::resultWrapper):
2609         * Modules/indexeddb/IDBRequest.idl:
2610         * Sources.txt:
2611         * WebCore.xcodeproj/project.pbxproj:
2612         * bindings/js/JSIDBCursorCustom.cpp:
2613         (WebCore::JSIDBCursor::key const):
2614         (WebCore::JSIDBCursor::primaryKey const):
2615         (WebCore::JSIDBCursor::visitAdditionalChildren):
2616         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2617         (WebCore::JSIDBCursorWithValue::value const):
2618         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
2619         * bindings/js/JSIDBRequestCustom.cpp: Added.
2620         (WebCore::JSIDBRequest::result const):
2621         (WebCore::JSIDBRequest::visitAdditionalChildren):
2622         * inspector/agents/InspectorIndexedDBAgent.cpp:
2623
2624 2019-02-08  Zalan Bujtas  <zalan@apple.com>
2625
2626         [LFC] The used containing block width value is optional
2627         https://bugs.webkit.org/show_bug.cgi?id=194428
2628
2629         Reviewed by Antti Koivisto.
2630
2631         The preferred width codepath cannot provide a valid used containing block width value.
2632
2633         "The percentage is calculated with respect to the width of the generated box's containing block.
2634         If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.2."
2635
2636         Let's use 0 as used value for now.
2637
2638         * layout/FormattingContextGeometry.cpp:
2639         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2640         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2641         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2642         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2643         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2644         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2645         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
2646         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
2647         * layout/LayoutUnits.h:
2648         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
2649         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2650         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2651         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2652         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2653         * page/FrameViewLayoutContext.cpp:
2654
2655 2019-02-08  Zalan Bujtas  <zalan@apple.com>
2656
2657         [LFC] Horizontal geometry compute functions should take the containing block's width as a used value
2658         https://bugs.webkit.org/show_bug.cgi?id=194424
2659
2660         Reviewed by Antti Koivisto.
2661
2662         This is in preparation for passing optional containing block width for the preferred with codepath. 
2663
2664         * layout/FormattingContext.cpp:
2665         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2666         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2667         * layout/FormattingContext.h:
2668         * layout/FormattingContextGeometry.cpp:
2669         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2670         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2671         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2672         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2673         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2674         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2675         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2676         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
2677         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
2678         * layout/LayoutUnits.h:
2679         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
2680         * layout/blockformatting/BlockFormattingContext.cpp:
2681         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2682         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2683         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2684         * layout/inlineformatting/InlineFormattingContext.cpp:
2685         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
2686         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2687         * layout/inlineformatting/InlineFormattingContext.h:
2688         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2689         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2690
2691 2019-02-08  Benjamin Poulain  <benjamin@webkit.org>
2692
2693         clampTo(): do not convert the input to double when dealing with integers
2694         https://bugs.webkit.org/show_bug.cgi?id=194263
2695         <rdar://problem/47692312>
2696
2697         Reviewed by Darin Adler.
2698
2699         Make the calls to clampTo<float>() unambiguous.
2700
2701         * page/FrameView.cpp:
2702         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
2703         * rendering/style/RenderStyle.h:
2704         (WebCore::RenderStyle::setOpacity):
2705         (WebCore::RenderStyle::setShapeImageThreshold):
2706
2707 2019-02-08  Eric Liang  <ericliang@apple.com>
2708
2709         When performing AXPress, check to see if the menu list is disabled.
2710         https://bugs.webkit.org/show_bug.cgi?id=193878
2711
2712         Reviewed by Chris Fleizach.
2713
2714         Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
2715
2716         * accessibility/AXObjectCache.h:
2717         * accessibility/AccessibilityMenuList.cpp:
2718         (WebCore::AccessibilityMenuList::press):
2719         * accessibility/mac/AXObjectCacheMac.mm:
2720         (WebCore::AXObjectCache::postPlatformNotification):
2721
2722 2019-02-07  Devin Rousso  <drousso@apple.com>
2723
2724         PseudoElement created for any ::before/::after selector regardless of whether a content property exists
2725         https://bugs.webkit.org/show_bug.cgi?id=194423
2726         <rdar://problem/46787260>
2727
2728         Reviewed by Antti Koivisto.
2729
2730         Test: inspector/css/pseudo-creation.html
2731
2732         * style/StyleTreeResolver.cpp:
2733         (WebCore::Style::TreeResolver::resolvePseudoStyle):
2734         We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
2735         `PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
2736         that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.
2737
2738 2019-02-07  Chris Dumez  <cdumez@apple.com>
2739
2740         Mark more heap-allocated classes as fast allocated
2741         https://bugs.webkit.org/show_bug.cgi?id=194422
2742
2743         Reviewed by Ryosuke Niwa.
2744
2745         * Modules/applepay/PaymentCoordinator.h:
2746         * Modules/beacon/NavigatorBeacon.h:
2747         * Modules/cache/DOMWindowCaches.h:
2748         * Modules/cache/WorkerGlobalScopeCaches.h:
2749         * Modules/credentialmanagement/NavigatorCredentials.h:
2750         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
2751         * Modules/gamepad/NavigatorGamepad.h:
2752         * Modules/indexeddb/IDBGetAllResult.h:
2753         * Modules/indexeddb/IDBGetResult.h:
2754         * Modules/indexeddb/IDBKeyData.h:
2755         * Modules/indexeddb/IDBValue.h:
2756         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
2757         * Modules/indexeddb/server/IndexValueEntry.h:
2758         * Modules/indexeddb/server/IndexValueStore.h:
2759         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2760         * Modules/indexeddb/server/MemoryCursor.h:
2761         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2762         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2763         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2764         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2765         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2766         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2767         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2768         * Modules/indexeddb/shared/IDBTransactionInfo.h:
2769         * Modules/mediacapabilities/NavigatorMediaCapabilities.h:
2770         * Modules/mediasession/WebMediaSessionManager.cpp:
2771         * Modules/mediastream/NavigatorMediaDevices.h:
2772         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2773         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
2774         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2775         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
2776         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
2777         * Modules/quota/DOMWindowQuota.h:
2778         * Modules/quota/NavigatorStorageQuota.h:
2779         * Modules/quota/WorkerNavigatorStorageQuota.h:
2780         * Modules/speech/DOMWindowSpeechSynthesis.h:
2781         * Modules/webaudio/BiquadProcessor.h:
2782         * Modules/webaudio/DelayProcessor.h:
2783         * Modules/webauthn/fido/FidoHidPacket.h:
2784         * Modules/webdriver/NavigatorWebDriver.h:
2785         * Modules/webgpu/DOMWindowWebGPU.h:
2786         * Modules/websockets/WebSocketChannel.h:
2787         * Modules/webvr/NavigatorWebVR.h:
2788         * accessibility/AXObjectCache.h:
2789         * bindings/js/DOMGCOutputConstraint.h:
2790         * bindings/js/DOMPromiseProxy.h:
2791         * bridge/c/c_runtime.h:
2792         * contentextensions/CombinedURLFilters.cpp:
2793         * crypto/CryptoAlgorithmParameters.h:
2794         * css/CSSComputedStyleDeclaration.h:
2795         * css/CSSRegisteredCustomProperty.h:
2796         * css/DOMCSSPaintWorklet.h:
2797         * css/DOMCSSRegisterCustomProperty.h:
2798         * css/StyleRule.h:
2799         * dom/ConstantPropertyMap.h:
2800         * dom/CustomElementReactionQueue.h:
2801         * dom/Document.h:
2802         * dom/GenericEventQueue.h:
2803         * dom/RejectedPromiseTracker.h:
2804         * dom/UserGestureIndicator.h:
2805         * editing/ReplaceSelectionCommand.cpp:
2806         * editing/SelectionRectGatherer.h:
2807         * editing/TextIterator.h:
2808         * editing/cocoa/HTMLConverter.mm:
2809         * fileapi/AsyncFileStream.cpp:
2810         * fileapi/AsyncFileStream.h:
2811         * html/forms/FileIconLoader.h:
2812         * html/parser/HTMLTreeBuilder.h:
2813         * html/track/WebVTTParser.h:
2814         * inspector/DOMPatchSupport.cpp:
2815         * loader/FrameLoaderClient.h:
2816         * loader/WorkerThreadableLoader.cpp:
2817         * page/IntersectionObserver.h:
2818         * page/PerformanceMonitor.h:
2819         * page/PerformanceUserTiming.h:
2820         * page/PrintContext.h:
2821         * page/ValidationMessageClient.h:
2822         * platform/ColorChooser.h:
2823         * platform/ControlStates.h:
2824         * platform/DataListSuggestionPicker.h:
2825         * platform/FileStream.h:
2826         * platform/KeyedCoding.h:
2827         * platform/LowPowerModeNotifier.h:
2828         * platform/PlatformSpeechSynthesizer.h:
2829         * platform/WebGLStateTracker.h:
2830         * platform/audio/AudioArray.h:
2831         * platform/audio/AudioDestination.h:
2832         * platform/audio/DownSampler.h:
2833         * platform/audio/DynamicsCompressor.h:
2834         * platform/audio/FFTFrame.h:
2835         * platform/audio/HRTFDatabase.h:
2836         * platform/audio/MultiChannelResampler.h:
2837         * platform/audio/Panner.h:
2838         * platform/audio/Reverb.h:
2839         * platform/audio/ReverbConvolver.h:
2840         * platform/audio/ReverbConvolverStage.h:
2841         * platform/audio/UpSampler.h:
2842         * platform/audio/mac/AudioSessionMac.cpp:
2843         * platform/audio/mac/CAAudioStreamDescription.h:
2844         * platform/audio/mac/CARingBuffer.h:
2845         * platform/cocoa/ScrollSnapAnimatorState.h:
2846         * platform/gamepad/PlatformGamepad.h:
2847         * platform/graphics/GraphicsLayer.cpp:
2848         * platform/graphics/GraphicsLayerFactory.h:
2849         * platform/graphics/PlatformTimeRanges.h:
2850         * platform/graphics/TextTrackRepresentation.h:
2851         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2852         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2853         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2854         * platform/graphics/displaylists/DisplayListRecorder.h:
2855         * platform/network/cocoa/WebCoreNSURLSession.mm:
2856         * platform/sql/SQLiteDatabase.h:
2857         * platform/text/TextCodecICU.h:
2858         * rendering/GridBaselineAlignment.h:
2859         * rendering/GridTrackSizingAlgorithm.h:
2860         * rendering/RenderObject.h:
2861         * rendering/style/GridArea.h:
2862         * workers/service/context/SWContextManager.h:
2863
2864 2019-02-07  Justin Fan  <justin_fan@apple.com>
2865
2866         [Web GPU] GPUDevice::createTexture implementation prototype
2867         https://bugs.webkit.org/show_bug.cgi?id=194409
2868         <rdar://problem/47894312>
2869
2870         Reviewed by Myles C. Maxfield.
2871
2872         Test: textures-textureviews.html updated to test new functionality.
2873
2874         Implement GPUDevice::createTexture():
2875         * Modules/webgpu/WebGPUDevice.cpp:
2876         (WebCore::WebGPUDevice::createTexture const):
2877         * Modules/webgpu/WebGPUDevice.h:
2878         * Modules/webgpu/WebGPUDevice.idl:
2879         * Modules/webgpu/WebGPUTexture.cpp:
2880         (WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
2881         (WebCore::WebGPUTexture::WebGPUTexture):
2882         * Modules/webgpu/WebGPUTexture.h:
2883
2884         Metal backend MTLTextureDescriptor and MTLTexture creation:
2885         * platform/graphics/gpu/GPUDevice.cpp:
2886         (WebCore::GPUDevice::tryCreateTexture const):
2887         * platform/graphics/gpu/GPUDevice.h:
2888         * platform/graphics/gpu/GPUTexture.h:
2889         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2890         (WebCore::mtlTextureTypeForGPUTextureDescriptor):
2891         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
2892         (WebCore::storageModeForPixelFormatAndSampleCount):
2893         (WebCore::tryCreateMtlTextureDescriptor):
2894         (WebCore::GPUTexture::tryCreate):
2895         (WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.
2896
2897         Add GPUUtils.h/cpp for shared utility functions:
2898         * SourcesCocoa.txt:
2899         * WebCore.xcodeproj/project.pbxproj:
2900         * platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
2901         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2902         (WebCore::GPUSwapChain::setFormat):
2903         (WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
2904         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
2905         (WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.
2906
2907 2019-02-07  Sihui Liu  <sihui_liu@apple.com>
2908
2909         REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
2910         https://bugs.webkit.org/show_bug.cgi?id=194402
2911         <rdar://problem/47858241>
2912
2913         Reviewed by Geoffrey Garen.
2914
2915         r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
2916         around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
2917         is valid during access.
2918
2919         * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
2920         (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
2921         (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
2922         * Modules/indexeddb/server/ServerOpenDBRequest.h:
2923
2924 2019-02-07  Timothy Hatcher  <timothy@apple.com>
2925
2926         Overflow element scrollbar is light for dark mode content.
2927         https://bugs.webkit.org/show_bug.cgi?id=194407
2928         rdar://problem/45991585
2929
2930         Reviewed by Beth Dakin.
2931
2932         Tested by css-dark-mode/supported-color-schemes-scrollbar.html.
2933
2934         * page/ChromeClient.h:
2935         (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
2936         short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
2937         that do not implement preferredScrollbarOverlayStyle().
2938         * page/FrameView.cpp:
2939         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
2940         to auto detect overlay style when page() is null.
2941         * rendering/RenderLayer.cpp:
2942         (WebCore::RenderLayer::useDarkAppearance const): Added.
2943         * rendering/RenderLayer.h:
2944         * testing/Internals.cpp:
2945         (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
2946         (WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
2947         * testing/Internals.h:
2948         * testing/Internals.idl:
2949
2950 2019-02-07  Eric Carlson  <eric.carlson@apple.com>
2951
2952         [MSE] Convert debug-only logging to runtime logging
2953         https://bugs.webkit.org/show_bug.cgi?id=194348
2954         <rdar://problem/47566449>
2955
2956         Reviewed by Jer Noble.
2957
2958         No new tests, this just changes existing logging.
2959
2960         * Modules/mediasource/MediaSource.cpp:
2961         (WebCore::convertEnumerationToString):
2962         (WebCore::MediaSource::MediaSource):
2963         (WebCore::MediaSource::~MediaSource):
2964         (WebCore::MediaSource::setPrivateAndOpen):
2965         (WebCore::MediaSource::addedToRegistry):
2966         (WebCore::MediaSource::removedFromRegistry):
2967         (WebCore::MediaSource::durationChanged):
2968         (WebCore::MediaSource::seekToTime):
2969         (WebCore::MediaSource::completeSeek):
2970         (WebCore::MediaSource::setLiveSeekableRange):
2971         (WebCore::MediaSource::clearLiveSeekableRange):
2972         (WebCore::MediaSource::setDuration):
2973         (WebCore::MediaSource::setDurationInternal):
2974         (WebCore::MediaSource::setReadyState):
2975         (WebCore::MediaSource::endOfStream):
2976         (WebCore::MediaSource::streamEndedWithError):
2977         (WebCore::MediaSource::addSourceBuffer):
2978         (WebCore::MediaSource::removeSourceBuffer):
2979         (WebCore::MediaSource::isTypeSupported):
2980         (WebCore::MediaSource::detachFromElement):
2981         (WebCore::MediaSource::attachToElement):
2982         (WebCore::MediaSource::openIfInEndedState):
2983         (WebCore::MediaSource::suspend):
2984         (WebCore::MediaSource::resume):
2985         (WebCore::MediaSource::stop):
2986         (WebCore::MediaSource::onReadyStateChange):
2987         (WebCore::MediaSource::scheduleEvent):
2988         (WebCore::MediaSource::logChannel const):
2989         (WebCore::MediaSourceInternal::toString): Deleted.
2990         * Modules/mediasource/MediaSource.h:
2991         (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
2992         (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
2993         * Modules/mediasource/SourceBuffer.cpp:
2994         (WebCore::SourceBuffer::SourceBuffer):
2995         (WebCore::SourceBuffer::~SourceBuffer):
2996         (WebCore::SourceBuffer::remove):
2997         (WebCore::SourceBuffer::seekToTime):
2998         (WebCore::SourceBuffer::appendBufferInternal):
2999         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
3000         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
3001         (WebCore::removeSamplesFromTrackBuffer):
3002         (WebCore::SourceBuffer::removeCodedFrames):
3003         (WebCore::SourceBuffer::evictCodedFrames):
3004         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
3005         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3006         (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
3007         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
3008         (WebCore::SourceBuffer::provideMediaData):
3009         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
3010         (WebCore::SourceBuffer::monitorBufferingRate):
3011         (WebCore::SourceBuffer::logChannel const):
3012         * Modules/mediasource/SourceBuffer.h:
3013         * dom/Document.cpp:
3014         (WebCore::messageSourceForWTFLogChannel):
3015         (WebCore::Document::didLogMessage):
3016         * html/HTMLMediaElement.cpp:
3017         (WebCore::convertEnumerationToString):
3018         (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
3019         (WebCore::HTMLMediaElement::selectMediaResource):
3020         (WebCore::HTMLMediaElement::loadResource):
3021         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3022         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
3023         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
3024         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
3025         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
3026         * platform/ContentType.cpp:
3027         (WebCore::ContentType::toJSONString const):
3028         * platform/ContentType.h:
3029         (WTF::LogArgument<WebCore::ContentType>::toString):
3030         * platform/MediaSample.h:
3031         (WebCore::MediaSample::toJSONString const):
3032         (WTF::LogArgument<WebCore::MediaSample>::toString):
3033         * platform/graphics/FloatSize.cpp:
3034         (WebCore::FloatSize::toJSONObject const):
3035         (WebCore::FloatSize::toJSONString const):
3036         * platform/graphics/FloatSize.h:
3037         (WTF::LogArgument<WebCore::FloatSize>::toString):
3038         * platform/graphics/MediaSourcePrivate.h:
3039         (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
3040         (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
3041         (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
3042         * platform/graphics/SourceBufferPrivate.h:
3043         (WebCore::SourceBufferPrivate::sourceBufferLogger const):
3044         (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
3045         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3046         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
3047         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
3048         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
3049         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
3050         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
3051         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
3052         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
3053         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3054         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
3055         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
3056         (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
3057         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3058         (WebCore::convertEnumerationToString):
3059         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
3060         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
3061         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
3062         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
3063         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
3064         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
3065         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
3066         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
3067         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
3068         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
3069         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
3070         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
3071         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
3072         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
3073         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
3074         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
3075         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
3076         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
3077         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
3078         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
3079         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3080         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
3081         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
3082         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
3083         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
3084         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
3085         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
3086         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
3087         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
3088         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
3089         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
3090         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3091         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3092         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3093         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
3094         (WebCore::MediaSampleAVFObjC::toJSONString const):
3095         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
3096         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
3097         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
3098         (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
3099         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
3100         (WebCore::MediaSourcePrivateAVFObjC::logChannel const):
3101         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3102         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3103         (WebCore::bufferWasConsumedCallback):
3104         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
3105         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
3106         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
3107         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
3108         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
3109         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
3110         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3111         (WebCore::SourceBufferPrivateAVFObjC::append):
3112         (WebCore::SourceBufferPrivateAVFObjC::abort):
3113         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
3114         (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
3115         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
3116         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3117         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
3118         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
3119         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
3120         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3121         (WebCore::SourceBufferPrivateAVFObjC::flush):
3122         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
3123         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3124         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
3125         (WebCore::SourceBufferPrivateAVFObjC::setActive):
3126         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
3127         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
3128         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
3129         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
3130         (WebCore::SourceBufferPrivateAVFObjC::logChannel const):
3131
3132 2019-02-07  Youenn Fablet  <youenn@apple.com>
3133
3134         Simplify applyConstraints callbacks
3135         https://bugs.webkit.org/show_bug.cgi?id=194297
3136
3137         Reviewed by Eric Carlson.
3138
3139         Make use of one callback for both success and failure cases.
3140         No changed of behavior.
3141
3142         * Modules/mediastream/MediaStreamTrack.cpp:
3143         (WebCore::MediaStreamTrack::applyConstraints):
3144         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3145         (WebCore::MediaStreamTrackPrivate::applyConstraints):
3146         * platform/mediastream/MediaStreamTrackPrivate.h:
3147         * platform/mediastream/RealtimeMediaSource.cpp:
3148         (WebCore::RealtimeMediaSource::applyConstraints):
3149         * platform/mediastream/RealtimeMediaSource.h:
3150         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3151         (WebCore::AVVideoCaptureSource::create):
3152         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3153         (WebCore::CoreAudioCaptureSource::create):
3154         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
3155         (WebCore::MockGStreamerAudioCaptureSource::applyConstraints):
3156         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
3157         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
3158         (WebCore::MockGStreamerVideoCaptureSource::applyConstraints):
3159         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
3160
3161 2019-02-07  Youenn Fablet  <youenn@apple.com>
3162
3163         Unable to sign in leetcode.
3164         https://bugs.webkit.org/show_bug.cgi?id=194366
3165         rdar://problem/47259025.
3166
3167         Reviewed by Chris Dumez.
3168
3169         In case a signal is passed as part of a FetchRequestInit,
3170         the IDL binding code is throwing an exception in case signal is not an AbortSignal object.
3171         This breaks an AbortSignal shim used in some web sites.
3172         Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest.
3173
3174         Test: http/wpt/fetch/request-abort.html
3175         Also covered by manually signing in to leetcode.
3176
3177         * Modules/fetch/FetchRequest.cpp:
3178         (WebCore::FetchRequest::initializeWith):
3179         * Modules/fetch/FetchRequestInit.h:
3180         (WebCore::FetchRequestInit::hasMembers const):
3181         * Modules/fetch/FetchRequestInit.idl:
3182
3183 2019-02-07  Youenn Fablet  <youenn@apple.com>
3184
3185         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
3186         https://bugs.webkit.org/show_bug.cgi?id=194312
3187
3188         Reviewed by Eric Carlson.
3189
3190         Add a way for sources to know when they are ended, i.e. that they will never be started again.
3191         No observable change of behavior.
3192
3193         * platform/mediastream/RealtimeMediaSource.cpp:
3194         (WebCore::RealtimeMediaSource::requestStop):
3195         * platform/mediastream/RealtimeMediaSource.h:
3196
3197 2019-02-07  Jer Noble  <jer.noble@apple.com>
3198
3199         HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class
3200         https://bugs.webkit.org/show_bug.cgi?id=194360
3201
3202         HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should
3203         really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement,
3204         make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor
3205         taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases.
3206
3207         Reviewed by Geoffrey Garen.
3208
3209         * Modules/applepay/ApplePaySession.cpp:
3210         (WebCore::ApplePaySession::ApplePaySession):
3211         * Modules/mediarecorder/MediaRecorder.cpp:
3212         (WebCore::MediaRecorder::MediaRecorder):
3213         * Modules/mediastream/MediaDevices.cpp:
3214         (WebCore::MediaDevices::MediaDevices):
3215         * Modules/mediastream/UserMediaRequest.cpp:
3216         (WebCore::UserMediaRequest::UserMediaRequest):
3217         * Modules/notifications/Notification.cpp:
3218         (WebCore::Notification::Notification):
3219         * Modules/paymentrequest/PaymentRequest.cpp:
3220         (WebCore::PaymentRequest::PaymentRequest):
3221         * Modules/webaudio/AudioContext.cpp:
3222         (WebCore::AudioContext::AudioContext):
3223         * animation/WebAnimation.cpp:
3224         (WebCore::WebAnimation::WebAnimation):
3225         * css/FontFaceSet.cpp:
3226         (WebCore::FontFaceSet::FontFaceSet):
3227         * dom/ActiveDOMObject.cpp:
3228         (WebCore::ActiveDOMObject::ActiveDOMObject):
3229         * dom/ActiveDOMObject.h:
3230         * dom/Document.h:
3231         (WebCore::ActiveDOMObject::ActiveDOMObject):
3232         * html/HTMLMarqueeElement.cpp:
3233         (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
3234         * html/HTMLMediaElement.cpp:
3235         (WebCore::HTMLMediaElement::HTMLMediaElement):
3236         * html/HTMLSourceElement.cpp:
3237         (WebCore::HTMLSourceElement::HTMLSourceElement):
3238         * page/IntersectionObserver.cpp:
3239         (WebCore::IntersectionObserver::IntersectionObserver):
3240
3241 2019-02-07  Zalan Bujtas  <zalan@apple.com>
3242
3243         [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
3244         https://bugs.webkit.org/show_bug.cgi?id=194391
3245
3246         Reviewed by Antti Koivisto.
3247
3248         The spec is not clear about this but that's what matches the current behaviour.
3249
3250         Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
3251
3252         * layout/FormattingContext.cpp:
3253         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3254
3255 2019-02-07  Zalan Bujtas  <zalan@apple.com>
3256
3257         [LFC] Use dedicated data structures for optional used values (input to geometry functions)
3258         https://bugs.webkit.org/show_bug.cgi?id=194376
3259
3260         Reviewed by Antti Koivisto.
3261
3262         This is in preparation for being able to pass in the containing block's width as an optional used value.
3263         During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.
3264
3265         * layout/FormattingContext.cpp:
3266         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3267         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3268         * layout/FormattingContext.h:
3269         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
3270         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
3271         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
3272         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
3273         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
3274         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
3275         (): Deleted.
3276         (WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
3277         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
3278         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
3279         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
3280         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
3281         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
3282         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
3283         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
3284         * layout/FormattingContextGeometry.cpp:
3285         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3286         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3287         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3288         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3289         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3290         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3291         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
3292         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3293         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
3294         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
3295         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
3296         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3297         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3298         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3299         * layout/LayoutUnits.h:
3300         * layout/blockformatting/BlockFormattingContext.cpp:
3301         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3302         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3303         * layout/blockformatting/BlockFormattingContext.h:
3304         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
3305         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
3306         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
3307         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
3308         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
3309         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3310         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3311         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3312         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3313         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3314         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
3315         * layout/inlineformatting/InlineFormattingContext.cpp:
3316         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
3317         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
3318         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3319         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
3320         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
3321         * page/FrameViewLayoutContext.cpp:
3322         (WebCore::layoutUsingFormattingContext):
3323
3324 2019-02-07  Antti Koivisto  <antti@apple.com>
3325
3326         Infinite recursion via CachedResource::~CachedResource
3327         https://bugs.webkit.org/show_bug.cgi?id=194378
3328         <rdar://problem/42023295>
3329
3330         Reviewed by Daniel Bates.
3331
3332         I don't know the exact steps to trigger this but the mechanism seems clear.
3333
3334         1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map.
3335         2) This decrements the handle count of resource and causes it be deleted.
3336         3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with
3337            resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled).
3338         4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created.
3339            This increments the handle count of the resource from 0 back to 1.
3340         5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3).
3341
3342         The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource.
3343         It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles.
3344
3345         Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource
3346         has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything
3347         other than bail out is going to crash.
3348
3349         CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to
3350         support this erranous call so they are removed as well.
3351
3352         * loader/ImageLoader.cpp:
3353         (WebCore::ImageLoader::updateFromElement):
3354         * loader/cache/CachedResource.cpp:
3355         (WebCore::CachedResource::~CachedResource):
3356
3357         This is the substantive change. The rest just removes now-dead code.
3358
3359         * loader/cache/CachedResource.h:
3360         (WebCore::CachedResource::setOwningCachedResourceLoader): Deleted.
3361         * loader/cache/CachedResourceLoader.cpp:
3362         (WebCore::CachedResourceLoader::~CachedResourceLoader):
3363         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3364         (WebCore::CachedResourceLoader::requestResource):
3365         (WebCore::CachedResourceLoader::loadResource):
3366         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
3367         (WebCore::CachedResourceLoader::removeCachedResource): Deleted.
3368         * loader/cache/CachedResourceLoader.h:
3369
3370 2019-02-07  Miguel Gomez  <magomez@igalia.com>
3371
3372         [WPE] Implement GStreamer based holepunch
3373         https://bugs.webkit.org/show_bug.cgi?id=193715
3374
3375         Reviewed by Xabier Rodriguez-Calvar.
3376
3377         Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
3378         video sink and drawing then, the player just draws a transparent rectangle on the position where
3379         the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
3380         sink which will be in charge of displaying the video frames in some way (usually on a plane below
3381         the browser), and will push empty frames to the compositor indicating that the rectangle to draw
3382         should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
3383         to tell the video sink where to position the video so it's set below the browser transparent hole.
3384
3385         Added ManualTest wpe/video-player-holepunch.html to test the feature.
3386
3387         * platform/graphics/MediaPlayer.cpp:
3388         (WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
3389         * platform/graphics/MediaPlayer.h:
3390         * platform/graphics/MediaPlayerPrivate.h:
3391         (WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
3392         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3393         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
3394         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
3395         (WebCore::setRectangleToVideoSink):
3396         (WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
3397         (WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
3398         (WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
3399         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
3400         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3401         * platform/graphics/texmap/TextureMapper.h:
3402         * platform/graphics/texmap/TextureMapperGL.cpp:
3403         (WebCore::TextureMapperGL::drawSolidColor):
3404         * platform/graphics/texmap/TextureMapperGL.h:
3405         * platform/graphics/texmap/TextureMapperLayer.cpp:
3406         (WebCore::TextureMapperLayer::paintSelf):
3407         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
3408         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
3409         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
3410         (WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
3411         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3412         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
3413         * rendering/RenderVideo.cpp:
3414         (WebCore::RenderVideo::videoBox const):
3415
3416 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
3417
3418         Unreviewed, rolling out r240759 and r240944.
3419
3420         Some timer uses are done off the main thread, WebCore::Timer
3421         cannot be used
3422
3423         Reverted changesets:
3424
3425         "<rdar://problem/47570443> Responsiveness timers are too
3426         expensive for frequent events"
3427         https://bugs.webkit.org/show_bug.cgi?id=194003
3428         https://trac.webkit.org/changeset/240759
3429
3430         "Use deferrable timer to restart the Responsiveness Timer on
3431         each wheel event"
3432         https://bugs.webkit.org/show_bug.cgi?id=194135
3433         https://trac.webkit.org/changeset/240944
3434
3435 2019-02-06  Keith Rollin  <krollin@apple.com>
3436
3437         Update .xcfilelist files
3438
3439         Unreviewed build fix.
3440
3441         * DerivedSources-input.xcfilelist:
3442         * DerivedSources-output.xcfilelist:
3443
3444 2019-02-06  Devin Rousso  <drousso@apple.com>
3445
3446         Web Inspector: DOM: don't send the entire function string with each event listener
3447         https://bugs.webkit.org/show_bug.cgi?id=194293
3448         <rdar://problem/47822809>
3449
3450         Reviewed by Joseph Pecoraro.
3451
3452         Test: inspector/dom/getEventListenersForNode.html
3453
3454         * inspector/agents/InspectorDOMAgent.cpp:
3455         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
3456
3457 2019-02-06  Andy Estes  <aestes@apple.com>
3458
3459         [Payment Request] It should be possible to require a phonetic name for shipping contacts
3460         https://bugs.webkit.org/show_bug.cgi?id=194311
3461         <rdar://46733045>
3462
3463         Reviewed by Alex Christensen.
3464
3465         It should be possible to require that a shipping contact has a phonetic name in Payment Request.
3466         To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
3467         ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.
3468
3469         Since required shipping contact fields can now be specified both in
3470         requiredShippingContactFields and PaymentOptions, we merge the required fields from these
3471         two sources such that, e.g., email is required if it is specified in either place.
3472
3473         So that clients can detect this new feature, the API version number is bumped from 5 to 6.
3474
3475         Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.
3476
3477         * DerivedSources.make:
3478         * Modules/applepay/ApplePayPaymentRequest.h:
3479         * Modules/applepay/ApplePayPaymentRequest.idl:
3480         * Modules/applepay/ApplePayRequestBase.cpp:
3481         (WebCore::convertAndValidate):
3482         * Modules/applepay/ApplePayRequestBase.h:
3483         * Modules/applepay/ApplePayRequestBase.idl:
3484         * Modules/applepay/ApplePaySession.cpp:
3485         (WebCore::convertAndValidate):
3486         * Modules/applepay/PaymentCoordinatorClient.cpp: Added.
3487         (WebCore::PaymentCoordinatorClient::supportsVersion):
3488         * Modules/applepay/PaymentCoordinatorClient.h:
3489         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3490         (WebCore::mergePaymentOptions):
3491         (WebCore::ApplePayPaymentHandler::show):
3492         * SourcesCocoa.txt:
3493         * WebCore.xcodeproj/project.pbxproj:
3494         * loader/EmptyClients.cpp:
3495         * testing/MockPaymentContactFields.h: Added.
3496         (WebCore::MockPaymentContactFields::MockPaymentContactFields):
3497         * testing/MockPaymentContactFields.idl: Added.
3498         * testing/MockPaymentCoordinator.cpp:
3499         (WebCore::MockPaymentCoordinator::showPaymentUI):
3500         (WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
3501         * testing/MockPaymentCoordinator.h:
3502         * testing/MockPaymentCoordinator.idl:
3503
3504 2019-02-06  Yusuke Suzuki  <ysuzuki@apple.com>
3505
3506         [JSC] PrivateName to PublicName hash table is wasteful
3507         https://bugs.webkit.org/show_bug.cgi?id=194277
3508
3509         Reviewed by Michael Saboff.
3510
3511         Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.
3512
3513         * bindings/js/JSDOMWindowCustom.cpp:
3514         (WebCore::addCrossOriginPropertyNames):
3515         * bindings/js/JSLocationCustom.cpp:
3516         (WebCore::getOwnPropertySlotCommon):
3517         (WebCore::putCommon):
3518         * bindings/js/WebCoreBuiltinNames.h:
3519
3520 2019-02-06  Keith Rollin  <krollin@apple.com>
3521
3522         Really enable the automatic checking and regenerations of .xcfilelists during builds
3523         https://bugs.webkit.org/show_bug.cgi?id=194357
3524         <rdar://problem/47861231>
3525
3526         Reviewed by Chris Dumez.
3527
3528         Bug 194124 was supposed to enable the automatic checking and
3529         regenerating of .xcfilelist files during the build. While related
3530         changes were included in that patch, the change to actually enable the
3531         operation somehow was omitted. This patch actually enables the
3532         operation. The check-xcfilelist.sh scripts now check
3533         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
3534         from the checking.
3535
3536         No new tests since there should be no observable behavior difference.
3537
3538         * Scripts/check-xcfilelists.sh:
3539
3540 2019-02-06  John Wilander  <wilander@apple.com>
3541
3542         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
3543         https://bugs.webkit.org/show_bug.cgi?id=194325
3544         <rdar://problem/47840283>
3545
3546         Reviewed by Chris Dumez.
3547
3548         No new tests. This is just data forwarding. Once the data is stored, I will create
3549         test infrastructure to query it.
3550
3551         * html/HTMLAnchorElement.cpp:
3552         (WebCore::HTMLAnchorElement::handleClick):
3553         * loader/AdClickAttribution.h:
3554         (WebCore::AdClickAttribution::encode const):
3555         (WebCore::AdClickAttribution::decode):
3556         (WebCore::AdClickAttribution::Conversion::encode const):
3557         (WebCore::AdClickAttribution::Conversion::decode):
3558             Infrastructure for IPC.
3559         * loader/FrameLoader.cpp:
3560         (WebCore::FrameLoader::urlSelected):
3561         (WebCore::FrameLoader::loadURLIntoChildFrame):
3562         (WebCore::FrameLoader::loadFrameRequest):
3563         (WebCore::FrameLoader::loadURL):
3564             These functions forward the optional WebCore::AdClickAttribution object
3565             FrameLoader::loadURL() creates the NavigationAction object and sets the
3566             WebCore::AdClickAttribution object on there.
3567         * loader/FrameLoader.h:
3568         (WebCore::FrameLoader::urlSelected):
3569         (WebCore::FrameLoader::loadURL):
3570         * loader/NavigationAction.h:
3571         (WebCore::NavigationAction::adClickAttribution):
3572         (WebCore::NavigationAction::setAdClickAttribution):
3573
3574 2019-02-06  Justin Fan  <justin_fan@apple.com>
3575
3576         [Web GPU] Implement supporting dictionaries for GPUTexture
3577         https://bugs.webkit.org/show_bug.cgi?id=194354
3578
3579         Reviewed by Dean Jackson.
3580
3581         Add dictionaries needed to create a GPUTextureDescriptor.
3582
3583         No new tests; no change in behavior. 
3584
3585         New interface and dictionaries added:
3586         * Modules/webgpu/GPUExtent3D.idl:
3587         * Modules/webgpu/GPUTextureDescriptor.idl:
3588         * Modules/webgpu/GPUTextureDimension.idl:
3589         * Modules/webgpu/GPUTextureUsage.idl:
3590         * platform/graphics/gpu/GPUExtent3D.h:
3591         * platform/graphics/gpu/GPUTextureDescriptor.h:
3592         * platform/graphics/gpu/GPUTextureDimension.h:
3593         * platform/graphics/gpu/GPUTextureUsage.h:
3594
3595         Update WebGPUTextureFormatEnum to GPUTextureFormat:
3596         * Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
3597         * Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
3598         * platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
3599         * Modules/webgpu/WebGPUSwapChain.cpp:
3600         * Modules/webgpu/WebGPUSwapChain.h:
3601         * Modules/webgpu/WebGPUSwapChain.idl:
3602         * platform/graphics/gpu/GPUSwapChain.h:
3603         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
3604         (WebCore::platformTextureFormatForGPUTextureFormat):
3605         (WebCore::GPUSwapChain::setFormat):
3606
3607         Update project files with new symbols:
3608         * CMakeLists.txt:
3609         * DerivedSources.make:
3610         * Sources.txt:
3611         * WebCore.xcodeproj/project.pbxproj:
3612         * bindings/js/WebCoreBuiltinNames.h:
3613
3614 2019-02-12  Dean Jackson  <dino@apple.com>
3615
3616         BitmapRenderer should handle existing ImageBuffers
3617         https://bugs.webkit.org/show_bug.cgi?id=194555
3618         <rdar://problem/47857150>
3619
3620         Reviewed by Tim Horton.
3621
3622         Our logic in ImageBitmapRenderingContext assumed that
3623         it had always created the ImageBuffer being used. However, it's
3624         valid to call something like toBlob() or toDataURL() before creating
3625         a context, so we need to handle the case where an ImageBuffer
3626         already exists.
3627
3628         Test: fast/canvas/bitmaprenderer-created-after-toBlob.html
3629
3630         * html/HTMLCanvasElement.cpp:
3631         (WebCore::HTMLCanvasElement::createImageBuffer const): Move some logic into setImageBuffer.
3632         (WebCore::HTMLCanvasElement::setImageBuffer const): Make sure to clear the state saver.
3633
3634 2019-02-06  Daniel Bates  <dabates@apple.com>
3635
3636         Standardize on ControlKey instead of CtrlKey
3637         https://bugs.webkit.org/show_bug.cgi?id=194317
3638
3639         Reviewed by Tim Horton.
3640
3641         * dom/UIEventWithKeyState.cpp:
3642         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
3643         (WebCore::UIEventWithKeyState::setModifierKeys):
3644         * dom/UIEventWithKeyState.h:
3645         (WebCore::UIEventWithKeyState::ctrlKey const):
3646         * page/ios/EventHandlerIOS.mm:
3647         (WebCore::EventHandler::accessKeyModifiers):
3648         * page/mac/EventHandlerMac.mm:
3649         (WebCore::EventHandler::accessKeyModifiers):
3650         * platform/PlatformEvent.h:
3651         (WebCore::PlatformEvent::controlKey const):
3652         (WebCore::PlatformEvent::PlatformEvent):
3653         (WebCore::PlatformEvent::ctrlKey const): Deleted.
3654         * platform/cocoa/KeyEventCocoa.mm:
3655         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
3656         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3657         (WebCore::modifiersForGdkKeyEvent):
3658         * platform/gtk/PlatformMouseEventGtk.cpp:
3659         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3660         * platform/gtk/PlatformWheelEventGtk.cpp:
3661         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3662         * platform/ios/KeyEventIOS.mm:
3663         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
3664         * platform/ios/PlatformEventFactoryIOS.mm:
3665         (WebCore::modifiersForEvent):
3666         * platform/mac/KeyEventMac.mm:
3667         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
3668         * platform/mac/PlatformEventFactoryMac.mm:
3669         (WebCore::modifiersForEvent):
3670         * testing/Internals.cpp:
3671         (WebCore::Internals::accessKeyModifiers const):
3672
3673 2019-02-06  Alex Christensen  <achristensen@webkit.org>
3674
3675         Fix WatchOS build
3676         https://bugs.webkit.org/show_bug.cgi?id=194353
3677
3678         Rubber stamped by Tim Horton and Wenson Hsieh.
3679
3680         * rendering/RenderThemeIOS.mm:
3681         (WebCore::iconForAttachment):
3682
3683 2019-02-06  Olivier Blin  <olivier.blin@softathome.com>
3684
3685         [SVG] fix SVGURIReference build by including SVGElement
3686         https://bugs.webkit.org/show_bug.cgi?id=194292
3687
3688         Reviewed by Michael Catanzaro.
3689
3690         * svg/SVGURIReference.h:
3691         SVGURIReference is making use of SVGElement in its constructor, but
3692         it was not declared.
3693
3694         The issue was not seen in unified builds because it was grouped with
3695         other files including SVGElement.
3696
3697 2019-02-06  Zalan Bujtas  <zalan@apple.com>
3698
3699         [LFC][IFC] Move line layout code to a dedicated file
3700         https://bugs.webkit.org/show_bug.cgi?id=194328
3701
3702         Reviewed by Antti Koivisto.
3703
3704         * Sources.txt:
3705         * WebCore.xcodeproj/project.pbxproj:
3706         * layout/inlineformatting/InlineFormattingContext.cpp:
3707         (WebCore::Layout::InlineFormattingContext::layout const):
3708         (WebCore::Layout::isTrimmableContent): Deleted.
3709         (WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
3710         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
3711         (WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
3712         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
3713         (WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
3714         (WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
3715         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
3716         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
3717         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
3718         * layout/inlineformatting/InlineFormattingContext.h:
3719         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
3720         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
3721         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
3722         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
3723         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
3724         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
3725         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
3726         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
3727         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
3728         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
3729         (WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
3730         (WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
3731         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
3732         (WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
3733         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
3734         (WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
3735         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
3736         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
3737         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
3738         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
3739         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3740         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
3741         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
3742         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
3743         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
3744         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
3745         * layout/inlineformatting/Line.cpp:
3746         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
3747         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
3748         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
3749         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
3750         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
3751         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
3752         (WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
3753         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
3754         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
3755         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
3756         (WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
3757         (WebCore::Layout::InlineFormattingContext::Line::close): Deleted.
3758
3759 2019-02-06  Youenn Fablet  <youenn@apple.com>
3760
3761         CoreAudioCaptureSource should not configure its audio unit until it starts producing data
3762         https://bugs.webkit.org/show_bug.cgi?id=194310
3763
3764         Reviewed by Eric Carlson.
3765
3766         Delay the configuration of the audio unit until the source is instructed to start producing data.
3767         This allows the UIProcess to not start changing the audio unit when
3768         checking for constraints during getUserMedia call before the prompt.
3769         Covered by manual testing.
3770
3771         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3772         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
3773         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
3774         (WebCore::CoreAudioCaptureSource::startProducingData):
3775         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3776
3777 2019-02-06  Youenn Fablet  <youenn@apple.com>
3778
3779         Disable audio ducking at Audio Unit setup time
3780         https://bugs.webkit.org/show_bug.cgi?id=194303
3781
3782         Reviewed by Eric Carlson.
3783
3784         When creating a CoreAudioCaptureSource, the audio unit might be
3785         reconfigured if a past audio capture was done.
3786         This might trigger audio ducking which is undone in startInternal.
3787         In some cases, startInternal will never call start.
3788         In that case, the audio unit will continue ducking the other processing.
3789         To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.
3790
3791         In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
3792         This might affect all applications.
3793         Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
3794         This has noticeable effects in the quality of audio being played on bluetooth devices.
3795
3796         Covered by manual tests.
3797
3798         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3799         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
3800         (WebCore::CoreAudioSharedUnit::unduck):
3801         (WebCore::CoreAudioSharedUnit::startInternal):
3802         (WebCore::CoreAudioSharedUnit::captureFailed):
3803         (WebCore::CoreAudioSharedUnit::stopProducingData):
3804
3805 2019-02-06  Antti Koivisto  <antti@apple.com>
3806
3807         RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
3808         https://bugs.webkit.org/show_bug.cgi?id=194333
3809         <rdar://problem/47822929>
3810
3811         Reviewed by Zalan Bujtas.
3812
3813         Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
3814         the legacy animation code triggering a resource load.
3815
3816         Test: http/tests/contentextensions/css-display-none-keyframe.html
3817
3818         * style/StyleScope.cpp:
3819         (WebCore::Style::Scope::scheduleUpdate):
3820
3821         Avoid clearing the style resolver if we are in the middle of a style resolution.
3822         A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
3823
3824 2019-02-06  Pablo Saavedra  <psaavedra@igalia.com>
3825
3826         Build failure after r240315
3827         https://bugs.webkit.org/show_bug.cgi?id=194341
3828
3829         Reviewed by Wenson Hsieh.
3830
3831         * bindings/js/JSUndoItemCustom.cpp:
3832         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
3833
3834 2019-02-05  Ryosuke Niwa  <rniwa@webkit.org>
3835
3836         REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
3837         https://bugs.webkit.org/show_bug.cgi?id=194329
3838
3839         Reviewed by Geoffrey Garen.
3840
3841         The bug was caused by the code path for when navigating with a specific target frame name that does not exist
3842         never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
3843         navigation, resulting in this release assertion.
3844
3845         Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.
3846
3847         Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html
3848
3849         * loader/FrameLoader.cpp:
3850         (WebCore::FrameLoader::loadURL):
3851
3852 2019-02-05  Claudio Saavedra  <csaavedra@igalia.com>
3853
3854         [FreeType] Build fix for Debian stable
3855
3856         Unreviewed build fix.
3857
3858         Debian stable currently has a version of fontconfig that doesn't
3859         yet have FC_COLOR. #ifdef its use to fix the build.
3860
3861         * platform/graphics/freetype/FontCacheFreeType.cpp:
3862         (WebCore::FontCache::systemFallbackForCharacters):
3863
3864 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3865
3866         Stop using blobRegistry in NetworkProcess
3867         https://bugs.webkit.org/show_bug.cgi?id=194027
3868
3869         Reviewed by Youenn Fablet.
3870
3871         Also stop using NetworkBlobRegistry::singleton.
3872         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
3873         We now have to resolve all blob file references while we still have a
3874         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
3875         using the singleton after we have passed everything to the loading code, but it works the same
3876         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
3877         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
3878         which extensions to revoke.
3879
3880         * platform/network/BlobRegistryImpl.h:
3881         * platform/network/FormData.cpp:
3882         (WebCore::appendBlobResolved):
3883         (WebCore::FormData::resolveBlobReferences):
3884         * platform/network/FormData.h:
3885         * platform/network/cf/FormDataStreamCFNet.cpp:
3886         (WebCore::createHTTPBodyCFReadStream):
3887         * platform/network/curl/CurlFormDataStream.cpp:
3888         (WebCore::CurlFormDataStream::CurlFormDataStream):
3889
3890 2019-02-05  Truitt Savell  <tsavell@apple.com>
3891
3892         Unreviewed, rolling out r240984.
3893
3894         Revision casued two API timeouts
3895
3896         Reverted changeset:
3897
3898         "Stop using blobRegistry in NetworkProcess"
3899         https://bugs.webkit.org/show_bug.cgi?id=194027
3900         https://trac.webkit.org/changeset/240984
3901
3902 2019-02-05  Keith Rollin  <krollin@apple.com>
3903
3904         Enable the automatic checking and regenerations of .xcfilelists during builds
3905         https://bugs.webkit.org/show_bug.cgi?id=194124
3906         <rdar://problem/47721277>
3907
3908         Reviewed by Tim Horton.
3909
3910         Bug 193790 add a facility for checking -- during build time -- that
3911         any needed .xcfilelist files are up-to-date and for updating them if
3912         they are not. This facility was initially opt-in by setting
3913         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
3914         the process seemed robust. Its now time to enable this facility and
3915         make it opt-out. If there is a need to disable this facility, set and
3916         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
3917         running `make` or `build-webkit`, or before running Xcode from the
3918         command line.
3919
3920         Additionally, remove the step that generates a list of source files
3921         going into the UnifiedSources build step. It's only necessarily to
3922         specify Sources.txt and SourcesCocoa.txt as inputs.
3923
3924         No new tests since there should be no observable behavior difference.
3925
3926         * UnifiedSources-input.xcfilelist: Removed.
3927         * WebCore.xcodeproj/project.pbxproj:
3928
3929 2019-02-05  Keith Rollin  <krollin@apple.com>
3930
3931         Update .xcfilelist files
3932         https://bugs.webkit.org/show_bug.cgi?id=194121
3933         <rdar://problem/47720863>
3934
3935         Reviewed by Tim Horton.
3936
3937         Preparatory to enabling the facility for automatically updating the
3938         .xcfilelist files, check in a freshly-updated set so that not everyone
3939         runs up against having to regenerate them themselves.
3940
3941         No new tests since there should be no observable behavior difference.
3942
3943         * DerivedSources-input.xcfilelist:
3944         * DerivedSources-output.xcfilelist:
3945
3946 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3947
3948         Stop using blobRegistry in NetworkProcess
3949         https://bugs.webkit.org/show_bug.cgi?id=194027
3950
3951         Reviewed by Youenn Fablet.
3952
3953         Also stop using NetworkBlobRegistry::singleton.
3954         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
3955         We now have to resolve all blob file references while we still have a
3956         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
3957         using the singleton after we have passed everything to the loading code, but it works the same
3958         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
3959         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
3960         which extensions to revoke.
3961