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