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