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