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