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