1 2018-04-16 Pablo Saavedra <psaavedra@igalia.com>
3 Inconsistent EGL defines in ImageBufferCairo
4 https://bugs.webkit.org/show_bug.cgi?id=184661
6 Reviewed by Žan Doberšek.
8 On revision r219391 libepoxy is added. The headers in
9 ImageBufferCairo.cpp become inconsistent when 2D canvas is enabled
10 (-DENABLE_ACCELERATED_2D_CANVAS=ON) due to a redefinition error during
14 /usr/include/GLES2/gl2.h:503:82: error: 'voi
15 epoxy_glAttachShader(GLuint, GLuint)' redeclared as different kind
17 GL_APICALL void GL_APIENTRY glAttachShader (GLuint
18 program, GLuint shader);
22 * platform/graphics/cairo/ImageBufferCairo.cpp:
24 2018-04-16 Filip Pizlo <fpizlo@apple.com>
26 MutationObserver should be in an IsoHeap
27 https://bugs.webkit.org/show_bug.cgi?id=184671
28 <rdar://problem/36081981>
30 Reviewed by Sam Weinig.
32 No new tests because no new behavior.
34 * dom/MutationObserver.cpp:
35 * dom/MutationObserver.h:
37 2018-04-16 Youenn Fablet <youenn@apple.com>
39 Use NetworkLoadChecker to handle synchronous HTTP loads
40 https://bugs.webkit.org/show_bug.cgi?id=184240
42 Reviewed by Chris Dumez.
44 Update LoaderStrategy::loadResourceSynchronously to pass FetchOptions directly.
45 Update various call sites accordingly. This allows NetworkProcess to do all necessary checks.
46 Add an option to disable security checks if NetworkProcess does it for WebProcess.
47 This option will be also used for regular asynchronous loads in future patches.
49 Update DocumentThreadableLoader to bypass preflighting and response validation checks in case they are done in NetworkProcess.
51 Covered by existing and rebased tests.
53 * loader/CrossOriginPreflightChecker.cpp:
54 (WebCore::CrossOriginPreflightChecker::doPreflight):
55 * loader/DocumentThreadableLoader.cpp:
56 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
57 (WebCore::DocumentThreadableLoader::loadRequest):
58 * loader/FrameLoader.cpp:
59 (WebCore::FrameLoader::loadResourceSynchronously):
60 * loader/FrameLoader.h:
61 * loader/LoaderStrategy.h:
62 * xml/XSLTProcessorLibxslt.cpp:
63 (WebCore::docLoaderFunc):
64 * xml/parser/XMLDocumentParserLibxml2.cpp:
67 2018-04-16 Christopher Reid <chris.reid@sony.com>
69 [WinCairo] Media elements should be enabled by default
70 https://bugs.webkit.org/show_bug.cgi?id=184597
72 Reviewed by Per Arne Vollan.
74 Enabling media elements by default with media foundation.
76 * page/SettingsDefaultValues.h:
78 2018-04-16 Christopher Reid <chris.reid@sony.com>
80 [Curl] Add the Accept-Language field to curl request headers
81 https://bugs.webkit.org/show_bug.cgi?id=184605
83 Reviewed by Alex Christensen.
85 Add Accept-Language field to curl request headers
87 * platform/network/curl/CurlRequest.cpp:
88 * platform/network/curl/CurlRequest.h:
90 2018-04-16 Chris Dumez <cdumez@apple.com>
92 Move more WindowProxy-related logic from ScriptController to WindowProxyController
93 https://bugs.webkit.org/show_bug.cgi?id=184640
95 Reviewed by Ryosuke Niwa.
97 Move more WindowProxy-related logic from ScriptController to WindowProxyController,
100 * bindings/js/JSDOMWindowProxy.cpp:
101 (WebCore::JSDOMWindowProxy::attachDebugger):
102 * bindings/js/JSDOMWindowProxy.h:
103 * bindings/js/ScriptCachedFrameData.cpp:
104 (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
105 (WebCore::ScriptCachedFrameData::restore):
106 * bindings/js/ScriptController.cpp:
107 (WebCore::ScriptController::~ScriptController):
108 (WebCore::ScriptController::initScriptForWindowProxy):
109 * bindings/js/ScriptController.h:
110 (WebCore::ScriptController::existingCacheableBindingRootObject const):
111 * bindings/js/WindowProxyController.cpp:
112 (WebCore::collectGarbageAfterWindowProxyDestruction):
113 (WebCore::WindowProxyController::~WindowProxyController):
114 (WebCore::WindowProxyController::clearWindowProxiesNotMatchingDOMWindow):
115 (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
116 (WebCore::WindowProxyController::attachDebugger):
117 * bindings/js/WindowProxyController.h:
118 * loader/FrameLoader.cpp:
119 (WebCore::FrameLoader::clear):
121 (WebCore::Page::setDebugger):
123 2018-04-16 Thibault Saunier <tsaunier@igalia.com>
125 [GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select in constructor
126 https://bugs.webkit.org/show_bug.cgi?id=184652
128 Reviewed by Philippe Normand.
130 In the constructor we should mark selected streams based on the default values from GstStream,
131 if the user changes them, they will be updated as required later on.
133 No new tests are added as we already have a few ones that are currently disabled in
134 the mediastream testsuite. This patch is part of the work to enable them.
136 * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
137 (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
138 * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
139 (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
141 2018-04-16 Thibault Saunier <tsaunier@igalia.com>
143 [GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client is avalaible
144 https://bugs.webkit.org/show_bug.cgi?id=184651
146 Reviewed by Philippe Normand.
148 We can't notify the client if none is connected, but still we need to fill our metadatas from
149 the provided GstTagList, especially in the case of playbin3 where the client is not set yet
150 at construct time but the metadata might already be preset (and won't be updated later on).
152 No new tests are added as we already have a few ones that are currently disabled in
153 the mediastream testsuite. This patch is part of the work to enable them.
155 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
156 (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
158 2018-04-16 Antoine Quint <graouts@apple.com>
160 [Web Animations] Ensure we never return -0 through the API
161 https://bugs.webkit.org/show_bug.cgi?id=184644
163 Reviewed by Dean Jackson.
165 We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
166 This would happen when playbackRate < 0.
168 * animation/WebAnimationUtilities.h:
169 (WebCore::secondsToWebAnimationsAPITime):
171 2018-04-15 Antoine Quint <graouts@apple.com>
173 [Web Animations] Animations do not naturally get a finish event
174 https://bugs.webkit.org/show_bug.cgi?id=184639
175 <rdar://problem/39397649>
179 We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
180 and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
181 set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
182 the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
183 they will keep being scheduled in a loop.
185 * animation/WebAnimation.cpp:
186 (WebCore::WebAnimation::timeToNextRequiredTick const):
187 (WebCore::WebAnimation::resolve):
189 2018-04-15 Chris Dumez <cdumez@apple.com>
191 Change Event's returnValue so it doesn't expose a new primitive
192 https://bugs.webkit.org/show_bug.cgi?id=184415
194 Reviewed by Darin Adler.
196 Update Event.returnValue setter to match the latest DOM specification after:
197 - https://github.com/whatwg/dom/pull/626
199 In particular, the returnValue setter is now a no-op if the new flag value
200 is true. If the input flag value is false, it only sets the 'canceled' flag
201 if the event is cancelable and the event’s in passive listener flag is unset.
203 Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html
206 (WebCore::Event::setLegacyReturnValue):
207 (WebCore::Event::setCanceledFlagIfPossible):
208 (WebCore::Event::preventDefault):
211 2018-04-14 Thibault Saunier <tsaunier@igalia.com>
213 [GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
214 https://bugs.webkit.org/show_bug.cgi?id=184620
216 Reviewed by Philippe Normand.
218 This is a minor change, a dedicated test doesn't really make sense here.
220 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
221 (WebCore::TrackPrivateBaseGStreamer::stream):
223 2018-04-13 Ryosuke Niwa <rniwa@webkit.org>
225 WebKit crashes when libwebrtc.dylib is missing
226 https://bugs.webkit.org/show_bug.cgi?id=184607
228 Rubber-stamped by Jer Noble.
230 Don't call LibWebRTC related code when libwebrtc is not available.
233 (WebCore::Document::prepareForDestruction):
234 (WebCore::Document::suspend):
236 2018-04-13 Chris Dumez <cdumez@apple.com>
238 Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
239 https://bugs.webkit.org/show_bug.cgi?id=184591
241 Reviewed by Sam Weinig.
243 Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
244 RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
245 This is work towards fixing Bug 184515.
248 * WebCore.xcodeproj/project.pbxproj:
249 * bindings/js/DOMWrapperWorld.cpp:
250 (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
251 (WebCore::DOMWrapperWorld::clearWrappers):
252 * bindings/js/DOMWrapperWorld.h:
253 (WebCore::DOMWrapperWorld::didCreateWindowProxy):
254 (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
255 * bindings/js/JSBindingsAllInOne.cpp:
256 * bindings/js/JSDOMWindowBase.cpp:
257 (WebCore::toJSDOMWindow):
258 * bindings/js/JSDOMWindowProxy.cpp:
260 (WebCore::toJSDOMWindowProxy):
261 * bindings/js/ScriptCachedFrameData.cpp:
262 (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
263 (WebCore::ScriptCachedFrameData::restore):
264 * bindings/js/ScriptController.cpp:
265 (WebCore::ScriptController::~ScriptController):
266 (WebCore::ScriptController::evaluateInWorld):
267 (WebCore::ScriptController::loadModuleScriptInWorld):
268 (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
269 (WebCore::ScriptController::evaluateModule):
270 (WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
271 (WebCore::ScriptController::setDOMWindowForWindowProxy):
272 (WebCore::ScriptController::initScriptForWindowProxy):
273 (WebCore::ScriptController::setupModuleScriptHandlers):
274 (WebCore::ScriptController::windowProxyController):
275 (WebCore::ScriptController::enableEval):
276 (WebCore::ScriptController::enableWebAssembly):
277 (WebCore::ScriptController::disableEval):
278 (WebCore::ScriptController::disableWebAssembly):
279 (WebCore::ScriptController::attachDebugger):
280 (WebCore::ScriptController::updateDocument):
281 (WebCore::ScriptController::collectIsolatedContexts):
282 (WebCore::ScriptController::windowScriptNPObject):
283 (WebCore::ScriptController::executeIfJavaScriptURL):
284 * bindings/js/ScriptController.h:
285 (WebCore::ScriptController::globalObject):
286 * bindings/js/ScriptControllerMac.mm:
287 (WebCore::ScriptController::windowScriptObject):
288 * bindings/js/ScriptState.cpp:
289 (WebCore::mainWorldExecState):
290 * bindings/js/WindowProxyController.cpp: Added.
291 (WebCore::WindowProxyController::WindowProxyController):
292 (WebCore::WindowProxyController::destroyWindowProxy):
293 (WebCore::WindowProxyController::createWindowProxy):
294 (WebCore::WindowProxyController::windowProxies):
295 (WebCore::WindowProxyController::createWindowProxyWithInitializedScript):
296 * bindings/js/WindowProxyController.h: Added.
297 (WebCore::WindowProxyController::releaseWindowProxies):
298 (WebCore::WindowProxyController::setWindowProxies):
299 (WebCore::WindowProxyController::windowProxy):
300 (WebCore::WindowProxyController::existingWindowProxy const):
301 (WebCore::WindowProxyController::globalObject):
302 * loader/FrameLoader.cpp:
303 (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
304 * page/AbstractFrame.cpp:
305 (WebCore::AbstractFrame::AbstractFrame):
306 * page/AbstractFrame.h:
307 (WebCore::AbstractFrame::windowProxyController):
308 (WebCore::AbstractFrame::windowProxyController const):
310 2018-04-13 Brady Eidson <beidson@apple.com>
312 Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
313 https://bugs.webkit.org/show_bug.cgi?id=184559
315 Reviewed by Alex Christensen.
317 Covered by new API test.
319 WebCore changes rework the meaning of a "ForSuspension" policy to simply navigate the page to about:blank.
321 * loader/DocumentLoader.cpp:
322 (WebCore::DocumentLoader::redirectReceived):
323 (WebCore::DocumentLoader::willSendRequest):
324 (WebCore::DocumentLoader::startLoadingMainResource):
325 * loader/DocumentLoader.h:
327 * loader/FrameLoader.cpp:
328 (WebCore::FrameLoader::init):
329 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
331 2018-04-13 Chris Dumez <cdumez@apple.com>
333 input.webkitEntries does not work as expected when folder contains accented chars
334 https://bugs.webkit.org/show_bug.cgi?id=184517
335 <rdar://problem/39265537>
337 Reviewed by Alex Christensen.
339 Use String::fromUTF8() to construct a WTF String from the char* returned by
340 dirname() in FileSystem::directoryName(). Previously, we were just calling
341 the String constructor, which would treat the input as latin 1 instead of
344 Change is covered by an API test rather than a layout test due to file versioning
347 * platform/posix/FileSystemPOSIX.cpp:
348 (WebCore::FileSystem::directoryName):
350 2018-04-13 Yusuke Suzuki <utatane.tea@gmail.com>
352 [WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
353 https://bugs.webkit.org/show_bug.cgi?id=184401
355 Rubber stamped by Saam Barati.
357 Apply bug 183970 changes to WebCore JS too. This offers solid type checking
358 with @getByIdDirectPrivate().
360 * Modules/mediastream/RTCPeerConnection.js:
361 (initializeRTCPeerConnection):
365 * Modules/mediastream/RTCPeerConnectionInternals.js:
366 (isRTCPeerConnection):
367 * Modules/streams/ReadableByteStreamController.js:
371 (getter.byobRequest):
372 * Modules/streams/ReadableByteStreamInternals.js:
373 (privateInitializeReadableStreamBYOBReader):
374 (privateInitializeReadableByteStreamController):
375 (privateInitializeReadableStreamBYOBRequest):
376 (isReadableByteStreamController):
377 (isReadableStreamBYOBRequest):
378 (isReadableStreamBYOBReader):
379 (readableByteStreamControllerCancel):
380 (readableByteStreamControllerError):
381 (readableByteStreamControllerClose):
382 (readableByteStreamControllerClearPendingPullIntos):
383 (readableByteStreamControllerGetDesiredSize):
384 (readableStreamHasBYOBReader):
385 (readableStreamHasDefaultReader):
386 (readableByteStreamControllerHandleQueueDrain):
387 (readableByteStreamControllerPull):
388 (readableByteStreamControllerShouldCallPull):
389 (readableByteStreamControllerCallPullIfNeeded):
390 (readableByteStreamControllerEnqueue):
391 (readableByteStreamControllerEnqueueChunk):
392 (readableByteStreamControllerRespondWithNewView):
393 (readableByteStreamControllerRespond):
394 (readableByteStreamControllerRespondInternal):
395 (readableByteStreamControllerRespondInReadableState):
396 (readableByteStreamControllerRespondInClosedState):
397 (readableByteStreamControllerProcessPullDescriptors):
398 (readableByteStreamControllerFillDescriptorFromQueue):
399 (readableByteStreamControllerShiftPendingDescriptor):
400 (readableByteStreamControllerInvalidateBYOBRequest):
401 (readableByteStreamControllerCommitDescriptor):
402 (readableStreamFulfillReadIntoRequest):
403 (readableByteStreamControllerPullInto):
404 (readableStreamAddReadIntoRequest):
405 * Modules/streams/ReadableStream.js:
406 (initializeReadableStream):
408 * Modules/streams/ReadableStreamBYOBReader.js:
413 * Modules/streams/ReadableStreamBYOBRequest.js:
415 (respondWithNewView):
417 * Modules/streams/ReadableStreamDefaultController.js:
419 * Modules/streams/ReadableStreamDefaultReader.js:
424 * Modules/streams/ReadableStreamInternals.js:
425 (privateInitializeReadableStreamDefaultReader):
426 (readableStreamReaderGenericInitialize):
427 (readableStreamDefaultControllerError):
428 (readableStreamPipeTo):
431 (isReadableStreamDefaultReader):
432 (isReadableStreamDefaultController):
433 (readableStreamError):
434 (readableStreamDefaultControllerCallPullIfNeeded):
435 (readableStreamDefaultControllerGetDesiredSize):
436 (readableStreamReaderGenericCancel):
437 (readableStreamCancel):
438 (readableStreamDefaultControllerCancel):
439 (readableStreamDefaultControllerPull):
440 (readableStreamDefaultControllerClose):
441 (readableStreamClose):
442 (readableStreamFulfillReadRequest):
443 (readableStreamDefaultReaderRead):
444 (readableStreamAddReadRequest):
445 (isReadableStreamDisturbed):
446 (readableStreamReaderGenericRelease):
447 (readableStreamDefaultControllerCanCloseOrEnqueue):
448 (privateInitializeReadableStreamDefaultController): Deleted.
449 * Modules/streams/StreamInternals.js:
450 (validateAndNormalizeQueuingStrategy):
451 * Modules/streams/WritableStream.js:
452 (initializeWritableStream):
459 * Modules/streams/WritableStreamInternals.js:
461 (syncWritableStreamStateWithQueue):
462 (errorWritableStream):
463 (callOrScheduleWritableStreamAdvanceQueue):
464 * bindings/js/JSDOMBindingInternals.js:
467 2018-04-12 Antoine Quint <graouts@apple.com>
469 [Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
470 https://bugs.webkit.org/show_bug.cgi?id=184569
471 <rdar://problem/38671301>
475 We now set the CSS Animations and CSS Transitions as Web Animations flag on by default. To ensure that some remaining
476 tests pass with this flag on, we expose a way to get to a PseudoElement via a new internals.pseudoElement() method. This
477 allows tests that used internals.pauseAnimationAtTimeOnPseudoElement() and internals.pauseTransitionAtTimeOnPseudoElement()
478 to now work with the Web Animations API.
480 * page/RuntimeEnabledFeatures.h:
481 * testing/Internals.cpp:
482 (WebCore::Internals::pseudoElement):
483 * testing/Internals.h:
484 * testing/Internals.idl:
486 2018-04-13 Sergio Villar Senin <svillar@igalia.com>
488 [WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
489 https://bugs.webkit.org/show_bug.cgi?id=184530
491 Reviewed by Žan Doberšek.
493 WebVR apps should invoke requestPresent() to start presenting contents of a VRLayerInit
494 (right now a HTML canvas with a WebGL context) on the VRDisplay. This request might fail for
495 a variety of reasons and can be eventually cancelled with exitPresent(). Once we are
496 presenting we could access the presenting layers (right now just one) with getLayers().
498 Note that we are not presenting anything to the HMD yet, that will be done later in a follow
501 I took the chance to correct a mistak in the VRDisplayCapabilities object which has a method
502 that should be called maxLayers instead of maxLayer.
504 * Modules/webvr/VRDisplay.cpp:
505 (WebCore::VRDisplay::requestPresent):
506 (WebCore::VRDisplay::stopPresenting):
507 (WebCore::VRDisplay::exitPresent):
508 (WebCore::VRDisplay::getLayers const):
509 (WebCore::VRDisplay::isPresenting const): Deleted. Implemented in the header file.
510 * Modules/webvr/VRDisplay.h:
511 (WebCore::VRDisplay::isPresenting const):
512 * Modules/webvr/VRDisplayCapabilities.h:
513 (WebCore::VRDisplayCapabilities::maxLayers const): Renamed from maxLayer().
514 (WebCore::VRDisplayCapabilities::maxLayer const): Deleted.
515 * Modules/webvr/VRDisplayCapabilities.idl:
517 2018-04-13 Miguel Gomez <magomez@igalia.com>
519 REGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non AC mode
520 https://bugs.webkit.org/show_bug.cgi?id=184583
522 Reviewed by Carlos Garcia Campos.
524 In non AC mode, ensure that a deadlock can't happen when destroying MediaPlayerPrivateGStreamerBase.
526 Covered by existent tests.
528 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
529 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
530 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
531 (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
532 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
534 2018-04-13 Miguel Gomez <magomez@igalia.com>
536 [GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
537 https://bugs.webkit.org/show_bug.cgi?id=183362
539 Reviewed by Carlos Garcia Campos.
541 Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed.
542 That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which
543 can be used to handle the pause event without avoiding future renderings. Also cancelRepaint()
544 has only effect when not in AC mode.
546 Covered by existent tests.
548 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
549 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
550 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
551 (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
552 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
554 2018-04-13 Xabier Rodriguez Calvar <calvaris@igalia.com>
556 [GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
557 https://bugs.webkit.org/show_bug.cgi?id=184533
559 Reviewed by Philippe Normand.
561 Renamed GStreamerUtilities* files into GStreamerCommon* and
562 modified files including them accordingly. Include
563 GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
564 to avoid problems destroying objects when those files are
565 forgotten to be included.
567 * Modules/webaudio/AudioContext.cpp:
568 * platform/GStreamer.cmake:
569 * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
570 * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
571 * platform/graphics/gstreamer/GStreamerCommon.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp.
572 * platform/graphics/gstreamer/GStreamerCommon.h: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h.
573 * platform/graphics/gstreamer/ImageGStreamer.h:
574 * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
575 * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
576 * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
577 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
578 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
579 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
580 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
581 * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
582 * platform/graphics/gstreamer/MediaSampleGStreamer.h:
583 * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
584 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
585 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
586 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
587 * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
588 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
589 * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
590 * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
591 * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
592 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
593 * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
594 * platform/graphics/gstreamer/mse/AppendPipeline.h:
595 * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
596 * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h:
597 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
598 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
599 * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
600 * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
601 * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
602 * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
603 * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
605 2018-04-12 Christopher Reid <chris.reid@sony.com>
607 [Curl] Fix clang build error in CurlContext.cpp
608 https://bugs.webkit.org/show_bug.cgi?id=184561
610 Reviewed by Darin Adler.
612 MSVC allows explicit template specialization in classes but gcc/clang do not.
614 * platform/network/curl/CurlContext.cpp:
616 2018-04-12 Christopher Reid <chris.reid@sony.com>
618 [Curl] Cookie Database on memory path should be :memory:
619 https://bugs.webkit.org/show_bug.cgi?id=184572
621 Reviewed by Alex Christensen.
623 CookieJarDB::isOnMemory is comparing the database path with :onmemory: but it should be using :memory:
624 For reference, see: https://www.sqlite.org/inmemorydb.html
626 * platform/network/curl/CookieJarDB.h:
628 2018-04-12 Daniel Bates <dabates@apple.com>
630 Attmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
631 (https://bugs.webkit.org/show_bug.cgi?id=184386)
633 Visual Studio cannot prove that all cases in the switch are covered :(
634 So, add an ASSERT_NOT_REACHED() and a return a value outside of the switch block.
636 * loader/cache/CachedResourceLoader.cpp:
637 (WebCore::destinationForType):
639 2018-04-12 Chris Dumez <cdumez@apple.com>
641 Introduce remote variants of Frame / DOMWindow classes
642 https://bugs.webkit.org/show_bug.cgi?id=184467
643 <rdar://problem/39011267>
645 Reviewed by Ryosuke Niwa.
647 Introduce remote variants of Frame / DOMWindow classes, for when these frames / windows
648 are hosted on another WebProcess. Those will be used in a follow-up patch.
650 The hierarchy is as follows (class naming will be improved in a follow-up patch to minimise
652 - AbstractFrame: A frame that can be either local or remote (hosted on another WebProcess)
653 - Frame: A local frame
654 - RemoteFrame: A frame hosted on another WebProcess. A RemoteFrame's window is also remote.
655 - AbstractDOMWindow: A window that be either local or remote (hosted on another WebProcess)
656 - DOMWindow: A local DOMWindow
657 - RemoteDOMWindow: A window hosted on another WebProcess. A RemoteDOMWindow's frame is also
658 remote. A RemoteDOMWindow is always cross-origin.
660 This patch introduces global identifiers (unique across all WebProcesses) for both Frames and
661 Windows. This is useful as we need to know which Frame / DOMWindow a particular RemoteFrame /
662 RemoteDOMWindow is pointing to.
664 Follow-up patch will add support for converting a local DOMWindow / Frame into a remote ones,
665 when a newly opened window (via window.open) is navigated cross-origin (Bug 184515).
667 Other things we'll need to implement in follow-ups:
668 - RemoteDOMWindow will need to know about its opener in order to support the window.opener
669 API. Internally, the opener will be stored as a RemoteFrame so that window.opener always
670 returns the current window in the opener frame (which changes upon navigation).
671 - Nullify a RemoteDOMWindow's frame whenever the window it is pointing to becomes frameless.
672 A frameless window behaves very differently (e.g. very little API is exposed to the Web).
673 This happens when either the newly opened window is either closed or navigated.
676 * WebCore.xcodeproj/project.pbxproj:
677 * loader/ContentFilter.cpp:
678 (WebCore::ContentFilter::didDecide):
679 * page/AbstractDOMWindow.cpp: Added.
680 (WebCore::AbstractDOMWindow::AbstractDOMWindow):
681 (WebCore::AbstractDOMWindow::~AbstractDOMWindow):
682 * page/AbstractDOMWindow.h: Added.
683 (WebCore::AbstractDOMWindow::identifier const):
684 * page/AbstractFrame.cpp: Added.
685 (WebCore::AbstractFrame::AbstractFrame):
686 (WebCore::AbstractFrame::~AbstractFrame):
687 * page/AbstractFrame.h: Added.
688 (WebCore::AbstractFrame::window const):
689 * page/DOMWindow.cpp:
690 (WebCore::DOMWindow::DOMWindow):
694 (WebCore::Frame::window const):
695 (WebCore::Frame::virtualWindow const):
698 * page/GlobalFrameIdentifier.h: Added.
699 (WebCore::GlobalFrameIdentifier::encode const):
700 (WebCore::GlobalFrameIdentifier::decode):
701 * page/GlobalWindowIdentifier.h: Added.
702 (WebCore::operator==):
703 (WebCore::GlobalWindowIdentifier::hash const):
704 (WebCore::GlobalWindowIdentifier::encode const):
705 (WebCore::GlobalWindowIdentifier::decode):
706 (WTF::GlobalWindowIdentifierHash::hash):
707 (WTF::GlobalWindowIdentifierHash::equal):
708 (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::emptyValue):
709 (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::constructDeletedValue):
710 (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::isDeletedValue):
712 * page/RemoteDOMWindow.cpp: Added.
713 (WebCore::RemoteDOMWindow::RemoteDOMWindow):
714 (WebCore::RemoteDOMWindow::~RemoteDOMWindow):
715 (WebCore::RemoteDOMWindow::self const):
716 (WebCore::RemoteDOMWindow::location const):
717 (WebCore::RemoteDOMWindow::close):
718 (WebCore::RemoteDOMWindow::closed const):
719 (WebCore::RemoteDOMWindow::focus):
720 (WebCore::RemoteDOMWindow::blur):
721 (WebCore::RemoteDOMWindow::length const):
722 (WebCore::RemoteDOMWindow::top const):
723 (WebCore::RemoteDOMWindow::opener const):
724 (WebCore::RemoteDOMWindow::parent const):
725 (WebCore::RemoteDOMWindow::postMessage):
726 The DOM API exposed on RemoteDOMWindow is only the subset of the DOMWindow API that is exposed cross origin,
727 since remote DOMWindow are always from a different origin. The short-term plan is to implement these in a
728 follow-up by relying on IPC (synchronous when necessary) to fetch the information from the real window in
729 the WebProcess where it lives. Longer term, we should probably keep RemoteDOMWindow members in sync with the
730 DOMWindow they're pointing to, so we do not have to rely on synchronous IPC.
732 * page/RemoteDOMWindow.h: Added.
734 * page/RemoteFrame.cpp: Added.
735 (WebCore::RemoteFrame::RemoteFrame):
736 (WebCore::RemoteFrame::~RemoteFrame):
737 (WebCore::RemoteFrame::virtualWindow const):
738 * page/RemoteFrame.h: Added.
741 2018-04-12 Daniel Bates <dabates@apple.com>
743 Content-Type not enforced for <script> allows for XSS
744 https://bugs.webkit.org/show_bug.cgi?id=184386
745 <rdar://problem/39112268>
747 Reviewed by Brady Eidson.
749 As per the Fetch standard, <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?> (16 March 2018),
750 we should block JavaScript scripts that are served with MIME type text/csv, or a MIME type
751 that begins with "audio/", "image/" or "video/".
753 As a side benefit of this change we now set the destination property [1] on preload requests.
755 [1] <https://fetch.spec.whatwg.org/#concept-request-destination>
757 Tests: http/tests/security/script-with-banned-mimetype.html
758 http/tests/workers/worker-importScripts-banned-mimetype.html
760 * Sources.txt: Add file FetchIdioms.cpp.
761 * WebCore.xcodeproj/project.pbxproj: Add files FetchIdioms.{cpp, h}.
762 * dom/LoadableClassicScript.cpp:
763 (WebCore::LoadableClassicScript::notifyFinished): Check the MIME type of the response and
764 block the script if applicable.
765 * dom/LoadableScript.h: Add error type MIMEType.
766 * loader/FetchIdioms.cpp: Added.
767 (WebCore::shouldBlockResponseDueToMIMEType): Implements the "Should response to request be blocked
768 due to its MIME type?" algorithm from the Fetch standard.
769 * loader/FetchIdioms.h: Added.
770 * loader/FetchOptions.h:
771 (WebCore::isScriptLikeDestination): Implements the definition of "script like" as per <https://fetch.spec.whatwg.org/#request-destination-script-like>.
772 * loader/cache/CachedResourceLoader.cpp:
773 (WebCore::CachedResourceLoader::requestImage): Removed logic to set the destination property as
774 CachedResourceLoader::requestResource() is now responsible for doing this.
775 (WebCore::CachedResourceLoader::requestFont): Ditto.
776 (WebCore::CachedResourceLoader::requestTextTrack): Ditto.
777 (WebCore::CachedResourceLoader::requestCSSStyleSheet): Ditto.
778 (WebCore::CachedResourceLoader::requestScript): Ditto.
779 (WebCore::CachedResourceLoader::requestXSLStyleSheet): Ditto.
780 (WebCore::CachedResourceLoader::requestMedia): Update comment to express that we should assert
781 that the destination property is either video or audio.
782 (WebCore::CachedResourceLoader::requestIcon): Remove logic to set the destination property as
783 CachedResourceLoader::requestResource() is now responsible for doing this.
784 (WebCore::CachedResourceLoader::requestRawResource): Removed assertion as this function is used to
785 load many kinds of requests that have different destination properties. The caller is responsible
786 for setting the appropriate destintion property.
787 (WebCore::CachedResourceLoader::requestMainResource): Remove logic to set the destination property
788 as CachedResourceLoader::requestResource() is now responsible for doing this.
789 (WebCore::destinationForType): Helper function that maps CachedResource::Type to FetchOptions::Destination.
790 (WebCore::CachedResourceLoader::requestResource): Set the destination property on the request if not
792 * loader/cache/CachedResourceLoader.h: Segregate requestRawResource() from the other request functions
793 and add a comment to explain what it is used for.
794 * workers/Worker.cpp:
795 (WebCore::Worker::create):
796 * workers/WorkerScriptLoader.cpp:
797 (WebCore::WorkerScriptLoader::loadSynchronously): Set the destination property to FetchOptions::Destination::Script
798 and store it in an instance variable as we will need to reference it once we receive the HTTP response.
799 Note that this function is only used to support the Web API importScripts().
800 (WebCore::WorkerScriptLoader::loadAsynchronously): Store the passed destination property in an
801 instance as we will need to reference it once we receive the HTTP response.
802 (WebCore::WorkerScriptLoader::didReceiveResponse): Check the MIME type of the response and
803 block the script if applicable.
804 * workers/WorkerScriptLoader.h:
805 * workers/service/ServiceWorkerJob.cpp:
806 (WebCore::ServiceWorkerJob::fetchScriptWithContext): Set the destination property to FetchOptions::Destination::Serviceworker.
808 2018-04-12 Antoine Quint <graouts@apple.com>
810 [Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
811 https://bugs.webkit.org/show_bug.cgi?id=184555
813 Reviewed by Dean Jackson.
815 A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
816 tests to fail when expressed as Web Animations.
818 * animation/AnimationTimeline.cpp:
819 (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
820 since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
822 (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
823 a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
824 (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
825 once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
826 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
827 start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
828 for this property already running, use that animation's original unanimated style as the from value.
829 * animation/AnimationTimeline.h:
830 * animation/CSSAnimation.cpp:
831 (WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
832 (WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
833 get it when a CSS Transition is created and takes precedence over this CSS Animation.
834 (WebCore::CSSAnimation::initialize): Deleted.
835 * animation/CSSAnimation.h:
836 * animation/CSSTransition.cpp:
837 (WebCore::CSSTransition::create):
838 (WebCore::CSSTransition::initialize):
839 * animation/CSSTransition.h:
840 * animation/DeclarativeAnimation.cpp:
841 (WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
842 directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
843 before timing properties are set based on the backing animation.
844 * animation/DeclarativeAnimation.h:
845 * animation/KeyframeEffectReadOnly.cpp:
846 (WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
847 (WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
848 (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
849 instead of a default RenderStyle which would not use the right values for implicit keyframes.
850 (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
851 the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
853 (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
854 last keyframes to always have the property listed since the underlying style was provided and should be captured.
855 * animation/KeyframeEffectReadOnly.h:
856 * style/StyleTreeResolver.cpp:
857 (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.
859 2018-04-12 Antoine Quint <graouts@apple.com>
861 [Web Animations] Only cancel declarative animations upon element removal
862 https://bugs.webkit.org/show_bug.cgi?id=184553
864 Reviewed by Dean Jackson.
866 Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
867 the ready promise and produce spurious logging from WPT tests.
869 * animation/AnimationTimeline.cpp:
870 (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
871 (WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
872 * animation/AnimationTimeline.h:
874 (WebCore::Element::removedFromAncestor):
875 * dom/PseudoElement.cpp:
876 (WebCore::PseudoElement::clearHostElement):
877 * rendering/updating/RenderTreeUpdater.cpp:
878 (WebCore::RenderTreeUpdater::tearDownRenderers):
880 2018-04-12 Ryan Haddad <ryanhaddad@apple.com>
882 Unreviewed, rolling out r230554.
884 The non-ASCII character in the filename causes issues with SVN
888 "input.webkitEntries does not work as expected when folder
889 contains accented chars"
890 https://bugs.webkit.org/show_bug.cgi?id=184517
891 https://trac.webkit.org/changeset/230554
893 2018-04-12 Alicia Boya García <aboya@igalia.com>
895 [MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
896 https://bugs.webkit.org/show_bug.cgi?id=180253
898 Right now it's checked that start <= end but it's not checked that
899 neither of them is undefined.
901 When this happens, the bug can be hard to track down.
903 The assertion is not enabled for Mac because there is currently a test
906 Reviewed by Jer Noble.
908 * platform/graphics/PlatformTimeRanges.cpp:
909 (WebCore::PlatformTimeRanges::add):
911 2018-04-12 Chris Dumez <cdumez@apple.com>
913 Process::setIdentifier() / Process::identifier() do not need a lock
914 https://bugs.webkit.org/show_bug.cgi?id=184544
916 Reviewed by Brady Eidson.
918 Process::setIdentifier() / Process::identifier() do not need a lock.
919 Process::setIdentifier() gets called in ChildProcess::initialize(),
920 before we start any background threads. It is then safe to query
921 this process identifier later on from background threads without
924 * platform/Process.cpp:
925 (WebCore::Process::setIdentifier):
926 (WebCore::Process::identifier):
928 2018-04-12 Antoine Quint <graouts@apple.com>
930 Unreviewed, fix the Windows build.
932 * animation/DocumentTimeline.cpp:
933 (WebCore::DocumentTimeline::computeExtentOfAnimation const):
935 2018-04-12 Antoine Quint <graouts@apple.com>
937 [Web Animations] Suspend animations when required
938 https://bugs.webkit.org/show_bug.cgi?id=184541
942 Animations managed by CSSAnimationController get suspended under a number of scenarios, we now add the possibility
943 to suspend animations on a DocumentTimeline as well such that Web Animations and CSS Animations and CSS Transitions
944 implemented as Web Animations get suspended under the same conditions as well. We also update the implementation for
945 Internals::numberOfActiveAnimations() such that tests checking that animations get suspended pass.
947 * animation/DocumentTimeline.cpp:
948 (WebCore::DocumentTimeline::suspendAnimations): When asked to be suspended, the DocumentTimeline cancels pending
949 invalidation tasks and updates all of the animations it manages, including those running on the compositor.
950 (WebCore::DocumentTimeline::resumeAnimations): When asked to be resumed, the DocumentTimeline resumes animations
951 it manages and rewinds its invalidation timer.
952 (WebCore::DocumentTimeline::animationsAreSuspended):
953 (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): Called by Internals::numberOfActiveAnimations(),
954 this returns the number of animations managed by this timeline that are not suspended.
955 (WebCore::DocumentTimeline::currentTime):
956 (WebCore::DocumentTimeline::timingModelDidChange): Ensure the invalidation timer is not rewound if the timeline
958 * animation/DocumentTimeline.h:
959 * animation/WebAnimation.cpp:
960 (WebCore::WebAnimation::setTimeline): When moving to a new timeline, ensure we match the new timeline's animation state.
961 (WebCore::WebAnimation::setSuspended): Toggle the accelerated running state of any backing hardware animations when
962 the suspension state of an animation changes.
963 * animation/WebAnimation.h:
964 (WebCore::WebAnimation::isSuspended const):
966 (WebCore::Document::didBecomeCurrentDocumentInFrame):
967 (WebCore::Document::resume):
969 * history/CachedFrame.cpp:
970 (WebCore::CachedFrameBase::restore):
972 (WebCore::Frame::clearTimers):
974 (WebCore::Page::setIsVisibleInternal):
975 (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
976 * testing/Internals.cpp:
977 (WebCore::Internals::numberOfActiveAnimations const):
978 (WebCore::Internals::animationsAreSuspended const):
979 (WebCore::Internals::suspendAnimations const):
980 (WebCore::Internals::resumeAnimations const):
982 2018-04-12 Antoine Quint <graouts@apple.com>
984 [Web Animations] Throttle animations when lowPowerMode is on
985 https://bugs.webkit.org/show_bug.cgi?id=184540
989 Ensure animations are sampled at a lower frequency when lowPowerMode is on.
991 * animation/DocumentTimeline.cpp:
992 (WebCore::DocumentTimeline::updateThrottlingState):
993 (WebCore::DocumentTimeline::animationInterval const):
994 (WebCore::DocumentTimeline::updateAnimationSchedule):
995 (WebCore::DocumentTimeline::scheduleAnimationResolution):
996 * animation/DocumentTimeline.h:
998 (WebCore::Page::handleLowModePowerChange):
999 * testing/Internals.cpp:
1000 (WebCore::Internals::animationsInterval const):
1002 2018-04-12 Antoine Quint <graouts@apple.com>
1004 [Web Animations] Ensure elements overlapping with elements animating also get composited
1005 https://bugs.webkit.org/show_bug.cgi?id=184539
1007 Reviewed by Jon Lee.
1009 A number of compositing tests failed because we didn't call into the Web Animations engine while various calls
1010 on RenderLayer and RenderLayerBacking were made. We bring the functionality over from CSSAnimationController to
1011 DocumentTimeline and KeyframeAnimation to KeyframeEffectReadOnly.
1013 * animation/AnimationTimeline.cpp:
1014 (WebCore::AnimationTimeline::animationsForElement const): Update this method's signature to be const since it
1015 should be callable by other const method.
1016 (WebCore::AnimationTimeline::animationsForElement): Deleted.
1017 * animation/AnimationTimeline.h:
1018 * animation/DocumentTimeline.cpp:
1019 (WebCore::DocumentTimeline::computeExtentOfAnimation const): Adapt this method from CSSAnimationController.
1020 (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): Adapt this method from CSSAnimationController.
1021 (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Adapt this method from CSSAnimationController.
1022 * animation/DocumentTimeline.h:
1023 * animation/KeyframeEffectReadOnly.cpp:
1024 (WebCore::KeyframeEffectReadOnly::computeExtentOfTransformAnimation const): Bring this method over from KeyframeAnimation.
1025 (WebCore::containsRotation): Bring this method over from KeyframeAnimation.
1026 (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaTransformList const): Bring this method over from KeyframeAnimation.
1027 (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaMatrix const): Bring this method over from KeyframeAnimation.
1028 * animation/KeyframeEffectReadOnly.h:
1029 (WebCore::KeyframeEffectReadOnly::animatedProperties const): DocumentTimeline::computeExtentOfAnimation() needs to get a list
1030 of all animated properties to see if a transform is animated, so we now expose such a list.
1031 * rendering/RenderLayer.cpp:
1032 (WebCore::RenderLayer::currentTransform const): Update this method to call into DocumentTimeline if the CSS Animations
1033 and CSS Transitions as Web Animations flag is on.
1034 (WebCore::RenderLayer::calculateClipRects const): Update this method to call into DocumentTimeline if the CSS Animations
1035 and CSS Transitions as Web Animations flag is on.
1036 * rendering/RenderLayerBacking.cpp:
1037 (WebCore::RenderLayerBacking::updateGeometry): Update this method to call into DocumentTimeline if the CSS Animations
1038 and CSS Transitions as Web Animations flag is on.
1039 * rendering/RenderLayerCompositor.cpp:
1040 (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Update this method to call into DocumentTimeline
1041 if the CSS Animations and CSS Transitions as Web Animations flag is on.
1042 * rendering/RenderObject.h:
1043 (WebCore::RenderObject::documentTimeline const):
1045 2018-04-11 Antoine Quint <graouts@apple.com>
1047 [Web Animations] Enable seeking for hardware animations
1048 https://bugs.webkit.org/show_bug.cgi?id=184518
1050 Reviewed by Dean Jackson.
1052 Hardware animations had lagged behind software animations in support and this patch bring their respective level
1053 of support closer to one another. Importantly, we add the ability to seek an animation added to a GraphicsLayerCA
1054 since many tests pause and seek animations to test their state. Animations may also have their playback state changed
1055 along with their current time in the same run loop, so we now maintain a list of pending processing actions for
1056 hardware animations.
1058 * animation/DocumentTimeline.cpp:
1059 (WebCore::DocumentTimeline::updateAnimationSchedule): If we have animations queued up for updates to their accelerated
1060 state we can schedule animation resolution immediately since we've already established we'll have work to do.
1061 (WebCore::DocumentTimeline::updateAnimations): Factor the updates of pending accelerated animations out in a dedicated
1063 (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): Go through all pending accelerated animations and update
1065 * animation/KeyframeEffectReadOnly.cpp:
1066 (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes): Update the m_shouldRunAccelerated flag when setting blending keyframes.
1067 (WebCore::KeyframeEffectReadOnly::apply): Ensure we finish accelerated animations if the progress is 1 or null (no longer active).
1068 start accelerated animations if the animation is starting and always resolve styles in software as well to ensure that
1069 hit testing will work as expected.
1070 (WebCore::KeyframeEffectReadOnly::computeShouldRunAccelerated):
1071 (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Called by WebAnimation when play() or pause() is called
1072 with the appropriate flag.
1073 (WebCore::KeyframeEffectReadOnly::animationDidSeek): Called by WebAnimation when the currentTime property is set.
1074 (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Add the provided action to the list of pending accelerated
1075 actions and notify the animation that the accelerated state needs changing.
1076 (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Called by DocumentTimeline, through WebAnimation, to apply
1077 all pending accelerated actions.
1078 (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const): If we're dealing with a declarative animation,
1079 we already have a backing Animation object, so use it directly. Otherwise, create one and ensure it reflects all timing properties
1081 (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): Deleted.
1082 (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): Deleted.
1083 * animation/WebAnimation.cpp:
1084 (WebCore::WebAnimation::setCurrentTime): Call animationDidSeek() on the effect to ensure its accelerated animation gets seeked.
1085 (WebCore::WebAnimation::play): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation is started or resumed.
1086 (WebCore::WebAnimation::pause): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation gets paused.
1087 (WebCore::WebAnimation::acceleratedStateDidChange):
1088 (WebCore::WebAnimation::applyPendingAcceleratedActions):
1089 (WebCore::WebAnimation::acceleratedRunningStateDidChange): Deleted.
1090 (WebCore::WebAnimation::startOrStopAccelerated): Deleted.
1091 * platform/graphics/GraphicsLayer.h:
1092 (WebCore::GraphicsLayer::seekAnimation):
1093 * platform/graphics/ca/GraphicsLayerCA.cpp:
1094 (WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Add an AnimationProcessingAction to the list of such actions for a
1095 given animation name. In case we already have a Remove action, we ignore the action since the hardware animation will have been
1096 removed by the time we try to apply this processing action.
1097 (WebCore::GraphicsLayerCA::pauseAnimation): Add a Pause processing action.
1098 (WebCore::GraphicsLayerCA::seekAnimation): Add a Seek processing action.
1099 (WebCore::GraphicsLayerCA::removeAnimation): Add a Remove processing action.
1100 (WebCore::GraphicsLayerCA::updateAnimations): First ensure that all animations pending commit are committed and then update
1101 all animations based on the actions added through addProcessingActionForAnimation().
1102 (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Generate a new animation based on the new seek time provided.
1103 * platform/graphics/ca/GraphicsLayerCA.h:
1104 (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
1105 * rendering/RenderBoxModelObject.cpp:
1106 (WebCore::RenderBoxModelObject::animationSeeked):
1107 * rendering/RenderLayerBacking.cpp:
1108 (WebCore::RenderLayerBacking::animationSeeked):
1109 * rendering/RenderLayerCompositor.cpp:
1110 (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Fix an issue where we would run the CSSAnimationController
1111 logic even when the legacy animation engine was disabled.
1113 2018-04-12 Xabier Rodriguez Calvar <calvaris@igalia.com>
1115 Unreviewed, fix GStreamer builds
1117 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1118 (WebCore::MediaPlayerPrivateGStreamer::handleMessage): We were
1119 passing a String to a GST_WARNING call.
1121 2018-04-11 Chris Dumez <cdumez@apple.com>
1123 input.webkitEntries does not work as expected when folder contains accented chars
1124 https://bugs.webkit.org/show_bug.cgi?id=184517
1125 <rdar://problem/39265537>
1127 Reviewed by Ryosuke Niwa.
1129 Use String::fromUTF8() to construct a WTF String from the char* returned by
1130 dirname() in FileSystem::directoryName(). Previously, we were just calling
1131 the String constructor, which would treat the input as latin 1 instead of
1134 Test: fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html
1136 * platform/posix/FileSystemPOSIX.cpp:
1137 (WebCore::FileSystem::directoryName):
1139 2018-04-11 Youenn Fablet <youenn@apple.com>
1141 Preventively expect UTF8 strings from libwebrtc SDP and error messages
1142 https://bugs.webkit.org/show_bug.cgi?id=184509
1144 Reviewed by Eric Carlson.
1146 Make WebCore code expect any libwebrtc string to contain UTF-8.
1147 Currently SDPs do not contain any UTF-8 specific character
1148 but https://tools.ietf.org/html/rfc4566 allows it.
1150 Add Internals API to set track id so that we can inject UTF-8 inside some WebRTC tests.
1151 Test: webrtc/utf8-sdp.html
1153 * Modules/mediastream/MediaStreamTrack.h:
1154 (WebCore::MediaStreamTrack::setIdForTesting):
1155 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1156 (WebCore::fromStdString):
1157 (WebCore::fromSessionDescription):
1158 (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
1159 (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1160 (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
1161 (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
1162 (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1163 (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
1164 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1165 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
1166 (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
1167 (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
1168 (WebCore::trackId): Deleted.
1169 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1170 (WebCore::fromStdString):
1171 (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
1172 (WebCore::createReceiverForSource):
1173 * platform/mediastream/MediaStreamTrackPrivate.h:
1174 (WebCore::MediaStreamTrackPrivate::setIdForTesting):
1175 * testing/Internals.cpp:
1176 (WebCore::Internals::setMediaStreamTrackIdentifier):
1177 * testing/Internals.h:
1178 * testing/Internals.idl:
1180 2018-04-11 Said Abou-Hallawa <sabouhallawa@apple.com>
1182 Cache glyphs (using display lists) when painting at high frequency
1183 https://bugs.webkit.org/show_bug.cgi?id=178750
1184 <rdar://problem/35201729>
1186 Reviewed by Antti Koivisto.
1188 This patch adds support for caching of glyph drawing commands when painting
1189 at high frequency. Caching the glyph drawing will be done using DisplayLists.
1191 GlyphDisplayListCache is basically a hash map which maps InlineTextBox
1192 or SimpleLineLayout::Run to DisplayList. Before adding a new entry to it
1193 we have to check whether the conditions for caching the glyph DisplayList
1194 are met or not. If no entry is found for a given run, a new DisplayList
1195 is created and a new entry is add to the cache.
1197 * WebCore.xcodeproj/project.pbxproj:
1198 * page/MemoryRelease.cpp:
1199 (WebCore::releaseNoncriticalMemory): Make GlyphDisplayListCache respond
1202 * platform/graphics/FontCascade.cpp:
1203 (WebCore::FontCascade::displayListForTextRun const):
1204 * platform/graphics/FontCascade.h:
1205 (WebCore::FontCascade::displayListForTextRun):
1206 Record the drawing of a glyph run into a DisplayList.
1208 * rendering/GlyphDisplayListCache.h: Added.
1209 (WebCore::GlyphDisplayListCache::singleton):
1210 (WebCore::GlyphDisplayListCache::get):
1211 (WebCore::GlyphDisplayListCache::remove):
1212 (WebCore::GlyphDisplayListCache::clear):
1213 (WebCore::GlyphDisplayListCache::size const):
1214 (WebCore::GlyphDisplayListCache::sizeInBytes const):
1215 A simple cache for the TextRun DisplayList. Adding a new entry in the
1216 cache happens under restricted conditions. So this cache is not expected
1219 * rendering/InlineTextBox.cpp:
1220 (WebCore::InlineTextBox::~InlineTextBox):
1221 (WebCore::InlineTextBox::paint):
1222 (WebCore::InlineTextBox::paintMarkedTexts):
1223 (WebCore::InlineTextBox::paintMarkedTextBackground):
1224 (WebCore::InlineTextBox::paintMarkedTextForeground):
1225 (WebCore::InlineTextBox::paintMarkedTextDecoration):
1226 (WebCore::InlineTextBox::paintCompositionBackground):
1227 (WebCore::InlineTextBox::paintCompositionUnderlines const):
1228 (WebCore::InlineTextBox::paintCompositionUnderline const):
1229 * rendering/InlineTextBox.h:
1230 (WebCore::InlineTextBox::paintMarkedTexts):
1231 InlineTextBox::paintMarkedTextForeground() now requires PaintInfo to know
1232 whether the entry in the GlyphDisplayListCache should be removed or not.
1233 Change all the GraphicsContext arguments to be PaintInfo.
1235 * rendering/SimpleLineLayout.cpp:
1236 (WebCore::SimpleLineLayout::Layout::~Layout):
1237 * rendering/SimpleLineLayout.h:
1238 * rendering/SimpleLineLayoutFunctions.cpp:
1239 (WebCore::SimpleLineLayout::paintFlow):
1240 (WebCore::SimpleLineLayout::simpleLineLayoutWillBeDeleted):
1241 * rendering/SimpleLineLayoutFunctions.h:
1242 * rendering/SimpleLineLayoutResolver.h:
1243 (WebCore::SimpleLineLayout::RunResolver::Run::simpleRun const):
1244 Implement the glyph caching for SimpleLineLayout::Run.
1246 * rendering/TextPainter.cpp:
1247 (WebCore::TextPainter::paintTextOrEmphasisMarks): If the DisplayList is
1248 available, replay it back into the GraphicsContext. Make sure to reset to
1249 the DisplayList pointer to nullptr after painting.
1251 (WebCore::TextPainter::clearGlyphDisplayLists):
1252 (WebCore::TextPainter::shouldUseGlyphDisplayList): Check whether we should
1253 use DisplayList to the draw glyph run.
1255 * rendering/TextPainter.h:
1256 (WebCore::TextPainter::setGlyphDisplayListIfNeeded): Check whether we should
1257 should use DisplayList to the draw glyph run and if we should, ensure first
1258 the DisplayList is cached and set it in the TextPainter so it uses it when
1261 (WebCore::TextPainter::removeGlyphDisplayList): Remove the cached DisplayList
1262 entry for a glyph layout run.
1264 2018-04-11 Brent Fulgham <bfulgham@apple.com>
1266 GraphicsLayerCA::createPlatformCALayer always disables extended color in its backing store
1267 https://bugs.webkit.org/show_bug.cgi?id=184367
1268 <rdar://problem/39249074>
1270 Reviewed by Simon Fraser.
1272 'createPlatformCALayer' always passes a nil widget, which early returns from 'screenSupportsExtendedColor'
1273 with false. Instead, we should just pass the widget (nil or not) to the screen properties methods,
1274 which will use the primary screen if no screen is specified. I.e., we shouldn't do an early return
1275 here if the passed widget is nil.
1277 * platform/mac/PlatformScreenMac.mm:
1278 (WebCore::screenSupportsExtendedColor):
1280 2018-04-11 Youenn Fablet <youenn@apple.com>
1282 Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
1283 https://bugs.webkit.org/show_bug.cgi?id=184374
1285 Reviewed by Chris Dumez.
1287 Add support for SecurityOrigin encode/decode routines.
1289 * page/SecurityOrigin.h:
1291 2018-04-11 Thibault Saunier <tsaunier@igalia.com>
1293 [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
1294 https://bugs.webkit.org/show_bug.cgi?id=184498
1296 Reviewed by Philippe Normand.
1298 [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
1300 This is the same behaviour as with playbin itself.
1302 Make sure to keep using "playbin" for MediaSource.
1304 No test added as this is basically a small rework of the way we expose a feature.
1306 * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1307 * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
1308 * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1309 * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1310 * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1311 * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
1312 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1313 (WebCore::MediaPlayerPrivateGStreamer::load):
1314 (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
1315 (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1316 (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1317 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1318 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1319 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1320 (WebCore::TrackPrivateBaseGStreamer::disconnect):
1321 (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1322 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1323 * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1324 * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
1326 2018-04-10 Alex Christensen <achristensen@webkit.org>
1328 IDN spoofing with Hebrew combining characters
1329 https://bugs.webkit.org/show_bug.cgi?id=184472
1330 <rdar://problem/39148687>
1332 Reviewed by Brent Fulgham.
1334 Covered by new API tests.
1336 * platform/mac/WebCoreNSURLExtras.mm:
1337 (WebCore::isLookalikeCharacter):
1338 Punycode-encode hosts with Hebrew combining marks that look like dots
1339 and Vav with a combining dot above like we do with dotless i and j.
1341 2018-04-11 Brent Fulgham <bfulgham@apple.com>
1343 Show punycode if URL contains Latin dum character
1344 https://bugs.webkit.org/show_bug.cgi?id=184477
1345 <rdar://problem/39121999>
1347 Reviewed by David Kilzer.
1349 Revise our "lookalike character" logic to include the small
1350 Latin dum character.
1352 Test: fast/url/host.html
1354 * platform/mac/WebCoreNSURLExtras.mm:
1355 (WebCore::isLookalikeCharacter):
1357 2018-04-11 Michael Catanzaro <mcatanzaro@igalia.com>
1359 [GTK] WaylandCompositorDisplay leaks its wl_display
1360 https://bugs.webkit.org/show_bug.cgi?id=184406
1362 Reviewed by Carlos Garcia Campos.
1364 Well, this was harder than expected. We really just want to fix a small leak in the WebKit
1365 layer, but that requires a change in how WaylandCompositorDisplay calls the
1366 PlatformDisplayWayland constructor, to pass NativeDisplayOwned::Yes. That means
1367 WaylandCompositorDisplay can no longer use PlatformDisplayWayland's protected default
1368 constructor. Problem is that the normal PlatformDisplayWayland constructor calls
1369 PlatformDisplayWayland::initialize, which calls PlatformDisplayWayland::registryGlobal,
1370 which is a virtual function. The WaylandCompositorDisplay portion of the object is not
1371 constructed yet at this point, so WaylandCompositorDisplay::registryGlobal will never be
1372 called if we do that. I had to revert the previous version of this fix due to this problem.
1373 It had broken accelerated compositing.
1375 I'm reminded of Effective C++ item #9: Never call virtual functions during construction or
1376 destruction ("because such calls will never go to a more derived class than that of the
1377 currently executing constructor or destructor"). This code is fragile and likely to break
1378 again in the future, so let's refactor it a bit. Instead of calling initialize in the
1379 constructor, we'll call it from create functions. We'll have to add a couple create
1380 functions, and make the constructor protected to ensure it's not possible to create a
1381 PlatformDisplayWayland without initializing it. For good parallelism, do the same for the
1382 other PlatformDisplay classes.
1384 This commit additionally removes PlatformDisplayWayland's protected default constructor,
1385 since it's not needed anymore.
1387 The NativeDisplayOwned arguments to the PlatformDisplay constructors are now mandatory,
1388 instead of using NativeDisplayOwned::No as the default value, since that was dangerously
1389 close to being the cause of this leak, and the constructors are now accessed from private
1390 create functions anyway. Some more caution when using default parameter values is warranted
1393 Lastly, since we have to change PlatformDisplay::createPlatformDisplay to use the new create
1394 functions, take the opportunity to move things around a bit for clarity. There should be no
1395 change in behavior. I was just disappointed that the PlatformDisplayWPE creation was at the
1396 bottom of the function, after a comment indicating that normal display creation has failed,
1397 which is not the case for WPE.
1399 This all might have been a bit overkill, since the leak could probably have been fixed by
1400 passing nullptr to the PlatformDisplayWayland constructor for the wl_display and not
1401 removing WaylandCompositorDisplay's call to PlatformDisplayWayland::initialize. But the
1402 correctness of that code would then rely on implementation details of initialize, so this
1403 refactor seems better.
1405 No new tests since there *should* be no behavior change. Then again, I'm touching
1406 PlatformDisplay, and history shows we don't have the greatest track record of touching this
1407 code without introducing problems.
1409 * platform/graphics/PlatformDisplay.cpp:
1410 (WebCore::PlatformDisplay::createPlatformDisplay):
1411 * platform/graphics/PlatformDisplay.h:
1412 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1413 (WebCore::PlatformDisplayWayland::create):
1414 (WebCore::PlatformDisplayWayland::create):
1415 (WebCore::PlatformDisplayWayland::createHeadless):
1416 (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
1417 (WebCore::PlatformDisplayWayland::initialize):
1418 * platform/graphics/wayland/PlatformDisplayWayland.h:
1419 * platform/graphics/win/PlatformDisplayWin.h:
1420 * platform/graphics/wpe/PlatformDisplayWPE.cpp:
1422 * platform/graphics/wpe/PlatformDisplayWPE.h:
1423 * platform/graphics/x11/PlatformDisplayX11.cpp:
1424 (WebCore::PlatformDisplayX11::create):
1425 (WebCore::PlatformDisplayX11::create):
1426 (WebCore::PlatformDisplayX11::createHeadless):
1427 * platform/graphics/x11/PlatformDisplayX11.h:
1429 2018-04-11 Jianjun Zhu <jianjun.zhu@intel.com>
1431 Fix a WebRTC data channel issue for non-ASCII characters.
1433 At the sender side, buffer size are calulcated after UTF8 encoding. At the
1434 receiver side, strings are constructed with UTF8 data.
1436 https://bugs.webkit.org/show_bug.cgi?id=184481
1438 Reviewed by Youenn Fablet.
1441 LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt
1443 * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1444 (WebCore::LibWebRTCDataChannelHandler::sendStringData):
1445 (WebCore::LibWebRTCDataChannelHandler::OnMessage):
1447 2018-04-11 Antti Koivisto <antti@apple.com>
1449 ImageFrame type used by non-Cocoa image decoder should not be the same as that used by ImageSource
1450 https://bugs.webkit.org/show_bug.cgi?id=184418
1452 Reviewed by Said Abou-Hallawa.
1454 ScalableImageDecoder uses ImageFrame class which is meant to be an implementation detail of ImageSource.
1455 There are bunch of fields and methods in the type that are only used by one or the other client. For hackability
1456 there should be an unrelated frame type for ScalableImageDecoder.
1458 This patch adds ScalableImageDecoderFrame type used in ScalableImageDecoder only. It then cleans up
1459 unneeded things from both ImageFrame and ScalableImageDecoderFrame.
1461 * platform/ImageDecoders.cmake:
1462 * platform/graphics/ImageFrame.cpp:
1463 (WebCore::ImageFrame::operator=):
1464 (WebCore::ImageFrame::clearImage):
1465 (WebCore::ImageFrame::size const):
1466 (WebCore::ImageFrame::initialize): Deleted.
1467 * platform/graphics/ImageFrame.h:
1468 (WebCore::ImageFrame::setDisposalMethod): Deleted.
1469 (WebCore::ImageFrame::disposalMethod const): Deleted.
1470 (WebCore::ImageFrame::backingStore const): Deleted.
1471 (WebCore::ImageFrame::hasBackingStore const): Deleted.
1472 * platform/image-decoders/ScalableImageDecoder.cpp:
1473 (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
1474 (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
1475 (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
1476 * platform/image-decoders/ScalableImageDecoder.h:
1477 * platform/image-decoders/ScalableImageDecoderFrame.cpp: Copied from Source/WebCore/platform/graphics/ImageFrame.cpp.
1478 (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
1479 (WebCore::ScalableImageDecoderFrame::~ScalableImageDecoderFrame):
1480 (WebCore::ScalableImageDecoderFrame::operator=):
1481 (WebCore::ScalableImageDecoderFrame::setDecodingStatus):
1482 (WebCore::ScalableImageDecoderFrame::decodingStatus const):
1483 (WebCore::ScalableImageDecoderFrame::clearImage):
1484 (WebCore::ScalableImageDecoderFrame::clear):
1485 (WebCore::ScalableImageDecoderFrame::initialize):
1486 (WebCore::ScalableImageDecoderFrame::size const):
1487 (WebCore::ImageFrame::ImageFrame): Deleted.
1488 (WebCore::ImageFrame::~ImageFrame): Deleted.
1489 (WebCore::ImageFrame::defaultFrame): Deleted.
1490 (WebCore::ImageFrame::operator=): Deleted.
1491 (WebCore::ImageFrame::setDecodingStatus): Deleted.
1492 (WebCore::ImageFrame::decodingStatus const): Deleted.
1493 (WebCore::ImageFrame::clearImage): Deleted.
1494 (WebCore::ImageFrame::clear): Deleted.
1495 (WebCore::ImageFrame::initialize): Deleted.
1496 (WebCore::ImageFrame::size const): Deleted.
1497 (WebCore::ImageFrame::hasNativeImage const): Deleted.
1498 (WebCore::ImageFrame::hasFullSizeNativeImage const): Deleted.
1499 (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions const): Deleted.
1500 (WebCore::ImageFrame::singlePixelSolidColor const): Deleted.
1501 * platform/image-decoders/ScalableImageDecoderFrame.h: Copied from Source/WebCore/platform/graphics/ImageFrame.h.
1502 (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
1503 (WebCore::ScalableImageDecoderFrame::disposalMethod const):
1504 (WebCore::ScalableImageDecoderFrame::hasAlpha const):
1505 (WebCore::ScalableImageDecoderFrame::hasBackingStore const):
1506 (WebCore::ImageFrame::ImageFrame): Deleted.
1507 (WebCore::ImageFrame::isInvalid const): Deleted.
1508 (WebCore::ImageFrame::isPartial const): Deleted.
1509 (WebCore::ImageFrame::isComplete const): Deleted.
1510 (WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
1511 (WebCore::ImageFrame::frameBytes const): Deleted.
1512 (WebCore::ImageFrame::subsamplingLevel const): Deleted.
1513 (WebCore::ImageFrame::setDisposalMethod): Deleted.
1514 (WebCore::ImageFrame::disposalMethod const): Deleted.
1515 (WebCore::ImageFrame::nativeImage const): Deleted.
1516 (WebCore::ImageFrame::setOrientation): Deleted.
1517 (WebCore::ImageFrame::orientation const): Deleted.
1518 (WebCore::ImageFrame::setDuration): Deleted.
1519 (WebCore::ImageFrame::duration const): Deleted.
1520 (WebCore::ImageFrame::setHasAlpha): Deleted.
1521 (WebCore::ImageFrame::hasAlpha const): Deleted.
1522 (WebCore::ImageFrame::hasNativeImage): Deleted.
1523 (WebCore::ImageFrame::hasFullSizeNativeImage): Deleted.
1524 (WebCore::ImageFrame::hasMetadata const): Deleted.
1525 (WebCore::ImageFrame::backingStore const): Deleted.
1526 (WebCore::ImageFrame::hasBackingStore const): Deleted.
1527 * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1528 (WebCore::BMPImageDecoder::frameBufferAtIndex):
1529 * platform/image-decoders/bmp/BMPImageDecoder.h:
1530 * platform/image-decoders/bmp/BMPImageReader.h:
1531 (WebCore::BMPImageReader::setBuffer):
1532 * platform/image-decoders/gif/GIFImageDecoder.cpp:
1533 (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
1534 (WebCore::GIFImageDecoder::frameBufferAtIndex):
1535 (WebCore::GIFImageDecoder::clearFrameBufferCache):
1536 (WebCore::GIFImageDecoder::haveDecodedRow):
1537 (WebCore::GIFImageDecoder::frameComplete):
1538 (WebCore::GIFImageDecoder::initFrameBuffer):
1539 * platform/image-decoders/gif/GIFImageDecoder.h:
1540 * platform/image-decoders/gif/GIFImageReader.cpp:
1541 (GIFImageReader::parse):
1542 * platform/image-decoders/gif/GIFImageReader.h:
1543 (GIFFrameContext::GIFFrameContext):
1544 * platform/image-decoders/ico/ICOImageDecoder.cpp:
1545 (WebCore::ICOImageDecoder::frameBufferAtIndex):
1546 * platform/image-decoders/ico/ICOImageDecoder.h:
1547 * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1548 (WebCore::JPEGImageDecoder::frameBufferAtIndex):
1549 (WebCore::setPixel):
1550 (WebCore::JPEGImageDecoder::outputScanlines):
1551 (WebCore::JPEGImageDecoder::jpegComplete):
1552 * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1553 * platform/image-decoders/png/PNGImageDecoder.cpp:
1554 (WebCore::PNGImageDecoder::frameBufferAtIndex):
1555 (WebCore::PNGImageDecoder::rowAvailable):
1556 (WebCore::PNGImageDecoder::readChunks):
1557 (WebCore::PNGImageDecoder::clearFrameBufferCache):
1558 (WebCore::PNGImageDecoder::initFrameBuffer):
1559 (WebCore::PNGImageDecoder::frameComplete):
1560 * platform/image-decoders/png/PNGImageDecoder.h:
1561 * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1562 (WebCore::WEBPImageDecoder::frameBufferAtIndex):
1563 (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
1564 (WebCore::WEBPImageDecoder::decodeFrame):
1565 (WebCore::WEBPImageDecoder::initFrameBuffer):
1566 (WebCore::WEBPImageDecoder::applyPostProcessing):
1567 (WebCore::WEBPImageDecoder::clearFrameBufferCache):
1568 * platform/image-decoders/webp/WEBPImageDecoder.h:
1570 2018-04-11 Antoine Quint <graouts@apple.com>
1572 [Web Animations] Turn Web Animations on by default
1573 https://bugs.webkit.org/show_bug.cgi?id=184491
1575 Reviewed by Simon Fraser.
1577 * page/RuntimeEnabledFeatures.h:
1579 2018-04-11 Ryosuke Niwa <rniwa@webkit.org>
1581 Fix warning in HashTools.h for newer versions of clang
1582 https://bugs.webkit.org/show_bug.cgi?id=184489
1584 Reviewed by Alexey Proskuryakov.
1586 Removed "register" storage class specififer as it has been deprecated in C++11.
1588 * platform/HashTools.h:
1590 2018-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
1592 FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
1593 https://bugs.webkit.org/show_bug.cgi?id=183395
1594 <rdar://problem/38055732>
1596 Reviewed by Zalan Bujtas.
1598 In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
1599 FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
1600 mitigation by wrapping the Frame in a Ref when firing the appearance update timer.
1602 Test: editing/selection/iframe-update-selection-appearance.html
1604 * editing/FrameSelection.cpp:
1605 (WebCore::FrameSelection::appearanceUpdateTimerFired):
1607 2018-04-10 Brent Fulgham <bfulgham@apple.com>
1609 Unreviewed follow-up to r230468.
1611 Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.
1613 * page/mac/EventHandlerMac.mm:
1614 (WebCore::lastEventIsMouseUp):
1615 (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1616 * platform/mac/EventLoopMac.mm:
1617 (WebCore::EventLoop::cycle):
1619 2018-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
1621 Unreviewed, fix the iOS build
1623 I accidentally exported an inline function in r230506.
1625 * page/ViewportConfiguration.h:
1626 (WebCore::ViewportConfiguration::viewSize const):
1628 2018-04-10 Nan Wang <n_wang@apple.com>
1630 AX: Expose strong password fields on iOS
1631 https://bugs.webkit.org/show_bug.cgi?id=184465
1632 <rdar://problem/39325104>
1634 Reviewed by Chris Fleizach.
1636 Exposed the strong password field on iOS. And made sure
1637 we are returning its actual value in accessibilityValue.
1639 Test: accessibility/ios-simulator/strong-password-field.html
1641 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1642 (-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
1643 (-[WebAccessibilityObjectWrapper accessibilityValue]):
1645 2018-04-10 Fujii Hironori <Hironori.Fujii@sony.com>
1647 [Win] Add UserAgentWin.cpp
1648 https://bugs.webkit.org/show_bug.cgi?id=184438
1650 Reviewed by Michael Catanzaro.
1652 No new tests (No behavior change).
1654 * PlatformWin.cmake:
1655 * platform/win/UserAgentWin.cpp: Added.
1656 (WebCore::standardUserAgent):
1657 (WebCore::standardUserAgentForURL):
1659 2018-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
1661 [Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in extra zoom mode
1662 https://bugs.webkit.org/show_bug.cgi?id=184435
1663 <rdar://problem/38726260>
1665 Reviewed by Dean Jackson.
1667 Expose the size of the platform view. By default, in extra zoom mode, this *not* the same as the minimum layout
1668 size, since we lay out at a large width and then shrink down to real device dimensions when computing the
1669 initial scale (see r229063).
1671 ViewGestureGeometryCollector uses this in the process of computing a target zoom scale when double tapping.
1673 * page/ViewportConfiguration.h:
1674 (WebCore::ViewportConfiguration::viewSize const):
1676 2018-04-10 Fujii Hironori <Hironori.Fujii@sony.com>
1678 [Win][WebKit] LibWebRTCProvider::webRTCAvailable is an undefined symbol
1679 https://bugs.webkit.org/show_bug.cgi?id=184437
1681 Reviewed by Michael Catanzaro.
1683 No new tests (No behavior change).
1685 * PlatformWin.cmake: Added LibWebRTCProviderWin.cpp.
1686 * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Added.
1687 (WebCore::LibWebRTCProvider::webRTCAvailable):
1689 2018-04-10 Chris Dumez <cdumez@apple.com>
1691 Unreviewed build fix.
1693 Those enum value names were too generic and would cause conflicts.
1695 * Modules/webvr/VRDisplayCapabilities.h:
1696 (WebCore::VRDisplayCapabilities::hasPosition const):
1697 (WebCore::VRDisplayCapabilities::hasOrientation const):
1698 (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
1699 (WebCore::VRDisplayCapabilities::canPresent const):
1700 * platform/vr/VRPlatformDisplay.h:
1701 * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
1702 (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
1704 2018-04-10 Chris Dumez <cdumez@apple.com>
1706 Avoid constructing a service worker RegistrationStore for private sessions
1707 https://bugs.webkit.org/show_bug.cgi?id=184463
1708 <rdar://problem/36613948>
1710 Reviewed by Youenn Fablet.
1712 Avoid constructing a service worker RegistrationStore for private sessions since there
1713 is no need for persistence and the registrationDatabaseDirectory is the empty string in
1716 * workers/service/server/SWServer.cpp:
1717 (WebCore::SWServer::removeRegistration):
1718 (WebCore::SWServer::clearAll):
1719 (WebCore::SWServer::clear):
1720 (WebCore::SWServer::SWServer):
1721 (WebCore::SWServer::didFinishActivation):
1722 * workers/service/server/SWServer.h:
1724 2018-04-10 Chris Dumez <cdumez@apple.com>
1726 Unreviewed build fix.
1728 * page/LayoutContext.cpp:
1729 (WebCore::LayoutContext::~LayoutContext):
1730 * page/LayoutContext.h:
1732 2018-04-10 Jeremy Jones <jeremyj@apple.com>
1734 MediaSessionManageriOS should defer creation of MPVolumeView until it needs to monitor AirPlay routes
1735 https://bugs.webkit.org/show_bug.cgi?id=184373
1736 <rdar://problem/35177606>
1738 Reviewed by Eric Carlson.
1740 No change of behavior.
1742 This delays the creation of MPVolumeView until airplay routes are monitored.
1743 MPVolumeView is now also released when monitoring ends.
1744 This makes sure the MP* objects are only accessed from a UI safe thread. WebCore's "MainThread" may be different that the UI thread.
1745 Since this state change is necessarily asynchronous, starting and stopping must prevent races to keep state coherent.
1747 * platform/audio/ios/MediaSessionManagerIOS.mm:
1748 (-[WebMediaSessionHelper initWithCallback:]):
1749 (-[WebMediaSessionHelper dealloc]):
1750 (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
1751 (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
1752 (-[WebMediaSessionHelper allocateVolumeView]): Deleted.
1753 (-[WebMediaSessionHelper setVolumeView:]): Deleted.
1755 2018-04-10 Sihui Liu <sihui_liu@apple.com>
1757 Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
1758 https://bugs.webkit.org/show_bug.cgi?id=184268
1759 <rdar://problem/39144446>
1761 Reviewed by Chris Dumez.
1763 The assertion is no longer true after the change, because multiple resources could have same
1764 url. Used if condition here to make sure we only delete specified resource.
1766 No new tests. Updated an existing test to test the stop loading case by not using injected
1767 bundle policy: http/tests/multipart/multipart-html.php.
1769 * loader/cache/CachedResourceLoader.cpp:
1770 (WebCore::CachedResourceLoader::removeCachedResource):
1772 2018-04-10 Zalan Bujtas <zalan@apple.com>
1774 Do not layout images when we only need the overflow information.
1775 https://bugs.webkit.org/show_bug.cgi?id=175331
1777 Reviewed by Simon Fraser.
1779 This improves MotionMark's Simple Leaves by ~10%.
1781 Covered by existing tests.
1783 * rendering/RenderImage.cpp:
1784 (WebCore::RenderImage::layout):
1786 2018-04-10 Zan Dobersek <zdobersek@igalia.com>
1788 [TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform
1789 https://bugs.webkit.org/show_bug.cgi?id=183868
1791 Reviewed by Carlos Garcia Campos.
1793 Drop the GraphicsLayerTransform member variable from TextureMapperLayer
1794 and instead compute all the required transform information in the
1795 computeTransformsRecursive() method. These computations are not too
1796 expensive, and in turn we can drop an object from this class' state that
1797 was only duplicating a bunch of state variables.
1799 No new tests -- no change in functionality.
1801 * platform/graphics/texmap/TextureMapperLayer.cpp:
1802 (WebCore::TextureMapperLayer::computeTransformsRecursive):
1803 (WebCore::TextureMapperLayer::paintSelf):
1804 (WebCore::TextureMapperLayer::paintSelfAndChildren):
1805 (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1806 (WebCore::TextureMapperLayer::replicaTransform):
1807 (WebCore::TextureMapperLayer::computeOverlapRegions):
1808 (WebCore::TextureMapperLayer::setPosition):
1809 (WebCore::TextureMapperLayer::setSize):
1810 (WebCore::TextureMapperLayer::setAnchorPoint):
1811 (WebCore::TextureMapperLayer::setPreserves3D):
1812 (WebCore::TextureMapperLayer::setTransform):
1813 (WebCore::TextureMapperLayer::setChildrenTransform):
1814 (WebCore::TextureMapperLayer::syncAnimations):
1815 (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded):
1816 * platform/graphics/texmap/TextureMapperLayer.h:
1818 2018-04-09 Brent Fulgham <bfulgham@apple.com>
1820 Add ProcessPrivilege assertions to places that access NSApp
1821 https://bugs.webkit.org/show_bug.cgi?id=184322
1822 <rdar://problem/39194560>
1824 Reviewed by Per Arne Vollan.
1826 Add ProcessPrivilege assertions to places where we interact with NSApp so
1827 that we can prevent accidentally using them in the WebContent process.
1829 * page/mac/EventHandlerMac.mm:
1830 (WebCore::lastEventIsMouseUp):
1831 (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1832 * platform/mac/EventLoopMac.mm:
1833 (WebCore::EventLoop::cycle):
1834 * platform/mac/PasteboardMac.mm:
1835 (WebCore::Pasteboard::setDragImage):
1837 2018-04-09 John Wilander <wilander@apple.com>
1839 Refactor Ignore HSTS code
1840 https://bugs.webkit.org/show_bug.cgi?id=184433
1841 <rdar://problem/39298238>
1843 Reviewed by Darin Adler.
1845 This patch refactors our ignore HSTS code. The convenience functions are moved
1846 out of CFNetwork SPI in PAL, and into where they are used. It also switches
1847 from performSelector: calls to straight function calls, after checking that
1848 there is a responder.
1850 * platform/network/mac/WebCoreURLResponse.mm:
1851 (WebCore::schemeWasUpgradedDueToDynamicHSTS):
1852 Add convenience function here since it was moved out of
1855 2018-04-09 Brady Eidson <beidson@apple.com>
1857 Expand WebCore policy concept of "shouldContinue" to allow for more than true/false
1858 https://bugs.webkit.org/show_bug.cgi?id=184424
1860 Reviewed by Alex Christensen.
1862 No new tests (No behavior change, refactor only)
1864 Specifically this expands the "shouldContinue" bool to be an enum class with:
1869 * loader/DocumentLoader.cpp:
1870 (WebCore::DocumentLoader::willSendRequest):
1871 * loader/FrameLoader.cpp:
1872 (WebCore::FrameLoader::loadURL):
1873 (WebCore::FrameLoader::load):
1874 (WebCore::FrameLoader::loadWithDocumentLoader):
1875 (WebCore::FrameLoader::loadPostRequest):
1876 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1877 (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1878 * loader/FrameLoader.h:
1879 * loader/PolicyChecker.cpp:
1880 (WebCore::PolicyChecker::checkNavigationPolicy):
1881 (WebCore::PolicyChecker::checkNewWindowPolicy):
1882 * loader/PolicyChecker.h:
1884 2018-04-09 Sihui Liu <sihui_liu@apple.com>
1886 REGRESSION(r229929): localStorage is broken for WebInspector
1887 https://bugs.webkit.org/show_bug.cgi?id=184382
1888 <rdar://problem/39257355>
1890 Reviewed by Chris Dumez.
1892 Removed an if condition that caused false positive cases of database error. As per
1893 https://www.sqlite.org/c3ref/errcode.html, return value of sqlite3_errcode() is undefined
1894 on successful API call, so we should not use the code to check if there is an error. We
1895 should only use it when there is an error.
1896 After moving this condition, LocalStorage might return empty string instead of NULL on
1897 sqlite3_column_blob() error.
1899 Modified a test to cover this case:
1900 TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm.
1902 * platform/sql/SQLiteStatement.cpp:
1903 (WebCore::SQLiteStatement::getColumnBlobAsString):
1905 2018-04-09 Brent Fulgham <bfulgham@apple.com>
1907 WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll is directly accessing NSScreen
1908 https://bugs.webkit.org/show_bug.cgi?id=184344
1909 <rdar://problem/39224969>
1911 Reviewed by Per Arne Vollan.
1913 The implementation of targetPositionInWindowForSelectionAutoscroll uses the display ID to get the
1914 screen boundaries of the current display. This causes a bunch of interaction with NSScreen that
1915 we do not want to allow in the WebContent process.
1917 Instead, we should just use the cached screen information the WebContent process already possesses.
1919 This patch makes the following changes:
1920 1. We now retrieve the screen rect of the page's display from the cache, rather than interacting with
1921 the WindowServer directly.
1922 2. Add a new 'toUserSpaceForPrimaryScreen' so we don't have to deal with a nil NSWindow when computing
1923 the user space version of the coordinates. A nil Window just means we want to get coordinates in
1924 terms of the primary display.
1925 3. Keep track of the primary display so we can refer to it later.
1926 4. Modify the IPC messages to include the primary display's ID so we can easily access it later.
1927 5. Modify the PlatformScreen methods to actually use the primary display when appropriate, rather
1928 than whichever screen happened to hash to the lowest value.
1930 * page/mac/EventHandlerMac.mm:
1931 (WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const): Use new methods that
1932 don't require WindowServer access.
1933 * platform/PlatformScreen.h:
1934 * platform/mac/PlatformScreenMac.mm:
1935 (WebCore::displayID): Assert if we hit this code in the WebContent process.
1936 (WebCore::firstScreen): Ditto.
1937 (WebCore::window): Ditto.
1938 (WebCore::screen): Ditto.
1939 (WebCore::primaryScreenID): Added.
1940 (WebCore::getScreenProperties): Modify to return a pair consisting of the primary display ID and
1941 the HashSet of screen settings.
1942 (WebCore::setScreenProperties): Update to also track the primary display ID.
1943 (WebCore::screenProperties): Update to use the primary display ID.
1944 (WebCore::screenHasInvertedColors): Ditto.
1945 (WebCore::toUserSpaceForPrimaryScreen): Added.
1947 2018-04-09 Said Abou-Hallawa <sabouhallawa@apple.com>
1949 Make InlineTextBox::createTextRun() take a const lvalue reference String
1950 https://bugs.webkit.org/show_bug.cgi?id=184182
1952 Reviewed by Zalan Bujtas.
1954 InlineTextBox::createTextRun() takes a non-const lvalue reference String.
1955 It is tempting to change the signature of this method to take a const lvalue
1956 reference. But this was done intentionally. TextRun is effectively a StringView:
1957 it does not own the passed string. Having the argument a non-const lvalue
1958 reference makes the compiler prevent calls like createTextRun("abc").
1960 To have a better way to express the lifetime of TextRun, this patch does
1963 -- It makes TextRun::m_text of type String instead of StringView.
1964 -- It adds a new constructor which takes const String&. This constructor
1965 will addRef the underlying StringImpl when assigning it to m_text.
1966 -- It keeps the constructor which takes a StringView. The caller of this
1967 constructor still has to make sure the underlying String outlives the
1968 TextRun. To avoid copying the underlying buffer of the StringView, we
1969 will not use StringView::toString(). Instead we will use
1970 StringView::toStringWithoutCopying() which makes the returned String
1971 accesses the same buffer the StringView uses. In this case, the returned
1972 String is effectively a StringView.
1974 * page/DebugPageOverlays.cpp:
1975 (WebCore::drawRightAlignedText):
1976 * platform/graphics/TextRun.cpp:
1977 * platform/graphics/TextRun.h:
1978 (WebCore::TextRun::TextRun):
1979 (WebCore::TextRun::subRun const):
1980 (WebCore::TextRun::length const):
1981 (WebCore::TextRun::setText):
1982 (WebCore::TextRun::string const): Deleted.
1983 * rendering/InlineTextBox.cpp:
1984 (WebCore::InlineTextBox::localSelectionRect const):
1985 (WebCore::InlineTextBox::paint):
1986 (WebCore::InlineTextBox::paintPlatformDocumentMarker):
1987 (WebCore::InlineTextBox::paintMarkedTextBackground):
1988 (WebCore::InlineTextBox::paintMarkedTextForeground):
1989 (WebCore::InlineTextBox::paintMarkedTextDecoration):
1990 (WebCore::InlineTextBox::offsetForPosition const):
1991 (WebCore::InlineTextBox::positionForOffset const):
1992 (WebCore::InlineTextBox::createTextRun const):
1993 There is no need for this function to take a String argument anymore. The
1994 reason for passing the String was to guarantee its lifetime by keeping
1995 a copy of it in the caller side. Now there is no need for that. The TextRun
1996 itself will keep this copy.
1998 * rendering/InlineTextBox.h:
1999 * rendering/RenderText.cpp:
2000 (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
2001 RenderText::text() returns StringImpl. The compiler wants us to be more
2002 explicit about which constructor of TextRun to call.
2004 * rendering/SimpleLineLayout.cpp:
2005 (WebCore::SimpleLineLayout::canUseForFontAndText):
2006 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2007 (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2008 RenderStyle::hyphenString() returns an AtomicString.
2010 2018-04-09 Michael Catanzaro <mcatanzaro@igalia.com>
2012 Unreviewed, rolling out r230390.
2014 Broke accelerated compositing
2018 "[GTK] WaylandCompositorDisplay leaks its wl_display"
2019 https://bugs.webkit.org/show_bug.cgi?id=184406
2020 https://trac.webkit.org/changeset/230390
2022 2018-04-03 Sergio Villar Senin <svillar@igalia.com>
2024 [OpenVR][WebVR] Retrieve FrameData in WebVR's rAF
2025 https://bugs.webkit.org/show_bug.cgi?id=184265
2027 Reviewed by Žan Doberšek.
2029 VRFrameData contains all the required information to properly render a VR scene like view
2030 and projection matrices, pose data (position & orientation) and linear & angular velocity
2031 among others. The getFrameData() call must be issued inside a WebVR's own
2032 requestAnimationFrame.
2034 * Modules/webvr/VRDisplay.cpp:
2035 (WebCore::VRDisplay::getFrameData const):
2036 (WebCore::VRDisplay::getPose const):
2037 (WebCore::VRDisplay::requestAnimationFrame):
2038 (WebCore::VRDisplay::cancelAnimationFrame):
2039 * Modules/webvr/VRDisplay.h:
2040 * Modules/webvr/VREyeParameters.h:
2041 (WebCore::VREyeParameters::rawOffset const): Required to compute view matrices.
2042 * Modules/webvr/VRFrameData.cpp:
2043 (WebCore::matrixToArray):
2044 (WebCore::VRFrameData::leftProjectionMatrix const):
2045 (WebCore::VRFrameData::leftViewMatrix const):
2046 (WebCore::VRFrameData::rightProjectionMatrix const):
2047 (WebCore::VRFrameData::rightViewMatrix const):
2048 (WebCore::projectionMatrixFromFieldOfView):
2049 (WebCore::rotationMatrixFromQuaternion):
2050 (WebCore::applyHeadToEyeTransform):
2051 (WebCore::VRFrameData::update):
2052 (WebCore::VRFrameData::timestamp const): Deleted.
2053 * Modules/webvr/VRFrameData.h:
2054 (WebCore::VRFrameData::timestamp const):
2055 * Modules/webvr/VRPose.cpp:
2056 (WebCore::optionalFloat3ToJSCArray):
2057 (WebCore::VRPose::position const):
2058 (WebCore::VRPose::linearVelocity const):
2059 (WebCore::VRPose::linearAcceleration const):
2060 (WebCore::VRPose::orientation const):
2061 (WebCore::VRPose::angularVelocity const):
2062 (WebCore::VRPose::angularAcceleration const):
2063 * Modules/webvr/VRPose.h:
2064 (WebCore::VRPose::create):
2065 (WebCore::VRPose::update):
2066 (WebCore::VRPose::VRPose):
2067 * platform/vr/VRPlatformDisplay.h:
2068 (WebCore::VRPlatformTrackingInfo::Quaternion::Quaternion):
2069 (WebCore::VRPlatformTrackingInfo::Quaternion::conjugate):
2070 (WebCore::VRPlatformTrackingInfo::Quaternion::operator*):
2071 (WebCore::VRPlatformTrackingInfo::Float3::Float3): Just a group of 3 floats used to store
2072 both velocity and acceleration in a format which is very convenient to later generate JSC
2074 (WebCore::VRPlatformTrackingInfo::clear):
2075 * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
2076 (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2077 (WebCore::rotationMatrixToQuaternion):
2078 (WebCore::VRPlatformDisplayOpenVR::getTrackingInfo):
2079 * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2081 2018-04-09 Michael Catanzaro <mcatanzaro@igalia.com>
2083 [GTK] WaylandCompositorDisplay leaks its wl_display
2084 https://bugs.webkit.org/show_bug.cgi?id=184406
2086 Reviewed by Carlos Garcia Campos.
2088 Remove the protected default constructor, for good measure.
2090 * platform/graphics/wayland/PlatformDisplayWayland.h:
2092 2018-04-08 Fujii Hironori <Hironori.Fujii@sony.com>
2094 [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
2095 https://bugs.webkit.org/show_bug.cgi?id=184127
2097 Reviewed by Konstantin Tokarev.
2099 No new tests (No behaviour changes).
2101 * CMakeLists.txt: Added a interface library WebCoreHeaderInterface.
2103 2018-04-08 Yusuke Suzuki <utatane.tea@gmail.com>
2105 Use alignas instead of compiler-specific attributes
2106 https://bugs.webkit.org/show_bug.cgi?id=183508
2108 Reviewed by Mark Lam.
2110 Use alignas instead of aligned.
2112 * platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
2113 * platform/graphics/cpu/arm/filters/FELightingNEON.h:
2114 (WebCore::FELighting::platformApplyNeon):
2116 2018-04-08 Michael Catanzaro <mcatanzaro@igalia.com>
2118 [WPE][GTK] Remove applicationDirectoryPath() and sharedResourcePath()
2119 https://bugs.webkit.org/show_bug.cgi?id=184381
2121 Reviewed by Carlos Garcia Campos.
2125 * platform/FileSystem.h:
2126 * platform/glib/FileSystemGlib.cpp:
2127 (WebCore::FileSystem::applicationDirectoryPath): Deleted.
2128 (WebCore::FileSystem::sharedResourcesPath): Deleted.
2130 2018-04-07 Daniel Bates <dabates@apple.com>
2132 Have WorkerScriptLoader::loadAsynchronously() take a FetchOptions
2133 https://bugs.webkit.org/show_bug.cgi?id=184385
2135 Reviewed by Youenn Fablet.
2137 Currently we pass various FetchOptions to WorkerScriptLoader::loadAsynchronously()
2138 so that it can build up a ThreadableLoaderOptions structure to pass to the loader.
2139 Each time we want to set another FetchOptions option we need to add a new parameter.
2140 Instead we should have WorkerScriptLoader::loadAsynchronously() take a FetchOptions.
2141 This will make it straightforward for a caller to set new loader options as needed.
2142 In particular, this will make it straightforward to support setting the request's
2143 destination flag (i.e. FetchOptions::destination) to support blocking scripts with
2144 a non-JavaScript MIME type in a subsequent commit.
2146 No functionality changed. So, no new tests.
2148 * loader/ResourceLoaderOptions.h:
2149 (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Modified to take a FetchOptions
2150 by value so as to support both move and copy semantics.
2151 * loader/ThreadableLoader.cpp:
2152 (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Added helper constructor
2153 that takes a FetchOptions.
2154 * loader/ThreadableLoader.h:
2155 * workers/Worker.cpp:
2156 (WebCore::Worker::create): Instantiate and pass a FetchOptions to the loader for the mode,
2157 cache policy, and redirect policy.
2158 * workers/WorkerScriptLoader.cpp:
2159 (WebCore::WorkerScriptLoader::loadAsynchronously): Modified to take a FetchOptions and
2160 instantiate a ThreadableLoaderOptions from it.
2161 * workers/WorkerScriptLoader.h:
2162 * workers/WorkerScriptLoaderClient.h:
2163 (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const): Deleted. This function
2164 is no longer needed because the Service Worker client now passes the service worker mode
2165 directly to the loader.
2166 * workers/service/ServiceWorkerJob.cpp:
2167 (WebCore::ServiceWorkerJob::fetchScriptWithContext): Instantiate and pass a FetchOptions
2169 * workers/service/ServiceWorkerJob.h:
2171 2018-04-07 Timothy Hatcher <timothy@apple.com>
2173 Use the system's link color when system appearance is desired for a WebView.
2175 https://bugs.webkit.org/show_bug.cgi?id=184353
2176 rdar://problem/9420053
2178 Reviewed by Wenson Hsieh.
2180 Have Document consult RenderTheme via StyleColor for the various link colors.
2181 This allows the system to have different colors than the standard hardcoded ones.
2182 This adds StyleColor::Options, to avoid multiple booleans being passed around,
2183 since the "for visited link" state is now needed in RenderTheme.
2185 * WebCore.xcodeproj/project.pbxproj: Made StyleColor.h private, since RenderTheme.h includes it.
2186 * css/StyleColor.cpp:
2187 (WebCore::StyleColor::colorFromKeyword): Use options instead of a bool.
2188 (WebCore::StyleColor::isSystemColor): Consider CSSValueWebkitLink the start of system colors.
2190 * css/StyleResolver.cpp:
2191 (WebCore::StyleResolver::colorFromPrimitiveValue const): Use StyleColor::Options.
2192 * css/parser/CSSParser.cpp:
2193 (WebCore::CSSParser::parseSystemColor): Use StyleColor::Options.
2195 (WebCore::Document::resetLinkColor): Ask StyleColor for the link color instead of hardcoding it.
2196 (WebCore::Document::resetVisitedLinkColor): Ditto.
2197 (WebCore::Document::resetActiveLinkColor): Ditto.
2198 (WebCore::Document::styleColorOptions const): Added. Helper to get the options used.
2200 * html/canvas/CanvasRenderingContext2D.cpp:
2201 (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Use StyleColor::Options.
2202 * rendering/RenderTheme.cpp:
2203 (WebCore::RenderTheme::systemColor const): Add default values here, moved from Document.
2204 (WebCore::RenderTheme::focusRingColor): Use StyleColor::Options.
2205 * rendering/RenderTheme.h:
2206 (WebCore::RenderTheme::platformFocusRingColor const): Use StyleColor::Options.
2207 * rendering/RenderThemeGtk.cpp:
2208 (WebCore::RenderThemeGtk::systemColor const): Use StyleColor::Options.
2209 * rendering/RenderThemeGtk.h:
2210 * rendering/RenderThemeIOS.h:
2211 * rendering/RenderThemeIOS.mm:
2212 (WebCore::RenderThemeIOS::systemColor const): Use StyleColor::Options.
2213 * rendering/RenderThemeMac.h:
2214 * rendering/RenderThemeMac.mm:
2215 (WebCore::RenderThemeMac::platformFocusRingColor const): Use StyleColor::Options.
2216 (WebCore::RenderThemeMac::platformColorsDidChange): Clear m_systemVisitedLinkColor.
2217 (WebCore::RenderThemeMac::systemColor const): Use StyleColor::Options.
2218 (WebCore::RenderThemeMac::adjustMenuListStyle const): Ditto.
2219 * rendering/RenderThemeWin.cpp:
2220 (WebCore::RenderThemeWin::systemColor const): Use StyleColor::Options.
2221 * rendering/RenderThemeWin.h:
2222 * rendering/TextPaintStyle.cpp:
2223 (WebCore::computeTextPaintStyle): Use StyleColor::Options.
2225 2018-04-06 Youenn Fablet <youenn@apple.com>
2227 Response headers should be filtered when sent from NetworkProcess to WebProcess
2228 https://bugs.webkit.org/show_bug.cgi?id=184310
2230 Reviewed by Ryosuke Niwa.
2232 Did some refactoring to allow ResourceResponse to use header value parsing routines.
2233 We add sanitization levels for regular responses in case responses might be exposed to scripts or not.
2234 If not exposed to scripts, additional filtering is done.
2236 Add internal API to get unfiltered response headers from a fetch response.
2237 Test: http/wpt/service-workers/header-filtering.https.html
2239 * Modules/fetch/FetchResponse.h:
2240 * loader/CrossOriginPreflightResultCache.cpp:
2241 (WebCore::CrossOriginPreflightResultCacheItem::parse):
2242 * platform/network/HTTPParsers.h:
2243 (WebCore::addToAccessControlAllowList):
2244 (WebCore::parseAccessControlAllowList):
2245 * platform/network/ResourceResponseBase.cpp:
2246 (WebCore::isSafeToKeepRedirectionResponseHeader):
2247 (WebCore::isCrossOriginSafeToKeepResponseHeader):
2248 (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
2249 * platform/network/ResourceResponseBase.h:
2250 * testing/ServiceWorkerInternals.cpp:
2251 (WebCore::ServiceWorkerInternals::fetchResponseHeaderList):
2252 * testing/ServiceWorkerInternals.h:
2253 * testing/ServiceWorkerInternals.idl:
2255 2018-04-06 Michael Catanzaro <mcatanzaro@igalia.com>
2257 Unreviewed, fix unused parameter warning when credential storage is disabled
2259 * platform/network/soup/NetworkStorageSessionSoup.cpp:
2260 (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2262 2018-04-06 Eric Carlson <eric.carlson@apple.com>
2264 [Extra zoom mode] Block playback until fullscreen begins
2265 https://bugs.webkit.org/show_bug.cgi?id=184371
2266 <rdar://problem/39250891>
2268 Reviewed by Youenn Fablet.
2270 * html/HTMLMediaElement.cpp:
2271 (WebCore::HTMLMediaElement::updatePlayState): Return early when waiting to enter fullscreen.
2272 (WebCore::HTMLMediaElement::enterFullscreen): Set m_waitingToEnterFullscreen.
2273 (WebCore::HTMLMediaElement::exitFullscreen): Clear m_waitingToEnterFullscreen.
2274 (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto.
2275 * html/HTMLMediaElement.h:
2277 2018-04-06 Brent Fulgham <bfulgham@apple.com>
2279 WebCore::screenSupportsExtendedColor improperly calls NSScreen functions in the WebContent process
2280 https://bugs.webkit.org/show_bug.cgi?id=184364
2281 <rdar://problem/39246314>
2283 Reviewed by Per Arne Vollan.
2285 The WebContent process is interacting directly with NSScreen to determine if the current screen
2286 has extended color support. This should be brokered from the UIProcess.
2288 Tested by fast/media/mq-color-gamut.html.
2290 * platform/ScreenProperties.h:
2291 (WebCore::ScreenProperties::encode const): Add screenSupportsExtendedColor.
2292 (WebCore::ScreenProperties::decode): Ditto.
2293 * platform/mac/PlatformScreenMac.mm:
2294 (WebCore::getScreenProperties): Retrieve extended color support.
2295 (WebCore::screenSupportsExtendedColor): Retrieve cached version when in the WebContent
2296 process. Assert that NSScreen is not accessed in the WebContent process.
2298 2018-04-06 Fujii Hironori <Hironori.Fujii@sony.com>
2300 [Win][WebCore] Expose a constant for scrollbar pixels per line (cScrollbarPixelsPerLine)
2301 https://bugs.webkit.org/show_bug.cgi?id=184296
2303 Reviewed by Alex Christensen.
2305 No new tests (No behavior changes).
2307 * platform/PlatformWheelEvent.h: Placed cScrollbarPixelsPerLine definition.
2308 * platform/win/WheelEventWin.cpp:
2309 (WebCore::PlatformWheelEvent::PlatformWheelEvent): Removed cScrollbarPixelsPerLine definition.
2311 2018-04-06 Brent Fulgham <bfulgham@apple.com>
2313 Unreviewed test fix after r230323
2315 * platform/mac/PlatformScreenMac.mm:
2316 (WebCore::screenSupportsExtendedColor): Remove assertion hit during test runs.
2318 2018-04-06 Brent Fulgham <bfulgham@apple.com>
2320 WebCore::screenColorSpace is retrieving CGColorSpace from NSScreen directly
2321 https://bugs.webkit.org/show_bug.cgi?id=184343
2322 <rdar://problem/39224881>
2324 Reviewed by Per Arne Vollan.
2326 Revise ScreenProperties to serialize the screen's color space, and later
2327 retrieve that in the WebContent process. This allows us to close off
2328 the CGSWindowServer connection.
2330 * platform/ScreenProperties.h:
2331 (WebCore::ScreenProperties::encode const): Add CGColorSpaceRef support.
2332 (WebCore::ScreenProperties::decode): Ditto.
2333 * platform/mac/PlatformScreenMac.mm:
2334 (WebCore::displayID): Add assertion to prevent use in WebContent process.
2335 (WebCore::firstScreen): Ditto.
2336 (WebCore::getScreenProperties): Add support for CGColorSpaceRef.
2337 (WebCore::screenColorSpace): Retrieve cached version when in WebContent process.
2338 Assert that NSScreen is not accessed in WebContent process.
2340 2018-04-06 Ms2ger <Ms2ger@igalia.com>
2342 Implement createImageBitmap(Blob)
2343 https://bugs.webkit.org/show_bug.cgi?id=183247
2345 Reviewed by Dean Jackson.
2348 - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
2349 - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
2351 * fileapi/FileReaderLoader.h:
2352 (WebCore::FileReaderLoader::url): expose the Blob's URL.
2353 * html/ImageBitmap.cpp: implement createImageBitmap(Blob).
2354 * html/ImageBitmap.h: allow the BlobImageObserver class access to the creation function.
2355 * loader/cache/CachedImage.cpp: reuse extracted code.
2356 (WebCore::CachedImage::isPDFResource const):
2357 (WebCore::CachedImage::isPostScriptResource const):
2358 (WebCore::CachedImage::createImage):
2359 * platform/graphics/Image.cpp: extract some code from CachedImage to reuse.
2360 (WebCore::Image::create):
2361 (WebCore::Image::isPDFResource):
2362 (WebCore::Image::isPostScriptResource):
2363 * platform/graphics/Image.h: add declarations.
2365 2018-04-06 Zalan Bujtas <zalan@apple.com>
2367 Flex child does not get repainted when it is inserted back to the render tree.
2368 https://bugs.webkit.org/show_bug.cgi?id=184361
2369 <rdar://problem/34528716>
2371 Reviewed by Antti Koivisto.
2373 As with any regular block children, we should issue full repaint for flexbox items on their
2374 first layout (see RenderBlockFlow::layoutBlockChild()).
2376 Test: fast/flexbox/missing-repaint-when-flext-item-never-had-layout.html
2378 * rendering/RenderFlexibleBox.cpp:
2379 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
2381 2018-04-06 Ms2ger <Ms2ger@igalia.com>
2383 Support transferring ImageBitmap objects
2384 https://bugs.webkit.org/show_bug.cgi?id=183131
2386 Reviewed by Dean Jackson.
2388 Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html
2390 * bindings/js/SerializedScriptValue.cpp:
2391 (WebCore::CloneSerializer::serialize): thread through ImageBitmaps.
2392 (WebCore::CloneSerializer::CloneSerializer): thread through ImageBitmaps.
2393 (WebCore::CloneSerializer::fillTransferMap): don't require a mutable reference.
2394 (WebCore::CloneSerializer::dumpImageBitmap): add.
2395 (WebCore::CloneSerializer::dumpIfTerminal): check for ImageBitmap.
2396 (WebCore::CloneDeserializer::deserialize): thread through ImageBitmaps.
2397 (WebCore::CloneDeserializer::CloneDeserializer): thread through ImageBitmaps.
2398 (WebCore::CloneDeserializer::readImageBitmap): add.
2399 (WebCore::CloneDeserializer::readTerminal): check for ImageBitmap.
2400 (WebCore::SerializedScriptValue::SerializedScriptValue): thread through ImageBitmaps.
2401 (WebCore::SerializedScriptValue::create): thread through ImageBitmaps.
2402 (WebCore::containsDuplicates): add.
2403 (WebCore::SerializedScriptValue::deserialize): handle ImageBitmap arguments.
2404 * bindings/js/SerializedScriptValue.h: update signatures, add member.
2405 * html/ImageBitmap.cpp:
2406 (WebCore::ImageBitmap::create): add.
2407 (WebCore::ImageBitmap::detachBitmaps): add.
2408 * html/ImageBitmap.h: add signatures.
2410 2018-04-06 Said Abou-Hallawa <sabouhallawa@apple.com>
2412 When recording the drawing, the DisplayList should be initialized with the GraphicsContextState of the underlying GraphicsContext
2413 https://bugs.webkit.org/show_bug.cgi?id=184336
2415 Reviewed by Antti Koivisto.
2417 The state of the drawing context has to be transfered to the recording
2418 DisplayList before recording. Many recording GraphicsContext functions
2419 will behave wrongly if it gets the default state.
2421 * html/canvas/CanvasRenderingContext2DBase.cpp:
2422 (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
2423 (WebCore::CanvasRenderingContext2DBase::drawingContext const):
2424 * platform/graphics/ca/GraphicsLayerCA.cpp:
2425 (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2426 * platform/graphics/displaylists/DisplayListRecorder.cpp:
2427 (WebCore::DisplayList::Recorder::Recorder):
2428 * platform/graphics/displaylists/DisplayListRecorder.h:
2429 (WebCore::DisplayList::Recorder::ContextState::ContextState):
2430 (WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
2431 * platform/graphics/displaylists/DisplayListReplayer.cpp:
2432 (WebCore::DisplayList::Replayer::replay):
2433 * platform/graphics/displaylists/DisplayListReplayer.h:
2434 (WebCore::DisplayList::Replayer::replay): If we do not have a clipping
2435 rectangle and we want to record all the drawing, we need a default value
2436 for the clipping rectangle and we want no clipping to happen.
2438 2018-04-06 Daniel Bates <dabates@apple.com>
2440 Emit a more informative message when a script is blocked due to "X-Content-Type: nosniff"
2441 https://bugs.webkit.org/show_bug.cgi?id=184359
2443 Reviewed by Per Arne Vollan.
2445 Emphasize in the message that the script was blocked from executing.
2447 Test: http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html
2449 * dom/LoadableClassicScript.cpp:
2450 (WebCore::LoadableClassicScript::notifyFinished):
2451 * workers/WorkerScriptLoader.cpp:
2452 (WebCore::WorkerScriptLoader::didReceiveResponse):
2454 2018-04-06 Daniel Bates <dabates@apple.com>
2456 importScripts() should throw exception with a reason when it fails to load a script from the network
2457 https://bugs.webkit.org/show_bug.cgi?id=184345
2459 Reviewed by Alexey Proskuryakov.
2461 Currently importScripts() throws a NetworkError exception without a reason when
2462 it fails to load a script from the network. It is ambiguous whether the load failed
2463 due to an access control failure or some other error. Instead we should include
2464 the reason the load failed in the thrown exception.
2466 * workers/WorkerGlobalScope.cpp:
2467 (WebCore::WorkerGlobalScope::importScripts):
2469 2018-04-06 Daniel Bates <dabates@apple.com>
2471 Attempt to fix the build after <https://trac.webkit.org/changeset/230338>
2472 (https://bugs.webkit.org/show_bug.cgi?id=184360)
2474 Make lambdas mutable so that we can WTFMove() their captured arguments.
2476 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2477 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
2478 (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
2479 (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
2481 2018-04-06 Daniel Bates <dabates@apple.com>
2483 Have class Exception take String by value instead of a String&&
2484 https://bugs.webkit.org/show_bug.cgi?id=184360
2486 Reviewed by Alexey Proskuryakov.
2488 For convenience support instantiating an Exception with either an lvalue String or
2491 Although it can be argued that having Exception take a String by value instead of String&&
2492 can lead to missed opportunities to WTFMove() a String object into Exception such mistakes
2493 are just that, missed opportunities. That is, correctness is not affected and we may perform
2494 an unnecessary ref/deref of the underlying StringImpl when instantiating an Exception. If
2495 such missed opportunities show up in profiles and such mistakes happen often then we can
2496 re-evaluate the decision to have Exception take a String by value.
2498 * Modules/cache/DOMCache.cpp:
2499 (WebCore::DOMCache::put): Simplify code now that Exception takes a String by value.
2500 * Modules/fetch/FetchResponse.cpp:
2501 (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
2502 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2503 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed): Move String into Exception to avoid an
2504 unnecessary ref/de-ref.
2505 (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed): Ditto.
2506 (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed): Ditto.
2508 (WebCore::Exception::Exception): Take String by value. Also use uniform initializer syntax.
2510 2018-04-06 Antti Koivisto <antti@apple.com>
2512 Tighten ImageSource to have BitmapImage pointer instead of Image
2513 https://bugs.webkit.org/show_bug.cgi?id=184356
2515 Reviewed by Said Abou-Hallawa.
2517 ImageSource is an implementation detail of BitmapImage, not a generic type.
2519 * loader/ImageLoader.cpp:
2520 (WebCore::ImageLoader::decode):
2521 * platform/graphics/BitmapImage.h:
2522 * platform/graphics/Image.h:
2523 (WebCore::Image::decode): Deleted.
2524 (WebCore::Image::imageFrameAvailableAtIndex): Deleted.
2526 Also make some BitmapImage specific functions non-virtual and remove them from Image.
2528 * platform/graphics/ImageSource.cpp:
2529 (WebCore::ImageSource::ImageSource):
2530 * platform/graphics/ImageSource.h:
2531 (WebCore::ImageSource::create):
2533 Make constructors private.
2535 * platform/graphics/cg/GraphicsContext3DCG.cpp:
2536 (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2538 2018-04-06 Brent Fulgham <bfulgham@apple.com>
2540 Unreviewed test fix after r230323
2542 * platform/mac/PlatformScreenMac.mm:
2543 (WebCore::screen): Remove assertion we still hit due to event handling code.
2545 2018-04-05 Youenn Fablet <youenn@apple.com>
2547 REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
2548 https://bugs.webkit.org/show_bug.cgi?id=184306
2550 Reviewed by Ryosuke Niwa.
2552 Add an option to not compile CSS rules since they are not useful in NetworkProcess.
2553 Covered by tests no longer crashing in Debug WK2 bots.
2555 * contentextensions/ContentExtension.cpp:
2556 (WebCore::ContentExtensions::ContentExtension::create):
2557 (WebCore::ContentExtensions::ContentExtension::ContentExtension):
2558 * contentextensions/ContentExtension.h:
2559 * contentextensions/ContentExtensionsBackend.cpp:
2560 (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
2561 * contentextensions/ContentExtensionsBackend.h:
2563 2018-04-05 Brent Fulgham <bfulgham@apple.com>
2565 WebContent process is calling CGDisplayUsesInvertedPolarity
2566 https://bugs.webkit.org/show_bug.cgi?id=184337
2567 <rdar://problem/39215702>
2569 Reviewed by Zalan Bujtas.
2571 The PlatformScreenMac code is still calling display-related routines directly, specifically
2572 CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
2575 There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
2576 the compile guards so all macOS builds use this behavior.
2578 Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
2579 routines in the future.
2581 Tested by existing regression tests.
2583 * platform/PlatformScreen.h:
2584 * platform/ScreenProperties.h:
2585 (WebCore::ScreenProperties::encode const): Add new values.
2586 (WebCore::ScreenProperties::decode):
2587 * platform/mac/PlatformScreenMac.mm:
2588 (WebCore::displayID): Add assertion that this is not calling display-related routines in
2589 the WebContent process.
2590 (WebCore::firstScreen): Ditto.
2591 (WebCore::screenProperties): Moved higher in the file so it can be reused. Add calls to
2592 CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray.
2593 (WebCore::getScreenProperties): Moved higher in the file so it can be reused. Stop
2594 double-hashing displayID.
2595 (WebCore::screenIsMonochrome): Use cached values in WebContent process. Assert if this
2596 code attempts a display-related routine in the WebContent process.
2597 (WebCore::screenHasInvertedColors): Ditto.
2598 (WebCore::screenDepth): Add assertion that this is not calling display-related routines in
2599 the WebContent process.
2600 (WebCore::screenDepthPerComponent): Ditto.
2601 (WebCore::screenRect): Ditto.
2602 (WebCore::screenAvailableRect): Ditto.
2603 (WebCore::screen): Ditto.
2604 (WebCore::screenColorSpace): Ditto.
2605 (WebCore::screenSupportsExtendedColor): Ditto.
2607 2018-04-05 John Wilander <wilander@apple.com>
2609 Resource Load Statistics: Apply cookie blocking to setCookiesFromDOM()
2610 https://bugs.webkit.org/show_bug.cgi?id=184346
2611 <rdar://problem/39226036>
2613 Reviewed by Brent Fulgham.
2615 Since these cookies can't be seen and are not sent in requests, I
2616 can't write an automated test for them. This really should have been
2617 done as part of: https://bugs.webkit.org/show_bug.cgi?id=180682.
2618 That said, I have tested this manually.
2620 * platform/network/mac/CookieJarMac.mm:
2621 (WebCore::setCookiesFromDOM):
2623 2018-04-05 Zalan Bujtas <zalan@apple.com>
2625 Folding anonymous blocks should not result in deleting content.
2626 https://bugs.webkit.org/show_bug.cgi?id=184339
2627 <rdar://problem/37327428>
2629 Reviewed by Antti Koivisto.
2631 While folding multiple anonymous blocks (moving the children from next sibling over to previous sibling)
2632 we should ensure that the block we are about to destroy does not gain new descendants.
2633 In case of 4 sibling anonymous blocks (A B C D), while destroying B
2634 1. we move C's children to A and destroy C.
2635 2. While destroying C, we notice B and C as sibling anonymous blocks and we move
2636 D's children over to B (even though B is going to be destroyed as we climb back on the stack).
2638 In this patch, B is detached from the tree before we start moving renderers around so that a subsequent folding won't
2639 find B anymore as a candidate.
2641 Test: fast/block/crash-while-folding-anonymous-blocks.html
2643 * rendering/updating/RenderTreeBuilderBlock.cpp:
2644 (WebCore::RenderTreeBuilder::Block::detach):
2646 2018-04-05 Andy Estes <aestes@apple.com>
2648 Mark Payment Request as "Supported" in features.json
2649 https://bugs.webkit.org/show_bug.cgi?id=184338
2651 Reviewed by Anders Carlsson.
2655 2018-04-05 Chris Dumez <cdumez@apple.com>
2657 Unreviewed, rolling out r230042.
2659 It is no longer needed now that it is safe to construct a
2660 SecurityOrigin from an on-main thread
2664 "WebSocket::didReceiveMessage() may construct a SecurityOrigin
2665 object on a non-main thread"
2666 https://bugs.webkit.org/show_bug.cgi?id=184068
2667 https://trac.webkit.org/changeset/230042
2669 2018-04-05 Yusuke Suzuki <utatane.tea@gmail.com>
2671 [WTF] Remove StaticLock
2672 https://bugs.webkit.org/show_bug.cgi?id=184332
2674 Reviewed by Mark Lam.
2678 * Modules/webdatabase/Database.cpp:
2679 (WebCore::Database::Database):
2680 (WebCore::Database::performOpenAndVerify):
2681 (WebCore::Database::closeDatabase):
2682 (WebCore::Database::getCachedVersion const):
2683 (WebCore::Database::setCachedVersion):
2684 * Modules/webdatabase/DatabaseTracker.cpp:
2685 (WebCore::DatabaseTracker::openDatabaseMutex):
2686 * Modules/webdatabase/DatabaseTracker.h:
2687 * Modules/websockets/WebSocket.cpp:
2688 (WebCore::WebSocket::allActiveWebSocketsMutex):
2689 * Modules/websockets/WebSocket.h:
2690 * bridge/objc/WebScriptObject.mm:
2691 * crypto/CryptoAlgorithmRegistry.cpp:
2692 (WebCore::CryptoAlgorithmRegistry::identifier):
2693 (WebCore::CryptoAlgorithmRegistry::name):
2694 (WebCore::CryptoAlgorithmRegistry::create):
2695 (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
2698 * platform/graphics/FontCache.cpp:
2699 * platform/graphics/MediaPlayer.cpp:
2700 * platform/ios/QuickLook.mm:
2701 * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
2702 * platform/ios/wak/WebCoreThread.mm:
2703 * platform/ios/wak/WebCoreThreadRun.cpp:
2704 * platform/network/cf/LoaderRunLoopCF.cpp:
2705 (WebCore::loaderRunLoop):
2706 * platform/network/curl/CurlContext.cpp:
2707 (WebCore::CurlShareHandle::mutexFor):
2708 * platform/network/curl/CurlContext.h:
2709 * platform/sql/SQLiteDatabaseTracker.cpp:
2710 (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
2711 (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
2712 * platform/text/TextEncodingRegistry.cpp:
2713 (WebCore::buildBaseTextCodecMaps):
2714 (WebCore::newTextCodec):
2715 (WebCore::atomicCanonicalTextEncodingName):
2716 * workers/WorkerThread.cpp:
2717 (WebCore::WorkerThread::workerThreadCount):
2718 (WebCore::WorkerThread::WorkerThread):
2719 (WebCore::WorkerThread::~WorkerThread):
2720 (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
2722 2018-04-04 Youenn Fablet <youenn@apple.com>
2724 WebRTC data channel only applications require capture permissions for direct connections
2725 https://bugs.webkit.org/show_bug.cgi?id=174500
2726 <rdar://problem/34134281>
2728 Reviewed by Eric Carlson.
2730 Test: webrtc/datachannel/mdns-ice-candidates.html
2732 Add support at PeerConnectionBackend to obfuscate any gathered host candidate
2733 by replacing the IP address with an opaque name that can be resolved by MDNS.
2734 An opaque name is generated for each IP address and is scoped by the document owning the peer connection object.
2736 Add support to resolve any such MDNS ICE candidate.
2737 A limit of 250 ms is fixed for the resolution to happen.
2738 After 250 ms, the candidate is discarded.
2740 Add an experimental flag around this feature, off by default.
2742 * Modules/mediastream/PeerConnectionBackend.cpp:
2743 (WebCore::extractIPAddres):
2744 (WebCore::PeerConnectionBackend::addIceCandidate):
2745 (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
2746 (WebCore::PeerConnectionBackend::addIceCandidateFailed):
2747 (WebCore::PeerConnectionBackend::newICECandidate):
2748 (WebCore::PeerConnectionBackend::doneGatheringCandidates):
2749 (WebCore::PeerConnectionBackend::registerMDNSName):
2750 (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
2751 * Modules/mediastream/PeerConnectionBackend.h:
2752 * Modules/mediastream/RTCIceCandidate.h:
2753 (WebCore::RTCIceCandidate::setCandidate):
2754 * Modules/mediastream/RTCPeerConnection.h:
2756 (WebCore::Document::prepareForDestruction):
2757 (WebCore::Document::suspend):
2758 * page/RuntimeEnabledFeatures.h:
2759 (WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const):
2760 (WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled):
2761 * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2763 2018-04-04 Brian Burg <bburg@apple.com>
2765 [Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
2766 https://bugs.webkit.org/show_bug.cgi?id=184314
2767 <rdar://problem/39186578>
2769 Reviewed by Timothy Hatcher.
2771 Covered by several tests in add_cookie.py per the bug title.
2773 * platform/network/cocoa/CookieCocoa.mm:
2774 (WebCore::Cookie::operator NSHTTPCookie * const):
2775 By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
2776 precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
2777 the truncated value and actual value are the same.
2779 2018-04-04 Alex Christensen <achristensen@webkit.org>
2781 Move PingHandle to WebKitLegacy
2782 https://bugs.webkit.org/show_bug.cgi?id=184145
2784 Reviewed by Youenn Fablet.
2786 * WebCore.xcodeproj/project.pbxproj:
2787 * platform/network/PingHandle.h: Removed.
2789 2018-04-04 Per Arne Vollan <pvollan@apple.com>
2791 The layout test fast/canvas/canvas-blending-global-alpha.html is failing when the WebContent process does not have WindowServer access.
2792 https://bugs.webkit.org/show_bug.cgi?id=183752
2793 <rdar://problem/38635731>
2795 The test is failing because the system is only providing software rendering when there is no access
2796 to the WindowServer, and software rendering is producing slightly different results than hardware
2797 rendering. To enable accelerated rendering, the GPU to be used for IOSurface rendering needs to be
2798 selected by handing over the OpenGL display mask to the IOSurface CGContext.
2800 Reviewed by Brent Fulgham.
2802 No new tests, covered by existing tests.
2804 * platform/graphics/GraphicsContext3D.h:
2805 * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2806 (WebCore::GraphicsContext3D::getOpenGLDisplayMask):
2807 * platform/graphics/cocoa/IOSurface.mm:
2808 (WebCore::IOSurface::ensurePlatformContext):
2810 2018-04-04 Said Abou-Hallawa <sabouhallawa@apple.com>
2812 Track the paint frequency through a new class named PaintFrequencyTracker
2813 https://bugs.webkit.org/show_bug.cgi?id=184311
2815 Reviewed by Antti Koivisto.
2817 PaintFrequencyTracker is a class which detects when a layer is painted
2818 frequently. SinglePaintFrequencyTracking is used in conjunction with
2819 PaintFrequencyTracker to recored a single paint timing.
2821 * rendering/PaintFrequencyTracker.h: Added.
2822 (WebCore::PaintFrequencyTracker::begin):
2823 (WebCore::PaintFrequencyTracker::end):
2824 (WebCore::PaintFrequencyTracker::paintingFrequently const):
2825 Simplify the logic for tracking the paint frequency and move it from
2828 (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
2829 (WebCore::SinglePaintFrequencyTracking::~SinglePaintFrequencyTracking):
2830 A convenient way to bracket the begin() and the end() methods of
2831 PaintFrequencyTracker.
2833 * rendering/RenderLayer.cpp:
2834 (WebCore::RenderLayer::paintLayerContents):
2835 (WebCore::RenderLayer::calculateClipRects const):
2836 (WebCore::PaintFrequencyInfo::PaintFrequencyInfo): Deleted.
2837 (WebCore::PaintFrequencyInfo::setPaintedCacheableResource): Deleted.
2838 (WebCore::PaintFrequencyInfo::paintingFrequently const): Deleted.
2839 (WebCore::PaintFrequencyInfo::updatePaintFrequency): Deleted.
2840 (WebCore::PaintFrequencyInfo::paintingCacheableResource): Deleted.
2841 * rendering/RenderLayer.h:
2842 Rename PaintFrequencyInfo to PaintFrequencyTracker and move it a separate
2845 2018-04-04 Jer Noble <jer.noble@apple.com>
2847 RELEASE_ASSERT in CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF() when MediaToolbox.framework missing
2848 https://bugs.webkit.org/show_bug.cgi?id=184247
2849 <rdar://problem/39007591>
2851 Rubber-stamped by Eric Carlson.
2853 Use SOFT_LINK_FRAMEWORK_OPTIONAL for frameworks which are not guaranteed to be present.
2855 * page/CaptionUserPreferencesMediaAF.cpp:
2856 (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF):
2858 2018-04-04 Brent Fulgham <bfulgham@apple.com>
2860 Failures from mach port reference handling should be fatal
2861 https://bugs.webkit.org/show_bug.cgi?id=184202
2862 <rdar://problem/37771114>
2864 Reviewed by Anders Carlsson.
2866 We may corrupt the Mach port space by improperly matching the equivalent of reference counting
2867 retains (mach_port_mod_refs) with releases (mach_port_deallocate).
2869 Our current implementation of MachSendRights::create does not grab a reference if the passed
2870 port is MACH_PORT_DEAD, but we unconditionally call mach_port_deallocate on the port, which
2871 could lead to a reference count mismatch.
2873 Likewise, our MachSendRight destructor does not release the port if it has changed to MACH_PORT_DEAD
2874 (e.g., if a child process dies), again leading to a mismatch in retain/releases.
2876 Finally, failures in mach_port_deallocate should be fatal because they indicate that the
2877 application was attempting to remove an unowned right. This is a fatal condition for Mach, and
2878 should lead to an abort.
2880 This patch does the following:
2882 1. It creates a helper function that does the right thing for safely deallocating a mach port.
2883 2. It uses it in multiple places.
2884 3. It revises 'MachSendRight::create" so that it properly handles the condition of a dead port.
2885 4. It revises the MachSendRight destructor to properly handle the condition of a dead port.
2887 No new tests, no change in behavior expected.
2889 * SourcesCocoa.txt: Update for move of MachSendRight files.
2890 * WebCore.xcodeproj/project.pbxproj: Ditto.
2891 * page/cocoa/ResourceUsageThreadCocoa.mm:
2892 (WebCore::getMachThreads): Added.
2893 (WebCore::cpuUsage): Use the new cleanup helper function.
2894 * platform/cocoa/MachSendRight.cpp: Removed.
2895 * platform/cocoa/MachSendRight.h: Removed.
2896 * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
2897 (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2898 * platform/graphics/cocoa/IOSurface.h:
2899 * platform/graphics/cocoa/IOSurface.mm:
2901 2018-04-04 Youenn Fablet <youenn@apple.com>
2903 Remove unused HTTP header names
2904 https://bugs.webkit.org/show_bug.cgi?id=184272
2906 Reviewed by Alex Christensen.
2908 No change of behavior.
2909 Removed some names that are not used in the code base.
2910 This allows to strengthen filtering of responses sent to WebProcess.
2911 Added two headers used by web inspector.
2912 Updated existing code to use indexed HTTP header names.
2914 * html/parser/XSSAuditor.cpp:
2915 (WebCore::XSSAuditor::init):
2916 * inspector/agents/InspectorPageAgent.cpp:
2917 (WebCore::InspectorPageAgent::sourceMapURLForResource):
2918 * platform/network/HTTPHeaderNames.in:
2920 2018-04-04 Beth Dakin <bdakin@apple.com>
2922 Fix the !HAVE(AVFOUNDATION_VIDEO_OUTPUT) build
2923 https://bugs.webkit.org/show_bug.cgi?id=184309
2925 rdar://problem/39179126
2927 Reviewed by Jer Noble.
2929 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2930 (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
2931 (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2933 2018-04-04 Youenn Fablet <youenn@apple.com>
2935 MockRealtimeVideoSourceMac should produce kCVPixelFormatType_420YpCbCr8Planar buffers
2936 https://bugs.webkit.org/show_bug.cgi?id=184304
2938 Reviewed by Eric Carlson.
2940 Allows covering RealtimeOutgoingVideoSourceMac code path handling native buffers produced by capture video sources.
2941 ARGB buffer coverage is done through canvas capture streams.
2943 * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
2944 * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2945 (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
2947 2018-04-04 Youenn Fablet <youenn@apple.com>
2949 Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main thread
2950 https://bugs.webkit.org/show_bug.cgi?id=183988
2952 Reviewed by Darin Adler.
2954 No change of behavior, TrackPrivate remains destroyed on the main thread.
2956 * platform/graphics/TrackPrivateBase.h:
2957 * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2958 (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2959 (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
2961 2018-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
2963 Unreviewed. Fix the build with libsoup < 2.49.91 after r230251.
2965 Stop using ResourceHandle in SoupNetworkSession.
2967 * platform/network/soup/SoupNetworkSession.cpp:
2968 (WebCore::SoupNetworkSession::SoupNetworkSession):
2969 (WebCore::authenticateCallback): Deleted.
2970 (WebCore::requestStartedCallback): Deleted.
2972 2018-04-03 Alex Christensen <achristensen@webkit.org>
2974 Remove unused libsoup ResourceHandle implementation
2975 https://bugs.webkit.org/show_bug.cgi?id=184048
2977 Reviewed by Michael Catanzaro.
2979 This code is unused since r228901 so let's remove it!
2981 * platform/network/ResourceHandle.h:
2982 * platform/network/ResourceHandleInternal.h:
2983 (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2984 * platform/network/soup/ResourceHandleSoup.cpp:
2985 (WebCore::ResourceHandle::~ResourceHandle):
2986 (WebCore::ResourceHandleInternal::soupSession):
2987 (WebCore::ResourceHandle::cancelledOrClientless):
2988 (WebCore::ResourceHandle::ensureReadBuffer):
2989 (WebCore::ResourceHandle::currentStreamPosition const):
2990 (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
2991 (WebCore::ResourceHandle::didStartRequest):
2992 (WebCore::ResourceHandle::start):
2993 (WebCore::ResourceHandle::releaseForDownload):
2994 (WebCore::ResourceHandle::sendPendingRequest):
2995 (WebCore::ResourceHandle::cancel):
2996 (WebCore::ResourceHandle::shouldUseCredentialStorage):
2997 (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
2998 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2999 (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3000 (WebCore::ResourceHandle::receivedCredential):
3001 (WebCore::ResourceHandle::receivedCancellation):
3002 (WebCore::ResourceHandle::receivedChallengeRejection):
3003 (WebCore::ResourceHandle::platformSetDefersLoading):
3004 (WebCore::sessionFromContext): Deleted.
3005 (WebCore::ResourceHandle::create): Deleted.
3006 (WebCore::ResourceHandle::ResourceHandle): Deleted.
3007 (WebCore::isAuthenticationFailureStatusCode): Deleted.
3008 (WebCore::tlsErrorsChangedCallback): Deleted.
3009 (WebCore::gotHeadersCallback): Deleted.
3010 (WebCore::applyAuthenticationToRequest): Deleted.
3011 (WebCore::restartedCallback): Deleted.
3012 (WebCore::shouldRedirect): Deleted.
3013 (WebCore::shouldRedirectAsGET): Deleted.
3014 (WebCore::continueAfterWillSendRequest): Deleted.
3015 (WebCore::doRedirect): Deleted.
3016 (WebCore::redirectSkipCallback): Deleted.
3017 (WebCore::wroteBodyDataCallback): Deleted.
3018 (WebCore::cleanupSoupRequestOperation): Deleted.
3019 (WebCore::nextMultipartResponsePartCallback): Deleted.
3020 (WebCore::sendRequestCallback): Deleted.
3021 (WebCore::continueAfterDidReceiveResponse): Deleted.
3022 (WebCore::startingCallback): Deleted.
3023 (WebCore::networkEventCallback): Deleted.
3024 (WebCore::createSoupMessageForHandleAndRequest): Deleted.
3025 (WebCore::createSoupRequestAndMessageForHandle): Deleted.
3026 (WebCore::ResourceHandle::timeoutFired): Deleted.
3027 (WebCore::waitingToSendRequest): Deleted.
3028 (WebCore::readCallback): Deleted.
3030 2018-04-03 Ross Kirsling <ross.kirsling@sony.com>
3032 Add missing WEBCORE_EXPORTs (for Windows shared library build)
3033 https://bugs.webkit.org/show_bug.cgi?id=184279
3035 Reviewed by Alex Christensen.
3039 * editing/FrameSelection.h:
3041 * html/HTMLFormElement.h:
3042 * html/canvas/CanvasRenderingContext.h:
3043 * platform/graphics/GraphicsContext.h:
3044 * platform/graphics/PlatformDisplay.h:
3045 * platform/graphics/cairo/CairoOperations.h:
3046 * platform/graphics/cairo/GraphicsContextImplCairo.h:
3047 * platform/graphics/texmap/TextureMapperLayer.h:
3048 * platform/network/HTTPHeaderMap.h:
3049 * platform/network/ResourceRequestBase.h:
3050 * platform/network/ResourceResponseBase.h:
3051 * platform/network/curl/AuthenticationChallenge.h:
3052 * platform/network/curl/CurlFormDataStream.h:
3053 * platform/network/curl/CurlRequest.h:
3054 * platform/network/curl/CurlSSLHandle.h:
3055 * platform/network/curl/ResourceError.h:
3056 * platform/network/curl/ResourceResponse.h:
3058 2018-04-03 Youenn Fablet <youenn@apple.com>
3060 RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
3061 https://bugs.webkit.org/show_bug.cgi?id=184281
3062 rdar://problem/39153262
3064 Reviewed by Jer Noble.
3066 Covered by manual testing by going to WebRTC web sites.
3068 * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3069 (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
3071 2018-04-03 Filip Pizlo <fpizlo@apple.com>
3073 GC shouldn't do object distancing
3074 https://bugs.webkit.org/show_bug.cgi?id=184195
3076 Reviewed by Saam Barati.
3078 No new tests because no change in behavior.
3081 * WebCore.xcodeproj/project.pbxproj:
3082 * bindings/js/JSDOMGlobalObject.cpp:
3083 (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
3084 * bindings/js/JSDOMGlobalObject.h:
3085 * bindings/js/JSDOMWindowBase.cpp:
3086 (WebCore::JSDOMWindowBase::JSDOMWindowBase):
3088 (WebCore::Document::threadLocalCache): Deleted.
3090 * page/OriginThreadLocalCache.cpp: Removed.
3091 * page/OriginThreadLocalCache.h: Removed.
3093 2018-04-03 Brent Fulgham <bfulgham@apple.com>
3095 Guard against keychain/certificate access outside the network process
3096 https://bugs.webkit.org/show_bug.cgi?id=184214
3097 <rdar://problem/38734795>
3099 Reviewed by Youenn Fablet.
3101 Use the ProcessPrivilege assertions to guard against accessing the Keychain from
3102 a non-Networking process.
3104 * Modules/webauthn/cocoa/LocalAuthenticator.mm:
3105 (WebCore::LocalAuthenticator::makeCredential): Assert if we access the keychain from
3106 a proces other than the Network or UI process.
3107 (WebCore::LocalAuthenticator::getAssertion): Ditto.
3108 (WebCore::LocalAuthenticator::issueClientCertificate const): Ditto.
3109 * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3110 (WebCore::createAndStoreMasterKey): Ditto.
3111 (WebCore::findMasterKey): Ditto.
3112 (WebCore::deleteDefaultWebCryptoMasterKey): Ditto.
3113 * platform/mac/SSLKeyGeneratorMac.mm:
3114 (WebCore::signedPublicKeyAndChallengeString): Ditto.
3115 * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3116 (WebCore::createPrivateStorageSession): Ditto.
3117 * platform/network/mac/ResourceHandleMac.mm:
3118 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto.
3120 2018-04-03 Youenn Fablet <youenn@apple.com>
3122 NetworkResourceLoader does not need to expose all redirect response headers
3123 https://bugs.webkit.org/show_bug.cgi?id=184114
3124 <rdar://problem/39010557>
3126 Reviewed by Ryosuke Niwa.
3128 No JS observable change of behavior.
3129 Behavior change is observable for injected bundles since they will no longer get access to the full response.
3130 List of response headers correspond to the one currently being used/exposed for redirections.
3132 Test: http/wpt/loading/redirect-headers.html
3134 * page/RuntimeEnabledFeatures.h:
3135 (WebCore::RuntimeEnabledFeatures::setRestrictedHTTPResponseAccess):
3136 (WebCore::RuntimeEnabledFeatures::restrictedHTTPResponseAccess const):
3137 * platform/network/ResourceResponseBase.cpp:
3138 (WebCore::isSafeToKeepRedirectionHeader):
3139 (WebCore::ResourceResponseBase::sanitizeRedirectionHTTPHeaderFields):
3140 * platform/network/ResourceResponseBase.h:
3142 2018-04-03 Andy Estes <aestes@apple.com>
3144 [Mac] Prioritize file promises over filenames during drag and drop
3145 https://bugs.webkit.org/show_bug.cgi?id=184237
3146 <rdar://problem/38278076>
3148 Reviewed by Wenson Hsieh.
3150 When performing a drag operation where the pasteboard contains both a file path and a file
3151 promise, we have historically preferred to accept the file path. Some versions of Photos.app
3152 will provide both a low-resolution thumbnail as a file path and its high-resolution
3153 counterpart as a file promise when dragging a photo, and our current logic leads us to
3154 choose the low-quality thumbnail.
3156 This patch changes our logic to prefer file promises over file paths. This matches the
3157 behavior of Finder and ensures we accept high-resolution assets from Photos.app.
3159 Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
3160 write a bogus file path to the pasteboard along with the legitimate file promise.
3162 * platform/mac/DragDataMac.mm:
3163 (WebCore::DragData::asFilenames const):
3164 * platform/mac/PasteboardMac.mm:
3165 (WebCore::Pasteboard::read):
3166 (WebCore::Pasteboard::readFilePaths):
3167 * platform/mac/PlatformPasteboardMac.mm:
3168 (WebCore::PlatformPasteboard::numberOfFiles const):
3170 2018-04-03 Mark Lam <mark.lam@apple.com>
3172 Fix mis-application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro.
3173 https://bugs.webkit.org/show_bug.cgi?id=184276
3174 <rdar://problem/39109543>
3176 Rubber-stamped by Michael Saboff.
3178 * bindings/scripts/CodeGeneratorJS.pm:
3179 (GenerateImplementation):
3180 * bindings/scripts/test/JS/JSInterfaceName.cpp:
3181 (WebCore::toJSNewlyCreated):
3182 * bindings/scripts/test/JS/JSMapLike.cpp:
3183 (WebCore::toJSNewlyCreated):
3184 * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3185 (WebCore::toJSNewlyCreated):
3186 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3187 (WebCore::toJSNewlyCreated):
3188 * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3189 (WebCore::toJSNewlyCreated):
3190 * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3191 (WebCore::toJSNewlyCreated):
3192 * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3193 (WebCore::toJSNewlyCreated):
3194 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3195 (WebCore::toJSNewlyCreated):
3196 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3197 (WebCore::toJSNewlyCreated):
3198 * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3199 (WebCore::toJSNewlyCreated):
3200 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3201 (WebCore::toJSNewlyCreated):
3202 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3203 (WebCore::toJSNewlyCreated):
3204 * bindings/scripts/test/JS/JSTestException.cpp:
3205 (WebCore::toJSNewlyCreated):
3206 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3207 (WebCore::toJSNewlyCreated):
3208 * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3209 (WebCore::toJSNewlyCreated):
3210 * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3211 (WebCore::toJSNewlyCreated):
3212 * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3213 (WebCore::toJSNewlyCreated):
3214 * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3215 (WebCore::toJSNewlyCreated):
3216 * bindings/scripts/test/JS/JSTestIterable.cpp:
3217 (WebCore::toJSNewlyCreated):
3218 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3219 (WebCore::toJSNewlyCreated):
3220 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3221 (WebCore::toJSNewlyCreated):
3222 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3223 (WebCore::toJSNewlyCreated):
3224 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3225 (WebCore::toJSNewlyCreated):
3226 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3227 (WebCore::toJSNewlyCreated):
3228 * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3229 (WebCore::toJSNewlyCreated):
3230 * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3231 (WebCore::toJSNewlyCreated):
3232 * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3233 (WebCore::toJSNewlyCreated):
3234 * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3235 (WebCore::toJSNewlyCreated):
3236 * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3237 (WebCore::toJSNewlyCreated):
3238 * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3239 (WebCore::toJSNewlyCreated):
3240 * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3241 (WebCore::toJSNewlyCreated):
3242 * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3243 (WebCore::toJSNewlyCreated):
3244 * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3245 (WebCore::toJSNewlyCreated):
3246 * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3247 (WebCore::toJSNewlyCreated):
3248 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3249 (WebCore::toJSNewlyCreated):
3250 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3251 (WebCore::toJSNewlyCreated):
3252 * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3253 (WebCore::toJSNewlyCreated):
3254 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3255 (WebCore::toJSNewlyCreated):
3256 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3257 (WebCore::toJSNewlyCreated):
3258 * bindings/scripts/test/JS/JSTestNode.cpp:
3259 (WebCore::toJSNewlyCreated):
3260 * bindings/scripts/test/JS/JSTestObj.cpp:
3261 (WebCore::toJSNewlyCreated):
3262 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3263 (WebCore::toJSNewlyCreated):
3264 * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3265 (WebCore::toJSNewlyCreated):
3266 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3267 (WebCore::toJSNewlyCreated):
3268 * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3269 (WebCore::toJSNewlyCreated):
3270 * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3271 (WebCore::toJSNewlyCreated):
3272 * bindings/scripts/test/JS/JSTestSerialization.cpp:
3273 (WebCore::toJSNewlyCreated):
3274 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3275 (WebCore::toJSNewlyCreated):
3276 * bindings/scripts/test/JS/JSTestStringifier.cpp:
3277 (WebCore::toJSNewlyCreated):
3278 * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3279 (WebCore::toJSNewlyCreated):
3280 * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3281 (WebCore::toJSNewlyCreated):
3282 * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3283 (WebCore::toJSNewlyCreated):
3284 * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3285 (WebCore::toJSNewlyCreated):
3286 * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3287 (WebCore::toJSNewlyCreated):
3288 * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3289 (WebCore::toJSNewlyCreated):
3290 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3291 (WebCore::toJSNewlyCreated):
3293 2018-04-03 Yousuke Kimoto <yousuke.kimoto@sony.com>
3295 [CMake] gperf path should be given when WebCore/css/makevalues.pl is executed
3296 https://bugs.webkit.org/show_bug.cgi?id=184224
3298 Reviewed by Konstantin Tokarev.
3300 When a building evironment doens't include a path to gperf,
3301 WebCore/css/makevalue.pl failes due to failing to execute gperf,
3302 so the full path to gperf should be given like WebCore/css/makeprop.pl.
3304 No new tests, no Web-facing behavior change.
3306 * CMakeLists.txt: gperf path is given to css/makevalues.pl.
3307 * css/makevalues.pl: Add an argument to handle a given gperf path.
3309 2018-04-03 Chris Dumez <cdumez@apple.com>
3311 Drop MainFrame class
3312 https://bugs.webkit.org/show_bug.cgi?id=184191
3314 Reviewed by Darin Adler.
3316 Drop MainFrame class and move contents into Page / Frame since there is a 1:1
3317 relationship between the Page and the MainFrame.
3319 This is ground work for introducing LocalFrame / RemoteFrame concepts.
3321 * Modules/applepay/ApplePaySession.cpp:
3322 (WebCore::ApplePaySession::create):
3323 (WebCore::ApplePaySession::supportsVersion):
3324 (WebCore::ApplePaySession::canMakePayments):
3325 (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
3326 (WebCore::ApplePaySession::openPaymentSetup):
3327 (WebCore::ApplePaySession::paymentCoordinator const):
3328 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3329 (WebCore::paymentCoordinator):
3330 * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
3331 * Modules/mediastream/UserMediaRequest.cpp:
3332 * Modules/plugins/QuickTimePluginReplacement.mm:
3334 * WebCore.xcodeproj/project.pbxproj:
3335 * accessibility/AccessibilityObject.cpp:
3336 (WebCore::AccessibilityObject::mainFrame const):
3337 (WebCore::AccessibilityObject::visiblePositionForBounds const):
3338 * accessibility/AccessibilityObject.h:
3339 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3340 * bindings/js/ScriptController.cpp:
3341 * bindings/js/ScriptState.cpp:
3342 * contentextensions/ContentExtensionsBackend.cpp:
3343 * css/MediaQueryEvaluator.cpp:
3344 (WebCore::displayModeEvaluate):
3345 * dom/DOMImplementation.cpp:
3347 * dom/DocumentMarkerController.cpp:
3349 (WebCore::Element::removedFromAncestor):
3350 * dom/EventDispatcher.cpp:
3351 * dom/ScriptedAnimationController.cpp:
3352 * editing/Editor.cpp:
3353 (WebCore::Editor::scanSelectionForTelephoneNumbers):
3354 * editing/EditorCommand.cpp:
3355 * editing/SelectionRectGatherer.cpp:
3356 (WebCore::SelectionRectGatherer::Notifier::~Notifier):
3357 * editing/cocoa/WebContentReaderCocoa.mm:
3358 * editing/markup.cpp:
3359 * history/CachedFrame.cpp:
3360 * history/CachedPage.cpp:
3361 * history/PageCache.cpp:
3362 (WebCore::destroyRenderTree):
3363 * html/HTMLMediaElement.cpp:
3364 * html/HTMLPlugInImageElement.cpp:
3365 * html/ImageDocument.cpp:
3366 * html/MediaElementSession.cpp:
3367 (WebCore::isMainContentForPurposesOfAutoplay):
3368 * html/canvas/WebGLRenderingContextBase.cpp:
3369 * inspector/InspectorClient.cpp:
3370 * inspector/InspectorController.cpp:
3371 * inspector/InspectorFrontendClientLocal.cpp:
3372 * inspector/InspectorFrontendHost.cpp:
3373 * inspector/InspectorInstrumentation.cpp:
3374 * inspector/InspectorOverlay.cpp:
3375 * inspector/PageScriptDebugServer.cpp:
3376 * inspector/agents/InspectorApplicationCacheAgent.cpp:
3377 * inspector/agents/InspectorCanvasAgent.cpp:
3378 * inspector/agents/InspectorDOMAgent.cpp:
3379 * inspector/agents/InspectorPageAgent.cpp:
3380 (WebCore::InspectorPageAgent::mainFrame):
3381 * inspector/agents/InspectorPageAgent.h:
3382 * inspector/agents/page/PageDebuggerAgent.cpp:
3383 * inspector/agents/page/PageRuntimeAgent.cpp:
3384 * loader/DocumentLoader.cpp:
3385 * loader/DocumentWriter.cpp:
3386 * loader/FrameLoader.cpp:
3387 (WebCore::FrameLoader::loadWithDocumentLoader):
3388 (WebCore::FrameLoader::setState):
3389 * loader/HistoryController.cpp:
3390 * loader/NavigationDisabler.h:
3391 * loader/ProgressTracker.cpp:
3392 * loader/ResourceLoadObserver.cpp:
3393 * loader/ResourceLoader.cpp:
3394 * loader/SubframeLoader.cpp:
3395 * loader/SubresourceLoader.cpp:
3396 * loader/appcache/ApplicationCacheHost.cpp:
3397 * loader/archive/mhtml/MHTMLArchive.cpp:
3398 * loader/cache/CachedResource.cpp:
3399 * loader/cache/CachedResourceLoader.cpp:
3400 * page/AutoscrollController.cpp:
3402 * page/ContextMenuController.cpp:
3403 * page/DOMWindow.cpp:
3404 * page/DebugPageOverlays.cpp:
3405 (WebCore::MouseWheelRegionOverlay::updateRegion):
3406 (WebCore::NonFastScrollableRegionOverlay::updateRegion):
3407 (WebCore::RegionOverlay::create):
3408 (WebCore::RegionOverlay::RegionOverlay):
3409 (WebCore::RegionOverlay::~RegionOverlay):
3410 (WebCore::DebugPageOverlays::ensureRegionOverlayForPage):
3411 (WebCore::DebugPageOverlays::showRegionOverlay):
3412 (WebCore::DebugPageOverlays::hideRegionOverlay):
3413 (WebCore::DebugPageOverlays::regionChanged):
3414 (WebCore::DebugPageOverlays::regionOverlayForPage const):
3415 (WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
3416 (WebCore::DebugPageOverlays::settingsChanged):
3417 * page/DebugPageOverlays.h:
3418 (WebCore::DebugPageOverlays::hasOverlaysForPage const):
3419 (WebCore::DebugPageOverlays::hasOverlays):
3420 (WebCore::DebugPageOverlays::didLayout):
3421 (WebCore::DebugPageOverlays::didChangeEventHandlers):
3422 * page/DragController.cpp:
3423 (WebCore::DragController::performDragOperation):
3424 (WebCore::DragController::tryDHTMLDrag):
3425 (WebCore::DragController::beginDrag):
3426 (WebCore::DragController::doSystemDrag):
3427 * page/EventHandler.cpp:
3428 (WebCore::EventHandler::handleMousePressEvent):
3429 (WebCore::EventHandler::mouseMoved):
3430 (WebCore::EventHandler::handleMouseReleaseEvent):
3431 (WebCore::EventHandler::handleWheelEvent):
3432 (WebCore::EventHandler::clearLatchedState):
3433 (WebCore::EventHandler::defaultWheelEventHandler):
3434 * page/FocusController.cpp:
3436 (WebCore::Frame::Frame):
3437 (WebCore::Frame::dropChildren):
3438 (WebCore::Frame::selfOnlyRef):
3439 (WebCore::Frame::selfOnlyDeref):
3441 (WebCore::Frame::mainFrame const):
3442 * page/FrameTree.cpp:
3443 * page/FrameView.cpp:
3444 (WebCore::FrameView::setFrameRect):
3445 (WebCore::FrameView::setContentsSize):
3446 (WebCore::FrameView::didChangeScrollOffset):
3447 (WebCore::FrameView::setViewExposedRect):
3449 * page/MainFrame.cpp: Removed.
3450 * page/MainFrame.h: Removed.
3451 * page/MemoryRelease.cpp:
3453 (WebCore::Page::Page):
3454 (WebCore::m_applicationManifest):
3455 (WebCore::Page::setDeviceScaleFactor):
3456 (WebCore::Page::latchingState):
3457 (WebCore::Page::pushNewLatchingState):
3458 (WebCore::Page::resetLatchingState):
3459 (WebCore::Page::popLatchingState):
3460 (WebCore::Page::removeLatchingStateForTarget):
3461 (WebCore::Page::setPaymentCoordinator):
3463 (WebCore::Page::mainFrame):
3464 (WebCore::Page::mainFrame const):
3465 (WebCore::Page::wheelEventDeltaFilter):
3466 (WebCore::Page::pageOverlayController):
3467 (WebCore::Page::servicesOverlayController):
3468 (WebCore::Page::paymentCoordinator const):
3469 (WebCore::Page::applicationManifest const):
3470 (WebCore::Page::performanceLogging const):
3471 * page/PageConsoleClient.cpp:
3472 * page/PageDebuggable.cpp:
3473 * page/PageGroup.cpp:
3474 * page/PageGroupLoadDeferrer.cpp:
3475 * page/PageOverlay.cpp:
3476 (WebCore::PageOverlay::controller const):
3477 * page/PageOverlayController.cpp:
3478 (WebCore::PageOverlayController::PageOverlayController):
3479 (WebCore::PageOverlayController::createRootLayersIfNeeded):
3480 (WebCore::PageOverlayController::layerWithDocumentOverlays):
3481 (WebCore::PageOverlayController::layerWithViewOverlays):
3482 (WebCore::PageOverlayController::installPageOverlay):
3483 (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
3484 (WebCore::PageOverlayController::didChangeViewExposedRect):
3485 (WebCore::PageOverlayController::updateSettingsForLayer):
3486 (WebCore::PageOverlayController::deviceScaleFactor const):
3487 (WebCore::PageOverlayController::notifyFlushRequired):
3488 (WebCore::PageOverlayController::tiledBackingUsageChanged):
3489 * page/PageOverlayController.h:
3490 * page/PageSerializer.cpp:
3491 * page/PerformanceLogging.cpp:
3492 (WebCore::PerformanceLogging::PerformanceLogging):
3493 (WebCore::PerformanceLogging::didReachPointOfInterest):
3494 * page/PerformanceLogging.h:
3495 * page/PerformanceMonitor.cpp:
3496 * page/ResourceUsageOverlay.cpp:
3497 (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay):
3498 (WebCore::ResourceUsageOverlay::initialize):
3499 * page/SettingsBase.cpp:
3500 * page/SpatialNavigation.cpp:
3501 * page/UserContentProvider.cpp:
3502 * page/ios/FrameIOS.mm:
3503 * page/mac/DragControllerMac.mm:
3504 * page/mac/EventHandlerMac.mm:
3505 (WebCore::latchingIsLockedToPlatformFrame):
3506 (WebCore::latchingIsLockedToAncestorOfThisFrame):
3507 (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
3508 (WebCore::EventHandler::platformPrepareForWheelEvents):
3509 (WebCore::EventHandler::platformRecordWheelEvent):
3510 (WebCore::EventHandler::platformCompleteWheelEvent):
3511 (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent):
3512 * page/mac/PageMac.mm:
3513 * page/mac/ServicesOverlayController.h:
3514 (WebCore::ServicesOverlayController::page const):
3515 * page/mac/ServicesOverlayController.mm:
3516 (WebCore::ServicesOverlayController::Highlight::Highlight):
3517 (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
3518 (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const):
3519 (WebCore::ServicesOverlayController::ServicesOverlayController):
3520 (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
3521 (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
3522 (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const):
3523 (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
3524 (WebCore::ServicesOverlayController::buildSelectionHighlight):
3525 (WebCore::ServicesOverlayController::hasRelevantSelectionServices):
3526 (WebCore::ServicesOverlayController::createOverlayIfNeeded):
3527 (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame):
3528 (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
3529 (WebCore::ServicesOverlayController::mouseEvent):
3530 (WebCore::ServicesOverlayController::handleClick):
3531 (WebCore::ServicesOverlayController::mainFrame const):
3532 * page/scrolling/AsyncScrollingCoordinator.cpp:
3533 * page/scrolling/ScrollingCoordinator.cpp:
3534 * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
3535 * page/scrolling/mac/ScrollingCoordinatorMac.mm:
3536 * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3537 * plugins/DOMMimeType.cpp:
3538 * plugins/PluginInfoProvider.cpp:
3539 (WebCore::PluginInfoProvider::refresh):
3540 * rendering/RenderBox.cpp:
3541 * rendering/RenderLayer.cpp:
3542 * rendering/RenderLayerBacking.cpp:
3543 * rendering/RenderLayerCompositor.cpp:
3544 (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const):
3545 (WebCore::RenderLayerCompositor::updateCompositingLayers):
3546 (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3547 (WebCore::RenderLayerCompositor::attachRootLayer):
3548 (WebCore::RenderLayerCompositor::detachRootLayer):
3549 (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
3550 * rendering/RenderObject.cpp:
3551 * replay/UserInputBridge.cpp:
3552 * storage/StorageEventDispatcher.cpp:
3553 * style/StyleTreeResolver.cpp:
3554 (WebCore::Style::suspendMemoryCacheClientCalls):
3555 * svg/SVGSVGElement.cpp:
3556 * svg/graphics/SVGImage.cpp:
3557 * testing/InternalSettings.cpp:
3558 * testing/Internals.cpp:
3559 (WebCore::Internals::Internals):
3560 (WebCore::Internals::installMockPageOverlay):
3561 (WebCore::Internals::pageOverlayLayerTreeAsText const):
3562 * testing/MockPageOverlay.cpp:
3563 * testing/MockPageOverlay.h:
3564 * testing/MockPageOverlayClient.cpp:
3565 (WebCore::MockPageOverlayClient::installOverlay):
3566 (WebCore::MockPageOverlayClient::layerTreeAsText):
3567 * testing/MockPageOverlayClient.h:
3568 * testing/MockPaymentCoordinator.cpp:
3569 (WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
3570 (WebCore::MockPaymentCoordinator::showPaymentUI):
3571 (WebCore::MockPaymentCoordinator::completeMerchantValidation):
3572 (WebCore::MockPaymentCoordinator::changeShippingOption):
3573 (WebCore::MockPaymentCoordinator::changePaymentMethod):
3574 (WebCore::MockPaymentCoordinator::acceptPayment):
3575 (WebCore::MockPaymentCoordinator::cancelPayment):
3576 * testing/MockPaymentCoordinator.h:
3577 * workers/service/context/ServiceWorkerThreadProxy.cpp:
3579 2018-04-03 Sihui Liu <sihui_liu@apple.com>
3581 The referer header is not set after redirect
3582 https://bugs.webkit.org/show_bug.cgi?id=182644
3583 <rdar://problem/37479048>
3585 Reviewed by Youenn Fablet.
3587 Update referrer policy and recompute referrer in redirection check, so Referer header would be set after it's removed from cross-origin request.
3589 Add support for Referrer-Policy header, so referrer policy would be changed based on redirect response.
3592 * WebCore.xcodeproj/project.pbxproj:
3594 (WebCore::Document::processReferrerPolicy):
3595 * loader/CrossOriginAccessControl.cpp:
3596 (WebCore::updateRequestReferrer):
3597 * loader/CrossOriginAccessControl.h:
3598 * loader/ResourceLoader.h:
3599 (WebCore::ResourceLoader::setReferrerPolicy):
3600 (WebCore::ResourceLoader::referrerPolicy const):
3601 * loader/SubresourceLoader.cpp:
3602 (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
3603 (WebCore::SubresourceLoader::updateReferrerPolicy):
3604 * loader/SubresourceLoader.h:
3605 * loader/cache/CachedResourceRequest.cpp:
3606 (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
3607 (WebCore::CachedResourceRequest::updateForAccessControl):
3608 (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
3609 * platform/ReferrerPolicy.cpp: Added.
3610 (WebCore::parseReferrerPolicy):
3611 * platform/ReferrerPolicy.h:
3612 * platform/network/HTTPHeaderNames.in:
3614 2018-04-03 Chris Dumez <cdumez@apple.com>
3616 Make SecurityOrigin safe to create and use from any thread
3617 https://bugs.webkit.org/show_bug.cgi?id=184216
3619 Reviewed by Youenn Fablet.
3621 We found that we have a decent amount of code constructing and using SecurityOrigin
3622 objects from non-main threads. Unfortunately, this was not safe, mostly due to
3623 SecurityOrigin's reliance on the SchemeRegistry.
3625 This patch makes it safe to construct a SecurityOrigin on any thread A and use
3626 it later on the same thread A. However, developers still need to call isolatedCopy()
3627 if they want to pass such object to another thread B.
3629 * page/SecurityOrigin.cpp:
3630 (WebCore::SecurityOrigin::canDisplay const):
3631 * page/SecurityOrigin.h:
3632 * page/SecurityPolicy.cpp:
3633 (WebCore::originAccessMapLock):
3634 (WebCore::originAccessMap):
3635 (WebCore::SecurityPolicy::isAccessWhiteListed):
3636 (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
3637 (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
3638 (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
3639 * platform/SchemeRegistry.cpp:
3640 (WebCore::schemeRegistryLock):
3641 (WebCore::allBuiltinSchemes):
3642 (WebCore::builtinLocalURLSchemes):
3643 (WebCore::localURLSchemes):
3644 (WebCore::displayIsolatedURLSchemes):
3645 (WebCore::builtinSecureSchemes):
3646 (WebCore::secureSchemes):
3647 (WebCore::builtinSchemesWithUniqueOrigins):
3648 (WebCore::schemesWithUniqueOrigins):
3649 (WebCore::builtinEmptyDocumentSchemes):
3650 (WebCore::emptyDocumentSchemes):
3651 (WebCore::schemesForbiddenFromDomainRelaxation):
3652 (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
3653 (WebCore::canDisplayOnlyIfCanRequestSchemes):
3654 (WebCore::notAllowingJavascriptURLsSchemes):
3655 (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
3656 (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
3657 (WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing):
3658 (WebCore::schemesAllowingDatabaseAccessInPrivateBrowsing):
3659 (WebCore::builtinCORSEnabledSchemes):
3660 (WebCore::CORSEnabledSchemes):
3661 (WebCore::ContentSecurityPolicyBypassingSchemes):
3662 (WebCore::cachePartitioningSchemes):
3663 (WebCore::serviceWorkerSchemes):
3664 (WebCore::alwaysRevalidatedSchemes):
3665 (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
3666 (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
3667 (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
3668 (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
3669 (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
3670 (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
3671 (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
3672 (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
3673 (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
3674 (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
3675 (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
3676 (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
3677 (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
3678 (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
3679 (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
3680 (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
3681 (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
3682 * platform/SchemeRegistry.h:
3684 2018-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
3686 [SOUP] Stop using ResourceHandle to load GResources
3687 https://bugs.webkit.org/show_bug.cgi?id=184259
3689 Reviewed by Sergio Villar Senin.
3691 GResources are loaded in the WebProcess using ResourceHandle because soup handles them transparently. But now
3692 that we no longer use ResourceHandle, we can add a simple loader for GResources, similar to the one used for
3693 data URLS, since loading a GResource is a matter of calling g_resources_lookup_data() in the end.
3697 * loader/ResourceLoader.cpp:
3698 (WebCore::ResourceLoader::start): Check if resource to load is a GResource and call loadGResource().
3699 * loader/ResourceLoader.h:
3700 * loader/soup/ResourceLoaderSoup.cpp: Added.
3701 (WebCore::ResourceLoader::loadGResource): Load the GResource in a GTask thread.
3702 * platform/SharedBuffer.cpp:
3703 (WebCore::SharedBuffer::DataSegment::data const):
3704 (WebCore::SharedBuffer::DataSegment::size const):
3705 * platform/SharedBuffer.h:
3706 * platform/glib/SharedBufferGlib.cpp:
3707 (WebCore::SharedBuffer::SharedBuffer):
3708 (WebCore::SharedBuffer::create):
3710 2018-04-02 Carlos Garcia Campos <cgarcia@igalia.com>
3712 [Enchant] Clean up TextCheckerEnchant
3713 https://bugs.webkit.org/show_bug.cgi?id=184233
3715 Reviewed by Michael Catanzaro.
3717 Several cleanups and improvements:
3719 * platform/text/enchant/TextCheckerEnchant.cpp:
3720 (WebCore::TextCheckerEnchant::singleton): Make TextCheckerEnchant a singleton since it's always used as a
3722 (WebCore::TextCheckerEnchant::EnchantDictDeleter::operator() const):
3723 (WebCore::TextCheckerEnchant::TextCheckerEnchant):
3724 (WebCore::TextCheckerEnchant::ignoreWord): Convert to utf8 once instead of on every loop iteration.
3725 (WebCore::TextCheckerEnchant::learnWord): Ditton.
3726 (WebCore::TextCheckerEnchant::checkSpellingOfWord): m_enchantDictionaries is now a Vector of std::unique_ptr.
3727 (WebCore::TextCheckerEnchant::getGuessesForWord): Convert to utf8 once instead of on every loop iteration.
3728 (WebCore::TextCheckerEnchant::updateSpellCheckingLanguages): Get only the first language instead of building a
3729 vector to get its first item. Use WTFMove to replace m_enchantDictionaries with the new Vector.
3730 (WebCore::TextCheckerEnchant::loadedSpellCheckingLanguages const): Use a lambda to get the list of languages
3731 already converted to String and iterate only once.
3732 (WebCore::TextCheckerEnchant::availableSpellCheckingLanguages const): Ditto.
3733 (WebCore::enchantDictDescribeCallback): Deleted.
3734 (WebCore::TextCheckerEnchant::~TextCheckerEnchant): Deleted.
3735 (WebCore::TextCheckerEnchant::freeEnchantBrokerDictionaries): Deleted.
3736 * platform/text/enchant/TextCheckerEnchant.h:
3738 2018-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
3740 [GTK] Segfaults in enchant_broker_free_dict()
3741 https://bugs.webkit.org/show_bug.cgi?id=183738
3743 Reviewed by Michael Catanzaro.
3745 Check enchant_broker_request_dict() didn't return nullptr before adding it to the m_enchantDictionaries vector.
3747 * platform/text/enchant/TextCheckerEnchant.cpp:
3748 (WebCore::TextCheckerEnchant::updateSpellCheckingLanguages):
3750 2018-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
3752 [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
3753 https://bugs.webkit.org/show_bug.cgi?id=183346
3755 Reviewed by Michael Catanzaro.
3757 This might happen if a request is cancelled right after the password request starts and before it finishes. We
3758 should cancel the password search when the network request is cancelled, not only when the NetworkStorageSession
3761 * platform/network/NetworkStorageSession.h:
3762 * platform/network/soup/NetworkStorageSessionSoup.cpp:
3763 (WebCore::NetworkStorageSession::~NetworkStorageSession):
3764 (WebCore::SecretServiceSearchData::SecretServiceSearchData): Helper struct to keep the request cancellable and
3766 (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage): Create a SecretServiceSearchData for the
3768 * platform/network/soup/ResourceHandleSoup.cpp:
3769 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Pass the request cancellable to
3770 NetworkStorageSession::getCredentialFromPersistentStorage().
3772 2018-04-02 Eric Carlson <eric.carlson@apple.com>
3774 [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
3775 https://bugs.webkit.org/show_bug.cgi?id=184188
3776 <rdar://problem/38940307>
3778 Reviewed by Youenn Fablet.
3780 * html/HTMLMediaElement.cpp:
3781 (WebCore::HTMLMediaElement::willExitFullscreen):
3782 * html/HTMLMediaElement.h:
3783 * platform/cocoa/VideoFullscreenChangeObserver.h:
3784 * platform/cocoa/VideoFullscreenModelVideoElement.h:
3785 * platform/cocoa/VideoFullscreenModelVideoElement.mm:
3786 (VideoFullscreenModelVideoElement::willExitFullscreen):
3787 * platform/graphics/MediaPlayer.cpp:
3788 (WebCore::MediaPlayer::updateVideoFullscreenInlineImage):
3789 * platform/graphics/MediaPlayer.h:
3790 * platform/graphics/MediaPlayerPrivate.h:
3791 (WebCore::MediaPlayerPrivateInterface::updateVideoFullscreenInlineImage):
3792 * platform/graphics/VideoFullscreenLayerManager.h:
3793 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3794 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3795 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
3796 (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
3797 (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
3798 (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
3799 (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
3800 (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3801 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3802 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
3803 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3804 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
3805 * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
3806 * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
3807 (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
3808 (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage):
3809 (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
3810 * platform/ios/VideoFullscreenInterfaceAVKit.h:
3811 * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3812 (VideoFullscreenInterfaceAVKit::exitFullscreen):
3813 (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
3814 (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3815 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3816 (VideoFullscreenControllerContext::willExitFullscreen):
3818 2018-04-02 Eric Carlson <eric.carlson@apple.com>
3820 Define AVKit softlink macro
3821 https://bugs.webkit.org/show_bug.cgi?id=184241
3823 Reviewed by Jer Noble.
3825 No new tests, no functional change.
3827 * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3828 * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3829 * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3830 * platform/ios/WebAVPlayerController.mm:
3831 * platform/mac/PlaybackSessionInterfaceMac.mm:
3832 * platform/mac/VideoFullscreenInterfaceMac.mm:
3834 2018-04-02 Wenson Hsieh <wenson_hsieh@apple.com>
3836 [Extra zoom mode] Update date picker UI to latest specifications
3837 https://bugs.webkit.org/show_bug.cgi?id=184234
3838 <rdar://problem/38804760>
3840 Reviewed by Timothy Hatcher.
3842 Tweak localizable strings. Day, month and year labels should be fully capitalized, and there needs to be a
3843 string for the "Set" button title.
3845 * English.lproj/Localizable.strings:
3846 * platform/LocalizedStrings.cpp:
3847 (WebCore::datePickerSetButtonTitle):
3848 (WebCore::datePickerDayLabelTitle):
3849 (WebCore::datePickerMonthLabelTitle):
3850 (WebCore::datePickerYearLabelTitle):
3851 * platform/LocalizedStrings.h:
3853 2018-04-02 Ryosuke Niwa <rniwa@webkit.org>
3855 REGRESSION(r228260):WebHTMLView beeps at every keydown for Chinese/Japanese/Korean Input Method
3856 https://bugs.webkit.org/show_bug.cgi?id=184231
3858 Reviewed by Alexey Proskuryakov.
3860 The bug was caused by EventHandler::internalKeyEvent calling setDefaultHandled and expecting it to stay true
3861 after dispatching the event even though m_defaultHandled is always cleared after r228260. This results in
3862 EventHandler::internalKeyEvent returning false, and resulting in a beep.
3864 Unfortunately, no new tests since there is no facility to detect this case in layout tests, and we can't
3865 easily emulate or trigger a real input method in API tests.
3867 * page/EventHandler.cpp:
3868 (WebCore::EventHandler::internalKeyEvent):
3870 2018-04-02 Jer Noble <jer.noble@apple.com>
3872 AudioBufferSourceNode start method causes OfflineAudioContext to start running
3873 https://bugs.webkit.org/show_bug.cgi?id=181939
3874 <rdar://problem/36755393>
3876 Reviewed by Eric Carlson.
3878 Test: webaudio/offlineaudiocontext-restriction.html
3880 Don't respect playback restrictions for offline AudioContexts.
3882 * Modules/webaudio/AudioContext.cpp:
3883 (WebCore::AudioContext::constructCommon):
3884 * Modules/webaudio/AudioContext.h:
3885 (WebCore::AudioContext::isOfflineContext const):
3886 (WebCore::AudioContext::userGestureRequiredForAudioStart const):
3887 (WebCore::AudioContext::pageConsentRequiredForAudioStart const):
3888 (WebCore::AudioContext::isOfflineContext): Deleted.
3890 2018-04-02 Alejandro G. Castro <alex@igalia.com>
3892 [GTK] Make libwebrtc backend buildable for GTK port
3893 https://bugs.webkit.org/show_bug.cgi?id=178860
3895 Reviewed by Youenn Fablet.
3897 This is the first step to add webrtc support to the GTK port using
3898 the libwebrtc backend.
3900 No new tests, no new feature added, it should be tested by current
3903 * CMakeLists.txt: Add the new files to the compilation and set the
3904 new includes in the libwebrtc library.
3905 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3906 Reorder the includes alphabetically and add some that are missing.
3907 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3909 * Sources.txt: Add new file to the compilation.
3910 * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
3911 Added. Initial implementation for GTK and WPE.
3912 * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h:
3914 * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
3916 * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h:
3918 * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
3920 * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
3922 * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
3924 * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
3926 * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Added includes
3927 for the compilation.
3928 * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Added, inherit from
3929 the LibWebRTCProvider to adapt for glib.
3931 2018-04-01 Yusuke Suzuki <utatane.tea@gmail.com>
3933 Use WTF::Lock instead of GMutex
3934 https://bugs.webkit.org/show_bug.cgi?id=184227
3936 Reviewed by Saam Barati.
3938 Prefer WTF::Lock over GMutex since these locks are just protecting WebKit C++ fields.
3942 * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3943 (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
3944 (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
3945 (WebCore::AudioSourceProviderGStreamer::provideInput):
3946 (WebCore::AudioSourceProviderGStreamer::handleAudioBuffer):
3947 (WebCore::AudioSourceProviderGStreamer::clearAdapters):
3948 * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
3949 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3950 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3951 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3952 (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
3953 (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3954 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3955 (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
3956 (WebCore::MediaPlayerPrivateGStreamerBase::paint):
3957 (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
3958 (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
3959 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3960 * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: