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