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