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