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