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