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