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