[Web Animations] Ensure setting the hold time invalidates the timing model
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-02-26  Antoine Quint  <graouts@apple.com>
2
3         [Web Animations] Ensure setting the hold time invalidates the timing model
4         https://bugs.webkit.org/show_bug.cgi?id=183136
5
6         Reviewed by Dean Jackson.
7
8         We used to always set the m_holdTime member variable directly, but the computation of the currentTime
9         depends on the value of m_holdTime, so setting the hold time should invalidate the timing model as well
10         as setting the m_holdTime member variable. In this patch we add a new setHoldTime() private method that
11         sets the member variable and invalidates the timing model.
12
13         * animation/WebAnimation.cpp:
14         (WebCore::WebAnimation::setTimeline):
15         (WebCore::WebAnimation::setHoldTime):
16         (WebCore::WebAnimation::silentlySetCurrentTime):
17         (WebCore::WebAnimation::setCurrentTime):
18         (WebCore::WebAnimation::cancel):
19         (WebCore::WebAnimation::finish):
20         (WebCore::WebAnimation::updateFinishedState):
21         (WebCore::WebAnimation::play):
22         (WebCore::WebAnimation::runPendingPlayTask):
23         (WebCore::WebAnimation::pause):
24         (WebCore::WebAnimation::runPendingPauseTask):
25         * animation/WebAnimation.h:
26
27 2018-02-26  Youenn Fablet  <youenn@apple.com>
28
29         MessagePort is not always destroyed in the right thread
30         https://bugs.webkit.org/show_bug.cgi?id=183053
31
32         Reviewed by Chris Dumez.
33
34         Make existingMessagePortForIdentifier take a lambda so that we hold the lock until there
35         is no longer a need to keep the MessagePort around.
36         This is very time sensitive and does not happen a lot when running WPT tests.
37
38         Update existing call sites to pass a lambda.
39
40         * dom/MessagePort.cpp:
41         (WebCore::MessagePort::existingMessagePortForIdentifier):
42         * dom/MessagePort.h:
43         * dom/messageports/MessagePortChannelProviderImpl.cpp:
44         (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
45         (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
46
47 2018-02-26  Commit Queue  <commit-queue@webkit.org>
48
49         Unreviewed, rolling out r226745.
50         https://bugs.webkit.org/show_bug.cgi?id=183132
51
52         This is breaking some websites (Requested by youenn on
53         #webkit).
54
55         Reverted changeset:
56
57         "Use no-cache fetch mode when loading main documents with
58         location.reload()"
59         https://bugs.webkit.org/show_bug.cgi?id=181285
60         https://trac.webkit.org/changeset/226745
61
62 2018-02-26  Philippe Normand  <pnormand@igalia.com>
63
64         Unreviewed, USE_GSTREAMER_PLAYBIN3 build fix.
65
66         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
67         There is no such ENABLE_GSTREAMER_PLAYBIN3.
68
69 2018-02-26  Philippe Normand  <pnormand@igalia.com>
70
71         Unreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors
72
73         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
74         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
75         Create an EGL display, even in Wayland.
76
77 2018-02-21  Sergio Villar Senin  <svillar@igalia.com>
78
79         [WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
80         https://bugs.webkit.org/show_bug.cgi?id=182999
81
82         Reviewed by Žan Doberšek.
83
84         Retrieve the z-depth of the eye view frustum and the HMD unique id.
85         The unique identifier is generated by the VRPlatormManager whereas
86         we use the default values from the spec for the z-depth (those can
87         be changed by applications later via JavaScript).
88
89         Once this lands the only remaining data to be retrieved from VR
90         backends for VRDisplay is the pose (getPose() call) and the frame
91         data (getFrameData() call).
92
93         * Modules/webvr/VRDisplay.cpp:
94         (WebCore::VRDisplay::VRDisplay):
95         (WebCore::VRDisplay::displayId const): Deleted.
96         (WebCore::VRDisplay::displayName const): Deleted.
97         (WebCore::VRDisplay::depthNear const): Deleted.
98         (WebCore::VRDisplay::setDepthNear): Deleted.
99         (WebCore::VRDisplay::depthFar const): Deleted.
100         (WebCore::VRDisplay::setDepthFar): Deleted.
101         * Modules/webvr/VRDisplay.h:
102         (WebCore::VRDisplay::displayId const): Moved implementation from
103         source file.
104         (WebCore::VRDisplay::displayName const): Ditto.
105         (WebCore::VRDisplay::depthNear const):
106         (WebCore::VRDisplay::setDepthNear):
107         (WebCore::VRDisplay::depthFar const):
108         (WebCore::VRDisplay::setDepthFar):
109         * platform/vr/VRManager.cpp:
110         (WebCore::VRManager::generateUniqueDisplayIdentifier):
111         * platform/vr/VRManager.h:
112         * platform/vr/VRPlatformDisplay.h:
113         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
114         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
115
116 2018-02-26  Charlie Turner  <cturner@igalia.com>
117
118         Fix build error with !LOG_DISABLED
119         https://bugs.webkit.org/show_bug.cgi?id=183049
120
121         Reviewed by Philippe Normand.
122
123         The following error message was being reported when doing a
124         release build with -DLOG_DISABLED=0:
125
126         ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’:
127 ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp:85:111: error: ‘logString’ was not declared in this scope
128      LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
129
130         Other uses of logString are guarded by !LOG_DISABLED rather than
131         NDEBUG, which was the cause of this issue.
132
133         * dom/messageports/MessagePortChannel.h: Guard using !LOG_DISABLED
134         rather than NDEBUG.
135
136 2018-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
137
138         [GStreamer] User current executable name instead of g_get_prgname() for gst_init
139         https://bugs.webkit.org/show_bug.cgi?id=183119
140
141         Reviewed by Philippe Normand.
142
143         g_get_prgname() is only set for programs using GOptionContext, calling gtk_init or explicitly calling
144         g_set_prgname(). Use WTF::getCurrentExecutableName() instead.
145
146         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
147         (WebCore::initializeGStreamer):
148
149 2018-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
150
151         [Extra zoom mode] Disable downloadable binary fonts by default
152         https://bugs.webkit.org/show_bug.cgi?id=183102
153         <rdar://problem/37860699>
154
155         Reviewed by Tim Horton.
156
157         Disable downloadable binary fonts by default in extra zoom mode by making the initial value of
158         `downloadableBinaryFontsEnabled` conditional. Layout tests are not possible at this time; test to be added once
159         layout test support is in place.
160
161         * page/Settings.yaml:
162         * page/SettingsBase.cpp:
163         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
164         * page/SettingsBase.h:
165
166 2018-02-25  Chris Dumez  <cdumez@apple.com>
167
168         Service workers do not work well inside Web.app
169         https://bugs.webkit.org/show_bug.cgi?id=183105
170         <rdar://problem/37864140>
171
172         Reviewed by Youenn Fablet.
173
174         SessionID::defaultSessionID() was hardcoded in the ServiceWorkerThread constructor
175         instead of using the sessionID of the SWServer that created the service worker thread.
176         As a result, when the Service Worker would establish a SWClientConnection to the
177         server, it would use the wrong sessionID and would end up using a different SWServer
178         (Since we have a different SWServer instance per sessionID). As a result,
179         ServiceWorkerRegistration / ServiceWorker objects inside the service worker would not
180         be kept in sync with the server (since they registered themselves with the wrong
181         SWServer).
182
183         Covered by new API test.
184
185         * workers/service/ServiceWorkerContextData.cpp:
186         (WebCore::ServiceWorkerContextData::isolatedCopy const):
187         * workers/service/ServiceWorkerContextData.h:
188         (WebCore::ServiceWorkerContextData::encode const):
189         (WebCore::ServiceWorkerContextData::decode):
190         * workers/service/context/ServiceWorkerThread.cpp:
191         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
192         * workers/service/context/ServiceWorkerThreadProxy.cpp:
193         (WebCore::createPageForServiceWorker):
194         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
195         * workers/service/server/RegistrationDatabase.cpp:
196         (WebCore::RegistrationDatabase::importRecords):
197         * workers/service/server/RegistrationStore.h:
198         (WebCore::RegistrationStore::server):
199         * workers/service/server/SWServer.cpp:
200         (WebCore::SWServer::updateWorker):
201         * workers/service/server/SWServerWorker.cpp:
202         (WebCore::SWServerWorker::contextData const):
203
204 2018-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
205
206         Null-dereference of the second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad
207         https://bugs.webkit.org/show_bug.cgi?id=182920
208
209         Reviewed by Darin Adler.
210
211         A test case
212         imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html
213         always crashes due to a null-dereference if compiled and optimized
214         by GCC 7.2. The second argument `resource` of
215         DocumentLoader::scheduleSubstituteResourceLoad can be null if the
216         resource can't be found in cache. I guess GCC optimizes inline
217         HashMap::add based on assuming the `resource` never becomes null
218         because its type is SubstituteResource&.
219
220         This changes introduces a new method
221         DocumentLoader::scheduleCannotShowURLError because it looks tricky
222         to pass a nullptr to the second argument of
223         scheduleSubstituteResourceLoad.
224
225         No new tests (Covered by existing tests).
226
227         * loader/DocumentLoader.cpp:
228         (WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method.
229         * loader/DocumentLoader.h:
230         * loader/appcache/ApplicationCacheHost.cpp:
231         (WebCore::ApplicationCacheHost::maybeLoadResource):
232         Call scheduleCannotShowURLError if the resource not found in the appcache.
233
234 2018-02-17  Darin Adler  <darin@apple.com>
235
236         Prepare for ExtendedColor changes (first step)
237         https://bugs.webkit.org/show_bug.cgi?id=182904
238
239         Reviewed by Sam Weinig.
240
241         * css/CSSValuePool.cpp:
242         (WebCore::CSSValuePool::createColorValue): Use HashMap::ensure.
243         (WebCore::CSSValuePool::createFontFamilyValue): Ditto.
244         (WebCore::CSSValuePool::createFontFaceValue): Ditto.
245
246         * css/parser/CSSParserFastPaths.cpp:
247         (WebCore::CSSParserFastPaths::maybeParseValue): Tightened up
248         the logic a bit.
249
250         * html/canvas/CanvasRenderingContext2D.cpp: Removed many unneeded includes.
251
252         * inspector/InspectorCanvas.cpp:
253         (WebCore::InspectorCanvas::recordAction): Updated for Ref instead of
254         RefPtr and to use move semantics.
255         (WebCore::buildArrayForAffineTransform): Return Ref instead of RefPtr.
256         (WebCore::buildArrayForVector): Ditto.
257         (WebCore::InspectorCanvas::buildInitialState): Ditto. Also use auto more.
258         (WebCore::InspectorCanvas::buildAction): Ditto.
259         (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Ditto.
260         (WebCore::InspectorCanvas::buildArrayForCanvasPattern): Ditto.
261         (WebCore::InspectorCanvas::buildArrayForImageData): Ditto.
262         * inspector/InspectorCanvas.h: Updated for the above. Also us "using" instead
263         of typedef and removed unneeded ErrorString typedef and some includes.
264
265         * page/DragController.cpp:
266         (WebCore::DragController::concludeEditDrag): Use auto and Ref.
267
268         * platform/DragData.h: Used pragma once and reorganized includes a bit.
269
270         * platform/graphics/ImageFrame.h:
271         (WebCore::ImageFrame::frameBytes const): Use uint32_t instead of RGBA32 to
272         prepare for removal of the RGBA32 type coming in a future patch.
273         * platform/graphics/ImageSource.cpp:
274         (WebCore::ImageSource::cacheNativeImageAtIndex): Ditto.
275         (WebCore::ImageSource::canUseAsyncDecoding): Ditto.
276
277         * platform/graphics/cocoa/GraphicsContextCocoa.mm: Tweaked #if for Mac-only
278         code to use PLATFORM(MAC) to be easier to read.
279         (WebCore::GraphicsContext::focusRingColor): Use sRGBColorSpaceRef instead of
280         calling CGColorSpaceCreateWithName each time.
281
282         * platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added include needed
283         now that it was removed from some header.
284
285         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Use uint32_t
286         instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch.
287         * platform/image-decoders/ScalableImageDecoder.cpp:
288         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
289         * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
290         (WebCore::ImageBackingStore::image const): Ditto.
291         * platform/image-decoders/gif/GIFImageDecoder.cpp:
292         (WebCore::GIFImageDecoder::haveDecodedRow): Ditto.
293         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
294         (WebCore::setPixel): Ditto.
295         (WebCore::JPEGImageDecoder::outputScanlines): Ditto.
296         * platform/image-decoders/png/PNGImageDecoder.cpp:
297         (WebCore::PNGImageDecoder::rowAvailable): Ditto.
298         (WebCore::PNGImageDecoder::frameComplete): Ditto.
299         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
300         (WebCore::WEBPImageDecoder::decodeFrame): Ditto.
301         (WebCore::WEBPImageDecoder::applyPostProcessing): Ditto.
302
303         * platform/mac/PlatformPasteboardMac.mm:
304         (WebCore::PlatformPasteboard::color): Added comments.
305
306         * rendering/EllipsisBox.cpp:
307         (WebCore::EllipsisBox::paintSelection): Use Color::isVisible.
308
309 2018-02-23  Chris Dumez  <cdumez@apple.com>
310
311         Crash under SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&)
312         https://bugs.webkit.org/show_bug.cgi?id=183066
313         <rdar://problem/37804111>
314
315         Reviewed by Ryosuke Niwa.
316
317         SecurityOrigin objects are constructed on various threads. However, someone added a
318         shouldTreatAsPotentiallyTrustworthy() call to the SecurityOrigin constructor which
319         was not thread safe. This is because this function relies on SchemeRegistry::shouldTreatURLSchemeAsSecure()
320         and SchemeRegistry::shouldTreatURLSchemeAsLocal() which were relying on global static HashMaps without
321         locks.
322
323         Update SecurityOrigin to initialize m_isPotentiallyTrustworthy lazily, to avoid paying
324         initialization cost in the constructor. This is only queries by SecurityContext::isSecureContext().
325
326         Make SchemeRegistry::shouldTreatURLSchemeAsLocal() and SchemeRegistry::shouldTreatURLSchemeAsSecure()
327         thread-safe, since they are needed to initialize SecurityOrigin::m_isPotentiallyTrustworthy from
328         various threads.
329
330         SchemeRegistry::shouldTreatURLSchemeAsSecure() is only called from SecurityOrigin (which requires
331         thread-safety), and getUserMedia() which is not hot code so the extra locking there should not
332         be an issue.
333
334         SchemeRegistry::shouldTreatURLSchemeAsLocal() is called from SecurityOrigin (which requires thread-
335         safety). It is also called from isQuickLookPreviewURL(), MHTMLArchive::create(), Page::userStyleSheetLocationChanged(),
336         isRemoteWebArchive() and HTMLPlugInImageElement. All these are not hot code so I do not think
337         we need a fast path.
338
339         * page/SecurityOrigin.cpp:
340         (WebCore::isLoopbackIPAddress):
341         (WebCore::shouldTreatAsPotentiallyTrustworthy):
342         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
343         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
344         * page/SecurityOrigin.h:
345         * platform/SchemeRegistry.cpp:
346         (WebCore::localURLSchemesLock):
347         (WebCore::localURLSchemes):
348         (WebCore::secureSchemesLock):
349         (WebCore::secureSchemes):
350         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
351         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
352         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
353         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
354         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
355         * platform/SchemeRegistry.h:
356
357 2018-02-23  Christopher Reid  <chris.reid@sony.com>
358
359         [Curl] Cookie Database files are wrongfully getting deleted when the database is opened
360         https://bugs.webkit.org/show_bug.cgi?id=183051
361
362         Reviewed by Per Arne Vollan.
363
364         The file stat logic was backwards causing a wrongful detection of database corruption.
365         Fixed the logic and abstracted these calls to use FileSystem.
366
367         * platform/network/curl/CookieJarDB.cpp:
368
369 2018-02-23  Zalan Bujtas  <zalan@apple.com>
370
371         [RenderTreeBuilder] Make RenderTreeBuilder::* classes WTF_MAKE_FAST_ALLOCATED
372         https://bugs.webkit.org/show_bug.cgi?id=183084
373         <rdar://problem/37828706>
374
375         Reviewed by Antti Koivisto.
376
377         * rendering/updating/RenderTreeBuilderBlock.h:
378         * rendering/updating/RenderTreeBuilderBlockFlow.h:
379         * rendering/updating/RenderTreeBuilderContinuation.h:
380         * rendering/updating/RenderTreeBuilderFirstLetter.h:
381         * rendering/updating/RenderTreeBuilderFormControls.h:
382         * rendering/updating/RenderTreeBuilderFullScreen.h:
383         * rendering/updating/RenderTreeBuilderInline.h:
384         * rendering/updating/RenderTreeBuilderList.h:
385         * rendering/updating/RenderTreeBuilderMathML.h:
386         * rendering/updating/RenderTreeBuilderMultiColumn.h:
387         * rendering/updating/RenderTreeBuilderRuby.h:
388         * rendering/updating/RenderTreeBuilderSVG.h:
389         * rendering/updating/RenderTreeBuilderTable.h:
390         * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
391
392 2018-02-23  Zalan Bujtas  <zalan@apple.com>
393
394         [RenderTreeBuilder] Move RenderFullScreen::createPlaceholder to RenderTreeBuilder
395         https://bugs.webkit.org/show_bug.cgi?id=183027
396         <rdar://problem/37773058>
397
398         Reviewed by Antti Koivisto.
399
400         No change in functionality.
401
402         * dom/Document.cpp:
403         (WebCore::Document::setFullScreenRenderer):
404         * dom/Document.h:
405         * rendering/RenderFullScreen.cpp:
406         (WebCore::RenderFullScreenPlaceholder::RenderFullScreenPlaceholder):
407         (WebCore::RenderFullScreenPlaceholder::isRenderFullScreenPlaceholder const):
408         (WebCore::RenderFullScreen::wrapNewRenderer):
409         (WebCore::RenderFullScreen::wrapExistingRenderer):
410         (): Deleted.
411         (WebCore::RenderFullScreen::createPlaceholder): Deleted.
412         * rendering/RenderFullScreen.h:
413         * rendering/updating/RenderTreeBuilder.cpp:
414         (WebCore::RenderTreeBuilder::createPlaceholderForFullScreen):
415         * rendering/updating/RenderTreeBuilder.h:
416         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
417         (WebCore::RenderTreeBuilder::FullScreen::createPlaceholder):
418         * rendering/updating/RenderTreeBuilderFullScreen.h:
419
420 2018-02-23  Zalan Bujtas  <zalan@apple.com>
421
422         [RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach()
423         https://bugs.webkit.org/show_bug.cgi?id=183073
424         <rdar://problem/37814585>
425
426         Reviewed by Antti Koivisto.
427
428         So that we don't destroy a renderer accidentally.
429
430         * rendering/updating/RenderTreeBuilderBlock.h:
431         * rendering/updating/RenderTreeBuilderRuby.h:
432         * rendering/updating/RenderTreeBuilderSVG.h:
433
434 2018-02-22  Antoine Quint  <graouts@apple.com>
435
436         REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS
437         https://bugs.webkit.org/show_bug.cgi?id=183074
438         <rdar://problem/37747028>
439
440         Reviewed by Eric Carlson.
441
442         Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html
443
444         In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media
445         element we stop listening to the bulk of media events and prevent controls from updating any DOM properties
446         so as to minimize the amount of CPU usage by the Web process.
447
448         An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing,
449         the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed"
450         property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning
451         "false". As a result, if the "controls" attribute was turned back on after the media started playing, they
452         would default to showing the start button, which would be then in the play state, ie. showing the pause icon.
453
454         We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered
455         regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on
456         the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back
457         to "true" from a previous "false" value.
458
459         * Modules/modern-media-controls/media/media-controller.js:
460         (MediaController.prototype.handleEvent):
461         * Modules/modern-media-controls/media/start-support.js:
462         (StartSupport):
463         (StartSupport.prototype.enable):
464         (StartSupport.prototype.handleEvent):
465         (StartSupport.prototype._updateShowsStartButton):
466
467 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
468
469         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
470         https://bugs.webkit.org/show_bug.cgi?id=173655
471         <rdar://problem/37706341>
472
473         Reviewed by Philippe Normand.
474
475         Do not assume gst is only used in the WebProcess, the MIMETypeRegistry also uses gst to get the list of
476         supported media types. Move the code to extract gst options from the process command line to a helper function
477         and use it in the UI process to pass the options to the WebProcess, but also in the current process when gst is
478         initialized without providing options.
479
480         Fixes several unit tests that use MIMETypeRegistry in the UI process.
481
482         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
483         (WebCore::extractGStreamerOptionsFromCommandLine): Helper to get the gst options from the current process
484         command line.
485         (WebCore::initializeGStreamer): Ensure this is called once. Get the gst options from the given vector or extract
486         it from the command line if not provided.
487         * platform/graphics/gstreamer/GStreamerUtilities.h:
488         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
489         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Bring back the gst
490         initialization here.
491
492 2018-02-23  Philippe Normand  <pnormand@igalia.com>
493
494         [GStreamer] HTTP totalBytes query returns 0 after seeking (sometimes)
495         https://bugs.webkit.org/show_bug.cgi?id=183002
496
497         Reviewed by Xabier Rodriguez-Calvar.
498
499         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
500         (webkit_web_src_init): Initialize member variables. Also no need
501         to set the appsrc size at that point.
502         (webKitWebSrcStop): There is no need to reset the size when
503         seeking. Size should in most cases represent the Content-Length
504         response attribute, even when seeking.
505         (webKitWebSrcStart): No need to reset the size attribute.
506         (webKitWebSrcQueryWithParent): Let appsrc handle DURATION queries.
507         (CachedResourceStreamingClient::responseReceived): Emit duration notification one time only.
508
509 2018-02-23  Philippe Normand  <pnormand@igalia.com>
510
511         [GStreamer] media/video-src-blob-using-open-panel.html crashes in Debug
512         https://bugs.webkit.org/show_bug.cgi?id=183005
513
514         Reviewed by Xabier Rodriguez-Calvar.
515
516         Test: media/video-src-blob-using-open-panel.html
517
518         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
519         (WebCore::convertToInternalProtocol): Also convert blob URIs
520         because they're handled by our httpsrc element.
521         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
522         (webKitWebSrcGetProtocols): Prefix blob URIs too, for consistency purpose.
523
524 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
525
526         Remove currentTime() / currentTimeMS()
527         https://bugs.webkit.org/show_bug.cgi?id=183052
528
529         Reviewed by Mark Lam.
530
531         * Modules/geolocation/Geolocation.cpp:
532         (WebCore::Geolocation::haveSuitableCachedPosition):
533         * dom/DOMTimeStamp.h:
534         (WebCore::convertSecondsToDOMTimeStamp):
535         * fileapi/File.cpp:
536         (WebCore::File::File):
537         (WebCore::File::lastModified const):
538         * history/HistoryItem.cpp:
539         (WebCore::generateSequenceNumber):
540         * html/BaseDateAndTimeInputType.cpp:
541         (WebCore::BaseDateAndTimeInputType::defaultValueForStepUp const):
542         * html/DateTimeInputType.cpp:
543         (WebCore::DateTimeInputType::defaultValueForStepUp const):
544         * html/MonthInputType.cpp:
545         (WebCore::MonthInputType::defaultValueForStepUp const):
546         * html/TimeInputType.cpp:
547         (WebCore::TimeInputType::defaultValueForStepUp const):
548         * inspector/agents/InspectorNetworkAgent.cpp:
549         (WebCore::InspectorNetworkAgent::willSendRequest):
550         (WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest):
551         * loader/EmptyFrameLoaderClient.h:
552         * loader/FormSubmission.cpp:
553         (WebCore::generateFormDataIdentifier):
554         * loader/FrameLoader.cpp:
555         (WebCore::FrameLoader::clientRedirected):
556         * loader/FrameLoader.h:
557         * loader/FrameLoaderClient.h:
558         * loader/NavigationScheduler.cpp:
559         * page/History.cpp:
560         (WebCore::History::stateObjectAdded):
561         * page/History.h:
562         * page/PageOverlay.cpp:
563         (WebCore::PageOverlay::startFadeAnimation):
564         (WebCore::PageOverlay::fadeAnimationTimerFired):
565         * page/PageOverlay.h:
566         * platform/graphics/cg/GraphicsContextCG.cpp:
567         (WebCore::GraphicsContext::drawNativeImage):
568         * platform/ios/LegacyTileLayerPool.h:
569         * platform/ios/LegacyTileLayerPool.mm:
570         (WebCore::LegacyTileLayerPool::LegacyTileLayerPool):
571         (WebCore::LegacyTileLayerPool::addLayer):
572         (WebCore::LegacyTileLayerPool::decayedCapacity const):
573         (WebCore::LegacyTileLayerPool::prune):
574         * platform/ios/SystemMemoryIOS.cpp:
575         (WebCore::systemMemoryLevel):
576         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
577         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
578
579 2018-02-22  Per Arne Vollan  <pvollan@apple.com>
580
581         The WebContent process should not use NSScreen in the screenDepth implementation.
582         https://bugs.webkit.org/show_bug.cgi?id=183048
583
584         Reviewed by Brent Fulgham.
585
586         NSScreen method calls should be done in the UIProcess, since these calls will communicate with
587         the WindowServer. The screen depth property can be retrieved in the UIProcess, and sent to the
588         WebContent process, where it is cached. Whenever screen properties change, the UIProcess will
589         send the new screen properties to the WebProcess.
590
591         No new tests, covered by existing tests.
592
593         * platform/ScreenProperties.h:
594         (WebCore::ScreenProperties::encode const):
595         (WebCore::ScreenProperties::decode):
596         * platform/mac/PlatformScreenMac.mm:
597         (WebCore::getScreenProperties):
598         (WebCore::screenDepth):
599         (WebCore::screenDepthPerComponent):
600         (WebCore::screenRect):
601         (WebCore::screenAvailableRect):
602
603 2018-02-22  Zalan Bujtas  <zalan@apple.com>
604
605         [RenderTreeBuilder] Rename insertChild() -> attach(), takeChild() -> detach() and removeAndDestroy() -> destroy()
606         https://bugs.webkit.org/show_bug.cgi?id=183061
607         <rdar://problem/37800269>
608
609         Reviewed by Ryosuke Niwa.
610
611         ...and moveChildTo() -> move() (moveChildrenTo() -> moveChildren()),
612         removeFromParentAndDestroyCleaningUpAnonymousWrappers() -> destroyAndCleanUpAnonymousWrappers()
613
614         No change in functionality.
615
616         * dom/Document.cpp:
617         (WebCore::Document::destroyRenderTree):
618         (WebCore::Document::setFullScreenRenderer):
619         * rendering/RenderBlockFlow.cpp:
620         (WebCore::RenderBlockFlow::styleDidChange):
621         * rendering/RenderButton.cpp:
622         (WebCore::RenderButton::setText):
623         * rendering/RenderElement.cpp:
624         (WebCore::RenderElement::didAttachChild):
625         (WebCore::RenderElement::didInsertChild): Deleted.
626         * rendering/RenderElement.h:
627         * rendering/RenderFullScreen.cpp:
628         (WebCore::RenderFullScreen::wrapNewRenderer):
629         (WebCore::RenderFullScreen::wrapExistingRenderer):
630         (WebCore::RenderFullScreen::unwrapRenderer):
631         (WebCore::RenderFullScreen::createPlaceholder):
632         * rendering/RenderMenuList.cpp:
633         (RenderMenuList::didAttachChild):
634         (RenderMenuList::setText):
635         (RenderMenuList::didInsertChild): Deleted.
636         * rendering/RenderMenuList.h:
637         * rendering/RenderQuote.cpp:
638         (WebCore::RenderQuote::updateTextRenderer):
639         * rendering/RenderTextFragment.cpp:
640         (WebCore::RenderTextFragment::setText):
641         * rendering/updating/RenderTreeBuilder.cpp:
642         (WebCore::RenderTreeBuilder::destroy):
643         (WebCore::RenderTreeBuilder::attach):
644         (WebCore::RenderTreeBuilder::attachIgnoringContinuation):
645         (WebCore::RenderTreeBuilder::detach):
646         (WebCore::RenderTreeBuilder::attachToRenderElement):
647         (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
648         (WebCore::RenderTreeBuilder::move):
649         (WebCore::RenderTreeBuilder::moveAllChildren):
650         (WebCore::RenderTreeBuilder::moveChildren):
651         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloats):
652         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
653         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
654         (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
655         (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
656         (WebCore::RenderTreeBuilder::detachFromRenderGrid):
657         (WebCore::RenderTreeBuilder::detachFromRenderElement):
658         (WebCore::RenderTreeBuilder::attachToRenderGrid):
659         (WebCore::RenderTreeBuilder::removeAndDestroy): Deleted.
660         (WebCore::RenderTreeBuilder::insertChild): Deleted.
661         (WebCore::RenderTreeBuilder::insertChildIgnoringContinuation): Deleted.
662         (WebCore::RenderTreeBuilder::takeChild): Deleted.
663         (WebCore::RenderTreeBuilder::insertChildToRenderElement): Deleted.
664         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal): Deleted.
665         (WebCore::RenderTreeBuilder::moveChildTo): Deleted.
666         (WebCore::RenderTreeBuilder::moveAllChildrenTo): Deleted.
667         (WebCore::RenderTreeBuilder::moveChildrenTo): Deleted.
668         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo): Deleted.
669         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
670         (WebCore::RenderTreeBuilder::takeChildFromRenderGrid): Deleted.
671         (WebCore::RenderTreeBuilder::takeChildFromRenderElement): Deleted.
672         (WebCore::RenderTreeBuilder::insertChildToRenderGrid): Deleted.
673         * rendering/updating/RenderTreeBuilder.h:
674         * rendering/updating/RenderTreeBuilderBlock.cpp:
675         (WebCore::RenderTreeBuilder::Block::attach):
676         (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
677         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
678         (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
679         (WebCore::RenderTreeBuilder::Block::detach):
680         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
681         (WebCore::RenderTreeBuilder::Block::insertChild): Deleted.
682         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation): Deleted.
683         (WebCore::RenderTreeBuilder::Block::takeChild): Deleted.
684         * rendering/updating/RenderTreeBuilderBlock.h:
685         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
686         (WebCore::RenderTreeBuilder::BlockFlow::attach):
687         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloats):
688         (WebCore::RenderTreeBuilder::BlockFlow::insertChild): Deleted.
689         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
690         * rendering/updating/RenderTreeBuilderBlockFlow.h:
691         * rendering/updating/RenderTreeBuilderContinuation.cpp:
692         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
693         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
694         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
695         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
696         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
697         * rendering/updating/RenderTreeBuilderFormControls.cpp:
698         (WebCore::RenderTreeBuilder::FormControls::attach):
699         (WebCore::RenderTreeBuilder::FormControls::detach):
700         (WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
701         (WebCore::RenderTreeBuilder::FormControls::insertChild): Deleted.
702         (WebCore::RenderTreeBuilder::FormControls::takeChild): Deleted.
703         * rendering/updating/RenderTreeBuilderFormControls.h:
704         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
705         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnDestroy):
706         * rendering/updating/RenderTreeBuilderInline.cpp:
707         (WebCore::RenderTreeBuilder::Inline::attach):
708         (WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
709         (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
710         (WebCore::RenderTreeBuilder::Inline::splitFlow):
711         (WebCore::RenderTreeBuilder::Inline::splitInlines):
712         (WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
713         (WebCore::RenderTreeBuilder::Inline::insertChild): Deleted.
714         (WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation): Deleted.
715         * rendering/updating/RenderTreeBuilderInline.h:
716         * rendering/updating/RenderTreeBuilderList.cpp:
717         (WebCore::RenderTreeBuilder::List::updateItemMarker):
718         * rendering/updating/RenderTreeBuilderMathML.cpp:
719         (WebCore::RenderTreeBuilder::MathML::makeFences):
720         (WebCore::RenderTreeBuilder::MathML::attach):
721         (WebCore::RenderTreeBuilder::MathML::insertChild): Deleted.
722         * rendering/updating/RenderTreeBuilderMathML.h:
723         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
724         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
725         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
726         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
727         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
728         * rendering/updating/RenderTreeBuilderRuby.cpp:
729         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
730         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
731         (WebCore::RenderTreeBuilder::Ruby::attach):
732         (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
733         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
734         (WebCore::RenderTreeBuilder::Ruby::detach):
735         (WebCore::RenderTreeBuilder::Ruby::insertChild): Deleted.
736         (WebCore::RenderTreeBuilder::Ruby::takeChild): Deleted.
737         * rendering/updating/RenderTreeBuilderRuby.h:
738         * rendering/updating/RenderTreeBuilderSVG.cpp:
739         (WebCore::RenderTreeBuilder::SVG::attach):
740         (WebCore::RenderTreeBuilder::SVG::detach):
741         (WebCore::RenderTreeBuilder::SVG::insertChild): Deleted.
742         (WebCore::RenderTreeBuilder::SVG::takeChild): Deleted.
743         * rendering/updating/RenderTreeBuilderSVG.h:
744         * rendering/updating/RenderTreeBuilderTable.cpp:
745         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
746         (WebCore::RenderTreeBuilder::Table::attach):
747         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
748         (WebCore::RenderTreeBuilder::Table::insertChild): Deleted.
749         * rendering/updating/RenderTreeBuilderTable.h:
750         * rendering/updating/RenderTreeUpdater.cpp:
751         (WebCore::RenderTreeUpdater::createRenderer):
752         (WebCore::RenderTreeUpdater::createTextRenderer):
753         (WebCore::RenderTreeUpdater::tearDownRenderers):
754         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
755         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
756         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
757         (WebCore::createContentRenderers):
758
759 2018-02-22  Chris Dumez  <cdumez@apple.com>
760
761         ResourceRequestBase::isolatedCopy() fails to isolate copy the cachePartition
762         https://bugs.webkit.org/show_bug.cgi?id=183059
763         <rdar://problem/37800202>
764
765         Reviewed by Youenn Fablet.
766
767         Update ResourceRequestBase::setAsIsolatedCopy() to call isolatedCopy() on the cachePartition as well,
768         given that it is a String and it would not be safe to send it to another thread otherwise.
769
770         * platform/network/ResourceRequestBase.cpp:
771         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
772
773 2018-02-22  Chris Dumez  <cdumez@apple.com>
774
775         ServiceWorkerContainer::startScriptFetchForJob() fails to isolate copy the registrationKey before passing it to the main thread
776         https://bugs.webkit.org/show_bug.cgi?id=183050
777         <rdar://problem/37796881>
778
779         Reviewed by Youenn Fablet.
780
781         Create an isolated copy of the registrationKey before passing it to the main thread in ServiceWorkerContainer's
782         startScriptFetchForJob() / jobFinishedLoadingScript() / jobFailedLoadingScript().
783
784         * workers/service/ServiceWorkerContainer.cpp:
785         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
786         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
787         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
788
789 2018-02-22  Chris Dumez  <cdumez@apple.com>
790
791         ServiceWorkerContainer::scheduleJob() fails to isolate copy the jobData before passing it to the main thread
792         https://bugs.webkit.org/show_bug.cgi?id=183046
793         <rdar://problem/37793395>
794
795         Reviewed by Youenn Fablet.
796
797         Make sure we isolate copy the jobData before passing it to the main thread in ServiceWorkerContainer::scheduleJob().
798         The jobData contains Strings / URLs so it is not safe to have non-isolated copies of it on various threads.
799
800         * workers/service/ServiceWorkerContainer.cpp:
801         (WebCore::ServiceWorkerContainer::scheduleJob):
802
803 2018-02-22  Basuke Suzuki  <Basuke.Suzuki@sony.com>
804
805         [Curl] Fix warning on clang.
806         https://bugs.webkit.org/show_bug.cgi?id=182986
807
808         Reviewed by Konstantin Tokarev.
809
810         No new tests because there's no behaviro changes.
811
812         * platform/network/curl/CurlResourceHandleDelegate.cpp:
813         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
814         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
815         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
816         * platform/network/curl/CurlResourceHandleDelegate.h:
817
818 2018-02-22  Youenn Fablet  <youenn@apple.com>
819
820         WorkerCacheStorageConnection::doRemove can assert in case two frames try to delete the same cache at the same time
821         https://bugs.webkit.org/show_bug.cgi?id=183041
822
823         Reviewed by Chris Dumez.
824
825         * Modules/cache/WorkerCacheStorageConnection.cpp:
826         (WebCore::WorkerCacheStorageConnection::doRemove): Update the assertion to accept the
827         case of an already deleted cache, i.e. returned identifer is 0.
828
829 2018-02-22  Alejandro G. Castro  <alex@igalia.com>
830
831         Remove some code leftovers in LibWebRTCMediaEndpoint and RealtimeOutgoingVideoSource classes
832         https://bugs.webkit.org/show_bug.cgi?id=183031
833
834         Reviewed by Youenn Fablet.
835
836         This include and namespace are not required in the file.
837
838         Just removing unused code, no tests required.
839
840         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
841
842 2018-02-22  Chris Dumez  <cdumez@apple.com>
843
844         Document.open() cancels existing provisional load but not navigation policy check
845         https://bugs.webkit.org/show_bug.cgi?id=183012
846         <rdar://problem/37755831>
847
848         Reviewed by Alex Christensen.
849
850         Test: fast/dom/Document/open-with-pending-load-async-policy.html
851
852         * dom/Document.cpp:
853         (WebCore::Document::open):
854         The existing code was calling FrameLoader::stopAllLoaders() when the loader's state
855         is FrameStateProvisional. The issue is that the FrameLoader's state only gets set
856         to FrameStateProvisional after the policy decision for the navigation is made.
857         This means that we fail to cancel a pending load if is still in the policy decision
858         stage, which can happen when the policy decision is made asynchronously. We now
859         also cancel such pending navigation policy checks as well.
860
861         * loader/PolicyChecker.cpp:
862         (WebCore::PolicyChecker::checkNavigationPolicy):
863         Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the
864         lambda. Otherwise, it gets reset too early when the policy decision is made
865         asynchronously.
866
867 2018-02-22  Youenn Fablet  <youenn@apple.com>
868
869         Add release asserts for service worker fetch and postMessage events
870         https://bugs.webkit.org/show_bug.cgi?id=183025
871         rdar://problem/37765052
872
873         Reviewed by Daniel Bates.
874
875         Add release assertion so that a service worker will only dispatch a message event
876         for clients and service workers with the same origin.
877         No change of behavior.
878
879         * platform/network/ResourceRequestBase.h:
880         * workers/service/context/ServiceWorkerThread.cpp:
881         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
882         * workers/service/context/ServiceWorkerThreadProxy.h:
883
884 2018-02-22  Miguel Gomez  <magomez@igalia.com>
885
886         including both gl3.h and gl2.h when USE_OPENGL_ES is enabled
887         https://bugs.webkit.org/show_bug.cgi?id=183008
888
889         Reviewed by Michael Catanzaro.
890
891         Don't include GLES3 headers as we stick to GLES2 API resources.
892
893         No new tests, no behavior change.
894
895         * platform/graphics/GLContext.cpp:
896
897 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
898
899         [GTK][WPE] Fix some build errors in service workers code
900         https://bugs.webkit.org/show_bug.cgi?id=182966
901
902         Reviewed by Žan Doberšek.
903
904         No new tests: no change in behavior.
905
906         * workers/service/ServiceWorkerProvider.h: add missing forward declaration.
907
908 2018-02-21  Zalan Bujtas  <zalan@apple.com>
909
910         [RenderTreeBuilder] Move RenderObject::insertedInto() mutation logic to RenderTreeBuilder
911         https://bugs.webkit.org/show_bug.cgi?id=183022
912         <rdar://problem/37764326>
913
914         Reviewed by Antti Koivisto.
915
916         No change in functionality.
917
918         * rendering/RenderObject.cpp:
919         (WebCore::RenderObject::insertedIntoTree):
920         * rendering/updating/RenderTreeBuilder.cpp:
921         (WebCore::RenderTreeBuilder::insertChildToRenderElementInternal):
922         (WebCore::RenderTreeBuilder::moveChildrenTo):
923         (WebCore::RenderTreeBuilder::multiColumnDescendantInserted): Deleted.
924         * rendering/updating/RenderTreeBuilder.h:
925
926 2018-02-21  Tim Horton  <timothy_horton@apple.com>
927
928         Include all Cocoa sources in all Cocoa platform builds
929         https://bugs.webkit.org/show_bug.cgi?id=183026
930         <rdar://problem/37513101>
931
932         Reviewed by Dan Bernstein.
933
934         Similar to r228571, don't have separate Sources files for iOS and Mac.
935         All sources now have #ifdefs that ensure that only the right ones
936         build on the right platforms. This makes it much easier to reason
937         about what builds where by just looking at the sources.
938
939         * SourcesCocoa.txt:
940         * SourcesIOS.txt: Removed.
941         * SourcesMac.txt: Removed.
942         * WebCore.xcodeproj/project.pbxproj:
943         * editing/WebContentReader.h:
944         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
945
946 2018-02-21  Youenn Fablet  <youenn@apple.com>
947
948         Make SubstituteResource take a ResourceResponse r-value
949         https://bugs.webkit.org/show_bug.cgi?id=183020
950
951         Reviewed by Alex Christensen.
952
953         No change of behavior.
954         Make SubstituteResource take a ResourceResponse r-value.
955         Update ArchiveResource accordingly.
956         Take benefit of that in ApplicationCacheResource to set the response source to ApplicationCache
957         before passing it to SubstituteResource constructor.
958
959         * loader/SubstituteResource.h:
960         (WebCore::SubstituteResource::SubstituteResource):
961         (WebCore::SubstituteResource::resourceResponse): Deleted.
962         * loader/appcache/ApplicationCacheResource.cpp:
963         (WebCore::ApplicationCacheResource::create):
964         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
965         * loader/appcache/ApplicationCacheResource.h:
966         (WebCore::ApplicationCacheResource::create): Deleted.
967         * loader/archive/ArchiveResource.cpp:
968         (WebCore::ArchiveResource::ArchiveResource):
969
970 2018-02-21  Zalan Bujtas  <zalan@apple.com>
971
972         [RenderTreeBuilder] ::willBeRemoved() does not need RenderTreeBuilder anymore.
973         https://bugs.webkit.org/show_bug.cgi?id=183019
974         <rdar://problem/37761421>
975
976         Reviewed by Antti Koivisto.
977
978         All the willBeDestroyed() mutations have been moved over to RenderTreeBuilder. 
979
980         No change in functionality.
981
982         * rendering/RenderBlock.cpp:
983         (WebCore::RenderBlock::willBeDestroyed):
984         * rendering/RenderBlock.h:
985         * rendering/RenderBlockFlow.cpp:
986         (WebCore::RenderBlockFlow::willBeDestroyed):
987         * rendering/RenderBlockFlow.h:
988         * rendering/RenderBox.cpp:
989         (WebCore::RenderBox::willBeDestroyed):
990         * rendering/RenderBox.h:
991         * rendering/RenderBoxModelObject.cpp:
992         (WebCore::RenderBoxModelObject::willBeDestroyed):
993         * rendering/RenderBoxModelObject.h:
994         * rendering/RenderCounter.cpp:
995         (WebCore::RenderCounter::willBeDestroyed):
996         * rendering/RenderCounter.h:
997         * rendering/RenderElement.cpp:
998         (WebCore::RenderElement::willBeDestroyed):
999         * rendering/RenderElement.h:
1000         * rendering/RenderEmbeddedObject.cpp:
1001         (WebCore::RenderEmbeddedObject::willBeDestroyed):
1002         * rendering/RenderEmbeddedObject.h:
1003         * rendering/RenderFragmentedFlow.cpp:
1004         (WebCore::RenderFragmentedFlow::willBeDestroyed):
1005         * rendering/RenderFragmentedFlow.h:
1006         * rendering/RenderImage.cpp:
1007         (WebCore::RenderImage::willBeDestroyed):
1008         * rendering/RenderImage.h:
1009         * rendering/RenderInline.cpp:
1010         (WebCore::RenderInline::willBeDestroyed):
1011         * rendering/RenderInline.h:
1012         * rendering/RenderLayerModelObject.cpp:
1013         (WebCore::RenderLayerModelObject::willBeDestroyed):
1014         * rendering/RenderLayerModelObject.h:
1015         * rendering/RenderListBox.cpp:
1016         (WebCore::RenderListBox::willBeDestroyed):
1017         * rendering/RenderListBox.h:
1018         * rendering/RenderListMarker.cpp:
1019         (WebCore::RenderListMarker::willBeDestroyed):
1020         * rendering/RenderListMarker.h:
1021         * rendering/RenderMenuList.cpp:
1022         (WebCore::RenderMenuList::willBeDestroyed):
1023         * rendering/RenderMenuList.h:
1024         * rendering/RenderObject.cpp:
1025         (WebCore::RenderObject::willBeDestroyed):
1026         (WebCore::RenderObject::destroy):
1027         * rendering/RenderObject.h:
1028         * rendering/RenderReplaced.cpp:
1029         (WebCore::RenderReplaced::willBeDestroyed):
1030         * rendering/RenderReplaced.h:
1031         * rendering/RenderSearchField.cpp:
1032         (WebCore::RenderSearchField::willBeDestroyed):
1033         * rendering/RenderSearchField.h:
1034         * rendering/RenderSnapshottedPlugIn.cpp:
1035         (WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
1036         * rendering/RenderSnapshottedPlugIn.h:
1037         * rendering/RenderText.cpp:
1038         (WebCore::RenderText::willBeDestroyed):
1039         * rendering/RenderText.h:
1040         * rendering/RenderTextControlMultiLine.cpp:
1041         (WebCore::RenderTextControlMultiLine::willBeDestroyed):
1042         * rendering/RenderTextControlMultiLine.h:
1043         * rendering/RenderVideo.cpp:
1044         (WebCore::RenderVideo::willBeDestroyed):
1045         * rendering/RenderVideo.h:
1046         * rendering/RenderWidget.cpp:
1047         (WebCore::RenderWidget::willBeDestroyed):
1048         * rendering/RenderWidget.h:
1049         * rendering/svg/RenderSVGBlock.cpp:
1050         (WebCore::RenderSVGBlock::willBeDestroyed):
1051         * rendering/svg/RenderSVGBlock.h:
1052         * rendering/svg/RenderSVGImage.cpp:
1053         (WebCore::RenderSVGImage::willBeDestroyed):
1054         * rendering/svg/RenderSVGImage.h:
1055         * rendering/svg/RenderSVGInline.cpp:
1056         (WebCore::RenderSVGInline::willBeDestroyed):
1057         * rendering/svg/RenderSVGInline.h:
1058         * rendering/svg/RenderSVGModelObject.cpp:
1059         (WebCore::RenderSVGModelObject::willBeDestroyed):
1060         * rendering/svg/RenderSVGModelObject.h:
1061         * rendering/svg/RenderSVGResourceContainer.cpp:
1062         (WebCore::RenderSVGResourceContainer::willBeDestroyed):
1063         * rendering/svg/RenderSVGResourceContainer.h:
1064         * rendering/svg/RenderSVGRoot.cpp:
1065         (WebCore::RenderSVGRoot::willBeDestroyed):
1066         * rendering/svg/RenderSVGRoot.h:
1067         * rendering/svg/RenderSVGText.cpp:
1068         (WebCore::RenderSVGText::willBeDestroyed):
1069         * rendering/svg/RenderSVGText.h:
1070
1071 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
1072
1073         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
1074         https://bugs.webkit.org/show_bug.cgi?id=182855
1075
1076         Reviewed by Brent Fulgham.
1077
1078         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
1079         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
1080         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
1081         process whenever there is a change in the display properties, and have the WebContent process cache these
1082         display properties. This message should also be sent to a newly started WebContent process.
1083
1084         No new tests, covered by existing tests.
1085
1086         * WebCore.xcodeproj/project.pbxproj:
1087         * platform/PlatformScreen.h:
1088         * platform/mac/PlatformScreenMac.mm:
1089         (WebCore::getScreenProperties):
1090         (WebCore::screenProperties):
1091         (WebCore::setScreenProperties):
1092         (WebCore::screenRect):
1093         (WebCore::screenAvailableRect):
1094         * platform/ScreenProperties.h: Added.
1095         (WebCore::ScreenProperties::encode const):
1096         (WebCore::ScreenProperties::decode):
1097
1098 2018-02-21  Christopher Reid  <chris.reid@sony.com>
1099
1100         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
1101         https://bugs.webkit.org/show_bug.cgi?id=182751
1102
1103         Reviewed by Youenn Fablet.
1104
1105         No change in behavior.
1106
1107         Adding support to set a custom CookieJar Database.
1108         Took CookieJarDB::open() out of its constructor because both the Network and Web process
1109         were trying to open the journal files but one process was failing due to a lack of permission.
1110         Now the database file is lazily opened and only the Network process will try to open the database.
1111         Some cleanup was done to CookieJarDB too.
1112
1113         * platform/network/NetworkStorageSession.h:
1114         * platform/network/curl/CookieJarDB.cpp:
1115         * platform/network/curl/CookieJarDB.h:
1116         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1117
1118 2018-02-21  Chris Dumez  <cdumez@apple.com>
1119
1120         Regression(r228708): Crash under WebCore::MediaResource::responseReceived(WebCore::CachedResource&, WebCore::ResourceResponse const&)
1121         https://bugs.webkit.org/show_bug.cgi?id=183018
1122         <rdar://problem/37754154>
1123
1124         Reviewed by Eric Carlson.
1125
1126         The fix at r228708 was trying to address the fact that avplayer sometimes
1127         deallocates WebCoreNSURLSessionDataTask objects on a non-main thread, which
1128         was not safe because its _resource data member needs to be deallocated on
1129         the main thread.
1130
1131         The issue is that r228708 caused _resource to outlive its WebCoreNSURLSessionDataTask.
1132         This is an issue because _resource has a client data member (of type WebCoreNSURLSessionDataTaskClient)
1133         which has a raw pointer to the WebCoreNSURLSessionDataTask. This means that the main thread could
1134         call methods like responseReceived() on the resource, which would call responseReceived() on the
1135         client, which would try to call [WebCoreNSURLSessionDataTask receivedResponse:] with an invalid
1136         m_task pointer.
1137
1138         To address the issue, I introduced a clearTask() method on WebCoreNSURLSessionDataTaskClient, which
1139         gets called from a non-main thread to clear the client's m_task pointer when the task is destroyed
1140         on a non-main thread. So that this is safe, every time the client tries to use m_task, we now
1141         acquire a lock for thread-safety and do a null-check on m_task.
1142
1143         No new tests, no known reproduction case.
1144
1145         * platform/graphics/PlatformMediaResourceLoader.h:
1146         (WebCore::PlatformMediaResource::client):
1147         * platform/network/cocoa/WebCoreNSURLSession.mm:
1148         (WebCore::WebCoreNSURLSessionDataTaskClient::clearTask):
1149         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
1150         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1151         (WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse):
1152         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
1153         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
1154         (WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed):
1155         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed):
1156         (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
1157         (-[WebCoreNSURLSessionDataTask dealloc]):
1158
1159 2018-02-21  Youenn Fablet  <youenn@apple.com>
1160
1161         Move AppCache loading to the NetworkProcess
1162         https://bugs.webkit.org/show_bug.cgi?id=178540
1163         <rdar://problem/37119346>
1164
1165         Reviewed by Alex Christensen.
1166
1167         Covered by existing tests.
1168
1169         Use ApplicationResourceLoader for cache entry loading.
1170         Remove all ResourceHandle use from ApplicationCacheGroup.
1171         Renamed m_loader in m_manifestLoader and added a new m_entryLoader to load cache entries.
1172
1173         Updated ApplicationCacheResourceLoader to handle different types of CachedResource.
1174         This allows in particular to handle redirections based on the resource type and create the ApplicationCacheResource with the right type.
1175         Use Include as credentials mode as per specification.
1176
1177         Add a new ApplicationCache ResourceResonse::Source.
1178         This allows fixing an assertion and should allow better inspector support if needs be.
1179
1180         * inspector/agents/InspectorNetworkAgent.cpp:
1181         (WebCore::responseSource):
1182         * loader/ResourceLoader.cpp:
1183         (WebCore::logResourceResponseSource):
1184         * loader/SubstituteResource.h:
1185         (WebCore::SubstituteResource::resourceResponse):
1186         * loader/appcache/ApplicationCacheGroup.cpp:
1187         (WebCore::ApplicationCacheGroup::stopLoading):
1188         (WebCore::ApplicationCacheGroup::update):
1189         (WebCore::ApplicationCacheGroup::didFinishLoading):
1190         (WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
1191         (WebCore::ApplicationCacheGroup::didFail):
1192         (WebCore::ApplicationCacheGroup::didFailLoadingEntry):
1193         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
1194         (WebCore::ApplicationCacheGroup::startLoadingEntry):
1195         * loader/appcache/ApplicationCacheGroup.h:
1196         * loader/appcache/ApplicationCacheResource.cpp:
1197         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
1198         * loader/appcache/ApplicationCacheResourceLoader.cpp:
1199         (WebCore::ApplicationCacheResourceLoader::create):
1200         (WebCore::ApplicationCacheResourceLoader::ApplicationCacheResourceLoader):
1201         (WebCore::ApplicationCacheResourceLoader::responseReceived):
1202         (WebCore::ApplicationCacheResourceLoader::redirectReceived):
1203         * loader/appcache/ApplicationCacheResourceLoader.h:
1204         * platform/network/ResourceResponseBase.h:
1205         * platform/network/cocoa/ResourceResponseCocoa.mm:
1206         (WebCore::ResourceResponse::platformCertificateInfo const):
1207         * testing/Internals.cpp:
1208         (WebCore::responseSourceToString):
1209
1210 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1211
1212         [RenderTreeBuilder] Move RenderBoxModelObject::willBeRemoved() mutation logic to RenderTreeBuilder
1213         https://bugs.webkit.org/show_bug.cgi?id=183014
1214         <rdar://problem/37757428>
1215
1216         Reviewed by Antti Koivisto.
1217
1218         No change in functionality.
1219
1220         * Sources.txt:
1221         * WebCore.xcodeproj/project.pbxproj:
1222         * rendering/RenderBoxModelObject.cpp:
1223         (WebCore::RenderBoxModelObject::~RenderBoxModelObject):
1224         (WebCore::RenderBoxModelObject::willBeDestroyed):
1225         (WebCore::RenderBoxModelObject::continuationChainNode const):
1226         (): Deleted.
1227         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations): Deleted.
1228         * rendering/RenderBoxModelObject.h:
1229         * rendering/updating/RenderTreeBuilder.cpp:
1230         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
1231         (WebCore::RenderTreeBuilder::removeAndDestroy):
1232         * rendering/updating/RenderTreeBuilder.h:
1233         (WebCore::RenderTreeBuilder::continuationBuilder):
1234         * rendering/updating/RenderTreeBuilderContinuation.cpp: Added.
1235         (WebCore::RenderTreeBuilder::Continuation::Continuation):
1236         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
1237         * rendering/updating/RenderTreeBuilderContinuation.h: Added.
1238
1239 2018-02-21  Youenn Fablet  <youenn@apple.com>
1240
1241         ServiceWorkerJob::m_lastResponse is unneeded
1242         https://bugs.webkit.org/show_bug.cgi?id=183013
1243
1244         Reviewed by Chris Dumez.
1245
1246         Remove this field since not used anywhere.
1247
1248         * workers/service/ServiceWorkerJob.cpp:
1249         (WebCore::ServiceWorkerJob::didReceiveResponse):
1250         * workers/service/ServiceWorkerJob.h:
1251
1252 2018-02-21  Youenn Fablet  <youenn@apple.com>
1253
1254         Use ResourceLoader to load appcache manifest
1255         https://bugs.webkit.org/show_bug.cgi?id=182861
1256
1257         Reviewed by Alex Christensen.
1258
1259         Covered by updated tests.
1260
1261         Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
1262         Make use of it to load the app cache manifest.
1263         Future work should load entries using the same loader.
1264
1265         Remove manifest handle.
1266         Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
1267         is handled by its ApplicationCacheGroup.
1268
1269         Add a ResourceLoader option to bypass the application cache.
1270         Use it for manifest loading.
1271
1272         * Sources.txt:
1273         * WebCore.xcodeproj/project.pbxproj:
1274         * loader/DocumentLoader.cpp:
1275         (WebCore::DocumentLoader::addSubresourceLoader):
1276         * loader/ResourceLoaderOptions.h:
1277         * loader/appcache/ApplicationCacheGroup.cpp:
1278         (WebCore::ApplicationCacheGroup::stopLoading):
1279         (WebCore::ApplicationCacheGroup::update):
1280         (WebCore::ApplicationCacheGroup::createRequest):
1281         (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
1282         (WebCore::ApplicationCacheGroup::didReceiveData):
1283         (WebCore::ApplicationCacheGroup::didFinishLoading):
1284         (WebCore::ApplicationCacheGroup::didFail):
1285         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
1286         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
1287         * loader/appcache/ApplicationCacheGroup.h:
1288         * loader/appcache/ApplicationCacheHost.cpp:
1289         (WebCore::ApplicationCacheHost::maybeLoadResource):
1290         (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
1291         (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
1292         (WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
1293         * loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
1294         * loader/appcache/ApplicationCacheResourceLoader.h: Added.
1295
1296 2018-02-21  Don Olmstead  <don.olmstead@sony.com>
1297
1298         [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
1299         https://bugs.webkit.org/show_bug.cgi?id=182883
1300
1301         Reviewed by Per Arne Vollan.
1302
1303         No new tests. No change in behavior.
1304
1305         * WebCorePrefix.h:
1306         * config.h:
1307         * testing/js/WebCoreTestSupportPrefix.h:
1308
1309 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1310
1311         [RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
1312         https://bugs.webkit.org/show_bug.cgi?id=183009
1313
1314         Reviewed by Antti Koivisto.
1315
1316         No change in functionality.
1317
1318         * dom/Document.cpp:
1319         (WebCore::Document::destroyRenderTree):
1320         * rendering/RenderView.cpp:
1321         (WebCore::RenderView::~RenderView):
1322         (WebCore::RenderView::willBeDestroyed): Deleted.
1323         * rendering/RenderView.h:
1324
1325 2018-02-21  Michael Catanzaro  <mcatanzaro@igalia.com>
1326
1327         [GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
1328         https://bugs.webkit.org/show_bug.cgi?id=181825
1329
1330         Reviewed by Carlos Garcia Campos.
1331
1332         We could fix this crash, but that would not be good enough, because upower-glib is a
1333         synchronous API that wraps D-Bus calls. That's not acceptable for use in the web process.
1334         Rewrite LowPowerModeNotifierGLib to use upower's D-Bus API directly, instead.
1335
1336         Note that this also enables LowPowerModeNotifier for WPE, since the USE(UPOWER) build
1337         flag is no longer needed.
1338
1339         * platform/LowPowerModeNotifier.cpp:
1340         * platform/LowPowerModeNotifier.h:
1341         * platform/glib/LowPowerModeNotifierGLib.cpp:
1342         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
1343         (WebCore::LowPowerModeNotifier::updateWarningLevel):
1344         (WebCore::LowPowerModeNotifier::warningLevelChanged):
1345         (WebCore::LowPowerModeNotifier::gPropertiesChangedCallback):
1346         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
1347         (WebCore::LowPowerModeNotifier::updateState): Deleted.
1348         (WebCore::LowPowerModeNotifier::warningLevelCallback): Deleted.
1349
1350 2018-02-21  Chris Dumez  <cdumez@apple.com>
1351
1352         VTTCue constructor should use 'double' type for startTime / endTime
1353         https://bugs.webkit.org/show_bug.cgi?id=182988
1354
1355         Reviewed by Eric Carlson.
1356
1357         VTTCue constructor should use 'double' type for startTime / endTime, not
1358         'unrestricted double':
1359         - https://w3c.github.io/webvtt/#the-vttcue-interface
1360
1361         Otherwise, we end up potentially returning NaN for TextTrackCue.startTime / endTime,
1362         even though those correctly use type 'double':
1363         - https://html.spec.whatwg.org/multipage/media.html#texttrackcue
1364
1365         The new behavior is consistent with Firefox and Chrome.
1366
1367         No new tests, updated existing test.
1368
1369         * bindings/js/JSDOMConvertNumbers.h:
1370         (WebCore::JSConverter<IDLDouble>::convert):
1371         Add assertion to make sure our implementation never tries to return NaN
1372         for an IDL attribute of type 'double'. This would be invalid as per Web
1373         IDL spec and would crash if the NaN being returned was impure as JSValue
1374         could not store it as a double.
1375
1376         * html/track/VTTCue.idl:
1377         Update constructor parameters to use 'double' type instead of 'unrestricted
1378         double', as per:
1379         - https://w3c.github.io/webvtt/#the-vttcue-interface
1380
1381 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1382
1383         [RenderTreeBuilder] Move RenderTextFragment::willBeRemoved() mutation logic to RenderTreeBuilder
1384         https://bugs.webkit.org/show_bug.cgi?id=182946
1385         <rdar://problem/37690039>
1386
1387         Reviewed by Antti Koivisto.
1388
1389         No change in functionality.
1390
1391         * rendering/RenderTextFragment.cpp:
1392         (WebCore::RenderTextFragment::willBeDestroyed):
1393         * rendering/updating/RenderTreeBuilder.cpp:
1394         (WebCore::RenderTreeBuilder::takeChild):
1395         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1396         (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnRemoval):
1397         * rendering/updating/RenderTreeBuilderFirstLetter.h:
1398
1399 2018-02-21  Ms2ger  <Ms2ger@igalia.com>
1400
1401         [GCrypt] Remove unsound assertion from CryptoKeyRSA::exportData().
1402         https://bugs.webkit.org/show_bug.cgi?id=183001
1403
1404         Reviewed by Philippe Normand.
1405
1406         This function is called from structured cloning, in particular when storing
1407         a key in IndexedDB. This would trip the assertion if the key in question is
1408         non-exportable.
1409
1410         The assertion was copied from the macOS implementation in r172389; it was
1411         subsequently removed there in r172898 to handle this case.
1412
1413         Test: crypto/subtle/rsa-indexeddb-non-exportable.html
1414
1415         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1416         (WebCore::CryptoKeyRSA::exportData const): remove assertion.
1417
1418 2018-02-21  Myles C. Maxfield  <mmaxfield@apple.com>
1419
1420         [Cocoa] Make system-ui obey the user-installed-font policy
1421         https://bugs.webkit.org/show_bug.cgi?id=182860
1422         <rdar://problem/36158249>
1423
1424         Reviewed by Antti Koivisto.
1425
1426         We have a completely different codepath for system-ui which makes it follow the system's
1427         font cascade list. This codepath (along with all the other relevant places which create
1428         system fonts) needs to obey the AllowUserInstalledFonts enum. This patch is fairly
1429         mechanical; we simply are hooking up the flag across SystemFontDatabase.
1430
1431         There are a few places which creates system fonts which this patch doesn't touch. This is
1432         not a problem because all the remaining places either:
1433         1) Simply pull out some attributes of the font (name, weight, size, etc.) and then throw
1434         away the font object itself, or
1435         2) Use the font in an environment where script cannot access the characters rendered (such
1436         as DragImages or the fullscreen placeholder view or the inside of the attachment element).
1437
1438         Test: fast/text/user-installed-fonts/system-ui.html
1439
1440         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1441         (WebCore::FontDatabase::collectionForFamily):
1442         (WebCore::FontDatabase::fontForPostScriptName):
1443         (WebCore::fontWithFamily):
1444         (WebCore::installedFontMandatoryAttributes):
1445         (WebCore::createSpecificFontForInstalledFonts):
1446         * platform/graphics/cocoa/FontCacheCoreText.h:
1447         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1448         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const):
1449         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const):
1450         (WebCore::SystemFontDatabase::systemFontCascadeList):
1451         (WebCore::SystemFontDatabase::removeCascadeList):
1452         (WebCore::SystemFontDatabase::computeCascadeList):
1453         (WebCore::systemFontParameters):
1454         (WebCore::systemFontCascadeList):
1455         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
1456         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
1457         * platform/graphics/ios/FontCacheIOS.mm:
1458         (WebCore::platformFontWithFamilySpecialCase):
1459         * platform/graphics/mac/FontCacheMac.mm:
1460         (WebCore::platformFontWithFamilySpecialCase):
1461
1462 2018-02-21  Chris Dumez  <cdumez@apple.com>
1463
1464         Unreviewed attempt to fix build after r228867.
1465
1466         * Modules/webvr/VRStageParameters.cpp:
1467
1468 2018-02-21  Philippe Normand  <pnormand@igalia.com>
1469
1470         [GStreamer] Rewrite purgeInvalid*Tracks methods
1471         https://bugs.webkit.org/show_bug.cgi?id=183004
1472
1473         Reviewed by Carlos Garcia Campos.
1474
1475         Removing items from a hashmap while iterating is bad.
1476
1477         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1478         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks):
1479         Safely remove items from the hashmap using removeIf().
1480         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
1481         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
1482
1483 2018-02-21  Chris Dumez  <cdumez@apple.com>
1484
1485         Unreviewed attempt to fix build after r228867.
1486
1487         * Modules/webvr/VRStageParameters.cpp:
1488
1489 2018-02-21  Philippe Normand  <pnormand@igalia.com>
1490
1491         [GStreamer] Crash in Debug build when purging invalid tracks
1492         https://bugs.webkit.org/show_bug.cgi?id=182997
1493
1494         Reviewed by Xabier Rodriguez-Calvar.
1495
1496         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1497         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Clear the hashmap when there is no valid track left.
1498         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
1499         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
1500         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1501         (WebCore::TrackPrivateBaseGStreamer::getLanguageCode): Demote debugging, this appears too much at least with playbin2.
1502         (WebCore::TrackPrivateBaseGStreamer::getTag): Ditto.
1503
1504 2018-02-21  Philippe Normand  <pnormand@igalia.com>
1505
1506         [GStreamer] We need to adopt GstGlDisplays after GStreamer 1.13.1
1507         https://bugs.webkit.org/show_bug.cgi?id=182996
1508
1509         Reviewed by Xabier Rodriguez-Calvar.
1510
1511         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1512         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1513         Adopt references when running with GStreamer 1.13.1 to avoid
1514         memory leaks.
1515
1516 2018-02-20  Philippe Normand  <pnormand@igalia.com>
1517
1518         [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html failing since r228617
1519         https://bugs.webkit.org/show_bug.cgi?id=160131
1520         <rdar://problem/35873985>
1521
1522         Reviewed by Michael Catanzaro.
1523
1524         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1525         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): We
1526         can't assume the pad has a sticky event here like implemented in
1527         InbandTextTrackPrivateGStreamer because it might be emitted after
1528         the track was created. So fallback to a dummy stream ID like in
1529         the Audio and Video tracks.
1530
1531 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
1532
1533         [WebVR][OpenVR] Retrieve stage parameters
1534         https://bugs.webkit.org/show_bug.cgi?id=182976
1535
1536         Reviewed by Žan Doberšek.
1537
1538         Use OpenVR to retrieve stage parameters, i.e., play area size and
1539         the transformation from sitting to standing position. It includes
1540         the same fallback used by Firefox to provide sensible values in case
1541         we cannot get the required information from the VR SDK (it's quite
1542         common not to have defined a play area).
1543
1544         * Modules/webvr/VRDisplay.cpp:
1545         (WebCore::VRDisplay::stageParameters const):
1546         * Modules/webvr/VRDisplay.h:
1547         * Modules/webvr/VRStageParameters.cpp:
1548         (WebCore::VRStageParameters::VRStageParameters):
1549         (WebCore::VRStageParameters::sittingToStandingTransform const):
1550         (WebCore::VRStageParameters::sizeX const):
1551         (WebCore::VRStageParameters::sizeZ const):
1552         * Modules/webvr/VRStageParameters.h:
1553         (WebCore::VRStageParameters::create):
1554         * platform/vr/VRPlatformDisplay.h:
1555         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1556         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1557         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
1558         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
1559
1560 2018-02-21  Philippe Normand  <pnormand@igalia.com>
1561
1562         [GStreamer] Create a Wayland GL display instead of EGL
1563         https://bugs.webkit.org/show_bug.cgi?id=182968
1564
1565         Reviewed by Xabier Rodriguez-Calvar.
1566
1567         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1568         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1569         Add logging and instantiate a GstDisplayWayland display instead of
1570         an EGL display when running under a Wayland compositor.
1571
1572 2018-02-21  Zalan Bujtas  <zalan@apple.com>
1573
1574         [RenderTreeBuilder] Move RenderFullScreen::willBeRemoved() mutation logic to RenderTreeBuilder
1575         https://bugs.webkit.org/show_bug.cgi?id=182947
1576         <rdar://problem/37690848>
1577
1578         Reviewed by Antti Koivisto.
1579
1580         No change in functionality.
1581
1582         * Sources.txt:
1583         * WebCore.xcodeproj/project.pbxproj:
1584         * rendering/RenderFullScreen.cpp:
1585         (WebCore::RenderFullScreen::willBeDestroyed):
1586         * rendering/updating/RenderTreeBuilder.cpp:
1587         (WebCore::RenderTreeBuilder::takeChild):
1588         * rendering/updating/RenderTreeBuilder.h:
1589         (WebCore::RenderTreeBuilder::fullScreenBuilder):
1590         * rendering/updating/RenderTreeBuilderFullScreen.cpp: Added.
1591         (WebCore::RenderTreeBuilder::FullScreen::FullScreen):
1592         (WebCore::RenderTreeBuilder::FullScreen::cleanupOnRemoval):
1593         * rendering/updating/RenderTreeBuilderFullScreen.h: Added.
1594         * rendering/updating/RenderTreeBuilderMathML.cpp:
1595
1596 2018-02-20  Zalan Bujtas  <zalan@apple.com>
1597
1598         [RenderTreeBuilder] Move RenderListItem::willBeRemoved() mutation logic to RenderTreeBuilder
1599         https://bugs.webkit.org/show_bug.cgi?id=182943
1600         <rdar://problem/37689029>
1601
1602         Reviewed by Antti Koivisto.
1603
1604         We don't need to destroy the marker in RenderListItem::willBeRemoved(), because it gets deleted
1605         in RenderTreeBuilder::removeAndDestroy() together with RenderListItem (as long as the marker is
1606         the RenderListItem's descendent). 
1607
1608         Covered by existing tests.
1609
1610         * rendering/RenderListItem.cpp:
1611         (WebCore::RenderListItem::~RenderListItem):
1612         (WebCore::RenderListItem::willBeDestroyed): Deleted.
1613         * rendering/RenderListItem.h:
1614
1615 2018-02-20  Nan Wang  <n_wang@apple.com>
1616
1617         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
1618         https://bugs.webkit.org/show_bug.cgi?id=182752
1619         <rdar://problem/37518233>
1620
1621         Reviewed by Ryosuke Niwa.
1622
1623         Call the assistive technology specific method for becoming first responder.
1624
1625         Test: accessibility/mac/accessibility-make-first-responder.html
1626
1627         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1628         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1629         * page/ChromeClient.h:
1630
1631 2018-02-20  Tim Horton  <timothy_horton@apple.com>
1632
1633         Introduce HAVE(IOSURFACE_ACCELERATOR)
1634         https://bugs.webkit.org/show_bug.cgi?id=182955
1635         <rdar://problem/37699510>
1636
1637         Reviewed by Sam Weinig.
1638
1639         No new tests, no change in behavior.
1640
1641         Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of
1642         IOSurfaceAccelerator behind it.
1643
1644         Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy.
1645
1646         * page/cocoa/MemoryReleaseCocoa.mm:
1647         * platform/graphics/ca/TileController.cpp:
1648         * platform/graphics/cg/IOSurfacePool.cpp:
1649         * platform/graphics/cg/IOSurfacePool.h:
1650         * platform/graphics/cg/ImageBufferCG.cpp:
1651         * platform/graphics/cocoa/IOSurface.h:
1652         * platform/graphics/cocoa/IOSurface.mm:
1653         * platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
1654         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1655         * platform/graphics/cv/VideoTextureCopierCV.h:
1656
1657 2018-02-20  Chris Dumez  <cdumez@apple.com>
1658
1659         Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
1660         https://bugs.webkit.org/show_bug.cgi?id=182720
1661         <rdar://problem/37515204>
1662
1663         Reviewed by Alex Christensen.
1664
1665         Wait for the policy response from the client after receiving a resource response,
1666         before sending the NetworkResourceLoader::ContinueDidReceiveResponse IPC back to
1667         the NetworkProcess. Otherwise, the network process may start sending us data and
1668         we may end up committing the provisional load before receiving the policy decision
1669         fron the client.
1670
1671         Change is covered by new API test.
1672
1673         * loader/DocumentLoader.cpp:
1674         (WebCore::DocumentLoader::responseReceived):
1675         * loader/NetscapePlugInStreamLoader.cpp:
1676         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
1677         * loader/NetscapePlugInStreamLoader.h:
1678         * loader/ResourceLoader.cpp:
1679         (WebCore::ResourceLoader::deliverResponseAndData):
1680         (WebCore::ResourceLoader::loadDataURL):
1681         (WebCore::ResourceLoader::didReceiveResponse):
1682         (WebCore::ResourceLoader::didReceiveResponseAsync):
1683         * loader/ResourceLoader.h:
1684         * loader/SubresourceLoader.cpp:
1685         (WebCore::SubresourceLoader::didReceiveResponse):
1686         (WebCore::SubresourceLoader::didReceiveResponsePolicy):
1687         (WebCore::SubresourceLoader::willCancel):
1688         * loader/SubresourceLoader.h:
1689         * loader/ios/PreviewLoader.mm:
1690         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
1691
1692 2018-02-20  Chris Dumez  <cdumez@apple.com>
1693
1694         Crash under JSC::JSCell::toNumber(JSC::ExecState*)
1695         https://bugs.webkit.org/show_bug.cgi?id=182984
1696         <rdar://problem/37694346>
1697
1698         Reviewed by Mark Lam.
1699
1700         The issue was caused by DOMMatrix attributes potentially returning "impure"
1701         NaN values. We would call JSC::jsNumber(double) to construct the JSValue
1702         but this is only safe for pure NaN values. Make sure we purify the double
1703         returned by the implementation for IDL attributes of type 'unrestricted double'
1704         before calling JSC::jsNumber(double).
1705
1706         No new tests, extended existing test.
1707
1708         * bindings/js/JSDOMConvertNumbers.h:
1709         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
1710         * testing/TypeConversions.h:
1711         (WebCore::TypeConversions::testImpureNaNUnrestrictedDouble const):
1712         (WebCore::TypeConversions::testImpureNaN2UnrestrictedDouble const):
1713         (WebCore::TypeConversions::testQuietNaNUnrestrictedDouble const):
1714         * testing/TypeConversions.idl:
1715
1716 2018-02-20  Tim Horton  <timothy_horton@apple.com>
1717
1718         Make more use of USE(OPENGL_ES) where it makes sense
1719         https://bugs.webkit.org/show_bug.cgi?id=182957
1720         <rdar://problem/37699443>
1721
1722         Reviewed by Dan Bernstein.
1723
1724         No new tests, no behavior change.
1725
1726         Make use of USE(OPENGL_ES) for CoreVideo functions that differ based
1727         on GL availability. Also adjust GraphicsContext3D in the same way.
1728
1729         * platform/cocoa/CoreVideoSoftLink.cpp:
1730         * platform/cocoa/CoreVideoSoftLink.h:
1731         * platform/graphics/GraphicsContext3D.h:
1732         * platform/graphics/cv/TextureCacheCV.mm:
1733         (WebCore::TextureCacheCV::create):
1734         (WebCore::TextureCacheCV::textureFromImage):
1735         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1736         (WebCore::enumToStringMap):
1737         (WebCore::VideoTextureCopierCV::initializeContextObjects):
1738         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
1739         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
1740         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
1741
1742 2018-02-20  Nan Wang  <n_wang@apple.com>
1743
1744         AX: AOM: Dispatch accessibleclick event
1745         https://bugs.webkit.org/show_bug.cgi?id=180898
1746         <rdar://problem/36086710>
1747
1748         Reviewed by Ryosuke Niwa.
1749
1750         Accessibility events.
1751         Spec: https://wicg.github.io/aom/spec/phase2.html
1752
1753         This patch allows developers to register event handlers on Elements
1754         for custom accessibility events.
1755
1756         Accessibility events go through a capturing and bubbling phase just
1757         like DOM events, but in the accessibility tree.
1758
1759         Implemented "accessibleclick" event.
1760
1761         Test: accessibility/mac/AOM-events.html
1762
1763         * accessibility/AccessibilityObject.cpp:
1764         (WebCore::AccessibilityObject::press):
1765         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
1766         * accessibility/AccessibilityObject.h:
1767         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1768         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
1769         * dom/Element.idl:
1770         * dom/EventDispatcher.cpp:
1771         (WebCore::dispatchEventWithType):
1772         (WebCore::EventDispatcher::dispatchEvent):
1773         * dom/EventDispatcher.h:
1774         * dom/EventNames.h:
1775         * dom/EventPath.cpp:
1776         (WebCore::EventPath::EventPath):
1777         * dom/EventPath.h:
1778
1779 2018-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1780
1781         [iOS 11.3 Beta] Can't copy a URL from Safari and paste it into the Gmail app
1782         https://bugs.webkit.org/show_bug.cgi?id=182952
1783         <rdar://problem/37636190>
1784
1785         Reviewed by Tim Horton.
1786
1787         After r220865 refactored the iOS copy codepaths to use NSItemProviders, we stopped writing the URL as plain text
1788         to the pasteboard. However, this means clients that only check for "text/plain" (or one of its aliases) on the
1789         pasteboard won't read any data on paste.
1790
1791         To fix this, we restore the pre-iOS 11.3 behavior of writing both the URL and plain text to the pasteboard.
1792         Since we're using item providers, we also ensure that the NSURL is at a higher fidelity than the string to make
1793         it clear that the data should be consumed as a URL.
1794
1795         This patch also rebaselines an existing drag and drop test to cover this change, and adds a new API test,
1796         ActionSheetTests.CopyLinkWritesURLAndPlainText, which simulates copying a link using the share sheet and pasting
1797         into a DataTransfer-dumping test harness.
1798
1799         * platform/ios/PlatformPasteboardIOS.mm:
1800         (WebCore::PlatformPasteboard::write):
1801
1802 2018-02-20  Eric Carlson  <eric.carlson@apple.com>
1803
1804         [iOS] Returning from Auto-PiP causes Safari to be unresponsive
1805         https://bugs.webkit.org/show_bug.cgi?id=182977
1806         <rdar://problem/37685981>
1807
1808         Reviewed by Jer Noble.
1809
1810         Remove the error handling added in r228115, it breaks auto-pip.
1811
1812         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1813         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
1814         (VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
1815         (VideoFullscreenInterfaceAVKit::exitFullscreen):
1816         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
1817         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1818         (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
1819         (VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
1820         (VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
1821
1822 2018-02-20  Jer Noble  <jer.noble@apple.com>
1823
1824         [EME] Adopt new AVContentKeySession success delegate callback
1825         https://bugs.webkit.org/show_bug.cgi?id=182974
1826         <rdar://problem/36079035>
1827
1828         Reviewed by Eric Carlson.
1829
1830         Store the updateLicenseCallback if the new protocol method is present and supported.
1831
1832         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
1833         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1834         (-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequestDidSucceed:]):
1835         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
1836         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
1837         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
1838
1839 2018-02-19  Dean Jackson  <dino@apple.com>
1840
1841         Handle all writing-modes in downcast
1842         https://bugs.webkit.org/show_bug.cgi?id=182949
1843         <rdar://problem/37710687>
1844
1845         Reviewed by Myles Maxfield.
1846
1847         It appears we forgot to handle the deprecated "lr"
1848         writing-mode value.
1849
1850         Test: fast/writing-mode/svg-writing-modes.html
1851
1852         * css/CSSPrimitiveValueMappings.h:
1853         (WebCore::CSSPrimitiveValue::operator WritingMode const):
1854
1855 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
1856
1857         [Cairo] Drop target GraphicsContext usage in Cairo operations
1858         https://bugs.webkit.org/show_bug.cgi?id=182964
1859
1860         Reviewed by Carlos Garcia Campos.
1861
1862         The GraphicsContext parameters in various Cairo operations are not used
1863         anymore, so they can be removed. Callsites are updated to reflect this.
1864
1865         * platform/graphics/cairo/CairoOperations.cpp:
1866         (WebCore::Cairo::drawShadowLayerBuffer):
1867         (WebCore::Cairo::fillShadowBuffer):
1868         (WebCore::Cairo::drawPathShadow):
1869         (WebCore::Cairo::drawGlyphsShadow):
1870         (WebCore::Cairo::fillRect):
1871         (WebCore::Cairo::fillRoundedRect):
1872         (WebCore::Cairo::fillRectWithRoundedHole):
1873         (WebCore::Cairo::fillPath):
1874         (WebCore::Cairo::strokeRect):
1875         (WebCore::Cairo::strokePath):
1876         (WebCore::Cairo::drawGlyphs):
1877         (WebCore::Cairo::drawNativeImage):
1878         (WebCore::Cairo::drawSurface):
1879         * platform/graphics/cairo/CairoOperations.h:
1880         * platform/graphics/cairo/FontCairo.cpp:
1881         (WebCore::FontCascade::drawGlyphs):
1882         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1883         (WebCore::GraphicsContext::drawNativeImage):
1884         (WebCore::GraphicsContext::fillPath):
1885         (WebCore::GraphicsContext::strokePath):
1886         (WebCore::GraphicsContext::fillRect):
1887         (WebCore::GraphicsContext::strokeRect):
1888         (WebCore::GraphicsContext::platformFillRoundedRect):
1889         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1890         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1891         (WebCore::GraphicsContextImplCairo::fillRect):
1892         (WebCore::GraphicsContextImplCairo::fillRoundedRect):
1893         (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
1894         (WebCore::GraphicsContextImplCairo::fillPath):
1895         (WebCore::GraphicsContextImplCairo::strokeRect):
1896         (WebCore::GraphicsContextImplCairo::strokePath):
1897         (WebCore::GraphicsContextImplCairo::drawGlyphs):
1898         (WebCore::GraphicsContextImplCairo::drawNativeImage):
1899         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1900         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
1901
1902 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
1903
1904         [WebVR][OpenVR] Retrieve eye parameters and field of view
1905         https://bugs.webkit.org/show_bug.cgi?id=182962
1906
1907         Reviewed by Žan Doberšek.
1908
1909         Get the required data from OpenVR to fill in the VREyeParameters and
1910         the VRFieldOfView objects.
1911
1912         * Modules/webvr/VRDisplay.cpp: Create some attributes in the
1913         body of the constructor instead in the member initialization list to
1914         avoid calling getDisplayInfo() multiple times.
1915         (WebCore::VRDisplay::VRDisplay):
1916         (WebCore::VRDisplay::capabilities const):
1917         (WebCore::VRDisplay::getEyeParameters const):
1918         * Modules/webvr/VRDisplay.h:
1919         * Modules/webvr/VREyeParameters.cpp:
1920         (WebCore::VREyeParameters::VREyeParameters): Added new attributes to
1921         the constructor.
1922         (WebCore::VREyeParameters::offset const): Return a Ref instead of
1923         a raw pointer.
1924         (WebCore::VREyeParameters::renderWidth const):
1925         (WebCore::VREyeParameters::renderHeight const):
1926         * Modules/webvr/VREyeParameters.h:
1927         (WebCore::VREyeParameters::create):
1928         * Modules/webvr/VRFieldOfView.cpp: Removed. All the impletementation
1929         fits perfectly in the header file.
1930         * Modules/webvr/VRFieldOfView.h:
1931         (WebCore::VRFieldOfView::create):
1932         (WebCore::VRFieldOfView::upDegrees const):
1933         (WebCore::VRFieldOfView::rightDegrees const):
1934         (WebCore::VRFieldOfView::downDegrees const):
1935         (WebCore::VRFieldOfView::leftDegrees const):
1936         (WebCore::VRFieldOfView::VRFieldOfView):
1937         * Sources.txt:
1938         * platform/vr/VRPlatformDisplay.h: Added some more data to the
1939         VRPlatformDisplayInfo struct.
1940         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1941         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1942         (WebCore::VRPlatformDisplayOpenVR::computeFieldOfView): Computes the
1943         up/down/left/right FOV angles in degrees from the raw project
1944         values returned by OpenVR.
1945         (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters): Fills in
1946         the eye parameter info.
1947         (WebCore::VRPlatformDisplayOpenVR::~VRPlatformDisplayOpenVR):
1948         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
1949
1950 2018-02-20  Philippe Normand  <pnormand@igalia.com>
1951
1952         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
1953         https://bugs.webkit.org/show_bug.cgi?id=173655
1954
1955         Reviewed by Xabier Rodriguez-Calvar.
1956
1957         The FIXME in GStreamerUtilities.cpp asks to pass the command line
1958         parameters to the GStreamer initialization function.
1959
1960         Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
1961
1962         * Modules/webaudio/AudioContext.cpp:
1963         (WebCore::AudioContext::constructCommon): Removes the call to the method
1964         that GStreamer initializes. It is no longer necessary.
1965         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1966         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto
1967         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1968         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto
1969         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1970         (WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer.
1971         * platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains
1972         GStreamer options as the input parameter of the initializeGStreamer() method.
1973
1974 2018-02-20  Miguel Gomez  <magomez@igalia.com>
1975
1976         [GTK] whatsapp web blurry in some parts, sharp on others
1977         https://bugs.webkit.org/show_bug.cgi?id=182673
1978
1979         Reviewed by Carlos Garcia Campos.
1980
1981         CoordinatedGraphicsLayer::createBackingStore() uses the scale factor returned by effectiveContentsScale(),
1982         which is always 1 if selfOrAncestorHaveNonAffineTransforms() returns true. But this fuction always returns
1983         true if the layer has an AnimatedPropertyTransform animation, which means that layers with those animations
1984         won't use the appropriate scale factor, causing blurry renderings.
1985
1986         This patch removes the animations check, so animated layers properly use the required scale factor.
1987
1988         No new tests, no behavior change.
1989
1990         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1991         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
1992
1993 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
1994
1995         [Cairo] Leverage ShadowBlur without using scratch buffer, target GraphicsContext
1996         https://bugs.webkit.org/show_bug.cgi?id=182958
1997
1998         Reviewed by Carlos Garcia Campos.
1999
2000         To allow ShadowBlur usage in different threads, avoid the ShadowBlur
2001         class using the scratch buffer internally. The current implementation of
2002         that scratch buffer is not thread-safe and its usage in such conditions
2003         can lead to crashes.
2004
2005         Instead, the new methods use a temporary ImageBuffer object for drawing.
2006         This does negate the efficiency of possibly reusing the scratch buffer,
2007         but at this point that is not yet the priority. This only affects ports
2008         using Cairo for drawing.
2009
2010         The added methods don't require a target GraphicsContext object to be
2011         passed in, instead they accept buffer draw callbacks that are invoked
2012         with the temporary ImageBuffer object containing the rasterized shadow,
2013         as well as position and size parameters. The CTM and clip bounds values
2014         also have to be passed in manually. In CairoOperations.cpp, the provided
2015         callbacks invoke commands that are equivalent in effect to those that
2016         would otherwise be invoked on the target GraphicsContext object in the
2017         ShadowBlur class.
2018
2019         For now, this approach has to avoid the tiling-based drawing of the
2020         rectangular shadows in drawRectShadow() and inset shadows in
2021         drawInsetShadow(), and instead stick to the non-tiling fallback. While
2022         only affecting Cairo-using ports, with some refactoring it should be
2023         possible to again leverage the tiling-based approach as well.
2024
2025         The beginShadowLayer() and endShadowLayer() functions, which are only
2026         used in CairoOperations.cpp, are replaced with the drawShadowLayer()
2027         method. This one accepts an additional callback that allows the caller
2028         to explicitly draw the shadow shape using the provided shadowing
2029         GraphicsContext object. As with the other two new methods, a temporary
2030         ImageBuffer object is used, and the buffer draw callback is invoked to
2031         allow caller to properly handle the shadowing output.
2032
2033         In CairoOperations.cpp, the new ShadowBlur methods are exercised, with
2034         direct Cairo operation invocation replacing the GraphicsContext calls
2035         otherwise done through ShadowBlur. ShadowState object now also has to
2036         track the global alpha and the global composite operator values so that
2037         it can properly rasterize the resulting shadow into the final image.
2038
2039         No new tests -- no change in behavior.
2040
2041         * platform/graphics/ShadowBlur.cpp:
2042         (WebCore::ShadowBlur::adjustBlurRadius):
2043         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2044         (WebCore::ShadowBlur::drawRectShadow):
2045         (WebCore::ShadowBlur::drawInsetShadow):
2046         (WebCore::ShadowBlur::drawShadowLayer):
2047         (WebCore::ShadowBlur::beginShadowLayer): Deleted.
2048         (WebCore::ShadowBlur::endShadowLayer): Deleted.
2049         * platform/graphics/ShadowBlur.h:
2050         * platform/graphics/cairo/CairoOperations.cpp:
2051         (WebCore::Cairo::drawShadowLayerBuffer):
2052         (WebCore::Cairo::fillShadowBuffer):
2053         (WebCore::Cairo::drawPathShadow):
2054         (WebCore::Cairo::drawGlyphsShadow):
2055         (WebCore::Cairo::ShadowState::ShadowState):
2056         (WebCore::Cairo::fillRect):
2057         (WebCore::Cairo::fillRoundedRect):
2058         (WebCore::Cairo::fillRectWithRoundedHole):
2059         (WebCore::Cairo::drawSurface):
2060         * platform/graphics/cairo/CairoOperations.h:
2061         Default-initialize FillSource::fillRule to RULE_NONZERO.
2062         * platform/graphics/cairo/PlatformContextCairo.h:
2063         Drop the ShadowBlur.h include, it's moved to CairoOperations.cpp.
2064         * rendering/RenderThemeGtk.cpp:
2065         Explicitly include the FloatRoundedRect.h header now that it's not
2066         included through the ShadowBlur.h header via PlatformContextCairo.h.
2067
2068 2018-02-20  Sergio Villar Senin  <svillar@igalia.com>
2069
2070         [WebVR] Use RuntimeEnabledFeatures to enable/disable WebVR
2071         https://bugs.webkit.org/show_bug.cgi?id=182961
2072
2073         Reviewed by Xabier Rodriguez-Calvar.
2074
2075         The shared feature was properly added to RuntimeEnabledFeatures some
2076         time ago but the code was instead using a private method in
2077         NavigatorWebVR to temporarily disable it. WebVR is enabled in
2078         WebPreferences.yaml for GTK+ & WPE as default experimental feature.
2079
2080         * Modules/webvr/NavigatorWebVR.cpp:
2081         (WebCore::NavigatorWebVR::getVRDisplays):
2082         (WebCore::NavigatorWebVR::vrEnabled): Deleted.
2083
2084 2018-02-19  Antti Koivisto  <antti@apple.com>
2085
2086         Use selector filter when invalidating descendants
2087         https://bugs.webkit.org/show_bug.cgi?id=182839
2088         <rdar://problem/37581072>
2089
2090         Reviewed by Zalan Bujtas.
2091
2092         We can make descendant invalidation faster by enabling filtering.
2093
2094         * css/SelectorFilter.cpp:
2095         (WebCore::SelectorFilter::initializeParentStack):
2096
2097             Traverse and reverse the ancestor chain, and push it.
2098
2099         (WebCore::SelectorFilter::pushParent):
2100         (WebCore::SelectorFilter::pushParentInitializingIfNeeded):
2101
2102             Add a version of pushParent that can initialize the stack.
2103
2104         (WebCore::SelectorFilter::popParent):
2105         (WebCore::SelectorFilter::popParentsUntil):
2106
2107             Pop until a given parent element.
2108
2109         (WebCore::SelectorFilter::pushParentStackFrame): Deleted.
2110         (WebCore::SelectorFilter::popParentStackFrame): Deleted.
2111
2112             These were the same as push/popParent.
2113
2114         * css/SelectorFilter.h:
2115         (WebCore::SelectorFilter::popParent): Deleted.
2116         * style/StyleInvalidator.cpp:
2117         (WebCore::Style::Invalidator::invalidateStyleForDescendants):
2118
2119             Use pushParentInitializingIfNeeded.
2120
2121         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
2122
2123             Use selector filter when doing descendant tree invalidation.
2124             Make sure to pop it until the parent when reusing.
2125
2126 2018-02-19  Fujii Hironori  <Hironori.Fujii@sony.com>
2127
2128         null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted
2129         https://bugs.webkit.org/show_bug.cgi?id=161947
2130
2131         Reviewed by Ryosuke Niwa.
2132
2133         InsertedNodes happened to be empty if the inserted nodes were
2134         removed. Add more checks if InsertedNodes is empty.
2135
2136         No new tests (Covered by existing tests).
2137
2138         * editing/ReplaceSelectionCommand.cpp:
2139         (WebCore::ReplaceSelectionCommand::doApply): Return early if InsertedNodes becomes empty.
2140         * editing/ReplaceSelectionCommand.h:
2141         (WebCore::ReplaceSelectionCommand::InsertedNodes::isEmpty): New method.
2142         (WebCore::ReplaceSelectionCommand::InsertedNodes::lastLeafInserted const):
2143         Assert m_lastNodeInserted is not null.
2144         (WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf const): Ditto.
2145
2146 2018-02-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2147
2148         Add SVGPropertyTraits::fromString() to all the SVG animated types
2149         https://bugs.webkit.org/show_bug.cgi?id=182901
2150
2151         Reviewed by Dean Jackson.
2152
2153         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
2154         goal is is to templatize the SVGAnimatedType class and to use SVGPropertyTraits
2155         methods inside the template functions.
2156
2157         * WebCore.xcodeproj/project.pbxproj: Move the enum and the SVGPropertyTraits
2158         from SVGMarkerElement.h to SVGMarkerTypes.h.
2159         * svg/SVGAngle.h:
2160         (WebCore::SVGAngle::SVGAngle): Delete unused constructor and create() method.
2161         * svg/SVGAngleValue.h:
2162         * svg/SVGAnimateMotionElement.cpp:
2163         (WebCore::parsePoint): Deleted. Move this function to SVGParserUtilities.cpp
2164         * svg/SVGAnimatedAngle.cpp:
2165         (WebCore::SVGAnimatedAngleAnimator::constructFromString): Use SVGPropertyTraits::fromString().
2166         * svg/SVGAnimatedBoolean.cpp:
2167         (WebCore::SVGAnimatedBooleanAnimator::constructFromString): Ditto.
2168         * svg/SVGAnimatedColor.cpp:
2169         (WebCore::SVGAnimatedColorAnimator::constructFromString): Ditto.
2170         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes): Use const.
2171         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): Ditto.
2172         * svg/SVGAnimatedEnumeration.cpp:
2173         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString): Ditto.
2174         * svg/SVGAnimatedInteger.cpp:
2175         (WebCore::SVGAnimatedIntegerAnimator::constructFromString): Ditto.
2176         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
2177         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString): Ditto.
2178         * svg/SVGAnimatedLength.cpp:
2179         * svg/SVGAnimatedLengthList.cpp:
2180         (WebCore::SVGAnimatedLengthListAnimator::constructFromString): Ditto.
2181         * svg/SVGAnimatedNumber.cpp:
2182         (WebCore::SVGAnimatedNumberAnimator::constructFromString): Ditto
2183         (WebCore::parseNumberFromString):
2184         * svg/SVGAnimatedNumberList.cpp:
2185         (WebCore::SVGAnimatedNumberListAnimator::constructFromString): Ditto.
2186         * svg/SVGAnimatedNumberOptionalNumber.cpp:
2187         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString): Ditto.
2188         * svg/SVGAnimatedPath.cpp:
2189         (WebCore::SVGAnimatedPathAnimator::constructFromString): Ditto.
2190         * svg/SVGAnimatedPointList.cpp:
2191         (WebCore::SVGAnimatedPointListAnimator::constructFromString): Ditto.
2192         * svg/SVGAnimatedPreserveAspectRatio.cpp:
2193         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString): Ditto.
2194         * svg/SVGAnimatedRect.cpp:
2195         (WebCore::SVGAnimatedRectAnimator::constructFromString): Ditto.
2196         * svg/SVGAnimatedString.cpp:
2197         (WebCore::SVGAnimatedStringAnimator::constructFromString): Ditto.
2198         * svg/SVGAnimatedTransformList.cpp:
2199         (WebCore::SVGAnimatedTransformListAnimator::constructFromString): Ditto.
2200         * svg/SVGLength.h:
2201         (WebCore::SVGLength::SVGLength): Delete unused constructor and create() method.
2202         * svg/SVGLengthListValues.h:
2203         (WebCore::SVGPropertyTraits<SVGLengthListValues>::fromString): New SVGPropertyTraits method.
2204         (WebCore::SVGPropertyTraits<SVGLengthListValues>::parse): Ditto.
2205         * svg/SVGMarkerElement.h:
2206         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue): Deleted.
2207         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString): Deleted.
2208         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString): Deleted.
2209         (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue): Deleted.
2210         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue): Deleted.
2211         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): Deleted.
2212         * svg/SVGMarkerTypes.h: Added.
2213         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::highestEnumValue):
2214         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
2215         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::fromString):
2216         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::highestEnumValue):
2217         (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
2218         (WebCore::SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue):
2219         * svg/SVGMatrix.h: Delete unused constructor and create method.
2220         * svg/SVGNumber.h:
2221         (WebCore::SVGNumber::SVGNumber): Ditto.
2222         * svg/SVGNumberListValues.h:
2223         (WebCore::SVGPropertyTraits<SVGNumberListValues>::fromString): New SVGPropertyTraits method.
2224         * svg/SVGParserUtilities.cpp:
2225         (WebCore::parsePoint): This is moved from SVGAnimateMotionElement.cpp
2226         * svg/SVGParserUtilities.h:
2227         * svg/SVGPathByteStream.h:
2228         (WebCore::SVGPathByteStream::SVGPathByteStream):
2229         (WebCore::SVGPathByteStream::operator=): Add copy and move assignment operators.
2230         (WebCore::SVGPathByteStream::copy const): Use the copy assignment.
2231         (WebCore::SVGPathByteStream::isEmpty const): Use Data.isEmpty().
2232         (WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): New SVGPropertyTraits method.
2233         (WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Ditto.
2234         * svg/SVGPathUtilities.cpp:
2235         (WebCore::addToSVGPathByteStream): Answer Simon's questions which were added in r190844.
2236         * svg/SVGPoint.h:
2237         (WebCore::SVGPoint::SVGPoint): Delete unused constructor and create method.
2238         * svg/SVGPointListValues.h:
2239         (WebCore::SVGPropertyTraits<SVGPointListValues>::fromString): New SVGPropertyTraits method.
2240         * svg/SVGPolyElement.cpp:
2241         (WebCore::SVGPolyElement::parseAttribute): Use the move assignment operator.
2242         * svg/SVGPreserveAspectRatio.h:
2243         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Delete unused constructor and create method.
2244         * svg/SVGPreserveAspectRatioValue.cpp:
2245         (WebCore::SVGPreserveAspectRatioValue::SVGPreserveAspectRatioValue): Add new constructor.
2246         * svg/SVGPreserveAspectRatioValue.h:
2247         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString): New SVGPropertyTraits method.
2248         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString): Ditto.
2249         * svg/SVGRect.h:
2250         (WebCore::SVGRect::SVGRect): Delete unused constructor and create method.
2251         * svg/SVGRectTraits.h: Removed.
2252         * svg/SVGTransform.h:
2253         (WebCore::SVGTransform::SVGTransform): Delete unused constructor and create method.
2254         * svg/SVGTransformListValues.h:
2255         (WebCore::SVGPropertyTraits<SVGTransformListValues>::fromString): New SVGPropertyTraits method.
2256         * svg/properties/SVGPropertyTearOff.h: Delete unused create method.
2257         * svg/properties/SVGPropertyTraits.h: New SVGPropertyTraits methods.
2258         (WebCore::SVGPropertyTraits<bool>::fromString): 
2259         (WebCore::SVGPropertyTraits<Color>::initialValue):
2260         (WebCore::SVGPropertyTraits<Color>::fromString):
2261         (WebCore::SVGPropertyTraits<Color>::parse):
2262         (WebCore::SVGPropertyTraits<Color>::toString):
2263         (WebCore::SVGPropertyTraits<int>::fromString):
2264         (WebCore::SVGPropertyTraits<float>::fromString):
2265         (WebCore::SVGPropertyTraits<float>::parse):
2266         (WebCore::SVGPropertyTraits<FloatPoint>::initialValue):
2267         (WebCore::SVGPropertyTraits<FloatPoint>::fromString):
2268         (WebCore::SVGPropertyTraits<FloatPoint>::parse):
2269         (WebCore::SVGPropertyTraits<FloatPoint>::toString):
2270         (WebCore::SVGPropertyTraits<FloatRect>::initialValue):
2271         (WebCore::SVGPropertyTraits<FloatRect>::fromString):
2272         (WebCore::SVGPropertyTraits<FloatRect>::parse):
2273         (WebCore::SVGPropertyTraits<FloatRect>::toString):
2274         (WebCore::SVGPropertyTraits<String>::fromString):
2275         (WebCore::SVGPropertyTraits<String>::parse):
2276         (WebCore::SVGPropertyTraits<String>::toString):
2277
2278 2018-02-19  Antoine Quint  <graouts@apple.com>
2279
2280         [Modern Media Controls] Implement a compact set of media controls
2281         https://bugs.webkit.org/show_bug.cgi?id=182937
2282         <rdar://problem/37682257>
2283
2284         Reviewed by Eric Carlson.
2285
2286         We add a new type of media controls used when we need stripped down and compact controls. The new
2287         CompactMediaControls only show a play/pause button and an invalid placard and disregard all media
2288         events that are not relevant to the display of these controls.
2289
2290         To distinguish cases where we need to show compact media controls, we expose a new property on
2291         MediaControlsHost called "compactMode".
2292
2293         Tests: media/modern-media-controls/compact-media-controls/compact-media-controls-constructor.html
2294                media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html
2295
2296         * Modules/mediacontrols/MediaControlsHost.cpp:
2297         (WebCore::MediaControlsHost::base64StringForIconNameAndType const):
2298         (WebCore::MediaControlsHost::compactMode const):
2299         * Modules/mediacontrols/MediaControlsHost.h:
2300         (WebCore::MediaControlsHost::setSimulateCompactMode):
2301         * Modules/mediacontrols/MediaControlsHost.idl:
2302         * Modules/modern-media-controls/controls/compact-media-controls.js: Added.
2303         (CompactMediaControls.prototype.get scaleFactor):
2304         (CompactMediaControls.prototype.set scaleFactor):
2305         (CompactMediaControls.prototype.get shouldCenterControlsVertically):
2306         (CompactMediaControls.prototype.set shouldCenterControlsVertically):
2307         (CompactMediaControls.prototype.get placard):
2308         (CompactMediaControls.prototype.set placard):
2309         (CompactMediaControls.prototype.layout):
2310         (CompactMediaControls.prototype.commitProperty):
2311         * Modules/modern-media-controls/controls/icon-service.js:
2312         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
2313         (const.iconService.new.IconService):
2314         * Modules/modern-media-controls/controls/inline-media-controls.js:
2315         * Modules/modern-media-controls/controls/layout-item.js:
2316         * Modules/modern-media-controls/js-files:
2317         * Modules/modern-media-controls/main.js:
2318         * Modules/modern-media-controls/media/media-controller.js:
2319         (MediaController.prototype.get layoutTraits):
2320         (MediaController.prototype._supportingObjectClasses): Compute the set of MediaControllerSupport classes based
2321         on the layout traits such that in compact mode we only return PlacardSupport and PlaybackSupport.
2322         (MediaController.prototype._updateControlsIfNeeded):
2323         (MediaController.prototype._controlsClassForLayoutTraits):
2324         (MediaController.prototype._shouldControlsBeAvailable):
2325         * Modules/modern-media-controls/media/placard-support.js:
2326         (PlacardSupport.prototype.get mediaEvents): Only track the "error" event in compact mode since this is the only
2327         relevant placard.
2328         * Modules/modern-media-controls/media/playback-support.js:
2329         (PlaybackSupport.prototype.syncControl): Only show or hide the play/pause button based on the playback state
2330         when in compact mode.
2331         (PlaybackSupport):
2332         * WebCore.xcodeproj/project.pbxproj:
2333
2334 2018-02-19  Antoine Quint  <graouts@apple.com>
2335
2336         [Web Animations] Make KeyframeEffect target nullable and read-write
2337         https://bugs.webkit.org/show_bug.cgi?id=182741
2338
2339         Reviewed by Dean Jackson.
2340
2341         We used to completely disregard null targets, for instance not parsing keyframes, but targets
2342         can be null and are also supposed to be read-write for KeyframeEffect. We now update the IDL
2343         for KeyframeEffect to mark the target property as read-write and update the implementation
2344         to correctly handle null targets.
2345
2346         This revealed a few issues in our implementation by allowing more WPT tests to run. So we also
2347         ensure that:
2348         
2349         - we don't crash when parsing font-related properties by calling update() on the generated
2350         RenderStyle's FontCascade when parsing keyframes.
2351
2352         - CSS properties are provided as camel-case and not as hyphenated form
2353
2354         - values provided in keyframes dictionaries are only read for valid properties
2355
2356         - styles for effect targets are invalidated as soon as the timing model for that animation
2357         is changed
2358
2359         * animation/KeyframeEffect.idl:
2360         * animation/KeyframeEffectReadOnly.cpp:
2361         (WebCore::invalidateElement): Add a new utility method to invalidate a given element since
2362         we may want to invalidate not only the current target (m_target) but also a previous target.
2363         (WebCore::IDLAttributeNameToAnimationPropertyName): Move this function below CSSPropertyIDToIDLAttributeName
2364         so that it can call that function. We also check that we reject CSS properties that are not provided in
2365         camel-case form (eg. "font-size" vs. "fontSize").
2366         (WebCore::processIterableKeyframes): Only read the JS values if we know that the provided JS property name
2367         maps to a valid CSS property.
2368         (WebCore::KeyframeEffectReadOnly::processKeyframes): Allow keyframes to be processed even if the effect's
2369         target is null.
2370         (WebCore::KeyframeEffectReadOnly::setTarget): Notify the animation that the effect target has changed and
2371         invalidate the style of the new target and the old targets, if any. We also update the blending keyframes
2372         since this task may not have been completed in a previous call to processKeyframes() due to the target being
2373         null at that time.
2374         (WebCore::KeyframeEffectReadOnly::invalidate): Use the invalidateElement() utility.
2375         * animation/KeyframeEffectReadOnly.h:
2376         * animation/WebAnimation.cpp:
2377         (WebCore::WebAnimation::effectTargetDidChange): This method is called in KeyframeEffectReadOnly::setTarget()
2378         to inform the animation of the previous effect target and the new one upon a target change. This allows us to
2379         forward this information onto the timeline so that we correctly add or remove the targets from the list of
2380         animated elements.
2381         * animation/WebAnimation.h:
2382
2383 2018-02-19  Chris Dumez  <cdumez@apple.com>
2384
2385         Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType()
2386         https://bugs.webkit.org/show_bug.cgi?id=182927
2387         <rdar://problem/37675748>
2388
2389         Reviewed by Antti Koivisto.
2390
2391         Make it safe to call MIMETypeRegistry::isSupportedJavaScriptMIMEType() from the non-main thread.
2392         It is currently being called from a background thread in the following places:
2393         - ServiceWorkerJob::didReceiveResponse()
2394         - WorkerGlobalScope::importScripts()
2395
2396         These call sites on non-main threads were added recently with the support for service workers.
2397
2398         No new tests, already covered by existing tests that flakily experience service worker
2399         process crashes.
2400
2401         * platform/MIMETypeRegistry.cpp:
2402         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
2403
2404 2018-02-19  Dean Jackson  <dino@apple.com>
2405
2406         SIGFPE @ int WebCore::SVGToOTFFontConverter::scaleUnitsPerEm<int> const + 45
2407         https://bugs.webkit.org/show_bug.cgi?id=182944
2408         <rdar://problem/35369984>
2409
2410         Reviewed by Myles Maxfield.
2411
2412         Avoid a divide-by-zero.
2413
2414         Test: svg/text/font-bad-unitsperem.html
2415
2416         * svg/SVGFontFaceElement.cpp:
2417         (WebCore::SVGFontFaceElement::unitsPerEm const):
2418
2419 2018-02-19  Tim Horton  <timothy_horton@apple.com>
2420
2421         REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ
2422         https://bugs.webkit.org/show_bug.cgi?id=182910
2423         <rdar://problem/37533950>
2424
2425         Reviewed by Simon Fraser.
2426
2427         We reverted other changes to the definition of client coordinates
2428         in r219829 due to compatibility concerns. However, we failed to revert
2429         r219342 on trunk, leaving elementFromPoint() using coordinates relative
2430         to the layout viewport.
2431
2432         Add a currently off-by-default setting to switch on layout-viewport-relative
2433         client coordinates and guard the elementFromPoint changes behind it.
2434         A future patch should roll r219829 back in also behind this setting, so
2435         that everything remains consistent regardless of which coordinate space we choose.
2436
2437         * dom/TreeScope.cpp:
2438         (WebCore::absolutePointIfNotClipped):
2439         * page/Settings.yaml:
2440         * rendering/RenderLayer.cpp:
2441         (WebCore::RenderLayer::hitTest):
2442
2443 2018-02-19  Eric Carlson  <eric.carlson@apple.com>
2444
2445         [Extra zoom mode] Don't allow PiP media playback
2446         https://bugs.webkit.org/show_bug.cgi?id=182930
2447         <rdar://problem/37676259>
2448
2449         Reviewed by Andy Estes.
2450
2451         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2452         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Don't call setPIPModeEnabled:
2453         if it isn't implemented.
2454         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
2455
2456 2018-02-19  Antoine Quint  <graouts@apple.com>
2457
2458         [Web Animations] Decouple parsing JS keyframes and computing blending keyframes
2459         https://bugs.webkit.org/show_bug.cgi?id=182939
2460         <rdar://problem/37678364>
2461
2462         Reviewed by Dean Jackson.
2463
2464         Move all the code used to create the KeyframeList into a dedicated updateBlendingKeyframes() method.
2465
2466         No new tests since this code change has no user-visible impact.
2467
2468         * animation/KeyframeEffectReadOnly.cpp:
2469         (WebCore::KeyframeEffectReadOnly::processKeyframes):
2470         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
2471         * animation/KeyframeEffectReadOnly.h:
2472
2473 2018-02-19  Jer Noble  <jer.noble@apple.com>
2474
2475         [EME] Add mechanism for MediaKeySession to react to HDCP changes
2476         https://bugs.webkit.org/show_bug.cgi?id=182935
2477
2478         Reviewed by Eric Carlson.
2479
2480         Add a client callback interface to CDMInterface to allow subclasses to communicate up to
2481         MediaKeySEssion. Add a virtual method to CDMInterface to allow it to be notified of HDCP
2482         status changes. Override this method in CDMInstanceFairPlayStreamingAVFObjC. Hook up the
2483         outputObscuredDueToInsufficientExternalProtectionChanged() methods in both
2484         MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC to this new
2485         CDMInstance method. Add an Internals method to simulate an HDCP error for testing purposes.
2486
2487         * Modules/encryptedmedia/MediaKeySession.cpp:
2488         (WebCore::MediaKeySession::MediaKeySession):
2489         (WebCore::MediaKeySession::~MediaKeySession):
2490         (WebCore::MediaKeySession::updateKeyStatuses):
2491         * Modules/encryptedmedia/MediaKeySession.h:
2492         * platform/encryptedmedia/CDMInstance.h:
2493         (WebCore::CDMInstance::setHDCPStatus):
2494         (WebCore::CDMInstance::setClient):
2495         (WebCore::CDMInstance::clearClient):
2496         * platform/graphics/MediaPlayer.cpp:
2497         (WebCore::MediaPlayer::beginSimulatedHDCPError):
2498         (WebCore::MediaPlayer::endSimulatedHDCPError):
2499         * platform/graphics/MediaPlayer.h:
2500         * platform/graphics/MediaPlayerPrivate.h:
2501         (WebCore::MediaPlayerPrivateInterface::beginSimulatedHDCPError):
2502         (WebCore::MediaPlayerPrivateInterface::endSimulatedHDCPError):
2503         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2504         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2505         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient):
2506         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient):
2507         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
2508         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2509         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2510         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2511         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2512         (WebCore::playerKVOProperties):
2513         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2514         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2515         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2516         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2517         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2518         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2519         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2520         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2521         * testing/Internals.cpp:
2522         (WebCore::Internals::beginSimulatedHDCPError):
2523         (WebCore::Internals::endSimulatedHDCPError):
2524         * testing/Internals.h:
2525         * testing/Internals.idl:
2526
2527 2018-02-19  Chris Dumez  <cdumez@apple.com>
2528
2529         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::TimerBase::~TimerBase
2530         https://bugs.webkit.org/show_bug.cgi?id=182931
2531         <rdar://problem/37602962>
2532
2533         Reviewed by Antti Koivisto.
2534
2535         Make sure PlatformMediaResource is ThreadSafeRefCounted since it is being
2536         used from several threads in WebCoreNSURLSession. Also make sure it is
2537         always destroyed on the main thread since it ends up destroying a
2538         CachedRawResource object.
2539
2540         No new tests, no known reproduction case.
2541
2542         * platform/graphics/PlatformMediaResourceLoader.h:
2543         * platform/network/cocoa/WebCoreNSURLSession.mm:
2544         (-[WebCoreNSURLSessionDataTask dealloc]):
2545
2546 2018-02-19  Zalan Bujtas  <zalan@apple.com>
2547
2548         [RenderTreeBuilder] Rename RenderTreeBuilder::removeAndDestroyChild() -> removeAndDestroy()
2549         https://bugs.webkit.org/show_bug.cgi?id=182934
2550         <rdar://problem/37678241>
2551
2552         Reviewed by Antti Koivisto.
2553
2554         No change in functionality.
2555
2556         * dom/Document.cpp:
2557         (WebCore::Document::setFullScreenRenderer):
2558         * rendering/RenderBoxModelObject.cpp:
2559         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
2560         * rendering/RenderButton.cpp:
2561         (WebCore::RenderButton::setText):
2562         * rendering/RenderFullScreen.cpp:
2563         (WebCore::RenderFullScreen::willBeDestroyed):
2564         (WebCore::RenderFullScreen::unwrapRenderer):
2565         * rendering/RenderListItem.cpp:
2566         (WebCore::RenderListItem::willBeDestroyed):
2567         * rendering/RenderTextFragment.cpp:
2568         (WebCore::RenderTextFragment::willBeDestroyed):
2569         (WebCore::RenderTextFragment::setText):
2570         * rendering/RenderView.cpp:
2571         (WebCore::RenderView::willBeDestroyed):
2572         * rendering/updating/RenderTreeBuilder.cpp:
2573         (WebCore::RenderTreeBuilder::removeAndDestroy):
2574         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2575         (WebCore::RenderTreeBuilder::removeAndDestroyChild): Deleted.
2576         * rendering/updating/RenderTreeBuilder.h:
2577         * rendering/updating/RenderTreeBuilderBlock.cpp:
2578         (WebCore::RenderTreeBuilder::Block::takeChild):
2579         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2580         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
2581         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2582         * rendering/updating/RenderTreeBuilderList.cpp:
2583         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2584         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2585         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2586         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
2587         * rendering/updating/RenderTreeBuilderRuby.cpp:
2588         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2589         (WebCore::RenderTreeBuilder::Ruby::takeChild):
2590
2591 2018-02-19  Daniel Bates  <dabates@apple.com>
2592
2593         Do not block authentication challenge to navigated resources
2594         https://bugs.webkit.org/show_bug.cgi?id=182807
2595         <rdar://problem/37481619>
2596
2597         Reviewed by Brent Fulgham.
2598
2599         Blocking the main resource from asking for credentials depending on how it was
2600         navigated to could be confusing to a person and breaks web compatibility. Restore
2601         the behavior before r224134.
2602
2603         * loader/FrameLoader.cpp:
2604         (WebCore::FrameLoader::receivedFirstData):
2605         * loader/ResourceLoader.cpp:
2606         (WebCore::ResourceLoader::init):
2607         (WebCore::ResourceLoader::willSendRequestInternal):
2608         (WebCore::ResourceLoader::didBlockAuthenticationChallenge):
2609         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const):
2610         (WebCore::ResourceLoader::isMixedContent const): Deleted.
2611         * loader/ResourceLoader.h:
2612         (WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const):
2613         (WebCore::ResourceLoader::wasInsecureRequestSeen const): Deleted.
2614
2615 2018-02-17  Antoine Quint  <graouts@apple.com>
2616
2617         [Web Animations] Store all parsed keyframe input information in a single structure
2618         https://bugs.webkit.org/show_bug.cgi?id=182903
2619
2620         Reviewed by Dean Jackson.
2621
2622         When parsing keyframe input provided through the JS API, we used to create several data structures.
2623         During parsing we would create a Vector<ProcessedKeyframe> where we would store the validated values
2624         for "offset", "easing" and "composite" as well as CSS properties and CSS values as strings. 
2625
2626         Then we would create a KeyframeList, a class that pre-dates the work on Web Animations and is used
2627         for hardware animations, with RenderStyle objects that are used for CSS property blending at runtime.
2628         Once the KeyframeList was created, the Vector<ProcessedKeyframe> was discarded.
2629
2630         Since KeyframeList did not know about nullable offsets, timing functions and composite operations, and
2631         because we do not with to modify a legacy class that we will eventually remove once all the Web Animations
2632         work is complete, we also stored the parsed offsets as m_offsets, the timing functions as m_timingFunctions
2633         and the composite operations as m_compositeOperations.
2634
2635         In this patch we rename the ProcessedKeyframe structure used temporarily during parsing to ParsedKeyframe and
2636         store both the input and processed data related to a given keyframe in that single structure which we keep
2637         around as m_parsedKeyframes when we finished processing the keyframes input. This update ParsedKeyframe structure
2638         allows to keep around the original nullable offsets, the original CSS properties and CSS values as strings as
2639         a HashMap<CSSPropertyID, String>, as well as the CSS properties and CSS values as CSSValue objects using a
2640         MutableStyleProperties object. 
2641
2642         This has the benefit of reducing the number of members, but also pave the way for supporting read-write targets
2643         where we will be able to decouple parsing keyframes and creating a KeyframeList, which requires a valid target
2644         to create RenderStyle objects used for blending, since the original parsing-time information is now stored.
2645
2646         Finally, this allowed getKeyframes() to be more compliant by returning the CSS values as originally provided in
2647         the keyframe input with shorthand properties when provided, rather than the long-hands we used to read back
2648         through RenderStyle objects.
2649
2650         The generated KeyframeList is now stored as m_blendingKeyframes and is only used for the purpose of interfacing
2651         with hardware animations and CSS property blending.
2652
2653         While ProcessedKeyframe was copyable due to holding only simple types, ParsedKeyframe is not since it uses a Ref
2654         to hold the MutableStyleProperties. This uncovered some cases where we copied ProcessedKeyframe objects, we now
2655         ensure that the ParsedKeyframe objects are moved instead, which was the correct thing to do all along.
2656
2657         * animation/KeyframeEffectReadOnly.cpp:
2658         (WebCore::computeMissingKeyframeOffsets): While we used to store std::optional<double> for the computed offset,
2659         we now store a simple double, which makes more sense since the computed offset is eventually a fully resolved
2660         value after calling computeMissingKeyframeOffsets(). So we now compute the final computed offset without resorting
2661         to intermediate nullable computed offsets.
2662         (WebCore::processIterableKeyframes):
2663         (WebCore::processPropertyIndexedKeyframes):
2664         (WebCore::KeyframeEffectReadOnly::KeyframeEffectReadOnly):
2665         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
2666         (WebCore::KeyframeEffectReadOnly::getKeyframes):
2667         (WebCore::KeyframeEffectReadOnly::processKeyframes):
2668         (WebCore::KeyframeEffectReadOnly::computeStackingContextImpact):
2669         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated):
2670         (WebCore::KeyframeEffectReadOnly::getAnimatedStyle):
2671         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
2672         (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated):
2673         * animation/KeyframeEffectReadOnly.h:
2674         (WebCore::KeyframeEffectReadOnly::ParsedKeyframe::ParsedKeyframe):
2675
2676 2018-02-19  Zalan Bujtas  <zalan@apple.com>
2677
2678         [RenderTreeBuilder] Remove redundant RenderObject::removeFromParentAndDestroy
2679         https://bugs.webkit.org/show_bug.cgi?id=182926
2680         <rdar://problem/37674997>
2681
2682         Reviewed by Antti Koivisto.
2683
2684         Call RenderTreeBuilder::removeAndDestroyChild() directly instead. 
2685
2686         No change in functionality.
2687
2688         * dom/Document.cpp:
2689         (WebCore::Document::setFullScreenRenderer):
2690         * rendering/RenderBoxModelObject.cpp:
2691         (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
2692         * rendering/RenderButton.cpp:
2693         (WebCore::RenderButton::setText):
2694         * rendering/RenderFullScreen.cpp:
2695         (WebCore::RenderFullScreen::willBeDestroyed):
2696         (WebCore::RenderFullScreen::unwrapRenderer):
2697         * rendering/RenderListItem.cpp:
2698         (WebCore::RenderListItem::willBeDestroyed):
2699         * rendering/RenderObject.cpp:
2700         (WebCore::RenderObject::removeFromParentAndDestroy): Deleted.
2701         * rendering/RenderObject.h:
2702         * rendering/RenderTextFragment.cpp:
2703         (WebCore::RenderTextFragment::willBeDestroyed):
2704         (WebCore::RenderTextFragment::setText):
2705         * rendering/updating/RenderTreeBuilder.cpp:
2706         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2707         * rendering/updating/RenderTreeBuilderBlock.cpp:
2708         (WebCore::RenderTreeBuilder::Block::takeChild):
2709         * rendering/updating/RenderTreeBuilderList.cpp:
2710         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2711         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2712         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2713         (WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
2714         * rendering/updating/RenderTreeBuilderRuby.cpp:
2715         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
2716         (WebCore::RenderTreeBuilder::Ruby::takeChild):
2717
2718 2018-02-19  Tim Horton  <timothy_horton@apple.com>
2719
2720         Increase text autosizing constants for extra zoom mode
2721         https://bugs.webkit.org/show_bug.cgi?id=182919
2722         <rdar://problem/37671259>
2723
2724         Reviewed by Wenson Hsieh.
2725
2726         * page/Settings.yaml:
2727         * page/SettingsBase.cpp:
2728         (WebCore::SettingsBase::defaultMinimumZoomFontSize):
2729         (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient):
2730         (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient):
2731         (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease):
2732         * page/SettingsBase.h:
2733         * rendering/RenderBlockFlow.cpp:
2734         (WebCore::oneLineTextMultiplier):
2735         (WebCore::textMultiplier):
2736         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2737         * rendering/TextAutoSizing.cpp:
2738         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2739         Make autosizing constants settings, and change their default values.
2740
2741 2018-02-17  Antoine Quint  <graouts@apple.com>
2742
2743         [Web Animations] Accept null composite modes in keyframes
2744         https://bugs.webkit.org/show_bug.cgi?id=182902
2745
2746         Reviewed by Dean Jackson.
2747
2748         The Web Animations spec used to specify that that composite modes should be non-null and instead not be
2749         provided when specifying keyframes, but now null values are accepted. We update the IDL input types used
2750         when parsing keyframes to allow for null values.
2751
2752         We had already updated the getKeyframes() output in webkit.org/b/182600.
2753
2754         * animation/KeyframeEffectReadOnly.cpp:
2755         (WebCore::processIterableKeyframes):
2756         (WebCore::processKeyframeLikeObject):
2757         (WebCore::processPropertyIndexedKeyframes):
2758         * animation/KeyframeEffectReadOnly.h:
2759         * animation/KeyframeEffectReadOnly.idl:
2760
2761 2018-02-19  Ms2ger  <Ms2ger@igalia.com>
2762
2763         Explicitly qualify some method calls on this in lamdas in Service Worker code.
2764         https://bugs.webkit.org/show_bug.cgi?id=182875
2765
2766         Reviewed by Chris Dumez.
2767
2768         This is necessary for the code to build with GCC 5. Other code already
2769         appears to have been adapted similarly.
2770
2771         No change in functionality.
2772
2773         * loader/DocumentLoader.cpp:
2774         (WebCore::DocumentLoader::redirectReceived):
2775         (WebCore::DocumentLoader::startLoadingMainResource):
2776         * workers/service/ServiceWorkerContainer.cpp:
2777         (WebCore::ServiceWorkerContainer::ready):
2778         (WebCore::ServiceWorkerContainer::getRegistration):
2779         (WebCore::ServiceWorkerContainer::getRegistrations):
2780         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
2781         * workers/service/ServiceWorkerGlobalScope.cpp:
2782         (WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet):
2783         * workers/service/server/SWServer.cpp:
2784         (WebCore::SWServer::claim):
2785         (WebCore::SWServer::Connection::resolveRegistrationReadyRequests):
2786         * workers/service/server/SWServerRegistration.cpp:
2787         (WebCore::SWServerRegistration::updateRegistrationState):
2788         (WebCore::SWServerRegistration::setUpdateViaCache):
2789         (WebCore::SWServerRegistration::setLastUpdateTime):
2790         (WebCore::SWServerRegistration::fireUpdateFoundEvent):
2791         * workers/service/server/SWServerWorker.cpp:
2792         (WebCore::SWServerWorker::setState):
2793
2794 2018-02-19  Zalan Bujtas  <zalan@apple.com>
2795
2796         [RenderTreeBuilder] Move RenderElement::removeAndDestroyChild() to RenderTreeBuilder
2797         https://bugs.webkit.org/show_bug.cgi?id=182915
2798         <rdar://problem/37658123>
2799
2800         Reviewed by Antti Koivisto.
2801
2802         No change in functionality.
2803
2804         * rendering/RenderElement.cpp:
2805         (WebCore::RenderElement::removeAndDestroyChild): Deleted.
2806         * rendering/RenderElement.h:
2807         (WebCore::RenderElement::isChildAllowed const):
2808         * rendering/RenderObject.cpp:
2809         (WebCore::RenderObject::removeFromParentAndDestroy):
2810         * rendering/RenderView.cpp:
2811         (WebCore::RenderView::willBeDestroyed):
2812         * rendering/updating/RenderTreeBuilder.cpp:
2813         (WebCore::RenderTreeBuilder::removeAndDestroyChild):
2814         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2815         * rendering/updating/RenderTreeBuilder.h:
2816         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2817         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
2818         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2819
2820 2018-02-12  Sergio Villar Senin  <svillar@igalia.com>
2821
2822         [WebVR][OpenVR] Implement getVRDisplays()
2823         https://bugs.webkit.org/show_bug.cgi?id=182692
2824
2825         Reviewed by Žan Doberšek.
2826
2827         This provides an implementation of Navigator's getVRDisplays()
2828         method using OpenVR as backend. It queues several promises in
2829         a queue and resolves them all just once. The information retrieved
2830         is very minimal for the time being, but this change lays the ground
2831         for all the changes that are about to land.
2832
2833         The VR code uses a VRManager which is the interface with the
2834         platform code and the responsible for instantiating the right
2835         platform code. This platform code is currently being implemented
2836         using OpenVR but could we also ported in the future to OpenXR or any
2837         other VR SDK.
2838
2839         * CMakeLists.txt:
2840         * Modules/webvr/NavigatorWebVR.cpp:
2841         (WebCore::NavigatorWebVR::getVRDisplays):
2842         (WebCore::NavigatorWebVR::vrEnabled):
2843         * Modules/webvr/NavigatorWebVR.h:
2844         * Modules/webvr/VRDisplay.cpp:
2845         (WebCore::VRDisplay::create):
2846         (WebCore::VRDisplay::VRDisplay):
2847         (WebCore::VRDisplay::isConnected const):
2848         (WebCore::VRDisplay::displayName const):
2849         * Modules/webvr/VRDisplay.h:
2850         * Modules/webvr/VRDisplayCapabilities.cpp:
2851         (WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
2852         (WebCore::VRDisplayCapabilities::hasPosition const):
2853         (WebCore::VRDisplayCapabilities::hasOrientation const):
2854         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
2855         (WebCore::VRDisplayCapabilities::canPresent const):
2856         (WebCore::VRDisplayCapabilities::maxLayer const):
2857         * Modules/webvr/VRDisplayCapabilities.h:
2858         (WebCore::VRDisplayCapabilities::create):
2859         * Sources.txt:
2860         * platform/vr/VRManager.cpp: Added. This is the main interface used by bindings code to
2861         access VR devices data provided by platform code.
2862         (WebCore::VRManager::singleton):
2863         (WebCore::VRManager::VRManager):
2864         (WebCore::VRManager::~VRManager):
2865         (WebCore::VRManager::refreshVRDevices):
2866         * platform/vr/VRManager.h: Added.
2867         * platform/vr/VRPlatformDisplay.h: Added. Abstraction of a VR display system. To be
2868         implemented by backends like OpenVR, OpenXR...
2869         * platform/vr/VRPlatformManager.h: Added. Abstraction of the platform specific class which
2870         retrieves data from VR devices. To be implemented by backends like OpenVR, OpenXR...
2871         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: Added.
2872         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2873         * platform/vr/openvr/VRPlatformDisplayOpenVR.h: Added.
2874         * platform/vr/openvr/VRPlatformManagerOpenVR.cpp: Added.
2875         (WebCore::VRPlatformManagerOpenVR::create):
2876         (WebCore::VRPlatformManagerOpenVR::VRPlatformManagerOpenVR):
2877         (WebCore::VRPlatformManagerOpenVR::~VRPlatformManagerOpenVR):
2878         (WebCore::VRPlatformManagerOpenVR::initOpenVR):
2879         * platform/vr/openvr/VRPlatformManagerOpenVR.h: Added.
2880         * WebCore.xcodeproj/project.pbxproj:
2881
2882 2018-02-19  Manuel Rego Casasnovas  <rego@igalia.com>
2883
2884         [css-grid] Apply automatic minimum size clamping to spanning items too
2885         https://bugs.webkit.org/show_bug.cgi?id=182684
2886
2887         Reviewed by Javier Fernandez.
2888
2889         In r225776 we added the conditions from the spec to apply
2890         the automatic minimum size clamping when required
2891         but only to non-spanning items.
2892         See: https://drafts.csswg.org/css-grid/#min-size-auto
2893
2894         This patch moves the code from GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem()
2895         to GridTrackSizingAlgorithmStrategy::minSizeForChild()
2896         that way the clamping is applied for both spanning and non-spanning items.
2897
2898         This somehow reverts r225776, as it was adding some duplicated code.
2899         All the checks to know if we should use that part of the spec
2900         were already present in GridTrackSizingAlgorithmStrategy::minSizeForChild().
2901
2902         Apart from using the previous code, there's a new loop to verify
2903         that the max track sizing function is fixed for all the tracks of the item.
2904
2905         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html
2906                imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html
2907
2908         * rendering/GridTrackSizingAlgorithm.cpp:
2909         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
2910         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2911
2912 2018-02-19  Philippe Normand  <pnormand@igalia.com>
2913
2914         [GTK][GStreamer] Replaying a webm video twice causes the video to stop getting rendered
2915         https://bugs.webkit.org/show_bug.cgi?id=176789
2916
2917         Reviewed by Xabier Rodriguez-Calvar.
2918
2919         Ensure the wrapped GstGLContext is set when the pipeline goes from
2920         READY to PAUSED state. This is a workaround for
2921         https://bugzilla.gnome.org/show_bug.cgi?id=757933.
2922
2923         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2924         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Add debug statement.
2925         (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired): Ditto.
2926         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2927         Ensure the wrapped GstGLContext is set when the pipeline goes from
2928         READY to PAUSED state.
2929         (WebCore::MediaPlayerPrivateGStreamer::didEnd): Add debug statement.
2930         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2931         Change the requestGLContext to be a method instead of a static
2932         function. Being a static function was a requirement for the now-removed OpenWebRTC player.
2933         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Add
2934         debug statement, fix requestGLContext usage.
2935         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext): Refactor as method.
2936         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): Fix requestGLContext usage.
2937         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Remove fixed FIXME.
2938         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGLVideoSinkContext):
2939         Set display and app wrapped contexts on the video sink.
2940         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2941
2942 2018-02-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2943
2944         [GStreamer] Crash in WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete
2945         https://bugs.webkit.org/show_bug.cgi?id=166733
2946
2947         Reviewed by Philippe Normand.
2948
2949         There are a couple of issues to tackle here.
2950
2951         First is handling getting more than one missing plugin
2952         installation request at the same time. For this we add the request
2953         to a Vector and handle them there.
2954
2955         Second is that if the player is dead and we still get the result,
2956         bad things happen. For that we "weaked" the pointer capture by the
2957         lambda.
2958
2959         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2960         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2961         Handle Vector of callbacks.
2962         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Weak
2963         private player pointer and put the callback in the Vector.
2964         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2965         Callback becomes Vector.
2966         * platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h:
2967         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
2968         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete):
2969         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
2970         Callback function is refactored into a "using" type and added self
2971         as parameter to the function.
2972
2973 2018-02-19  Philippe Normand  <pnormand@igalia.com>
2974
2975         [GStreamer] Playbin3 support
2976         https://bugs.webkit.org/show_bug.cgi?id=182530
2977
2978         Reviewed by Xabier Rodriguez-Calvar.
2979
2980         This patch introduces opt-in support for the playbin3 GStreamer
2981         element. This new playback element is still considered
2982         experimental but it can still be very useful for media assets
2983         containing multiple tracks of the same type. In such scenario
2984         audio/video decoders would be created only for the selected tracks
2985         whereas playbin2 creates decoder for each track.
2986
2987         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: Take
2988         a weak pointer of the media player instead of playbin and call the
2989         player when enabling tracks. Also use the GstStream API instead of
2990         inspecting the pad when playbin3 is used.
2991         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
2992         (WebCore::AudioTrackPrivateGStreamer::disconnect):
2993         (WebCore::AudioTrackPrivateGStreamer::markAsActive):
2994         (WebCore::AudioTrackPrivateGStreamer::setEnabled):
2995         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2996         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: GstStream and
2997         GstStreamCollection smart pointer support.
2998         (WTF::adoptGRef):
2999         (WTF::refGPtr<GstStream>):
3000         (WTF::derefGPtr<GstStream>):
3001         (WTF::refGPtr<GstStreamCollection>):
3002         (WTF::derefGPtr<GstStreamCollection>):
3003         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3004         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
3005         Use the GstStream API instead of inspecting the pad when playbin3
3006         is used.
3007         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
3008         (WebCore::InbandTextTrackPrivateGStreamer::disconnect):
3009         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3010         (WebCore::InbandTextTrackPrivateGStreamer::create):
3011         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3012         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3013         m_{audio,video,text}Tracks are now hashmaps, which is a bit more
3014         convenient to use than Vectors.
3015         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Update our
3016         tracks implementations depending on the streams stored in the
3017         collection.
3018         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Activate the
3019         given track. This method is called by the TrackPrivate
3020         implementations.
3021         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
3022         Refactored legacy (playbin2) support for track hashmap storage.
3023         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
3024         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
3025         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Use track hashmap storage.
3026         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): React on
3027         playbin3 GstStream messages, store the collection provided and
3028         activate the given selected streams accordingly.
3029         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Invalidate tracks no longer needed.
3030         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
3031         (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
3032         (WebCore::MediaPlayerPrivateGStreamer::sourceSetupCallback):
3033         Refactoring, use source-setup signal instead of the source
3034         property which is not supported in playbin3.
3035         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
3036         Promoted logging messages, GST_TRACE should be used for very
3037         frequent and less interesting messages.
3038         (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): Ditto.
3039         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Called by the source-setup signal handler.
3040         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Debugging message added.
3041         (WebCore::MediaPlayerPrivateGStreamer::setPreload): Ditto.
3042         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Create a
3043         playbin3 element if USE(GSTREAMER_PLAYBIN3) was enabled and
3044         connect to playbin2 signals otherwise.
3045         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3046         (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Promoted to public.
3047         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3048         New StreamCollectionChanged notification type, used the sub-class.
3049         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3050         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): Support for GstStream API.
3051         (WebCore::TrackPrivateBaseGStreamer::disconnect): Clear GstStream too.
3052         (WebCore::TrackPrivateBaseGStreamer::tagsChanged): Get tags from GstStream.
3053         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged): No need to check m_pad twice.
3054         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Ditto.
3055         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3056         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: Take
3057         a weak pointer of the media player instead of playbin and call the
3058         player when enabling tracks. Also use the GstStream API instead of
3059         inspecting the pad when playbin3 is used.
3060         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
3061         (WebCore::VideoTrackPrivateGStreamer::disconnect):
3062         (WebCore::VideoTrackPrivateGStreamer::markAsActive):
3063         (WebCore::VideoTrackPrivateGStreamer::setSelected):
3064         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
3065         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Pass player pointer to track constructor.
3066         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
3067         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Source-setup signal handler.
3068         (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup):
3069         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3070
3071 2018-02-19  Fujii Hironori  <Hironori.Fujii@sony.com>
3072
3073         REGRESSION(r219298): RELEASE_ASSERT(!m_owningPointerForClose) fails in WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
3074         https://bugs.webkit.org/show_bug.cgi?id=174354
3075         <rdar://problem/33294987>
3076
3077         Reviewed by Michael Catanzaro.
3078
3079         UniqueIDBDatabase::invokeOperationAndTransactionTimer was called
3080         even after m_owningPointerForClose was set in
3081         UniqueIDBDatabase::didDeleteBackingStore.
3082
3083         No new tests (Covered by existing tests).
3084
3085         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3086         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3087         Do not start deleting the UniqueIDBDatabase. Just call invokeOperationAndTransactionTimer.
3088         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
3089         Assert m_owningPointerForClose is null.
3090
3091 2018-02-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3092
3093         Fix build error after r228417 without ACCESSIBILITY
3094         https://bugs.webkit.org/show_bug.cgi?id=182914
3095
3096         Reviewed by Chris Fleizach.
3097
3098         An inline empty version of AXObjectCache::deferFocusdUIElementChangeIfNeeded()
3099         needs to be defined if not HAVE(ACCESSIBILITY). 
3100
3101         * accessibility/AXObjectCache.h:
3102         (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
3103
3104 2018-02-18  Zalan Bujtas  <zalan@apple.com>
3105
3106         [RenderTreeBuilder] REGRESSION(r228238) Detach renderer before destroying its subtree.
3107         https://bugs.webkit.org/show_bug.cgi?id=182908
3108         <rdar://problem/37619394>
3109
3110         Reviewed by Antti Koivisto.
3111
3112         Prior to r228238 we first detached the to-be-destroyed renderer and then
3113         started nuking its descendants. r228238 changed the order and now the descendants are
3114         destroyed while they are still attached to the tree. Apparently some of the takeChild()
3115         normalization logic gets triggered now that the renderers still have access to their previous/next
3116         siblings. This is unexpected and it shouldn't matter whether the subtree is still attached.
3117         Let's revert it to the original order for now (see webkit.org/b/182909).
3118
3119         Test: fast/block/crash-when-subtree-is-still-attached.html
3120
3121         * rendering/RenderElement.cpp:
3122         (WebCore::RenderElement::removeAndDestroyChild):
3123
3124 2018-02-18  Charlie Turner  <cturner@igalia.com>
3125
3126         [GStreamer] Push smaller buffers from HTTP source
3127         https://bugs.webkit.org/show_bug.cgi?id=182829
3128
3129         Reviewed by Philippe Normand.
3130
3131         Split the received buffer into smaller buffers of a size consistent
3132         with the basesrc (4KiB). It is important not to push large buffers
3133         into the appsrc (where large is relative to the appsrc's configured
3134         byte size). If large buffers are pushed, then when they are internally
3135         dequeued by the appsrc, the buffering percentage can dramatically
3136         plummet due to a large amount of bytes being removed after a push. This
3137         can in turn trick the media player into thinking it needs to buffer,
3138         and then issuing a spurious set of playing->paused then
3139         paused->playing transitions, which by the time the buffering logic
3140         completes, data are already available.
3141
3142         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3143         (CachedResourceStreamingClient::dataReceived):
3144
3145 2018-02-17  Darin Adler  <darin@apple.com>
3146
3147         Web Inspector: get rid of remaining uses of OptOutput<T>
3148         https://bugs.webkit.org/show_bug.cgi?id=180607
3149
3150         Reviewed by Brian Burg.
3151
3152         * inspector/InspectorStyleSheet.cpp:
3153         (WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*.
3154         (WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead
3155         of lineEndings().get().
3156         (WebCore::InspectorStyle::styleWithProperties const): Ditto.
3157         (WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto.
3158         (WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of
3159         a std::unique_ptr<Vector>.
3160         (WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto.
3161         * inspector/InspectorStyleSheet.h: Updated for the above.
3162
3163         * inspector/agents/InspectorCSSAgent.h: Removed some bogus const.
3164         * inspector/agents/InspectorCanvasAgent.cpp: Ditto.
3165         * inspector/agents/InspectorCanvasAgent.h: Ditto.
3166
3167         * inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings
3168         so we don't waste space with a pointer to the string.
3169         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed
3170         explicit creation of String, which was wasteful and unnecessary.
3171         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto.
3172         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto.
3173         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto.
3174         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const.
3175
3176         * inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use
3177         final instead of override.
3178         * inspector/agents/InspectorPageAgent.cpp: Ditto.
3179         * inspector/agents/InspectorPageAgent.h: Ditto.
3180
3181 2018-02-16  Zalan Bujtas  <zalan@apple.com>
3182
3183         [RenderTreeBuilder] Cleanup RenderTreeBuilder
3184         https://bugs.webkit.org/show_bug.cgi?id=182899
3185         <rdar://problem/37627888>
3186
3187         Reviewed by Antti Koivisto.
3188
3189         No change in functionality.
3190
3191         * rendering/RenderBlockFlow.cpp:
3192         (WebCore::RenderBlockFlow::styleDidChange):
3193         * rendering/updating/RenderTreeBuilder.cpp:
3194         (WebCore::RenderTreeBuilder::takeChild):
3195         (WebCore::RenderTreeBuilder::moveChildTo):
3196         (WebCore::RenderTreeBuilder::moveAllChildrenTo):
3197         (WebCore::RenderTreeBuilder::moveChildrenTo):
3198         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
3199         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
3200         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
3201         (WebCore::RenderTreeBuilder::takeChildFromRenderMenuList): Deleted.
3202         (WebCore::RenderTreeBuilder::takeChildFromRenderButton): Deleted.
3203         * rendering/updating/RenderTreeBuilder.h:
3204         (WebCore::RenderTreeBuilder::current):
3205         * rendering/updating/RenderTreeBuilderBlock.cpp:
3206         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
3207         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
3208         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
3209         * rendering/updating/RenderTreeBuilderFormControls.cpp:
3210         (WebCore::RenderTreeBuilder::FormControls::takeChild):
3211         * rendering/updating/RenderTreeBuilderFormControls.h:
3212         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3213         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
3214         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
3215         * rendering/updating/RenderTreeBuilderRuby.cpp:
3216         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
3217         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
3218         (WebCore::RenderTreeBuilder::Ruby::takeChild):
3219         * rendering/updating/RenderTreeBuilderTable.cpp:
3220         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
3221
3222 2018-02-16  Daniel Bates  <dabates@apple.com>
3223
3224         Remove UTF-32 BOM parsing code
3225         https://bugs.webkit.org/show_bug.cgi?id=182900
3226         <rdar://problem/37238717>
3227
3228         Reviewed by Alexey Proskuryakov.
3229
3230         The UTF-32 encodings were removed from the text codec registry in r224747. So,
3231         we no longer need code to parse UTF-32{BE, LE} BOM or encode and decode these
3232         variants.
3233
3234         * dom/TextDecoder.cpp:
3235         (WebCore::codeUnitByteSize):
3236         * loader/TextResourceDecoder.cpp:
3237         (WebCore::TextResourceDecoder::checkForBOM):
3238         (WebCore::TextResourceDecoder::checkForHeadCharset):
3239         * platform/text/TextEncoding.cpp:
3240         (WebCore::TextEncoding::isNonByteBasedEncoding const):
3241         (WebCore::UTF32BigEndianEncoding): Deleted.
3242         (WebCore::UTF32LittleEndianEncoding): Deleted.
3243         * platform/text/TextEncoding.h:
3244
3245 2018-02-16  Zalan Bujtas  <zalan@apple.com>
3246
3247         [RenderTreeBuilder] Move RenderBoxModelObject::moveChild*() to RenderTreeBuilder
3248         https://bugs.webkit.org/show_bug.cgi?id=182896
3249         <rdar://problem/37623051>
3250
3251         Reviewed by Antti Koivisto.
3252
3253         No change in functionality.
3254
3255         * rendering/RenderBlock.h:
3256         (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): Deleted.
3257         * rendering/RenderBlockFlow.cpp:
3258         (WebCore::RenderBlockFlow::styleDidChange):
3259         (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
3260         * rendering/RenderBlockFlow.h:
3261         * rendering/RenderBoxModelObject.cpp:
3262         (WebCore::RenderBoxModelObject::moveChildTo): Deleted.
3263         (WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
3264         (WebCore::RenderBoxModelObject::moveAllChildrenToInternal): Deleted.
3265         * rendering/RenderBoxModelObject.h:
3266         (WebCore::RenderBoxModelObject::moveChildTo): Deleted.
3267         (WebCore::RenderBoxModelObject::moveAllChildrenTo): Deleted.
3268         (WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
3269         * rendering/updating/RenderTreeBuilder.cpp:
3270         (WebCore::RenderTreeBuilder::moveChildTo):
3271         (WebCore::RenderTreeBuilder::moveAllChildrenTo):
3272         (WebCore::RenderTreeBuilder::moveChildrenTo):
3273         (WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
3274         (WebCore::RenderTreeBuilder::makeChildrenNonInline):
3275         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
3276         * rendering/updating/RenderTreeBuilder.h:
3277         * rendering/updating/RenderTreeBuilderBlock.cpp:
3278         (WebCore::moveAllChildrenToInternal):
3279         (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
3280         (WebCore::RenderTreeBuilder::Block::takeChild):
3281         (WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
3282         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
3283         (WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
3284         * rendering/updating/RenderTreeBuilderBlockFlow.h:
3285         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3286         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
3287         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
3288         * rendering/updating/RenderTreeBuilderRuby.cpp:
3289         (WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
3290         (WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
3291         (WebCore::RenderTreeBuilder::Ruby::takeChild):
3292         * rendering/updating/RenderTreeBuilderTable.cpp:
3293         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
3294
3295 2018-02-16  Andy Estes  <aestes@apple.com>
3296
3297         [Cocoa] Stop using non-prefixed vDSP functions in 32-bit builds
3298         https://bugs.webkit.org/show_bug.cgi?id=182898
3299         <rdar://problem/37195079>
3300
3301         Reviewed by Tim Horton.
3302
3303         There's no need to use non-prefixed vDSP function aliases on 32-bit builds.
3304         The vDSP-prefixed versions are available on all Cocoa platforms we currently support.
3305
3306         * platform/audio/DirectConvolver.cpp:
3307         (WebCore::DirectConvolver::process):
3308         * platform/audio/VectorMath.cpp:
3309         (WebCore::VectorMath::vsmul):
3310         (WebCore::VectorMath::vadd):
3311         (WebCore::VectorMath::vmul):
3312         (WebCore::VectorMath::zvmul):
3313
3314 2018-02-16  Ryan Haddad  <ryanhaddad@apple.com>
3315
3316         Unreviewed, rolling out r228575.
3317
3318         Introduced LayoutTest crashes under GuardMalloc.
3319
3320         Reverted changeset:
3321
3322         "Use ResourceLoader to load appcache manifest"
3323         https://bugs.webkit.org/show_bug.cgi?id=182861
3324         https://trac.webkit.org/changeset/228575
3325
3326 2018-02-16  Dean Jackson  <dino@apple.com>
3327
3328         Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
3329         https://bugs.webkit.org/show_bug.cgi?id=182894
3330
3331         Reviewed by Tim Horton.
3332
3333         Adjust the places where we check for PLATFORM(MAC) or
3334         PLATFORM(IOS) related to WebGL, and instead rely
3335         on USE(OPENGL) USE(OPENGL_ES).
3336
3337         * CMakeLists.txt:
3338         * PlatformGTK.cmake:
3339         * platform/graphics/GLContext.cpp:
3340         (WebCore::initializeOpenGLShimsIfNeeded):
3341         * platform/graphics/GraphicsContext3DPrivate.cpp:
3342         * platform/graphics/OpenGLESShims.h:
3343         * platform/graphics/cairo/ImageBufferCairo.cpp:
3344         * platform/graphics/egl/GLContextEGL.cpp:
3345         (WebCore::GLContextEGL::getEGLConfig):
3346         (WebCore::GLContextEGL::createContext):
3347         (WebCore::GLContextEGL::createSharingContext):
3348         * platform/graphics/egl/GLContextEGLWPE.cpp:
3349         (WebCore::GLContextEGL::createWPEContext):
3350         * platform/graphics/egl/GLContextEGLWayland.cpp:
3351         (WebCore::GLContextEGL::createWaylandContext):
3352         * platform/graphics/egl/GLContextEGLX11.cpp:
3353         (WebCore::GLContextEGL::createPixmapContext):
3354         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3355         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
3356         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
3357         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
3358         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
3359         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
3360         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
3361         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
3362         * platform/graphics/opengl/Extensions3DOpenGLES.h:
3363         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
3364         (WebCore::GraphicsContext3D::create):
3365         (WebCore::GraphicsContext3D::GraphicsContext3D):
3366         (WebCore::GraphicsContext3D::isGLES2Compliant const):
3367         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
3368         (WebCore::GraphicsContext3D::create):
3369         (WebCore::GraphicsContext3D::GraphicsContext3D):
3370         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3371         (WebCore::GraphicsContext3D::isGLES2Compliant const):
3372         (WebCore::GraphicsContext3D::getExtensions):
3373         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
3374         (WebCore::TextureMapperContextAttributes::initialize):
3375         * platform/graphics/texmap/TextureMapperGL.cpp:
3376         (WebCore::TextureMapperGLData::~TextureMapperGLData):
3377         (WebCore::TextureMapperGLData::getVAO):
3378         (WebCore::TextureMapperGL::beginPainting):
3379         (WebCore::TextureMapperGL::endPainting):
3380         * platform/graphics/texmap/TextureMapperGLHeaders.h:
3381         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
3382         (WebCore::TextureMapperShaderProgram::create):
3383
3384 2018-02-16  Zalan Bujtas  <zalan@apple.com>
3385
3386         [RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder
3387         https://bugs.webkit.org/show_bug.cgi?id=182885
3388         <rdar://problem/37617371>
3389
3390         Reviewed by Antti Koivisto.
3391
3392         No change in functionality.
3393
3394         * rendering/RenderElement.cpp:
3395         (WebCore::RenderElement::insertChildInternal): Deleted.