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