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