[iOS] AirPlay device name is sometimes wrong
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-04-17  Eric Carlson  <eric.carlson@apple.com>
2
3         [iOS] AirPlay device name is sometimes wrong
4         https://bugs.webkit.org/show_bug.cgi?id=184543
5         <rdar://problem/39105498>
6
7         Reviewed by Jer Noble.
8
9         No new tests, this can only be tested with a specific hardware setup.
10
11         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
12         (WebCore::exernalDeviceDisplayNameForPlayer): Get the device name from the AVOutputContext
13         when possible.
14
15 2018-04-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
16
17         [GTK] Build fix after r230529 (WaylandCompositorDisplay leaks its wl_display)
18         https://bugs.webkit.org/show_bug.cgi?id=184406
19
20         Rubber-stamped by Michael Catanzaro.
21
22         Fix build with clang 3.8
23
24         No new tests, it is a build fix.
25
26         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
27         (WebCore::PlatformDisplayWayland::create):
28
29 2018-04-16  Antoine Quint  <graouts@apple.com>
30
31         Layout Test animations/needs-layout.html is a flaky Image Failure.
32         https://bugs.webkit.org/show_bug.cgi?id=172397
33
34         Reviewed by Dean Jackson.
35
36         Animations that animate a transform and uses a relative value for either the x or y components
37         require a layout before starting, which CSSAnimationController would perform in the call to
38         CSSAnimationControllerPrivate::animationTimerFired() made immediately after a CSS animation was
39         created.
40
41         We now perform a similar task where upon setting new blending keyframes we compute a flag indicating
42         if the keyframe effect is animating a transform with relative x or y components. Then, when we perform
43         the first invalidation task, which runs in the next run loop after a change to the timing model has
44         been made, such as a call to play() on a CSSAnimation made in the TreeResolver::createAnimatedElementUpdate()
45         where the CSSAnimation was created, we call forceLayout() on this element's FrameView. We also ensure
46         we commit animations on the compositor immediately after that too, instead of waiting until the next
47         DisplayRefreshMonitor callback.
48
49         * animation/DocumentTimeline.cpp:
50         (WebCore::DocumentTimeline::performInvalidationTask):
51         (WebCore::DocumentTimeline::updateAnimations):
52         * animation/KeyframeEffectReadOnly.cpp:
53         (WebCore::KeyframeEffectReadOnly::forceLayoutIfNeeded):
54         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
55         (WebCore::KeyframeEffectReadOnly::computedNeedsForcedLayout):
56         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
57         * animation/KeyframeEffectReadOnly.h:
58
59 2018-04-16  Pablo Saavedra  <psaavedra@igalia.com>
60
61         Inconsistent EGL defines in ImageBufferCairo
62         https://bugs.webkit.org/show_bug.cgi?id=184661
63
64         Reviewed by Žan Doberšek.
65
66         On revision r219391 libepoxy is added. The headers in
67         ImageBufferCairo.cpp become inconsistent when 2D canvas is enabled
68         (-DENABLE_ACCELERATED_2D_CANVAS=ON) due to a redefinition error during
69         the Webkit build:
70
71             ...
72             /usr/include/GLES2/gl2.h:503:82: error: 'voi
73             epoxy_glAttachShader(GLuint, GLuint)' redeclared as different kind
74             of symbol
75             GL_APICALL void         GL_APIENTRY glAttachShader (GLuint
76             program, GLuint shader);
77
78         No new tests.
79
80         * platform/graphics/cairo/ImageBufferCairo.cpp:
81
82 2018-04-16  Filip Pizlo  <fpizlo@apple.com>
83
84         MutationObserver should be in an IsoHeap
85         https://bugs.webkit.org/show_bug.cgi?id=184671
86         <rdar://problem/36081981>
87
88         Reviewed by Sam Weinig.
89
90         No new tests because no new behavior.
91
92         * dom/MutationObserver.cpp:
93         * dom/MutationObserver.h:
94
95 2018-04-16  Youenn Fablet  <youenn@apple.com>
96
97         Use NetworkLoadChecker to handle synchronous HTTP loads
98         https://bugs.webkit.org/show_bug.cgi?id=184240
99
100         Reviewed by Chris Dumez.
101
102         Update LoaderStrategy::loadResourceSynchronously to pass FetchOptions directly.
103         Update various call sites accordingly. This allows NetworkProcess to do all necessary checks.
104         Add an option to disable security checks if NetworkProcess does it for WebProcess.
105         This option will be also used for regular asynchronous loads in future patches.
106
107         Update DocumentThreadableLoader to bypass preflighting and response validation checks in case they are done in NetworkProcess.
108
109         Covered by existing and rebased tests.
110
111         * loader/CrossOriginPreflightChecker.cpp:
112         (WebCore::CrossOriginPreflightChecker::doPreflight):
113         * loader/DocumentThreadableLoader.cpp:
114         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
115         (WebCore::DocumentThreadableLoader::loadRequest):
116         * loader/FrameLoader.cpp:
117         (WebCore::FrameLoader::loadResourceSynchronously):
118         * loader/FrameLoader.h:
119         * loader/LoaderStrategy.h:
120         * xml/XSLTProcessorLibxslt.cpp:
121         (WebCore::docLoaderFunc):
122         * xml/parser/XMLDocumentParserLibxml2.cpp:
123         (WebCore::openFunc):
124
125 2018-04-16  Christopher Reid  <chris.reid@sony.com>
126
127         [WinCairo] Media elements should be enabled by default
128         https://bugs.webkit.org/show_bug.cgi?id=184597
129
130         Reviewed by Per Arne Vollan.
131
132         Enabling media elements by default with media foundation.
133
134         * page/SettingsDefaultValues.h:
135
136 2018-04-16  Christopher Reid  <chris.reid@sony.com>
137
138         [Curl] Add the Accept-Language field to curl request headers
139         https://bugs.webkit.org/show_bug.cgi?id=184605
140
141         Reviewed by Alex Christensen.
142
143         Add Accept-Language field to curl request headers
144
145         * platform/network/curl/CurlRequest.cpp:
146         * platform/network/curl/CurlRequest.h:
147
148 2018-04-16  Chris Dumez  <cdumez@apple.com>
149
150         Move more WindowProxy-related logic from ScriptController to WindowProxyController
151         https://bugs.webkit.org/show_bug.cgi?id=184640
152
153         Reviewed by Ryosuke Niwa.
154
155         Move more WindowProxy-related logic from ScriptController to WindowProxyController,
156         for clarity.
157
158         * bindings/js/JSDOMWindowProxy.cpp:
159         (WebCore::JSDOMWindowProxy::attachDebugger):
160         * bindings/js/JSDOMWindowProxy.h:
161         * bindings/js/ScriptCachedFrameData.cpp:
162         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
163         (WebCore::ScriptCachedFrameData::restore):
164         * bindings/js/ScriptController.cpp:
165         (WebCore::ScriptController::~ScriptController):
166         (WebCore::ScriptController::initScriptForWindowProxy):
167         * bindings/js/ScriptController.h:
168         (WebCore::ScriptController::existingCacheableBindingRootObject const):
169         * bindings/js/WindowProxyController.cpp:
170         (WebCore::collectGarbageAfterWindowProxyDestruction):
171         (WebCore::WindowProxyController::~WindowProxyController):
172         (WebCore::WindowProxyController::clearWindowProxiesNotMatchingDOMWindow):
173         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
174         (WebCore::WindowProxyController::attachDebugger):
175         * bindings/js/WindowProxyController.h:
176         * loader/FrameLoader.cpp:
177         (WebCore::FrameLoader::clear):
178         * page/Page.cpp:
179         (WebCore::Page::setDebugger):
180
181 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
182
183         [GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select in constructor
184         https://bugs.webkit.org/show_bug.cgi?id=184652
185
186         Reviewed by Philippe Normand.
187
188         In the constructor we should mark selected streams based on the default values from GstStream,
189         if the user changes them, they will be updated as required later on.
190
191         No new tests are added as we already have a few ones that are currently disabled in
192         the mediastream testsuite. This patch is part of the work to enable them.
193
194         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
195         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
196         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
197         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
198
199 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
200
201         [GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client is avalaible
202         https://bugs.webkit.org/show_bug.cgi?id=184651
203
204         Reviewed by Philippe Normand.
205
206         We can't notify the client if none is connected, but still we need to fill our metadatas from
207         the provided GstTagList, especially in the case of playbin3 where the client is not set yet
208         at construct time but the metadata might already be preset (and won't be updated later on).
209
210         No new tests are added as we already have a few ones that are currently disabled in
211         the mediastream testsuite. This patch is part of the work to enable them.
212
213         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
214         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
215
216 2018-04-16  Antoine Quint  <graouts@apple.com>
217
218         [Web Animations] Ensure we never return -0 through the API
219         https://bugs.webkit.org/show_bug.cgi?id=184644
220
221         Reviewed by Dean Jackson.
222
223         We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
224         This would happen when playbackRate < 0.
225
226         * animation/WebAnimationUtilities.h:
227         (WebCore::secondsToWebAnimationsAPITime):
228
229 2018-04-15  Antoine Quint  <graouts@apple.com>
230
231         [Web Animations] Animations do not naturally get a finish event
232         https://bugs.webkit.org/show_bug.cgi?id=184639
233         <rdar://problem/39397649>
234
235         Reviewed by Jon Lee.
236
237         We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
238         and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
239         set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
240         the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
241         they will keep being scheduled in a loop.
242
243         * animation/WebAnimation.cpp:
244         (WebCore::WebAnimation::timeToNextRequiredTick const):
245         (WebCore::WebAnimation::resolve):
246
247 2018-04-15  Chris Dumez  <cdumez@apple.com>
248
249         Change Event's returnValue so it doesn't expose a new primitive
250         https://bugs.webkit.org/show_bug.cgi?id=184415
251
252         Reviewed by Darin Adler.
253
254         Update Event.returnValue setter to match the latest DOM specification after:
255         - https://github.com/whatwg/dom/pull/626
256
257         In particular, the returnValue setter is now a no-op if the new flag value
258         is true. If the input flag value is false, it only sets the 'canceled' flag
259         if the event is cancelable and the event’s in passive listener flag is unset.
260
261         Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html
262
263         * dom/Event.cpp:
264         (WebCore::Event::setLegacyReturnValue):
265         (WebCore::Event::setCanceledFlagIfPossible):
266         (WebCore::Event::preventDefault):
267         * dom/Event.h:
268
269 2018-04-14  Thibault Saunier  <tsaunier@igalia.com>
270
271         [GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
272         https://bugs.webkit.org/show_bug.cgi?id=184620
273
274         Reviewed by Philippe Normand.
275
276         This is a minor change, a dedicated test doesn't really make sense here.
277
278         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
279         (WebCore::TrackPrivateBaseGStreamer::stream):
280
281 2018-04-13  Ryosuke Niwa  <rniwa@webkit.org>
282
283         WebKit crashes when libwebrtc.dylib is missing
284         https://bugs.webkit.org/show_bug.cgi?id=184607
285
286         Rubber-stamped by Jer Noble.
287
288         Don't call LibWebRTC related code when libwebrtc is not available.
289
290         * dom/Document.cpp:
291         (WebCore::Document::prepareForDestruction):
292         (WebCore::Document::suspend):
293
294 2018-04-13  Chris Dumez  <cdumez@apple.com>
295
296         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
297         https://bugs.webkit.org/show_bug.cgi?id=184591
298
299         Reviewed by Sam Weinig.
300
301         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
302         RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
303         This is work towards fixing Bug 184515.
304
305         * Sources.txt:
306         * WebCore.xcodeproj/project.pbxproj:
307         * bindings/js/DOMWrapperWorld.cpp:
308         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
309         (WebCore::DOMWrapperWorld::clearWrappers):
310         * bindings/js/DOMWrapperWorld.h:
311         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
312         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
313         * bindings/js/JSBindingsAllInOne.cpp:
314         * bindings/js/JSDOMWindowBase.cpp:
315         (WebCore::toJSDOMWindow):
316         * bindings/js/JSDOMWindowProxy.cpp:
317         (WebCore::toJS):
318         (WebCore::toJSDOMWindowProxy):
319         * bindings/js/ScriptCachedFrameData.cpp:
320         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
321         (WebCore::ScriptCachedFrameData::restore):
322         * bindings/js/ScriptController.cpp:
323         (WebCore::ScriptController::~ScriptController):
324         (WebCore::ScriptController::evaluateInWorld):
325         (WebCore::ScriptController::loadModuleScriptInWorld):
326         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
327         (WebCore::ScriptController::evaluateModule):
328         (WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
329         (WebCore::ScriptController::setDOMWindowForWindowProxy):
330         (WebCore::ScriptController::initScriptForWindowProxy):
331         (WebCore::ScriptController::setupModuleScriptHandlers):
332         (WebCore::ScriptController::windowProxyController):
333         (WebCore::ScriptController::enableEval):
334         (WebCore::ScriptController::enableWebAssembly):
335         (WebCore::ScriptController::disableEval):
336         (WebCore::ScriptController::disableWebAssembly):
337         (WebCore::ScriptController::attachDebugger):
338         (WebCore::ScriptController::updateDocument):
339         (WebCore::ScriptController::collectIsolatedContexts):
340         (WebCore::ScriptController::windowScriptNPObject):
341         (WebCore::ScriptController::executeIfJavaScriptURL):
342         * bindings/js/ScriptController.h:
343         (WebCore::ScriptController::globalObject):
344         * bindings/js/ScriptControllerMac.mm:
345         (WebCore::ScriptController::windowScriptObject):
346         * bindings/js/ScriptState.cpp:
347         (WebCore::mainWorldExecState):
348         * bindings/js/WindowProxyController.cpp: Added.
349         (WebCore::WindowProxyController::WindowProxyController):
350         (WebCore::WindowProxyController::destroyWindowProxy):
351         (WebCore::WindowProxyController::createWindowProxy):
352         (WebCore::WindowProxyController::windowProxies):
353         (WebCore::WindowProxyController::createWindowProxyWithInitializedScript):
354         * bindings/js/WindowProxyController.h: Added.
355         (WebCore::WindowProxyController::releaseWindowProxies):
356         (WebCore::WindowProxyController::setWindowProxies):
357         (WebCore::WindowProxyController::windowProxy):
358         (WebCore::WindowProxyController::existingWindowProxy const):
359         (WebCore::WindowProxyController::globalObject):
360         * loader/FrameLoader.cpp:
361         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
362         * page/AbstractFrame.cpp:
363         (WebCore::AbstractFrame::AbstractFrame):
364         * page/AbstractFrame.h:
365         (WebCore::AbstractFrame::windowProxyController):
366         (WebCore::AbstractFrame::windowProxyController const):
367
368 2018-04-13  Brady Eidson  <beidson@apple.com>
369
370         Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
371         https://bugs.webkit.org/show_bug.cgi?id=184559
372
373         Reviewed by Alex Christensen.
374
375         Covered by new API test.
376
377         WebCore changes rework the meaning of a "ForSuspension" policy to simply navigate the page to about:blank.
378
379         * loader/DocumentLoader.cpp:
380         (WebCore::DocumentLoader::redirectReceived):
381         (WebCore::DocumentLoader::willSendRequest):
382         (WebCore::DocumentLoader::startLoadingMainResource):
383         * loader/DocumentLoader.h:
384
385         * loader/FrameLoader.cpp:
386         (WebCore::FrameLoader::init):
387         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
388
389 2018-04-13  Chris Dumez  <cdumez@apple.com>
390
391         input.webkitEntries does not work as expected when folder contains accented chars
392         https://bugs.webkit.org/show_bug.cgi?id=184517
393         <rdar://problem/39265537>
394
395         Reviewed by Alex Christensen.
396
397         Use String::fromUTF8() to construct a WTF String from the char* returned by
398         dirname() in FileSystem::directoryName(). Previously, we were just calling
399         the String constructor, which would treat the input as latin 1 instead of
400         UTF-8.
401
402         Change is covered by an API test rather than a layout test due to file versioning
403         limitations.
404
405         * platform/posix/FileSystemPOSIX.cpp:
406         (WebCore::FileSystem::directoryName):
407
408 2018-04-13  Yusuke Suzuki  <utatane.tea@gmail.com>
409
410         [WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
411         https://bugs.webkit.org/show_bug.cgi?id=184401
412
413         Rubber stamped by Saam Barati.
414
415         Apply bug 183970 changes to WebCore JS too. This offers solid type checking
416         with @getByIdDirectPrivate().
417
418         * Modules/mediastream/RTCPeerConnection.js:
419         (initializeRTCPeerConnection):
420         (getLocalStreams):
421         (getStreamById):
422         (addStream):
423         * Modules/mediastream/RTCPeerConnectionInternals.js:
424         (isRTCPeerConnection):
425         * Modules/streams/ReadableByteStreamController.js:
426         (enqueue):
427         (error):
428         (close):
429         (getter.byobRequest):
430         * Modules/streams/ReadableByteStreamInternals.js:
431         (privateInitializeReadableStreamBYOBReader):
432         (privateInitializeReadableByteStreamController):
433         (privateInitializeReadableStreamBYOBRequest):
434         (isReadableByteStreamController):
435         (isReadableStreamBYOBRequest):
436         (isReadableStreamBYOBReader):
437         (readableByteStreamControllerCancel):
438         (readableByteStreamControllerError):
439         (readableByteStreamControllerClose):
440         (readableByteStreamControllerClearPendingPullIntos):
441         (readableByteStreamControllerGetDesiredSize):
442         (readableStreamHasBYOBReader):
443         (readableStreamHasDefaultReader):
444         (readableByteStreamControllerHandleQueueDrain):
445         (readableByteStreamControllerPull):
446         (readableByteStreamControllerShouldCallPull):
447         (readableByteStreamControllerCallPullIfNeeded):
448         (readableByteStreamControllerEnqueue):
449         (readableByteStreamControllerEnqueueChunk):
450         (readableByteStreamControllerRespondWithNewView):
451         (readableByteStreamControllerRespond):
452         (readableByteStreamControllerRespondInternal):
453         (readableByteStreamControllerRespondInReadableState):
454         (readableByteStreamControllerRespondInClosedState):
455         (readableByteStreamControllerProcessPullDescriptors):
456         (readableByteStreamControllerFillDescriptorFromQueue):
457         (readableByteStreamControllerShiftPendingDescriptor):
458         (readableByteStreamControllerInvalidateBYOBRequest):
459         (readableByteStreamControllerCommitDescriptor):
460         (readableStreamFulfillReadIntoRequest):
461         (readableByteStreamControllerPullInto):
462         (readableStreamAddReadIntoRequest):
463         * Modules/streams/ReadableStream.js:
464         (initializeReadableStream):
465         (pipeThrough):
466         * Modules/streams/ReadableStreamBYOBReader.js:
467         (cancel):
468         (read):
469         (releaseLock):
470         (getter.closed):
471         * Modules/streams/ReadableStreamBYOBRequest.js:
472         (respond):
473         (respondWithNewView):
474         (getter.view):
475         * Modules/streams/ReadableStreamDefaultController.js:
476         (error):
477         * Modules/streams/ReadableStreamDefaultReader.js:
478         (cancel):
479         (read):
480         (releaseLock):
481         (getter.closed):
482         * Modules/streams/ReadableStreamInternals.js:
483         (privateInitializeReadableStreamDefaultReader):
484         (readableStreamReaderGenericInitialize):
485         (readableStreamDefaultControllerError):
486         (readableStreamPipeTo):
487         (readableStreamTee):
488         (isReadableStream):
489         (isReadableStreamDefaultReader):
490         (isReadableStreamDefaultController):
491         (readableStreamError):
492         (readableStreamDefaultControllerCallPullIfNeeded):
493         (readableStreamDefaultControllerGetDesiredSize):
494         (readableStreamReaderGenericCancel):
495         (readableStreamCancel):
496         (readableStreamDefaultControllerCancel):
497         (readableStreamDefaultControllerPull):
498         (readableStreamDefaultControllerClose):
499         (readableStreamClose):
500         (readableStreamFulfillReadRequest):
501         (readableStreamDefaultReaderRead):
502         (readableStreamAddReadRequest):
503         (isReadableStreamDisturbed):
504         (readableStreamReaderGenericRelease):
505         (readableStreamDefaultControllerCanCloseOrEnqueue):
506         (privateInitializeReadableStreamDefaultController): Deleted.
507         * Modules/streams/StreamInternals.js:
508         (validateAndNormalizeQueuingStrategy):
509         * Modules/streams/WritableStream.js:
510         (initializeWritableStream):
511         (abort):
512         (close):
513         (write):
514         (getter.closed):
515         (getter.ready):
516         (getter.state):
517         * Modules/streams/WritableStreamInternals.js:
518         (isWritableStream):
519         (syncWritableStreamStateWithQueue):
520         (errorWritableStream):
521         (callOrScheduleWritableStreamAdvanceQueue):
522         * bindings/js/JSDOMBindingInternals.js:
523         (mapLikeForEach):
524
525 2018-04-12  Antoine Quint  <graouts@apple.com>
526
527         [Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
528         https://bugs.webkit.org/show_bug.cgi?id=184569
529         <rdar://problem/38671301>
530
531         Reviewed by Jon Lee.
532
533         We now set the CSS Animations and CSS Transitions as Web Animations flag on by default. To ensure that some remaining
534         tests pass with this flag on, we expose a way to get to a PseudoElement via a new internals.pseudoElement() method. This
535         allows tests that used internals.pauseAnimationAtTimeOnPseudoElement() and internals.pauseTransitionAtTimeOnPseudoElement()
536         to now work with the Web Animations API.
537
538         * page/RuntimeEnabledFeatures.h:
539         * testing/Internals.cpp:
540         (WebCore::Internals::pseudoElement):
541         * testing/Internals.h:
542         * testing/Internals.idl:
543
544 2018-04-13  Sergio Villar Senin  <svillar@igalia.com>
545
546         [WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
547         https://bugs.webkit.org/show_bug.cgi?id=184530
548
549         Reviewed by Žan Doberšek.
550
551         WebVR apps should invoke requestPresent() to start presenting contents of a VRLayerInit
552         (right now a HTML canvas with a WebGL context) on the VRDisplay. This request might fail for
553         a variety of reasons and can be eventually cancelled with exitPresent(). Once we are
554         presenting we could access the presenting layers (right now just one) with getLayers().
555
556         Note that we are not presenting anything to the HMD yet, that will be done later in a follow
557         up patch.
558
559         I took the chance to correct a mistak in the VRDisplayCapabilities object which has a method
560         that should be called maxLayers instead of maxLayer.
561
562         * Modules/webvr/VRDisplay.cpp:
563         (WebCore::VRDisplay::requestPresent):
564         (WebCore::VRDisplay::stopPresenting):
565         (WebCore::VRDisplay::exitPresent):
566         (WebCore::VRDisplay::getLayers const):
567         (WebCore::VRDisplay::isPresenting const): Deleted. Implemented in the header file.
568         * Modules/webvr/VRDisplay.h:
569         (WebCore::VRDisplay::isPresenting const):
570         * Modules/webvr/VRDisplayCapabilities.h:
571         (WebCore::VRDisplayCapabilities::maxLayers const): Renamed from maxLayer().
572         (WebCore::VRDisplayCapabilities::maxLayer const): Deleted.
573         * Modules/webvr/VRDisplayCapabilities.idl:
574
575 2018-04-13  Miguel Gomez  <magomez@igalia.com>
576
577         REGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non AC mode
578         https://bugs.webkit.org/show_bug.cgi?id=184583
579
580         Reviewed by Carlos Garcia Campos.
581
582         In non AC mode, ensure that a deadlock can't happen when destroying MediaPlayerPrivateGStreamerBase.
583
584         Covered by existent tests.
585
586         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
587         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
588         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
589         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
590         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
591
592 2018-04-13  Miguel Gomez  <magomez@igalia.com>
593
594         [GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
595         https://bugs.webkit.org/show_bug.cgi?id=183362
596
597         Reviewed by Carlos Garcia Campos.
598
599         Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed.
600         That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which
601         can be used to handle the pause event without avoiding future renderings. Also cancelRepaint()
602         has only effect when not in AC mode.
603
604         Covered by existent tests.
605
606         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
607         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
608         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
609         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
610         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
611
612 2018-04-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
613
614         [GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
615         https://bugs.webkit.org/show_bug.cgi?id=184533
616
617         Reviewed by Philippe Normand.
618
619         Renamed GStreamerUtilities* files into GStreamerCommon* and
620         modified files including them accordingly. Include
621         GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
622         to avoid problems destroying objects when those files are
623         forgotten to be included.
624
625         * Modules/webaudio/AudioContext.cpp:
626         * platform/GStreamer.cmake:
627         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
628         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
629         * platform/graphics/gstreamer/GStreamerCommon.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp.
630         * platform/graphics/gstreamer/GStreamerCommon.h: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h.
631         * platform/graphics/gstreamer/ImageGStreamer.h:
632         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
633         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
634         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
635         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
636         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
637         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
638         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
639         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
640         * platform/graphics/gstreamer/MediaSampleGStreamer.h:
641         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
642         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
643         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
644         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
645         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
646         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
647         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
648         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
649         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
650         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
651         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
652         * platform/graphics/gstreamer/mse/AppendPipeline.h:
653         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
654         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h:
655         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
656         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
657         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
658         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
659         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
660         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
661         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
662
663 2018-04-12  Christopher Reid  <chris.reid@sony.com>
664
665         [Curl] Fix clang build error in CurlContext.cpp
666         https://bugs.webkit.org/show_bug.cgi?id=184561
667
668         Reviewed by Darin Adler.
669
670         MSVC allows explicit template specialization in classes but gcc/clang do not.
671
672         * platform/network/curl/CurlContext.cpp:
673
674 2018-04-12  Christopher Reid  <chris.reid@sony.com>
675
676         [Curl] Cookie Database on memory path should be :memory:
677         https://bugs.webkit.org/show_bug.cgi?id=184572
678
679         Reviewed by Alex Christensen.
680
681         CookieJarDB::isOnMemory is comparing the database path with :onmemory: but it should be using :memory:
682         For reference, see: https://www.sqlite.org/inmemorydb.html
683
684         * platform/network/curl/CookieJarDB.h:
685
686 2018-04-12  Daniel Bates  <dabates@apple.com>
687
688         Attmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
689         (https://bugs.webkit.org/show_bug.cgi?id=184386)
690
691         Visual Studio cannot prove that all cases in the switch are covered :(
692         So, add an ASSERT_NOT_REACHED() and a return a value outside of the switch block. 
693
694         * loader/cache/CachedResourceLoader.cpp:
695         (WebCore::destinationForType):
696
697 2018-04-12  Chris Dumez  <cdumez@apple.com>
698
699         Introduce remote variants of Frame / DOMWindow classes
700         https://bugs.webkit.org/show_bug.cgi?id=184467
701         <rdar://problem/39011267>
702
703         Reviewed by Ryosuke Niwa.
704
705         Introduce remote variants of Frame / DOMWindow classes, for when these frames / windows
706         are hosted on another WebProcess. Those will be used in a follow-up patch.
707
708         The hierarchy is as follows (class naming will be improved in a follow-up patch to minimise
709         patch size):
710         - AbstractFrame: A frame that can be either local or remote (hosted on another WebProcess)
711             - Frame: A local frame
712             - RemoteFrame: A frame hosted on another WebProcess. A RemoteFrame's window is also remote.
713         - AbstractDOMWindow: A window that be either local or remote (hosted on another WebProcess)
714             - DOMWindow: A local DOMWindow
715             - RemoteDOMWindow: A window hosted on another WebProcess. A RemoteDOMWindow's frame is also
716               remote. A RemoteDOMWindow is always cross-origin.
717
718         This patch introduces global identifiers (unique across all WebProcesses) for both Frames and
719         Windows. This is useful as we need to know which Frame / DOMWindow a particular RemoteFrame /
720         RemoteDOMWindow is pointing to.
721
722         Follow-up patch will add support for converting a local DOMWindow / Frame into a remote ones,
723         when a newly opened window (via window.open) is navigated cross-origin (Bug 184515).
724
725         Other things we'll need to implement in follow-ups:
726         - RemoteDOMWindow will need to know about its opener in order to support the window.opener
727           API. Internally, the opener will be stored as a RemoteFrame so that window.opener always
728           returns the current window in the opener frame (which changes upon navigation).
729         - Nullify a RemoteDOMWindow's frame whenever the window it is pointing to becomes frameless.
730           A frameless window behaves very differently (e.g. very little API is exposed to the Web).
731           This happens when either the newly opened window is either closed or navigated.
732
733         * Sources.txt:
734         * WebCore.xcodeproj/project.pbxproj:
735         * loader/ContentFilter.cpp:
736         (WebCore::ContentFilter::didDecide):
737         * page/AbstractDOMWindow.cpp: Added.
738         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
739         (WebCore::AbstractDOMWindow::~AbstractDOMWindow):
740         * page/AbstractDOMWindow.h: Added.
741         (WebCore::AbstractDOMWindow::identifier const):
742         * page/AbstractFrame.cpp: Added.
743         (WebCore::AbstractFrame::AbstractFrame):
744         (WebCore::AbstractFrame::~AbstractFrame):
745         * page/AbstractFrame.h: Added.
746         (WebCore::AbstractFrame::window const):
747         * page/DOMWindow.cpp:
748         (WebCore::DOMWindow::DOMWindow):
749         * page/DOMWindow.h:
750         (isType):
751         * page/Frame.cpp:
752         (WebCore::Frame::window const):
753         (WebCore::Frame::virtualWindow const):
754         * page/Frame.h:
755         (isType):
756         * page/GlobalFrameIdentifier.h: Added.
757         (WebCore::GlobalFrameIdentifier::encode const):
758         (WebCore::GlobalFrameIdentifier::decode):
759         * page/GlobalWindowIdentifier.h: Added.
760         (WebCore::operator==):
761         (WebCore::GlobalWindowIdentifier::hash const):
762         (WebCore::GlobalWindowIdentifier::encode const):
763         (WebCore::GlobalWindowIdentifier::decode):
764         (WTF::GlobalWindowIdentifierHash::hash):
765         (WTF::GlobalWindowIdentifierHash::equal):
766         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::emptyValue):
767         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::constructDeletedValue):
768         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::isDeletedValue):
769
770         * page/RemoteDOMWindow.cpp: Added.
771         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
772         (WebCore::RemoteDOMWindow::~RemoteDOMWindow):
773         (WebCore::RemoteDOMWindow::self const):
774         (WebCore::RemoteDOMWindow::location const):
775         (WebCore::RemoteDOMWindow::close):
776         (WebCore::RemoteDOMWindow::closed const):
777         (WebCore::RemoteDOMWindow::focus):
778         (WebCore::RemoteDOMWindow::blur):
779         (WebCore::RemoteDOMWindow::length const):
780         (WebCore::RemoteDOMWindow::top const):
781         (WebCore::RemoteDOMWindow::opener const):
782         (WebCore::RemoteDOMWindow::parent const):
783         (WebCore::RemoteDOMWindow::postMessage):
784         The DOM API exposed on RemoteDOMWindow is only the subset of the DOMWindow API that is exposed cross origin,
785         since remote DOMWindow are always from a different origin. The short-term plan is to implement these in a
786         follow-up by relying on IPC (synchronous when necessary) to fetch the information from the real window in
787         the WebProcess where it lives. Longer term, we should probably keep RemoteDOMWindow members in sync with the
788         DOMWindow they're pointing to, so we do not have to rely on synchronous IPC.
789
790         * page/RemoteDOMWindow.h: Added.
791         (isType):
792         * page/RemoteFrame.cpp: Added.
793         (WebCore::RemoteFrame::RemoteFrame):
794         (WebCore::RemoteFrame::~RemoteFrame):
795         (WebCore::RemoteFrame::virtualWindow const):
796         * page/RemoteFrame.h: Added.
797         (isType):
798
799 2018-04-12  Daniel Bates  <dabates@apple.com>
800
801         Content-Type not enforced for <script> allows for XSS
802         https://bugs.webkit.org/show_bug.cgi?id=184386
803         <rdar://problem/39112268>
804
805         Reviewed by Brady Eidson.
806
807         As per the Fetch standard, <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?> (16 March 2018),
808         we should block JavaScript scripts that are served with MIME type text/csv, or a MIME type
809         that begins with "audio/", "image/" or "video/".
810
811         As a side benefit of this change we now set the destination property [1] on preload requests.
812
813         [1] <https://fetch.spec.whatwg.org/#concept-request-destination>
814
815         Tests: http/tests/security/script-with-banned-mimetype.html
816                http/tests/workers/worker-importScripts-banned-mimetype.html
817
818         * Sources.txt: Add file FetchIdioms.cpp.
819         * WebCore.xcodeproj/project.pbxproj: Add files FetchIdioms.{cpp, h}.
820         * dom/LoadableClassicScript.cpp:
821         (WebCore::LoadableClassicScript::notifyFinished): Check the MIME type of the response and
822         block the script if applicable.
823         * dom/LoadableScript.h: Add error type MIMEType.
824         * loader/FetchIdioms.cpp: Added.
825         (WebCore::shouldBlockResponseDueToMIMEType): Implements the "Should response to request be blocked
826         due to its MIME type?" algorithm from the Fetch standard.
827         * loader/FetchIdioms.h: Added.
828         * loader/FetchOptions.h:
829         (WebCore::isScriptLikeDestination): Implements the definition of "script like" as per <https://fetch.spec.whatwg.org/#request-destination-script-like>.
830         * loader/cache/CachedResourceLoader.cpp:
831         (WebCore::CachedResourceLoader::requestImage): Removed logic to set the destination property as
832         CachedResourceLoader::requestResource() is now responsible for doing this.
833         (WebCore::CachedResourceLoader::requestFont): Ditto.
834         (WebCore::CachedResourceLoader::requestTextTrack): Ditto.
835         (WebCore::CachedResourceLoader::requestCSSStyleSheet): Ditto.
836         (WebCore::CachedResourceLoader::requestScript): Ditto.
837         (WebCore::CachedResourceLoader::requestXSLStyleSheet): Ditto.
838         (WebCore::CachedResourceLoader::requestMedia): Update comment to express that we should assert
839         that the destination property is either video or audio.
840         (WebCore::CachedResourceLoader::requestIcon): Remove logic to set the destination property as
841         CachedResourceLoader::requestResource() is now responsible for doing this.
842         (WebCore::CachedResourceLoader::requestRawResource): Removed assertion as this function is used to
843         load many kinds of requests that have different destination properties. The caller is responsible
844         for setting the appropriate destintion property.
845         (WebCore::CachedResourceLoader::requestMainResource): Remove logic to set the destination property
846         as CachedResourceLoader::requestResource() is now responsible for doing this.
847         (WebCore::destinationForType): Helper function that maps CachedResource::Type to FetchOptions::Destination.
848         (WebCore::CachedResourceLoader::requestResource): Set the destination property on the request if not
849         already set.
850         * loader/cache/CachedResourceLoader.h: Segregate requestRawResource() from the other request functions
851         and add a comment to explain what it is used for.
852         * workers/Worker.cpp:
853         (WebCore::Worker::create):
854         * workers/WorkerScriptLoader.cpp:
855         (WebCore::WorkerScriptLoader::loadSynchronously): Set the destination property to FetchOptions::Destination::Script
856         and store it in an instance variable as we will need to reference it once we receive the HTTP response.
857         Note that this function is only used to support the Web API importScripts().
858         (WebCore::WorkerScriptLoader::loadAsynchronously): Store the passed destination property in an
859         instance as we will need to reference it once we receive the HTTP response.
860         (WebCore::WorkerScriptLoader::didReceiveResponse): Check the MIME type of the response and
861         block the script if applicable.
862         * workers/WorkerScriptLoader.h:
863         * workers/service/ServiceWorkerJob.cpp:
864         (WebCore::ServiceWorkerJob::fetchScriptWithContext): Set the destination property to FetchOptions::Destination::Serviceworker.
865
866 2018-04-12  Antoine Quint  <graouts@apple.com>
867
868         [Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
869         https://bugs.webkit.org/show_bug.cgi?id=184555
870
871         Reviewed by Dean Jackson.
872
873         A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
874         tests to fail when expressed as Web Animations.
875
876         * animation/AnimationTimeline.cpp:
877         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
878         since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
879         to create them.
880         (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
881         a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
882         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
883         once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
884         see if we need to cancel this transition. Previously, we used to only see if it had been transitioned in the old style. We also
885         start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
886         for this property already running, use that animation's original unanimated style as the from value.
887         * animation/AnimationTimeline.h:
888         * animation/CSSAnimation.cpp:
889         (WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
890         (WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
891         get it when a CSS Transition is created and takes precedence over this CSS Animation.
892         (WebCore::CSSAnimation::initialize): Deleted.
893         * animation/CSSAnimation.h:
894         * animation/CSSTransition.cpp:
895         (WebCore::CSSTransition::create):
896         (WebCore::CSSTransition::initialize):
897         * animation/CSSTransition.h:
898         * animation/DeclarativeAnimation.cpp:
899         (WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
900         directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
901         before timing properties are set based on the backing animation.
902         * animation/DeclarativeAnimation.h:
903         * animation/KeyframeEffectReadOnly.cpp:
904         (WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
905         (WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
906         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
907         instead of a default RenderStyle which would not use the right values for implicit keyframes.
908         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
909         the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
910         "transition: all".
911         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
912         last keyframes to always have the property listed since the underlying style was provided and should be captured.
913         * animation/KeyframeEffectReadOnly.h:
914         * style/StyleTreeResolver.cpp:
915         (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.
916
917 2018-04-12  Antoine Quint  <graouts@apple.com>
918
919         [Web Animations] Only cancel declarative animations upon element removal
920         https://bugs.webkit.org/show_bug.cgi?id=184553
921
922         Reviewed by Dean Jackson.
923
924         Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
925         the ready promise and produce spurious logging from WPT tests.
926
927         * animation/AnimationTimeline.cpp:
928         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
929         (WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
930         * animation/AnimationTimeline.h:
931         * dom/Element.cpp:
932         (WebCore::Element::removedFromAncestor):
933         * dom/PseudoElement.cpp:
934         (WebCore::PseudoElement::clearHostElement):
935         * rendering/updating/RenderTreeUpdater.cpp:
936         (WebCore::RenderTreeUpdater::tearDownRenderers):
937
938 2018-04-12  Ryan Haddad  <ryanhaddad@apple.com>
939
940         Unreviewed, rolling out r230554.
941
942         The non-ASCII character in the filename causes issues with SVN
943
944         Reverted changeset:
945
946         "input.webkitEntries does not work as expected when folder
947         contains accented chars"
948         https://bugs.webkit.org/show_bug.cgi?id=184517
949         https://trac.webkit.org/changeset/230554
950
951 2018-04-12  Alicia Boya García  <aboya@igalia.com>
952
953         [MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
954         https://bugs.webkit.org/show_bug.cgi?id=180253
955
956         Right now it's checked that start <= end but it's not checked that
957         neither of them is undefined.
958
959         When this happens, the bug can be hard to track down.
960
961         The assertion is not enabled for Mac because there is currently a test
962         that is hitting it.
963
964         Reviewed by Jer Noble.
965
966         * platform/graphics/PlatformTimeRanges.cpp:
967         (WebCore::PlatformTimeRanges::add):
968
969 2018-04-12  Chris Dumez  <cdumez@apple.com>
970
971         Process::setIdentifier() / Process::identifier() do not need a lock
972         https://bugs.webkit.org/show_bug.cgi?id=184544
973
974         Reviewed by Brady Eidson.
975
976         Process::setIdentifier() / Process::identifier() do not need a lock.
977         Process::setIdentifier() gets called in ChildProcess::initialize(),
978         before we start any background threads. It is then safe to query
979         this process identifier later on from background threads without
980         locks.
981
982         * platform/Process.cpp:
983         (WebCore::Process::setIdentifier):
984         (WebCore::Process::identifier):
985
986 2018-04-12  Antoine Quint  <graouts@apple.com>
987
988         Unreviewed, fix the Windows build.
989
990         * animation/DocumentTimeline.cpp:
991         (WebCore::DocumentTimeline::computeExtentOfAnimation const):
992
993 2018-04-12  Antoine Quint  <graouts@apple.com>
994
995         [Web Animations] Suspend animations when required
996         https://bugs.webkit.org/show_bug.cgi?id=184541
997
998         Reviewed by Jon Lee.
999
1000         Animations managed by CSSAnimationController get suspended under a number of scenarios, we now add the possibility
1001         to suspend animations on a DocumentTimeline as well such that Web Animations and CSS Animations and CSS Transitions
1002         implemented as Web Animations get suspended under the same conditions as well. We also update the implementation for
1003         Internals::numberOfActiveAnimations() such that tests checking that animations get suspended pass.
1004
1005         * animation/DocumentTimeline.cpp:
1006         (WebCore::DocumentTimeline::suspendAnimations): When asked to be suspended, the DocumentTimeline cancels pending
1007         invalidation tasks and updates all of the animations it manages, including those running on the compositor.
1008         (WebCore::DocumentTimeline::resumeAnimations): When asked to be resumed, the DocumentTimeline resumes animations
1009         it manages and rewinds its invalidation timer.
1010         (WebCore::DocumentTimeline::animationsAreSuspended):
1011         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): Called by Internals::numberOfActiveAnimations(),
1012         this returns the number of animations managed by this timeline that are not suspended.
1013         (WebCore::DocumentTimeline::currentTime):
1014         (WebCore::DocumentTimeline::timingModelDidChange): Ensure the invalidation timer is not rewound if the timeline
1015         is suspended.
1016         * animation/DocumentTimeline.h:
1017         * animation/WebAnimation.cpp:
1018         (WebCore::WebAnimation::setTimeline): When moving to a new timeline, ensure we match the new timeline's animation state.
1019         (WebCore::WebAnimation::setSuspended): Toggle the accelerated running state of any backing hardware animations when
1020         the suspension state of an animation changes.
1021         * animation/WebAnimation.h:
1022         (WebCore::WebAnimation::isSuspended const):
1023         * dom/Document.cpp:
1024         (WebCore::Document::didBecomeCurrentDocumentInFrame):
1025         (WebCore::Document::resume):
1026         * dom/Document.h:
1027         * history/CachedFrame.cpp:
1028         (WebCore::CachedFrameBase::restore):
1029         * page/Frame.cpp:
1030         (WebCore::Frame::clearTimers):
1031         * page/Page.cpp:
1032         (WebCore::Page::setIsVisibleInternal):
1033         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
1034         * testing/Internals.cpp:
1035         (WebCore::Internals::numberOfActiveAnimations const):
1036         (WebCore::Internals::animationsAreSuspended const):
1037         (WebCore::Internals::suspendAnimations const):
1038         (WebCore::Internals::resumeAnimations const):
1039
1040 2018-04-12  Antoine Quint  <graouts@apple.com>
1041
1042         [Web Animations] Throttle animations when lowPowerMode is on
1043         https://bugs.webkit.org/show_bug.cgi?id=184540
1044
1045         Reviewed by Jon Lee.
1046
1047         Ensure animations are sampled at a lower frequency when lowPowerMode is on.
1048
1049         * animation/DocumentTimeline.cpp:
1050         (WebCore::DocumentTimeline::updateThrottlingState):
1051         (WebCore::DocumentTimeline::animationInterval const):
1052         (WebCore::DocumentTimeline::updateAnimationSchedule):
1053         (WebCore::DocumentTimeline::scheduleAnimationResolution):
1054         * animation/DocumentTimeline.h:
1055         * page/Page.cpp:
1056         (WebCore::Page::handleLowModePowerChange):
1057         * testing/Internals.cpp:
1058         (WebCore::Internals::animationsInterval const):
1059
1060 2018-04-12  Antoine Quint  <graouts@apple.com>
1061
1062         [Web Animations] Ensure elements overlapping with elements animating also get composited
1063         https://bugs.webkit.org/show_bug.cgi?id=184539
1064
1065         Reviewed by Jon Lee.
1066
1067         A number of compositing tests failed because we didn't call into the Web Animations engine while various calls
1068         on RenderLayer and RenderLayerBacking were made. We bring the functionality over from CSSAnimationController to
1069         DocumentTimeline and KeyframeAnimation to KeyframeEffectReadOnly.
1070
1071         * animation/AnimationTimeline.cpp:
1072         (WebCore::AnimationTimeline::animationsForElement const): Update this method's signature to be const since it
1073         should be callable by other const method.
1074         (WebCore::AnimationTimeline::animationsForElement): Deleted.
1075         * animation/AnimationTimeline.h:
1076         * animation/DocumentTimeline.cpp:
1077         (WebCore::DocumentTimeline::computeExtentOfAnimation const): Adapt this method from CSSAnimationController.
1078         (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): Adapt this method from CSSAnimationController.
1079         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Adapt this method from CSSAnimationController.
1080         * animation/DocumentTimeline.h:
1081         * animation/KeyframeEffectReadOnly.cpp:
1082         (WebCore::KeyframeEffectReadOnly::computeExtentOfTransformAnimation const): Bring this method over from KeyframeAnimation.
1083         (WebCore::containsRotation): Bring this method over from KeyframeAnimation.
1084         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaTransformList const): Bring this method over from KeyframeAnimation.
1085         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaMatrix const): Bring this method over from KeyframeAnimation.
1086         * animation/KeyframeEffectReadOnly.h:
1087         (WebCore::KeyframeEffectReadOnly::animatedProperties const): DocumentTimeline::computeExtentOfAnimation() needs to get a list
1088         of all animated properties to see if a transform is animated, so we now expose such a list.
1089         * rendering/RenderLayer.cpp:
1090         (WebCore::RenderLayer::currentTransform const): Update this method to call into DocumentTimeline if the CSS Animations
1091         and CSS Transitions as Web Animations flag is on.
1092         (WebCore::RenderLayer::calculateClipRects const): Update this method to call into DocumentTimeline if the CSS Animations
1093         and CSS Transitions as Web Animations flag is on.
1094         * rendering/RenderLayerBacking.cpp:
1095         (WebCore::RenderLayerBacking::updateGeometry): Update this method to call into DocumentTimeline if the CSS Animations
1096         and CSS Transitions as Web Animations flag is on.
1097         * rendering/RenderLayerCompositor.cpp:
1098         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Update this method to call into DocumentTimeline
1099         if the CSS Animations and CSS Transitions as Web Animations flag is on.
1100         * rendering/RenderObject.h:
1101         (WebCore::RenderObject::documentTimeline const):
1102
1103 2018-04-11  Antoine Quint  <graouts@apple.com>
1104
1105         [Web Animations] Enable seeking for hardware animations
1106         https://bugs.webkit.org/show_bug.cgi?id=184518
1107
1108         Reviewed by Dean Jackson.
1109
1110         Hardware animations had lagged behind software animations in support and this patch bring their respective level
1111         of support closer to one another. Importantly, we add the ability to seek an animation added to a GraphicsLayerCA
1112         since many tests pause and seek animations to test their state. Animations may also have their playback state changed
1113         along with their current time in the same run loop, so we now maintain a list of pending processing actions for
1114         hardware animations.
1115
1116         * animation/DocumentTimeline.cpp:
1117         (WebCore::DocumentTimeline::updateAnimationSchedule): If we have animations queued up for updates to their accelerated
1118         state we can schedule animation resolution immediately since we've already established we'll have work to do.
1119         (WebCore::DocumentTimeline::updateAnimations): Factor the updates of pending accelerated animations out in a dedicated
1120         method.
1121         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): Go through all pending accelerated animations and update
1122         their state.
1123         * animation/KeyframeEffectReadOnly.cpp:
1124         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes): Update the m_shouldRunAccelerated flag when setting blending keyframes.
1125         (WebCore::KeyframeEffectReadOnly::apply): Ensure we finish accelerated animations if the progress is 1 or null (no longer active).
1126         start accelerated animations if the animation is starting and always resolve styles in software as well to ensure that
1127         hit testing will work as expected.
1128         (WebCore::KeyframeEffectReadOnly::computeShouldRunAccelerated):
1129         (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Called by WebAnimation when play() or pause() is called
1130         with the appropriate flag.
1131         (WebCore::KeyframeEffectReadOnly::animationDidSeek): Called by WebAnimation when the currentTime property is set.
1132         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Add the provided action to the list of pending accelerated
1133         actions and notify the animation that the accelerated state needs changing.
1134         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Called by DocumentTimeline, through WebAnimation, to apply
1135         all pending accelerated actions.
1136         (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const): If we're dealing with a declarative animation,
1137         we already have a backing Animation object, so use it directly. Otherwise, create one and ensure it reflects all timing properties
1138         for the animation.
1139         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): Deleted.
1140         (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): Deleted.
1141         * animation/WebAnimation.cpp:
1142         (WebCore::WebAnimation::setCurrentTime): Call animationDidSeek() on the effect to ensure its accelerated animation gets seeked.
1143         (WebCore::WebAnimation::play): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation is started or resumed.
1144         (WebCore::WebAnimation::pause): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation gets paused.
1145         (WebCore::WebAnimation::acceleratedStateDidChange): 
1146         (WebCore::WebAnimation::applyPendingAcceleratedActions):
1147         (WebCore::WebAnimation::acceleratedRunningStateDidChange): Deleted.
1148         (WebCore::WebAnimation::startOrStopAccelerated): Deleted.
1149         * platform/graphics/GraphicsLayer.h:
1150         (WebCore::GraphicsLayer::seekAnimation):
1151         * platform/graphics/ca/GraphicsLayerCA.cpp:
1152         (WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Add an AnimationProcessingAction to the list of such actions for a
1153         given animation name. In case we already have a Remove action, we ignore the action since the hardware animation will have been
1154         removed by the time we try to apply this processing action.
1155         (WebCore::GraphicsLayerCA::pauseAnimation): Add a Pause processing action.
1156         (WebCore::GraphicsLayerCA::seekAnimation): Add a Seek processing action.
1157         (WebCore::GraphicsLayerCA::removeAnimation): Add a Remove processing action.
1158         (WebCore::GraphicsLayerCA::updateAnimations): First ensure that all animations pending commit are committed and then update
1159         all animations based on the actions added through addProcessingActionForAnimation().
1160         (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Generate a new animation based on the new seek time provided.
1161         * platform/graphics/ca/GraphicsLayerCA.h:
1162         (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
1163         * rendering/RenderBoxModelObject.cpp:
1164         (WebCore::RenderBoxModelObject::animationSeeked):
1165         * rendering/RenderLayerBacking.cpp:
1166         (WebCore::RenderLayerBacking::animationSeeked):
1167         * rendering/RenderLayerCompositor.cpp:
1168         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Fix an issue where we would run the CSSAnimationController
1169         logic even when the legacy animation engine was disabled.
1170
1171 2018-04-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1172
1173         Unreviewed, fix GStreamer builds
1174
1175         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1176         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): We were
1177         passing a String to a GST_WARNING call.
1178
1179 2018-04-11  Chris Dumez  <cdumez@apple.com>
1180
1181         input.webkitEntries does not work as expected when folder contains accented chars
1182         https://bugs.webkit.org/show_bug.cgi?id=184517
1183         <rdar://problem/39265537>
1184
1185         Reviewed by Ryosuke Niwa.
1186
1187         Use String::fromUTF8() to construct a WTF String from the char* returned by
1188         dirname() in FileSystem::directoryName(). Previously, we were just calling
1189         the String constructor, which would treat the input as latin 1 instead of
1190         UTF-8.
1191
1192         Test: fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html
1193
1194         * platform/posix/FileSystemPOSIX.cpp:
1195         (WebCore::FileSystem::directoryName):
1196
1197 2018-04-11  Youenn Fablet  <youenn@apple.com>
1198
1199         Preventively expect UTF8 strings from libwebrtc SDP and error messages
1200         https://bugs.webkit.org/show_bug.cgi?id=184509
1201
1202         Reviewed by Eric Carlson.
1203
1204         Make WebCore code expect any libwebrtc string to contain UTF-8.
1205         Currently SDPs do not contain any UTF-8 specific character
1206         but https://tools.ietf.org/html/rfc4566 allows it.
1207
1208         Add Internals API to set track id so that we can inject UTF-8 inside some WebRTC tests.
1209         Test: webrtc/utf8-sdp.html
1210
1211         * Modules/mediastream/MediaStreamTrack.h:
1212         (WebCore::MediaStreamTrack::setIdForTesting):
1213         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1214         (WebCore::fromStdString):
1215         (WebCore::fromSessionDescription):
1216         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
1217         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1218         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
1219         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
1220         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1221         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
1222         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1223         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
1224         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
1225         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
1226         (WebCore::trackId): Deleted.
1227         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1228         (WebCore::fromStdString):
1229         (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
1230         (WebCore::createReceiverForSource):
1231         * platform/mediastream/MediaStreamTrackPrivate.h:
1232         (WebCore::MediaStreamTrackPrivate::setIdForTesting):
1233         * testing/Internals.cpp:
1234         (WebCore::Internals::setMediaStreamTrackIdentifier):
1235         * testing/Internals.h:
1236         * testing/Internals.idl:
1237
1238 2018-04-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1239
1240         Cache glyphs (using display lists) when painting at high frequency
1241         https://bugs.webkit.org/show_bug.cgi?id=178750
1242         <rdar://problem/35201729>
1243
1244         Reviewed by Antti Koivisto.
1245
1246         This patch adds support for caching of glyph drawing commands when painting
1247         at high frequency. Caching the glyph drawing will be done using DisplayLists.
1248
1249         GlyphDisplayListCache is basically a hash map which maps InlineTextBox
1250         or SimpleLineLayout::Run to DisplayList. Before adding a new entry to it
1251         we have to check whether the conditions for caching the glyph DisplayList
1252         are met or not. If no entry is found for a given run, a new DisplayList
1253         is created and a new entry is add to the cache.
1254
1255         * WebCore.xcodeproj/project.pbxproj:
1256         * page/MemoryRelease.cpp:
1257         (WebCore::releaseNoncriticalMemory): Make GlyphDisplayListCache respond
1258         to memory pressure.
1259
1260         * platform/graphics/FontCascade.cpp:
1261         (WebCore::FontCascade::displayListForTextRun const):
1262         * platform/graphics/FontCascade.h:
1263         (WebCore::FontCascade::displayListForTextRun):
1264         Record the drawing of a glyph run into a DisplayList.
1265
1266         * rendering/GlyphDisplayListCache.h: Added.
1267         (WebCore::GlyphDisplayListCache::singleton):
1268         (WebCore::GlyphDisplayListCache::get):
1269         (WebCore::GlyphDisplayListCache::remove):
1270         (WebCore::GlyphDisplayListCache::clear):
1271         (WebCore::GlyphDisplayListCache::size const):
1272         (WebCore::GlyphDisplayListCache::sizeInBytes const):
1273         A simple cache for the TextRun DisplayList. Adding a new entry in the
1274         cache happens under restricted conditions. So this cache is not expected
1275         to grow much.
1276
1277         * rendering/InlineTextBox.cpp:
1278         (WebCore::InlineTextBox::~InlineTextBox):
1279         (WebCore::InlineTextBox::paint):
1280         (WebCore::InlineTextBox::paintMarkedTexts):
1281         (WebCore::InlineTextBox::paintMarkedTextBackground):
1282         (WebCore::InlineTextBox::paintMarkedTextForeground):
1283         (WebCore::InlineTextBox::paintMarkedTextDecoration):
1284         (WebCore::InlineTextBox::paintCompositionBackground):
1285         (WebCore::InlineTextBox::paintCompositionUnderlines const):
1286         (WebCore::InlineTextBox::paintCompositionUnderline const):
1287         * rendering/InlineTextBox.h:
1288         (WebCore::InlineTextBox::paintMarkedTexts):
1289         InlineTextBox::paintMarkedTextForeground() now requires PaintInfo to know
1290         whether the entry in the GlyphDisplayListCache should be removed or not.
1291         Change all the GraphicsContext arguments to be PaintInfo.
1292
1293         * rendering/SimpleLineLayout.cpp:
1294         (WebCore::SimpleLineLayout::Layout::~Layout):
1295         * rendering/SimpleLineLayout.h:
1296         * rendering/SimpleLineLayoutFunctions.cpp:
1297         (WebCore::SimpleLineLayout::paintFlow):
1298         (WebCore::SimpleLineLayout::simpleLineLayoutWillBeDeleted):
1299         * rendering/SimpleLineLayoutFunctions.h:
1300         * rendering/SimpleLineLayoutResolver.h:
1301         (WebCore::SimpleLineLayout::RunResolver::Run::simpleRun const):
1302         Implement the glyph caching for SimpleLineLayout::Run.
1303
1304         * rendering/TextPainter.cpp:
1305         (WebCore::TextPainter::paintTextOrEmphasisMarks): If the DisplayList is
1306         available, replay it back into the GraphicsContext. Make sure to reset to
1307         the DisplayList pointer to nullptr after painting.
1308
1309         (WebCore::TextPainter::clearGlyphDisplayLists):
1310         (WebCore::TextPainter::shouldUseGlyphDisplayList): Check whether we should
1311         use DisplayList to the draw glyph run.
1312
1313         * rendering/TextPainter.h:
1314         (WebCore::TextPainter::setGlyphDisplayListIfNeeded): Check whether we should
1315         should use DisplayList to the draw glyph run and if we should, ensure first
1316         the DisplayList is cached and set it in the TextPainter so it uses it when
1317         the run is painted.
1318
1319         (WebCore::TextPainter::removeGlyphDisplayList): Remove the cached DisplayList
1320         entry for a glyph layout run.
1321
1322 2018-04-11  Brent Fulgham  <bfulgham@apple.com>
1323
1324         GraphicsLayerCA::createPlatformCALayer always disables extended color in its backing store
1325         https://bugs.webkit.org/show_bug.cgi?id=184367
1326         <rdar://problem/39249074>
1327
1328         Reviewed by Simon Fraser.
1329
1330         'createPlatformCALayer' always passes a nil widget, which early returns from 'screenSupportsExtendedColor'
1331         with false. Instead, we should just pass the widget (nil or not) to the screen properties methods,
1332         which will use the primary screen if no screen is specified. I.e., we shouldn't do an early return
1333         here if the passed widget is nil.
1334
1335         * platform/mac/PlatformScreenMac.mm:
1336         (WebCore::screenSupportsExtendedColor):
1337
1338 2018-04-11  Youenn Fablet  <youenn@apple.com>
1339
1340         Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
1341         https://bugs.webkit.org/show_bug.cgi?id=184374
1342
1343         Reviewed by Chris Dumez.
1344
1345         Add support for SecurityOrigin encode/decode routines.
1346
1347         * page/SecurityOrigin.h:
1348
1349 2018-04-11  Thibault Saunier  <tsaunier@igalia.com>
1350
1351         [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
1352         https://bugs.webkit.org/show_bug.cgi?id=184498
1353
1354         Reviewed by Philippe Normand.
1355
1356         [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
1357
1358         This is the same behaviour as with playbin itself.
1359
1360         Make sure to keep using "playbin" for MediaSource.
1361
1362         No test added as this is basically a small rework of the way we expose a feature.
1363
1364         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1365         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
1366         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1367         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1368         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1369         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
1370         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1371         (WebCore::MediaPlayerPrivateGStreamer::load):
1372         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
1373         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1374         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1375         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1376         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1377         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1378         (WebCore::TrackPrivateBaseGStreamer::disconnect):
1379         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1380         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1381         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1382         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
1383
1384 2018-04-10  Alex Christensen  <achristensen@webkit.org>
1385
1386         IDN spoofing with Hebrew combining characters
1387         https://bugs.webkit.org/show_bug.cgi?id=184472
1388         <rdar://problem/39148687>
1389
1390         Reviewed by Brent Fulgham.
1391
1392         Covered by new API tests.
1393
1394         * platform/mac/WebCoreNSURLExtras.mm:
1395         (WebCore::isLookalikeCharacter):
1396         Punycode-encode hosts with Hebrew combining marks that look like dots
1397         and Vav with a combining dot above like we do with dotless i and j.
1398
1399 2018-04-11  Brent Fulgham  <bfulgham@apple.com>
1400
1401         Show punycode if URL contains Latin dum character
1402         https://bugs.webkit.org/show_bug.cgi?id=184477
1403         <rdar://problem/39121999>
1404
1405         Reviewed by David Kilzer.
1406
1407         Revise our "lookalike character" logic to include the small
1408         Latin dum character.
1409
1410         Test: fast/url/host.html
1411
1412         * platform/mac/WebCoreNSURLExtras.mm:
1413         (WebCore::isLookalikeCharacter):
1414
1415 2018-04-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1416
1417         [GTK] WaylandCompositorDisplay leaks its wl_display
1418         https://bugs.webkit.org/show_bug.cgi?id=184406
1419
1420         Reviewed by Carlos Garcia Campos.
1421
1422         Well, this was harder than expected. We really just want to fix a small leak in the WebKit
1423         layer, but that requires a change in how WaylandCompositorDisplay calls the
1424         PlatformDisplayWayland constructor, to pass NativeDisplayOwned::Yes. That means
1425         WaylandCompositorDisplay can no longer use PlatformDisplayWayland's protected default
1426         constructor. Problem is that the normal PlatformDisplayWayland constructor calls
1427         PlatformDisplayWayland::initialize, which calls PlatformDisplayWayland::registryGlobal,
1428         which is a virtual function. The WaylandCompositorDisplay portion of the object is not
1429         constructed yet at this point, so WaylandCompositorDisplay::registryGlobal will never be
1430         called if we do that. I had to revert the previous version of this fix due to this problem.
1431         It had broken accelerated compositing.
1432
1433         I'm reminded of Effective C++ item #9: Never call virtual functions during construction or
1434         destruction ("because such calls will never go to a more derived class than that of the
1435         currently executing constructor or destructor"). This code is fragile and likely to break
1436         again in the future, so let's refactor it a bit. Instead of calling initialize in the
1437         constructor, we'll call it from create functions. We'll have to add a couple create
1438         functions, and make the constructor protected to ensure it's not possible to create a
1439         PlatformDisplayWayland without initializing it. For good parallelism, do the same for the
1440         other PlatformDisplay classes.
1441
1442         This commit additionally removes PlatformDisplayWayland's protected default constructor,
1443         since it's not needed anymore.
1444
1445         The NativeDisplayOwned arguments to the PlatformDisplay constructors are now mandatory,
1446         instead of using NativeDisplayOwned::No as the default value, since that was dangerously
1447         close to being the cause of this leak, and the constructors are now accessed from private
1448         create functions anyway. Some more caution when using default parameter values is warranted
1449         in the future.
1450
1451         Lastly, since we have to change PlatformDisplay::createPlatformDisplay to use the new create
1452         functions, take the opportunity to move things around a bit for clarity. There should be no
1453         change in behavior. I was just disappointed that the PlatformDisplayWPE creation was at the
1454         bottom of the function, after a comment indicating that normal display creation has failed,
1455         which is not the case for WPE.
1456
1457         This all might have been a bit overkill, since the leak could probably have been fixed by
1458         passing nullptr to the PlatformDisplayWayland constructor for the wl_display and not
1459         removing WaylandCompositorDisplay's call to PlatformDisplayWayland::initialize. But the
1460         correctness of that code would then rely on implementation details of initialize, so this
1461         refactor seems better.
1462
1463         No new tests since there *should* be no behavior change. Then again, I'm touching
1464         PlatformDisplay, and history shows we don't have the greatest track record of touching this
1465         code without introducing problems.
1466
1467         * platform/graphics/PlatformDisplay.cpp:
1468         (WebCore::PlatformDisplay::createPlatformDisplay):
1469         * platform/graphics/PlatformDisplay.h:
1470         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1471         (WebCore::PlatformDisplayWayland::create):
1472         (WebCore::PlatformDisplayWayland::create):
1473         (WebCore::PlatformDisplayWayland::createHeadless):
1474         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
1475         (WebCore::PlatformDisplayWayland::initialize):
1476         * platform/graphics/wayland/PlatformDisplayWayland.h:
1477         * platform/graphics/win/PlatformDisplayWin.h:
1478         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
1479         (WebCore::create):
1480         * platform/graphics/wpe/PlatformDisplayWPE.h:
1481         * platform/graphics/x11/PlatformDisplayX11.cpp:
1482         (WebCore::PlatformDisplayX11::create):
1483         (WebCore::PlatformDisplayX11::create):
1484         (WebCore::PlatformDisplayX11::createHeadless):
1485         * platform/graphics/x11/PlatformDisplayX11.h:
1486
1487 2018-04-11  Jianjun Zhu  <jianjun.zhu@intel.com>
1488
1489         Fix a WebRTC data channel issue for non-ASCII characters.
1490
1491         At the sender side, buffer size are calulcated after UTF8 encoding. At the
1492         receiver side, strings are constructed with UTF8 data.
1493
1494         https://bugs.webkit.org/show_bug.cgi?id=184481
1495
1496         Reviewed by Youenn Fablet.
1497
1498         Updated test:
1499         LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt
1500
1501         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1502         (WebCore::LibWebRTCDataChannelHandler::sendStringData):
1503         (WebCore::LibWebRTCDataChannelHandler::OnMessage):
1504
1505 2018-04-11  Antti Koivisto  <antti@apple.com>
1506
1507         ImageFrame type used by non-Cocoa image decoder should not be the same as that used by ImageSource
1508         https://bugs.webkit.org/show_bug.cgi?id=184418
1509
1510         Reviewed by Said Abou-Hallawa.
1511
1512         ScalableImageDecoder uses ImageFrame class which is meant to be an implementation detail of ImageSource.
1513         There are bunch of fields and methods in the type that are only used by one or the other client. For hackability
1514         there should be an unrelated frame type for ScalableImageDecoder.
1515
1516         This patch adds ScalableImageDecoderFrame type used in ScalableImageDecoder only. It then cleans up
1517         unneeded things from both ImageFrame and ScalableImageDecoderFrame.
1518
1519         * platform/ImageDecoders.cmake:
1520         * platform/graphics/ImageFrame.cpp:
1521         (WebCore::ImageFrame::operator=):
1522         (WebCore::ImageFrame::clearImage):
1523         (WebCore::ImageFrame::size const):
1524         (WebCore::ImageFrame::initialize): Deleted.
1525         * platform/graphics/ImageFrame.h:
1526         (WebCore::ImageFrame::setDisposalMethod): Deleted.
1527         (WebCore::ImageFrame::disposalMethod const): Deleted.
1528         (WebCore::ImageFrame::backingStore const): Deleted.
1529         (WebCore::ImageFrame::hasBackingStore const): Deleted.
1530         * platform/image-decoders/ScalableImageDecoder.cpp:
1531         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
1532         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
1533         (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
1534         * platform/image-decoders/ScalableImageDecoder.h:
1535         * platform/image-decoders/ScalableImageDecoderFrame.cpp: Copied from Source/WebCore/platform/graphics/ImageFrame.cpp.
1536         (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
1537         (WebCore::ScalableImageDecoderFrame::~ScalableImageDecoderFrame):
1538         (WebCore::ScalableImageDecoderFrame::operator=):
1539         (WebCore::ScalableImageDecoderFrame::setDecodingStatus):
1540         (WebCore::ScalableImageDecoderFrame::decodingStatus const):
1541         (WebCore::ScalableImageDecoderFrame::clearImage):
1542         (WebCore::ScalableImageDecoderFrame::clear):
1543         (WebCore::ScalableImageDecoderFrame::initialize):
1544         (WebCore::ScalableImageDecoderFrame::size const):
1545         (WebCore::ImageFrame::ImageFrame): Deleted.
1546         (WebCore::ImageFrame::~ImageFrame): Deleted.
1547         (WebCore::ImageFrame::defaultFrame): Deleted.
1548         (WebCore::ImageFrame::operator=): Deleted.
1549         (WebCore::ImageFrame::setDecodingStatus): Deleted.
1550         (WebCore::ImageFrame::decodingStatus const): Deleted.
1551         (WebCore::ImageFrame::clearImage): Deleted.
1552         (WebCore::ImageFrame::clear): Deleted.
1553         (WebCore::ImageFrame::initialize): Deleted.
1554         (WebCore::ImageFrame::size const): Deleted.
1555         (WebCore::ImageFrame::hasNativeImage const): Deleted.
1556         (WebCore::ImageFrame::hasFullSizeNativeImage const): Deleted.
1557         (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions const): Deleted.
1558         (WebCore::ImageFrame::singlePixelSolidColor const): Deleted.
1559         * platform/image-decoders/ScalableImageDecoderFrame.h: Copied from Source/WebCore/platform/graphics/ImageFrame.h.
1560         (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
1561         (WebCore::ScalableImageDecoderFrame::disposalMethod const):
1562         (WebCore::ScalableImageDecoderFrame::hasAlpha const):
1563         (WebCore::ScalableImageDecoderFrame::hasBackingStore const):
1564         (WebCore::ImageFrame::ImageFrame): Deleted.
1565         (WebCore::ImageFrame::isInvalid const): Deleted.
1566         (WebCore::ImageFrame::isPartial const): Deleted.
1567         (WebCore::ImageFrame::isComplete const): Deleted.
1568         (WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
1569         (WebCore::ImageFrame::frameBytes const): Deleted.
1570         (WebCore::ImageFrame::subsamplingLevel const): Deleted.
1571         (WebCore::ImageFrame::setDisposalMethod): Deleted.
1572         (WebCore::ImageFrame::disposalMethod const): Deleted.
1573         (WebCore::ImageFrame::nativeImage const): Deleted.
1574         (WebCore::ImageFrame::setOrientation): Deleted.
1575         (WebCore::ImageFrame::orientation const): Deleted.
1576         (WebCore::ImageFrame::setDuration): Deleted.
1577         (WebCore::ImageFrame::duration const): Deleted.
1578         (WebCore::ImageFrame::setHasAlpha): Deleted.
1579         (WebCore::ImageFrame::hasAlpha const): Deleted.
1580         (WebCore::ImageFrame::hasNativeImage): Deleted.
1581         (WebCore::ImageFrame::hasFullSizeNativeImage): Deleted.
1582         (WebCore::ImageFrame::hasMetadata const): Deleted.
1583         (WebCore::ImageFrame::backingStore const): Deleted.
1584         (WebCore::ImageFrame::hasBackingStore const): Deleted.
1585         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1586         (WebCore::BMPImageDecoder::frameBufferAtIndex):
1587         * platform/image-decoders/bmp/BMPImageDecoder.h:
1588         * platform/image-decoders/bmp/BMPImageReader.h:
1589         (WebCore::BMPImageReader::setBuffer):
1590         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1591         (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
1592         (WebCore::GIFImageDecoder::frameBufferAtIndex):
1593         (WebCore::GIFImageDecoder::clearFrameBufferCache):
1594         (WebCore::GIFImageDecoder::haveDecodedRow):
1595         (WebCore::GIFImageDecoder::frameComplete):
1596         (WebCore::GIFImageDecoder::initFrameBuffer):
1597         * platform/image-decoders/gif/GIFImageDecoder.h:
1598         * platform/image-decoders/gif/GIFImageReader.cpp:
1599         (GIFImageReader::parse):
1600         * platform/image-decoders/gif/GIFImageReader.h:
1601         (GIFFrameContext::GIFFrameContext):
1602         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1603         (WebCore::ICOImageDecoder::frameBufferAtIndex):
1604         * platform/image-decoders/ico/ICOImageDecoder.h:
1605         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1606         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
1607         (WebCore::setPixel):
1608         (WebCore::JPEGImageDecoder::outputScanlines):
1609         (WebCore::JPEGImageDecoder::jpegComplete):
1610         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1611         * platform/image-decoders/png/PNGImageDecoder.cpp:
1612         (WebCore::PNGImageDecoder::frameBufferAtIndex):
1613         (WebCore::PNGImageDecoder::rowAvailable):
1614         (WebCore::PNGImageDecoder::readChunks):
1615         (WebCore::PNGImageDecoder::clearFrameBufferCache):
1616         (WebCore::PNGImageDecoder::initFrameBuffer):
1617         (WebCore::PNGImageDecoder::frameComplete):
1618         * platform/image-decoders/png/PNGImageDecoder.h:
1619         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1620         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
1621         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
1622         (WebCore::WEBPImageDecoder::decodeFrame):
1623         (WebCore::WEBPImageDecoder::initFrameBuffer):
1624         (WebCore::WEBPImageDecoder::applyPostProcessing):
1625         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
1626         * platform/image-decoders/webp/WEBPImageDecoder.h:
1627
1628 2018-04-11  Antoine Quint  <graouts@apple.com>
1629
1630         [Web Animations] Turn Web Animations on by default
1631         https://bugs.webkit.org/show_bug.cgi?id=184491
1632
1633         Reviewed by Simon Fraser.
1634
1635         * page/RuntimeEnabledFeatures.h:
1636
1637 2018-04-11  Ryosuke Niwa  <rniwa@webkit.org>
1638
1639         Fix warning in HashTools.h for newer versions of clang
1640         https://bugs.webkit.org/show_bug.cgi?id=184489
1641
1642         Reviewed by Alexey Proskuryakov.
1643
1644         Removed "register" storage class specififer as it has been deprecated in C++11.
1645
1646         * platform/HashTools.h:
1647
1648 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1649
1650         FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
1651         https://bugs.webkit.org/show_bug.cgi?id=183395
1652         <rdar://problem/38055732>
1653
1654         Reviewed by Zalan Bujtas.
1655
1656         In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
1657         FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
1658         mitigation by wrapping the Frame in a Ref when firing the appearance update timer.
1659
1660         Test: editing/selection/iframe-update-selection-appearance.html
1661
1662         * editing/FrameSelection.cpp:
1663         (WebCore::FrameSelection::appearanceUpdateTimerFired):
1664
1665 2018-04-10  Brent Fulgham  <bfulgham@apple.com>
1666
1667         Unreviewed follow-up to r230468.
1668
1669         Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.
1670
1671         * page/mac/EventHandlerMac.mm:
1672         (WebCore::lastEventIsMouseUp):
1673         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1674         * platform/mac/EventLoopMac.mm:
1675         (WebCore::EventLoop::cycle):
1676
1677 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1678
1679         Unreviewed, fix the iOS build
1680
1681         I accidentally exported an inline function in r230506.
1682
1683         * page/ViewportConfiguration.h:
1684         (WebCore::ViewportConfiguration::viewSize const):
1685
1686 2018-04-10  Nan Wang  <n_wang@apple.com>
1687
1688         AX: Expose strong password fields on iOS
1689         https://bugs.webkit.org/show_bug.cgi?id=184465
1690         <rdar://problem/39325104>
1691
1692         Reviewed by Chris Fleizach.
1693
1694         Exposed the strong password field on iOS. And made sure
1695         we are returning its actual value in accessibilityValue.
1696
1697         Test: accessibility/ios-simulator/strong-password-field.html
1698
1699         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1700         (-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
1701         (-[WebAccessibilityObjectWrapper accessibilityValue]):
1702
1703 2018-04-10  Fujii Hironori  <Hironori.Fujii@sony.com>
1704
1705         [Win] Add UserAgentWin.cpp
1706         https://bugs.webkit.org/show_bug.cgi?id=184438
1707
1708         Reviewed by Michael Catanzaro.
1709
1710         No new tests (No behavior change).
1711
1712         * PlatformWin.cmake:
1713         * platform/win/UserAgentWin.cpp: Added.
1714         (WebCore::standardUserAgent):
1715         (WebCore::standardUserAgentForURL):
1716
1717 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1718
1719         [Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in extra zoom mode
1720         https://bugs.webkit.org/show_bug.cgi?id=184435
1721         <rdar://problem/38726260>
1722
1723         Reviewed by Dean Jackson.
1724
1725         Expose the size of the platform view. By default, in extra zoom mode, this *not* the same as the minimum layout
1726         size, since we lay out at a large width and then shrink down to real device dimensions when computing the
1727         initial scale (see r229063).
1728
1729         ViewGestureGeometryCollector uses this in the process of computing a target zoom scale when double tapping.
1730
1731         * page/ViewportConfiguration.h:
1732         (WebCore::ViewportConfiguration::viewSize const):
1733
1734 2018-04-10  Fujii Hironori  <Hironori.Fujii@sony.com>
1735
1736         [Win][WebKit] LibWebRTCProvider::webRTCAvailable is an undefined symbol
1737         https://bugs.webkit.org/show_bug.cgi?id=184437
1738
1739         Reviewed by Michael Catanzaro.
1740
1741         No new tests (No behavior change).
1742
1743         * PlatformWin.cmake: Added LibWebRTCProviderWin.cpp.
1744         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Added.
1745         (WebCore::LibWebRTCProvider::webRTCAvailable):
1746
1747 2018-04-10  Chris Dumez  <cdumez@apple.com>
1748
1749         Unreviewed build fix.
1750
1751         Those enum value names were too generic and would cause conflicts.
1752
1753         * Modules/webvr/VRDisplayCapabilities.h:
1754         (WebCore::VRDisplayCapabilities::hasPosition const):
1755         (WebCore::VRDisplayCapabilities::hasOrientation const):
1756         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
1757         (WebCore::VRDisplayCapabilities::canPresent const):
1758         * platform/vr/VRPlatformDisplay.h:
1759         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1760         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1761
1762 2018-04-10  Chris Dumez  <cdumez@apple.com>
1763
1764         Avoid constructing a service worker RegistrationStore for private sessions
1765         https://bugs.webkit.org/show_bug.cgi?id=184463
1766         <rdar://problem/36613948>
1767
1768         Reviewed by Youenn Fablet.
1769
1770         Avoid constructing a service worker RegistrationStore for private sessions since there
1771         is no need for persistence and the registrationDatabaseDirectory is the empty string in
1772         such cases.
1773
1774         * workers/service/server/SWServer.cpp:
1775         (WebCore::SWServer::removeRegistration):
1776         (WebCore::SWServer::clearAll):
1777         (WebCore::SWServer::clear):
1778         (WebCore::SWServer::SWServer):
1779         (WebCore::SWServer::didFinishActivation):
1780         * workers/service/server/SWServer.h:
1781
1782 2018-04-10  Chris Dumez  <cdumez@apple.com>
1783
1784         Unreviewed build fix.
1785
1786         * page/LayoutContext.cpp:
1787         (WebCore::LayoutContext::~LayoutContext):
1788         * page/LayoutContext.h:
1789
1790 2018-04-10  Jeremy Jones  <jeremyj@apple.com>
1791
1792         MediaSessionManageriOS should defer creation of MPVolumeView until it needs to monitor AirPlay routes
1793         https://bugs.webkit.org/show_bug.cgi?id=184373
1794         <rdar://problem/35177606>
1795
1796         Reviewed by Eric Carlson.
1797
1798         No change of behavior.
1799
1800         This delays the creation of MPVolumeView until airplay routes are monitored.
1801         MPVolumeView is now also released when monitoring ends. 
1802         This makes sure the MP* objects are only accessed from a UI safe thread. WebCore's "MainThread" may be different that the UI thread.
1803         Since this state change is necessarily asynchronous, starting and stopping must prevent races to keep state coherent.
1804
1805         * platform/audio/ios/MediaSessionManagerIOS.mm:
1806         (-[WebMediaSessionHelper initWithCallback:]):
1807         (-[WebMediaSessionHelper dealloc]):
1808         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
1809         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
1810         (-[WebMediaSessionHelper allocateVolumeView]): Deleted.
1811         (-[WebMediaSessionHelper setVolumeView:]): Deleted.
1812
1813 2018-04-10  Sihui Liu  <sihui_liu@apple.com>
1814
1815         Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
1816         https://bugs.webkit.org/show_bug.cgi?id=184268
1817         <rdar://problem/39144446>
1818
1819         Reviewed by Chris Dumez.
1820
1821         The assertion is no longer true after the change, because multiple resources could have same
1822         url. Used if condition here to make sure we only delete specified resource.
1823
1824         No new tests. Updated an existing test to test the stop loading case by not using injected 
1825         bundle policy: http/tests/multipart/multipart-html.php.
1826
1827         * loader/cache/CachedResourceLoader.cpp:
1828         (WebCore::CachedResourceLoader::removeCachedResource):
1829
1830 2018-04-10  Zalan Bujtas  <zalan@apple.com>
1831
1832         Do not layout images when we only need the overflow information.
1833         https://bugs.webkit.org/show_bug.cgi?id=175331
1834
1835         Reviewed by Simon Fraser.
1836
1837         This improves MotionMark's Simple Leaves by ~10%. 
1838
1839         Covered by existing tests.
1840
1841         * rendering/RenderImage.cpp:
1842         (WebCore::RenderImage::layout):
1843
1844 2018-04-10  Zan Dobersek  <zdobersek@igalia.com>
1845
1846         [TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform
1847         https://bugs.webkit.org/show_bug.cgi?id=183868
1848
1849         Reviewed by Carlos Garcia Campos.
1850
1851         Drop the GraphicsLayerTransform member variable from TextureMapperLayer
1852         and instead compute all the required transform information in the
1853         computeTransformsRecursive() method. These computations are not too
1854         expensive, and in turn we can drop an object from this class' state that
1855         was only duplicating a bunch of state variables.
1856
1857         No new tests -- no change in functionality.
1858
1859         * platform/graphics/texmap/TextureMapperLayer.cpp:
1860         (WebCore::TextureMapperLayer::computeTransformsRecursive):
1861         (WebCore::TextureMapperLayer::paintSelf):
1862         (WebCore::TextureMapperLayer::paintSelfAndChildren):
1863         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1864         (WebCore::TextureMapperLayer::replicaTransform):
1865         (WebCore::TextureMapperLayer::computeOverlapRegions):
1866         (WebCore::TextureMapperLayer::setPosition):
1867         (WebCore::TextureMapperLayer::setSize):
1868         (WebCore::TextureMapperLayer::setAnchorPoint):
1869         (WebCore::TextureMapperLayer::setPreserves3D):
1870         (WebCore::TextureMapperLayer::setTransform):
1871         (WebCore::TextureMapperLayer::setChildrenTransform):
1872         (WebCore::TextureMapperLayer::syncAnimations):
1873         (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded):
1874         * platform/graphics/texmap/TextureMapperLayer.h:
1875
1876 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
1877
1878         Add ProcessPrivilege assertions to places that access NSApp
1879         https://bugs.webkit.org/show_bug.cgi?id=184322
1880         <rdar://problem/39194560>
1881
1882         Reviewed by Per Arne Vollan.
1883
1884         Add ProcessPrivilege assertions to places where we interact with NSApp so
1885         that we can prevent accidentally using them in the WebContent process.
1886
1887         * page/mac/EventHandlerMac.mm:
1888         (WebCore::lastEventIsMouseUp):
1889         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1890         * platform/mac/EventLoopMac.mm:
1891         (WebCore::EventLoop::cycle):
1892         * platform/mac/PasteboardMac.mm:
1893         (WebCore::Pasteboard::setDragImage):
1894
1895 2018-04-09  John Wilander  <wilander@apple.com>
1896
1897         Refactor Ignore HSTS code
1898         https://bugs.webkit.org/show_bug.cgi?id=184433
1899         <rdar://problem/39298238>
1900
1901         Reviewed by Darin Adler.
1902
1903         This patch refactors our ignore HSTS code. The convenience functions are moved
1904         out of CFNetwork SPI in PAL, and into where they are used. It also switches
1905         from performSelector: calls to straight function calls, after checking that
1906         there is a responder.
1907
1908         * platform/network/mac/WebCoreURLResponse.mm:
1909         (WebCore::schemeWasUpgradedDueToDynamicHSTS):
1910             Add convenience function here since it was moved out of
1911             CFNetworkSPI.h.
1912
1913 2018-04-09  Brady Eidson  <beidson@apple.com>
1914
1915         Expand WebCore policy concept of "shouldContinue" to allow for more than true/false
1916         https://bugs.webkit.org/show_bug.cgi?id=184424
1917
1918         Reviewed by Alex Christensen.
1919
1920         No new tests (No behavior change, refactor only)
1921
1922         Specifically this expands the "shouldContinue" bool to be an enum class with:
1923         -Yes
1924         -No
1925         -ForSuspension
1926
1927         * loader/DocumentLoader.cpp:
1928         (WebCore::DocumentLoader::willSendRequest):
1929         * loader/FrameLoader.cpp:
1930         (WebCore::FrameLoader::loadURL):
1931         (WebCore::FrameLoader::load):
1932         (WebCore::FrameLoader::loadWithDocumentLoader):
1933         (WebCore::FrameLoader::loadPostRequest):
1934         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1935         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1936         * loader/FrameLoader.h:
1937         * loader/PolicyChecker.cpp:
1938         (WebCore::PolicyChecker::checkNavigationPolicy):
1939         (WebCore::PolicyChecker::checkNewWindowPolicy):
1940         * loader/PolicyChecker.h:
1941
1942 2018-04-09  Sihui Liu  <sihui_liu@apple.com>
1943
1944         REGRESSION(r229929): localStorage is broken for WebInspector
1945         https://bugs.webkit.org/show_bug.cgi?id=184382
1946         <rdar://problem/39257355>
1947
1948         Reviewed by Chris Dumez.
1949
1950         Removed an if condition that caused false positive cases of database error. As per 
1951         https://www.sqlite.org/c3ref/errcode.html, return value of sqlite3_errcode() is undefined
1952         on successful API call, so we should not use the code to check if there is an error. We
1953         should only use it when there is an error.
1954         After moving this condition, LocalStorage might return empty string instead of NULL on
1955         sqlite3_column_blob() error.
1956
1957         Modified a test to cover this case: 
1958         TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm.
1959
1960         * platform/sql/SQLiteStatement.cpp:
1961         (WebCore::SQLiteStatement::getColumnBlobAsString):
1962
1963 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
1964
1965         WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll is directly accessing NSScreen
1966         https://bugs.webkit.org/show_bug.cgi?id=184344
1967         <rdar://problem/39224969>
1968
1969         Reviewed by Per Arne Vollan.
1970
1971         The implementation of targetPositionInWindowForSelectionAutoscroll uses the display ID to get the
1972         screen boundaries of the current display. This causes a bunch of interaction with NSScreen that
1973         we do not want to allow in the WebContent process.
1974
1975         Instead, we should just use the cached screen information the WebContent process already possesses.
1976
1977         This patch makes the following changes:
1978         1. We now retrieve the screen rect of the page's display from the cache, rather than interacting with
1979            the WindowServer directly.
1980         2. Add a new 'toUserSpaceForPrimaryScreen' so we don't have to deal with a nil NSWindow when computing
1981            the user space version of the coordinates. A nil Window just means we want to get coordinates in
1982            terms of the primary display.
1983         3. Keep track of the primary display so we can refer to it later.
1984         4. Modify the IPC messages to include the primary display's ID so we can easily access it later.
1985         5. Modify the PlatformScreen methods to actually use the primary display when appropriate, rather
1986            than whichever screen happened to hash to the lowest value.
1987
1988         * page/mac/EventHandlerMac.mm:
1989         (WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const): Use new methods that
1990         don't require WindowServer access.
1991         * platform/PlatformScreen.h:
1992         * platform/mac/PlatformScreenMac.mm:
1993         (WebCore::displayID): Assert if we hit this code in the WebContent process.
1994         (WebCore::firstScreen): Ditto.
1995         (WebCore::window): Ditto.
1996         (WebCore::screen): Ditto.
1997         (WebCore::primaryScreenID): Added.
1998         (WebCore::getScreenProperties): Modify to return a pair consisting of the primary display ID and
1999         the HashSet of screen settings.
2000         (WebCore::setScreenProperties): Update to also track the primary display ID.
2001         (WebCore::screenProperties): Update to use the primary display ID.
2002         (WebCore::screenHasInvertedColors): Ditto.
2003         (WebCore::toUserSpaceForPrimaryScreen): Added.
2004
2005 2018-04-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
2006
2007         Make InlineTextBox::createTextRun() take a const lvalue reference String
2008         https://bugs.webkit.org/show_bug.cgi?id=184182
2009
2010         Reviewed by Zalan Bujtas.
2011
2012         InlineTextBox::createTextRun() takes a non-const lvalue reference String.
2013         It is tempting to change the signature of this method to take a const lvalue 
2014         reference. But this was done intentionally. TextRun is effectively a StringView:
2015         it does not own the passed string. Having the argument a non-const lvalue
2016         reference makes the compiler prevent calls like createTextRun("abc").
2017
2018         To have a better way to express the lifetime of TextRun, this patch does
2019         the following:
2020
2021         -- It makes TextRun::m_text of type String instead of StringView.
2022         -- It adds a new constructor which takes const String&. This constructor
2023            will addRef the underlying StringImpl when assigning it to m_text.
2024         -- It keeps the constructor which takes a StringView. The caller of this
2025            constructor still has to make sure the underlying String outlives the
2026            TextRun. To avoid copying the underlying buffer of the StringView, we
2027            will not use  StringView::toString(). Instead we will use
2028            StringView::toStringWithoutCopying() which makes the returned String 
2029            accesses the same buffer the StringView uses. In this case, the returned
2030            String is effectively a StringView.
2031
2032         * page/DebugPageOverlays.cpp:
2033         (WebCore::drawRightAlignedText):
2034         * platform/graphics/TextRun.cpp:
2035         * platform/graphics/TextRun.h:
2036         (WebCore::TextRun::TextRun):
2037         (WebCore::TextRun::subRun const):
2038         (WebCore::TextRun::length const):
2039         (WebCore::TextRun::setText):
2040         (WebCore::TextRun::string const): Deleted.
2041         * rendering/InlineTextBox.cpp:
2042         (WebCore::InlineTextBox::localSelectionRect const):
2043         (WebCore::InlineTextBox::paint):
2044         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
2045         (WebCore::InlineTextBox::paintMarkedTextBackground):
2046         (WebCore::InlineTextBox::paintMarkedTextForeground):
2047         (WebCore::InlineTextBox::paintMarkedTextDecoration):
2048         (WebCore::InlineTextBox::offsetForPosition const):
2049         (WebCore::InlineTextBox::positionForOffset const):
2050         (WebCore::InlineTextBox::createTextRun const):
2051         There is no need for this function to take a String argument anymore. The
2052         reason for passing the String was to guarantee its lifetime by keeping
2053         a copy of it in the caller side. Now there is no need for that. The TextRun
2054         itself will keep this copy.
2055
2056         * rendering/InlineTextBox.h:
2057         * rendering/RenderText.cpp:
2058         (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
2059         RenderText::text() returns StringImpl. The compiler wants us to be more
2060         explicit about which constructor of TextRun to call.
2061
2062         * rendering/SimpleLineLayout.cpp:
2063         (WebCore::SimpleLineLayout::canUseForFontAndText):
2064         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2065         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2066         RenderStyle::hyphenString() returns an AtomicString.
2067
2068 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2069
2070         Unreviewed, rolling out r230390.
2071
2072         Broke accelerated compositing
2073
2074         Reverted changeset:
2075
2076         "[GTK] WaylandCompositorDisplay leaks its wl_display"
2077         https://bugs.webkit.org/show_bug.cgi?id=184406
2078         https://trac.webkit.org/changeset/230390
2079
2080 2018-04-03  Sergio Villar Senin  <svillar@igalia.com>
2081
2082         [OpenVR][WebVR] Retrieve FrameData in WebVR's rAF
2083         https://bugs.webkit.org/show_bug.cgi?id=184265
2084
2085         Reviewed by Žan Doberšek.
2086
2087         VRFrameData contains all the required information to properly render a VR scene like view
2088         and projection matrices, pose data (position & orientation) and linear & angular velocity
2089         among others. The getFrameData() call must be issued inside a WebVR's own
2090         requestAnimationFrame.
2091
2092         * Modules/webvr/VRDisplay.cpp:
2093         (WebCore::VRDisplay::getFrameData const):
2094         (WebCore::VRDisplay::getPose const):
2095         (WebCore::VRDisplay::requestAnimationFrame):
2096         (WebCore::VRDisplay::cancelAnimationFrame):
2097         * Modules/webvr/VRDisplay.h:
2098         * Modules/webvr/VREyeParameters.h:
2099         (WebCore::VREyeParameters::rawOffset const): Required to compute view matrices.
2100         * Modules/webvr/VRFrameData.cpp:
2101         (WebCore::matrixToArray):
2102         (WebCore::VRFrameData::leftProjectionMatrix const):
2103         (WebCore::VRFrameData::leftViewMatrix const):
2104         (WebCore::VRFrameData::rightProjectionMatrix const):
2105         (WebCore::VRFrameData::rightViewMatrix const):
2106         (WebCore::projectionMatrixFromFieldOfView):
2107         (WebCore::rotationMatrixFromQuaternion):
2108         (WebCore::applyHeadToEyeTransform):
2109         (WebCore::VRFrameData::update):
2110         (WebCore::VRFrameData::timestamp const): Deleted.
2111         * Modules/webvr/VRFrameData.h:
2112         (WebCore::VRFrameData::timestamp const):
2113         * Modules/webvr/VRPose.cpp:
2114         (WebCore::optionalFloat3ToJSCArray):
2115         (WebCore::VRPose::position const):
2116         (WebCore::VRPose::linearVelocity const):
2117         (WebCore::VRPose::linearAcceleration const):
2118         (WebCore::VRPose::orientation const):
2119         (WebCore::VRPose::angularVelocity const):
2120         (WebCore::VRPose::angularAcceleration const):
2121         * Modules/webvr/VRPose.h:
2122         (WebCore::VRPose::create):
2123         (WebCore::VRPose::update):
2124         (WebCore::VRPose::VRPose):
2125         * platform/vr/VRPlatformDisplay.h:
2126         (WebCore::VRPlatformTrackingInfo::Quaternion::Quaternion):
2127         (WebCore::VRPlatformTrackingInfo::Quaternion::conjugate):
2128         (WebCore::VRPlatformTrackingInfo::Quaternion::operator*):
2129         (WebCore::VRPlatformTrackingInfo::Float3::Float3): Just a group of 3 floats used to store
2130         both velocity and acceleration in a format which is very convenient to later generate JSC
2131         arrays.
2132         (WebCore::VRPlatformTrackingInfo::clear):
2133         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
2134         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2135         (WebCore::rotationMatrixToQuaternion):
2136         (WebCore::VRPlatformDisplayOpenVR::getTrackingInfo):
2137         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2138
2139 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2140
2141         [GTK] WaylandCompositorDisplay leaks its wl_display
2142         https://bugs.webkit.org/show_bug.cgi?id=184406
2143
2144         Reviewed by Carlos Garcia Campos.
2145
2146         Remove the protected default constructor, for good measure.
2147
2148         * platform/graphics/wayland/PlatformDisplayWayland.h:
2149
2150 2018-04-08  Fujii Hironori  <Hironori.Fujii@sony.com>
2151
2152         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
2153         https://bugs.webkit.org/show_bug.cgi?id=184127
2154
2155         Reviewed by Konstantin Tokarev.
2156
2157         No new tests (No behaviour changes).
2158
2159         * CMakeLists.txt: Added a interface library WebCoreHeaderInterface.
2160
2161 2018-04-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2162
2163         Use alignas instead of compiler-specific attributes
2164         https://bugs.webkit.org/show_bug.cgi?id=183508
2165
2166         Reviewed by Mark Lam.
2167
2168         Use alignas instead of aligned.
2169
2170         * platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
2171         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
2172         (WebCore::FELighting::platformApplyNeon):
2173
2174 2018-04-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2175
2176         [WPE][GTK] Remove applicationDirectoryPath() and sharedResourcePath()
2177         https://bugs.webkit.org/show_bug.cgi?id=184381
2178
2179         Reviewed by Carlos Garcia Campos.
2180
2181         These are unused.
2182
2183         * platform/FileSystem.h:
2184         * platform/glib/FileSystemGlib.cpp:
2185         (WebCore::FileSystem::applicationDirectoryPath): Deleted.
2186         (WebCore::FileSystem::sharedResourcesPath): Deleted.
2187
2188 2018-04-07  Daniel Bates  <dabates@apple.com>
2189
2190         Have WorkerScriptLoader::loadAsynchronously() take a FetchOptions
2191         https://bugs.webkit.org/show_bug.cgi?id=184385
2192
2193         Reviewed by Youenn Fablet.
2194
2195         Currently we pass various FetchOptions to WorkerScriptLoader::loadAsynchronously()
2196         so that it can build up a ThreadableLoaderOptions structure to pass to the loader.
2197         Each time we want to set another FetchOptions option we need to add a new parameter.
2198         Instead we should have WorkerScriptLoader::loadAsynchronously() take a FetchOptions.
2199         This will make it straightforward for a caller to set new loader options as needed.
2200         In particular, this will make it straightforward to support setting the request's
2201         destination flag (i.e. FetchOptions::destination) to support blocking scripts with
2202         a non-JavaScript MIME type in a subsequent commit.
2203
2204         No functionality changed. So, no new tests.
2205
2206         * loader/ResourceLoaderOptions.h:
2207         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Modified to take a FetchOptions
2208         by value so as to support both move and copy semantics.
2209         * loader/ThreadableLoader.cpp:
2210         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):  Added helper constructor
2211         that takes a FetchOptions.
2212         * loader/ThreadableLoader.h:
2213         * workers/Worker.cpp:
2214         (WebCore::Worker::create): Instantiate and pass a FetchOptions to the loader for the mode,
2215         cache policy, and redirect policy.
2216         * workers/WorkerScriptLoader.cpp:
2217         (WebCore::WorkerScriptLoader::loadAsynchronously): Modified to take a FetchOptions and
2218         instantiate a ThreadableLoaderOptions from it.
2219         * workers/WorkerScriptLoader.h:
2220         * workers/WorkerScriptLoaderClient.h:
2221         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const): Deleted. This function
2222         is no longer needed because the Service Worker client now passes the service worker mode
2223         directly to the loader.
2224         * workers/service/ServiceWorkerJob.cpp:
2225         (WebCore::ServiceWorkerJob::fetchScriptWithContext): Instantiate and pass a FetchOptions
2226         to the loader.
2227         * workers/service/ServiceWorkerJob.h:
2228
2229 2018-04-07  Timothy Hatcher  <timothy@apple.com>
2230
2231         Use the system's link color when system appearance is desired for a WebView.
2232
2233         https://bugs.webkit.org/show_bug.cgi?id=184353
2234         rdar://problem/9420053
2235
2236         Reviewed by Wenson Hsieh.
2237
2238         Have Document consult RenderTheme via StyleColor for the various link colors.
2239         This allows the system to have different colors than the standard hardcoded ones.
2240         This adds StyleColor::Options, to avoid multiple booleans being passed around,
2241         since the "for visited link" state is now needed in RenderTheme.
2242
2243         * WebCore.xcodeproj/project.pbxproj: Made StyleColor.h private, since RenderTheme.h includes it.
2244         * css/StyleColor.cpp:
2245         (WebCore::StyleColor::colorFromKeyword): Use options instead of a bool.
2246         (WebCore::StyleColor::isSystemColor): Consider CSSValueWebkitLink the start of system colors.
2247         * css/StyleColor.h:
2248         * css/StyleResolver.cpp:
2249         (WebCore::StyleResolver::colorFromPrimitiveValue const): Use StyleColor::Options.
2250         * css/parser/CSSParser.cpp:
2251         (WebCore::CSSParser::parseSystemColor): Use StyleColor::Options.
2252         * dom/Document.cpp:
2253         (WebCore::Document::resetLinkColor): Ask StyleColor for the link color instead of hardcoding it.
2254         (WebCore::Document::resetVisitedLinkColor): Ditto.
2255         (WebCore::Document::resetActiveLinkColor): Ditto.
2256         (WebCore::Document::styleColorOptions const): Added. Helper to get the options used.
2257         * dom/Document.h:
2258         * html/canvas/CanvasRenderingContext2D.cpp:
2259         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Use StyleColor::Options.
2260         * rendering/RenderTheme.cpp:
2261         (WebCore::RenderTheme::systemColor const): Add default values here, moved from Document.
2262         (WebCore::RenderTheme::focusRingColor): Use StyleColor::Options.
2263         * rendering/RenderTheme.h:
2264         (WebCore::RenderTheme::platformFocusRingColor const): Use StyleColor::Options.
2265         * rendering/RenderThemeGtk.cpp:
2266         (WebCore::RenderThemeGtk::systemColor const): Use StyleColor::Options.
2267         * rendering/RenderThemeGtk.h:
2268         * rendering/RenderThemeIOS.h:
2269         * rendering/RenderThemeIOS.mm:
2270         (WebCore::RenderThemeIOS::systemColor const): Use StyleColor::Options.
2271         * rendering/RenderThemeMac.h:
2272         * rendering/RenderThemeMac.mm:
2273         (WebCore::RenderThemeMac::platformFocusRingColor const): Use StyleColor::Options.
2274         (WebCore::RenderThemeMac::platformColorsDidChange): Clear m_systemVisitedLinkColor.
2275         (WebCore::RenderThemeMac::systemColor const): Use StyleColor::Options.
2276         (WebCore::RenderThemeMac::adjustMenuListStyle const): Ditto.
2277         * rendering/RenderThemeWin.cpp:
2278         (WebCore::RenderThemeWin::systemColor const): Use StyleColor::Options.
2279         * rendering/RenderThemeWin.h:
2280         * rendering/TextPaintStyle.cpp:
2281         (WebCore::computeTextPaintStyle): Use StyleColor::Options.
2282
2283 2018-04-06  Youenn Fablet  <youenn@apple.com>
2284
2285         Response headers should be filtered when sent from NetworkProcess to WebProcess
2286         https://bugs.webkit.org/show_bug.cgi?id=184310
2287
2288         Reviewed by Ryosuke Niwa.
2289
2290         Did some refactoring to allow ResourceResponse to use header value parsing routines.
2291         We add sanitization levels for regular responses in case responses might be exposed to scripts or not.
2292         If not exposed to scripts, additional filtering is done.
2293
2294         Add internal API to get unfiltered response headers from a fetch response.
2295         Test: http/wpt/service-workers/header-filtering.https.html
2296
2297         * Modules/fetch/FetchResponse.h:
2298         * loader/CrossOriginPreflightResultCache.cpp:
2299         (WebCore::CrossOriginPreflightResultCacheItem::parse):
2300         * platform/network/HTTPParsers.h:
2301         (WebCore::addToAccessControlAllowList):
2302         (WebCore::parseAccessControlAllowList):
2303         * platform/network/ResourceResponseBase.cpp:
2304         (WebCore::isSafeToKeepRedirectionResponseHeader):
2305         (WebCore::isCrossOriginSafeToKeepResponseHeader):
2306         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
2307         * platform/network/ResourceResponseBase.h:
2308         * testing/ServiceWorkerInternals.cpp:
2309         (WebCore::ServiceWorkerInternals::fetchResponseHeaderList):
2310         * testing/ServiceWorkerInternals.h:
2311         * testing/ServiceWorkerInternals.idl:
2312
2313 2018-04-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2314
2315         Unreviewed, fix unused parameter warning when credential storage is disabled
2316
2317         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2318         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2319
2320 2018-04-06  Eric Carlson  <eric.carlson@apple.com>
2321
2322         [Extra zoom mode] Block playback until fullscreen begins
2323         https://bugs.webkit.org/show_bug.cgi?id=184371
2324         <rdar://problem/39250891>
2325
2326         Reviewed by Youenn Fablet.
2327
2328         * html/HTMLMediaElement.cpp:
2329         (WebCore::HTMLMediaElement::updatePlayState): Return early when waiting to enter fullscreen.
2330         (WebCore::HTMLMediaElement::enterFullscreen): Set m_waitingToEnterFullscreen.
2331         (WebCore::HTMLMediaElement::exitFullscreen): Clear m_waitingToEnterFullscreen.
2332         (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto.
2333         * html/HTMLMediaElement.h:
2334
2335 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
2336
2337         WebCore::screenSupportsExtendedColor improperly calls NSScreen functions in the WebContent process
2338         https://bugs.webkit.org/show_bug.cgi?id=184364
2339         <rdar://problem/39246314>
2340
2341         Reviewed by Per Arne Vollan.
2342
2343         The WebContent process is interacting directly with NSScreen to determine if the current screen
2344         has extended color support. This should be brokered from the UIProcess.
2345         
2346         Tested by fast/media/mq-color-gamut.html.
2347
2348         * platform/ScreenProperties.h:
2349         (WebCore::ScreenProperties::encode const): Add screenSupportsExtendedColor.
2350         (WebCore::ScreenProperties::decode): Ditto.
2351         * platform/mac/PlatformScreenMac.mm:
2352         (WebCore::getScreenProperties): Retrieve extended color support.
2353         (WebCore::screenSupportsExtendedColor): Retrieve cached version when in the WebContent
2354         process. Assert that NSScreen is not accessed in the WebContent process.
2355
2356 2018-04-06  Fujii Hironori  <Hironori.Fujii@sony.com>
2357
2358         [Win][WebCore] Expose a constant for scrollbar pixels per line (cScrollbarPixelsPerLine)
2359         https://bugs.webkit.org/show_bug.cgi?id=184296
2360
2361         Reviewed by Alex Christensen.
2362
2363         No new tests (No behavior changes).
2364
2365         * platform/PlatformWheelEvent.h: Placed cScrollbarPixelsPerLine definition.
2366         * platform/win/WheelEventWin.cpp:
2367         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Removed cScrollbarPixelsPerLine definition.
2368
2369 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
2370
2371         Unreviewed test fix after r230323
2372
2373         * platform/mac/PlatformScreenMac.mm:
2374         (WebCore::screenSupportsExtendedColor): Remove assertion hit during test runs.
2375
2376 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
2377
2378         WebCore::screenColorSpace is retrieving CGColorSpace from NSScreen directly
2379         https://bugs.webkit.org/show_bug.cgi?id=184343
2380         <rdar://problem/39224881>
2381
2382         Reviewed by Per Arne Vollan.
2383
2384         Revise ScreenProperties to serialize the screen's color space, and later
2385         retrieve that in the WebContent process. This allows us to close off
2386         the CGSWindowServer connection.
2387
2388         * platform/ScreenProperties.h:
2389         (WebCore::ScreenProperties::encode const): Add CGColorSpaceRef support.
2390         (WebCore::ScreenProperties::decode): Ditto.
2391         * platform/mac/PlatformScreenMac.mm:
2392         (WebCore::displayID): Add assertion to prevent use in WebContent process.
2393         (WebCore::firstScreen): Ditto.
2394         (WebCore::getScreenProperties): Add support for CGColorSpaceRef.
2395         (WebCore::screenColorSpace): Retrieve cached version when in WebContent process.
2396         Assert that NSScreen is not accessed in WebContent process.
2397
2398 2018-04-06  Ms2ger  <Ms2ger@igalia.com>
2399
2400         Implement createImageBitmap(Blob)
2401         https://bugs.webkit.org/show_bug.cgi?id=183247
2402
2403         Reviewed by Dean Jackson.
2404
2405         Tests:
2406             - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
2407             - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
2408
2409         * fileapi/FileReaderLoader.h:
2410         (WebCore::FileReaderLoader::url): expose the Blob's URL.
2411         * html/ImageBitmap.cpp: implement createImageBitmap(Blob).
2412         * html/ImageBitmap.h: allow the BlobImageObserver class access to the creation function.
2413         * loader/cache/CachedImage.cpp: reuse extracted code.
2414         (WebCore::CachedImage::isPDFResource const):
2415         (WebCore::CachedImage::isPostScriptResource const):
2416         (WebCore::CachedImage::createImage):
2417         * platform/graphics/Image.cpp: extract some code from CachedImage to reuse.
2418         (WebCore::Image::create):
2419         (WebCore::Image::isPDFResource):
2420         (WebCore::Image::isPostScriptResource):
2421         * platform/graphics/Image.h: add declarations.
2422
2423 2018-04-06  Zalan Bujtas  <zalan@apple.com>
2424
2425         Flex child does not get repainted when it is inserted back to the render tree.
2426         https://bugs.webkit.org/show_bug.cgi?id=184361
2427         <rdar://problem/34528716>
2428
2429         Reviewed by Antti Koivisto.
2430
2431         As with any regular block children, we should issue full repaint for flexbox items on their
2432         first layout (see RenderBlockFlow::layoutBlockChild()).
2433
2434         Test: fast/flexbox/missing-repaint-when-flext-item-never-had-layout.html
2435
2436         * rendering/RenderFlexibleBox.cpp:
2437         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
2438
2439 2018-04-06  Ms2ger  <Ms2ger@igalia.com>
2440
2441         Support transferring ImageBitmap objects
2442         https://bugs.webkit.org/show_bug.cgi?id=183131
2443
2444         Reviewed by Dean Jackson.
2445
2446         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html
2447
2448         * bindings/js/SerializedScriptValue.cpp:
2449         (WebCore::CloneSerializer::serialize): thread through ImageBitmaps.
2450         (WebCore::CloneSerializer::CloneSerializer): thread through ImageBitmaps.
2451         (WebCore::CloneSerializer::fillTransferMap): don't require a mutable reference.
2452         (WebCore::CloneSerializer::dumpImageBitmap): add.
2453         (WebCore::CloneSerializer::dumpIfTerminal): check for ImageBitmap.
2454         (WebCore::CloneDeserializer::deserialize): thread through ImageBitmaps.
2455         (WebCore::CloneDeserializer::CloneDeserializer): thread through ImageBitmaps.
2456         (WebCore::CloneDeserializer::readImageBitmap): add.
2457         (WebCore::CloneDeserializer::readTerminal): check for ImageBitmap.
2458         (WebCore::SerializedScriptValue::SerializedScriptValue): thread through ImageBitmaps.
2459         (WebCore::SerializedScriptValue::create): thread through ImageBitmaps.
2460         (WebCore::containsDuplicates): add.
2461         (WebCore::SerializedScriptValue::deserialize): handle ImageBitmap arguments.
2462         * bindings/js/SerializedScriptValue.h: update signatures, add member.
2463         * html/ImageBitmap.cpp:
2464         (WebCore::ImageBitmap::create): add.
2465         (WebCore::ImageBitmap::detachBitmaps): add.
2466         * html/ImageBitmap.h: add signatures.
2467
2468 2018-04-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2469
2470         When recording the drawing, the DisplayList should be initialized with the GraphicsContextState of the underlying GraphicsContext
2471         https://bugs.webkit.org/show_bug.cgi?id=184336
2472
2473         Reviewed by Antti Koivisto.
2474
2475         The state of the drawing context has to be transfered to the recording 
2476         DisplayList before recording. Many recording GraphicsContext functions 
2477         will behave wrongly if it gets the default state.
2478
2479         * html/canvas/CanvasRenderingContext2DBase.cpp:
2480         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
2481         (WebCore::CanvasRenderingContext2DBase::drawingContext const):
2482         * platform/graphics/ca/GraphicsLayerCA.cpp:
2483         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2484         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2485         (WebCore::DisplayList::Recorder::Recorder):
2486         * platform/graphics/displaylists/DisplayListRecorder.h:
2487         (WebCore::DisplayList::Recorder::ContextState::ContextState):
2488         (WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
2489         * platform/graphics/displaylists/DisplayListReplayer.cpp:
2490         (WebCore::DisplayList::Replayer::replay):
2491         * platform/graphics/displaylists/DisplayListReplayer.h:
2492         (WebCore::DisplayList::Replayer::replay): If we do not have a clipping
2493         rectangle and we want to record all the drawing, we need a default value
2494         for the clipping rectangle and we want no clipping to happen.
2495
2496 2018-04-06  Daniel Bates  <dabates@apple.com>
2497
2498         Emit a more informative message when a script is blocked due to "X-Content-Type: nosniff"
2499         https://bugs.webkit.org/show_bug.cgi?id=184359
2500
2501         Reviewed by Per Arne Vollan.
2502
2503         Emphasize in the message that the script was blocked from executing.
2504
2505         Test: http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html
2506
2507         * dom/LoadableClassicScript.cpp:
2508         (WebCore::LoadableClassicScript::notifyFinished):
2509         * workers/WorkerScriptLoader.cpp:
2510         (WebCore::WorkerScriptLoader::didReceiveResponse):
2511
2512 2018-04-06  Daniel Bates  <dabates@apple.com>
2513
2514         importScripts() should throw exception with a reason when it fails to load a script from the network
2515         https://bugs.webkit.org/show_bug.cgi?id=184345
2516
2517         Reviewed by Alexey Proskuryakov.
2518
2519         Currently importScripts() throws a NetworkError exception without a reason when
2520         it fails to load a script from the network. It is ambiguous whether the load failed
2521         due to an access control failure or some other error. Instead we should include
2522         the reason the load failed in the thrown exception.
2523
2524         * workers/WorkerGlobalScope.cpp:
2525         (WebCore::WorkerGlobalScope::importScripts):
2526
2527 2018-04-06  Daniel Bates  <dabates@apple.com>
2528
2529         Attempt to fix the build after <https://trac.webkit.org/changeset/230338>
2530         (https://bugs.webkit.org/show_bug.cgi?id=184360)
2531
2532         Make lambdas mutable so that we can WTFMove() their captured arguments.
2533
2534         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2535         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
2536         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
2537         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
2538
2539 2018-04-06  Daniel Bates  <dabates@apple.com>
2540
2541         Have class Exception take String by value instead of a String&&
2542         https://bugs.webkit.org/show_bug.cgi?id=184360
2543
2544         Reviewed by Alexey Proskuryakov.
2545
2546         For convenience support instantiating an Exception with either an lvalue String or
2547         rvalue String.
2548
2549         Although it can be argued that having Exception take a String by value instead of String&&
2550         can lead to missed opportunities to WTFMove() a String object into Exception such mistakes
2551         are just that, missed opportunities. That is, correctness is not affected and we may perform
2552         an unnecessary ref/deref of the underlying StringImpl when instantiating an Exception. If
2553         such missed opportunities show up in profiles and such mistakes happen often then we can
2554         re-evaluate the decision to have Exception take a String by value.
2555
2556         * Modules/cache/DOMCache.cpp:
2557         (WebCore::DOMCache::put): Simplify code now that Exception takes a String by value.
2558         * Modules/fetch/FetchResponse.cpp:
2559         (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
2560         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2561         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed): Move String into Exception to avoid an
2562         unnecessary ref/de-ref.
2563         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed): Ditto.
2564         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed): Ditto.
2565         * dom/Exception.h:
2566         (WebCore::Exception::Exception): Take String by value. Also use uniform initializer syntax.
2567
2568 2018-04-06  Antti Koivisto  <antti@apple.com>
2569
2570         Tighten ImageSource to have BitmapImage pointer instead of Image
2571         https://bugs.webkit.org/show_bug.cgi?id=184356
2572
2573         Reviewed by Said Abou-Hallawa.
2574
2575         ImageSource is an implementation detail of BitmapImage, not a generic type.
2576
2577         * loader/ImageLoader.cpp:
2578         (WebCore::ImageLoader::decode):
2579         * platform/graphics/BitmapImage.h:
2580         * platform/graphics/Image.h:
2581         (WebCore::Image::decode): Deleted.
2582         (WebCore::Image::imageFrameAvailableAtIndex): Deleted.
2583
2584         Also make some BitmapImage specific functions non-virtual and remove them from Image.
2585
2586         * platform/graphics/ImageSource.cpp:
2587         (WebCore::ImageSource::ImageSource):
2588         * platform/graphics/ImageSource.h:
2589         (WebCore::ImageSource::create):
2590
2591         Make constructors private.
2592
2593         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2594         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2595
2596 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
2597
2598         Unreviewed test fix after r230323
2599
2600         * platform/mac/PlatformScreenMac.mm:
2601         (WebCore::screen): Remove assertion we still hit due to event handling code.
2602
2603 2018-04-05  Youenn Fablet  <youenn@apple.com>
2604
2605         REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
2606         https://bugs.webkit.org/show_bug.cgi?id=184306
2607
2608         Reviewed by Ryosuke Niwa.
2609
2610         Add an option to not compile CSS rules since they are not useful in NetworkProcess.
2611         Covered by tests no longer crashing in Debug WK2 bots.
2612
2613         * contentextensions/ContentExtension.cpp:
2614         (WebCore::ContentExtensions::ContentExtension::create):
2615         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
2616         * contentextensions/ContentExtension.h:
2617         * contentextensions/ContentExtensionsBackend.cpp:
2618         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
2619         * contentextensions/ContentExtensionsBackend.h:
2620
2621 2018-04-05  Brent Fulgham  <bfulgham@apple.com>
2622
2623         WebContent process is calling CGDisplayUsesInvertedPolarity
2624         https://bugs.webkit.org/show_bug.cgi?id=184337
2625         <rdar://problem/39215702>
2626
2627         Reviewed by Zalan Bujtas.
2628
2629         The PlatformScreenMac code is still calling display-related routines directly, specifically
2630         CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
2631         the UIProcess.
2632         
2633         There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
2634         the compile guards so all macOS builds use this behavior.
2635         
2636         Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
2637         routines in the future.
2638
2639         Tested by existing regression tests.
2640
2641         * platform/PlatformScreen.h:
2642         * platform/ScreenProperties.h:
2643         (WebCore::ScreenProperties::encode const): Add new values.
2644         (WebCore::ScreenProperties::decode):
2645         * platform/mac/PlatformScreenMac.mm:
2646         (WebCore::displayID): Add assertion that this is not calling display-related routines in
2647         the WebContent process.
2648         (WebCore::firstScreen): Ditto.
2649         (WebCore::screenProperties): Moved higher in the file so it can be reused. Add calls to
2650         CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray.
2651         (WebCore::getScreenProperties): Moved higher in the file so it can be reused. Stop
2652         double-hashing displayID.
2653         (WebCore::screenIsMonochrome): Use cached values in WebContent process. Assert if this
2654         code attempts a display-related routine in the WebContent process.
2655         (WebCore::screenHasInvertedColors): Ditto.
2656         (WebCore::screenDepth): Add assertion that this is not calling display-related routines in
2657         the WebContent process.
2658         (WebCore::screenDepthPerComponent): Ditto.
2659         (WebCore::screenRect): Ditto.
2660         (WebCore::screenAvailableRect): Ditto.
2661         (WebCore::screen): Ditto.
2662         (WebCore::screenColorSpace): Ditto.
2663         (WebCore::screenSupportsExtendedColor): Ditto.
2664
2665 2018-04-05  John Wilander  <wilander@apple.com>
2666
2667         Resource Load Statistics: Apply cookie blocking to setCookiesFromDOM()
2668         https://bugs.webkit.org/show_bug.cgi?id=184346
2669         <rdar://problem/39226036>
2670
2671         Reviewed by Brent Fulgham.
2672
2673         Since these cookies can't be seen and are not sent in requests, I
2674         can't write an automated test for them. This really should have been
2675         done as part of: https://bugs.webkit.org/show_bug.cgi?id=180682.
2676         That said, I have tested this manually.
2677
2678         * platform/network/mac/CookieJarMac.mm:
2679         (WebCore::setCookiesFromDOM):
2680
2681 2018-04-05  Zalan Bujtas  <zalan@apple.com>
2682
2683         Folding anonymous blocks should not result in deleting content.
2684         https://bugs.webkit.org/show_bug.cgi?id=184339
2685         <rdar://problem/37327428>
2686
2687         Reviewed by Antti Koivisto.
2688
2689         While folding multiple anonymous blocks (moving the children from next sibling over to previous sibling)
2690         we should ensure that the block we are about to destroy does not gain new descendants.
2691         In case of 4 sibling anonymous blocks (A B C D), while destroying B
2692         1. we move C's children to A and destroy C.
2693         2. While destroying C, we notice B and C as sibling anonymous blocks and we move
2694         D's children over to B (even though B is going to be destroyed as we climb back on the stack).
2695         
2696         In this patch, B is detached from the tree before we start moving renderers around so that a subsequent folding won't
2697         find B anymore as a candidate.
2698
2699         Test: fast/block/crash-while-folding-anonymous-blocks.html
2700
2701         * rendering/updating/RenderTreeBuilderBlock.cpp:
2702         (WebCore::RenderTreeBuilder::Block::detach):
2703
2704 2018-04-05  Andy Estes  <aestes@apple.com>
2705
2706         Mark Payment Request as "Supported" in features.json
2707         https://bugs.webkit.org/show_bug.cgi?id=184338
2708
2709         Reviewed by Anders Carlsson.
2710
2711         * features.json:
2712
2713 2018-04-05  Chris Dumez  <cdumez@apple.com>
2714
2715         Unreviewed, rolling out r230042.
2716
2717         It is no longer needed now that it is safe to construct a
2718         SecurityOrigin from an on-main thread
2719
2720         Reverted changeset:
2721
2722         "WebSocket::didReceiveMessage() may construct a SecurityOrigin
2723         object on a non-main thread"
2724         https://bugs.webkit.org/show_bug.cgi?id=184068
2725         https://trac.webkit.org/changeset/230042
2726
2727 2018-04-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2728
2729         [WTF] Remove StaticLock
2730         https://bugs.webkit.org/show_bug.cgi?id=184332
2731
2732         Reviewed by Mark Lam.
2733
2734         No behavior change.
2735
2736         * Modules/webdatabase/Database.cpp:
2737         (WebCore::Database::Database):
2738         (WebCore::Database::performOpenAndVerify):
2739         (WebCore::Database::closeDatabase):
2740         (WebCore::Database::getCachedVersion const):
2741         (WebCore::Database::setCachedVersion):
2742         * Modules/webdatabase/DatabaseTracker.cpp:
2743         (WebCore::DatabaseTracker::openDatabaseMutex):
2744         * Modules/webdatabase/DatabaseTracker.h:
2745         * Modules/websockets/WebSocket.cpp:
2746         (WebCore::WebSocket::allActiveWebSocketsMutex):
2747         * Modules/websockets/WebSocket.h:
2748         * bridge/objc/WebScriptObject.mm:
2749         * crypto/CryptoAlgorithmRegistry.cpp:
2750         (WebCore::CryptoAlgorithmRegistry::identifier):
2751         (WebCore::CryptoAlgorithmRegistry::name):
2752         (WebCore::CryptoAlgorithmRegistry::create):
2753         (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
2754         * dom/Node.cpp:
2755         * platform/URL.cpp:
2756         * platform/graphics/FontCache.cpp:
2757         * platform/graphics/MediaPlayer.cpp:
2758         * platform/ios/QuickLook.mm:
2759         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
2760         * platform/ios/wak/WebCoreThread.mm:
2761         * platform/ios/wak/WebCoreThreadRun.cpp:
2762         * platform/network/cf/LoaderRunLoopCF.cpp:
2763         (WebCore::loaderRunLoop):
2764         * platform/network/curl/CurlContext.cpp:
2765         (WebCore::CurlShareHandle::mutexFor):
2766         * platform/network/curl/CurlContext.h:
2767         * platform/sql/SQLiteDatabaseTracker.cpp:
2768         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
2769         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
2770         * platform/text/TextEncodingRegistry.cpp:
2771         (WebCore::buildBaseTextCodecMaps):
2772         (WebCore::newTextCodec):
2773         (WebCore::atomicCanonicalTextEncodingName):
2774         * workers/WorkerThread.cpp:
2775         (WebCore::WorkerThread::workerThreadCount):
2776         (WebCore::WorkerThread::WorkerThread):
2777         (WebCore::WorkerThread::~WorkerThread):
2778         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
2779
2780 2018-04-04  Youenn Fablet  <youenn@apple.com>
2781
2782         WebRTC data channel only applications require capture permissions for direct connections
2783         https://bugs.webkit.org/show_bug.cgi?id=174500
2784         <rdar://problem/34134281>
2785
2786         Reviewed by Eric Carlson.
2787
2788         Test: webrtc/datachannel/mdns-ice-candidates.html
2789
2790         Add support at PeerConnectionBackend to obfuscate any gathered host candidate
2791         by replacing the IP address with an opaque name that can be resolved by MDNS.
2792         An opaque name is generated for each IP address and is scoped by the document owning the peer connection object.
2793
2794         Add support to resolve any such MDNS ICE candidate.
2795         A limit of 250 ms is fixed for the resolution to happen.
2796         After 250 ms, the candidate is discarded.
2797
2798         Add an experimental flag around this feature, off by default.
2799
2800         * Modules/mediastream/PeerConnectionBackend.cpp:
2801         (WebCore::extractIPAddres):
2802         (WebCore::PeerConnectionBackend::addIceCandidate):
2803         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
2804         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
2805         (WebCore::PeerConnectionBackend::newICECandidate):
2806         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
2807         (WebCore::PeerConnectionBackend::registerMDNSName):
2808         (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
2809         * Modules/mediastream/PeerConnectionBackend.h:
2810         * Modules/mediastream/RTCIceCandidate.h:
2811         (WebCore::RTCIceCandidate::setCandidate):
2812         * Modules/mediastream/RTCPeerConnection.h:
2813         * dom/Document.cpp:
2814         (WebCore::Document::prepareForDestruction):
2815         (WebCore::Document::suspend):
2816         * page/RuntimeEnabledFeatures.h:
2817         (WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const):
2818         (WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled):
2819         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2820
2821 2018-04-04  Brian Burg  <bburg@apple.com>
2822
2823         [Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
2824         https://bugs.webkit.org/show_bug.cgi?id=184314
2825         <rdar://problem/39186578>
2826
2827         Reviewed by Timothy Hatcher.
2828
2829         Covered by several tests in add_cookie.py per the bug title.
2830
2831         * platform/network/cocoa/CookieCocoa.mm:
2832         (WebCore::Cookie::operator NSHTTPCookie * const):
2833         By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
2834         precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
2835         the truncated value and actual value are the same.
2836
2837 2018-04-04  Alex Christensen  <achristensen@webkit.org>
2838
2839         Move PingHandle to WebKitLegacy
2840         https://bugs.webkit.org/show_bug.cgi?id=184145
2841
2842         Reviewed by Youenn Fablet.
2843
2844         * WebCore.xcodeproj/project.pbxproj:
2845         * platform/network/PingHandle.h: Removed.
2846
2847 2018-04-04  Per Arne Vollan  <pvollan@apple.com>
2848
2849         The layout test fast/canvas/canvas-blending-global-alpha.html is failing when the WebContent process does not have WindowServer access.
2850         https://bugs.webkit.org/show_bug.cgi?id=183752
2851         <rdar://problem/38635731>
2852
2853         The test is failing because the system is only providing software rendering when there is no access
2854         to the WindowServer, and software rendering is producing slightly different results than hardware
2855         rendering. To enable accelerated rendering, the GPU to be used for IOSurface rendering needs to be
2856         selected by handing over the OpenGL display mask to the IOSurface CGContext.
2857
2858         Reviewed by Brent Fulgham.
2859
2860         No new tests, covered by existing tests.
2861
2862         * platform/graphics/GraphicsContext3D.h:
2863         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2864         (WebCore::GraphicsContext3D::getOpenGLDisplayMask):
2865         * platform/graphics/cocoa/IOSurface.mm:
2866         (WebCore::IOSurface::ensurePlatformContext):
2867
2868 2018-04-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2869
2870         Track the paint frequency through a new class named PaintFrequencyTracker
2871         https://bugs.webkit.org/show_bug.cgi?id=184311
2872
2873         Reviewed by Antti Koivisto.
2874
2875         PaintFrequencyTracker is a class which detects when a layer is painted 
2876         frequently. SinglePaintFrequencyTracking is used in conjunction with
2877         PaintFrequencyTracker to recored a single paint timing.
2878
2879         * rendering/PaintFrequencyTracker.h: Added.
2880         (WebCore::PaintFrequencyTracker::begin):
2881         (WebCore::PaintFrequencyTracker::end):
2882         (WebCore::PaintFrequencyTracker::paintingFrequently const):
2883         Simplify the logic for tracking the paint frequency and move it from
2884         RenderLayer.cpp.
2885
2886         (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
2887         (WebCore::SinglePaintFrequencyTracking::~SinglePaintFrequencyTracking):
2888         A convenient way to bracket the begin() and the end() methods of
2889         PaintFrequencyTracker.
2890
2891         * rendering/RenderLayer.cpp:
2892         (WebCore::RenderLayer::paintLayerContents):
2893         (WebCore::RenderLayer::calculateClipRects const):
2894         (WebCore::PaintFrequencyInfo::PaintFrequencyInfo): Deleted.
2895         (WebCore::PaintFrequencyInfo::setPaintedCacheableResource): Deleted.
2896         (WebCore::PaintFrequencyInfo::paintingFrequently const): Deleted.
2897         (WebCore::PaintFrequencyInfo::updatePaintFrequency): Deleted.
2898         (WebCore::PaintFrequencyInfo::paintingCacheableResource): Deleted.
2899         * rendering/RenderLayer.h:
2900         Rename PaintFrequencyInfo to PaintFrequencyTracker and move it a separate
2901         header file.
2902
2903 2018-04-04  Jer Noble  <jer.noble@apple.com>
2904
2905         RELEASE_ASSERT in CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF() when MediaToolbox.framework missing
2906         https://bugs.webkit.org/show_bug.cgi?id=184247
2907         <rdar://problem/39007591>
2908
2909         Rubber-stamped by Eric Carlson.
2910
2911         Use SOFT_LINK_FRAMEWORK_OPTIONAL for frameworks which are not guaranteed to be present.
2912
2913         * page/CaptionUserPreferencesMediaAF.cpp:
2914         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF):
2915
2916 2018-04-04  Brent Fulgham  <bfulgham@apple.com>
2917
2918         Failures from mach port reference handling should be fatal
2919         https://bugs.webkit.org/show_bug.cgi?id=184202
2920         <rdar://problem/37771114>
2921
2922         Reviewed by Anders Carlsson.
2923
2924         We may corrupt the Mach port space by improperly matching the equivalent of reference counting
2925         retains (mach_port_mod_refs) with releases (mach_port_deallocate).
2926
2927         Our current implementation of MachSendRights::create does not grab a reference if the passed
2928         port is MACH_PORT_DEAD, but we unconditionally call mach_port_deallocate on the port, which
2929         could lead to a reference count mismatch.
2930
2931         Likewise, our MachSendRight destructor does not release the port if it has changed to MACH_PORT_DEAD
2932         (e.g., if a child process dies), again leading to a mismatch in retain/releases.
2933
2934         Finally, failures in mach_port_deallocate should be fatal because they indicate that the
2935         application was attempting to remove an unowned right. This is a fatal condition for Mach, and
2936         should lead to an abort. 
2937
2938         This patch does the following:
2939
2940         1. It creates a helper function that does the right thing for safely deallocating a mach port.
2941         2. It uses it in multiple places.
2942         3. It revises 'MachSendRight::create" so that it properly handles the condition of a dead port.
2943         4. It revises the MachSendRight destructor to properly handle the condition of a dead port.
2944
2945         No new tests, no change in behavior expected.
2946
2947         * SourcesCocoa.txt: Update for move of MachSendRight files.
2948         * WebCore.xcodeproj/project.pbxproj: Ditto.
2949         * page/cocoa/ResourceUsageThreadCocoa.mm:
2950         (WebCore::getMachThreads): Added.
2951         (WebCore::cpuUsage): Use the new cleanup helper function.
2952         * platform/cocoa/MachSendRight.cpp: Removed.
2953         * platform/cocoa/MachSendRight.h: Removed.
2954         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
2955         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2956         * platform/graphics/cocoa/IOSurface.h:
2957         * platform/graphics/cocoa/IOSurface.mm:
2958
2959 2018-04-04  Youenn Fablet  <youenn@apple.com>
2960
2961         Remove unused HTTP header names
2962         https://bugs.webkit.org/show_bug.cgi?id=184272
2963
2964         Reviewed by Alex Christensen.
2965
2966         No change of behavior.
2967         Removed some names that are not used in the code base.
2968         This allows to strengthen filtering of responses sent to WebProcess.
2969         Added two headers used by web inspector.
2970         Updated existing code to use indexed HTTP header names.
2971
2972         * html/parser/XSSAuditor.cpp:
2973         (WebCore::XSSAuditor::init):
2974         * inspector/agents/InspectorPageAgent.cpp:
2975         (WebCore::InspectorPageAgent::sourceMapURLForResource):
2976         * platform/network/HTTPHeaderNames.in:
2977
2978 2018-04-04  Beth Dakin  <bdakin@apple.com>
2979
2980         Fix the !HAVE(AVFOUNDATION_VIDEO_OUTPUT) build
2981         https://bugs.webkit.org/show_bug.cgi?id=184309
2982         -and corresponding-
2983         rdar://problem/39179126
2984
2985         Reviewed by Jer Noble.
2986
2987         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2988         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
2989         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2990
2991 2018-04-04  Youenn Fablet  <youenn@apple.com>
2992
2993         MockRealtimeVideoSourceMac should produce kCVPixelFormatType_420YpCbCr8Planar buffers
2994         https://bugs.webkit.org/show_bug.cgi?id=184304
2995
2996         Reviewed by Eric Carlson.
2997
2998         Allows covering RealtimeOutgoingVideoSourceMac code path handling native buffers produced by capture video sources.
2999         ARGB buffer coverage is done through canvas capture streams.
3000
3001         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
3002         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3003         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
3004
3005 2018-04-04  Youenn Fablet  <youenn@apple.com>
3006
3007         Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main thread
3008         https://bugs.webkit.org/show_bug.cgi?id=183988
3009
3010         Reviewed by Darin Adler.
3011
3012         No change of behavior, TrackPrivate remains destroyed on the main thread.
3013
3014         * platform/graphics/TrackPrivateBase.h:
3015         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3016         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3017         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
3018
3019 2018-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3020
3021         Unreviewed. Fix the build with libsoup < 2.49.91 after r230251.
3022
3023         Stop using ResourceHandle in SoupNetworkSession.
3024
3025         * platform/network/soup/SoupNetworkSession.cpp:
3026         (WebCore::SoupNetworkSession::SoupNetworkSession):
3027         (WebCore::authenticateCallback): Deleted.
3028         (WebCore::requestStartedCallback): Deleted.
3029
3030 2018-04-03  Alex Christensen  <achristensen@webkit.org>
3031
3032         Remove unused libsoup ResourceHandle implementation
3033         https://bugs.webkit.org/show_bug.cgi?id=184048
3034
3035         Reviewed by Michael Catanzaro.
3036
3037         This code is unused since r228901 so let's remove it!
3038
3039         * platform/network/ResourceHandle.h:
3040         * platform/network/ResourceHandleInternal.h:
3041         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3042         * platform/network/soup/ResourceHandleSoup.cpp:
3043         (WebCore::ResourceHandle::~ResourceHandle):
3044         (WebCore::ResourceHandleInternal::soupSession):
3045         (WebCore::ResourceHandle::cancelledOrClientless):
3046         (WebCore::ResourceHandle::ensureReadBuffer):
3047         (WebCore::ResourceHandle::currentStreamPosition const):
3048         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
3049         (WebCore::ResourceHandle::didStartRequest):
3050         (WebCore::ResourceHandle::start):
3051         (WebCore::ResourceHandle::releaseForDownload):
3052         (WebCore::ResourceHandle::sendPendingRequest):
3053         (WebCore::ResourceHandle::cancel):
3054         (WebCore::ResourceHandle::shouldUseCredentialStorage):
3055         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
3056         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3057         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3058         (WebCore::ResourceHandle::receivedCredential):
3059         (WebCore::ResourceHandle::receivedCancellation):
3060         (WebCore::ResourceHandle::receivedChallengeRejection):
3061         (WebCore::ResourceHandle::platformSetDefersLoading):
3062         (WebCore::sessionFromContext): Deleted.
3063         (WebCore::ResourceHandle::create): Deleted.
3064         (WebCore::ResourceHandle::ResourceHandle): Deleted.
3065         (WebCore::isAuthenticationFailureStatusCode): Deleted.
3066         (WebCore::tlsErrorsChangedCallback): Deleted.
3067         (WebCore::gotHeadersCallback): Deleted.
3068         (WebCore::applyAuthenticationToRequest): Deleted.
3069         (WebCore::restartedCallback): Deleted.
3070         (WebCore::shouldRedirect): Deleted.
3071         (WebCore::shouldRedirectAsGET): Deleted.
3072         (WebCore::continueAfterWillSendRequest): Deleted.
3073         (WebCore::doRedirect): Deleted.
3074         (WebCore::redirectSkipCallback): Deleted.
3075         (WebCore::wroteBodyDataCallback): Deleted.
3076         (WebCore::cleanupSoupRequestOperation): Deleted.
3077         (WebCore::nextMultipartResponsePartCallback): Deleted.
3078         (WebCore::sendRequestCallback): Deleted.
3079         (WebCore::continueAfterDidReceiveResponse): Deleted.
3080         (WebCore::startingCallback): Deleted.
3081         (WebCore::networkEventCallback): Deleted.
3082         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
3083         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
3084         (WebCore::ResourceHandle::timeoutFired): Deleted.
3085         (WebCore::waitingToSendRequest): Deleted.
3086         (WebCore::readCallback): Deleted.
3087
3088 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
3089
3090         Add missing WEBCORE_EXPORTs (for Windows shared library build)
3091         https://bugs.webkit.org/show_bug.cgi?id=184279
3092
3093         Reviewed by Alex Christensen.
3094
3095         * dom/Element.h:
3096         * dom/Node.h:
3097         * editing/FrameSelection.h:
3098         * html/DOMURL.h:
3099         * html/HTMLFormElement.h:
3100         * html/canvas/CanvasRenderingContext.h:
3101         * platform/graphics/GraphicsContext.h:
3102         * platform/graphics/PlatformDisplay.h:
3103         * platform/graphics/cairo/CairoOperations.h:
3104         * platform/graphics/cairo/GraphicsContextImplCairo.h:
3105         * platform/graphics/texmap/TextureMapperLayer.h:
3106         * platform/network/HTTPHeaderMap.h:
3107         * platform/network/ResourceRequestBase.h:
3108         * platform/network/ResourceResponseBase.h:
3109         * platform/network/curl/AuthenticationChallenge.h:
3110         * platform/network/curl/CurlFormDataStream.h:
3111         * platform/network/curl/CurlRequest.h:
3112         * platform/network/curl/CurlSSLHandle.h:
3113         * platform/network/curl/ResourceError.h:
3114         * platform/network/curl/ResourceResponse.h:
3115
3116 2018-04-03  Youenn Fablet  <youenn@apple.com>
3117
3118         RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
3119         https://bugs.webkit.org/show_bug.cgi?id=184281
3120         rdar://problem/39153262
3121
3122         Reviewed by Jer Noble.
3123
3124         Covered by manual testing by going to WebRTC web sites.
3125
3126         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3127         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
3128
3129 2018-04-03  Filip Pizlo  <fpizlo@apple.com>
3130
3131         GC shouldn't do object distancing
3132         https://bugs.webkit.org/show_bug.cgi?id=184195
3133
3134         Reviewed by Saam Barati.
3135
3136         No new tests because no change in behavior.
3137
3138         * Sources.txt:
3139         * WebCore.xcodeproj/project.pbxproj:
3140         * bindings/js/JSDOMGlobalObject.cpp:
3141         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
3142         * bindings/js/JSDOMGlobalObject.h:
3143         * bindings/js/JSDOMWindowBase.cpp:
3144         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
3145         * dom/Document.cpp:
3146         (WebCore::Document::threadLocalCache): Deleted.
3147         * dom/Document.h:
3148         * page/OriginThreadLocalCache.cpp: Removed.
3149         * page/OriginThreadLocalCache.h: Removed.
3150
3151 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
3152
3153         Guard against keychain/certificate access outside the network process
3154         https://bugs.webkit.org/show_bug.cgi?id=184214
3155         <rdar://problem/38734795>
3156
3157         Reviewed by Youenn Fablet.
3158
3159         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
3160         a non-Networking process.
3161
3162         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
3163         (WebCore::LocalAuthenticator::makeCredential): Assert if we access the keychain from
3164         a proces other than the Network or UI process.
3165         (WebCore::LocalAuthenticator::getAssertion): Ditto.
3166         (WebCore::LocalAuthenticator::issueClientCertificate const): Ditto.
3167         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3168         (WebCore::createAndStoreMasterKey): Ditto.
3169         (WebCore::findMasterKey): Ditto.
3170         (WebCore::deleteDefaultWebCryptoMasterKey): Ditto.
3171         * platform/mac/SSLKeyGeneratorMac.mm:
3172         (WebCore::signedPublicKeyAndChallengeString): Ditto.
3173         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3174         (WebCore::createPrivateStorageSession): Ditto.
3175         * platform/network/mac/ResourceHandleMac.mm:
3176         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto.
3177
3178 2018-04-03  Youenn Fablet  <youenn@apple.com>
3179
3180         NetworkResourceLoader does not need to expose all redirect response headers
3181         https://bugs.webkit.org/show_bug.cgi?id=184114
3182         <rdar://problem/39010557>
3183
3184         Reviewed by Ryosuke Niwa.
3185
3186         No JS observable change of behavior.
3187         Behavior change is observable for injected bundles since they will no longer get access to the full response.
3188         List of response headers correspond to the one currently being used/exposed for redirections.
3189
3190         Test: http/wpt/loading/redirect-headers.html
3191
3192         * page/RuntimeEnabledFeatures.h:
3193         (WebCore::RuntimeEnabledFeatures::setRestrictedHTTPResponseAccess):
3194         (WebCore::RuntimeEnabledFeatures::restrictedHTTPResponseAccess const):
3195         * platform/network/ResourceResponseBase.cpp:
3196         (WebCore::isSafeToKeepRedirectionHeader):
3197         (WebCore::ResourceResponseBase::sanitizeRedirectionHTTPHeaderFields):
3198         * platform/network/ResourceResponseBase.h:
3199
3200 2018-04-03  Andy Estes  <aestes@apple.com>
3201
3202         [Mac] Prioritize file promises over filenames during drag and drop
3203         https://bugs.webkit.org/show_bug.cgi?id=184237
3204         <rdar://problem/38278076>
3205
3206         Reviewed by Wenson Hsieh.
3207
3208         When performing a drag operation where the pasteboard contains both a file path and a file
3209         promise, we have historically preferred to accept the file path. Some versions of Photos.app
3210         will provide both a low-resolution thumbnail as a file path and its high-resolution
3211         counterpart as a file promise when dragging a photo, and our current logic leads us to
3212         choose the low-quality thumbnail.
3213
3214         This patch changes our logic to prefer file promises over file paths. This matches the
3215         behavior of Finder and ensures we accept high-resolution assets from Photos.app.
3216
3217         Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
3218         write a bogus file path to the pasteboard along with the legitimate file promise.
3219
3220         * platform/mac/DragDataMac.mm:
3221         (WebCore::DragData::asFilenames const):
3222         * platform/mac/PasteboardMac.mm:
3223         (WebCore::Pasteboard::read):
3224         (WebCore::Pasteboard::readFilePaths):
3225         * platform/mac/PlatformPasteboardMac.mm:
3226         (WebCore::PlatformPasteboard::numberOfFiles const):
3227
3228 2018-04-03  Mark Lam  <mark.lam@apple.com>
3229
3230         Fix mis-application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro.
3231         https://bugs.webkit.org/show_bug.cgi?id=184276
3232         <rdar://problem/39109543>
3233
3234         Rubber-stamped by Michael Saboff.
3235
3236         * bindings/scripts/CodeGeneratorJS.pm:
3237         (GenerateImplementation):
3238         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3239         (WebCore::toJSNewlyCreated):
3240         * bindings/scripts/test/JS/JSMapLike.cpp:
3241         (WebCore::toJSNewlyCreated):
3242         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3243         (WebCore::toJSNewlyCreated):
3244         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3245         (WebCore::toJSNewlyCreated):
3246         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3247         (WebCore::toJSNewlyCreated):
3248         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3249         (WebCore::toJSNewlyCreated):
3250         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3251         (WebCore::toJSNewlyCreated):
3252         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3253         (WebCore::toJSNewlyCreated):
3254         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3255         (WebCore::toJSNewlyCreated):
3256         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3257         (WebCore::toJSNewlyCreated):
3258         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3259         (WebCore::toJSNewlyCreated):
3260         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3261         (WebCore::toJSNewlyCreated):
3262         * bindings/scripts/test/JS/JSTestException.cpp:
3263         (WebCore::toJSNewlyCreated):
3264         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3265         (WebCore::toJSNewlyCreated):
3266         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3267         (WebCore::toJSNewlyCreated):
3268         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3269         (WebCore::toJSNewlyCreated):
3270         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3271         (WebCore::toJSNewlyCreated):
3272         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3273         (WebCore::toJSNewlyCreated):
3274         * bindings/scripts/test/JS/JSTestIterable.cpp:
3275         (WebCore::toJSNewlyCreated):
3276         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3277         (WebCore::toJSNewlyCreated):
3278         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3279         (WebCore::toJSNewlyCreated):
3280         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3281         (WebCore::toJSNewlyCreated):
3282         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3283         (WebCore::toJSNewlyCreated):
3284         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3285         (WebCore::toJSNewlyCreated):
3286         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3287         (WebCore::toJSNewlyCreated):
3288         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3289         (WebCore::toJSNewlyCreated):
3290         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3291         (WebCore::toJSNewlyCreated):
3292         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3293         (WebCore::toJSNewlyCreated):
3294         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3295         (WebCore::toJSNewlyCreated):
3296         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3297         (WebCore::toJSNewlyCreated):
3298         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3299         (WebCore::toJSNewlyCreated):
3300         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3301         (WebCore::toJSNewlyCreated):
3302         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3303         (WebCore::toJSNewlyCreated):
3304         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3305         (WebCore::toJSNewlyCreated):
3306         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3307         (WebCore::toJSNewlyCreated):
3308         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3309         (WebCore::toJSNewlyCreated):
3310         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3311         (WebCore::toJSNewlyCreated):
3312         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3313         (WebCore::toJSNewlyCreated):
3314         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3315         (WebCore::toJSNewlyCreated):
3316         * bindings/scripts/test/JS/JSTestNode.cpp:
3317         (WebCore::toJSNewlyCreated):
3318         * bindings/scripts/test/JS/JSTestObj.cpp:
3319         (WebCore::toJSNewlyCreated):
3320         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3321         (WebCore::toJSNewlyCreated):
3322         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3323         (WebCore::toJSNewlyCreated):
3324         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3325         (WebCore::toJSNewlyCreated):
3326         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3327         (WebCore::toJSNewlyCreated):
3328         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3329         (WebCore::toJSNewlyCreated):
3330         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3331         (WebCore::toJSNewlyCreated):
3332         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3333         (WebCore::toJSNewlyCreated):
3334         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3335         (WebCore::toJSNewlyCreated):
3336         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3337         (WebCore::toJSNewlyCreated):
3338         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3339         (WebCore::toJSNewlyCreated):
3340         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3341         (WebCore::toJSNewlyCreated):
3342         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3343         (WebCore::toJSNewlyCreated):
3344         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3345         (WebCore::toJSNewlyCreated):
3346         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3347         (WebCore::toJSNewlyCreated):
3348         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3349         (WebCore::toJSNewlyCreated):
3350
3351 2018-04-03  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3352
3353         [CMake] gperf path should be given when WebCore/css/makevalues.pl is executed
3354         https://bugs.webkit.org/show_bug.cgi?id=184224
3355
3356         Reviewed by Konstantin Tokarev.
3357
3358         When a building evironment doens't include a path to gperf,
3359         WebCore/css/makevalue.pl failes due to failing to execute gperf,
3360         so the full path to gperf should be given like WebCore/css/makeprop.pl.
3361
3362         No new tests, no Web-facing behavior change.
3363
3364         * CMakeLists.txt: gperf path is given to css/makevalues.pl.
3365         * css/makevalues.pl: Add an argument to handle a given gperf path.
3366
3367 2018-04-03  Chris Dumez  <cdumez@apple.com>
3368
3369         Drop MainFrame class
3370         https://bugs.webkit.org/show_bug.cgi?id=184191
3371
3372         Reviewed by Darin Adler.
3373
3374         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
3375         relationship between the Page and the MainFrame.
3376
3377         This is ground work for introducing LocalFrame / RemoteFrame concepts.
3378
3379         * Modules/applepay/ApplePaySession.cpp:
3380         (WebCore::ApplePaySession::create):
3381         (WebCore::ApplePaySession::supportsVersion):
3382         (WebCore::ApplePaySession::canMakePayments):
3383         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
3384         (WebCore::ApplePaySession::openPaymentSetup):
3385         (WebCore::ApplePaySession::paymentCoordinator const):
3386         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3387         (WebCore::paymentCoordinator):
3388         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
3389         * Modules/mediastream/UserMediaRequest.cpp:
3390         * Modules/plugins/QuickTimePluginReplacement.mm:
3391         * Sources.txt:
3392         * Web