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