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